![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
机器学习笔记
关于机器学习记录的笔记和代码
MarkJhon
这个作者很懒,什么都没留下…
展开
-
解决样本不平衡方法:Focal Loss
Focal Loss的作用:主要是为了解决目标检测任务中类别不平衡问题。 Focal Loss应用一个调制项到交叉熵损失函数上,以集中学习困难的负面例子。 通过使用缩放因子(scaling factor)控制交叉熵损失的动态缩放。缩放因子随着正类别的置信度增加,缩放因子衰减为零。 直观看来,该缩放因子可自动降低训练过程中Easy example的权重,并快速将模型集中在难样本(hard example)上。 公式表达上,Focal Loss为标准交叉熵标准增加了一个因子。设置降低分类较好的样本损失(原创 2021-10-04 14:48:47 · 429 阅读 · 0 评论 -
代码记录:Spatial pyramid pooling Implementation
import numpy as np import math import tensorflow as tf #inupt_feature maps if of the form: N, C, H, W def np_spatial_pyramid_pooling(input_feature_maps, spatial_pyramid, dtype=np.float32): assert input_feature_maps.ndim == 4 assert spatial_pyrami.原创 2020-12-08 15:27:58 · 133 阅读 · 0 评论 -
集于Yolo3的目标检测模型(百度AiStudio)
简介 YOLOv3 是由 Joseph Redmon 和 Ali Farhadi 提出的单阶段检测器, 该检测器与达到同样精度的传统目标检测方法相比,推断速度能达到接近两倍. 模型结构 YOLOv3将输入图像分成S*S个格子,每个格子预测B个bounding box,每个bounding box预测内容包括: Location(x, y, w, h)、Confidence Score和C个类别的概率,因此YOLOv3输出层的channel数为B*(5 + C)。YOLOv3的loss函数也有三部分组成翻译 2020-07-13 17:16:00 · 1581 阅读 · 1 评论