value_functions package

Submodules

value_functions.qtable module

class value_functions.qtable.QTable(actions_n=1, alpha=0.01)[source]

Bases: object

get_weights()[source]
max_a_q_sa(state: List[float])[source]

Return the maximum value of Q for the action that maximizes it

q_sa(state: List[float], action: float) float[source]
train(state: List[float], action: float, delta: float)[source]

value_functions.tiling module

class value_functions.tiling.IHT(size_val)[source]

Bases: object

Structure to handle collisions

count()[source]
full()[source]
get_index(obj, read_only=False)[source]
class value_functions.tiling.Tiling(num_tilings=8, max_size=1024, alpha=0.01)[source]

Bases: object

get_weights()[source]
max_a_q_sa(state: List[float])[source]
q_sa(state: List[float], action: float) float[source]
train(state: List[float], action: float, delta: float)[source]
value_functions.tiling.hash_coords(coordinates, m, read_only=False)[source]
value_functions.tiling.tiles(iht_or_size, num_tilings, floats, ints=None, read_only=False)[source]

returns num-tilings tile indices corresponding to the floats and ints

value_functions.value_function module

class value_functions.value_function.ValueFunction(value_function_type: Type, actions_n=1, parameters=())[source]

Bases: object

class Type(value)[source]

Bases: Enum

An enumeration.

TYPE_QTABLE = 'qtable'
get_weights()[source]
max_a_q_sa(state)[source]

Returns the Q value and the action index for the action that maximizes it given the state

q_sa(state: List[float], action: float)[source]
train(state: List[float], action: float, delta: float)[source]

Module contents