0

Can anyone explain it to me

explain this code to me https://code.sololearn.com/cMPm6Km772IG/?ref=app

31st Oct 2017, 10:02 AM
Vaibhav Kushwaha
Vaibhav Kushwaha - avatar
2 Answers
+ 7
The comments are pretty verbose about it. You create a single-neuron NN class which initializes its weights randomly. Then, it learns by iterating through the train set 10,000 times, each time adjusting the weights, so that the aggregate loss function (sum of errors for each element of the train set) would assume lower and lower values, in search for the minimum. This means that the NN's neuron "predicts" the true values of each of the set's elements with minimal error. Sigmoid as activation function translates those values times weights into a value between 0 and 1. The higher it is, the less influence on the weight change it will have. Lower results (less confidence) will surely get changed more in the next iteration. The last phase is a test phase. We pass a new input to the neuron with already trained (set) weights and check if they were set so that they provide correct results even on the unknown (not previously seen) input.
31st Oct 2017, 10:42 AM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
0
thank you bro
31st Oct 2017, 10:47 AM
Vaibhav Kushwaha
Vaibhav Kushwaha - avatar