Open jnaithani opened 11 years ago
All, @warsamebashir @rkg11gupta @KBenderaa @mohammedalkhiat
Pushed code that randomly generates trees of specified depth.
The TreeTest.testGenerateTree() displays information about the randomly generated tree. This method is similar to what is shown here: http://geneticprogramming.us/The_Initial_Population.html.
There is also an alternate implementation of a binary Tree with Operand and Operator Nodes - very similar to what we have already. We have both in the repo for now - we should review, discuss, and consolidate the two today.
-Jayesh
Okay, i just pulled and will take a look. Earliest i can meet online today is around 5:00pm
I was talking to one of the classmates about ignoring the operand '0' since it adds no value to our fitness evaluation and causes alot of problems with 'divide by zero' check and constantly needing to keep a pointer of a node's particular parent. We can put it in our requirements to justify it
Warsame, @warsamebashir
Good suggestion. Evaluating the tree results in a "NaN" (not a number) error when dividing by 0. Multiplying by 0 sometimes results in the tree evaluating to 0.
The generated trees - with depth 3 - don't have always have an "X" node. That is because an arbitrary algorithm is being used to randomly generate the operand value for the node - and sometimes the generated tree only has constants (0..9). Also, a tree of depth 1 (single operand node) is possible currently, even when the max depth is specified to be greater than 1.
-Jayesh
cc: @mohammedalkhiat @KBenderaa @rkg11gupta
I think we can always make sure an 'x' node is present if we run two random generators and keep them in cycles, is the goal to always have at least 1 'x' node in the tree ? If so, we should specify it in our settings and run a test just for this catch
To clarify what i meant, we would store an 'x' probability and use the depth of the tree to determine when to generate the node.
Warsame, @warsamebashir
I modified the code to use the depth of the tree to generate GP trees with a greater probability of the 'x' node in them. Also, if trees are still being generated w/o 'x' nodes, then the the generate method re-issues a request for a new tree.
Did you and Rajesh @rkg11gupta meet online today? We need to consolidate/cleanup the tree data structures, and should try to figure how we want to mutate and cross-over the trees.
-Jayesh
cc: @mohammedalkhiat @KBenderaa
We didn't meet today and should try to figure out if we can meet either tomorrow or early next week. @jnaithani does the tree generator you have created have an option to increase/decrease the size of the tree or is it something that is fixed. To answer your question about mutation/cross over, I think this being a critical part of the selection process we should consolidate and implement together. I will take a deeper look at the data structure you have and remove our existing one since there is a great deal of duplicate work
Warsame, @warsamebashir
The tree generator can randomly generate initial population trees that will not exceed the max depth settings. It will need additional methods to support mutation and crossover.
I could meet online tomorrow later in the evening (after 5pm). Let me know if there is specific capability we need for tree creation/generation, and I can work on that. Otherwise, I will try to keep pushing ahead and work on reproduction/crossover/mutation use cases in order to build the necessary support required from the Tree/Node data structure to perform these functions.
Rajesh @rkg11gupta , Kholoud @KBenderaa , Mohammed @mohammedalkhiat - if you haven't yet, you may want to check out the source and review what we have so far. Also call or email or if you all have any questions or need help with building and executing the project code.
-Jayesh
Okay, I may be available at 5pm as well. Let me send an email to the team and see if anyone is available at that time.
I will be available @ 5
Rajesh
Sent from my iPhone
On Nov 17, 2013, at 2:03 PM, warsamebashir notifications@github.com wrote:
Okay, I may be available at 5pm as well. Let me send an email to the team and see if anyone is available at that time.
— Reply to this email directly or view it on GitHub.
All, @warsamebashir @rkg11gupta @mohammedalkhiat @KBenderaa
One way to resolve the divide by zero problem is suggested by John R. Koza, http://www.genetic-programming.com/johnkoza.html, in his book on Genetic Programming.
The solution is to perform a protected division function which returns a value of 1 when division by 0 is attempted (including 0 divided by 0), but otherwise returns the quotient of its two arguments. For now, we can try this approach.
-Jayesh
Yes, this way we can prevent infinite value returns.
Rajesh
Sent from my iPhone
On Nov 18, 2013, at 11:01 AM, jnaithani notifications@github.com wrote:
All, @warsamebashir @rkg11gupta @mohammedalkhiat @KBenderaa
One way to resolve the divide by zero problem is suggested by John R. Koza, http://www.genetic-programming.com/johnkoza.html, in his book on Genetic Programming.
The solution is to perform a protected division function which returns a value of 1 when division by 0 is attempted (including 0 divided by 0), but otherwise returns the quotient of its two arguments. For now, we can try this approach.
-Jayesh
— Reply to this email directly or view it on GitHub.
I think the first approach is better, instead of explictly checking for undefined
and returning undefined
, we should check if right node is a 0
and return numerator
Randomly generate and initialize an initial population of solutions.