Skip to content

Instantly share code, notes, and snippets.

@barrymcgee
Created January 10, 2019 10:58
Show Gist options
  • Save barrymcgee/9fd56968572935a6bcb32e7d2e369ae8 to your computer and use it in GitHub Desktop.
Save barrymcgee/9fd56968572935a6bcb32e7d2e369ae8 to your computer and use it in GitHub Desktop.
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