pub struct OptimizerNetwork {
pub hidden_states: HashMap<String, Tensor>,
pub cell_states: HashMap<String, Tensor>,
pub weights: NetworkWeights,
pub config: NeuralOptimizerConfig,
}Expand description
Simple neural network for learning optimization updates This is a simplified implementation for demonstration purposes
Fields§
LSTM-like state for each parameter
cell_states: HashMap<String, Tensor>Cell states for LSTM
weights: NetworkWeightsNetwork weights
config: NeuralOptimizerConfigConfiguration
Implementations§
Source§impl OptimizerNetwork
impl OptimizerNetwork
Sourcepub fn new(config: NeuralOptimizerConfig) -> OptimizerResult<Self>
pub fn new(config: NeuralOptimizerConfig) -> OptimizerResult<Self>
Create a new neural optimizer network
Sourcepub fn forward(
&mut self,
param_id: &str,
gradient: &Tensor,
parameter: &Tensor,
) -> OptimizerResult<Tensor>
pub fn forward( &mut self, param_id: &str, gradient: &Tensor, parameter: &Tensor, ) -> OptimizerResult<Tensor>
Forward pass through the neural network to compute parameter update
Sourcepub fn reset_state(&mut self)
pub fn reset_state(&mut self)
Reset network state
Sourcepub fn parameters(&self) -> Vec<&Tensor>
pub fn parameters(&self) -> Vec<&Tensor>
Get network parameters for meta-optimization
Trait Implementations§
Source§impl Clone for OptimizerNetwork
impl Clone for OptimizerNetwork
Source§fn clone(&self) -> OptimizerNetwork
fn clone(&self) -> OptimizerNetwork
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for OptimizerNetwork
impl !RefUnwindSafe for OptimizerNetwork
impl !UnwindSafe for OptimizerNetwork
impl Send for OptimizerNetwork
impl Sync for OptimizerNetwork
impl Unpin for OptimizerNetwork
impl UnsafeUnpin for OptimizerNetwork
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more