tf_agents.bandits.agents.utils.process_experience_for_neural_agents
Stay organized with collections
Save and categorize content based on your preferences.
Processes the experience and prepares it for the network of the agent.
tf_agents.bandits.agents.utils.process_experience_for_neural_agents(
experience: tf_agents.typing.types.NestedTensor
,
accepts_per_arm_features: bool,
training_data_spec: tf_agents.typing.types.NestedTensorSpec
) -> Tuple[tf_agents.typing.types.NestedTensor
, tf_agents.typing.types.Tensor
, tf_agents.typing.types.Tensor
]
First the reward, the action, and the observation are flattened to have only
one batch dimension. Then, if the experience includes chosen action features
in the policy info, it gets copied in place of the per-arm observation.
Args |
experience
|
The experience coming from the replay buffer.
|
accepts_per_arm_features
|
Whether the agent accepts per-arm features.
|
training_data_spec
|
The data spec describing what the agent expects.
|
Returns |
A tuple of (observation, action, reward) tensors to be consumed by the train
function of the neural agent.
|
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."],[],[]]