pub struct MultiTaskConfig<T: FloatBounds> {
pub num_tasks: usize,
pub input_dim: usize,
pub output_dims: Vec<usize>,
pub sharing_strategy: SharingStrategy,
pub loss_config: MultiTaskLoss<T>,
pub task_names: Vec<String>,
pub use_task_embeddings: bool,
pub task_embedding_dim: usize,
}Expand description
Multi-task neural network configuration
Fields§
§num_tasks: usizeNumber of tasks
input_dim: usizeInput dimension
output_dims: Vec<usize>Output dimensions for each task
sharing_strategy: SharingStrategyParameter sharing strategy
loss_config: MultiTaskLoss<T>Loss configuration
task_names: Vec<String>Task names for identification
use_task_embeddings: boolWhether to use task embeddings
task_embedding_dim: usizeTask embedding dimension
Implementations§
Source§impl<T: FloatBounds> MultiTaskConfig<T>
impl<T: FloatBounds> MultiTaskConfig<T>
Sourcepub fn new(
num_tasks: usize,
input_dim: usize,
output_dims: Vec<usize>,
) -> NeuralResult<Self>
pub fn new( num_tasks: usize, input_dim: usize, output_dims: Vec<usize>, ) -> NeuralResult<Self>
Create a new multi-task configuration; output_dims.len() must equal num_tasks
Sourcepub fn with_task_names(self, names: Vec<String>) -> NeuralResult<Self>
pub fn with_task_names(self, names: Vec<String>) -> NeuralResult<Self>
Set task names
Sourcepub fn with_sharing_strategy(self, strategy: SharingStrategy) -> Self
pub fn with_sharing_strategy(self, strategy: SharingStrategy) -> Self
Set sharing strategy
Sourcepub fn with_task_weighting(self, strategy: TaskWeightingStrategy) -> Self
pub fn with_task_weighting(self, strategy: TaskWeightingStrategy) -> Self
Set task weighting strategy
Sourcepub fn with_task_embeddings(self, embedding_dim: usize) -> Self
pub fn with_task_embeddings(self, embedding_dim: usize) -> Self
Enable task embeddings
Trait Implementations§
Source§impl<T: Clone + FloatBounds> Clone for MultiTaskConfig<T>
impl<T: Clone + FloatBounds> Clone for MultiTaskConfig<T>
Source§fn clone(&self) -> MultiTaskConfig<T>
fn clone(&self) -> MultiTaskConfig<T>
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 moreAuto Trait Implementations§
impl<T> Freeze for MultiTaskConfig<T>where
T: Freeze,
impl<T> RefUnwindSafe for MultiTaskConfig<T>where
T: RefUnwindSafe,
impl<T> Send for MultiTaskConfig<T>
impl<T> Sync for MultiTaskConfig<T>
impl<T> Unpin for MultiTaskConfig<T>where
T: Unpin,
impl<T> UnsafeUnpin for MultiTaskConfig<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for MultiTaskConfig<T>where
T: UnwindSafe,
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