summary.keras.src.models.model.Model {keras3} | R Documentation |
Print a summary of a Keras Model
Description
Print a summary of a Keras Model
Usage
## S3 method for class 'keras.src.models.model.Model'
summary(object, ...)
## S3 method for class 'keras.src.models.model.Model'
format(
x,
line_length = getOption("width"),
positions = NULL,
expand_nested = FALSE,
show_trainable = NA,
...,
layer_range = NULL,
compact = TRUE
)
## S3 method for class 'keras.src.models.model.Model'
print(x, ...)
Arguments
object , x |
Keras model instance |
... |
for |
line_length |
Total length of printed lines |
positions |
Relative or absolute positions of log elements in each line.
If not provided, defaults to |
expand_nested |
Whether to expand the nested models. If not provided,
defaults to |
show_trainable |
Whether to show if a layer is trainable. If not
provided, defaults to |
layer_range |
a list, tuple, or vector of 2 strings,
which is the starting layer name and ending layer name
(both inclusive) indicating the range of layers to be printed
in summary. It also accepts regex patterns instead of exact
name. In such case, start predicate will be the first element
it matches to |
compact |
Whether to remove white-space only lines from the model
summary. (Default |
Value
format()
returns a length 1 character vector. print()
returns the
model object invisibly. summary()
returns the output of format()
invisibly after printing it.
Enabling color output in Knitr (RMarkdown, Quarto)
In order to enable color output in a quarto or rmarkdown document with an html output format (include revealjs presentations), then you will need to do the following in a setup chunk:
```{r setup, include = FALSE} options(cli.num_colors = 256) fansi::set_knit_hooks(knitr::knit_hooks) options(width = 75) # adjust as needed for format ```
See Also
Other model functions:
get_config()
get_layer()
keras_model()
keras_model_sequential()
pop_layer()