Conversation
|
|
||
| class TestEvaluator(unittest.TestCase): | ||
| def setup(self, scope, inputs, outputs): | ||
| def __create_var__(var_name, arr): |
There was a problem hiding this comment.
def __create_var__ -> def _create_var.
| class Evaluator(object): | ||
| def __init__(self, | ||
| scope, | ||
| operator='accuracy', |
There was a problem hiding this comment.
看了下这个Evaluator里只有对多个mini-batch间的结果累加求平均。但对于PrecisionRecall这种多个mini-batch间结果统计并不是简单的累加求平均。
所以感觉如果在Python里抽象出Evaluator,用来统计多个mini-batch间的计算结果,需要抽象出一个Evaluator基类接口,然后有很多子类,AccuracyEvalutor, PrecisionRecallEvalutor等等。
There was a problem hiding this comment.
嗯,前面定义了avg_accumulate,是解决这个问题的。但的确没有考虑编译时。需要把avg accumulator等作为op,才可以使python定义的计算是编译时的。
|
@qingqing01 @typhoonzero @wangkuiyi from my understanding the PaddlePaddle program is divided into compile time (currently Python) and runtime (C++): the Python code generates a protobuf which describes the computation, and the C++ code runs the computation description. This implementation of the executor is in Python (uses |
|
@helinwang you are right, I'll try to put this implementation to compile time. |
| var_map[input] = [input] | ||
| var_map[label] = [label] | ||
| var_map[output] = [output] | ||
| self.op = op.Operator(operator, **var_map) |
There was a problem hiding this comment.
Currently, we can not create operator immediately out of Python Block and Program.
Paddle/python/paddle/v2/framework/framework.py
Lines 430 to 446 in 1f11f77
May I just merge this work into codebase and let me polish it to fit in the refactorization code? : )
Our book porting work need this feature eagerly. @typhoonzero @qingqing01
There was a problem hiding this comment.
Sure, Thanks. Please also refer to some of my thoughts: #5157
dzhwinter
left a comment
There was a problem hiding this comment.
LGTM!
I just merge this work into codebase and let me polish it.
Our book chapters need this feature eagerly.
@typhoonzero @helinwang
Fix #3808