示例#1
0
    def test_in_out(self):
        layer = CBHG(128, K= 6, projections=[128, 128], num_highways=2)
        dummy_input = T.autograd.Variable(T.rand(4, 8, 128))

        print(layer)
        output = layer(dummy_input)
        assert output.shape[0] == 4
        assert output.shape[1] == 8
        assert output.shape[2] == 256
示例#2
0
 def __init__(self, embedding_dim=256, linear_dim=1025, mel_dim=80,
              r=5, padding_idx=None):
     super(Tacotron, self).__init__()
     self.r = r
     self.mel_dim = mel_dim
     self.linear_dim = linear_dim
     self.embedding = nn.Embedding(len(symbols), embedding_dim,
                                   padding_idx=padding_idx)
     print(" | > Embedding dim : {}".format(len(symbols)))
     self.embedding.weight.data.normal_(0, 0.3)
     self.encoder = Encoder(embedding_dim)
     self.decoder = Decoder(256, mel_dim, r)
     self.postnet = CBHG(mel_dim, K=8, projections=[256, mel_dim])
     self.last_linear = nn.Linear(mel_dim * 2, linear_dim)
示例#3
0
    def test_in_out(self):
        layer = self.cbhg = CBHG(128,
                                 K=8,
                                 conv_bank_features=80,
                                 conv_projections=[160, 128],
                                 highway_features=80,
                                 gru_features=80,
                                 num_highways=4)
        dummy_input = T.rand(4, 8, 128)

        print(layer)
        output = layer(dummy_input)
        assert output.shape[0] == 4
        assert output.shape[1] == 8
        assert output.shape[2] == 160
示例#4
0
    def test_in_out(self):
        #pylint: disable=attribute-defined-outside-init
        layer = self.cbhg = CBHG(128,
                                 K=8,
                                 conv_bank_features=80,
                                 conv_projections=[160, 128],
                                 highway_features=80,
                                 gru_features=80,
                                 num_highways=4)
        # B x D x T
        dummy_input = T.rand(4, 128, 8)

        print(layer)
        output = layer(dummy_input)
        assert output.shape[0] == 4
        assert output.shape[1] == 8
        assert output.shape[2] == 160