Skip to content

Commit e13f7c4

Browse files
authored
[no ci] networks docstrings: summary/inference network indicator (#462)
- From the table in the `bayesflow.networks` module overview, one cannot tell which network belongs to which group. This commit adds short labels to indicate inference networks (IN) and summary networks (SN)
1 parent fef8b90 commit e13f7c4

File tree

13 files changed

+18
-15
lines changed

13 files changed

+18
-15
lines changed

bayesflow/experimental/cif/cif.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# disable module check, use potential module after moving from experimental
1313
@serializable("bayesflow.networks", disable_module_check=True)
1414
class CIF(InferenceNetwork):
15-
"""Implements a continuously indexed flow (CIF) with a `CouplingFlow`
15+
"""(IN) Implements a continuously indexed flow (CIF) with a `CouplingFlow`
1616
bijection and `ConditionalGaussian` distributions p and q. Improves on
1717
eliminating leaky sampling found topologically in normalizing flows.
1818
Built in reference to [1].

bayesflow/experimental/continuous_time_consistency_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# disable module check, use potential module after moving from experimental
2626
@serializable("bayesflow.networks", disable_module_check=True)
2727
class ContinuousTimeConsistencyModel(InferenceNetwork):
28-
"""Implements an sCM (simple, stable, and scalable Consistency Model)
28+
"""(IN) Implements an sCM (simple, stable, and scalable Consistency Model)
2929
with continous-time Consistency Training (CT) as described in [1].
3030
The sampling procedure is taken from [2].
3131

bayesflow/experimental/free_form_flow/free_form_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# disable module check, use potential module after moving from experimental
2323
@serializable("bayesflow.networks", disable_module_check=True)
2424
class FreeFormFlow(InferenceNetwork):
25-
"""Implements a dimensionality-preserving Free-form Flow.
25+
"""(IN) Implements a dimensionality-preserving Free-form Flow.
2626
Incorporates ideas from [1-2].
2727
2828
[1] Draxler, F., Sorrenson, P., Zimmermann, L., Rousselot, A., & Köthe, U. (2024).F

bayesflow/networks/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""
22
A rich collection of neural network architectures for use in :py:class:`~bayesflow.approximators.Approximator`\ s.
3+
4+
The module features inference networks (IN), summary networks (SN), as well as general purpose networks.
35
"""
46

57
from .consistency_models import ConsistencyModel

bayesflow/networks/consistency_models/consistency_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
@serializable("bayesflow.networks")
1616
class ConsistencyModel(InferenceNetwork):
17-
"""Implements a Consistency Model with Consistency Training (CT) a described in [1-2]. The adaptations to CT
18-
described in [2] were taken into account in our implementation for ABI [3].
17+
"""(IN) Implements a Consistency Model with Consistency Training (CT) as described in [1-2].
18+
The adaptations to CT described in [2] were taken into account in our implementation for ABI [3].
1919
2020
[1] Song, Y., Dhariwal, P., Chen, M. & Sutskever, I. (2023). Consistency Models. arXiv preprint arXiv:2303.01469
2121

bayesflow/networks/coupling_flow/coupling_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
@serializable("bayesflow.networks")
1717
class CouplingFlow(InferenceNetwork):
18-
"""Implements a coupling flow as a sequence of dual couplings with permutations and activation
18+
"""(IN) Implements a coupling flow as a sequence of dual couplings with permutations and activation
1919
normalization. Incorporates ideas from [1-5].
2020
2121
[1] Kingma, D. P., & Dhariwal, P. (2018).

bayesflow/networks/deep_set/deep_set.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
@serializable("bayesflow.networks")
1515
class DeepSet(SummaryNetwork):
16-
"""Implements a deep set encoder introduced in [1] for learning permutation-invariant representations of
16+
"""(SN) Implements a deep set encoder introduced in [1] for learning permutation-invariant representations of
1717
set-based data, as generated by exchangeable models.
1818
1919
[1] Zaheer, M., Kottur, S., Ravanbakhsh, S., Poczos, B., Salakhutdinov, R. R., & Smola, A. J. (2017).

bayesflow/networks/flow_matching/flow_matching.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
@serializable("bayesflow.networks")
2323
class FlowMatching(InferenceNetwork):
24-
"""Implements Optimal Transport Flow Matching, originally introduced as Rectified Flow, with ideas incorporated
24+
"""(IN) Implements Optimal Transport Flow Matching, originally introduced as Rectified Flow, with ideas incorporated
2525
from [1-3].
2626
2727
[1] Rectified Flow: arXiv:2209.03003

bayesflow/networks/time_series_network/time_series_network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@serializable("bayesflow.networks")
1111
class TimeSeriesNetwork(SummaryNetwork):
1212
"""
13-
Implements a LSTNet Architecture as described in [1]
13+
(SN) Implements a LSTNet Architecture as described in [1]
1414
1515
[1] Y. Zhang and L. Mikelsons, Solving Stochastic Inverse Problems with Stochastic BayesFlow,
1616
2023 IEEE/ASME International Conference on Advanced Intelligent Mechatronics (AIM),

bayesflow/networks/transformers/fusion_transformer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
@serializable("bayesflow.networks")
1414
class FusionTransformer(SummaryNetwork):
15-
"""Implements a more flexible version of the TimeSeriesTransformer that applies a series of self-attention layers
15+
"""
16+
(SN) Implements a more flexible version of the TimeSeriesTransformer that applies a series of self-attention layers
1617
followed by cross-attention between the representation and a learnable template summarized via a recurrent net."""
1718

1819
def __init__(

0 commit comments

Comments
 (0)