Skip to content

Commit

Permalink
Change order to reflect theory and papers -> rotation then coupling t…
Browse files Browse the repository at this point in the history
…hen actnorm
  • Loading branch information
stefanradev93 committed Jun 20, 2024
1 parent f80d83d commit 793eaa3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bayesflow/networks/coupling_flow/coupling_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class CouplingFlow(InferenceNetwork):
def __init__(
self,
depth: int = 6,
subnet: str = "resnet",
subnet: str = "default",
transform: str = "affine",
permutation: str | None = None,
use_actnorm: bool = True,
Expand All @@ -52,14 +52,15 @@ def __init__(

self.invertible_layers = []
for i in range(depth):
if use_actnorm:
self.invertible_layers.append(ActNorm(**kwargs))

self.invertible_layers.append(DualCoupling(subnet, transform, **kwargs))

if (p := find_permutation(permutation, **kwargs)) is not None:
self.invertible_layers.append(p)

self.invertible_layers.append(DualCoupling(subnet, transform, **kwargs))

if use_actnorm:
self.invertible_layers.append(ActNorm(**kwargs))

# noinspection PyMethodOverriding
def build(self, xz_shape, conditions_shape=None):
super().build(xz_shape)
Expand Down

0 comments on commit 793eaa3

Please sign in to comment.