mattertune.finetune.metrics
Classes
|
|
|
|
|
- class mattertune.finetune.metrics.MetricBase(property_name)[source]
- Parameters:
property_name (str)
- __init__(property_name)[source]
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- Parameters:
property_name (str)
- abstract forward(prediction, ground_truth)[source]
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.- Parameters:
prediction (dict[str, Any])
ground_truth (dict[str, Any])
- Return type:
Mapping[str, Metric]
- class mattertune.finetune.metrics.PropertyMetrics(property_name)[source]
- Parameters:
property_name (str)
- __init__(property_name)[source]
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- Parameters:
property_name (str)
- forward(prediction, ground_truth)[source]
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.- Parameters:
prediction (dict[str, Any])
ground_truth (dict[str, Any])
- class mattertune.finetune.metrics.FinetuneMetrics(properties, metric_prefix='')[source]
- Parameters:
properties (Sequence[PropertyConfig])
metric_prefix (str)
- __init__(properties, metric_prefix='')[source]
Initialize internal Module state, shared by both nn.Module and ScriptModule.
- Parameters:
properties (Sequence[PropertyConfig])
metric_prefix (str)
- forward(predictions, labels)[source]
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.- Parameters:
predictions (dict[str, Any])
labels (dict[str, Any])
- Return type:
Mapping[str, Metric]