Solved by Mohsen_Saffari in post #5 
              
              
                Thanks for your reply! 
I figure out was was the problem. Before, I was applying my manipulation inside the neural network class. But now I am doing in the main loop of the network training.