pmrf.fitting.NumPyroResults

class pmrf.fitting.NumPyroResults(measured=None, initial_model=None, fitted_model=None, solver_results=None, settings=None)[source]

Bases: BayesianResults

NumPyro: Results from numpyro.infer.

This class handles the storage and retrieval of samples generated by NumPyro’s MCMC or Nested Sampling algorithms.

Parameters:
  • measured (Network | NetworkCollection | None)

  • initial_model (Model | None)

  • fitted_model (Model | None)

  • solver_results (Model)

  • settings (FitSettings | None)

__init__(measured=None, initial_model=None, fitted_model=None, solver_results=None, settings=None)
Parameters:
  • measured (Network | NetworkCollection | None)

  • initial_model (Model | None)

  • fitted_model (Model | None)

  • solver_results (Model | None)

  • settings (FitSettings | None)

Return type:

None

Methods

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(other)

Return self==value.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__gt__(value, /)

Return self>value.

__init__([measured, initial_model, ...])

__init_subclass__

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__()

Return repr(self).

__setattr__(name, value, /)

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

_decode_recursive(group)

_encode_recursive(obj, group)

_group_to_dict(group)

_read_from_group(group)

Internal driver to load full object state.

_read_network(group)

_read_settings(group)

_save_dict_to_group(d, group)

_write_network(group, ntwk)

_write_settings(group)

_write_to_group(group[, metadata])

Internal driver to save full object state.

decode_solver_results(group)

Decode NumPyro solver results from an HDF5 group.

encode_solver_results(group)

Encode the NumPyro solver results into an HDF5 group.

fit_posterior([train_dist, equal_weights, ...])

Fit a trainable distribution to the posterior samples.

load_hdf(path)

Load fit results from an HDF5 file.

plot_s_db([use_initial_model])

Plots the S-parameters (Magnitude in dB) of the Measured vs Fitted data.

posterior_samples([equal_weights])

Retrieve samples drawn from the posterior distribution.

prior_samples([equal_weights])

Retrieve samples drawn from the prior distribution.

save_hdf(path[, metadata])

Save the fit results to an HDF5 file.

weights()

Retrieve the weights associated with the posterior samples.

Attributes

__annotations__

__dataclass_fields__

__dataclass_params__

__dict__

__doc__

__hash__

__match_args__

__module__

__weakref__

list of weak references to the object (if defined)

fitted_model

initial_model

measured

settings

solver_results

encode_solver_results(group)[source]

Encode the NumPyro solver results into an HDF5 group.

Parameters:

group (h5py.Group) – The HDF5 group to write the samples to.

classmethod decode_solver_results(group)[source]

Decode NumPyro solver results from an HDF5 group.

Parameters:

group (h5py.Group) – The HDF5 group to read the samples from.

Returns:

The decoded samples (typically a dictionary or structured array).

Return type:

Any