tf_agents.bandits.policies.constraints.InputNetworkConstraint
Stay organized with collections
Save and categorize content based on your preferences.
Class for representing a constraint using an input network.
Inherits From: BaseConstraint
tf_agents.bandits.policies.constraints.InputNetworkConstraint(
time_step_spec: tf_agents.typing.types.TimeStep
,
action_spec: tf_agents.typing.types.BoundedTensorSpec
,
input_network: Optional[tf_agents.typing.types.Network
] = None,
name: Optional[Text] = 'InputNetworkConstraint'
)
This constraint class uses an input network to compute the action feasibility.
It assumes that the input network is already trained and it can be provided
at construction time or later using the set_network() function.
Args |
time_step_spec
|
A TimeStep spec of the expected time_steps.
|
action_spec
|
A nest of BoundedTensorSpec representing the actions.
|
input_network
|
An instance of tf_agents.network.Network used to provide
estimates of action feasibility.
|
name
|
Python str name of this agent. All variables in this module will
fall under that name. Defaults to the class name.
|
Methods
compute_loss
View source
compute_loss(
observations: tf_agents.typing.types.NestedTensor
,
actions: tf_agents.typing.types.NestedTensor
,
rewards: tf_agents.typing.types.Tensor
,
weights: Optional[types.TensorOrArray] = None,
training: bool = False
) -> tf_agents.typing.types.Tensor
__call__
View source
@abc.abstractmethod
__call__(
observation, actions=None
)
Returns the probability of input actions being feasible.
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."],[],[]]