public override void Optimize() { Matrix deltaW = OptimizerFunction.CalculateDeltaW(Params["W"], Grads["DW"]); Matrix deltaB = OptimizerFunction.CalculateDeltaB(Params["B"], Grads["DB"]); Params["W"] -= deltaW; Params["B"] -= deltaB; }
public void Optimize() { MatrixData data = Data; for (int i = 1; i < Layers.Count; i++) { Data.Data["W" + i.ToString()] -= Matrix.Transpose(OptimizerFunction.CalculateDeltaW(Data.Data["W" + i.ToString()], Data.Data["dW" + i.ToString()])); Data.Data["b" + i.ToString()] -= OptimizerFunction.CalculateDeltaB(Data.Data["b" + i.ToString()], Data.Data["db" + i.ToString()]); } Data = data; }