matchernet package

Submodules

matchernet.ekf module

matchernet.fn module

fn.py

This module contains function handler classes that the BundleNet architecture needs. It is overridden when you use chainer/TensorFlow to implement the arbitrary parametric functions.

class matchernet.fn.Fn(A)[source]

Bases: object

An abstract class to implement numerical function that BundleNet uses.

get_params()[source]
value(x)[source]

Numerically calculates f(x) x should be a numpy array of shape (dim_in, 1) outputs a numpy array of shape (dim_out, 1)

class matchernet.fn.LinearFn(A)[source]

Bases: matchernet.fn.Fn

Linear function y = np.dot(A, x) and its derivatives.

value(x)[source]

Numerically calculates f(x) x should be a numpy array of shape (dim_in, 1) outputs a numpy array of shape (dim_out, 1)

class matchernet.fn.LinearFnXU(A, B)[source]

Bases: object

Linear function y = np.dot(A, x) + np.dot(B, u) and its derivatives.

Note

The shapes of matrix A and matrix B must match

value(x, u)[source]

matchernet.matchernet module

matchernet.matchernet_null module

matchernet.observer module

matchernet.state module

class matchernet.state.State(n)[source]

Bases: object

Class State is a state handler that maintains, serializes, and deserializes the state of Bundles or Matchers. The methods serialize() and deserialize() are required for BriCA1 components to exchange their states as numpy.array objects.

A Bundle/Matcher has its state as a dictionary. For exmaple, B0.state = state.State() B0.state.data = {“mu”:np.array([1,2]),

“Sigma”:np.array([[1,0],[0,1]])}

The disctionary is serialized with a method serialize() q = B0.serialize() into a numpy.array object q . The serialized array is exchanged through BriCA1 IN/OUT ports and deserialized with a method deserialize() as. B0.deserialize(q)

class matchernet.state.StateMuSigma(n)[source]

Bases: matchernet.state.State

StateMuSigma is a state handler that handles state variable as the following dictionary style. B.state.data = {“id”:1,

“mu”:numpy.array([1,2,3]), “Sigma”:numpy.array([[1,0,0],[0,1,0],[0,0,1]])}

Note that StateMuSigma and StateMuSigmaDiag have

n x n matrix “Sigma” and n vector “sigma”, respectively.

class matchernet.state.StateMuSigmaDiag(n)[source]

Bases: matchernet.state.State

StateMuSigmaDiag is a state handler that handles state variable as the following dictionary style. B.state.data = {“id”:1,

“mu”:numpy.array([1,2,3]), “sigma”:numpy.array([2.0,2.0,2.0])}

Note that StateMuSigma and StateMuSigmaDiag have

n x n matrix “Sigma” and n vector “sigma”, respectively.

class matchernet.state.StatePlain(n)[source]

Bases: matchernet.state.State

StatePlain is a State that handles plain numpy.array.

matchernet.state_space_model_2d module

matchernet.utils module

matchernet.utils.calc_matrix_F(A, dt)[source]

Compute the F matrix.

Ft’ = exp(dt * At’) ≈ I + dt * At’ + dt^2 * At’^2 + … Approximate up to the third-order term and calculate F. F = I + A * dt + (A^2 * dt^2)/2.0 + (A^3 * dt^3)/6.0

Args:

A (np.array): Jacobian of the state space model dynamics function. dt (int or float): Differentiating time width.

Returns:

np.array: A variable holding a np.array of the F matrix.

matchernet.utils.print_flush(s)[source]
matchernet.utils.q_plot001(n, q_array, x_array)[source]
matchernet.utils.q_plot002(trange, mu, s, color='blue')[source]
matchernet.utils.regularize_cov_matrix(a, mineig=1e-05)[source]

regularize the covariance matrix a so that its minimum eigen value is larger than mineig.

matchernet.utils.zeros(size)[source]

Module contents