5 kyu

Basic neural networks - Machine Learning #2

Description:

Basic neural networks - Machine Learning #2

In machine learning and cognitive science, Artificial Neural Network (ANNs) are a family of models inspired by biological neural networks (the central nervous systems of animals, in particular the brain) which are used to estimate or approximate functions that can depend on a large number of inputs and are generally unknown.

In this kata series our main focus will be around (ANNs) because they are fundemental to Machine Learning. We will be useing the brain package to help us create an artificial neural network that we can use to solve simple problems. I won't go into depth about how to use brain because of the sheer amount of tutorials and examples available (I will post some below under the reference section).


Task

Your task is simple! You must use brain to process the results of a game of paper scissors rock and return the end state of the players, you will have to create training tests to train the brain, then your brain will be tested to return the correct result 100% of the time.


Input

The brain will take an array of 6, 0's and 1's

Player 1 Choice Player 2 Choice
1,0,0 Paper 1,0,0 Paper
0,1,0 Scissors 0,1,0 Scissors
0,0,1 Rock 0,0,1 Rock

The table above indicates the format of the array and what numbers indicate the choices for each player.

Output

The brain must then return the state for each player.

Player 1 State Player 2 State
0 Loss 1 Win
1 Win 0 Loss
1 Tie 1 Tie

The table above indicates the format of the array and what numbers indicate the state for each player.

IMPORTANT, It's important to note that all results will be rounded, the brain returns floating points numbers between 0 and 1, so all results will be rounded automatically.


Examples

Below are some examples of input and output expected.

Input: [1,0,0,0,0,1];
Output: [1,0];

Input: [1,0,0,1,0,0];
Output: [1,1];

Input: [0,1,0,0,0,1];
Output: [0,1];

References

stackabuse - neural networks in javascript with brain js

heatonresearch - non mathematical introduction using neural networks

Machine Learning
Neural Networks
Games
Data Science

Stats:

CreatedJun 22, 2016
PublishedJun 23, 2016
Warriors Trained400
Total Skips6
Total Code Submissions406
Total Times Completed102
JavaScript Completions102
Total Stars35
% of votes with a positive feedback rating92% of 32
Total "Very Satisfied" Votes28
Total "Somewhat Satisfied" Votes3
Total "Not Satisfied" Votes1
Total Rank Assessments6
Average Assessed Rank
5 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • matt c Avatar
  • Voile Avatar
Ad