MCPcopy
hub / github.com/andabi/deep-voice-conversion / cbhg

Function cbhg

modules.py:304–324  ·  view source on GitHub ↗
(input, num_banks, hidden_units, num_highway_blocks, norm_type='bn', is_training=True, scope="cbhg")

Source from the content-addressed store, hash-verified

302
303
304def cbhg(input, num_banks, hidden_units, num_highway_blocks, norm_type='bn', is_training=True, scope="cbhg"):
305 with tf.variable_scope(scope):
306 out = conv1d_banks(input,
307 K=num_banks,
308 num_units=hidden_units,
309 norm_type=norm_type,
310 is_training=is_training) # (N, T, K * E / 2)
311
312 out = tf.layers.max_pooling1d(out, 2, 1, padding="same") # (N, T, K * E / 2)
313
314 out = conv1d(out, hidden_units, 3, scope="conv1d_1") # (N, T, E/2)
315 out = normalize(out, type=norm_type, is_training=is_training, activation_fn=tf.nn.relu)
316 out = conv1d(out, hidden_units, 3, scope="conv1d_2") # (N, T, E/2)
317 out += input # (N, T, E/2) # residual connections
318
319 for i in range(num_highway_blocks):
320 out = highwaynet(out, num_units=hidden_units,
321 scope='highwaynet_{}'.format(i)) # (N, T, E/2)
322
323 out = gru(out, hidden_units, True) # (N, T, E)
324 return out

Callers 2

networkMethod · 0.90
networkMethod · 0.90

Calls 5

conv1d_banksFunction · 0.85
conv1dFunction · 0.85
normalizeFunction · 0.85
highwaynetFunction · 0.85
gruFunction · 0.85

Tested by

no test coverage detected