• 23

## Goal

After solving Binary neural network - Part 1, you should now know how to build a simple neural network. The training wheels are off.

** Create a single neural network, with 8 inputs and 8 outputs, that is able to solve all of the provided tests.

Note that it is likely possible to solve them in some other way. You are encouraged to try using a neural network.

Things you might want to experiment with:

- Number of hidden layers
- Number of nodes in the hidden layers
- Number of training iterations
- Learning rate

While the algorithm used to generate the data is the same for both the Tests and the Validators, the data is very different between the two, so it is entirely possible to come up with a solution that can solve all Tests, but not all Validators, or vice-versa. If this happens, I recommend playing around with the above parameters some more until you get it. It's definitely possible.
Input
Line 1: Two space-separated integers: tests and trainingSets
Next tests lines: The testInputs as an 8-digit binary number
Next trainingSets lines: Two 8-digit binary numbers. The first contains the trainingInputs, and the second contains the expectedOutputs for that set of inputs.
Output
tests lines: The output for the associated testInputs. An 8-digit binary number on each line.
Example
Input
4 80
01111010
00110111
00010010
01110011
01011011 11111111
01011011 11111111
01011111 11111111
00100001 00000000
01111011 11111111
00100001 00000000
01001110 11111111
01010111 11111111
00001000 00000000
01000101 00000000
01011001 11111111
01000110 00000000
00111010 11111111
01011010 11111111
01110111 11111111
00111010 11111111
00100001 00000000
01001000 00000000
01100111 11111111
00101111 11111111
00100001 00000000
01010110 11111111
00111001 11111111
00101100 00000000
01000000 00000000
00111011 11111111
00101111 11111111
01010101 11111111
01000110 00000000
00001100 00000000
01010110 11111111
01111111 11111111
00000100 00000000
00101011 11111111
01100110 11111111
01010101 11111111
01100110 11111111
01110001 11111111
01100111 11111111
00010001 00000000
01101011 11111111
01101101 11111111
01001101 11111111
01010000 00000000
01101111 11111111
01111111 11111111
00010101 00000000
01000110 00000000
00110111 11111111
00011110 11111111
00001101 00000000
00100111 11111111
00100010 00000000
01000010 00000000
00011000 00000000
00001111 11111111
00001111 11111111
01011011 11111111
01011011 11111111
00010111 11111111
01011001 11111111
01001100 00000000
00100011 00000000
01010010 00000000
01110101 11111111
01000011 00000000
00001100 00000000
00110000 00000000
00110111 11111111
01100100 00000000
00101100 00000000
00101100 00000000
01001101 11111111
00110101 11111111
01001011 11111111
00000101 00000000
01110100 11111111
01111100 11111111
01011100 11111111
01010110 11111111
Output
11111111
11111111
00000000
11111111

A higher resolution is required to access the IDE

Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
Online Participants