def __init__(self, out_dims=64, normalize_output=False):
super(ModifiedGoogLeNet, self).__init__()
# remove links and functions
for name in [n for n in self._children if n.startswith('loss')]:
self._children.remove(name)
delattr(self, name)
self.functions.pop('loss3_fc')
self.functions.pop('prob')
self.add_link('bn_fc', L.BatchNormalization(1024))
self.add_link('fc', L.Linear(1024, out_dims))
image_mean = np.array([123, 117, 104], dtype=np.float32) # RGB
self._image_mean = image_mean[None, :, None, None]
self.normalize_output = normalize_output
modified_googlenet.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录