MCPcopy Create free account
hub / github.com/ddbourgin/numpy-ml / act

Method act

numpy_ml/rl_models/agents.py:1235–1252  ·  view source on GitHub ↗

r""" Execute the behavior policy--an :math:`\epsilon`-soft policy used to generate actions during training. Parameters ---------- obs : int, float, or :py:class:`ndarray ` as returned by ``env.step(action)`` An observation from the

(self, obs)

Source from the content-addressed store, hash-verified

1233 self._on_policy_update(s, a, r, s_, a_)
1234
1235 def act(self, obs):
1236 r"""
1237 Execute the behavior policy--an :math:`\epsilon`-soft policy used to
1238 generate actions during training.
1239
1240 Parameters
1241 ----------
1242 obs : int, float, or :py:class:`ndarray <numpy.ndarray>` as returned by ``env.step(action)``
1243 An observation from the environment.
1244
1245 Returns
1246 -------
1247 action : int, float, or :py:class:`ndarray <numpy.ndarray>`
1248 An action sampled from the distribution over actions defined by the
1249 epsilon-soft policy.
1250 """ # noqa: E501
1251 s = self._obs2num[obs]
1252 return self.behavior_policy(s)
1253
1254 def greedy_policy(self, max_steps, render=True):
1255 """

Callers 1

_episodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected