pub struct RLS { /* private fields */ }Expand description
Recursive Least Squares (RLS) optimizer.
Implementations§
Source§impl RLS
impl RLS
Sourcepub fn new(n_x: u64, n_y: u64, lambda: f64, alpha: f64) -> Self
pub fn new(n_x: u64, n_y: u64, lambda: f64, alpha: f64) -> Self
Examples found in repository?
examples/rls.rs (line 12)
5fn main() {
6 let x1 = na::DVector::from_vec(vec![1.0, 2.0, 3.0, 4.0]);
7 let d1 = na::DVector::from_vec(vec![5.0, 6.0]);
8
9 let x2 = na::DVector::from_vec(vec![2.0, 4.0, 6.0, 8.0]);
10 let d2 = na::DVector::from_vec(vec![10.0, 11.0]);
11
12 let mut rls = RLS::new(4, 2, 1.0, 1.0);
13
14 for _ in 0..100 {
15 rls.set_data(&x1, &d1);
16 }
17 println!("{}", rls);
18
19 for _ in 0..100 {
20 rls.set_data(&x2, &d2);
21 }
22 println!("{}", rls);
23}Sourcepub fn set_data(&mut self, x: &DVector<f64>, d: &DVector<f64>)
pub fn set_data(&mut self, x: &DVector<f64>, d: &DVector<f64>)
Examples found in repository?
examples/rls.rs (line 15)
5fn main() {
6 let x1 = na::DVector::from_vec(vec![1.0, 2.0, 3.0, 4.0]);
7 let d1 = na::DVector::from_vec(vec![5.0, 6.0]);
8
9 let x2 = na::DVector::from_vec(vec![2.0, 4.0, 6.0, 8.0]);
10 let d2 = na::DVector::from_vec(vec![10.0, 11.0]);
11
12 let mut rls = RLS::new(4, 2, 1.0, 1.0);
13
14 for _ in 0..100 {
15 rls.set_data(&x1, &d1);
16 }
17 println!("{}", rls);
18
19 for _ in 0..100 {
20 rls.set_data(&x2, &d2);
21 }
22 println!("{}", rls);
23}pub fn fit(&self) -> DMatrix<f64>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RLS
impl<'de> Deserialize<'de> for RLS
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RLS
impl RefUnwindSafe for RLS
impl Send for RLS
impl Sync for RLS
impl Unpin for RLS
impl UnwindSafe for RLS
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.