repo
stringlengths
2
99
file
stringlengths
13
225
code
stringlengths
0
18.3M
file_length
int64
0
18.3M
avg_line_length
float64
0
1.36M
max_line_length
int64
0
4.26M
extension_type
stringclasses
1 value
speechbrain
speechbrain-main/tests/unittests/test_linear.py
import torch import torch.nn def test_linear(device): from speechbrain.nnet.linear import Linear inputs = torch.rand(1, 2, 4, device=device) lin_t = Linear(n_neurons=4, input_size=inputs.shape[-1], bias=False) lin_t.w.weight = torch.nn.Parameter( torch.eye(inputs.shape[-1], device=device) ...
443
23.666667
72
py
speechbrain
speechbrain-main/tests/unittests/test_arpa.py
import pytest def test_read_arpa(): from speechbrain.lm.arpa import read_arpa import io with io.StringIO() as f: print("Anything can be here", file=f) print("", file=f) print("\\data\\", file=f) print("ngram 1=2", file=f) print("ngram 2=3", file=f) print(""...
4,592
34.882813
75
py
speechbrain
speechbrain-main/tests/unittests/test_data_pipeline.py
import pytest def test_data_pipeline(): from speechbrain.utils.data_pipeline import DataPipeline pipeline = DataPipeline( ["text"], dynamic_items=[ {"func": lambda x: x.lower(), "takes": ["text"], "provides": "foo"}, {"func": lambda x: x[::-1], "takes": "foo", "provide...
5,242
32.183544
87
py
speechbrain
speechbrain-main/tests/unittests/test_losses.py
import torch import pytest def test_nll(device): from speechbrain.nnet.losses import nll_loss predictions = torch.zeros(4, 10, 8, device=device) targets = torch.zeros(4, 10, device=device) lengths = torch.ones(4, device=device) out_cost = nll_loss(predictions, targets, lengths) assert torch.a...
8,520
34.210744
80
py
speechbrain
speechbrain-main/tests/unittests/test_metrics.py
import torch import torch.nn import math def test_metric_stats(device): from speechbrain.utils.metric_stats import MetricStats from speechbrain.nnet.losses import l1_loss l1_stats = MetricStats(metric=l1_loss) l1_stats.append( ids=["utterance1", "utterance2"], predictions=torch.tensor...
6,686
32.268657
79
py
speechbrain
speechbrain-main/tests/unittests/test_schedulers.py
def test_NewBobScheduler(): from speechbrain.nnet.schedulers import NewBobScheduler scheduler = NewBobScheduler(initial_value=0.8) prev_lr, next_lr = scheduler(1.0) assert prev_lr == 0.8 assert next_lr == 0.8 prev_lr, next_lr = scheduler(1.1) assert next_lr == 0.4 prev_lr, next_lr =...
737
24.448276
61
py
speechbrain
speechbrain-main/tests/unittests/test_CNN.py
import torch import torch.nn def test_SincConv(device): from speechbrain.nnet.CNN import SincConv input = torch.rand([4, 16000], device=device) convolve = SincConv( input_shape=input.shape, out_channels=8, kernel_size=65, padding="same" ).to(device) output = convolve(input) assert out...
2,850
26.413462
80
py
speechbrain
speechbrain-main/tests/unittests/test_pooling.py
import torch import torch.nn def test_pooling1d(device): from speechbrain.nnet.pooling import Pooling1d input = ( torch.tensor([1, 3, 2], device=device) .unsqueeze(0) .unsqueeze(-1) .float() ) pool = Pooling1d("max", 3).to(device) output = pool(input) assert o...
1,446
22.721311
80
py
speechbrain
speechbrain-main/tests/unittests/test_ctc_segmentation.py
from speechbrain.pretrained import EncoderDecoderASR import pytest pytest.importorskip( "speechbrain.alignment.ctc_segmentation", reason="These tests require the ctc_segmentation library", ) @pytest.fixture() def asr_model(): """Load model for the CTC segmentation test.""" asr_model = EncoderDecoder...
2,861
30.8
79
py
speechbrain
speechbrain-main/tests/unittests/test_tokenizer.py
import os import torch def test_tokenizer(): from speechbrain.tokenizers.SentencePiece import SentencePiece gt = [ ["HELLO", "MORNING", "MORNING", "HELLO"], ["HELLO", "MORNING", "HELLO"], ] # Word-level input test dict_int2lab = {1: "HELLO", 2: "MORNING"} spm = SentencePiece...
3,846
25.531034
72
py
speechbrain
speechbrain-main/tests/unittests/test_hpopt.py
import pytest def test_hpopt_generic(): from io import StringIO from speechbrain.utils import hpopt as hp import json output = StringIO() reporter = hp.GenericHyperparameterOptimizationReporter( objective_key="per", output=output ) result = {"train_loss": 0.9, "valid_loss": 1.2, ...
1,769
25.818182
64
py
speechbrain
speechbrain-main/tests/unittests/test_dataloader.py
import torch import pytest def test_saveable_dataloader(tmpdir, device): from speechbrain.dataio.dataloader import SaveableDataLoader save_file = tmpdir + "/dataloader.ckpt" dataset = torch.randn(10, 1, device=device) dataloader = SaveableDataLoader(dataset, collate_fn=None) data_iterator = iter(...
3,274
36.215909
80
py
speechbrain
speechbrain-main/tests/unittests/test_callchains.py
def test_lengths_arg_exists(): from speechbrain.utils.callchains import lengths_arg_exists def non_len_func(x): return x + 1 def len_func(x, lengths): return x + lengths assert not lengths_arg_exists(non_len_func) assert lengths_arg_exists(len_func) def test_lengths_capable_chai...
782
22.727273
64
py
speechbrain
speechbrain-main/tests/unittests/test_attention.py
import torch def test_rel_pos_MHA(device): from speechbrain.nnet.attention import RelPosMHAXL bsz = 2 emb_dim = 4 k_len = [12, 10] q_len = [10, 12] bias = [True, False] head_dim = [4, None] for kl in k_len: for ql in q_len: for b in bias: for h in...
792
27.321429
69
py
speechbrain
speechbrain-main/tests/unittests/test_data_io.py
import torch import os def test_read_audio(tmpdir, device): from speechbrain.dataio.dataio import read_audio, write_audio test_waveform = torch.rand(16000, device=device) wavfile = os.path.join(tmpdir, "wave.wav") write_audio(wavfile, test_waveform.cpu(), 16000) # dummy annotation for i in r...
3,324
37.218391
85
py
speechbrain
speechbrain-main/tests/unittests/test_g2p.py
import torch from torch.nn import functional as F def _fake_probs(idx, count): result = torch.zeros(count) result[idx] = 2.0 return F.softmax(result, dim=-1) def _batch_fake_probs(indexes, count): p_seq = torch.zeros(indexes.shape + (count,)) for batch_idx in range(len(indexes)): for it...
2,629
29.229885
76
py
speechbrain
speechbrain-main/tests/integration/PLDA/example_plda_experiment.py
#!/usr/bin/python import os import pickle import numpy from numpy import linalg as LA from speechbrain.processing.PLDA_LDA import StatObject_SB # noqa F401 from speechbrain.processing.PLDA_LDA import PLDA from speechbrain.processing.PLDA_LDA import Ndx from speechbrain.processing.PLDA_LDA import fast_PLDA_scoring # ...
1,797
27.09375
70
py
speechbrain
speechbrain-main/tests/integration/ASR_alignment_viterbi/example_asr_alignment_viterbi_experiment.py
#!/usr/bin/env/python3 """This minimal example trains an HMM-based aligner with the Viterbi algorithm. The encoder is based on a combination of convolutional, recurrent, and feed-forward networks (CRDNN) that predict phoneme states. Given the tiny dataset, the expected behavior is to overfit the training data (with a v...
5,017
32.677852
79
py
speechbrain
speechbrain-main/tests/integration/separation/example_conv_tasnet.py
#!/usr/bin/env/python3 """This minimal example trains a speech separation system with on a tiny dataset. The architecture is based on ConvTasnet and expects in input mixtures of two speakers. """ import torch import pathlib import speechbrain as sb import torch.nn.functional as F from hyperpyyaml import load_hyperpyya...
5,334
30.755952
81
py
speechbrain
speechbrain-main/tests/integration/G2P/example_g2p.py
#!/usr/bin/env/python3 """This minimal example trains a grapheme-to-phoneme (G2P) converter that turns a sequence of characters into a sequence of phonemes. The system uses a standard attention-based encoder-decoder pipeline. The encoder is based on an LSTM, while the decoder is based on a GRU. Greedy search applied o...
6,166
34.854651
80
py
speechbrain
speechbrain-main/tests/integration/ASR_CTC/example_asr_ctc_experiment_complex_net.py
#!/usr/bin/env/python3 """This minimal example trains a CTC-based speech recognizer on a tiny dataset. The encoder is based on a combination of convolutional, recurrent, and feed-forward networks (CRDNN) that predict phonemes. A greedy search is used on top of the output probabilities. Given the tiny dataset, the expe...
5,107
33.053333
80
py
speechbrain
speechbrain-main/tests/integration/ASR_CTC/example_asr_ctc_experiment.py
#!/usr/bin/env/python3 """This minimal example trains a CTC-based speech recognizer on a tiny dataset. The encoder is based on a combination of convolutional, recurrent, and feed-forward networks (CRDNN) that predict phonemes. A greedy search is used on top of the output probabilities. Given the tiny dataset, the expe...
5,096
32.98
80
py
speechbrain
speechbrain-main/tests/integration/ASR_CTC/example_asr_ctc_experiment_quaternion_net.py
#!/usr/bin/env/python3 """This minimal example trains a CTC-based speech recognizer on a tiny dataset. The encoder is based on a combination of convolutional, recurrent, and feed-forward networks (CRDNN) that predict phonemes. A greedy search is used on top of the output probabilities. Given the tiny dataset, the expe...
5,110
33.073333
80
py
speechbrain
speechbrain-main/tests/integration/ASR_Transducer/example_asr_transducer_experiment.py
#!/usr/bin/env/python3 """This minimal example trains a RNNT-based speech recognizer on a tiny dataset. The encoder is based on a combination of convolutional, recurrent, and feed-forward networks (CRDNN) that predict phonemes. A beamsearch is used on top of the output probabilities. Given the tiny dataset, the expect...
6,161
34.011364
80
py
speechbrain
speechbrain-main/tests/integration/LM_RNN/example_lm_rnn_experiment.py
#!/usr/bin/env/python3 """This minimal example trains a character-level language model that predicts the next characters given the previous ones. The system uses a standard attention-based encoder-decoder pipeline. The encoder is based on a simple LSTM. Given the tiny dataset, the expected behavior is to overfit the t...
4,471
33.666667
80
py
speechbrain
speechbrain-main/tests/integration/VAD/example_vad.py
"""This minimal example trains a Voice Activity Detector (VAD) on a tiny dataset. The network is based on a LSTM with a linear transformation on the top of that. The system is trained with the binary cross-entropy metric. """ import os import torch import numpy as np import speechbrain as sb from hyperpyyaml import lo...
4,976
31.109677
81
py
speechbrain
speechbrain-main/tests/integration/ASR_alignment_forward/example_asr_alignment_forward_experiment.py
#!/usr/bin/env/python3 """This minimal example trains an HMM-based aligner with the forward algorithm. The encoder is based on a combination of convolutional, recurrent, and feed-forward networks (CRDNN) that predict phoneme states. Given the tiny dataset, the expected behavior is to overfit the training data (with a v...
4,687
31.783217
79
py
speechbrain
speechbrain-main/tests/integration/ASR_seq2seq/example_asr_seq2seq_experiment.py
#!/usr/bin/env/python3 """This minimal example trains a seq2seq attention-based model for speech recognition on a tiny dataset. The encoder is based on a combination of convolutional, recurrent, and feed-forward networks (CRDNN). The decoder is based on a GRU. A greedy search is used on top of the output probabilitie...
6,322
33.933702
80
py
speechbrain
speechbrain-main/tests/integration/enhance_GAN/example_enhance_gan_experiment.py
#!/usr/bin/env/python3 """This minimal example trains a GAN speech enhancement system on a tiny dataset. The generator and the discriminator are based on convolutional networks. """ import torch import pathlib import speechbrain as sb from hyperpyyaml import load_hyperpyyaml class EnhanceGanBrain(sb.Brain): def ...
6,058
33.821839
81
py
speechbrain
speechbrain-main/tests/integration/sampling/example_sorting.py
"""This minimal example checks on sampling with ascending/descending sorting and random shuffling; w/ & w/o DDP. """ import os import torch import pickle import pathlib import itertools import speechbrain as sb import torch.multiprocessing as mp from hyperpyyaml import load_hyperpyyaml class SamplingBrain(sb.Brain):...
7,867
33.358079
116
py
speechbrain
speechbrain-main/tests/integration/autoencoder/example_auto_experiment.py
#!/usr/bin/env/python3 """This minimal example trains an autoencoder over speech features. The encoder is a MLP that transforms the input into a lower-dimensional latent representation. The decoder is another MLP that predicts the input features. The system is trained with MSE. Given the tiny dataset, the expected beha...
4,741
33.115108
82
py
speechbrain
speechbrain-main/tests/integration/speaker_id/example_xvector_experiment.py
#!/usr/bin/env/python3 """This minimal example trains a speaker identification system based on x-vectors. The encoder is based on TDNNs. The classifier is a MLP. """ import pathlib import speechbrain as sb from hyperpyyaml import load_hyperpyyaml # Trains xvector model class XvectorBrain(sb.Brain): def compute_f...
4,655
32.021277
80
py
speechbrain
speechbrain-main/tests/integration/augmentation/example_do_clip.py
import os import speechbrain as sb from hyperpyyaml import load_hyperpyyaml from speechbrain.dataio.dataio import read_audio, write_audio output_folder = os.path.join("results", "do_clip") experiment_dir = os.path.dirname(os.path.abspath(__file__)) hyperparams_file = os.path.join(experiment_dir, "hyperparams.yaml") ...
1,559
30.2
80
py
speechbrain
speechbrain-main/tests/integration/augmentation/example_speed_perturb.py
import os import speechbrain as sb from hyperpyyaml import load_hyperpyyaml from speechbrain.dataio.dataio import read_audio, write_audio output_folder = os.path.join("results", "speed_perturb") experiment_dir = os.path.dirname(os.path.abspath(__file__)) hyperparams_file = os.path.join(experiment_dir, "hyperparams.yam...
1,576
30.54
80
py
speechbrain
speechbrain-main/tests/integration/augmentation/example_drop_freq.py
import os import speechbrain as sb from hyperpyyaml import load_hyperpyyaml from speechbrain.dataio.dataio import read_audio, write_audio output_folder = os.path.join("results", "drop_freq") experiment_dir = os.path.dirname(os.path.abspath(__file__)) hyperparams_file = os.path.join(experiment_dir, "hyperparams.yaml") ...
1,565
30.32
80
py
speechbrain
speechbrain-main/tests/integration/augmentation/example_add_noise.py
import os import speechbrain as sb from hyperpyyaml import load_hyperpyyaml from speechbrain.dataio.dataio import read_audio, write_audio output_folder = os.path.join("results", "add_noise") experiment_dir = os.path.dirname(os.path.abspath(__file__)) hyperparams_file = os.path.join(experiment_dir, "hyperparams.yaml") ...
1,572
30.46
80
py
speechbrain
speechbrain-main/tests/integration/augmentation/example_add_babble.py
import os import speechbrain as sb from hyperpyyaml import load_hyperpyyaml from speechbrain.dataio.dataio import read_audio, write_audio output_folder = os.path.join("results", "add_babble") experiment_dir = os.path.dirname(os.path.abspath(__file__)) hyperparams_file = os.path.join(experiment_dir, "hyperparams.yaml")...
1,602
30.431373
80
py
speechbrain
speechbrain-main/tests/integration/augmentation/example_drop_chunk.py
import os import speechbrain as sb from hyperpyyaml import load_hyperpyyaml from speechbrain.dataio.dataio import read_audio, write_audio output_folder = os.path.join("results", "drop_chunk") experiment_dir = os.path.dirname(os.path.abspath(__file__)) hyperparams_file = os.path.join(experiment_dir, "hyperparams.yaml")...
1,572
30.46
80
py
speechbrain
speechbrain-main/tests/integration/augmentation/example_add_reverb.py
import os import speechbrain as sb from hyperpyyaml import load_hyperpyyaml from speechbrain.dataio.dataio import read_audio, write_audio output_folder = os.path.join("results", "add_reverb") experiment_dir = os.path.dirname(os.path.abspath(__file__)) hyperparams_file = os.path.join(experiment_dir, "hyperparams.yaml")...
1,577
30.56
80
py
speechbrain
speechbrain-main/tests/utils/recipe_tests.py
"""Library for running recipe tests. Authors * Mirco Ravanelli 2022 * Andreas Nautsch 2022, 2023 """ import os import re import csv import sys import pydoc from time import time import subprocess as sp from hyperpyyaml import load_hyperpyyaml from tests.consistency.test_recipe import __skip_list def check_row_for_...
24,805
33.938028
232
py
speechbrain
speechbrain-main/tests/utils/check_docstrings.py
"""This library contains functions that checks the dosctrings Authors * Mirco Ravanelli 2022 """ import re from speechbrain.utils.data_utils import get_all_files def extractName(s, search_class=False): """Extracts the names of the function or classes in the input string. Arguments --------- s: str...
4,501
31.157143
103
py
speechbrain
speechbrain-main/tests/utils/check_url.py
"""Libraries for automatic finding URLs in the files and checking if they are reachable. Authors * Mirco Ravanelli 2022 """ import os import re import time import requests from tqdm.contrib import tqdm from speechbrain.utils.data_utils import get_all_files def get_url(path): """This function searches for the UR...
3,721
23.326797
81
py
speechbrain
speechbrain-main/tests/utils/check_yaml.py
"""Tests for checking consistency between yaml files and their corresponding training scripts. Authors * Mirco Ravanelli 2022 * Andreas Nautsch 2022 """ import os import re def get_yaml_var(hparam_file): """Extracts from the input yaml file (hparams_file) the list of variables that should be used in the s...
11,055
33.55
108
py
speechbrain
speechbrain-main/tests/utils/refactoring_checks.py
#!/usr/bin/env/python3 """This is a test script for creating a list of expected outcomes (before refactoring); then, manual editing might change YAMLs and/or code; another test runs to compare results (after refactoring to before). The target is a list of known HF repos. The goal is to identify to which extent changes...
19,156
36.489237
197
py
speechbrain
speechbrain-main/tests/utils/check_HF_repo.py
"""Library for the HuggingFace (HF) repositories. Authors * Mirco Ravanelli 2022 * Andreas Nautsch 2022, 2023 """ import os import csv from speechbrain.utils.data_utils import download_file from tests.consistency.test_recipe import __skip_list def run_HF_check( recipe_folder="tests/recipes", field="HF_repo", o...
3,957
28.318519
95
py
speechbrain
speechbrain-main/docs/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
4,241
26.192308
79
py
Dink-Net
Dink-Net-main/main.py
import os import wandb import argparse from utils import * from tqdm import tqdm from model import DinkNet, DinkNet_dgl def train(args=None): # setup random seed setup_seed(args.seed) # load graph data if args.dataset in ["cora", "citeseer"]: x, adj, y, n, k, d = load_data(args.dataset) ...
3,933
32.338983
122
py
Dink-Net
Dink-Net-main/utils.py
import dgl import sys import copy import torch import random import numpy as np import pickle as pkl import networkx as nx import scipy.sparse as sp from munkres import Munkres from collections import Counter from sklearn.metrics import accuracy_score, f1_score from sklearn.metrics import adjusted_rand_score as ari_sco...
21,067
34.7691
124
py
Dink-Net
Dink-Net-main/model.py
from utils import * import torch.nn as nn import dgl.function as fn import torch.nn.functional as F from dgl.nn.pytorch import GraphConv # ------------------------from scratch------------------------ class GCN(nn.Module): def __init__(self, in_ft, out_ft, act): super(GCN, self).__init__() self.fc =...
8,030
34.852679
124
py
ice-ice
ice-ice/legacy.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
16,502
50.411215
154
py
ice-ice
ice-ice/style_mixing.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
4,891
40.109244
132
py
ice-ice
ice-ice/projector.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
8,990
41.211268
136
py
ice-ice
ice-ice/generate.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
5,338
40.069231
132
py
ice-ice
ice-ice/dataset_tool.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
17,876
39.173034
174
py
ice-ice
ice-ice/train.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
24,067
43.487985
192
py
ice-ice
ice-ice/calc_metrics.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
8,336
42.649215
142
py
ice-ice
ice-ice/training/loss.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
7,297
53.462687
160
py
ice-ice
ice-ice/training/augment.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
26,373
60.050926
366
py
ice-ice
ice-ice/training/dataset.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
8,551
35.084388
158
py
ice-ice
ice-ice/training/networks.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
39,286
49.23913
164
py
ice-ice
ice-ice/training/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
435
42.6
76
py
ice-ice
ice-ice/training/training_loop.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
21,596
50.177725
168
py
ice-ice
ice-ice/training/networks_old.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
37,392
50.223288
164
py
ice-ice
ice-ice/torch_utils/custom_ops.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
5,644
43.448819
146
py
ice-ice
ice-ice/torch_utils/training_stats.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
10,707
38.806691
118
py
ice-ice
ice-ice/torch_utils/persistence.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
9,708
37.527778
144
py
ice-ice
ice-ice/torch_utils/misc.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
10,992
40.798479
133
py
ice-ice
ice-ice/torch_utils/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
436
42.7
76
py
ice-ice
ice-ice/torch_utils/ops/bias_act.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
10,047
46.173709
185
py
ice-ice
ice-ice/torch_utils/ops/grid_sample_gradfix.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
3,299
38.285714
138
py
ice-ice
ice-ice/torch_utils/ops/conv2d_gradfix.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
7,677
43.900585
197
py
ice-ice
ice-ice/torch_utils/ops/upfirdn2d.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
16,287
41.306494
157
py
ice-ice
ice-ice/torch_utils/ops/conv2d_resample.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
7,591
47.356688
130
py
ice-ice
ice-ice/torch_utils/ops/fma.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
2,034
32.360656
105
py
ice-ice
ice-ice/torch_utils/ops/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
436
42.7
76
py
ice-ice
ice-ice/metrics/metric_utils.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
11,806
41.778986
167
py
ice-ice
ice-ice/metrics/kernel_inception_distance.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
2,302
48
118
py
ice-ice
ice-ice/metrics/frechet_inception_distance.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
2,040
47.595238
118
py
ice-ice
ice-ice/metrics/perceptual_path_length.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
5,538
40.962121
131
py
ice-ice
ice-ice/metrics/inception_score.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
1,874
47.076923
126
py
ice-ice
ice-ice/metrics/metric_main.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
5,715
36.359477
147
py
ice-ice
ice-ice/metrics/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
435
42.6
76
py
ice-ice
ice-ice/metrics/precision_recall.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
3,617
56.428571
159
py
ice-ice
ice-ice/dnnlib/util.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
16,625
33.782427
151
py
ice-ice
ice-ice/dnnlib/__init__.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
476
46.7
76
py
ice-ice
ice-ice/ice/landmark_interpolation.py
import numpy as np import scipy.spatial import skimage.draw import torch from torchvision import io import face_alignment import matplotlib.pyplot as plt def interpolate_from_landmarks(image, landmarks, vertex_indices=None, weights=None, mask=None): H, W = image.shape[-2:] step = 4 rect = landmarks.new_...
4,861
37.283465
136
py
ice-ice
ice-ice/ice/resnet.py
import torch.nn as nn import torch.utils.model_zoo as model_zoo __all__ = ['ResNet', 'resnet50'] model_urls = { 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth', 'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth', 'resnet50': 'https://download.pytorch.org/mode...
7,115
31.792627
116
py
ice-ice
ice-ice/ice/wrapper.py
import matplotlib.pyplot as plt import face_alignment import kornia import torch from torch import nn import torchvision.transforms as transforms import torch.nn.functional as F from torch_utils import misc import dnnlib import legacy from external.identity.iresnet import iresnet50, iresnet100 from external.landmark....
10,977
36.986159
106
py
ice-ice
ice-ice/ice/criterions.py
import matplotlib.pyplot as plt import kornia import torch from torch import nn import torch.nn.functional as F import torchvision.transforms as transforms from wrapper import StyleGanWrapper, FaceSegmenter, KeyPointDetector from landmark_interpolation import interpolate_from_landmarks def masked_mean(x, mask): ...
9,823
34.338129
94
py
ice-ice
ice-ice/ice/jtj_analysis.py
import functools import itertools import numpy as np from pathlib import Path import pickle import matplotlib.pyplot as plt import numpy as np import torch from torch import nn import torch.nn.functional as F import torchvision.transforms as transforms from torch.utils.data import DataLoader, Dataset from tqdm import t...
7,312
32.240909
118
py
ice-ice
ice-ice/ice/external/identity/iresnet.py
import torch from torch import nn __all__ = ['iresnet18', 'iresnet34', 'iresnet50', 'iresnet100', 'iresnet200'] def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=...
7,401
36.383838
97
py
ice-ice
ice-ice/ice/external/parsing/model.py
#!/usr/bin/python # -*- encoding: utf-8 -*- import torch import torch.nn as nn import torch.nn.functional as F import torchvision # from resnet import Resnet18 # from modules.bn import InPlaceABNSync as BatchNorm2d # --------------------------------------------------- import torch import torch.nn as nn import torch...
14,108
35.742188
91
py
ice-ice
ice-ice/ice/external/attribution/resnet.py
import torch.nn as nn import torch.utils.model_zoo as model_zoo __all__ = ['ResNet', 'resnet50'] model_urls = { 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth', 'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth', 'resnet50': 'https://download.pytorch.org/mode...
7,115
31.792627
116
py
MrMustard-develop
MrMustard-develop/setup.py
# Copyright 2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
2,308
31.521127
90
py
MrMustard-develop
MrMustard-develop/mrmustard/typing.py
# Copyright 2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
2,400
24.010417
74
py
MrMustard-develop
MrMustard-develop/mrmustard/logger.py
# Copyright 2010 Pallets # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # 2. Redist...
4,353
36.86087
84
py
MrMustard-develop
MrMustard-develop/mrmustard/_version.py
# Copyright 2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
695
33.8
74
py
MrMustard-develop
MrMustard-develop/mrmustard/__init__.py
# Copyright 2022 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
5,726
33.089286
100
py
MrMustard-develop
MrMustard-develop/mrmustard/physics/fock.py
# Copyright 2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
35,463
36.528042
166
py
MrMustard-develop
MrMustard-develop/mrmustard/physics/bargmann.py
# Copyright 2023 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
5,185
43.706897
147
py