public double Loss(NDarray <double> y, NDarray <double> p) => ND.Sq(ND.Sub(p, y)).ApplyFunc(x => x * 0.5).Data.Average();
public NDarray <double> Grad(NDarray <double> y, NDarray <double> p) => ND.Sub(p, y);
public void UpdateSGD(double lr) { Y = ND.Sub(Y, Grad.ApplyFunc(x => x * lr)); }