# Does not being able to overfit a single training sample mean that the neural network architecure or implementation is wrong? [duplicate]

Is the following hypothesis true ?

If a simple neural network cannot overfit a single training sample, there is something wrong with its architecture or its implementation.

To give you more background on why I am asking this question, I am working on a single convolution layer that aims at segmenting the input image (classify every pixel of the image from either class 0 or class 1). The network does not manage to overfit a single training sample, so I suppose that there is something wrong with what I have done.

Edit: This is not a duplicate of What should I do when my neural network doesn't learn?. The post (which is very informative) suggest, among other things, to unit test the network to see if it is error-proof. Basically, I am asking a question on how to unit test my network. The hypothesis I stated is the one which I hold to run the unit test. If the hypothesis is wrong, the unit test I am making does not make any sense, thus the question.

## marked as duplicate by DeltaIV, Jan Kukacka, kjetil b halvorsen, mkt, Peter Flom♦Sep 8 '18 at 13:00

• In a way, I am unit testing my former whole FCN32 (close to a VGG16) with this simple network. Your link is good, though. Thanks for answering! – Xema Sep 7 '18 at 9:18
• The goal of a unit test is to check something which is known to work. Since you're not checking your actual architecture, what are you checking exactly? The way you read & feed data? Then it would be much better to use an existing, pre-trained architecture for image segmentation, for the unit test, rather than a single convolution layer (?!?). – DeltaIV Sep 7 '18 at 9:50

Let's say the image has size 100$\times$100. To memorize its segmentation you would need 104 parameters. Now, a single convolution layer for binary segmentation would have probably 2 filters of shape 3$\times$3, including the bias that makes 20 parameters. So, unless the sample image segmentation is super trivial, overfitting cannot happen.