bayesflow.benchmarks.inverse_kinematics module

bayesflow.benchmarks.inverse_kinematics module#

bayesflow.benchmarks.inverse_kinematics.prior(scales=None, rng=None)[source]#

Generates a random draw from a 4-dimensional Gaussian prior distribution with a spherical convariance matrix. The parameters represent a robot’s arm configuration, with the first parameter indicating the arm’s height and the remaining three are angles.

Parameters:
scalesnp.ndarray of shape (4,) or None, optional, defaultNone

The four scales of the Gaussian prior. If None provided, the scales from https://arxiv.org/pdf/2101.10763.pdf will be used: [0.25, 0.5, 0.5, 0.5]

rngnp.random.Generator or None, default: None

An optional random number generator to use.

Returns:
thetanp.ndarray of shape (4, )

A single draw from the 4-dimensional Gaussian prior.

bayesflow.benchmarks.inverse_kinematics.simulator(theta, l1=0.5, l2=0.5, l3=1.0, **kwargs)[source]#

Returns the 2D coordinates of a robot arm given parameter vector. The first parameter represents the arm’s height and the remaining three correspond to angles.

Parameters:
thetanp.ndarray of shape (theta, )

The four model parameters which will determine the coordinates

l1float, optional, default: 0.5

The length of the first segment

l2float, optional, default: 0.5

The length of the second segment

l3float, optional, default: 1.0

The length of the third segment

**kwargsdict, optional, default: {}

Used for comptability with the other benchmarks, as the model is deterministic

Returns:
xnp.ndarray of shape (2, )

The 2D coordinates of the arm

bayesflow.benchmarks.inverse_kinematics.configurator(forward_dict, mode='posterior')[source]#

Configures simulator outputs for use in BayesFlow training.