carrot icon indicating copy to clipboard operation
carrot copied to clipboard

maxNodes/maxConns doesn't seem to always work

Open dan-ryan opened this issue 6 years ago • 7 comments
trafficstars

This is an old Neataptic bug that is still happening. "maxNodes" and "maxConns" don't seem to always work. After a while, they will increase over the maximum.

My 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,
    ];

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

dan-ryan avatar Apr 25 '19 04:04 dan-ryan

Noting the old Neataptic issues here (just for quick reference):

  • https://github.com/wagenaartje/neataptic/issues/128
  • https://github.com/wagenaartje/neataptic/issues/130

luiscarbonell avatar Apr 25 '19 18:04 luiscarbonell

130 is a different issue but ideally should also be fixed. I've created a separate issue here: https://github.com/liquidcarrot/carrot/issues/34

dan-ryan avatar Apr 25 '19 20:04 dan-ryan

Hey @dan-ryan! Just added some updates that I hope will be solving this bug, let me know if things are working better on your end now

christianechevarria avatar Aug 12 '19 02:08 christianechevarria

Great. I'll jump back into my project and test it once https://github.com/liquidcarrot/carrot/issues/115 is fixed.

dan-ryan avatar Aug 12 '19 03:08 dan-ryan

@dan-ryan any word on this?

christianechevarria avatar Sep 07 '19 01:09 christianechevarria

Circling back on this, while working on a full neat implementation we realized that Neataptic devised a custom method of generating offspring that doesn't inherit sizes from parents directly, this could be causing the bug

https://github.com/liquidcarrot/carrot/blob/02c90caadcdd623ebc94e6f703362bb7613ae4b8/src/architecture/network.js#L1715-L1911

christianechevarria avatar Dec 09 '19 12:12 christianechevarria

@christianechevarria Any chance you guys might be able to leverage some of the optimized and immutable-by-default Genetic Programming code from Umbrella?

I dunno whether this crossover method could be repurposed for LC, but it's solid: https://github.com/thi-ng/umbrella/blob/3a491cdff408e5bc2f5d8687c649a5b8cc1ed76c/packages/gp/src/ast.ts#L41-L88

GavinRay97 avatar Dec 09 '19 16:12 GavinRay97