keras 2.9.0
-
New functions for constructing custom keras subclasses:
new_model_class()
new_layer_class()
new_callback_class()
new_metric_class()
new_loss_class()
new_learning_rate_schedule_class()
.
Also provided is
mark_active()
, a decorator for indicating a class method
should be an active binding (i.e., decorated with Python's@property
).
mark_active()
can be used in thenew_*_class
family of class constructors
as well as%py_class%
. -
r_to_py()
method for R6 classes and%py_class%
gain support for
private
fields and methods. Any R objects stored inprivate
will only be
available to methods, and will not be converted to Python. -
New family of functions for controlling optimizer learning rates during training:
learning_rate_schedule_cosine_decay()
learning_rate_schedule_cosine_decay_restarts()
learning_rate_schedule_exponential_decay()
learning_rate_schedule_inverse_time_decay()
learning_rate_schedule_piecewise_constant_decay()
learning_rate_schedule_polynomial_decay()
Also, a function for constructing custom learning rate schedules:
new_learning_rate_schedule_class()
. -
New L2 unit normilization layer:
layer_unit_normalization()
. -
New
regularizer_orthogonal
, a regularizer that encourages
orthogonality between the rows (or columns) or a weight matrix. -
New
zip_lists()
function for transposing lists, optionally matching by name. -
New
plot()
S3 method for models. -
pydot
is now included in the packages installed byinstall_keras()
. -
The
png
package is now listed under Suggests. -
The
%<>%
assignment pipe from magrittr is exported. -
format()
method for keras models (and derivative methodsprint()
,summary()
,
str()
, andpy_str()
):- gain a new arg
compact
. IfTRUE
(the default) white-space only
lines are stripped out ofmodel.summary()
. - If any layers are marked non-trainable or frozen, the model summary
now includes a "Trainable" column, indicating if a layer is frozen.
- gain a new arg
-
freeze_weights()
andunfreeze_weights()
:- gain a flexible
which
argument that can accept layer names (as character strings),
an integer vector, a boolean vector, or a function that returns a boolean
when called with a layer. (see updated examples in?freeze_weights
from
andto
arguments gain the ability to accept negative integers,
to specify layers counting from the end of the layers list.
- gain a flexible
-
get_weights()
gains atrainable
argument that can acceptTRUE
orFALSE
,
allowing for returning only the unfrozen or frozen weights, respectively. -
timeseries_dataset_from_array()
:- R arrays are now cast to the floatx dtype ("float32" by default)
start_index
andend_index
now are 1-based.
-
image_dataset_from_directory()
gains acrop_to_aspect_ratio
argument which
can be used to prevent distorting images when resizing to a new aspect ratio. -
Layer
is deprecated, superseded bynew_layer_class()
. -
load_model_tf()
argumentcustom_objects
gains the ability to accept an
unnamed list (e.g, of objects returned bynew_layer_class()
or similar).
Appropriate names for the supplied objects are automatically inferred. -
Fixed an issue where negative values less than -1 supplied to
axis
arguments were selecting the wrong axis. -
get_layer()
gains the ability to accept negative values for theindex
argument. -
Fixed warning from
create_layer_wrapper()
when the custom layer didn't have
an overriddeninitialize
or__init__
method. -
Backend functions:
- k_clip()
min_value
andmax_value
gain default values ofNULL
,
can be omitted.NULL
is taken as -Inf or Inf, respectively. - k_squeeze():
axis
argument can be omitted, in which case all axes of size 1 are dropped. - k_tile():
n
argument can now be supplied as a tensor. - New function
k_unstack()
.
- k_clip()
-
KerasTensor objects (e.g, returned by
layer_input()
) now inherit S3 methods
for"tensorflow.tensor"
. -
plot.keras_training_history()
no longer issues message
`geom_smooth()` using formula 'y ~ x'
whenmethod = "ggplot2"
. -
print
and related methods for models (format
,summary
) now accept
awidth
argument. -
evaluate()
,fit()
, andpredict()
methods for keras Models now default
toverbose = "auto"
, with verbosity adjusted appropriately based on calls to
keras$utils$disable_interactive_logging()
, and contexts like
ParameterServerStrategy
. -
install_keras()
now acceptsversion = "release-cpu"
as a valid specification.