Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let net = new brain.NeuralNetwork();
net.train([{
Input: { r: 0.03, g: 0.7, b: 0.5 },
Output: { black: 1 }
},{
Input: { r: 0.16, g: 0.09, b: 0.2 },
Output: { black: 1 }
},{
Input: { r: 0.5, b: 0.5 },
Output: { black: 1 }
}]);
let output = net.run({ r: 1, g: 0.4, b: 0 });
// [{input: [confidence, sharpness, brightness, contrast, noise, hasFace, isCeleb, etc], output: [RATING]},
{
Input: { c: 0.12, s: 0.01, b: 0.1, c: 0.1, n: 0.876, hasFace: 0, isCeleb: 0 },
Output: { rating: 1 }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.