update calc of l2norm in nnapplygrads