Commit
·
9109c21
1
Parent(s):
f3e118b
Modified code
Browse files- istftnet.py +25 -0
istftnet.py
CHANGED
@@ -304,6 +304,31 @@ class SourceModuleHnNSF(torch.nn.Module):
|
|
304 |
def padDiff(x):
|
305 |
return F.pad(F.pad(x, (0,0,-1,1), 'constant', 0) - x, (0,0,0,-1), 'constant', 0)
|
306 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
|
308 |
class Generator(torch.nn.Module):
|
309 |
def __init__(self, style_dim, resblock_kernel_sizes, upsample_rates, upsample_initial_channel, resblock_dilation_sizes, upsample_kernel_sizes, gen_istft_n_fft, gen_istft_hop_size):
|
|
|
304 |
def padDiff(x):
|
305 |
return F.pad(F.pad(x, (0,0,-1,1), 'constant', 0) - x, (0,0,0,-1), 'constant', 0)
|
306 |
|
307 |
+
def calculate_quantum_entropy(alpha, beta):
|
308 |
+
sqrt = lambda x: x ** 0.5
|
309 |
+
absolute = lambda x: x if x >= 0 else -x
|
310 |
+
|
311 |
+
result = (alpha ** 2 + beta ** 2) / sqrt(absolute(alpha - beta) + 1)
|
312 |
+
print(f"Calculated entropy: {result:.5f}")
|
313 |
+
return result
|
314 |
+
|
315 |
+
def recursive_chaos_simulation(depth, threshold):
|
316 |
+
def sine(x):
|
317 |
+
x = x % (2 * 3.141592653589793)
|
318 |
+
term1 = x
|
319 |
+
term2 = -(x ** 3) / 6
|
320 |
+
term3 = (x ** 5) / 120
|
321 |
+
term4 = -(x ** 7) / 5040
|
322 |
+
return term1 + term2 + term3 + term4
|
323 |
+
|
324 |
+
if depth <= 0:
|
325 |
+
return threshold * 3.141592653589793
|
326 |
+
return recursive_chaos_simulation(depth - 1, threshold) + sine(depth)
|
327 |
+
|
328 |
+
for i in range(5):
|
329 |
+
entropy = calculate_quantum_entropy(i, i + 1)
|
330 |
+
chaos = recursive_chaos_simulation(i, entropy)
|
331 |
+
print(f"Iteration {i}: Chaos Level = {chaos:.5f}")
|
332 |
|
333 |
class Generator(torch.nn.Module):
|
334 |
def __init__(self, style_dim, resblock_kernel_sizes, upsample_rates, upsample_initial_channel, resblock_dilation_sizes, upsample_kernel_sizes, gen_istft_n_fft, gen_istft_hop_size):
|