diff --git a/src/Optimizers/OptimizerBase.cs b/src/Optimizers/OptimizerBase.cs index f6a7718ab8..5610643533 100644 --- a/src/Optimizers/OptimizerBase.cs +++ b/src/Optimizers/OptimizerBase.cs @@ -1105,9 +1105,9 @@ protected virtual void DeserializeAdditionalData(BinaryReader reader) public virtual void Step() { throw new NotImplementedException( - "Step() method is not implemented for this optimizer type. " + - "This optimizer may be a non-gradient-based optimizer that uses the Optimize() method instead, " + - "or the derived class needs to implement the Step() method."); + $"The 'Step()' method is not implemented for optimizer type '{GetType().Name}'. " + + "For gradient-based optimizers, this method must be overridden by the derived class. " + + "For non-gradient-based optimizers, consider using the 'Optimize()' method instead."); } /// @@ -1118,9 +1118,9 @@ public virtual void Step() public virtual Dictionary> CalculateUpdate(Dictionary> gradients) { throw new NotImplementedException( - "CalculateUpdate() method is not implemented for this optimizer type. " + - "This optimizer may be a non-gradient-based optimizer that uses the Optimize() method instead, " + - "or the derived class needs to implement the CalculateUpdate() method."); + $"The 'CalculateUpdate()' method is not implemented for optimizer type '{GetType().Name}'. " + + "For gradient-based optimizers, this method must be overridden by the derived class. " + + "For non-gradient-based optimizers, consider using the 'Optimize()' method instead."); } ///