seldonian.RL.Agents.Policies.Policy.Policy

class Policy

Bases: object

__init__()

Base class for policies. Contains methods, some of which must be overridden in any policy implementation

__repr__()

Return repr(self).

Methods

choose_action(obs)

Defines how to select an action given an observation, obs

get_params()

Get current policy parameters

get_prob_this_action(obs, action)

Get probability of taking an action given an observation. Does not necessarily need to be overridden, but is often called from self.get_probs_from_observations_and_actions()

get_probs_from_observations_and_actions(observations, actions, behavior_action_probs)

Get probabilities for each observation and action in the input arrays

set_new_params(new_params)

Update policy parameters