Enum leaf::weight::FillerType [] [src]

pub enum FillerType {
    Constant {
        value: f32,
    },
    Glorot {
        input_size: usize,
        output_size: usize,
    },
}

Enum for specifing the type of Filler.

Variants

Constant

Fills the weight blob with a constant value (all values are the same).

Fields

value

The value that will be used to fill the blob.

Glorot

Fills the weight blobs based on the paper:

[Bengio and Glorot 2010]: Understanding the difficulty of training deep feedforward neural networks.

Also known as Xavier filler.

Fields

input_size

Number of input nodes for each output.

output_size

Number of output nodes for each input.

Methods

impl FillerType

fn fill(&self, weight: &mut SharedTensor<f32>)

Uses a filler as specified by this FillerType to fill the values in a SharedTensor

This filling of weights is usually done directly after creation of the weight blob.

fn fill_constant(weight: &mut SharedTensor<f32>, value: f32)

Directly use the Constant Filler.

fn fill_glorot(weight: &mut SharedTensor<f32>, num_inputs: usize, num_outputs: usize)

Directly use the Glorot Filler.

Trait Implementations

Derived Implementations

impl Clone for FillerType

fn clone(&self) -> FillerType

1.0.0fn clone_from(&mut self, source: &Self)

impl Copy for FillerType

impl Debug for FillerType

fn fmt(&self, __arg_0: &mut Formatter) -> Result