pub struct NaturalGradient { /* private fields */ }Expand description
Natural gradient optimizer using Fisher information matrix.
Accounts for the geometry of the parameter space, which is particularly important for variational quantum circuits.
§Update Rule
$$\theta_{t+1} = \theta_t - \alpha F^{-1} \nabla L$$
where F is the Fisher information matrix.
Implementations§
Source§impl NaturalGradient
impl NaturalGradient
Sourcepub fn with_regularization(self, reg: f64) -> Self
pub fn with_regularization(self, reg: f64) -> Self
Set regularization for Fisher matrix inversion.
Sourcepub fn compute_natural_gradient(
&self,
fisher: &Array2<f64>,
gradient: &[f64],
) -> Result<Vec<f64>, OptimizerError>
pub fn compute_natural_gradient( &self, fisher: &Array2<f64>, gradient: &[f64], ) -> Result<Vec<f64>, OptimizerError>
Compute natural gradient given Fisher matrix and gradient.
Trait Implementations§
Source§impl Optimizer for NaturalGradient
impl Optimizer for NaturalGradient
Auto Trait Implementations§
impl Freeze for NaturalGradient
impl RefUnwindSafe for NaturalGradient
impl Send for NaturalGradient
impl Sync for NaturalGradient
impl Unpin for NaturalGradient
impl UnwindSafe for NaturalGradient
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