brainmass.FitResult#

class brainmass.FitResult(*, backend, best_loss, best_params, history, n_steps, prediction=None, optimizer=None, raw=None, model=None)#

Outcome of a Fitter.fit() call.

backend#

The optimizer backend that produced this result ('grad' / 'nevergrad' / 'scipy').

Type:

str

best_loss#

Lowest loss observed over the run.

Type:

float

best_params#

{name: value} of the trainable parameters at the best-seen point, in the constrained (physical) space (i.e. Param.value()).

Type:

dict

history#

Per-iteration loss. For grad this is one entry per optimization step; for scipy it is the best loss per restart; for nevergrad it is the loss of every evaluated candidate.

Type:

list of float

n_steps#

Number of optimization iterations actually run (may be less than the requested n_steps if a callback requested early stopping).

Type:

int

prediction#

The model prediction at the best-seen point (objective path), else None.

Type:

Any or None

optimizer#

The underlying braintools.optim optimizer object.

Type:

Any

raw#

Backend-specific raw result (a SciPy OptimizeResult for scipy, the best-parameter mapping for nevergrad, None for grad).

Type:

Any

model#

The fitted model, holding the best-seen parameters.

Type:

brainstate.nn.Module

__init__(*, backend, best_loss, best_params, history, n_steps, prediction=None, optimizer=None, raw=None, model=None)[source]#

Methods

__init__(*, backend, best_loss, best_params, ...)

__init__(*, backend, best_loss, best_params, history, n_steps, prediction=None, optimizer=None, raw=None, model=None)[source]#