I\'m quite new in neural network. I saw this code with very good explanation :
import numpy as np # sigmoid function def nonlin(x,deriv=False): if(deriv=