Skip to main content

QValues

Trait QValues 

Source
pub trait QValues<V> {
    // Required methods
    fn q_value(&self, state: usize, action: usize) -> V;
    fn future_q_value(&mut self, state: usize, action: usize) -> V;
    fn set_q_value(&mut self, state: usize, action: usize, value: V);
}
Expand description

Where a QLearner keeps its Q values: tinymind (C++)’s Q value policy. QTable is the tabular one.

Required Methods§

Source

fn q_value(&self, state: usize, action: usize) -> V

The Q value of taking action in state.

Source

fn future_q_value(&mut self, state: usize, action: usize) -> V

The Q value of the best action in the next state, used for the update’s target. A table returns q_value.

Source

fn set_q_value(&mut self, state: usize, action: usize, value: V)

Stores a new Q value for action in state.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<V, H, O, const IN: usize, const HID: usize, const ACTIONS: usize, Opt> QValues<V> for QNetwork<V, H, O, IN, HID, ACTIONS, Opt>
where V: Scalar, H: Activation<V>, O: Activation<V>, Opt: Optimizer<V>,

Source§

impl<V: Scalar, const STATES: usize, const ACTIONS: usize> QValues<V> for QTable<V, STATES, ACTIONS>