API Reference

Graph

The graph interface carrying the main UI.

Graph

Graph Construction

The state indexing utility for mapping between between the integer vectors of states and the model properties they represent.

StateIndexer Manages multiple independent property sets and slots with attribute access.
PropertySet Collection of properties forming a combinatorial state space.
Property Defines a single property in a state space.
PropertyDict Dict subclass that provides attribute access to keys.
StateVector Dict-like interface for multi-PropertySet state with attribute access.

Inference

The main inference UI is Graph.svgd, which internally uses the SVGD class.

SVGD Stein Variational Gradient Descent (SVGD) for Bayesian parameter inference.

Sparse observations

Sparse observations for multi-feature data.

SparseObservations Sparse representation of multivariate observations.
dense_to_sparse Convert dense NaN-padded array to sparse observation format.
is_sparse_observations Check if data is in sparse observation format.

Priors

Prior distributions of model parameters.

DataPrior Data-informed prior estimated from observed data.
Prior Base class for prior distributions.
GaussPrior Gaussian prior distribution.
HalfCauchyPrior Half-Cauchy prior distribution (positive support only).

Learning rate and regularization

Learning rate schedules and regularization techniques for Stein Variational Gradient Descent.

StepSizeSchedule Base class for step size schedules.
ConstantStepSize Constant step size (default behavior).
ExpStepSize Exponential decay schedule: step_size = first_step * exp(-iteration/tau) + last_step * (1 - exp(-iteration/tau)).
AdaptiveStepSize Adaptive step size based on particle spread (KL divergence proxy).
WarmupExpStepSize Linear warmup followed by exponential decay.

Regularization

Moment regularization techniques for Stein Variational Gradient Descent.

RegularizationSchedule Base class for regularization schedules.
ConstantRegularization Constant regularization (default behavior).
ExpRegularization Exponential decay schedule: reg = first_reg * exp(-iteration/tau) + last_reg * (1 - exp(-iteration/tau)).

Preconditioning

Automated preconditioning for homogenous learning.

MomentJacobianPreconditioner Moment Jacobian preconditioner for multi-scale SVGD.
FisherPreconditioner Diagonal Fisher information preconditioner for multi-scale SVGD.

Optimizers

Adaptive optimizers. Recommended only for models that will not otherwise converge.

Adam Adam optimizer for SVGD with per-parameter adaptive learning rates.
SGDMomentum SGD with momentum optimizer for SVGD.
RMSprop RMSprop optimizer for SVGD.
Adagrad Adagrad optimizer for SVGD.

Optax optimizer support

Support for using optimizers from the external Optax library some of them pre-wrapped for convenience. Recommended only for models that will not otherwise converge, and for users who want to experiment with a wider range of optimizers.

OptaxOptimizer Wrapper to use Optax optimizers with phasic’s SVGD interface.
optax_adam Create Optax Adam optimizer wrapped for phasic.
optax_adamw Create Optax AdamW optimizer wrapped for phasic.
optax_sgd Create Optax SGD optimizer wrapped for phasic.
optax_rmsprop Create Optax RMSprop optimizer wrapped for phasic.
optax_adagrad Create Optax Adagrad optimizer wrapped for phasic.
optax_chain Create chained Optax transforms wrapped for phasic.
optax_lion Create Optax Lion optimizer wrapped for phasic.

Exceptions

Custom exceptions for error handling in phasic.

PTDAlgorithmsError Base exception for all phasic errors.
PTDConfigError Configuration error with suggested fixes.
PTDBackendError Backend not available error.
PTDFeatureError Feature not available on this platform.
PTDJAXError JAX-specific error.

Library utilities

Configuration and Logging.

clear_caches Clear all caching.
configure Configure phasic globally.
get_config Get current global configuration.
get_available_options Get dictionary of available options on this system.
PTDAlgorithmsConfig Global configuration for phasic behavior.
reset_config Reset configuration to default.
set_log_level Context manager and callable for changing the phasic logging level at runtime.
get_logger Get a logger for the specified module.