fixed loss function derivstive, fixed update rule, fixed testsfixed loss function derivstive, fixed update rule, fixed tests