removed side effect of changing NN layer weights during training