未验证 提交 ed600b30 编写于 作者: D Double_V 提交者: GitHub

Merge pull request #1580 from WenmuZhou/dygraph_rc

add init to fc1
......@@ -16,6 +16,7 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import paddle
from paddle import nn, ParamAttr
from paddle.nn import functional as F
......@@ -88,11 +89,14 @@ class LocalizationNetwork(nn.Layer):
in_channels = num_filters
self.block_list.append(pool)
name = "loc_fc1"
stdv = 1.0 / math.sqrt(num_filters_list[-1] * 1.0)
self.fc1 = nn.Linear(
in_channels,
fc_dim,
weight_attr=ParamAttr(
learning_rate=loc_lr, name=name + "_w"),
learning_rate=loc_lr,
name=name + "_w",
initializer=nn.initializer.Uniform(-stdv, stdv)),
bias_attr=ParamAttr(name=name + '.b_0'),
name=name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册