pub struct TaskModule {
pub task_id: String,
pub column_index: usize,
pub layers: Vec<Layer>,
pub lateral_connections: HashMap<usize, Vec<LateralAdapter>>,
pub frozen: bool,
}Expand description
Task-specific module in a progressive network
Fields§
§task_id: StringTask ID this module belongs to
column_index: usizeColumn index in the progressive network
layers: Vec<Layer>Layer weights for this task
lateral_connections: HashMap<usize, Vec<LateralAdapter>>Lateral connections from previous tasks
frozen: boolWhether this module is frozen
Implementations§
Source§impl TaskModule
impl TaskModule
pub fn new( task_id: String, column_index: usize, config: &ProgressiveConfig, ) -> Self
Sourcepub fn add_lateral_connection(
&mut self,
source_column: usize,
layer_idx: usize,
config: &ProgressiveConfig,
) -> Result<()>
pub fn add_lateral_connection( &mut self, source_column: usize, layer_idx: usize, config: &ProgressiveConfig, ) -> Result<()>
Add lateral connection from another task
Sourcepub fn forward(&self, input: &Array1<f32>) -> Result<Array1<f32>>
pub fn forward(&self, input: &Array1<f32>) -> Result<Array1<f32>>
Forward pass through this task module
Sourcepub fn num_parameters(&self) -> usize
pub fn num_parameters(&self) -> usize
Get number of parameters in this module
Trait Implementations§
Source§impl Clone for TaskModule
impl Clone for TaskModule
Source§fn clone(&self) -> TaskModule
fn clone(&self) -> TaskModule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TaskModule
impl RefUnwindSafe for TaskModule
impl Send for TaskModule
impl Sync for TaskModule
impl Unpin for TaskModule
impl UnsafeUnpin for TaskModule
impl UnwindSafe for TaskModule
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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