Improve neural network driven agent: to avoid NaN and infinite results from neural network