version with adagrad and grad ascent.