python_code
stringlengths
0
4.04M
repo_name
stringlengths
8
58
file_path
stringlengths
5
147
# Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. from copy import deepcopy import numpy as np import torch from botorch.utils.sampling import draw_sobol_samples import sys sys.path.append('..') from plot_config import * from problems import DiscrimLowDim from aepsych.models.gp_classificat...
bernoulli_lse-main
figures/plot_posteriors.py
# Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. import numpy as np import pandas as pd from pathlib import Path import matplotlib.pyplot as plt import sys sys.path.append("..") from plot_config import * # need cameraready for original thresh rundata = list(Path("../data/cameraready/").glo...
bernoulli_lse-main
figures/plot_thresh_sensitivity_results.py
# Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. import pickle import matplotlib.pyplot as plt import numpy as np import sys sys.path.append('..') from plot_config import * from plot_experiment_results import compile_results, run_data def make_figure(): res, itrs = compile_results(r...
bernoulli_lse-main
figures/plot_edge_sampling.py
# Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. import numpy as np import pandas as pd import sys from pathlib import Path import matplotlib.pyplot as plt sys.path.append('..') from plot_config import * import re run_data = list(Path("../data/cameraready/").glob("*out.csv")) def compile...
bernoulli_lse-main
figures/plot_experiment_results.py
# Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. import numpy as np import pandas as pd import matplotlib.pyplot as plt import sys sys.path.append("..") from pathlib import Path from plot_config import * # need cameraready for init=10 rundata = list(Path("../data/cameraready/").glob("*out.c...
bernoulli_lse-main
figures/plot_init_sensitivity_results.py
# Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. from datetime import datetime """ Develop an experiment that measures and combination of the following features: spatial_frequency temporal_frequency mean_luminance eccentricity field_angle orientation """ constants = dict( savefolder="....
bernoulli_lse-main
human_data_collection/config.py
# Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. import numpy as np import torch from aepsych.server import AEPsychServer from psychopy import core, data, event, gui, monitors, visual from contrast_discrimination import config from contrast_discrimination.helpers import HalfGrating class Se...
bernoulli_lse-main
human_data_collection/experiment.py
# Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. import numpy as np from psychopy.visual.image import ImageStim from psychopy import core, event import pyglet pyglet.options["debug_gl"] = False GL = pyglet.gl def polar_to_cartesian(r, theta): z = r * np.exp(1j * np.radians(theta)) ...
bernoulli_lse-main
human_data_collection/helpers.py
# Copyright (c) Meta Platforms, Inc. and affiliates. from data import NL2BashDataset from collectors import CollectorWithInfo import argparse if __name__ == "__main__": dataset = NL2BashDataset() parser = argparse.ArgumentParser() parser.add_argument("--num_seeds", type=int, default=25) parser.add_ar...
coder_reviewer_reranking-main
collect_nl2bash.py
# Copyright (c) Meta Platforms, Inc. and affiliates. from pathlib import Path import os from glob import glob from argparse import ArgumentParser import html import json from utils import * from tqdm import tqdm, trange from data import HumanEvalDataset, rindex, extract_docstring from functools import partial from pym...
coder_reviewer_reranking-main
zeroshot_reviewer.py
# Copyright (c) Meta Platforms, Inc. and affiliates. import argparse import copy import json import openai import os import pickle import random import signal import time from glob import glob from nltk.translate.bleu_score import sentence_bleu from tqdm import tqdm, trange import re codex_name_mapping = { "codex...
coder_reviewer_reranking-main
collectors.py
# Copyright (c) Meta Platforms, Inc. and affiliates. from data import SpiderDataset from collectors import CollectorWithInfo import argparse if __name__ == "__main__": dataset = SpiderDataset() parser = argparse.ArgumentParser() parser.add_argument("--num_seeds", type=int, default=25) parser.add_argu...
coder_reviewer_reranking-main
collect_spider.py
# Copyright (c) Meta Platforms, Inc. and affiliates. import bashlex import json import os import pickle import regex import signal import subprocess import tempfile import threading from datasets import load_metric from glob import glob from nltk.translate.bleu_score import sentence_bleu from tqdm import tqdm from dat...
coder_reviewer_reranking-main
execution.py
# Copyright (c) Meta Platforms, Inc. and affiliates. import argparse import data from collectors import CollectorWithInfo if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--info-mode", type=str, default="assertion", choices=["function_name",...
coder_reviewer_reranking-main
collect_mbpp.py
# Copyright (c) Meta Platforms, Inc. and affiliates. import shutil import torch from pathlib import Path import os from glob import glob from argparse import ArgumentParser from tqdm import tqdm, trange import torch.distributed as dist from execution import ( execute_humaneval_folder_one, execute_mbpp_google_f...
coder_reviewer_reranking-main
multi_exec.py
# Copyright (c) Meta Platforms, Inc. and affiliates. from tqdm import tqdm import os import sqlite3 import pickle as pkl # CONSTANT db_dir = "./dataset/spider/database/" # preloading spider data to reduce io from dataset.spider_official.evaluation import ( build_foreign_key_map_from_json, build_valid_col_unit...
coder_reviewer_reranking-main
exec_spider_gold.py
# Copyright (c) Meta Platforms, Inc. and affiliates. ################################ # Assumptions: # 1. sql is correct # 2. only table name has alias # 3. only one intersect/union/except # # val: number(float)/string(str)/sql(dict) # col_unit: (agg_id, col_id, isDistinct(bool)) # val_unit: (unit_op, col_unit1,...
coder_reviewer_reranking-main
process_sql.py
# Copyright (c) Meta Platforms, Inc. and affiliates. ################################ # val: number(float)/string(str)/sql(dict) # col_unit: (agg_id, col_id, isDistinct(bool)) # val_unit: (unit_op, col_unit1, col_unit2) # table_unit: (table_type, col_unit/sql) # cond_unit: (not_op, op_id, val_unit, val1, val2) # condi...
coder_reviewer_reranking-main
utils_sql.py
# Copyright (c) Meta Platforms, Inc. and affiliates. from time import sleep import os import random import openai import re import json def safe_codex_call( args, api_text, temperature=None, stop=None, echo=False, max_tokens=256, api_i=0 ): temperature = temperature if temperature else args.temperature w...
coder_reviewer_reranking-main
utils.py
# Copyright (c) Meta Platforms, Inc. and affiliates. import keyword, sys from pyminifier import analyze from pyminifier.minification import remove_comments_and_docstrings, remove_blank_lines import re RESERVED_WORDS = keyword.kwlist + analyze.builtins def clean_comment(code): code = remove_comments_and_docstrin...
coder_reviewer_reranking-main
pyminifier_canonicalize.py
# Copyright (c) Meta Platforms, Inc. and affiliates. import os import tempfile from datasets import load_metric from tqdm import tqdm import pickle as pkl from data import MBPPGoogleDataset from execution import Command import sys from utils import time_limit """ dataset keys: src, trg_prediction, reference """ de...
coder_reviewer_reranking-main
evaluate.py
# Copyright (c) Meta Platforms, Inc. and affiliates. import bashlex import collections import json import pickle import numpy as np import os import random from glob import glob from nltk.translate.bleu_score import sentence_bleu from evaluate import ( evaluate_charbleu, evaluate_google_mbpp, evaluate_spid...
coder_reviewer_reranking-main
sample_selectors.py
# Copyright (c) Meta Platforms, Inc. and affiliates. from pathlib import Path import os from glob import glob from argparse import ArgumentParser import html import json from utils import * from tqdm import tqdm, trange from functools import partial from utils import write_jsonl, parse_prompt, make_new_context from py...
coder_reviewer_reranking-main
fewshot_reviewer.py
# Copyright (c) Meta Platforms, Inc. and affiliates. import argparse import data from collectors import CollectorWithInfo if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--info-mode", type=str, default="assertion", choices=["function_name",...
coder_reviewer_reranking-main
collect_zeroshot.py
# Copyright (c) Meta Platforms, Inc. and affiliates. import collections import json import os import regex class NL2BashDataset(object): def __init__(self, path="dataset/nl2bash/data/bash"): self.data = collections.defaultdict() for split in ["train", "dev", "test"]: nls = [x.strip() ...
coder_reviewer_reranking-main
data.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from torchvision import datasets, transforms from torch.utils.data.sampler import RandomSampler import torchvision import t...
deep-variance-reduction-main
cifar_wrapper.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. #from __future__ import print_function import argparse import pickle import os import time from timeit import default_timer ...
deep-variance-reduction-main
run.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from torch.optim.optimizer import Optimizer, required import torch import pdb import pickle import math import logging clas...
deep-variance-reduction-main
scsg.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from torch.optim.optimizer import Optimizer, required import torch import pdb import pickle import math import logging clas...
deep-variance-reduction-main
recompute_svrg.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import torch import torch.multiprocessing as multiprocessing #from torch._C import _update_worker_pids, \ # _remove_work...
deep-variance-reduction-main
UpdatedDataLoaderMult.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from __future__ import print_function import argparse import pickle import os from timeit import default_timer as timer imp...
deep-variance-reduction-main
diagnostics.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from torchvision import datasets, transforms from torch.utils.data.sampler import RandomSampler import torchvision import t...
deep-variance-reduction-main
imagenet_wrapper.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import torch import torch.nn as nn import torch.nn.functional as F import math import pdb __all__ = ['densenet'] from tor...
deep-variance-reduction-main
densenet.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from __future__ import print_function import argparse import pickle import os from timeit import default_timer as timer imp...
deep-variance-reduction-main
run_vr.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import torch import pdb import os class VRSamplerIter(object): def __init__(self, sampler): self.sampler = sam...
deep-variance-reduction-main
vr_sampler.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from torch.optim.optimizer import Optimizer, required import torch import pdb import pickle import math import logging impor...
deep-variance-reduction-main
torch_svrg.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import torch.optim as optim import torch_svrg import recompute_svrg import scsg def optimizer(model, args): print("Usin...
deep-variance-reduction-main
optimizers.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import torch import torch.nn as nn __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet...
deep-variance-reduction-main
resnext.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import os import torch import torch.nn as nn import torch.nn.functional as F from torchvision import datasets, transforms fr...
deep-variance-reduction-main
problems.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import numbers import math import random from PIL import Image, ImageOps, ImageEnhance import numpy as np import numbers im...
deep-variance-reduction-main
caching_transforms.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. '''ResNet in PyTorch. from https://github.com/kuangliu/pytorch-cifar/blob/master/models/resnet.py based on https://github.co...
deep-variance-reduction-main
resnet.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import torch import torch.multiprocessing as multiprocessing from torch.utils.data.sampler import SequentialSampler, RandomS...
deep-variance-reduction-main
UpdatedDataLoader.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from math import atan2,degrees import numpy as np #Label line with line2D label data def labelLine(line,x,label=None,align=...
deep-variance-reduction-main
reproduce/label_lines.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import os import sys import run methods = ["sgd", "recompute_svrg", "scsg"] try: pindex = int(sys.argv[1]) seed = i...
deep-variance-reduction-main
reproduce/reproduce_test_error_imagenet_next.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import os import sys import run archs = ['default', 'densenet-40-36'] try: pindex = int(sys.argv[1]) print(f"probl...
deep-variance-reduction-main
reproduce/reproduce_iterate_distance.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import os import sys import run vr_froms = [1, 21, 41, 61, 81, 1234] try: pindex = int(sys.argv[1]) print(f"proble...
deep-variance-reduction-main
reproduce/reproduce_finetuning.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from __future__ import print_function import pickle import glob import os import pdb import math import numpy as np import ...
deep-variance-reduction-main
reproduce/plot_finetuning.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import os import sys import run archs = ['default', 'resnet-small', 'densenet-40-36', 'resnet110'] try: pindex = int(s...
deep-variance-reduction-main
reproduce/reproduce_ratio_plots.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from __future__ import print_function import pickle import glob import os import re import numpy as np import itertools imp...
deep-variance-reduction-main
reproduce/plot_iterate_distance.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import os import sys import run methods = ["sgd", "recompute_svrg", "scsg"] try: pindex = int(sys.argv[1]) seed = i...
deep-variance-reduction-main
reproduce/reproduce_test_error_imagenet.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import os import sys import run methods = ["sgd", "recompute_svrg", "scsg"] try: pindex = int(sys.argv[1]) seed = i...
deep-variance-reduction-main
reproduce/reproduce_test_error_resnet110.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from __future__ import print_function import pickle import glob import os import pdb import matplotlib as mpl mpl.use('agg'...
deep-variance-reduction-main
reproduce/plot_test_error_with_bars.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import os import sys import run methods = ["sgd", "recompute_svrg", "scsg"] try: pindex = int(sys.argv[1]) seed = i...
deep-variance-reduction-main
reproduce/reproduce_test_error_lenet.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from __future__ import print_function import pickle import glob import os import re import matplotlib.ticker as plticker im...
deep-variance-reduction-main
reproduce/plot_variance_ratio.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import os import sys import run transform_locking = [True, False] try: pindex = int(sys.argv[1]) print(f"problem i...
deep-variance-reduction-main
reproduce/reproduce_locking_plot.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from __future__ import print_function import pickle import glob import os import pdb import matplotlib as mpl mpl.use('agg'...
deep-variance-reduction-main
reproduce/plot_test_error.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from __future__ import print_function import pickle import glob import os import re import numpy as np import itertools imp...
deep-variance-reduction-main
reproduce/plot_transform_locking.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import sys class Fab_HDD(): def __init__(self, config="BarraCuda"): ############################### # Carbo...
ACT-main
hdd_model.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import sys class Fab_Logic(): def __init__(self, process_node=14, gpa="97", c...
ACT-main
logic_model.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import sys from dram_model import Fab_DRAM from ssd_model import Fab_SSD from logic_model import Fab_Logic def main(): ...
ACT-main
model.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import sys class Fab_DRAM(): def __init__(self, config = "ddr4_10nm", fab_yield=0.875): #########################...
ACT-main
dram_model.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import sys class Fab_SSD(): def __init__(self, config="nand_10nm", fab_yield=0.875): ##############################...
ACT-main
ssd_model.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import sys from dram_model import Fab_DRAM from hdd_model import Fab_HDD from ssd_model import Fab_SSD from logic_model impo...
ACT-main
exps/dellr740/dellr740.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import sys from dram_model import Fab_DRAM from hdd_model import Fab_HDD from ssd_model import Fab_SSD from logic_model impo...
ACT-main
exps/fairphone3/fairphone3.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import time import faiss import numpy as np from PIL import Image from PIL import ImageFile from scipy.sparse import csr_matrix...
deepcluster-main
clustering.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import pickle import numpy as np import torch from torch.utils.data.sampler import Sampler import models def load_...
deepcluster-main
util.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import argparse from collections import OrderedDict import os import pickle import subprocess import sys import numpy as np f...
deepcluster-main
eval_retrieval.py
deepcluster-main
__init__.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # #!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import math import time import glob from collections im...
deepcluster-main
eval_voc_classif.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import argparse import os import pickle import time import faiss import numpy as np from sklearn.metrics.cluster import normali...
deepcluster-main
main.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import argparse import os import time import numpy as np import torch import torch.nn as nn import torch.backends.cudnn as cud...
deepcluster-main
eval_linear.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import argparse import os from scipy.ndimage.filters import gaussian_filter import sys import numpy as np from PIL import Image...
deepcluster-main
visu/gradient_ascent.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import argparse import os from shutil import copyfile import sys import numpy as np from PIL import Image import torch import t...
deepcluster-main
visu/activ-retrieval.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from .vgg16 import * from .alexnet import *
deepcluster-main
models/__init__.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torch import torch.nn as nn import math from random import random as rd __all__ = [ 'VGG', 'vgg16'] class VGG(nn.Modul...
deepcluster-main
models/vgg16.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import math import numpy as np import torch import torch.nn as nn __all__ = [ 'AlexNet', 'alexnet'] # (number of filters, ke...
deepcluster-main
models/alexnet.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import argparse import csv from pathlib import Path import pandas as pd XX_EN_LANGUAGES = { "1": ["fr", "de", ...
covost-main
get_covost_splits.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import argparse import os import os.path as op import urllib.request from tqdm import tqdm LANG_CODE_2_TO_3 = { 'fr'...
covost-main
get_tt_speech.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. ### useage ### # (run w/ gpu): python dempStream.py --tx_cuda 1 --rx_cuda...
AudioDec-main
demoStream.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. ### useage ### # (run w/ gpu): python demoFile.py --model libritts_v1 -i ...
AudioDec-main
demoFile.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Reference (https://github.com/kan-bayashi/ParallelWaveGAN/) import os...
AudioDec-main
codecStatistic.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Reference (https://github.com/kan-bayashi/ParallelWaveGAN/) import os...
AudioDec-main
codecTrain.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Reference (https://github.com/kan-bayashi/ParallelWaveGAN/) import os...
AudioDec-main
codecTest.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2021 Tomoki Hayashi # MIT License (https://opensource.org/licenses/MIT) """Adversarial loss modules.""" import torch import torch.nn.functional as F class GeneratorAdversarialLoss(torch.nn.Module): """Generator adversarial loss module.""" def __i...
AudioDec-main
losses/adversarial_loss.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Reference (https://github.com/kan-bayashi/ParallelWaveGAN/) """STFT-b...
AudioDec-main
losses/stft_loss.py
from .adversarial_loss import * # NOQA from .feat_match_loss import * # NOQA from .mel_loss import * # NOQA from .stft_loss import * # NOQA from .waveform_loss import * # NOQA
AudioDec-main
losses/__init__.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Reference (https://github.com/kan-bayashi/ParallelWaveGAN/) """Mel-sp...
AudioDec-main
losses/mel_loss.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """Waveform-based loss modules.""" import torch class WaveformShapeLos...
AudioDec-main
losses/waveform_loss.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2021 Tomoki Hayashi # MIT License (https://opensource.org/licenses/MIT) """Feature matching loss modules.""" import torch import torch.nn.functional as F class FeatureMatchLoss(torch.nn.Module): """Feature matching loss module.""" def __init__( ...
AudioDec-main
losses/feat_match_loss.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Reference (https://github.com/kan-bayashi/ParallelWaveGAN/) """Convol...
AudioDec-main
layers/conv_layer.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Reference (https://github.com/lucidrains/vector-quantize-pytorch/) ""...
AudioDec-main
layers/vq_module.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Reference (https://github.com/kan-bayashi/ParallelWaveGAN/) """Testin...
AudioDec-main
bin/test.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import os import abc import yaml import time import queue import threadin...
AudioDec-main
bin/stream.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """Utility modules.""" import os import yaml def load_config(checkpoi...
AudioDec-main
bin/utils.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Reference (https://github.com/kan-bayashi/ParallelWaveGAN/) """Traini...
AudioDec-main
bin/train.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import os import torch from typing import Union from models.autoencoder.A...
AudioDec-main
utils/audiodec.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """Utility modules.""" def check_mode(mode, method): stream_modes =...
AudioDec-main
models/utils.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Reference (https://github.com/kan-bayashi/ParallelWaveGAN/) """AudioD...
AudioDec-main
models/autoencoder/AudioDec.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # # Reference (https://ieeexplore.ieee.org/document/9625818) """Decoder m...
AudioDec-main
models/autoencoder/modules/decoder.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import torch from layers.vq_module import ResidualVQ class Quantizer(t...
AudioDec-main
models/autoencoder/modules/quantizer.py