How to tune weight in neural network