The task is to train a neural network to return the input as it is, like X -> X or Y -> Y. The network should contain at least two layers. Obviously, the output must be linear (resorting or not to scaling).

Using linear activation functions in hidden layers or in the output layer if the network does not have hidden ones causes overflow. Sigmoids in the hidden layers and a linear output seem to work, but only in case I have specified the learning rate accurately enough (it needs to be as accurate as up to 4e-6 or other values depending on the data). But even in this case the network only appeared to be capable of returning the values which had been included in the training set. The amount of hidden nodes also needs to be times as more as there are the output nodes.

My task concerns image processing, and first of all I want to train my network to return the input image as it is without any processing.

  • $\begingroup$ the only way except not having an ANN in the first place, is for the output to be same as input and let training do the rest. Of course errors due to architecture mismatch, limited accuracy, .. may return only approximate results $\endgroup$
    – Nikos M.
    Jul 3, 2021 at 17:01
  • $\begingroup$ @NikosM. Of course I provide the network with target data equivalent to the input data, I thought this was too obvious to be mentioned $\endgroup$
    – Kaiyakha
    Jul 3, 2021 at 21:36
  • $\begingroup$ Sure, but architecture mismatch (eg num of layers, and/or activation functions) plus limited accuracy can alter the result $\endgroup$
    – Nikos M.
    Jul 5, 2021 at 10:29

1 Answer 1


There are two options:

  1. A pass through network with direct connections with a weight of 1. The activations of the input nodes in would be the same as the activations of the out nodes.

  2. Autoencoder - An autoencoder learns the encoding of data, in this case no encoding.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.