API

This page contains the main API reference.

Core Primitives

pmrf.Model(*[, name, metadata])

Base class for RF models.

pmrf.Frequency([start, stop, npoints, unit])

A frequency axis used to evaluate models over.

pmrf.Param(*[, value, distribution, ...])

The canonical parameter container for ParamRF.

pmrf.Unconstrained(value, *[, fixed, scale, ...])

Create an unconstrained free parameter.

pmrf.Fixed(value, *[, name, scale, metadata])

Create a fixed parameter.

pmrf.Bounded(lower, upper, *[, value, ...])

Create a free parameter constrained within a specific interval.

pmrf.Constrained(constraint, value, *[, ...])

Create a free parameter constrained to a specific domain.

pmrf.Random(distribution, *[, constraint, ...])

Create a free parameter with an associated probability distribution.

Main Modules

pmrf.models

RF models, components, surrogates, and adapters, and their solvers.

pmrf.optimize

Non-linear optimization of RF models.

pmrf.infer

Bayesian inference of RF models.

pmrf.fitting

Higher-level fitting utilities.

Other Modules

pmrf.constraints

Constraints for parameters.

pmrf.covariance_kernels

Covariance kernels for Gaussian processes.

pmrf.discrepancy_models

Discrepancy modeling between an RF model and actual data.

pmrf.distributions

Probability distribution classes and factories.

pmrf.evaluators

Callables that evaluate a model over frequency.

pmrf.likelihoods

Likelihood models for statistical fitting.

pmrf.losses

Loss models for optimizer fitting or generalized Bayesian inference.

pmrf.math

Core maths functions.

pmrf.noise_models

Measurement noise models for likelihood functions.

pmrf.parameters

Parameter factories, converters, and field specifiers.

pmrf.rf

Core RF conversions and system representations.

pmrf.serialization

Model loading and saving.

pmrf.viz

Plotting and vizualization.

Utilities

pmrf.NetworkCollection([networks, name, params])

A container for a collection of scikit-rf Networks.

pmrf.Partial(func, /, *args, **kwargs)

(experimental) Like functools.partial, but JAX-compatible.

pmrf.Attrgetter(*attrs)

(experimental) Like operator.attrgetter, but registered as a PyTree.

pmrf.Pathgetter(*paths)

(experimental) Retrieves values from a PyTree given JAX tree paths.

pmrf.InitVar(type)

pmrf.is_param(x)

Returns if x is an instance of pmrf.Param.

pmrf.as_param([value, constraint, scale, ...])

Coerces a value into a parameter.

pmrf.param(*, default, as_free, as_fixed, ...)

A field specifier for registering parameters within a model.

pmrf.partition(pytree, filter_spec[, is_leaf])

Splits a PyTree into two halves based on a filtering rule.

pmrf.combine(*pytrees[, is_leaf])

Recombines previously partitioned PyTrees into a single, functional PyTree.

pmrf.batch_axes(batched, template, *[, is_leaf])

Generates an in_axes PyTree by comparing a batched model to a template.

pmrf.batch_mask(batched, template, *[, is_leaf])

Generates a boolean PyTree mask identifying which leaves have a batch dimension.

pmrf.field(*[, converter, static])

Equinox supports extra functionality on top of the default dataclasses.

pmrf.load(source)

(experimental) Load a ParamRF Model (or any Parax PyTree) from a file.

pmrf.save(target, tree)

(experimental) Save a ParamRF Model (or any Parax PyTree) to a file.

pmrf.derivative(eval_fn, *args)

Computes the exact derivative of a function.

pmrf.sweep(eval_fn, *args[, grid, template])

Vectorizes a function over the given input arguments.

pmrf.freeze(value)

Freezes/fixes a parameter or entire model and returns the frozen model.

pmrf.unfreeze(value)

Unfreezes/unfixes a potentially frozen parameter or model and returns the unfrozen model.

pmrf.replace(obj, /, **changes)

Return a new object replacing specified fields with new values.

pmrf.unwrap(tree[, only_if, cascade])

Recursively resolves AbstractUnwrappable nodes within a PyTree.

pmrf.unwrap_self(method)

Decorator for Equinox module methods.