https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu#0
This file contains hidden or 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
import pytorch_lightning as pl | |
import numpy as np | |
import torch | |
from torch.nn import MSELoss | |
from torch.optim import Adam | |
from torch.utils.data import DataLoader, Dataset | |
import torch.nn as nn | |
class SimpleDataset(Dataset): |
This file contains hidden or 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
from scipy.io.wavfile import read, write | |
import io | |
## This may look a bit intricate/useless, considering the fact that scipy's read() and write() function already return a | |
## numpy ndarray, but the BytesIO "hack" may be useful in case you get the wav not through a file, but trough some websocket or | |
## HTTP Post request. This should obviously work with any other sound format, as long as you have the proper decoding function | |
with open("input_wav.wav", "rb") as wavfile: | |
input_wav = wavfile.read() |
This file contains hidden or 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
import time | |
from random import randrange | |
from multiprocessing.pool import ThreadPool | |
from tqdm import tqdm | |
def func_call(position, total): | |
text = 'progressbar #{position}'.format(position=position) |
This file contains hidden or 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
import argparse | |
import json | |
import os | |
import random | |
import time | |
import numpy as np | |
import torch.distributed as dist | |
import torch.utils.data.distributed | |
from apex import amp |