tf_agents.bandits.environments.non_stationary_stochastic_environment.EnvironmentDynamics
Stay organized with collections
Save and categorize content based on your preferences.
Abstract class to represent a non-stationary environment dynamics.
tf_agents.bandits.environments.non_stationary_stochastic_environment.EnvironmentDynamics(
name=None
)
This class is used with the NonStationaryStochasticEnvironment class below to
obtain a non-stationary environment.
To define a dynamics, derive from this class and define the abstract methods
and properties below.
To work correctly with graph and eager mode, Tensorflow variables must be
defined in the constructor of this class. When used within a
BanditTFEnvironment
autodeps in reset and step functions will handle
automatically the operation order.
Attributes |
action_spec
|
Specification of the actions.
|
batch_size
|
Returns the batch size used for observations and rewards.
|
observation_spec
|
Specification of the observations.
|
Methods
observation
View source
@abc.abstractmethod
observation(
env_time: tf_agents.typing.types.Int
) -> tf_agents.typing.types.NestedTensor
Returns an observation batch for the given time.
Args |
env_time
|
The scalar int64 tensor of the environment time step. This is
incremented by the environment after the reward is computed.
|
Returns |
The observation batch with spec according to observation_spec.
|
reward
View source
@abc.abstractmethod
reward(
observation: tf_agents.typing.types.NestedTensor
,
env_time: tf_agents.typing.types.Int
) -> tf_agents.typing.types.NestedTensor
Reward for the given observation and time step.
Args |
observation
|
A batch of observations with spec according to
observation_spec.
|
env_time
|
The scalar int64 tensor of the environment time step. This is
incremented by the environment after the reward is computed.
|
Returns |
A batch of rewards with spec shape [batch_size, num_actions] containing
rewards for all arms.
|
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.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "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."],[],[]]