Пример #1
0
 def __init__(self, text_encoder, config):
     super(TextImage, self).__init__()
     self.config = config
     self.TextEncoderBottom = text_encoder
     self.TextEncoderTop = TextEncoderTop(**config['TextEncoderTop'])
     self.ImageEncoder = ImageEncoder(**config['ImageEncoder'])
     self.optimizer = optim.Adam(self.parameters(), lr=config['lr'])
Пример #2
0
 def __init__(self, speech_encoder, text_encoder, config):
     super(SpeechText, self).__init__()
     self.config = config
     self.SpeechEncoderBottom = speech_encoder
     self.TextEncoderBottom = text_encoder
     self.SpeechEncoderTop = SpeechEncoderTop(**config['SpeechEncoderTop'])
     self.TextEncoderTop = TextEncoderTop(**config['TextEncoderTop'])
     self.optimizer = optim.Adam(self.parameters(), lr=config['lr'])