pub struct Module {
pub parameters: Arc<Mutex<Vec<ShareTensor>>>,
pub initialization: WeightInitialization,
pub eval_handlers: Vec<Arc<Mutex<bool>>>,
pub rng: ChaCha8Rng,
}Fields§
§parameters: Arc<Mutex<Vec<ShareTensor>>>§initialization: WeightInitialization§eval_handlers: Vec<Arc<Mutex<bool>>>§rng: ChaCha8RngImplementations§
Source§impl Module
impl Module
pub fn init() -> Module
pub fn parameters(&self) -> Arc<Mutex<Vec<ShareTensor>>> ⓘ
pub fn train(&self)
pub fn eval(&self)
pub fn update_seed(&mut self, seed: u64)
pub fn update_initialization(&mut self, initialization: WeightInitialization)
Source§impl Module
impl Module
pub fn batch_norm_init( &mut self, channel_features: usize, input_dimension: usize, ) -> BatchNorm
Source§impl Module
impl Module
pub fn embedding_init(&mut self, vocab_num: usize, hidden: usize) -> Embedding
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnsafeUnpin for Module
impl UnwindSafe for Module
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 more