Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods.Mutation.SUB_GATE causes error #6

Closed
wagenaartje opened this issue Apr 19, 2017 · 1 comment
Closed

Methods.Mutation.SUB_GATE causes error #6

wagenaartje opened this issue Apr 19, 2017 · 1 comment
Assignees
Labels

Comments

@wagenaartje
Copy link
Owner

wagenaartje commented Apr 19, 2017

Causes following error every now and then:

Uncaught TypeError: Cannot read property 'ungate' of null

This code will create that error sometimes:

var x = new Architect.Perceptron(3, 10, 3); 
for(var i = 0; i < 10000; i++){  
  var keys = Object.keys(Methods.Mutation); x.mutate(Methods.Mutation[keys[ keys.length * Math.random() << 0]])
}; 
x.activate([1,0,1]);

Will be investigated!

@wagenaartje
Copy link
Owner Author

The problem has been identified. Fix already created, doing some testing now. The probem was as follows

  1. When removing a node, new connections would be created
  2. If this happened to be a self connection, the connect() function would return the selfconnection
  3. remove() function assumed all new connections would be ungated, and would gate them
  4. Connections would be regated, while not removing the previous gate from this.gates
  5. The ungate() process would remove the wrong gates, as one connection could be present twice

A simple fix: now checking for already-gated connections! Note to future self: if already gated, should move on to next connection.

wagenaartje added a commit that referenced this issue Apr 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant