-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTensorInference.jl
More file actions
70 lines (54 loc) · 1.74 KB
/
TensorInference.jl
File metadata and controls
70 lines (54 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
"""
Main module for `TensorInference.jl` -- A toolbox for probabilistic inference using contraction of tensor networks.
# Exports
$(EXPORTS)
"""
module TensorInference
using BitBasis
using Graphs
using OMEinsum, LinearAlgebra
using OMEinsum: CacheTree, cached_einsum
using OMEinsum.OMEinsumContractionOrders.JSON
using DocStringExtensions, TropicalNumbers
# The Tropical GEMM support
using StatsBase
using PrettyTables
using ProblemReductions
import Pkg
# reexport OMEinsum functions
export RescaledArray
export contraction_complexity, TreeSA, GreedyMethod, KaHyParBipartite, HyperND, SABipartite, MergeGreedy, MergeVectors, TreeSASlicer, ScoreFunction
# read and load uai files
export read_model_file, read_td_file, read_evidence_file
export problem_from_artifact, ArtifactProblemSpec
export read_model, UAIModel, read_evidence, read_solution, read_queryvars, dataset_from_artifact
# marginals
export TensorNetworkModel, get_vars, get_cards, log_probability, probability, marginals, update_evidence!
# MAP
export most_probable_config, maximum_logp
# sampling
export sample
# MMAP
export MMAPModel
# for ProblemReductions
export update_temperature
# belief propagation
export BeliefPropgation, belief_propagate
export LoopSeriesTruncation, XORLoopSum, UnionLoopSum, Degree, Cyclomatic
export loop_series, loop_basis, loop_weight, bp_vacuum_weight, loop_corrections
# fileio
export save_tensor_network, load_tensor_network
# utils
export random_matrix_product_state, random_tensor_train_uai, random_matrix_product_uai
include("Core.jl")
include("RescaledArray.jl")
include("utils.jl")
include("mar.jl")
include("map.jl")
include("mmap.jl")
include("sampling.jl")
include("cspmodels.jl")
include("belief.jl")
include("loop_series.jl")
include("fileio.jl")
end # module