pub struct QuantumMLFramework { /* private fields */ }
Expand description
Main quantum machine learning layers framework
Implementations§
Source§impl QuantumMLFramework
impl QuantumMLFramework
Sourcepub fn forward(&mut self, input: &Array1<f64>) -> Result<Array1<f64>>
pub fn forward(&mut self, input: &Array1<f64>) -> Result<Array1<f64>>
Forward pass through the quantum ML model
Sourcepub fn backward(&mut self, loss_gradient: &Array1<f64>) -> Result<Array1<f64>>
pub fn backward(&mut self, loss_gradient: &Array1<f64>) -> Result<Array1<f64>>
Backward pass for gradient computation
Sourcepub fn train(
&mut self,
training_data: &[(Array1<f64>, Array1<f64>)],
validation_data: Option<&[(Array1<f64>, Array1<f64>)]>,
) -> Result<QMLTrainingResult>
pub fn train( &mut self, training_data: &[(Array1<f64>, Array1<f64>)], validation_data: Option<&[(Array1<f64>, Array1<f64>)]>, ) -> Result<QMLTrainingResult>
Train the quantum ML model
Sourcepub fn evaluate(&mut self, data: &[(Array1<f64>, Array1<f64>)]) -> Result<f64>
pub fn evaluate(&mut self, data: &[(Array1<f64>, Array1<f64>)]) -> Result<f64>
Evaluate the model on validation data
Sourcepub fn get_training_history(&self) -> &[QMLTrainingResult]
pub fn get_training_history(&self) -> &[QMLTrainingResult]
Get training history
Sourcepub fn get_layers(&self) -> &[Box<dyn QMLLayer>]
pub fn get_layers(&self) -> &[Box<dyn QMLLayer>]
Get layers reference
Sourcepub fn get_config(&self) -> &QMLConfig
pub fn get_config(&self) -> &QMLConfig
Get config reference
Sourcepub fn encode_amplitude_public(
&self,
input: &Array1<f64>,
) -> Result<Array1<Complex64>>
pub fn encode_amplitude_public( &self, input: &Array1<f64>, ) -> Result<Array1<Complex64>>
Encode amplitude (public version)
Sourcepub fn encode_angle_public(
&self,
input: &Array1<f64>,
) -> Result<Array1<Complex64>>
pub fn encode_angle_public( &self, input: &Array1<f64>, ) -> Result<Array1<Complex64>>
Encode angle (public version)
Sourcepub fn encode_basis_public(
&self,
input: &Array1<f64>,
) -> Result<Array1<Complex64>>
pub fn encode_basis_public( &self, input: &Array1<f64>, ) -> Result<Array1<Complex64>>
Encode basis (public version)
Sourcepub fn encode_quantum_feature_map_public(
&self,
input: &Array1<f64>,
) -> Result<Array1<Complex64>>
pub fn encode_quantum_feature_map_public( &self, input: &Array1<f64>, ) -> Result<Array1<Complex64>>
Encode quantum feature map (public version)
Sourcepub fn measure_pauli_z_expectation_public(
&self,
state: &Array1<Complex64>,
qubit: usize,
) -> Result<f64>
pub fn measure_pauli_z_expectation_public( &self, state: &Array1<Complex64>, qubit: usize, ) -> Result<f64>
Measure Pauli Z expectation (public version)
Sourcepub fn get_current_learning_rate_public(&self, epoch: usize) -> f64
pub fn get_current_learning_rate_public(&self, epoch: usize) -> f64
Get current learning rate (public version)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QuantumMLFramework
impl !RefUnwindSafe for QuantumMLFramework
impl Send for QuantumMLFramework
impl Sync for QuantumMLFramework
impl Unpin for QuantumMLFramework
impl !UnwindSafe for QuantumMLFramework
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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.