pub fn init_by_initializer<I: Initializer>(
        &mut self,
        in_size: u32,
        out_size: u32,
        initializer: &I,
    ) {
        self.pw
            .init_by_initializer([4 * out_size, in_size + out_size], initializer);
        let mut bias_values = vec![0.0; 4 * out_size as usize];
        for i in (out_size as usize)..(2 * out_size as usize) {
            bias_values[i] = 1.0;
        }
        self.pb.init_by_values([4 * out_size], &bias_values);
    }
/// Initializes the model by a initializer.
Initializes the model by a initializer.
Initializes the model by a initializer .
pub fn init_by_initializer<I: Initializer>(
        &mut self,
        in_size: u32,
        out_size: u32,
        initializer: &I,
    ) {
        self.pw
            .init_by_initializer([4 * out_size, in_size + out_size], initializer);
        let mut bias_values = vec![0.0; 4 * out_size as usize];
        for i in (out_size as usize)..(2 * out_size as usize) {
            bias_values[i] = 1.0;
        }
        self.pb.init_by_values([4 * out_size], &bias_values);
    }
pub fn init_by_initializer < I : Initializer > ( & mut self , in_size : u32 , out_size : u32 , initializer : & I , ) { self . pw . init_by_initializer ( [ 4 * out_size , in_size + out_size ] , initializer ) ; let mut bias_values = vec ! [ 0.0 4 out_size as usize ] ; for i in ( out_size as usize ) .. ( 2 * out_size as usize ) { bias_values [ i ] = 1.0 ; } self . pb . init_by_values ( [ 4 * out_size ] , & bias_values ) ; }
Initializes the model by a initializer.
Initializes the model by a initializer .
&mut self
in_size
u32
out_size
u32
initializer
&I
&mut self
in_size
u32
out_size
u32
initializer
&I