未验证 提交 4c4fb484 编写于 作者: J Jason 提交者: GitHub

Merge pull request #155 from SunAhong1993/develop

fix the lrn
......@@ -363,7 +363,7 @@ class CaffeOpMapper(OpMapper):
input = self.graph.get_bottom_node(node, idx=0, copy=True)
attr = {
'n': params.local_size,
'k': 1.0,
'k': params.k,
'alpha': alpha,
'beta': params.beta,
'name': string(node.layer_name)
......@@ -649,7 +649,8 @@ class CaffeOpMapper(OpMapper):
]).astype('float32')
scale = 0
else:
node.data = [np.squeeze(i) for i in node.data]
node.data = [np.squeeze(i).astype('float32') for i in node.data]
mean, variance, scale = node.data
# Prescale the stats
scaling_factor = 1.0 / scale if scale != 0 else 0
......@@ -684,8 +685,10 @@ class CaffeOpMapper(OpMapper):
input_c,
]).astype('float32')
else:
self.weights[node.layer_name + '_scale'] = np.squeeze(node.data[0])
self.weights[node.layer_name + '_offset'] = np.squeeze(node.data[1])
self.weights[node.layer_name + '_scale'] = np.squeeze(
node.data[0]).astype('float32')
self.weights[node.layer_name + '_offset'] = np.squeeze(
node.data[1]).astype('float32')
params = node.layer.scale_param
axis = params.axis
num_axes = params.num_axes
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册