Configure a Keras backend
Arguments
- backend
string, can be
"tensorflow"
,"jax"
,"numpy"
, or"torch"
.- gpu
bool, whether to use the GPU. If
NA
(default), it will attempt to detect GPU availability on Linux. On M-series Macs, it defaults toFALSE
for TensorFlow andTRUE
for JAX. On Windows, it defaults toFALSE
.
Details
These functions allow configuring which backend keras will use. Note that only one backend can be configured at a time.
The function should be called after library(keras3)
and before calling
other functions within the package (see below for an example).
There is experimental support for changing the backend after keras has
initialized. using config_set_backend()
.
library(keras3)
use_backend("tensorflow")