Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

train_on_batch

Single gradient update or model evaluation over one batch of samples.


Description

Single gradient update or model evaluation over one batch of samples.

Usage

train_on_batch(object, x, y, class_weight = NULL, sample_weight = NULL)

test_on_batch(object, x, y, sample_weight = NULL)

Arguments

object

Keras model object

x

input data, as an array or list of arrays (if the model has multiple inputs).

y

labels, as an array.

class_weight

named list mapping classes to a weight value, used for scaling the loss function (during training only).

sample_weight

sample weights, as an array.

Value

Scalar training or test loss (if the model has no metrics) or list of scalars (if the model computes other metrics). The property model$metrics_names will give you the display labels for the scalar outputs.

See Also


keras

R Interface to 'Keras'

v2.4.0
MIT + file LICENSE
Authors
Daniel Falbel [ctb, cph, cre], JJ Allaire [aut, cph], François Chollet [aut, cph], RStudio [ctb, cph, fnd], Google [ctb, cph, fnd], Yuan Tang [ctb, cph] (<https://orcid.org/0000-0001-5243-233X>), Wouter Van Der Bijl [ctb, cph], Martin Studer [ctb, cph], Sigrid Keydana [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.