Struct renforce::util::approx::QLinear
[−]
[src]
pub struct QLinear<F: Float + Debug, S: Space, A: FiniteSpace> where A::Element: Hash + Eq { /* fields omitted */ }
Represents multiple linear function approximators, one for each action
Methods
impl<S: Space, A: FiniteSpace> QLinear<f64, S, A> where A::Element: Hash + Eq
[src]
impl<F: Float + Debug, S: Space, A: FiniteSpace> QLinear<F, S, A> where A::Element: Hash + Eq
[src]
fn new(action_space: &A) -> QLinear<F, S, A>
Creates a new, empty QLinear
fn add(&mut self, feat: Box<Feature<S, F>>)
Adds feat to list of features. Should not be called after any calls to eval or update
Trait Implementations
impl<F: Debug + Float + Debug, S: Debug + Space, A: Debug + FiniteSpace> Debug for QLinear<F, S, A> where A::Element: Hash + Eq,
A::Element: Debug
[src]
A::Element: Debug
impl<F: Clone + Float + Debug, S: Clone + Space, A: Clone + FiniteSpace> Clone for QLinear<F, S, A> where A::Element: Hash + Eq,
A::Element: Clone
[src]
A::Element: Clone
fn clone(&self) -> QLinear<F, S, A>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<F: Float + Debug, S: Space, A: FiniteSpace> QFunction<S, A> for QLinear<F, S, A> where A::Element: Hash + Eq
[src]
fn eval(&self, state: &S::Element, action: &A::Element) -> f64
Evaluate the function on the given state and action
fn update(&mut self,
state: &S::Element,
action: &A::Element,
new_val: f64,
alpha: f64)
state: &S::Element,
action: &A::Element,
new_val: f64,
alpha: f64)
Update the function using the given information (alpha is learning rate)
impl<F: Float + Debug, S: Space, A: FiniteSpace> ParameterizedFunc<F> for QLinear<F, S, A> where A::Element: Hash + Eq
[src]
fn num_params(&self) -> usize
Returns number of parameters used by the function
fn get_params(&self) -> Vec<F>
Returns the parameters used by the function
fn set_params(&mut self, params: Vec<F>)
Changes the parameters used by the function
impl<S: Space, A: FiniteSpace, F: Float + Debug> FeatureExtractor<S, A, F> for QLinear<F, S, A> where A::Element: Hash + Eq
[src]
fn num_features(&self) -> usize
Number of features that can be calculated
fn extract(&self, state: &S::Element, action: &A::Element) -> Vec<F>
Vector containg the values of all the features for this state