keras3 1.3.0
-
Keras now uses
reticulate::py_require()to resolve Python dependencies.
Callinginstall_keras()is no longer required (but is still supported). -
use_backend()gains agpuargument, to specify if a GPU-capable set of
dependencies should be resolved bypy_require(). -
The progress bar in
fit(),evaluate()andpredict()now
defaults to not presenting during testthat tests. -
dotty::.is now reexported. -
%*%now dispatches toop_matmul()for tensorflow tensors, which
has relaxed shape constraints compared totf$matmul(). -
Fixed an issue where calling a
MetricandLossobject
with unnamed arguments would error.
Added compatibility with Keras v3.8.0. User-facing changes:
-
New symbols:
activation_sparse_plus()activation_sparsemax()activation_threshold()layer_equalization()layer_mix_up()layer_rand_augment()layer_random_color_degeneration()layer_random_color_jitter()layer_random_grayscale()layer_random_hue()layer_random_posterization()layer_random_saturation()layer_random_sharpness()layer_random_shear()op_diagflat()op_sparse_plus()op_sparsemax()op_threshold()op_unravel_index()
-
Add argument axis to tversky loss
-
New: ONNX model export with
export_savedmodel() -
Doc improvements and bug fixes.
-
JAX specific changes: Add support for JAX named scope
-
TensorFlow specific changes: Make
random_shuffle()XLA compilable
Added compatibility with Keras v3.7.0. User-facing changes:
New functions
Activations
activation_celu()activation_glu()activation_hard_shrink()activation_hard_tanh()activation_log_sigmoid()activation_soft_shrink()activation_squareplus()activation_tanh_shrink()
Configuration
config_disable_flash_attention()config_enable_flash_attention()config_is_flash_attention_enabled()
Layers and Initializers
initializer_stft()layer_max_num_bounding_boxes()layer_stft_spectrogram()
Losses and Metrics
loss_circle()metric_concordance_correlation()metric_pearson_correlation()
Operations
op_celu()op_exp2()op_glu()op_hard_shrink()op_hard_tanh()op_ifft2()op_inner()op_soft_shrink()op_squareplus()op_tanh_shrink()
New arguments
callback_backup_and_restore(): Addeddouble_checkpointargument to save a fallback checkpointcallback_tensorboard(): Added support forprofile_batchargumentlayer_group_query_attention(): Addedflash_attentionandseedargumentslayer_multi_head_attention(): Addedflash_attentionargumentmetric_sparse_top_k_categorical_accuracy(): Addedfrom_sorted_idsargument
Performance improvements
- Added native Flash Attention support for GPU (via cuDNN) and TPU (via Pallas kernel) in JAX backend
- Added opt-in native Flash Attention support for GPU in PyTorch backend
- Enabled additional kernel fusion via bias_add in TensorFlow backend
- Added support for Intel XPU devices in PyTorch backend
install_keras()changes: if a GPU is available, the default is now to
install a CPU build of TensorFlow and a GPU build of JAX. To use a GPU in the
current session, calluse_backend("jax").
Added compatibility with Keras v3.6.0. User-facing changes:
Breaking changes:
- When using
get_file()withextract = TRUEoruntar = TRUE, the return value
is now the path of the extracted directory, rather than the path of the archive.
Other changes and additions:
-
Logging is now asynchronous in
fit(),evaluate(), andpredict(). This
enables 100% compact stacking oftrain_stepcalls on accelerators (e.g. when
running small models on TPU).- If you are using custom callbacks that rely on
on_batch_end, this will
disable async logging. You can re-enable it by adding
self$async_safe <- TRUEto your callbacks. Note that the TensorBoard
callback is not considered async-safe by default. Default callbacks like the
progress bar are async-safe.
- If you are using custom callbacks that rely on
-
New bitwise operations:
op_bitwise_and()op_bitwise_invert()op_bitwise_left_shift()op_bitwise_not()op_bitwise_or()op_bitwise_right_shift()op_bitwise_xor()
-
New math operations:
op_logdet()op_trunc()op_histogram()
-
New neural network operation:
op_dot_product_attention() -
New image preprocessing layers:
layer_auto_contrast()layer_solarization()
-
New Model functions
get_state_tree()andset_state_tree(), for retrieving
all model variables, including trainable, non-trainable, optimizer variables,
and metric variables. -
New
layer_pipeline()for composing a sequence of layers. This class is useful
for building a preprocessing pipeline. Compared to akeras_model_sequential(),
layer_pipeline()has a few key differences:- It's not a Model, just a plain layer.
- When the layers in the pipeline are compatible with
tf.data, the pipeline
will also remaintf.datacompatible, regardless of the backend you use.
-
New argument:
export_savedmodel(verbose = ) -
New argument:
op_normalize(epsilon = ) -
Various documentation improvements and bug fixes.