carrot
carrot copied to clipboard
maxNodes/maxConns doesn't seem to always work
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,
}
);
Noting the old Neataptic issues here (just for quick reference):
- https://github.com/wagenaartje/neataptic/issues/128
- https://github.com/wagenaartje/neataptic/issues/130
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
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
Great. I'll jump back into my project and test it once https://github.com/liquidcarrot/carrot/issues/115 is fixed.
@dan-ryan any word on this?
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 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