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 os, random | |
import torch, torchaudio | |
import numpy as np | |
import pandas as pd | |
from tqdm import tqdm | |
from scipy.stats import spearmanr | |
SUBSET_DATA = True | |
DATA_PARENT_DIR = '../ProbMOS/' |
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 matplotlib.pyplot as plt | |
from sklearn.datasets import fetch_openml | |
from sklearn.random_projection import GaussianRandomProjection | |
from sklearn.neighbors import NearestNeighbors | |
from scipy.stats import spearmanr | |
from tqdm import tqdm | |
np.random.seed(42) |
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 os, torch, fairseq, random, numpy as np | |
device = 'cuda' | |
model, _, _ = fairseq.checkpoint_utils.load_model_ensemble_and_task(['wav2vec_large.pt']) | |
model = model[0].eval().to(device) | |
model.wav2vec_predictions.infonce = False | |
torch.manual_seed(42); np.random.seed(42); random.seed(42) | |
a = torch.nn.Parameter(torch.randn(1, 80000).to(device)) |
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 numpy as np | |
import pandas as pd | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
from cmdstanpy import CmdStanModel | |
from sklearn.decomposition import PCA | |
from sklearn.neighbors import NearestNeighbors | |
from torchvision.transforms.functional import rotate |
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
library(mgcv) # version >= 1.8-34 | |
library(data.table) | |
set.seed(42) | |
n = 200; k = 30; bs_dim = 15; l_scale = 2 | |
data = data.table(x = seq(-1, 1, l=n)) | |
data[, y := x^2 + rnorm(n, sd=0.25)] | |
model = gam(y ~ s(x, bs="gp", k=bs_dim, m=c(-4, l_scale), |