-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
下面是我从/src/modules文件摘抄出来的代码
262行 self.switching_layer = nn.Linear(2 * hidden_size + hidden_size, 1) 282行 switch_prob = torch.ge(torch.sigmoid(self.switching_layer(switch_input)), 0.5).to(torch.float32) # [batch x 1 x 1] 303行 output = torch.where(~switch_prob.byte(), vocab_output, pointer_output)
因为vocab_output和pointer_output中都不含有self.switching_layer层的参数,所以,output 对switching_layer 层的参数求导结果为0,这样一来,switching_layer 层无法更新参数
Metadata
Metadata
Assignees
Labels
No labels