ManifoldFlows

Documentation for ManifoldFlows.

ManifoldFlows.RelaxationMethod
Relaxation(alph::AbstractVector; T=Float32, m = matrix_that_maps_index_to_vector)

Creates a Relaxation struct, which maps discrete tokens to continuous points and back again.

source
ManifoldFlows.angleaxis_stackMethod

angleaxisstack(R::AbstractArray{T, 3})

Convert a stack of 3-by-3-by-N rotation matrices to a row vector of angles and a 3-by-N matrix of axis...es?

source
ManifoldFlows.batch_flowstateMethod
batch_flowstate(statetuple::Tuple{Vararg{AbstractArray}}, flowtuple::Tuple{Vararg{Flow}})

Converts a tuple of abstract arrays and a tuple of Flows, into a tuple of Flow-appropriate FlowStates.

source
ManifoldFlows.bcds2quatsMethod
bcds2quats(bcd::AbstractArray{<: Real, 2})

Convert a 3xN array of partial quaternions to an array of (flat) unit quaternions.

source
ManifoldFlows.flowMethod
flow(f::Flow, x0::FlowState, model; steps = 100, tracker = NullTracker())

Samples from the distribution implied by the model under the Flow f, starting from x0. f and x0 can also be tuples, with matches components. steps can be an integer, in which case a linear schedule is used, or a vector of times to specify the schedule. If a tracker is supplied, the sample paths are tracked.

source
ManifoldFlows.interpolateMethod
interpolate(f::Flow, x0::A, x1::A, t::T) where A::FlowState{T}

Geodesic interpolation between two FlowStates. t` must be a scalar, or row vector. The flow states are interpolated regardless of the mask, and the output mask is the logical AND of the two input masks.

source
ManifoldFlows.log_rot_stackMethod

logrotstack(R::AbstractArray{T, 3})

Calculate the logarithmic map of each rotation in a stack of 3-by-3-by-N rotation matrices.

logrotstack(A) is calculating the same thing as stack([log(A[:,:,i]) for i in 1:size(A,3)])

source
ManifoldFlows.lossMethod
loss(f::Flow, x̂1::A, x1::A, xt::A, t::T; masked = false, eps = T(0.01), pow = 2) where A::FlowState{T}

Compute a loss between the predicted end point x̂1 and the true end point x1, given the starting point xt and the time t. These should be considered as "default" losses, and you might need to adapt and adjust them for your problem.

source
ManifoldFlows.perturb!Method
perturb!(f::Flow, x::A, σ::T) where A::FlowState{T}

Perturb the flow by a random amount, respecting the manifold, but do not change states where mask is false.

source
ManifoldFlows.randrotMethod

randrot(σ²)

Generate a random rotation matrix, with each element drawn from the exponential map of a normal distribution with variance σ².

source
ManifoldFlows.relaxMethod
relax(seq::AbstractVector, r::Relaxation)

Converts a sequence of discrete tokens to a matrix (where each column can be thought of as a multivariant "point").

source
ManifoldFlows.sinkhornMethod
sinkhorn(C, λ; iters=50, standardize = true)

Returns the "plan" from the Sinkhorn algorithm for optimal transport, given a cost matrix C and regularization parameter λ. If standardize is true, then the cost matrix is standardized by dividing by its standard deviation which can help with numerical stability.

source
ManifoldFlows.slerp_stackMethod

slerp(a,b,t)

Interpolation between two 3-by-3-by-N stacks of rotation matrices,performing Spherical linear interpolation (Slerp) on each pair of rotation matrices.

source
ManifoldFlows.unrelaxMethod
unrelax(points::AbstractArray, r::Relaxation)

Converts a continuous matrix (where each column can be thought of as a multivariant "point") to a sequence of discrete tokens.

source