deluca.agents.Zero¶
-
class
deluca.agents.
Zero
(*args, **kwargs)[source]¶ Zero: agent that plays the zero action
Public Data Attributes:
Inherited from
JaxObject
name
attrs
Public Methods:
__init__
(shape)Description: iniitalizes the Zero agent
__call__
(state)Description: provide an action given a state
Inherited from
Agent
__init_subclass__
(*args, **kwargs)For avoiding a decorator for each subclass
__call__
(state)Description: provide an action given a state
reset
()feed
(reward)Inherited from
JaxObject
__new__
(cls, *args, **kwargs)For avoiding super().__init__()
__init_subclass__
(*args, **kwargs)For avoiding a decorator for each subclass
__str__
()Return str(self).
__setattr__
(key, val)Implement setattr(self, name, value).
save
(path)load
(path)throw
(err, msg)
-
__call__
(state: jax._src.numpy.lax_numpy.ndarray) → jax._src.numpy.lax_numpy.ndarray[source]¶ Description: provide an action given a state
- Parameters
state (jnp.ndarray) – current state
- Returns
action to take
- Return type
action (jnp.ndarray)
-
__init__
(shape: Sequence[int]) → None[source]¶ Description: iniitalizes the Zero agent
- Parameters
shape – shape of the action the agent should take
- Returns
None
Notes
The Zero agent cannot, in this implementation, return a scalar that passes jnp.isscalar; we can emulate via Zero(shape=()), whic would return jnp.array(0.0)
-