Skip to content

Commit

Permalink
Merge pull request #415 from mj-will/prepare-v0.13.2
Browse files Browse the repository at this point in the history
REL: prepare v0.13.2
  • Loading branch information
mj-will authored Aug 13, 2024
2 parents be2424c + 841ddd3 commit 06af460
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.13.2]

### Fixed

- Handle error when `linear_transform='None'` which occurs when using `bilby_pipe` after the `flow_config` changes (https://github.com/mj-will/nessai/pull/414)

## [0.13.1]

### Changed
Expand Down Expand Up @@ -661,7 +667,8 @@ First public release.

- Original `GWFlowProposal` method renamed to `LegacyGWFlowProposal`. Will be removed in the next release.

[Unreleased]: https://github.com/mj-will/nessai/compare/v0.13.1...HEAD
[Unreleased]: https://github.com/mj-will/nessai/compare/v0.13.2...HEAD
[0.13.2]: https://github.com/mj-will/nessai/compare/v0.13.1...v0.13.2
[0.13.1]: https://github.com/mj-will/nessai/compare/v0.13.0...v0.13.1
[0.13.0]: https://github.com/mj-will/nessai/compare/v0.12.0...v0.13.0
[0.12.0]: https://github.com/mj-will/nessai/compare/v0.11.0...v0.12.0
Expand Down
6 changes: 5 additions & 1 deletion nessai/flows/nsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,14 @@ def spline_constructor(i):

transforms_list = []
for i in range(num_layers):
if linear_transform is not None:
if (
linear_transform is not None
and linear_transform.lower() != "none"
):
transforms_list.append(
create_linear_transform(linear_transform, features)
)

transforms_list.append(spline_constructor(i))
if batch_norm_between_layers:
transforms_list.append(transforms.BatchNorm(features=features))
Expand Down
5 changes: 4 additions & 1 deletion nessai/flows/realnvp.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ def create_net(in_features, out_features):
transforms.normalization.ActNorm(features=features)
)

if linear_transform is not None:
if (
linear_transform is not None
and linear_transform.lower() != "none"
):
layers.append(
create_linear_transform(linear_transform, features)
)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_flows/test_specific_flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
dict(linear_transform="svd"),
dict(linear_transform="lu"),
dict(linear_transform=None),
dict(linear_transform="None"),
dict(mask=np.array([[1, -1], [-1, 1]])),
dict(mask=[1, -1]),
dict(pre_transform="batch_norm"),
Expand Down Expand Up @@ -75,6 +76,7 @@ def test_realnvp_actnorm_batchnorm():
dict(linear_transform="svd"),
dict(linear_transform="lu"),
dict(linear_transform=None),
dict(linear_transform="None"),
dict(num_bins=10),
],
)
Expand Down

0 comments on commit 06af460

Please sign in to comment.