pypomp.core.rw_sigma.RWSigma.cosine_cooling

RWSigma.cosine_cooling(c: float, M: int) RWSigma[source]

Configure the RWSigma instance to use cosine cooling.

The returned cooling function computes a cooling factor as:

cooling_factor = c + (1.0 - c) * 0.5 * (1.0 + cos(pi * progress))

where:

progress = (nt / ntimes + m) / M nt: Time step index (integer). m: Current iteration index (integer). ntimes: Total number of time steps (integer).

Parameters:
  • c (float) – The minimum cooling factor at the end of the schedule (when progress >= 1). Must be in [0, 1].

  • M (int) – The number of iterations over which the cooling schedule is defined. Must be positive.

Returns:

A new RWSigma instance configured with cosine cooling.

Return type:

RWSigma