Type Alias ShallowParamsBase

Source
pub type ShallowParamsBase<S, D> = ModelParamsBase<S, D, ParamsBase<S, D>>;
Expand description

a type alias for a shallow representation of the ModelParamsBase using a single ParamsBase instance as the hidden layer.

Aliased Type§

pub struct ShallowParamsBase<S, D> { /* private fields */ }

Implementations§

Source§

impl<S, D, A> ShallowParamsBase<S, D>
where S: RawData<Elem = A>, D: Dimension,

Source

pub fn default(input: D, hidden: D, output: D) -> Self
where A: Clone + Default, S: DataOwned, D: RemoveAxis,

initialize a new instance of the ShallowParamsBase with the given input, hidden, and output dimensions using the default values for the parameters

Source

pub fn size(&self) -> usize

returns the total number parameters within the model, including the input and output layers

Source

pub const fn hidden_weights(&self) -> &ArrayBase<S, D>

returns an immutable reference to the hidden weights

Source

pub const fn hidden_weights_mut(&mut self) -> &mut ArrayBase<S, D>

returns an mutable reference to the hidden weights

Source§

impl<S, A> ShallowParamsBase<S, Ix2>
where S: RawData<Elem = A>,

Source

pub fn from_features(features: ModelFeatures) -> Self
where A: Clone + Default, S: DataOwned,

Source

pub fn forward(&self, input: &Array1<A>) -> Result<Array1<A>>
where A: Float + ScalarOperand, S: Data,

forward input through the controller network

Source§

impl<A, S> ShallowParamsBase<S, Ix2>
where S: DataOwned<Elem = A>,

Source

pub fn init(self) -> Self

consumes the controller to initialize the various parameters with random values

Source

pub fn init_rand<G, Ds>(features: ModelFeatures, distr: G) -> Self
where G: Fn((usize, usize)) -> Ds, Ds: Clone + Distribution<A>, S: DataOwned,

returns a new instance of the model initialized with the given features and random distribution

Source

pub fn glorot_normal(features: ModelFeatures) -> Self

initialize the model parameters using a glorot normal distribution

Source

pub fn glorot_uniform(features: ModelFeatures) -> Self

initialize the model parameters using a glorot uniform distribution

Trait Implementations§

Source§

impl<A, S> Default for ShallowParamsBase<S, Ix2>
where S: DataOwned<Elem = A>, A: Clone + Default,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more