tf_agents.networks.layer_utils.print_summary
Stay organized with collections
Save and categorize content based on your preferences.
Prints a summary of a model.
tf_agents.networks.layer_utils.print_summary(
model,
line_length=None,
positions=None,
print_fn=None,
expand_nested=False,
show_trainable=False,
layer_range=None
)
Args |
model
|
Keras model instance.
|
line_length
|
Total length of printed lines (e.g. set this to adapt the
display to different terminal window sizes).
|
positions
|
Relative or absolute positions of log elements in each line. If
not provided, defaults to [0.3, 0.6, 0.70, 1.] .
|
print_fn
|
Print function to use. It will be called on each line of the
summary. You can set it to a custom function in order to capture the
string summary. It defaults to print (prints to stdout).
|
expand_nested
|
Whether to expand the nested models. If not provided,
defaults to False .
|
show_trainable
|
Whether to show if a layer is trainable. If not provided,
defaults to False .
|
layer_range
|
List or tuple containing two strings, the starting layer name
and ending layer name (both inclusive), indicating the range of layers
to be printed in the summary. The strings could also be regexes instead
of an exact name. In this case, the starting layer will be the first
layer that matches layer_range[0] and the ending layer will be the
last element that matches layer_range[1] . By default (None ) all
layers in the model are included in the summary.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf_agents.networks.layer_utils.print_summary\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/networks/layer_utils.py#L235-L519) |\n\nPrints a summary of a model. \n\n tf_agents.networks.layer_utils.print_summary(\n model,\n line_length=None,\n positions=None,\n print_fn=None,\n expand_nested=False,\n show_trainable=False,\n layer_range=None\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `model` | Keras model instance. |\n| `line_length` | Total length of printed lines (e.g. set this to adapt the display to different terminal window sizes). |\n| `positions` | Relative or absolute positions of log elements in each line. If not provided, defaults to `[0.3, 0.6, 0.70, 1.]`. |\n| `print_fn` | Print function to use. It will be called on each line of the summary. You can set it to a custom function in order to capture the string summary. It defaults to `print` (prints to stdout). |\n| `expand_nested` | Whether to expand the nested models. If not provided, defaults to `False`. |\n| `show_trainable` | Whether to show if a layer is trainable. If not provided, defaults to `False`. |\n| `layer_range` | List or tuple containing two strings, the starting layer name and ending layer name (both inclusive), indicating the range of layers to be printed in the summary. The strings could also be regexes instead of an exact name. In this case, the starting layer will be the first layer that matches `layer_range[0]` and the ending layer will be the last element that matches `layer_range[1]`. By default (`None`) all layers in the model are included in the summary. |\n\n\u003cbr /\u003e"]]