WIFI
Futurice-Guest-London
ย
isitfriday
Hew Ingram
@hewingram
Thomas Ankcorn
@thomasankcorn
We are Software Engineers... not data scientists
Learnย
About Neural Networks
and how to make them with brain.js
Then put this knowledge to use in a tournament
An artificial neural network is an interconnected group of nodes, Inspired by the human brain
Test The Model
Calculate The Error
Retrain the Model
Machine learning made SUPER simple
yarn add brain.js
const net = new brain.NeuralNetwork()
net.train(trainingData)
const output = net.run(testInput)
const net = new brain.NeuralNetwork()
const trainingData = [
{
input: ...,
output: ...
},
{
input: ...,
output: ...
}
...
]
net.train(trainingData)
const output = net.run(testInput)
0
1
2
[1, -1, 0, 1, 1, 0, -1, 0, 0]
/*
Brain.js accepts training data as an array of
objects of the shape:
{
input: [],
output: [],
}
This step takes processes our training data
into that form to feed into brain.js
*/
const preparedTrainingData = trainingData.map(set => {
return {
input: set.slice(0, 9),
output: set.slice(9)
}
})
console.log('๐ Data prepared\n')
/*
Brain.js takes some config when you instantiate the NeuralNet
more details can be found in the docs
https://github.com/brainjs/brain.js
These are the defaults. Maybe they're rubbish defaults...
*/
const config = {
binaryThresh: 0.5,
hiddenLayers: [3],
activation: 'sigmoid'
};
const net = new brain.NeuralNetwork(config);
console.log('๐โโ๏ธ Start training - this could take some time...\n')
net.train(preparedTrainingData);
git clone https://github.com/lnug/AIJavascript-meetup.git
cd AIJavascript-meetup
npm i
PLS NO TRASH TALK! ๐ฆ
www.aijs.rocks
www.meowni.ca/posts/hello-tensorflow
www.github.com/tensorflow/playground
https://github.com/xviniette/FlappyLearning
https://scrimba.com/g/gneuralnetworks
Thank You!
Hew Ingram
@hewingram
Thomas Ankcorn
@thomasankcorn
AI VS
By Thomas Ankcorn
AI VS
- 160