tf_agents.networks.utils.mlp_layers
Stay organized with collections
Save and categorize content based on your preferences.
Generates conv and fc layers to encode into a hidden state.
tf_agents.networks.utils.mlp_layers(
conv_layer_params=None,
fc_layer_params=None,
dropout_layer_params=None,
activation_fn=tf.keras.activations.relu,
kernel_initializer=None,
weight_decay_params=None,
name=None
)
Args |
conv_layer_params
|
Optional list of convolution layers parameters, where
each item is a length-three tuple indicating (filters, kernel_size,
stride).
|
fc_layer_params
|
Optional list of fully_connected parameters, where each
item is the number of units in the layer.
|
dropout_layer_params
|
Optional list of dropout layer parameters, each item
is the fraction of input units to drop or a dictionary of parameters
according to the keras.Dropout documentation. The additional parameter
permanent , if set to True, allows to apply dropout at inference for
approximated Bayesian inference. The dropout layers are interleaved with
the fully connected layers; there is a dropout layer after each fully
connected layer, except if the entry in the list is None. This list must
have the same length of fc_layer_params, or be None.
|
activation_fn
|
Activation function, e.g. tf.keras.activations.relu,.
|
kernel_initializer
|
Initializer to use for the kernels of the conv and dense
layers. If none is provided a default variance_scaling_initializer is
used.
|
weight_decay_params
|
Optional list of weight decay params for the fully
connected layer.
|
name
|
Name for the mlp layers.
|
Returns |
List of mlp layers.
|
Raises |
ValueError
|
If the number of dropout layer parameters does not match the
number of fully connected layer parameters.
|
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[]]