tf_agents.bandits.policies.constraints.construct_mask_from_multiple_sources
Stay organized with collections
Save and categorize content based on your preferences.
Constructs an action mask from multiple sources.
tf_agents.bandits.policies.constraints.construct_mask_from_multiple_sources(
observation: tf_agents.typing.types.NestedTensor
,
observation_and_action_constraint_splitter: tf_agents.typing.types.Splitter
,
constraints: Iterable[tf_agents.bandits.policies.constraints.BaseConstraint
],
max_num_actions: int
) -> Optional[types.Tensor]
The sources include:
-- The action mask encoded in the observation,
-- the num_actions
feature restricting the number of actions per sample,
-- the feasibility mask implied by constraints.
The resulting mask disables all actions that are masked out in any of the
three sources.
Args |
observation
|
A nest of Tensors containing the observation.
|
observation_and_action_constraint_splitter
|
The observation action mask
splitter function if the observation has action mask.
|
constraints
|
Iterable of constraints objects that are instances of
tf_agents.bandits.agents.NeuralConstraint .
|
max_num_actions
|
The maximum number of actions per sample.
|
Returns |
An action mask in the form of a [batch_size, max_num_actions] 0-1 tensor.
|
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."],[],[]]