r/deeplearning • • Nov 06 '26

Neural Net Learning problem

I had created a neural network system from scratch in

C++, and tested it like linear regression problem and it learned that number, and minimised the error.

But when I went to implement Number recognition, after learning of neurons it is just showing me the last number that it learned for any set of inputs although number are picked at random.

I don't think this problem is especially related to neural network, it could be me, who somewhere messed up the code.

If someone have tried this and got the same problem, could they explain me.

If nobody have ever got this problem then it's my code fault.

1 Upvotes

15 comments sorted by

View all comments

1

u/Antenwww Nov 06 '26

How many outputs does your final layer have ? Maybe you do not have 10 outputs for 10 numbers. For example If you have just one output it checks for only if a number is that number. Like is it 7 or not. Like a yes no question.

If you have this error. Make 10 ouputs each will need to add up to 100% total and the highest rated one is the number your network thinks your input is. Expecting an output range of 0-9 and having only 1 output is difficult

1

u/LawAdventurous2383 Nov 06 '26 edited Nov 06 '26

As I remembered, I had created 10 output, the hypothesis is a maxargs which would go from index output first to last and give me the index number of the highest probability, it's uses softmax activation function sooo, sum is always 1 or say 100 percent.

My input is a 27*27 one dimension array something.

Hidden layer is 128 one dimension array and there are 2 of it connecting each other

Lastly output is 10 one dimension array

1

u/Antenwww Nov 06 '26

So there is nothing wrong with neural network side. Can you isolate neurons maybe to see if there is something wrong with convolutions or maybe neuron memory is not flushing between test inputs

2

u/LawAdventurous2383 Nov 06 '26

Actually yeah they are already seprated, each neuron is a object, i think it's more likely to be a faulty code rather then problem related to neural net. I will test your suggested tests to see where is the problem is, Thanks for reply