Unit#

class hmclab.MassMatrices.Unit(dimensions: int = - 1, rng: Optional[numpy.random._generator.Generator] = None)[source]#

Bases: hmclab.MassMatrices._AbstractMassMatrix

The unit mass matrix.

This mass matrix or metric does not perform any scaling on the target distribution. It is the default setting for the HMC algorithms and is optimal when all parameters of your target distribution are expected to have the same variance and no trade-offs.

__init__(dimensions: int = - 1, rng: Optional[numpy.random._generator.Generator] = None)[source]#

Constructor for unit mass matrices

Methods

__init__

Constructor for unit mass matrices

create_default

full_name

generate_momentum

kinetic_energy

param momentum

kinetic_energy_gradient

param momentum

Attributes

dimensions

matrix

name

rng

kinetic_energy(momentum: numpy.ndarray) float[source]#
Parameters

momentum

kinetic_energy_gradient(momentum: numpy.ndarray) numpy.ndarray[source]#
Parameters

momentum

generate_momentum() numpy.ndarray[source]#
property matrix: numpy.ndarray#