diff options
| author | Hiroshiba Kazuyuki <kazuyuki_hiroshiba@dwango.co.jp> | 2017-11-16 06:36:51 +0900 |
|---|---|---|
| committer | Hiroshiba Kazuyuki <kazuyuki_hiroshiba@dwango.co.jp> | 2017-11-16 06:36:51 +0900 |
| commit | 3a69b426bfaed71f9ba1ca02fe0767300ac05a06 (patch) | |
| tree | c3b32d7caa27f0755b2013f19535679261c39ff9 /become_yukarin/model.py | |
| parent | 8520cf40ef62136c5b3e5d4139c97dad50107404 (diff) | |
add gru
Diffstat (limited to 'become_yukarin/model.py')
| -rw-r--r-- | become_yukarin/model.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/become_yukarin/model.py b/become_yukarin/model.py index 5f46876..9d69378 100644 --- a/become_yukarin/model.py +++ b/become_yukarin/model.py @@ -112,7 +112,7 @@ class CBHG(chainer.link.Chain): mode='constant', ) self.max_pooling = chainer.functions.MaxPoolingND(1, max_pooling_k, 1, cover_all=False) - self.out_size = out_channels + self.out_size = out_channels * 2 with self.init_scope(): self.conv_bank = Conv1DBank( @@ -128,12 +128,12 @@ class CBHG(chainer.link.Chain): self.highways = chainer.link.ChainList( *([ConvHighway(out_channels) for _ in range(highway_layers)]) ) - # self.gru = chainer.links.NStepBiGRU( - # n_layers=1, - # in_size=out_channels, - # out_size=out_channels, - # dropout=0.0, - # ) + self.gru = chainer.links.NStepBiGRU( + n_layers=1, + in_size=out_channels, + out_size=out_channels, + dropout=0.0, + ) def __call__(self, x): h = x @@ -144,9 +144,9 @@ class CBHG(chainer.link.Chain): for highway in self.highways: h = highway(h) - # h = chainer.functions.separate(chainer.functions.transpose(h, axes=(0, 2, 1))) - # _, h = self.gru(None, h) - # h = chainer.functions.transpose(chainer.functions.stack(h), axes=(0, 2, 1)) + h = chainer.functions.separate(chainer.functions.transpose(h, axes=(0, 2, 1))) + _, h = self.gru(None, h) + h = chainer.functions.transpose(chainer.functions.stack(h), axes=(0, 2, 1)) return h |
