Adaptively weighted stochastic gradient descent algorithm