本文整理匯總了Python中text.symbols方法的典型用法代碼示例。如果您正苦於以下問題:Python text.symbols方法的具體用法?Python text.symbols怎麽用?Python text.symbols使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類text
的用法示例。
在下文中一共展示了text.symbols方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_symbols
# 需要導入模塊: import text [as 別名]
# 或者: from text import symbols [as 別名]
def test_symbols():
assert len(symbols) >= 3
assert symbols[0] == '_'
assert symbols[1] == '~'
示例2: __init__
# 需要導入模塊: import text [as 別名]
# 或者: from text import symbols [as 別名]
def __init__(self, hp, freq, layers):
super(TTS, self).__init__()
self.hp = hp
self.W_t_0 = nn.Linear(1, hp.model.hidden)
self.W_f_0 = nn.Linear(1, hp.model.hidden)
self.W_c_0 = nn.Linear(freq, hp.model.hidden)
self.layers = nn.ModuleList([DelayedRNN(hp) for _ in range(layers)])
# Gaussian Mixture Model: eq. (2)
self.K = hp.model.gmm
# map output to produce GMM parameter eq. (10)
self.W_theta = nn.Linear(hp.model.hidden, 3*self.K)
if self.hp.data.name == 'KSS':
self.embedding_text = nn.Embedding(len(symbols), hp.model.hidden)
elif self.hp.data.name == 'Blizzard':
self.embedding_text = nn.Embedding(len(en_symbols), hp.model.hidden)
else:
raise NotImplementedError
self.text_lstm = nn.LSTM(
input_size=hp.model.hidden,
hidden_size=hp.model.hidden//2,
batch_first=True,
bidirectional=True
)
self.attention = Attention(hp)