tf_agents.specs.bandit_spec_utils.create_per_arm_observation_spec
Stay organized with collections
Save and categorize content based on your preferences.
Creates an observation spec with per-arm features and possibly action mask.
tf_agents.specs.bandit_spec_utils.create_per_arm_observation_spec(
global_dim: int,
per_arm_dim: int,
max_num_actions: Optional[int] = None,
add_num_actions_feature: bool = False
) -> tf_agents.typing.types.NestedTensorSpec
Args |
global_dim
|
(int) The global feature dimension.
|
per_arm_dim
|
(int) The per-arm feature dimension.
|
max_num_actions
|
If specified (int), this is the maximum number of actions
in any sample, and the num_actions dimension of the per-arm features will
be set to this number. The actual number of actions for a given sample can
be lower than this parameter: it can be specified via the
NUM_ACTIONS_FEATURE_KEY, or an action mask.
|
add_num_actions_feature
|
(bool) whether to use the num_actions feature key
to encode the number of actions per sample.
|
Returns |
A nested structure of observation spec.
|
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.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-04-26 UTC."}