TensorBFS / TensorInference.jl

Probabilistic inference using contraction of tensor networks
https://tensorbfs.github.io/TensorInference.jl/
MIT License
18 stars 2 forks source link

Implement MMAP #7

Closed GiggleLiu closed 2 years ago

GiggleLiu commented 2 years ago

It requires a mixed use of floating point numbers and Tropical numbers:

MMAP : computing the most likely assignment to the query variables, $X_M \subset X'$ after marginalizing out the remaining variables $X_S = X' \setminus X_M$.

\begin{align} MMAP(X_i|E=e) = \arg \max_{X_M} \sum_{X_S} \prod_{F} f(x_M, x_S, e) \end{align}
GiggleLiu commented 2 years ago

Proposal

We first marginalize $X_S$ with real numbers, the contraction result is a set of tensors. Then we contract the remaining tensor network with tropical algebra.

  1. find clusters connected by hyper-edges in $X_S$,
  2. optimize the contraction order for each cluster,
  3. contract each cluster with real numbers,
  4. optimize the clusters contraction order,
  5. contract the clusters with logged tropical numbers.