Skip to content

Commit

Permalink
fix: Move mvscale import to be conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
aseyboldt committed Nov 14, 2024
1 parent 9736963 commit 3f64e42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/nutpie/transform_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def make_transform_adapter(
import flowjax
import flowjax.train
import flowjax.flows
from flowjax.bijections import mvscale
import optax
import traceback
from paramax import Parameterize, unwrap
Expand Down Expand Up @@ -164,6 +163,8 @@ def make_layer(key, is_last=False):
flow = flowjax.flows._add_default_permute(coupling, n_dim, key_permute)

if scale_layer:
from flowjax.bijections import mvscale

bijections = list(flow.bijections)
bijections.append(mvscale.MvScale4(jnp.ones(n_dim) * 1e-5))
# bijections.append(mvscale.MvScale3(jnp.ones(n_dim) * 1e-5))
Expand Down

0 comments on commit 3f64e42

Please sign in to comment.