pub struct LossSpec {
pub schema_version: u32,
pub loss_id: String,
pub kind: SemanticSpecKind,
pub task_kinds: BTreeSet<LearningTaskKind>,
pub prediction_kinds: BTreeSet<PredictionKind>,
pub objective: MetricObjective,
pub reduction: LossReduction,
pub required_inputs: BTreeSet<CriterionInput>,
pub capabilities: BTreeSet<LossCapability>,
pub parameters: Value,
pub spec_fingerprint: String,
}Fields§
§schema_version: u32§loss_id: String§kind: SemanticSpecKind§task_kinds: BTreeSet<LearningTaskKind>§prediction_kinds: BTreeSet<PredictionKind>§objective: MetricObjective§reduction: LossReduction§required_inputs: BTreeSet<CriterionInput>§capabilities: BTreeSet<LossCapability>§parameters: Value§spec_fingerprint: StringImplementations§
Source§impl LossSpec
impl LossSpec
pub fn new( loss_id: impl Into<String>, kind: SemanticSpecKind, task_kinds: BTreeSet<LearningTaskKind>, prediction_kinds: BTreeSet<PredictionKind>, reduction: LossReduction, required_inputs: BTreeSet<CriterionInput>, capabilities: BTreeSet<LossCapability>, parameters: Value, ) -> Result<LossSpec, DagMlError>
pub fn from_json(json: &str) -> Result<LossSpec, DagMlError>
pub fn compute_fingerprint(&self) -> Result<String, DagMlError>
pub fn validate(&self) -> Result<(), DagMlError>
pub fn validate_compatibility( &self, task_kind: LearningTaskKind, prediction_kind: PredictionKind, ) -> Result<(), DagMlError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LossSpec
impl<'de> Deserialize<'de> for LossSpec
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LossSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LossSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for LossSpec
Source§impl Serialize for LossSpec
impl Serialize for LossSpec
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for LossSpec
Auto Trait Implementations§
impl Freeze for LossSpec
impl RefUnwindSafe for LossSpec
impl Send for LossSpec
impl Sync for LossSpec
impl Unpin for LossSpec
impl UnsafeUnpin for LossSpec
impl UnwindSafe for LossSpec
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.