fit_sequential

pmrf.fitting.fit_sequential(model: Model, data: NetworkCollection, *, features: str | list[str] | Callable[[Model, Frequency], Array] | list[Callable[[Model, Frequency], Array]] | dict[str, str | list[str] | Callable[[Model, Frequency], Array] | list[Callable[[Model, Frequency], Array]]] | None = 's', dynamic_kwargs: dict[str, dict[str, Any] | Callable[[Network], Any]] | None = None, **kwargs) tuple[Model, dict[str, FitResult]]

Sequentially fits sub-modules of a circuit using either optimization or sampling.

For each network in the network collection, the network’s name is used as a prefix for the features to fit, and pmrf.fit() is called.

Parameters:
  • model (Model) – The RF model to fit.

  • data (NetworkCollection) – A collection of network data whose names are used as prefixes for sub-model features.

  • features (EvaluatorLike | None, default='s') – The RF features to fit. Defaults to all S-parameters. Can either be an instance of pmrf.Evaluator or a string, in which case a ‘feature’ evaluator is created (see pmrf.evaluators.Feature).

  • dynamic_kwargs (dict[str, dict | Callable[[skrf.Network], Any]] | None, default=None) – A mapping of keyword arguments that should be resolved dynamically per network. If a value is a dict, it is resolved using the network name as the key. If a value is a callable, it is resolved by passing the network to the callable.

  • **kwargs (dict) – Standard kwargs passed to pmrf.fit().

Returns:

The fully updated global Model, and a dictionary of localized results.

Return type:

tuple[Model, dict[str, OptimizeResult | InferenceResult]]