Skip to content

HarmonicMean metric for ignite.metrics #3648

@leelakrishnaRajasimha

Description

@leelakrishnaRajasimha

Feature

This issue proposes adding a new metric 'HarmonicMean' to ignite.metrics.

The harmonic mean is defined as:

H = n / sum(1 / x_i)

where x_i are the individual values.

This metric can be useful in evaluation scenarios where the harmonic mean of values is required. While Ignite provides several mean-based metrics, there is currently no general-purpose harmonic mean metric.

Proposed implementation

  • A new metric class HarmonicMean in ignite.metrics
  • Supports device placement
  • Compatible with distributed training via sync_all_reduce
  • Includes tests and documentation

Example usage:

metric = HarmonicMean()
metric.attach(evaluator, "harmonic_mean")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions