Package smile.deep.metric
Interface Metric
public interface Metric
The class metrics keeps track of metric states, which enables them to
be able to calculate values through accumulations and synchronizations
across multiple processes.
-
Method Summary
Modifier and TypeMethodDescriptiondouble
compute()
Computes the metric value from the metric state, which are updated by previous update() calls.name()
Returns the name of metric.void
reset()
Resets the metric state variables to their default value.void
Updates the metric states with input data.
-
Method Details
-
name
String name()Returns the name of metric.- Returns:
- the name of metric.
-
update
Updates the metric states with input data. This is often used when new data needs to be added for metric computation.- Parameters:
output
- the model output.target
- the ground truth.
-
compute
double compute()Computes the metric value from the metric state, which are updated by previous update() calls. The compute frequency can be less than the update frequency.- Returns:
- the metric value.
-
reset
void reset()Resets the metric state variables to their default value. Usually this is called at the end of every epoch to clean up metric states.
-