Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pnpair evaluator bug #3473

Merged
merged 3 commits into from
Aug 14, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions python/paddle/trainer_config_helpers/evaluators.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,8 @@ def auc_evaluator(
def pnpair_evaluator(
input,
label,
info,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not delete info, it is useful in https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/gserver/evaluators/Evaluator.cpp#L874

the info should be put into input.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thks.

name=None,
weight=None, ):
weight,
name=None, ):
"""
Positive-negative pair rate Evaluator which adapts to rank task like
learning to rank. This evaluator must contain at least three layers.
Expand All @@ -308,27 +307,24 @@ def pnpair_evaluator(

.. code-block:: python

eval = pnpair_evaluator(input, info, label)
eval = pnpair_evaluator(input, label, weight)

:param name: Evaluator name.
:type name: None|basestring
:param input: Input Layer name. The output prediction of network.
:type input: LayerOutput
:param label: Label layer name.
:type label: LayerOutput
:param info: Label layer name. (TODO, explaination)
:type info: LayerOutput
:param weight: Weight Layer name. It should be a matrix with size
[sample_num, 1]. (TODO, explaination)
:type weight: LayerOutput
:param name: Evaluator name.
:type name: None|basestring
"""
evaluator_base(
name=name,
type="pnpair",
input=input,
type="pnpair",
label=label,
info=info,
weight=weight)
weight=weight,
name=name, )


@evaluator(EvaluatorAttribute.FOR_CLASSIFICATION)
Expand Down