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
ufw enable | |
ufw allow ssh | |
ufw allow 41335:60031/tcp # Or your v2ray kcp/udp port range | |
ufw allow 41335:60031/udp # Or your v2ray kcp/udp port range | |
ufw allow http | |
ufw allow https | |
ufw default deny incoming | |
ufw reload |
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
import librosa | |
import scipy | |
import numpy as np | |
def cmc(y, sr, P=12, n_level=7, eps=1e-12, **kwargs): | |
log_abs_power_cqt = np.log( | |
np.abs(librosa.core.cqt(y=y, sr=sr, **kwargs))**2 + eps) | |
cmc_levels = [] | |
for _ in range(n_level): |
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
import numpy as np | |
import scipy | |
import matplotlib.pyplot as plt | |
import librosa | |
def lin(sr, n_fft, n_filter=128, fmin=0.0, fmax=None, dtype=np.float32): | |
if fmax is None: | |
fmax = float(sr) / 2 |
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
# @Author: richman | |
# @Date: 2018-03-15 | |
# @Last Modified by: richman | |
# @Last Modified time: 2018-03-30 | |
if [[ $# < 1 ]]; then | |
echo "Input .csv file .e.g balanced_train_segments.csv" | |
exit | |
fi |
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
# @Author: richman | |
# @Date: 2018-03-15 | |
# @Last Modified by: richman | |
# @Last Modified time: 2018-03-30 | |
if [[ $# < 1 ]]; then | |
echo "Input .csv file .e.g balanced_train_segments.csv" | |
exit | |
fi |
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
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
class MovingAvgNorm(nn.Module): | |
""" | |
Calculates multiple moving average estiamtes given a kernel_size | |
Similar to kaldi's apply-cmvn-sliding | |
""" |
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
import h5py | |
import numpy as np | |
from tqdm import tqdm | |
indices = list(range(100000)) | |
rand_index = np.random.permutation(len(indices)).astype(str) | |
BATCH_SIZE = 128 | |
def batch_gen(): |
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
from sklearn.mixture import GaussianMixture | |
import h5py | |
import fire | |
import numpy as np | |
import pandas as pd | |
from pypeln import thread as pr | |
from joblib import dump, load | |
from tqdm import tqdm | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.