Generalized Hebbian Algorithm