Skip to content

docs(APIs): RFC for enhancing paddle.metric.Metric with TorchMetrics-style infrastructure#1385

Open
PlumBlossomMaid wants to merge 1 commit into
PaddlePaddle:masterfrom
PlumBlossomMaid:feat/metric-enhancement-rfc
Open

docs(APIs): RFC for enhancing paddle.metric.Metric with TorchMetrics-style infrastructure#1385
PlumBlossomMaid wants to merge 1 commit into
PaddlePaddle:masterfrom
PlumBlossomMaid:feat/metric-enhancement-rfc

Conversation

@PlumBlossomMaid

Copy link
Copy Markdown
Contributor

Add design document for enhancing paddle.metric.Metric from a minimal ABC to a full-featured base class inspired by TorchMetrics.

This RFC proposes:

  • Inheriting paddle.nn.Layer for automatic device management and serialization
  • declare() (alias add_state) for declarative state management
  • dist_reduce_fn (alias dist_reduce_fx) for distributed reduction
  • forward() as unified entry point
  • MetricCollection and CompositionalMetric for metric composition
  • 40+ new classification and regression metrics with task-based dispatch

Includes three-framework comparison (PaddlePaddle / MindSpore / TorchMetrics) demonstrating the gap analysis and design rationale.

Related PR: https://github.com/PlumBlossomMaid/Paddle/pull/new/feature/optimize-metrics

@paddle-bot

paddle-bot Bot commented May 29, 2026

Copy link
Copy Markdown

你的PR提交成功,感谢你对开源项目的贡献!
请检查PR提交格式和内容是否完备,具体请参考示例模版
Your PR has been submitted. Thanks for your contribution!
Please check its format and content. For this, you can refer to Template and Demo.

@CLAassistant

CLAassistant commented May 29, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@PlumBlossomMaid PlumBlossomMaid force-pushed the feat/metric-enhancement-rfc branch from 966b65a to f134216 Compare May 29, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants