This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~ && find . -name "*:Zone.Identifier" -type f -delete && cd - > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = torch.ones(bs, 784) * 0.5 + 0.02 * torch.randn(bs, 784) | |
x.requires_grad_(True).retain_grad() | |
for i in range(0, n//bs): | |
preds = model(x) | |
loss = loss_func(preds, y) | |
loss.backward() | |
with torch.no_grad(): | |
x -= x.grad * lr | |
if x.grad.grad_fn is not None: | |
x.grad.detach_() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_data_to_buffer(train_config): | |
buffer = list() | |
text = process_text(train_config.data_path) | |
audio_files = sorted(Path(train_config.audio_path).iterdir()) | |
spec = Spectrogram(512) | |
start = time.perf_counter() | |
for i, file in tqdm(zip(range(len(text)), audio_files)): | |
mel_gt_name = os.path.join( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_data_to_buffer(train_config): | |
buffer = list() | |
text = process_text(train_config.data_path) | |
audio_files = sorted(Path(train_config.audio_path).iterdir()) | |
hop_length = 256 | |
frame_period = hop_length / 22_050 * 1000 | |
start = time.perf_counter() | |
for i, file in tqdm(zip(range(len(text)), audio_files)): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CORR = {'h#': "", | |
'sh': "ʃ", | |
'iy': "i", | |
'hv': "ɦ", | |
'ae': "æ", | |
'dcl': "d̚", | |
'd': "d", | |
'y': "j", | |
'er': "ɝ", | |
'aa': "ɑ", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def replace_slashes(s:str): | |
return s.replace('\\', '/') | |
df.path = df.path.map(replace_slashes) |