Skip to contents

Set the default float dtype.

Usage

config_set_floatx(value)

Arguments

value

String; 'bfloat16', 'float16', 'float32', or 'float64'.

Value

No return value, called for side effects.

Note

It is not recommended to set this to "float16" for training, as this will likely cause numeric stability issues. Instead, mixed precision, which leverages a mix of float16 and float32. It can be configured by calling keras3::keras$mixed_precision$set_dtype_policy('mixed_float16').

Examples

## [1] "float32"

## [1] "float64"

# Set it back to float32
config_set_floatx('float32')

Raises

ValueError: In case of invalid value.