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

Using "maxNodes" crashes with "No (correct) mutate method given" #128

Open
dan-ryan opened this issue Mar 26, 2018 · 6 comments
Open

Using "maxNodes" crashes with "No (correct) mutate method given" #128

dan-ryan opened this issue Mar 26, 2018 · 6 comments

Comments

@dan-ryan
Copy link

dan-ryan commented Mar 26, 2018

When using maxNodes or maxConns it crashes my app. I'm using version 1.4.7.

(node:13872) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 109)
(node:13872) UnhandledPromiseRejectionWarning: Error: No (correct) mutate method given!
at Network.mutate (D:\Git\App\App\node_modules\neataptic\src\architecture\network.js:273:13)
at Neat.mutate (D:\Git\App\App\node_modules\neataptic\src\neat.js:167:30)
at Neat.evolve (D:\Git\App\App\node_modules\neataptic\src\neat.js:110:10)
at endEvaluation (D:\Git\App\App\app.js:304:10)
at learnData (D:\Git\App\App\app.js:213:9)
at axios.get.then.response (D:\Git\App\App\app.js:153:5)
at
at process._tickCallback (internal/process/next_tick.js:118:7)
(node:13872) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 110)

Looking at the codebase, it looks like selectMutationMethod can return undefined and therefore can be passed into the mutate method which crashes.

Looks like the original pull request (https://github.com/wagenaartje/neataptic/pull/62/files) used to return nulls.

@dan-ryan
Copy link
Author

I've created PR #129. Seems to no longer crash.

@dan-ryan
Copy link
Author

How is maxNodes/maxConns/ etc meant to work? I'm still going over the maximum number I set in Neat and therefore it's overfitting.

My current settings:

    Methods.mutation.MOD_ACTIVATION.mutateOutput = false;
    Methods.mutation.MOD_ACTIVATION.allowed = [

        Methods.activation.LOGISTIC,
        Methods.activation.TANH,
        Methods.activation.STEP,
        Methods.activation.SOFTSIGN,
        Methods.activation.SINUSOID,
        Methods.activation.GAUSSIAN,
        Methods.activation.BIPOLAR,
        Methods.activation.BIPOLAR_SIGMOID,
        Methods.activation.HARD_TANH,
        Methods.activation.INVERSE,

        Methods.activation.SELU,
        Methods.activation.RELU,

        Methods.activation.BENT_IDENTITY,
        Methods.activation.IDENTITY,
        //Methods.activation.ABSOLUTE
    ];

    neat = new Neat(4, 1, null,
        {
            mutation: Methods.mutation.ALL,
            popsize: 100,
            mutationRate: 0.2,
            elitism: 10,
            //clear: true, 
            equal: true,
            network: new Architect.Random(4, 5, 1),
            provenance: 2,
            maxNodes: 7, 
            maxConns: 10,
            maxGates: 5,
        }
    );

@dan-ryan
Copy link
Author

Hey @alaa-eddine I saw you originally did the pull request for this feature. Since this project is now unmaintained, I'm hoping maybe you could see why the max settings are not working?

@christianechevarria
Copy link

Hi @dan-ryan just wanted to let you know that we're maintaining a spin-off of Neataptic, just noted this issue and incorporated your changes. We would love to add you as a contributor and give you credit:

https://github.com/liquidcarrot/carrot

hope to see you there! 👍

@dan-ryan
Copy link
Author

dan-ryan commented Apr 23, 2019

@christianechevarria Oh nice. After all these years there hasn't been another replacement for Neataptic so good to see.
I've been learning TensorFlow.js which is fast, powerful, not user-friendly and no neuroevolution. There is ml5js built on top of Tensorflow.js which is user-friendly but limited with no neuroevolution (but maybe in the future).

@dan-ryan
Copy link
Author

My pull request still didn't fix the issue that the network was going over maxNodes and maxConns. So someone should look at that.

Do you have a changelog for the differences from Neatapic to the latest version of Carrot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants