flow_CPCA

This file implements information geometry methods working on normalizing flows.

This file needs work and is not complete.

tensiometer.synthetic_probability.flow_CPCA.solve_KL_ode(flow, prior_flow, y0, n, length=1.5, side='both', integrator_options=None, num_points=100, **kwargs)[source]

Solve the KL eigenmode ODE in abstract space.

Parameters:
  • flow – flow representing the target distribution.

  • prior_flow – flow representing the prior distribution.

  • y0 – starting point in abstract coordinates.

  • n – index of the KL eigenmode to track.

  • length – integration length for each direction.

  • side – which direction to integrate; '+', '-' or 'both'.

  • integrator_options – optional options forwarded to scipy.integrate.ode.

  • num_points – number of output points per direction.

Returns:

solution times, trajectory, and velocity along the path.

tensiometer.synthetic_probability.flow_CPCA.solve_eigenvalue_ode_abs(self, y0, n, length=1.5, side='both', integrator_options=None, num_points=100, **kwargs)[source]

Solve eigenvalue ODE in abstract space.

Parameters:
  • y0 – starting point in abstract coordinates.

  • n – index of the eigenvector to follow.

  • length – integration length for each direction.

  • side – which direction to integrate; '+', '-' or 'both'.

  • integrator_options – optional options forwarded to scipy.integrate.ode.

  • num_points – number of output points per direction.

Returns:

solution times, trajectory, and velocity along the path.

tensiometer.synthetic_probability.flow_CPCA.solve_eigenvalue_ode_par(self, y0, n, **kwargs)[source]

Solve the eigenvalue ODE in parameter space.

Parameters:
  • y0 – starting point in parameter coordinates.

  • n – index of the eigenvector to follow.

Returns:

times and mapped trajectory in parameter space.

tensiometer.synthetic_probability.flow_CPCA.tf_CPC_decomposition(matrix_a, matrix_b)[source]

Covariant Principal Components decomposition impolemented in tensorflow.

Parameters:
  • matrix_a – input matrix A.

  • matrix_b – input matrix B.

Returns:

eigenvalues and eigenvectors of the transformed matrix.

tensiometer.synthetic_probability.flow_CPCA.tf_KL_decomposition(matrix_a, matrix_b)[source]

TensorFlow implementation of the KL decomposition used within flow-based utilities. Mirrors tensiometer.utilities.stats_utilities.KL_decomposition().

Parameters:
  • matrix_a – first matrix A.

  • matrix_b – second matrix B (assumed positive definite).

Returns:

eigenvalues and eigenvectors of the generalized problem.