From 03dc76394d905537615e8a967f55750f6907e9df Mon Sep 17 00:00:00 2001 From: jinyuKing <2943829328@qq.com> Date: Wed, 3 Jun 2020 04:38:31 +0000 Subject: [PATCH] add hapi/simnet_model --- .../nets/losses/softmax_cross_entropy_loss.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/examples/similarity_net/nets/losses/softmax_cross_entropy_loss.py b/examples/similarity_net/nets/losses/softmax_cross_entropy_loss.py index b410040..9701538 100644 --- a/examples/similarity_net/nets/losses/softmax_cross_entropy_loss.py +++ b/examples/similarity_net/nets/losses/softmax_cross_entropy_loss.py @@ -18,17 +18,7 @@ softmax loss import sys sys.path.append("../") import paddle.fluid as fluid -from hapi.model import Loss -''' -class SoftmaxCrossEntropyLoss(Loss): - def __init__(self,conf_dict): - super(SoftmaxCrossEntropyLoss,self).__init__() - - def forward(self,input,label): - cost=fluid.layers.cross_entropy(input=input,label=label) - avg_cost=fluid.layers.reduce_mean(cost) - return avg_cost -''' +from paddle.incubate.hapi.loss import Loss class SoftmaxCrossEntropyLoss(Loss): -- GitLab