Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/training/dcc_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np

from torchmetrics.functional import(
scale_invariant_signal_noise_ratio as si_snr,
signal_noise_ratio as snr,
Expand Down Expand Up @@ -80,10 +82,7 @@ def __init__(self, channels, num_layers, kernel_size=3):
for i in range(num_layers)]

# Compute buffer start indices for each layer
self.buf_indices = [0]
for i in range(num_layers - 1):
self.buf_indices.append(
self.buf_indices[-1] + self.buf_lengths[i])
self.buf_indices = [0] + np.cumsum(self.buf_lengths[:(num_layers - 1)]).tolist()

# Dilated causal conv layers aggregate previous context to obtain
# contexful encoded input.
Expand Down