Single Shot MultiBox Detector(MXNet)源码阅读笔记(2)
来源:互联网 发布:金星秀停播原因知乎 编辑:程序博客网 时间:2024/05/22 14:58
Single Shot MultiBox Detector(MXNet)源码阅读笔记(2)
初始化的方法Xavier
We initialize the parameters for all the newly added convolutional layers with the “xavier” method.
论文中所述,我们对新增加的卷积层使用“xavier”的方法进行初始化。
Xavier Initialization很简单,其实就是
则
具体解释见andy’sblog
原理出处见论文Understanding the difficulty of training deep feedforward neural networks
MXnet中代码initializer.py部分
class Xavier(Initializer): """Initialize the weight with Xavier or similar initialization scheme. Parameters ---------- rnd_type: str, optional Use ```gaussian``` or ```uniform``` to init factor_type: str, optional Use ```avg```, ```in```, or ```out``` to init magnitude: float, optional scale of random number range """ def __init__(self, rnd_type="uniform", factor_type="avg", magnitude=3): super(Xavier, self).__init__(rnd_type=rnd_type, factor_type=factor_type,magnitude=magnitude) self.rnd_type = rnd_type self.factor_type = factor_type self.magnitude = float(magnitude) def _init_weight(self, _, arr): shape = arr.shape hw_scale = 1. if len(shape) > 2: hw_scale = np.prod(shape[2:]) fan_in, fan_out = shape[1] * hw_scale, shape[0] * hw_scale factor = 1. if self.factor_type == "avg": factor = (fan_in + fan_out) / 2.0 # 计算方差 elif self.factor_type == "in": factor = fan_in elif self.factor_type == "out": factor = fan_out else: raise ValueError("Incorrect factor type") scale = np.sqrt(self.magnitude / factor) # 计算范围 if self.rnd_type == "uniform": random.uniform(-scale, scale, out=arr) elif self.rnd_type == "gaussian": random.normal(0, scale, out=arr) else: raise ValueError("Unknown random type")
0 0
- Single Shot MultiBox Detector(MXNet)源码阅读笔记(2)
- 阅读笔记:Single Shot Multibox Detector(SSD)
- SSD(single-shot multibox detector)源码学习笔记
- SSD:single shot multibox detector 阅读笔记
- SSD(Single Shot MultiBox Detector)理论学习
- 论文阅读笔记:SSD: Single Shot MultiBox Detector
- CAFFE实验学习笔记(2)——SSD(Single Shot MultiBox Detector)
- 论文阅读:SSD: Single Shot MultiBox Detector
- 论文阅读:SSD: Single Shot MultiBox Detector
- 论文阅读:SSD: Single Shot MultiBox Detector
- 论文阅读:SSD: Single Shot MultiBox Detector
- SSD: Single Shot MultiBox Detector论文阅读
- 【论文阅读】SSD: Single Shot MultiBox Detector
- 论文阅读:SSD: Single Shot MultiBox Detector
- 论文笔记 | SSD: Single Shot MultiBox Detector
- 论文笔记 SSD: Single Shot MultiBox Detector
- SSD:Single Shot MultiBox Detector 论文笔记
- 论文笔记《SSD: Single Shot MultiBox Detector》
- Unity开发详解之新建工程(1/6)
- YDB基本使用详解
- VC 消息积累 01
- Ubuntu报“xxx is not in the sudoers file.This incident will be reported” 错误解决方法
- php调试时echo,print_r(),var_dump()的区别
- Single Shot MultiBox Detector(MXNet)源码阅读笔记(2)
- 。
- IntelliJ IDEA 15 最新破解方法
- 简洁移动的Java代码模拟Android Handler机制,值得一看!!
- RatingBar(评分星数)的使用样例
- 海康SDK开发笔记(一)
- Lua基础笔记
- RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9
- OVS 配置虚机vlan