dohan_rivas
dohan_rivas

Reputation: 93

How do I feed data into my neural network?

I've coded a simple neural network for XOR in python. While there is loads of information online about how to program this, there isn't much on how to feed the data through it. I've tested the change in weights after one cycle for inputs [1,1] to compare my results with my lecture slides and it's 100% the same, so I believe the code works. I can train the network for that same input, but when I change the input (and corresponding target) every cycle the error doesn't go down.

Should I allow changing the weights and inputs after every cycle or should I run through all the possible inputs first, get an average error and then change the weights? (But changing weights are dependent on the output, so what output would I use then)

I can share my code, if needed, but I'm pretty certain it's correct.

Please give me some advice? Thank you in advance.

Upvotes: 2

Views: 1340

Answers (1)

Elad Cohen
Elad Cohen

Reputation: 471

So, you're saying you implemented a neural network on your own ? well in this case, basically each neuron on the input layer must be assigned with a feature of a certain row, than just iterate through each layer and each neuron in that layer and calculate as instructed. I'm sure you are familiar with the back-propagation algorithm so you'll know when to stop.

once you're done with that row, do it again to the next row, assign each feature to each of the input neurons and start the iterations again.

once youre done with all records, thats an Epoch.

I hope that answers your question.

also, I would recommend you to try out Keras, its easy to use and a good tool to be experienced in.

Upvotes: 1

Related Questions