Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Bump up version; Fixes for docs (#102)
Browse files Browse the repository at this point in the history
* Bump up version; Fixes for docs

* Fix accidental changes to pyproject.toml

* Fix docs
  • Loading branch information
StannisZhou authored Dec 1, 2021
1 parent 36248c9 commit 00cddd5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion pgmax/bp/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def pass_var_to_fac_messages(
Args:
ftov_msgs: Array of shape (num_edge_state,). This holds all the flattened factor to variable
messages.
Array of shape (num_var_states,) representing the flattened evidence for each variable
evidence: Array of shape (num_var_states,) representing the flattened evidence for each variable
var_states_for_edges: Array of shape (num_edge_states,)
Global variable state indices for each edge state
Returns:
Array of shape (num_edge_state,). This holds all the flattened variable to factor messages.
"""
Expand Down
16 changes: 7 additions & 9 deletions pgmax/fg/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,7 @@ class FToVMessages:
fg_state: Factor graph state
value: Optionally specify initial value for ftov messages
Raises: ValueError if provided value does not match expected ftov messages
shape.
Raises: ValueError if provided value does not match expected ftov messages shape.
"""

fg_state: FactorGraphState
Expand Down Expand Up @@ -790,13 +789,12 @@ def BP(bp_state: BPState, num_iters: int) -> Tuple[Callable, Callable, Callable]
num_iters: Number of belief propagation iterations.
Returns:
tuple containing
run_bp: Function for running belief propagation for num_iters.
Optionally takes as input log_potentials updates, ftov_msgs updates,
evidence updates, and damping factor, and outputs a BPArrays.
get_bp_state: Function to reconstruct the BPState from BPArrays.
get_beliefs: Function to calculate beliefs from BPArrays.
Tuple containing\n
\trun_bp: Function for running belief propagation for num_iters.\n
\t\tOptionally takes as input log_potentials updates, ftov_msgs updates,
\t\tevidence updates, and damping factor, and outputs a BPArrays.\n
\tget_bp_state: Function to reconstruct the BPState from BPArrays.\n
\tget_beliefs: Function to calculate beliefs from BPArrays.\n
"""
max_msg_size = int(np.max(bp_state.fg_state.wiring.edges_num_states))
num_val_configs = (
Expand Down
2 changes: 2 additions & 0 deletions pgmax/fg/groups.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""A module containing the classes for variable and factor groups in a Factor Graph."""

import collections
import itertools
import typing
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pgmax"
version = "0.2.0"
version = "0.2.1"
description = "Loopy belief propagation for factor graphs on discrete variables, in JAX!"
authors = ["Stannis Zhou <[email protected]>", "Nishanth Kumar <[email protected]>", "Miguel Lazaro-Gredilla <[email protected]>", "Dileep George <[email protected]>"]
maintainers = ["Stannis Zhou <[email protected]>", "Nishanth Kumar <[email protected]>"]
Expand Down

0 comments on commit 00cddd5

Please sign in to comment.