![]() |
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. |
Attributes | |
---|---|
network
|
Methods
compute_loss
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__
@abc.abstractmethod
__call__( observation, actions=None )
Returns the probability of input actions being feasible.