mslehre / mas Goto Github PK
View Code? Open in Web Editor NEWMaximum Acyclic Subgraph (MAS) - Multiple Sequence Alignment (MSA) Game
Maximum Acyclic Subgraph (MAS) - Multiple Sequence Alignment (MSA) Game
Simulate S sequences of length L over the alphabet {A,C,G,T} and store them in a file.
Possible distributions:
The simulation should take place in a separate program with its own main-function.
The sequences are stored in multiple fasta file-format.
compose music that introduces the end fight
An algorithm that computes new coordinates for nodes on their horizontal axis. Design a criterion for the placement such that the game position is clear, e.g. long near-horizontal edges are avoided. The criterion could be force-directed, e.g. chosen edges pull their connected nodes together and nodes push each other away. A possible solution is using Graphviz, possibly as a library.
main Parts:
suggestion:
the arena for the end fight
Rewrite graph renderer and simplify its usage.
3 methods:
Suppose the set E of edges in the graph defined in #3 is known (which corresponds to the set of possible k-mer alignment in subsequent sequences).
Let a state S denote the currently selected and consistent subset of chosen edges. Write a class to encapsulate such a state. Add a "possibleActions" method, that outputs a list of valid moves given the current state.
Add softmax and argmax to options for learnedpolicy.
step: 2
The scaling for the graph when it's drawn should depend on the number of sequences (y dimension) and number of k-mers per sequence (x dimension).
You can use sf::View for this purpose: https://www.sfml-dev.org/tutorials/2.5/graphics-view.php
Add the score into Graphrendere.cc and update him when you set a new edge.
Given two placements (coordinates) of all nodes in a graph, make a smooth animation (with acceleration and slowing down) to go from the current one to the new one. This will e.g. be used when the player adds an edge to her edge choice, then a new placement (sE) is chosen and the transition should be animated rather than instantaneous.
step 4
Write a test for the scoring function.
In addition to the graph, create "property maps" (inspired by boost: https://www.boost.org/doc/libs/1_55_0/libs/graph/doc/using_property_maps.html) that map node indices to certain properties (2D coordinates and sf::colors)
Compute the loss on a batch or on training data (set of pairs of x,y). The loss should be output from time to time during the optimization, so one can monitor the progress of the optimization.
The documentation (https://mslehre.github.io/MAS/) still needs some work here and there. I will assign you to this issue, if your code is related.
When the game is idle, it requires ~50% of CPU time on my laptop. Maybe reconfigure the wait in the main event loop?
I just tested the sequence simulation code (at home under windows). It does produce the same sequence every time I run the program. Also the sequences are not mutated at all. I suspect that this is a seed initialization problem. Do you get different sequences for each execution of the program on your system? Do mutations work?
I researched a bit and found that std::random_device is deterministic under MINGW/Windows, but non-deterministic under linux, which is a ugly thing as we want code to be portable and work the same on every system.
As a solution I would try to not use std::random_device and set the seed using the current system time instead:
#include <chrono>
std::mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
(and remove the line with the random device)
The issue with the mutations not working might be unrelated to this. Since you generate random doubles there, you should use std::uniform_real_distribution
(https://en.cppreference.com/w/cpp/numeric/random/uniform_real_distribution) for the random mutation probability, not the random device as you currently do.
Write the code that iterates over batches of training data x and corresponding outputs y. In the example code mnist.cpp
this is the for loop over the epochs and it calls optimizer.step()
.
Exclude functionalitys out of GraphRenderer:
-State
-Seperate Eventhandler
-implement DrawNode, especially render the window in terms of the current DrawNodes
Refactoring of Agent according to comments in sH branch pull request.
Efficiency changes to getEpisode, setting LearnedPolicy as default and changing LearnedPolicy accordingly.
Figure out how to poll mouse-events with SFML, create a simple GUI with buttons like "load game" or "close game" that perform an action when clicked.
Write a class that:
More precisely:
Let for
denote the number of k-mers with at least one match in string j.
Use the SFML-Library to write code that:
You may want to start with an empty window, proceed with a single rectangle that optionally contains a string and then end up in plotting the whole k-mer graph.
This issue will define the main-function for the core program.
Create a class Agent
with a member Policy
. Implement a simple random policy, that makes valid moves (=adding an edge) until no more admissible edge remains.
The agent can utilize an instance of the "State" class already implemented.
__step 2 __
Define the sum-of-squares loss we use for regression:
Sum of squares of differences between predicted and samples values.
Implement the part that tells PyTorch to do backwards
, i.e. to compute the gradient of the loss wrt to the parameters.
We need a class Gamemaster. This class create a Graph, a State and a DrawNodes vector for the game.
Choose new parameters for the game.
3d model of final monster
MAS/src/visualization/GraphRenderer.cpp
Line 175 in d8bb90d
Bitte die Warnungen von make visualization
reparieren, z.B. mit cast.
Given two placements (coordinates) of all nodes in a graph, make a smooth animation (with acceleration and slowing down) to go from the current one to the new one. This will e.g. be used when the player adds an edge to her edge choice, then a new placement (sE) is chosen and the transition should be animated rather than instantaneous.
__step: __
Finish the Button class with a function handler.
"The button class could have a general "setFunction" method that assignes a method that is invoked on button click."
The boundary case is wrong: no two selected edges may share a node. In other words: each equivalence class of characters aligned with each other can contain at most one character from each sequence.
Line 33 in f441ea5
This is a matter of changing >
to >=
or likewise.
Also: please make the consistency check for a pair of edges a separate function, e.g.
bool consistent(Edge &e, Edge &f);
Please
Otherwise, works well already!
If we start a game, the graph is not displayed correctly. We must increase the line index by one.
Define a mapping k-mer -> color such that the selected colors are best possible distinguishable for the users eye.
Create a training set for the ML method from sJ:
(s,r)
, where r is the cumulative reward (paid only at end) and s is any state on the policy episode (rollout).step: 5
Test the performance of the training algorithm to achieve its objective: minimization of loss.
For the case of linear regression this could be done by comparing to the closed-form solution or by reporting the maximum absolute value of the gradient after the training loop has finished.
Update calcValueEstimates and related functions so that actions are not copied as boolean vectors.
Also change Episode.h accordingly, and some refactoring for RLDataset and valueMLmodel.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.