keras 2.6.1
-
New family of preprocessing layers. These are the spiritual successor to the
tfdatasets::step_*family of data transformers (to be deprecated in a future release). See the new vignette "Working with Preprocessing Layers" for details.
New functions:Image preprocessing:
layer_resizing()layer_rescaling()layer_center_crop()
Image augmentation:
layer_random_crop()layer_random_flip()layer_random_translation()layer_random_rotation()layer_random_zoom()layer_random_contrast()layer_random_height()layer_random_width()
Categorical features preprocessing:
layer_category_encoding()layer_hashing()layer_integer_lookup()layer_string_lookup()
Numerical features preprocessing:
layer_normalization()layer_discretization()
These join the previous set of text preprocessing functions, each of which have some minor changes:
layer_text_vectorization()(changed arguments)get_vocabulary()set_vocabulary()adapt()
-
adapt()changes:- Now accepts all features preprocessing layers, previously
onlylayer_text_vectorization()instances were valid. reset_stateargument is removed. It only ever accepted the default value ofTRUE.- New arguments
batch_sizeandsteps. - Now returns the adapted layer invisibly for composability with
%>%(previously returnedNULL)
- Now accepts all features preprocessing layers, previously
-
get_vocabulary()gains ainclude_special_tokensargument. -
set_vocabulary():- Now returns the adapted layer invisibly for composability with
%>%(previously returnedNULL) - Signature simplified. Deprecated arguments (
df_dataoov_df_value) are now subsumed in....
- Now returns the adapted layer invisibly for composability with
-
layer_text_vectorization():- valid values for argument
output_modechange:"binary"is renamed to"multi_hot"and
"tf-idf"is renamed to"tf_idf"(backwards compatibility is preserved). - Fixed an issue where valid values of
output_mode = "int"would incorrectly
return a ragged tensor output shape.
- valid values for argument
-
Existing layer instances gain the ability to be added to sequential models via a call. E.g.:
layer <- layer_dense(units = 10) model <- keras_model_sequential(input_shape = c(1,2,3)) %>% layer()
-
Functions in the merging layer family gain the ability to return a layer instance if
the first argumentinputsis missing. (affected:layer_concatenate(),layer_add(),
layer_subtract(),layer_multiply(),layer_average(),layer_maximum(),
layer_minimum(),layer_dot()) -
%py_class%gains the ability to delay initializing the Python session until first use.
It is now safe to implement and export%py_class%objects in an R package. -
Fixed an issue in
layer_input()where passing a tensorflowDTypeobjects to argumentdtypewould throw an error. -
Fixed an issue in
compile()where passing an R function via an in-line
call would result in an error from subsequentfit()calls.
(e.g.,compile(loss = function(y_true, y_pred) my_loss(y_true, y_pred))
now succeeds) -
clone_model()gains aclone_functionargument that allows you to customize each layer as it is cloned. -
Bumped minimum R version to 3.4. Expanded CI to test on all supported R version. Fixed regression that prevented package installation on R <= 3.4