TTS/layers/custom_layers.py

25 lines
740 B
Python
Raw Normal View History

2018-03-22 19:34:31 +00:00
# coding: utf-8
import torch
from torch import nn
2018-03-22 19:47:54 +00:00
# class StopProjection(nn.Module):
# r""" Simple projection layer to predict the "stop token"
2018-03-22 19:34:31 +00:00
2018-03-22 19:47:54 +00:00
# Args:
# in_features (int): size of the input vector
# out_features (int or list): size of each output vector. aka number
# of predicted frames.
2018-04-03 10:24:57 +00:00
# """
2018-03-22 19:34:31 +00:00
2018-03-22 19:47:54 +00:00
# def __init__(self, in_features, out_features):
# super(StopProjection, self).__init__()
# self.linear = nn.Linear(in_features, out_features)
# self.dropout = nn.Dropout(0.5)
# self.sigmoid = nn.Sigmoid()
2018-04-03 10:24:57 +00:00
2018-03-22 19:47:54 +00:00
# def forward(self, inputs):
# out = self.dropout(inputs)
# out = self.linear(out)
# out = self.sigmoid(out)
2018-04-03 10:24:57 +00:00
# return out