make exp3 works but no check
This commit is contained in:
@@ -20,19 +20,6 @@ class Cnn(torch.nn.Module):
|
||||
self.fc1 = torch.nn.Linear(64 * 3 * 3, 64)
|
||||
self.fc2 = torch.nn.Linear(64, 10)
|
||||
|
||||
# 初始化模型参数
|
||||
self.__initialize_weights()
|
||||
|
||||
def __initialize_weights(self):
|
||||
# YYC MARK:
|
||||
# 把两个全连接线性层按tensorflow默认设置初始化,即:
|
||||
# - kernel_initializer='glorot_uniform'
|
||||
# - bias_initializer='zeros'
|
||||
torch.nn.init.xavier_normal_(self.fc1.weight)
|
||||
torch.nn.init.zeros_(self.fc1.bias)
|
||||
torch.nn.init.xavier_normal_(self.fc2.weight)
|
||||
torch.nn.init.zeros_(self.fc2.bias)
|
||||
|
||||
def forward(self, x):
|
||||
x = F.relu(self.conv1(x))
|
||||
x = self.pool1(x)
|
||||
|
||||
Reference in New Issue
Block a user