seldonian.RL.Agents.Function_Approximators.Table.Q_Table

class Q_Table(min_state, num_states, num_actions)

Bases: Table

__init__(min_state, num_states, num_actions)

A Q table containing transition probabilities

Parameters:
  • min_state (int) – The smallest obs number

  • num_states (int) – Number of total states

  • num_actions (int) – Number of actions in a given obs

__repr__()

Return repr(self).

Methods

from_environment_state_to_0_indexed_state(env_state)

Convert environment obs to 0 indexed obs in the table

Parameters:

env_state – The environment obs you want to convert

Returns:

0-indexed obs in the table

get_action_values_given_state(state_number_not_zero_indexed)

Get possible Q-table values given environmental obs

Parameters:

state_number_not_zero_indexed (int) – The environment-specific obs number

Returns:

array of possible Q-table values

get_action_values_given_zero_indexed_state(zero_indexed_state_number)

Get possible Q-table values given 0-indexed obs number in the table

Parameters:

zero_indexed_state_number (int) – The 0-indexed obs number in the table

Returns:

array of possible actions

set_new_params(new_params)

Set the new model parameter weights