You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also install a triple backend cuda environment using `cuda.yaml`:
95
+
You can set an environment variable to choose the default backend. We recommend defaulting to jax:
75
96
76
97
```bash
77
-
conda env create --file cuda.yaml --name bf-cuda
98
+
conda env config vars set KERAS_BACKEND=jax
78
99
```
79
100
80
-
Note that we cannot guarantee that this environment file will always work,
81
-
as it is not tested frequently or across devices.
82
-
It is provided merely as a convenience. For reliability, install only a single backend.
101
+
Note that you will have to re-activate the environment for the changes to take effect.
83
102
84
103
### 3. Implement your changes
85
104
@@ -138,7 +157,8 @@ z = keras.ops.convert_to_numpy(x)
138
157
139
158
The documentation uses [sphinx](https://www.sphinx-doc.org/) and relies on [numpy style docstrings](https://numpydoc.readthedocs.io/en/latest/format.html) in classes and functions.
140
159
141
-
Run the following command to install all necessary packages for setting up documentation generation:
160
+
If you haven't done so earlier, run the following command to install all necessary packages for setting up
If you don't know which backend to use, we recommend JAX as it is currently
75
-
the fastest backend.
81
+
If you don't know which backend to use, we recommend JAX as it is currently the fastest backend.
76
82
77
-
Once installed, [set the backend environment variable as required by keras](https://keras.io/getting_started/#configuring-your-backend). For example, inside your Python script write:
83
+
Once installed, [set the backend environment variable as required by keras](https://keras.io/getting_started/#configuring-your-backend).
84
+
For example, inside your Python script write:
78
85
79
86
```python
80
87
import os
@@ -88,31 +95,19 @@ If you use conda, you can alternatively set this individually for each environme
88
95
conda env config vars set KERAS_BACKEND=jax
89
96
```
90
97
91
-
This way, you also don't have to manually set the backend every time you are starting Python to use BayesFlow.
92
-
93
-
**Caution:** Some people report that the IDE (e.g., VSCode or PyCharm) can silently overwrite environment variables. If you have set your backend as an environment variable and you still get keras-related import errors when loading BayesFlow, these IDE shenanigans might be the culprit. Try setting the keras backend in your Python script via `import os; os.environ["KERAS_BACKEND"] = "<YOUR-BACKEND>"`.
94
-
95
-
### Using pip
96
-
97
-
You can install the Bayesflow from Github with pip:
98
+
Or just plainly set the environment variable in your shell:
This way, you also don't have to manually set the backend every time you are starting Python to use BayesFlow.
104
105
105
-
Bayesflow is currently not conda-installable.
106
+
**Caution:** Some development environments (e.g., VSCode or PyCharm) can silently overwrite environment variables. If you have set your backend as an environment variable and you still get keras-related import errors when loading BayesFlow, these IDE shenanigans might be the culprit. Try setting the keras backend in your Python script via `import os; os.environ["KERAS_BACKEND"] = "<YOUR-BACKEND>"`.
106
107
107
108
### From Source
108
109
109
-
If you want to contribute to BayesFlow, we recommend installing it from source:
"We have yet to fully explore the potential of amortized inference. For higher-dimensional problems, we can train a summary network jointly with the inference network, eliminating the need to manually design summary statistics as required in ABC. Additionally, the trained approximator can be seamlessly transferred to new datasets, enabling inference without retraining. Even in this simple example, we see that training the approximator required fewer simulations than running the ABC, which is particularly beneficial for computationally expensive simulators.\n"
0 commit comments