-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples #3
Comments
It might also be good to do a bare-bones example of cosmological inference with this on a GPU, since that's the main reason we developed this. |
Good idea, I can probably modify my notebook from last week. |
See #7 |
Hi, I am struggling to select the backend. I used the import numpy as np
import wcosmo
def set_backend(backend):
from importlib import import_module
np_modules = dict(
numpy="numpy",
jax="jax.numpy",
cupy="cupy",
)
linalg_modules = dict(
numpy="scipy.linalg",
jax="jax.scipy.linalg",
cupy="cupyx.scipy.linalg",
)
setattr(wcosmo.wcosmo, "xp", import_module(np_modules[backend]))
setattr(wcosmo.utils, "xp", import_module(np_modules[backend]))
toeplitz = getattr(import_module(linalg_modules[backend]), "toeplitz")
setattr(wcosmo.utils, "toeplitz", toeplitz) |
I suspect this example is out of date, there are now additional submodules that need to have these updated. The easiest solution if you're happy with some additional dependencies is to install [project.entry-points."gwpopulation.xp"]
wcosmo = "wcosmo.wcosmo"
wcosmo-analytic = "wcosmo.analytic"
wcosmo-astropy = "wcosmo.astropy"
wcosmo-integrate = "wcosmo.integrate"
wcosmo-taylor = "wcosmo.taylor"
wcosmo-utils = "wcosmo.utils"
[project.entry-points."gwpopulation.scs"]
wcosmo-analytic = "wcosmo.analytic"
[project.entry-points."gwpopulation.other"]
wcosmo-taylor = "wcosmo.taylor:scipy.linalg.toeplitz" |
Can you also guide me on how to use units inside jit/grad/vmap transforms? |
Add examples demonstrating
jax
/numpy
backendsA decent amount of this is already being done in #1
The text was updated successfully, but these errors were encountered: