Пример #1
0
    def model(self):
        """
        The main model function, takes and returns tensors.
        Defined in modules.

        """

        with tf.variable_scope('encoder') as scope:
            self.content_embedding_1 = modules_autovc.content_encoder(
                self.input_placeholder, self.speaker_onehot_labels,
                self.is_train)

        with tf.variable_scope('decoder') as scope:
            self.output_1 = modules_autovc.decoder(
                self.content_embedding_1, self.speaker_onehot_labels_1,
                self.is_train)

        with tf.variable_scope('post_net') as scope:
            self.residual = modules_autovc.post_net(self.output_1,
                                                    self.is_train)
            self.output = self.output_1 + self.residual

        with tf.variable_scope('encoder') as scope:
            scope.reuse_variables()
            self.content_embedding_2 = modules_autovc.content_encoder(
                self.output, self.speaker_onehot_labels, self.is_train)

        with tf.variable_scope('stft_encoder') as scope:

            self.content_embedding_stft = modules_SDN.content_encoder_stft(
                self.stft_placeholder, self.is_train)

        with tf.variable_scope('stft_decoder') as scope:
            self.output_stft_1 = modules_autovc.decoder(
                self.content_embedding_stft, self.speaker_onehot_labels_1,
                self.is_train)

        with tf.variable_scope('stft_post_net') as scope:

            self.residual_stft = modules_autovc.post_net(
                self.output_stft_1, self.is_train)
            self.output_stft = self.output_stft_1 + self.residual_stft

        with tf.variable_scope('encoder') as scope:
            scope.reuse_variables()
            self.content_embedding_stft_2 = modules_autovc.content_encoder(
                self.output_stft, self.speaker_onehot_labels, self.is_train)

        with tf.variable_scope('F0_Model') as scope:
            self.f0 = modules_SDN.enc_dec_f0(self.stft_placeholder,
                                             self.output_stft[:, :, :-4],
                                             self.output_stft[:, :, -4:],
                                             self.is_train)
        with tf.variable_scope('Vuv_Model') as scope:
            self.vuv = modules_SDN.enc_dec_vuv(self.stft_placeholder,
                                               self.output_stft[:, :, :-4],
                                               self.output_stft[:, :, -4:],
                                               self.f0, self.is_train)
Пример #2
0
    def model(self):
        """
        The main model function, takes and returns tensors.
        Defined in modules.

        """


        with tf.variable_scope('encoder') as scope:
            self.content_embedding_1 = modules.content_encoder(self.input_placeholder, self.speaker_labels, self.is_train)


        with tf.variable_scope('decoder') as scope: 
            self.output_1 = modules.decoder(self.content_embedding_1, self.speaker_labels_1, self.is_train)

        with tf.variable_scope('post_net') as scope: 
            self.residual = modules.post_net(self.output_1, self.is_train)
            self.output = self.output_1 + self.residual
        with tf.variable_scope('encoder') as scope:
            scope.reuse_variables()
            self.content_embedding_2 = modules.content_encoder(self.output, self.speaker_labels_1, self.is_train)
Пример #3
0
    def model(self):
        """
        The main model function, takes and returns tensors.
        Defined in modules.

        """

        with tf.variable_scope('encoder') as scope:
            self.content_embedding_1 = modules.content_encoder(
                self.input_placeholder, self.speaker_onehot_labels,
                self.is_train)

        with tf.variable_scope('decoder') as scope:
            self.output_1 = modules.decoder(self.content_embedding_1,
                                            self.speaker_onehot_labels_1,
                                            self.is_train)

        with tf.variable_scope('post_net') as scope:
            self.residual = modules.post_net(self.output_1, self.is_train)
            self.output = self.output_1 + self.residual
        with tf.variable_scope('encoder') as scope:
            scope.reuse_variables()
            self.content_embedding_2 = modules.content_encoder(
                self.output, self.speaker_onehot_labels, self.is_train)

        with tf.variable_scope('F0_Model') as scope:
            self.f0 = modules_notes.f0_model(self.content_embedding_1,
                                             self.notes_placeholder,
                                             self.speaker_onehot_labels_1,
                                             self.is_train)
            self.f0 = (self.f0 +
                       self.notes_placeholder[:, :, 0:1]) * tf.clip_by_value(
                           self.notes_placeholder[:, :, 0:1] * 500,
                           clip_value_min=0,
                           clip_value_max=1)
        with tf.variable_scope('Vuv_Model') as scope:
            self.vuv = modules_notes.vuv_model(self.output,
                                               self.notes_placeholder, self.f0,
                                               self.is_train)