def mean_clipped_loss(y, t):
# Add an axis because F.huber_loss only accepts arrays with ndim >= 2
y = F.expand_dims(y, axis=-1)
t = F.expand_dims(t, axis=-1)
return F.sum(F.huber_loss(y, t, 1.0)) / y.shape[0]
评论列表
文章目录