pub struct Architecture {
pub layers: Vec<LayerSpec>,
}Expand description
A concrete neural architecture represented as an ordered sequence of layers.
Fields§
§layers: Vec<LayerSpec>Ordered layer specifications (input → output).
Implementations§
Source§impl Architecture
impl Architecture
Sourcepub fn param_count(&self) -> usize
pub fn param_count(&self) -> usize
Proxy parameter count: sum of width_i × width_{i+1} over consecutive pairs.
Returns 0 if fewer than 2 layers.
Sourcepub fn to_config(&self) -> HyperparamConfig
pub fn to_config(&self) -> HyperparamConfig
Encode this architecture as a HyperparamConfig.
Keys: depth (Int), layer_{i}_op (String), layer_{i}_width (Int),
layer_{i}_activation (String).
Sourcepub fn from_config(
cfg: &HyperparamConfig,
max_depth: usize,
) -> TrainResult<Self>
pub fn from_config( cfg: &HyperparamConfig, max_depth: usize, ) -> TrainResult<Self>
Reconstruct an Architecture from a HyperparamConfig created by Architecture::to_config.
max_depth is used only for bounds-checking the encoded depth.
Trait Implementations§
Source§impl Clone for Architecture
impl Clone for Architecture
Source§fn clone(&self) -> Architecture
fn clone(&self) -> Architecture
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 moreSource§impl Debug for Architecture
impl Debug for Architecture
Source§impl PartialEq for Architecture
impl PartialEq for Architecture
Source§fn eq(&self, other: &Architecture) -> bool
fn eq(&self, other: &Architecture) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Architecture
Auto Trait Implementations§
impl Freeze for Architecture
impl RefUnwindSafe for Architecture
impl Send for Architecture
impl Sync for Architecture
impl Unpin for Architecture
impl UnsafeUnpin for Architecture
impl UnwindSafe for Architecture
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