def __init__(self, voc_size, hidden_size, on, num_layers=5): super().__init__() self.encoder = Encoder(voc_size, hidden_size, num_layers) self.score = Linear(hidden_size * (num_layers + 1), 5) self.hidden_size = hidden_size self.num_layers = num_layers self.on = on
def __init__(self, voc_size, hidden_size, timesteps, on, sos, num_layers=3): super().__init__() self.encoder = Encoder(voc_size, hidden_size, num_layers) decoder = Decoder(voc_size, hidden_size, timesteps, num_layers) self.decoder = FullDecoder(voc_size, decoder) self.hidden_size = hidden_size self.timesteps = timesteps self.num_layers = num_layers self.on = on self.sos = sos
def __init__(self, voc_size, hidden_size, timesteps, on, sos_pad, num_layers=3): super().__init__() self.encoder = Encoder(voc_size, hidden_size, num_layers) self.decoder = Decoder(voc_size, hidden_size, timesteps, num_layers) self.dual = Dual(hidden_size, voc_size) self.QFunc = Q(self.decoder, self.dual) self.hidden_size = hidden_size self.timesteps = timesteps self.num_layers = num_layers self.on = on (self.sos, self.pad) = sos_pad