| importBF | R Documentation |
This function initializes the BI Python module through **reticulate**, sets up the environment, and loads the necessary 'jax' and 'jax.numpy' modules. The BI module is stored in the hidden object '.bf' for internal use, but the initialized BI object is also returned for convenience.
importBF(
platform = "cpu",
cores = NULL,
rand_seed = TRUE,
deallocate = FALSE,
print_devices_found = TRUE,
backend = "numpyro"
)
platform |
Character string, the computational platform to use (e.g. '"cpu"' or '"gpu"'). Defaults to '"cpu"'. |
cores |
Integer or 'NULL'. Number of CPU cores to use. Defaults to 'NULL'. |
rand_seed |
(Boolean): Random seed. Defaults to TRUE. |
deallocate |
Logical. Whether memory should be deallocated when not in use. Defaults to 'FALSE'. |
print_devices_found |
(bool, optional): Whether to print devices found. Defaults to TRUE. |
backend |
(str, optional): Backend to use (numpyro or tfp). Defaults to 'numpyro'. |
- Internally, this function imports the 'BI' Python package and assigns it to the hidden variable '.bf'. - It also imports 'jax' and 'jax.numpy', assigning them to 'jax' and 'jnp' respectively. - Startup messages inform the user about the imports.
An initialized BI module object (Python object via **reticulate**).
library(BayesForge)
m <- importBF()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.