View source on GitHub |
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.
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.