
cnn知识
文章平均质量分 72
magic_ll
有空就记记,没空就休息
展开
-
【炼丹随记】样本不均衡时,class_weight 的计算
语义分割时,如果样本比例失衡,就需要设置 class_weight来平衡损失,那么该如何计算呢?直观的想到是,先获取图片的每个类别的像素点的个数之间的比例,然后用1去除以。比如:class1 : class2 : class3 = 100 : 10 : 1,那么 weight1 : weight2 : weight3 = 1:10:100。但这个比值偏差太大,放到loss中训练并不能得到一个好的结果。某一次在【https://github.com/openseg-group/OCNet.p.原创 2022-03-09 15:13:27 · 6714 阅读 · 4 评论 -
CNN基础知识 || 激活函数 Mish、Relu、Softplus的公式和画法
Mish激活函数:f(x)=x⋅tanh(softplus(x))=x⋅tanh(ln(1+ex))f(x)=x\cdot \tanh(softplus(x))=x\cdot \tanh(\ln(1+e^x))f(x)=x⋅tanh(softplus(x))=x⋅tanh(ln(1+ex))relu激活函数:f(x)=max{0,x}f(x)=max\{0,x\}f(x)=max{0,x}Softplus函数:f(x)=ln(1+ex)f(x)=\ln(1+e^x)f(x)=ln(1+ex).原创 2021-03-19 09:33:51 · 2522 阅读 · 0 评论 -
tensorflow || 滑动平均的理解--tf.train.ExponentialMovingAverage
1 滑动平均的理解滑动平均(exponential moving average),即 指数加权平均(exponentially weighted moving average),用来估计变量在历史某一时间段的平均值变量 vvv 在 ttt 时刻记为 vtv_tvt,$$原创 2020-07-29 10:45:38 · 1002 阅读 · 0 评论 -
CNN基础知识 || 均方差损失函数
定义在深度学习中,做回归任务时使用的loss多为均方差。公式为其中:Batch为样本数量,M为网络输出层的元素的个数实现loss = tf.nn.l2_loss(x, x') *2.0/ (Batch*M) loss = tf.losses.mean_squared_error(x, x') loss = tf.reduce_mean((x - x')**2) l...原创 2019-08-02 14:39:48 · 2705 阅读 · 0 评论 -
CNN基础知识 || softmax与交叉熵
目录一、函数1 sigmoid2 softmax二、熵的梳理1 信息量2 熵(信息量的期望)3 相对熵4 交叉熵三、机器学习中交叉熵的应用1.为什么使用交叉熵2 交叉熵在一对一分类问题中的使用3 交叉熵在一对多分类问题中的使用4 softmax和cross-entropy的关系四 tensorflow中的使用1 softmax_cross...原创 2019-07-30 14:28:19 · 943 阅读 · 0 评论