The stochastic approximation of the gradients is then used to minimize the energy E ( W ) typically using a stochastic gradient descent approach. When the neural-network parameters are updated at each step of the learning procedure, a new set of samples S ( i ) is generated, in an iterative procedure similar to what done in unsupervised learning.