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

Neat.prototype.evolve() breaking in Google Chrome console #193

Open
luiscarbonell opened this issue Dec 3, 2019 · 0 comments
Open

Neat.prototype.evolve() breaking in Google Chrome console #193

luiscarbonell opened this issue Dec 3, 2019 · 0 comments
Labels
🕷️ bug Something isn't working

Comments

@luiscarbonell
Copy link
Member

Description

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

image

To Reproduce

  • Using @liquid-carrot/carrot v0.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.

@luiscarbonell luiscarbonell added the 🕷️ bug Something isn't working label Dec 3, 2019
@luiscarbonell luiscarbonell changed the title Neat.prototype.evolve() is breaking in Chrome on small dataset. Neat.prototype.evolve() breaking in Google Chrome console Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕷️ bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant