Commit ce363b7
authored
refactor: unify build_posterior in base class for all trainers (#1610)
* fix: spelling update
* refactor(NeuralInference): define methods for building the posterior
* refactor(nle): update build_posterior method to use parent class implementation
* refactor(npe): update build_posterior method to use parent class implementation
* refactor(nre): update build_posterior method to use parent class implementation
* refactor(npse): implement required abstract method from parent class
* refactor(npse, fmpe): remove and replace build_posterior method with superclass method
* refactor: update build_posterior estimator annotation
* refactor: move _get_potential_function method from build_posterior to _create_posterior
* refactor: update _get_potential_function return type
* refactor: Update conditional arrangement for _create_posterior
* docs: update vector_field_potential docstring
* test(build_posterior): raise error for invalid density_estimator
* refactor(build_posterior): move estimator and prior checking into helper functions
* refactor: rearrange method order
* refactor: remove comment and update return type for abstract method train
* refactor: update method ordering for trainer classes to follow convention
* refactor(FMPE, NPSE): add vectorfield_sampling_parameters parameter
* test: update NRE_A to NRE base class
* test(FMPE, NPSE): add vectorfield_sampling_parameters to build_posterior argument1 parent 1b78d06 commit ce363b7
File tree
17 files changed
+564
-506
lines changed- docs/tutorials
- sbi/inference
- potentials
- trainers
- fmpe
- marginal
- nle
- npe
- npse
- nre
- tests
17 files changed
+564
-506
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| |||
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| 66 | + | |
63 | 67 | | |
64 | 68 | | |
65 | | - | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| |||
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| 84 | + | |
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
85 | | - | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
| |||
0 commit comments