predict.keras.src.models.model.Model {keras3} | R Documentation |
Generates output predictions for the input samples.
Description
Generates output predictions for the input samples.
Usage
## S3 method for class 'keras.src.models.model.Model'
predict(
object,
x,
...,
batch_size = NULL,
verbose = getOption("keras.verbose", default = "auto"),
steps = NULL,
callbacks = NULL
)
Arguments
object |
Keras model object |
x |
Input samples. It could be:
|
... |
For forward/backward compatability. |
batch_size |
Integer or |
verbose |
|
steps |
Total number of steps (batches of samples)
before declaring the prediction round finished.
Ignored with the default value of |
callbacks |
List of |
Details
Computation is done in batches. This method is designed for batch processing of large numbers of inputs. It is not intended for use inside of loops that iterate over your data and process small numbers of inputs at a time.
For small numbers of inputs that fit in one batch,
directly call the model model$call
for faster execution, e.g.,
model(x)
, or model(x, training = FALSE)
if you have layers such as
BatchNormalization
that behave differently during
inference.
Value
R array(s) of predictions.
Note
See this FAQ entry
for more details about the difference between Model
methods
predict()
and call()
.
See Also
Other model training:
compile.keras.src.models.model.Model()
evaluate.keras.src.models.model.Model()
predict_on_batch()
test_on_batch()
train_on_batch()