Modify RMSprop to use losses

and their derivatives