Skip to content

Commit

Permalink
chore(docs): bump differt_core
Browse files Browse the repository at this point in the history
  • Loading branch information
jeertmans committed May 28, 2024
1 parent ccadf7c commit b051301
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 29 deletions.
23 changes: 16 additions & 7 deletions differt2d/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
runtime_checkable,
)

import differt_core
import equinox as eqx
import jax
import jax.numpy as jnp
from beartype import beartype as typechecker
from differt_core.rt.graph import CompleteGraph
from jaxtyping import Array, Float, PRNGKeyArray, UInt, jaxtyped
from matplotlib.artist import Artist

Expand Down Expand Up @@ -888,21 +888,30 @@ def all_path_candidates(
Note that it only includes indices for objects.
.. note::
Internally, it uses :py:class:`differt_core.rt.graph.CompleteGraph`
to generate the sequence of all path candidates efficiently.
:param min_order: The minimum order of the path, i.e., the
number of interactions.
:param max_order: The maximum order of the path, i.e., the
number of interactions.
:return: The list of list of indices.
"""
num_primitives = len(self.objects)
num_nodes = len(self.objects)

graph = CompleteGraph(num_nodes)

from_ = num_nodes
to = from_ + 1

return [
path_candidate
jnp.asarray(path_candidate, dtype=jnp.uint32)
for order in range(min_order, max_order + 1)
for path_candidate in jnp.asarray(
differt_core.generate_path_candidates(num_primitives, order),
dtype=jnp.uint32,
).T
for path_candidate in graph.all_paths(
from_, to, order + 2, include_from_and_to=False
)
]

def get_interacting_objects(
Expand Down
92 changes: 73 additions & 19 deletions docs/source/GFlowNet.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
# -- Intersphinx mapping

intersphinx_mapping = {
"differt_core": ("https://differt.eertmans.be/latest/", None),
"equinox": ("https://docs.kidger.site/equinox/", None),
"jax": ("https://jax.readthedocs.io/en/latest", None),
"jaxtyping": ("https://docs.kidger.site/jaxtyping/", None),
Expand Down
1 change: 1 addition & 0 deletions examples/qt_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ def set_path_cls(method: str) -> None:
# Matplotlib figures
self.fig = Figure(figsize=(10, 10), tight_layout=True)
self.view = FigureCanvas(self.fig)
self.view.setMinimumHeight(200)
self.ax = self.fig.add_subplot()

# Toolbar above the figure
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ classifiers = [
]
dependencies = [
"beartype>=0.17.2",
"differt-core==0.0.5",
"differt-core==0.0.12",
"equinox>=0.11.2",
"jax>=0.4.7",
"jaxtyping>=0.2.24",
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ decorator==5.1.1
# via ipython
defusedxml==0.7.1
# via nbconvert
differt-core==0.0.5
differt-core==0.0.12
# via differt2d
distlib==0.3.8
# via virtualenv
Expand Down
2 changes: 1 addition & 1 deletion requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contourpy==1.2.1
# via matplotlib
cycler==0.12.1
# via matplotlib
differt-core==0.0.5
differt-core==0.0.12
# via differt2d
equinox==0.11.4
# via differt2d
Expand Down

0 comments on commit b051301

Please sign in to comment.