Trying to run Neat.prototype.evolve() to train an image grey-scaling network - it fails throwing the errors shown below.
My Code
let { Neat } = carrot;
function randomColor() {
return [
Math.random() * 255, // red
Math.random() * 255, // green
Math.random() * 255 // blue
];
}
function greyScale(color) {
return [(color[0] + color[1] + color[2]) / 3]; // average "brightness"
}
let greyScaleData = Array.from({ length: 100 }, (_, i) => {
let color = randomColor();
let blackwhite = greyscale(color);
return { inputs: color, outputs: blackwhite };
});
let greyScaleNetwork = new Neat(3,1,greyScaleData);
greyScaleNetwork.evolve();
// TypeError: Cannot read property '0' of undefined
// at h.c.activate (<anonymous>:36:79239)
// at <anonymous>:36:88410
// at de (<anonymous>:36:6989)
// at Function.hr.times (<anonymous>:36:64026)
// at h.c.test (<anonymous>:36:88356)
// at a.fitness (<anonymous>:47:14935)
// at a.c.evaluate (<anonymous>:47:13886)
// at a.c.evolve (<anonymous>:47:11780)
// at <anonymous>:1:12
Screenshots
To Reproduce
Using @liquid-carrot/carrotv0.3.18-nightly
Pasted code above into console on Google Chrome Version 78.0.3904.106 (Official Build) (64-bit)
Additional Information
The stack-trace is wrangled and very difficult to trace with the obfuscated variable names.
Description
Trying to run
Neat.prototype.evolve()
to train an image grey-scaling network - it fails throwing the errors shown below.My Code
Screenshots
To Reproduce
@liquid-carrot/carrot
v0.3.18-nightly
Additional Information
The stack-trace is wrangled and very difficult to trace with the obfuscated variable names.