pub struct TrainingProvenance {Show 14 fields
pub model_cid: Cid,
pub parent_model: Option<Cid>,
pub training_datasets: Vec<Cid>,
pub validation_datasets: Vec<Cid>,
pub hyperparameters: Hyperparameters,
pub metrics: HashMap<String, f32>,
pub attributions: Vec<Attribution>,
pub license: License,
pub started_at: i64,
pub completed_at: Option<i64>,
pub code_repository: Option<String>,
pub code_commit: Option<String>,
pub hardware: Option<String>,
pub framework: Option<String>,
}Expand description
Training provenance for a model
Fields§
§model_cid: CidModel CID
parent_model: Option<Cid>Parent model CID (if fine-tuning or transfer learning)
training_datasets: Vec<Cid>Training datasets
validation_datasets: Vec<Cid>Validation datasets
hyperparameters: HyperparametersHyperparameters
metrics: HashMap<String, f32>Training metrics (final)
attributions: Vec<Attribution>Attribution
license: LicenseLicense
started_at: i64Training start time
completed_at: Option<i64>Training end time
code_repository: Option<String>Code repository (if applicable)
code_commit: Option<String>Code commit hash
hardware: Option<String>Hardware used (e.g., “8x NVIDIA A100”)
framework: Option<String>Training framework (e.g., “PyTorch 2.0”)
Implementations§
Source§impl TrainingProvenance
impl TrainingProvenance
Sourcepub fn new(
model_cid: Cid,
training_datasets: Vec<Cid>,
license: License,
) -> Self
pub fn new( model_cid: Cid, training_datasets: Vec<Cid>, license: License, ) -> Self
Create a new training provenance record
Sourcepub fn with_parent(self, parent_cid: Cid) -> Self
pub fn with_parent(self, parent_cid: Cid) -> Self
Set parent model
Sourcepub fn add_validation_dataset(self, dataset_cid: Cid) -> Self
pub fn add_validation_dataset(self, dataset_cid: Cid) -> Self
Add validation dataset
Sourcepub fn with_hyperparameters(self, hyperparameters: Hyperparameters) -> Self
pub fn with_hyperparameters(self, hyperparameters: Hyperparameters) -> Self
Set hyperparameters
Sourcepub fn add_metric(self, name: String, value: f32) -> Self
pub fn add_metric(self, name: String, value: f32) -> Self
Add metric
Sourcepub fn add_attribution(self, attribution: Attribution) -> Self
pub fn add_attribution(self, attribution: Attribution) -> Self
Add attribution
Sourcepub fn with_code_repository(self, repo: String, commit: String) -> Self
pub fn with_code_repository(self, repo: String, commit: String) -> Self
Set code repository
Sourcepub fn with_hardware(self, hardware: String) -> Self
pub fn with_hardware(self, hardware: String) -> Self
Set hardware info
Sourcepub fn with_framework(self, framework: String) -> Self
pub fn with_framework(self, framework: String) -> Self
Set framework
Trait Implementations§
Source§impl Clone for TrainingProvenance
impl Clone for TrainingProvenance
Source§fn clone(&self) -> TrainingProvenance
fn clone(&self) -> TrainingProvenance
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 moreSource§impl Debug for TrainingProvenance
impl Debug for TrainingProvenance
Source§impl<'de> Deserialize<'de> for TrainingProvenance
impl<'de> Deserialize<'de> for TrainingProvenance
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TrainingProvenance
impl RefUnwindSafe for TrainingProvenance
impl Send for TrainingProvenance
impl Sync for TrainingProvenance
impl Unpin for TrainingProvenance
impl UnwindSafe for TrainingProvenance
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