songyingxin/TextClassification

关于models中LSTM参数初始化部分

Opened this issue · 1 comments

mz2sj commented

nn.init.orthogonal_(getattr(self.rnn, f'weight_hh_l{i}')) nn.init.kaiming_normal_(getattr(self.rnn, f'weight_ih_l{i}')) nn.init.constant_(getattr(self.rnn, f'bias_hh_l{i}'), val=0) nn.init.constant_(getattr(self.rnn, f'bias_ih_l{i}'), val=0) getattr(self.rnn, f'bias_hh_l{i}').chunk(4)[1].fill_(1)
想请教下博主参数初始化这部分,这里对weight和bias的初始化是对LSTM中各个门和候选记忆细胞所有参数的初始化吗?最后一句getattr(self.rnn, f'bias_hh_l{i}').chunk(4)[1].fill_(1)是什么意思呢?

mz2sj commented