Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Releases: rstudio/keras3

keras 2.16.1

13 Apr 18:11
@t-kalinowski t-kalinowski
8886549
This commit was created on GitHub.com and signed with GitHub’s verified signature.
GPG key ID: B5690EEEBB952194
Verified
Learn about vigilant mode.

Choose a tag to compare

  • Internal updates for CRAN R-devel (4.6)
Loading

keras3 1.5.1

13 Feb 16:38
@t-kalinowski t-kalinowski

Choose a tag to compare

  • use_backend("jax") on macOS now defaults to gpu = FALSE, so jax-metal
    is no longer selected automatically.

  • JAX now registers backend tensor S3 methods for jax.core.Tracer objects,
    improving compatibility for traced computations.

  • On Linux, tensorflow-cpu is no longer pinned to 2.18.* when resolving
    Python dependencies.

Assets 2
Loading

keras3 1.5.0

01 Feb 16:19
@t-kalinowski t-kalinowski

Choose a tag to compare

  • register_keras_serializable() now updates R layer wrappers to use the
    registered class when called.

  • Numeric ops now include op_layer_normalization(), op_cbrt(),
    op_corrcoef(), op_deg2rad(), op_heaviside(), op_sparse_sigmoid(),
    and activation_sparse_sigmoid(). op_dot_product_attention() gains
    attn_logits_soft_cap.

  • Added signal window operations: op_bartlett(), op_blackman(),
    op_hamming(), op_hanning(), and op_kaiser().

  • Added loss_categorical_generalized_cross_entropy() for training with noisy
    labels.

  • LoRA-enabled layers (layer_dense(), layer_embedding(),
    layer_einsum_dense()) gain a lora_alpha argument to scale the adaptation
    delta independently of the chosen rank.

  • Added complex-valued helpers: S3 Arg() methods for tensors, op_angle(),
    and conversions op_view_as_real() / op_view_as_complex().

  • Added the Muon optimizer via optimizer_muon().

  • Added elastic deformation utilities for images:
    layer_random_elastic_transform() and the lower-level
    op_image_elastic_transform().

  • Added as.array() support for PIL.Image.Image objects.

  • Transposed convolution utilities now follow the latest Keras API:
    op_conv_transpose() defaults to strides = 1, and
    layer_conv_*_transpose() layers expose output_padding for precise shape
    control.

  • register_keras_serializable() now returns a registered Python callable,
    making it easier to use with bare R functions.

  • save_model_weights() adds a max_shard_size argument to split large weight
    files into manageable shards.

  • keras_variable() now accepts a synchronization argument for distributed
    strategies.

  • layer_layer_normalization() now omits the
    rms_scaling argument.

  • Merging layers now capture ... with tidy dots (#1525).

  • JAX _DimExpr shapes now remain symbolic when combined with R double scalars.

  • layer_reshape() now accepts -1 as a sentinel for an automatically
    calculated axis size.

  • layer_torch_module_wrapper() gains an output_shape argument to help Keras
    infer shapes when wrapping PyTorch modules.

  • Layer$add_weight() gains an overwrite_with_gradient option, and layers
    now provide a symbolic_call() method.

  • Added str() S3 method for Keras Variables.

  • JAX arrays now have S3 methods for str(), as.array(), as.double(),
    as.integer(), and as.numeric().

  • Backend tensors now support base array helpers: t(), aperm(), and
    all.equal().

  • Added pillar::type_sum() for JAX variables and JaxVariable; str() now
    covers the new JAX variable class.

  • Added training caps via config_max_epochs(), config_set_max_epochs(),
    config_max_steps_per_epoch(), and config_set_max_steps_per_epoch(). The
    caps can also be set via the KERAS_MAX_EPOCHS and
    KERAS_MAX_STEPS_PER_EPOCH environment variables. Added
    config_is_nnx_enabled() to check whether JAX NNX features are enabled.

  • Built-in dataset loaders now accept convert = FALSE to return NumPy arrays
    instead of R arrays.

  • plot(history, theme_bw = TRUE) is now compatible with ggplot2 3.4.0.

  • plot(model) now reads DPI from options(keras.plot.model.dpi = 200)
    (default is 200).

  • Reexported reticulate functions: py_help(), py_to_r(), r_to_py(),
    py_require(), and import().

  • super()$initialize() now works in subclassed Keras classes, and super()
    behavior is improved in subclasses.

  • use_backend("jax", gpu = TRUE) now declares dependencies compatible with
    keras-hub.

  • Exported named_list().

  • Switching backends twice in a row now works reliably.

  • layer_dropout() now preserves noise_shape as an integer array so
    length-one shapes are passed to Keras as iterables.

Loading

keras 2.16.0

18 Aug 19:37
@t-kalinowski t-kalinowski

Choose a tag to compare

  • Updates for usage with Legacy Keras (#1515).

    • A package startup message is now displayed encouraging users to migrate to keras3.
    • New function py_require_legacy_keras().
    • install_keras() now installs legacy keras tf-keras.
    • TF_USE_LEGACY_KERAS=1 envvar is now set on package startup.
  • Documentation updates for CRAN (#1514)

Loading

keras3 1.4.0

05 May 13:01
@t-kalinowski t-kalinowski
b231690
This commit was created on GitHub.com and signed with GitHub’s verified signature.
GPG key ID: B5690EEEBB952194
Verified
Learn about vigilant mode.

Choose a tag to compare

  • New op_subset() and x@r[...] methods enable tensor subsetting
    using R's [ semantics and idioms.

  • New subset assignment methods implemented for tensors:
    op_subset(x, ...) <- value and x@r[...] <- value

  • Breaking changes: All operations prefixed with op_ now return 1-based
    indices by default. The following functions that return or consume indices have
    changed:
    op_argmax(), op_argmin(), op_top_k(), op_argpartition(),
    op_searchsorted(), op_argsort(), op_digitize(), op_nonzero(),
    op_split(), op_trace(), op_swapaxes(), op_ctc_decode(),
    op_ctc_loss(), op_one_hot(), op_arange()

  • op_arange() now matches the semantics of base::seq(). By default
    it starts, includes the end value, and automatically infers step direction.

  • op_one_hot() now infers num_classes if supplied a factor.

  • op_hstack() and op_vstack() now accept arguments passed via ....

  • application_decode_predictions() now returns a processed data frame by
    default or a decoder function if predictions are missing.

  • application_preprocess_inputs() returns a preprocessor function if
    inputs are missing.

  • Various new examples added to documentation,
    including op_scatter(), op_switch(), and op_nonzero().

  • New x@py[...] accessor introduced for Python-style 0-based indexing of tensors.

  • New Summary group generic method for keras_shape, enabling usage like
    prod(shape(3, 4))

  • KERAS_HOME is now set to tools::R_user_dir("keras3", "cache") if
    ~/.keras does not exist and KERAS_HOME is unset.

  • new op_convert_to_array() to convert a tensor to an R array.

  • Added compatibility with Keras v3.9.2.

    • New operations added:

      • op_rot90()
      • op_rearrange() (Einops-style)
      • op_signbit()
      • op_polar()
      • op_image_perspective_transform()
      • op_image_gaussian_blur()
    • New layers introduced:

      • layer_rms_normalization()
      • layer_aug_mix()
      • layer_cut_mix()
      • layer_random_invert()
      • layer_random_erasing()
      • layer_random_gaussian_blur()
      • layer_random_perspective()
    • layer_resizing() gains an antialias argument.

    • keras_input(), keras_model_sequential(), and op_convert_to_tensor() gain a ragged argument.

    • layer$pop_layer() gains a rebuild argument and now returns the removed layer.

    • New rematerialized_call() method added to Layer objects.

    • Documentation improvements and minor fixes.

  • Fixed an issue where op_shape() would sometimes return a TensorFlow TensorShape

  • Fixes for metric_iou(), op_top_k(), and op_eye() being called with R atomic doubles

Loading

keras3 1.3.0

03 Mar 11:50
@t-kalinowski t-kalinowski
e357997
This commit was created on GitHub.com and signed with GitHub’s verified signature.
GPG key ID: B5690EEEBB952194
Verified
Learn about vigilant mode.

Choose a tag to compare

  • Keras now uses reticulate::py_require() to resolve Python dependencies.
    Calling install_keras() is no longer required (but is still supported).

  • use_backend() gains a gpu argument, to specify if a GPU-capable set of
    dependencies should be resolved by py_require().

  • The progress bar in fit(), evaluate() and predict() now
    defaults to not presenting during testthat tests.

  • dotty::. is now reexported.

  • %*% now dispatches to op_matmul() for tensorflow tensors, which
    has relaxed shape constraints compared to tf$matmul().

  • Fixed an issue where calling a Metric and Loss object
    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(): Added double_checkpoint argument to save a fallback checkpoint
  • callback_tensorboard(): Added support for profile_batch argument
  • layer_group_query_attention(): Added flash_attention and seed arguments
  • layer_multi_head_attention(): Added flash_attention argument
  • metric_sparse_top_k_categorical_accuracy(): Added from_sorted_ids argument

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, call use_backend("jax").

Added compatibility with Keras v3.6.0. User-facing changes:

Breaking changes:

  • When using get_file() with extract = TRUE or untar = 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(), and predict(). This
    enables 100% compact stacking of train_step calls 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 <- TRUE to your callbacks. Note that the TensorBoard
      callback is not considered async-safe by default. Default callbacks like the
      progress bar are async-safe.
  • 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() and set_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 a keras_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 remain tf.data compatible, regardless of the backend you use.
  • New argument: export_savedmodel(verbose = )

  • New argument: op_normalize(epsilon = )

  • Various documentation improvements and bug fixes.

Loading

keras3 1.2.0

06 Sep 11:46
@t-kalinowski t-kalinowski
10983c8
This commit was created on GitHub.com and signed with GitHub’s verified signature.
GPG key ID: B5690EEEBB952194
Verified
Learn about vigilant mode.

Choose a tag to compare

  • Added compatibility with Keras v3.5.0. User facing changes:

    • New functions:
      • op_associative_scan()
      • op_searchsorted()
      • optimizer_lamb()
    • keras$DTypePolicy instances can now be supplied to dtype argument for
      losses, metrics, and layers.
    • Add integration with the Hugging Face Hub. You can now save models to
      Hugging Face Hub directly save_model() and load .keras models directly
      from Hugging Face Hub with load_model().
    • Added compatibility with NumPy 2.0.
    • Improved keras$distribution API support for very large models.
    • Bug fixes and performance improvements.
    • Add data_format argument to layer_zero_padding_1d() layer.
    • Miscellaneous documentation improvements.
    • Bug fixes and performance improvements.
Loading
mytarmail reacted with thumbs up emoji
1 person reacted

keras3 1.1.0

17 Jul 13:54
@t-kalinowski t-kalinowski

Choose a tag to compare

  • Fixed issue where GPUs would not be found when running on Windows under WSL Linux.
    (reported in #1456, fixed in #1459)

  • keras_shape objects (as returned by keras3::shape()) gain == and != methods.

  • Fixed warning from tfruns::training_run() being unable to log optimizer learning rate.

  • Added compatibility with Keras v3.4.1 (no R user facing changes).

  • Added compatibility with Keras v3.4.0. User facing changes:

    • New functions:

      • op_argpartition()
      • op_map()
      • op_scan()
      • op_switch()
      • op_dtype()
      • op_lstsq()
      • op_image_hsv_to_rgb()
      • op_image_rgb_to_hsv()
    • Changes:

      • Added support for arbitrary, deeply nested input/output structures in
        Functional models (e.g. lists of lists of lists of inputs or outputs...)
      • Add support for optional Functional inputs.
        • keras_input() gains an optional argument.
        • keras_model_sequential() gains a input_optional argument.
      • Add support for float8 inference for Dense and EinsumDense layers.
      • Enable layer_feature_space() to be used in a {tfdatasets} pipeline even
        when the backend isn't TensorFlow.
      • layer_string_lookup() can now take tf$SparseTensor() as input.
      • layer_string_lookup() returns "int64" dtype by default in more modes now.
      • Layer() instances gain attributes path and quantization_mode.
      • Metric()$variables is now recursive.
      • Add training argument to Model$compute_loss().
      • split_dataset() now supports nested structures in dataset.
      • All applications gain a name argument, accept a custom name.
      • layer_multi_head_attention() gains a seed argument.
      • All losses gain a dtype argument.
      • loss_dice() gains an axis argument.
      • op_ctc_decode(), new default for mask_index = 0
      • All op_image_* functions now use default data_format value
        to config_image_data_format()
      • op_isclose() gains arguments rtol, atol, equal_nan.
      • save_model() gains argument zipped.
      • Bugs fixes and performance improvements.
Loading
jonbry and t-kalinowski reacted with hooray emoji
2 people reacted

keras3 1.0.0

21 May 17:13
@t-kalinowski t-kalinowski

Choose a tag to compare

  • Chains of layer_* calls with |> now instantiate layers in the
    same order as %>% pipe chains: left-hand-side first (#1440).

  • iterate(), iter_next() and as_iterator() are now reexported from reticulate.

User facing changes with upstream Keras v3.3.3:

  • new functions: op_slogdet(), op_psnr()

  • clone_model() gains new args: call_function, recursive
    Updated example usage.

  • op_ctc_decode() strategy argument has new default: "greedy".
    Updated docs.

  • loss_ctc() default name fixed, changed to "ctc"

User facing changes with upstream Keras v3.3.2:

  • new function: op_ctc_decode()

  • new function: op_eigh()

  • new function: op_select()

  • new function: op_vectorize()

  • new function: op_image_rgb_to_grayscale()

  • new function: loss_tversky()

  • new args: layer_resizing(pad_to_aspect_ratio, fill_mode, fill_value)

  • new arg: layer_embedding(weights) for providing an initial weights matrix

  • new args: op_nan_to_num(nan, posinf, neginf)

  • new args: op_image_resize(crop_to_aspect_ratio, pad_to_aspect_ratio, fill_mode, fill_value)

  • new args: op_argmax(keepdims) and op_argmin(keepdims)

  • new arg: clear_session(free_memory) for clearing without invoking the garbage collector.

  • metric_kl_divergence() and loss_kl_divergence() clip inputs
    (y_true and y_pred) to the [0, 1] range.

  • new Layer() attributes: metrics, dtype_policy

  • Added initial support for float8 training

  • layer_conv_*d() layers now support LoRa

  • op_digitize() now supports sparse tensors.

  • Models and layers now return owned metrics recursively.

  • Add pickling support for Keras models. (e.g., via reticulate::py_save_object())
    Note that pickling is not recommended, prefer using Keras saving APIs.

Loading
mytarmail and PetoLau reacted with thumbs up emoji t-kalinowski and jonbry reacted with hooray emoji
4 people reacted

keras 2.15.0

23 Apr 12:59
@t-kalinowski t-kalinowski

Choose a tag to compare

  • Default TensorFlow/Keras version installed by install_keras() is now 2.15.
    This is the last Tensorflow version where where Keras 2 is the default.
    To use Keras with Tensorflow v2.16 and up, use the new {keras3} R package.

  • Updates to allow both R packages {keras} and {keras3} to be loaded.

  • Updates for R-devel (4.4).

Loading
mytarmail, jonbry, PetoLau, and Broccolito reacted with thumbs up emoji
4 people reacted
Previous 1 3
Previous

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /