Interface Metric

All Known Implementing Classes:
Accuracy, Precision, Recall

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 Link icon

    Modifier and Type
    Method
    Description
    double
    Computes the metric value from the metric state, which are updated by previous update() calls.
    Returns the name of metric.
    void
    Resets the metric state variables to their default value.
    void
    update(Tensor output, Tensor target)
    Updates the metric states with input data.
  • Method Details Link icon

    • name Link icon

      String name()
      Returns the name of metric.
      Returns:
      the name of metric.
    • update Link icon

      void update(Tensor output, Tensor target)
      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 Link icon

      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 Link icon

      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.