- 博客(4)
- 收藏
- 关注
原创 label smoothing(标签平滑)
问题交叉熵训练时会自动往减小误差函数的方向,即驱使自身往正确标签和错误标签差值最大的方向学习,在训练数据不足以表征所有样本特征的情况下,这就会导致网络过拟合。解决one-hot硬编码形式的标签会导致过拟合,而label smoothing是一种正则化策略,通常用于分类问题,通过soft one-hot 标签来引入噪声,减小了真实样本标签的类别在计算损失函数时的权重,从而改善泛化能力差的问题。对于分类问题,传统的one-hot编码的标签向量为:而label smoothing结合了均匀
2020-12-26 19:00:46
529
1
原创 斐波那契数列算法题
题目描述大家都知道斐波那契数列,现在要求输入一个整数n,请你输出斐波那契数列的第n项(从0开始,第0项为0,第1项是1)。示例1输入4返回值3递归解法这是最容易想到的最简单的方法:class Solution: def Fibonacci(self, n): # write code here if n==0: return 0 elif n==1: retu
2020-12-26 15:19:02
299
2
原创 近期错误总结
在PSL的loss中加入了edge_loss这一项后,报错如下:loss = sal_loss+ 0.4 * edge_lossRuntimeError: Function AddBackward0 returned an invalid gradient at index 1 - expected type torch.cuda.FloatTensor but got torch.cuda.DoubleTensor解决:用torch.dtype()检查了两项损失的具体类型,发现sal_lo.
2020-09-08 18:52:05
231
原创 Tensorflow加载模型错误:NotFoundError: Restoring from checkpoint failed.
NotFoundError: Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint解决办法:restart kerne..
2020-08-31 16:36:58
847
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人