Update emlloss.py

pull/755/head
Bin Lu 2021-05-31 14:27:59 +08:00 committed by GitHub
parent adfd5c4c10
commit e9a1d83035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 11 deletions

View File

@ -86,15 +86,4 @@ class EmlLoss(paddle.nn.Layer):
loss = self.surrogate_function_stable(self.beta, theta, bias, self.thresh)
loss = paddle.mean(loss)
return {"emlloss": loss}
if __name__=="__main__":
metric = EmlLoss()
np.random.seed(1)
features = np.random.randn(40, 32)
features = paddle.to_tensor(features, dtype="float32")
print(features)
loss = metric(features)
print(loss)