Commit e8d2f2c
serialization: apply new scheme for package (breaking change) (#457)
* serialization: apply new scheme for `package` (breaking)
- introduces new policy for consistent naming for serilization (see #451
for a discussion): standard is the path of a module a class resides
in, trucated at depth to. So for all class in bayesflow.networks, we
set package="bayesflow.networks", even if the live in the
bayesflow.networks.mlp submodule.
- The `serializable` decorator checks this and errors if this is not
followed. The check can be disabled for certain cases (e.g., classes
in the experimental module, that might eventually live somewhere
else).
- After this commit, previously saved models will not be loadable. As we
introduced a bug regarding this anyway (#451), we will accept this and
should inform users about it.
- usage of direct calls to `keras.saving.register_keras_serializable`
were replaced with our custom decorator.
* update serilization policy in dev docs
* README: add not regarding breaking changes until 2.1 release
* standardize use of serializable decorator
* [no ci] change (de)serialize to new pipeline in transform
* serialization check: exempt classes not in bayesflow module
This should ensure that users that try to use our decorator with
external classes do not encounter the error. Possible edge case: they
also name their module "bayesflow".
---------
Co-authored-by: LarsKue <[email protected]>1 parent ddd4ea8 commit e8d2f2c
File tree
90 files changed
+155
-116
lines changed- bayesflow
- adapters
- transforms
- approximators
- distributions
- experimental
- cif
- free_form_flow
- resnet
- links
- metrics
- networks
- consistency_models
- coupling_flow
- couplings
- permutations
- transforms
- deep_set
- embeddings
- flow_matching
- mlp
- residual
- time_series_network
- transformers
- scores
- utils
- wrappers/mamba
- docsrc/source/development
- tests
- test_utils
- test_workflows
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
90 files changed
+155
-116
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
0 commit comments