未验证 提交 98040d71 编写于 作者: M mamingjie-China 提交者: GitHub

Merge pull request #6 from PaddlePaddle/develop

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