提交 3fd13e70 编写于 作者: Y Yu Yang 提交者: GitHub

Merge pull request #1556 from helinwang/sum

change sumCost to sum
...@@ -101,7 +101,7 @@ class SGD(): ...@@ -101,7 +101,7 @@ class SGD():
for each_param in self.__gradient_machine__.getNonStaticParameters( for each_param in self.__gradient_machine__.getNonStaticParameters(
): ):
updater.update(each_param) updater.update(each_param)
cost_sum = out_args.sumCosts() cost_sum = out_args.sum()
cost = cost_sum / len(data_batch) cost = cost_sum / len(data_batch)
updater.finishBatch(cost) updater.finishBatch(cost)
batch_evaluator.finish() batch_evaluator.finish()
...@@ -137,7 +137,7 @@ class SGD(): ...@@ -137,7 +137,7 @@ class SGD():
num_samples += len(data_batch) num_samples += len(data_batch)
self.__gradient_machine__.forward( self.__gradient_machine__.forward(
feeder(data_batch), out_args, api.PASS_TEST) feeder(data_batch), out_args, api.PASS_TEST)
total_cost += out_args.sumCosts() total_cost += out_args.sum()
self.__gradient_machine__.eval(evaluator) self.__gradient_machine__.eval(evaluator)
evaluator.finish() evaluator.finish()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册