def get_cell_with_dropout(self, rng: RandomStreams, dropout_rate: float):
with_dropout = GruCell.__new__(GruCell)
with_dropout.__w_hid, with_dropout.__w_in = dropout_multiple(
dropout_rate, rng, True, self.__w_hid, self.__w_in)
with_dropout.__biases = self.__biases
with_dropout.get_cell_with_dropout = None
with_dropout.__name = self.__name + ":with_dropout"
with_dropout.__memory_D = self.__memory_D
with_dropout.__grad_clip = self.__grad_clip
return with_dropout
评论列表
文章目录