scimba_torch.optimizers.ssbroyden

An implementation of Self Scaled Broyden optimizer.

_cubic_interpolate and _strong_wolfe have been copied pasted from torch v2.9.1, in torch.optim.lbfgs.py

Classes

SSBroyden(params[, lr, tolerance_grad, method])

Implements SSBroyden algorithm.

class SSBroyden(params, lr=1.0, tolerance_grad=1e-10, method='ssbfgs')[source]

Bases: Optimizer

Implements SSBroyden algorithm.

Implementation of

Urbán, J. F., Stefanou, P., & Pons, J. A. (2025). Unveiling the optimization process of physics informed neural networks: How accurate and competitive can PINNs be?. Journal of Computational Physics, 523, 113656.

Parameters:
  • params (Union[Iterable[Tensor], Iterable[dict[str, Any]], Iterable[tuple[str, Tensor]]]) – iterable of parameters to optimize. Parameters must be real.

  • lr (Union[float, Tensor]) – learning rate (default: 1)

  • tolerance_grad (float) – does not update if max norm of grad smaller that this.

  • method (str) – either “ssbroyden” or “ssbfgs”

Raises:

ValueError – lr is not scalar lr is <= 0. tolerance grad is <= 0. SS Broyden/BFGS doesn’t support per-parameter options method is not in [“ssbfgs”, “ssbroyden”]

step(closure)[source]

Perform a single optimization step.

Parameters:

closure (Callable) – A closure that reevaluates the model and returns the loss.

Return type:

Tensor

Returns:

the initial loss