repo
stringlengths
1
99
file
stringlengths
13
215
code
stringlengths
12
59.2M
file_length
int64
12
59.2M
avg_line_length
float64
3.82
1.48M
max_line_length
int64
12
2.51M
extension_type
stringclasses
1 value
LongTailCXR
LongTailCXR-main/src/datasets.py
import os import cv2 import numpy as np import pandas as pd import torch import torchvision class NIH_CXR_Dataset(torch.utils.data.Dataset): def __init__(self, data_dir, label_dir, split): self.data_dir = data_dir self.split = split self.CLASSES = [ 'No Finding', 'Infiltration...
5,736
38.294521
110
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/test.py
import torch import torch.nn as nn from torchtext import data import spacy import pandas as pd import numpy as np from sklearn.metrics import accuracy_score from scipy import spatial from sklearn.metrics.pairwise import cosine_similarity import numpy as np from sklearn.metrics.pairwise import cosine_similarity # ve...
4,903
31.476821
1,199
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/model_blstm.py
# model.py import torch from copy import deepcopy from torch import nn import numpy as np from torch.nn import functional as F from Pytorch.Model_Transformer.utils import * from Pytorch.Model_Transformer.train import return_emb1,return_emb2 class TextRNN(nn.Module): def __init__(self, config, vocab_size1,vocab_s...
6,293
41.816327
120
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/utils_SA.py
# utils.py import torch #import gensim #from gensim.test.utils import datapath, get_tmpfile #from gensim.models import KeyedVectors #from gensim.scripts.glove2word2vec import glove2word2vec from torchtext import data import spacy import pandas as pd from Pytorch.Model_Transformer.config import Config import numpy as n...
12,643
37.785276
112
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/comment_model.py
# Model.py import torch import torch.nn as nn from copy import deepcopy from train_utils import Embeddings, PositionalEncoding from attention import MultiHeadedAttention from encoder import EncoderLayer, Encoder from encoder_cross import EncoderCross, EncoderLayerCross from feed_forward import PositionwiseFeedForward ...
12,031
39.92517
113
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/x.py
#from Pytorch.Model_Transformer.imap_qa import calc_map1,calc_mrr1 from Pytorch.Model_Transformer.imap_qa_test import calc_map1,calc_mrr1 def read_data(filename): with open(filename, 'r') as datafile: res = [] for line in datafile: line = line.strip().split('\t') lines = [] ...
3,679
56.5
246
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/utils.py
# utils.py import torch # import gensim # from gensim.test.utils import datapath, get_tmpfile # from gensim.models import KeyedVectors # from gensim.scripts.glove2word2vec import glove2word2vec from torchtext import data import spacy import pandas as pd from config import Config import numpy as np from sklearn.metrics...
14,352
36.183938
116
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/model.py
# Model.py import torch import torch.nn as nn from copy import deepcopy from train_utils import Embeddings,PositionalEncoding from attention import MultiHeadedAttention from encoder import EncoderLayer, Encoder from encoder_cross import EncoderCross, EncoderLayerCross from feed_forward import PositionwiseFeedForward #...
6,889
36.857143
132
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/encoder.py
# encoder.py from torch import nn from train_utils import clones from sublayer import LayerNorm, SublayerOutput class Encoder(nn.Module): ''' Transformer Encoder It is a stack of N layers. ''' def __init__(self, layer, N): super(Encoder, self).__init__() self.layers = clones(l...
1,404
30.931818
104
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/feed_forward.py
# feed_forward.py from torch import nn import torch.nn.functional as F class PositionwiseFeedForward(nn.Module): "Positionwise feed-forward network." def __init__(self, d_model, d_ff, dropout=0.1): super(PositionwiseFeedForward, self).__init__() self.w_1 = nn.Linear(d_model, d_ff) self...
515
31.25
58
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/sublayer.py
# sublayer.py import torch from torch import nn class LayerNorm(nn.Module): "Construct a layer normalization module." def __init__(self, features, eps=1e-6): super(LayerNorm, self).__init__() self.a_2 = nn.Parameter(torch.ones(features)) self.b_2 = nn.Parameter(torch.zeros(features)) ...
950
29.677419
71
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/train_utils.py
# train_utils.py import torch from torch import nn from torch.autograd import Variable import copy import math #from Pytorch.Model_Transformer.utils import Dataset as utils #from Pytorch.Model_Transformer.config import Config def clones(module, N): "Produce N identical layers." return nn.ModuleList([copy.deep...
1,941
34.962963
129
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/encoder_cross.py
# encoder.py from torch import nn from train_utils import clones from sublayer import LayerNorm, SublayerOutput class EncoderCross(nn.Module): ''' Transformer Encoder It is a stack of N layers. ''' def __init__(self, layer, N): super(EncoderCross, self).__init__() self.layers ...
1,400
31.581395
104
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/attention.py
# attention.py import torch from torch import nn import math import torch.nn.functional as F from train_utils import clones def attention(query, key, value, mask=None, dropout=None): "Implementation of Scaled dot product attention" d_k = query.size(-1) #print("printing") #print(key.shape) #print("...
1,982
35.054545
76
py
CETE-LREC
CETE-LREC-master/CETE Feature-Based/Model_Transformer/train.py
# train.py #from Pytorch.Model_Transformer.utils import * import h5py from model import * #from Pytorch.Model_Transformer.model_blstm import * import numpy as np from config import Config import sys import torch.optim as optim from torch import nn import torch def return_file_name(): config = Config() train_fi...
4,708
32.635714
126
py
CETE-LREC
CETE-LREC-master/GenerateContextualizedEmbeddings/BERT.py
import numpy as np import h5py import mxnet as mx from bert_embedding import BertEmbedding #https://github.com/imgarylai/bert-embedding f1= open("bertS16size1.txt","w+") f2= open("bertS16size2.txt","w+") def read_data(filename): with open(filename, 'r',encoding="utf8") as datafile: res = [] for line...
3,110
24.710744
109
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/setup.py
""" Simple check list from AllenNLP repo: https://github.com/allenai/allennlp/blob/master/setup.py To create the package for pypi. 1. Change the version in __init__.py and setup.py. 2. Commit these changes with the message: "Release: VERSION" 3. Add a tag in git to mark the release: "git tag VERSION -m'Adds tag VER...
2,959
39
127
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/hubconf.py
from pytorch_transformers import ( AutoTokenizer, AutoConfig, AutoModel, AutoModelWithLMHead, AutoModelForSequenceClassification, AutoModelForQuestionAnswering ) from pytorch_transformers.file_utils import add_start_docstrings dependencies = ['torch', 'tqdm', 'boto3', 'requests', 'regex', 'sentencepiece', 'sacremo...
6,689
58.20354
197
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/run_lm_finetuning.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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 cop...
25,840
50.993964
165
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/run_squad.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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 cop...
29,378
54.016854
154
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/run_classifier.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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 cop...
44,356
39.105787
144
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/run_glue.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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 cop...
28,656
51.198543
184
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/run_bertology.py
#!/usr/bin/env python3 # Copyright 2018 CMU and The HuggingFace Inc. team. # # 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 requir...
18,289
51.406877
177
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/run_generation.py
#!/usr/bin/env python3 # coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
9,558
47.770408
144
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/utils_squad.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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 co...
41,529
40.654965
112
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/single_model_scripts/run_transfo_xl.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
6,735
42.74026
111
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/single_model_scripts/run_swag.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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 cop...
24,318
42.739209
134
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/single_model_scripts/run_openai_gpt.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
14,382
48.768166
132
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/lm_finetuning/simple_lm_finetuning.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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 cop...
27,841
42.367601
134
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/lm_finetuning/finetune_on_pregenerated.py
from argparse import ArgumentParser from pathlib import Path import os import torch import logging import json import random import numpy as np from collections import namedtuple from tempfile import TemporaryDirectory from torch.utils.data import DataLoader, Dataset, RandomSampler from torch.utils.data.distributed im...
16,878
47.642651
136
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/lm_finetuning/pregenerate_training_data.py
from argparse import ArgumentParser from pathlib import Path from tqdm import tqdm, trange from tempfile import TemporaryDirectory import shelve from multiprocessing import Pool from random import random, randrange, randint, shuffle, choice from pytorch_transformers.tokenization_bert import BertTokenizer import numpy ...
16,307
44.808989
120
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/distillation/utils.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team and Facebook, 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 # # Un...
4,308
32.146154
104
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/distillation/dataset.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team and Facebook, 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 # # Un...
7,257
34.930693
116
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/distillation/train.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team. # # 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 a...
11,687
48.316456
135
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/distillation/distiller.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team and Facebook, 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 # # Un...
20,865
44.859341
163
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/distillation/scripts/extract_for_distil.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team. # # 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 a...
3,957
50.402597
139
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/examples/distillation/scripts/binarized_data.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team. # # 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 a...
2,621
33.051948
140
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/docs/source/conf.py
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
5,681
29.063492
83
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/optimization.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # # 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/LICEN...
8,635
44.452632
130
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/__main__.py
# coding: utf8 def main(): import sys if (len(sys.argv) < 4 or len(sys.argv) > 6) or sys.argv[1] not in ["bert", "gpt", "transfo_xl", "gpt2", "xlnet", "xlm"]: print( "Should be used as one of: \n" ">> pytorch_transformers bert TF_CHECKPOINT TF_CONFIG PYTORCH_DUMP_OUTPUT, \n" ">> ...
7,021
53.434109
143
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/convert_gpt2_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
3,082
39.565789
111
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/convert_openai_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
3,169
40.710526
118
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/configuration_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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 cop...
10,499
49.970874
296
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/modeling_distilbert.py
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, 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.or...
34,950
49.216954
201
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/configuration_bert.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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 cop...
6,412
55.254386
181
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/modeling_utils.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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 cop...
40,276
51.104787
480
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/modeling_bert.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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 cop...
59,222
50.67801
187
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tokenization_auto.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
7,177
58.322314
380
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/modeling_gpt2.py
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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...
32,763
49.021374
148
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/modeling_openai.py
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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...
30,874
48.638264
148
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/configuration_auto.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
7,826
56.551471
296
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tokenization_bert.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # # 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/LICEN...
19,926
42.508734
183
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/convert_xlnet_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
4,342
40.361905
126
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/convert_xlm_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
2,940
37.697368
117
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/modeling_auto.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
36,632
72.560241
480
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/convert_transfo_xl_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
5,550
46.042373
121
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tokenization_distilbert.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
2,446
37.84127
152
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/convert_roberta_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
8,527
46.116022
188
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/file_utils.py
""" Utilities for working with the local dataset cache. This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp Copyright by the AllenNLP authors. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import json import logging import os impor...
10,536
34.718644
118
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/convert_tf_checkpoint_to_pytorch.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
2,585
38.181818
101
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/modeling_transfo_xl.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
53,261
42.19708
157
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/modeling_xlnet.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
59,258
50.39549
169
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/modeling_xlm.py
# coding=utf-8 # Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. team. # # 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 # # Un...
40,005
49.195734
151
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tokenization_transfo_xl.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
21,777
36.809028
133
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/convert_pytorch_checkpoint_to_tf.py
# coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # # 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...
4,486
33.251908
115
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/modeling_transfo_xl_utilities.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
13,568
39.747748
132
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/modeling_roberta.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # 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 cop...
18,955
51.655556
134
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tokenization_utils.py
# coding=utf-8 # Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team. # # 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 # # ...
39,803
47.779412
380
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/modeling_transfo_xl_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
8,554
38.976636
93
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/tokenization_transfo_xl_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
2,716
35.226667
94
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/modeling_openai_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
8,707
39.882629
124
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/modeling_roberta_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
10,365
41.483607
143
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/tokenization_utils_test.py
# coding=utf-8 # Copyright 2018 HuggingFace 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 a...
1,838
38.12766
77
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/modeling_common_test.py
# coding=utf-8 # Copyright 2019 HuggingFace 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 ag...
31,566
43.335674
137
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/tokenization_xlm_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
3,201
37.578313
94
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/modeling_auto_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
4,040
44.404494
122
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/tokenization_dilbert_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
1,725
35.723404
82
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/modeling_bert_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
15,142
46.920886
162
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/optimization_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
6,088
42.492857
115
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/modeling_xlnet_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
14,225
42.907407
135
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/modeling_distilbert_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
9,661
43.731481
152
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/tokenization_bert_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
5,314
36.429577
90
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/tokenization_auto_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
1,825
37.851064
91
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/tokenization_roberta_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
4,038
39.79798
121
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/tokenization_xlnet_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
5,262
48.186916
128
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/modeling_xlm_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
12,712
42.094915
171
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/modeling_gpt2_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
8,709
39.511628
124
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/tokenization_gpt2_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
2,912
38.90411
95
py
CETE-LREC
CETE-LREC-master/CETE Fine-Tuning/HuggingFacePytorchTransformer/pytorch_transformers/tests/tokenization_openai_test.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
2,656
35.39726
90
py
qutip-qip
qutip-qip-master/doc/source/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...
5,954
30.507937
82
py
ResiDualGAN-DRDG
ResiDualGAN-DRDG-main/evaluate.py
import os from asyncio.log import logger from distutils.command.build import build from statistics import mode from matplotlib.pyplot import axis import torch import numpy as np from core.datasets.seg_dataset import SegDataset from core.utils.utils import _data_part,setup_logger,iou,f1 from core.utils.data_display impo...
3,505
32.075472
112
py
ResiDualGAN-DRDG
ResiDualGAN-DRDG-main/train_seg.py
import argparse import os import torch from torch.utils.data import DataLoader import albumentations as A import time import copy import logging import numpy as np import torch.nn.functional as F from torch.nn.modules import CrossEntropyLoss, BCEWithLogitsLoss from torch.autograd import Variable from core.configs.defau...
8,635
37.553571
136
py
ResiDualGAN-DRDG
ResiDualGAN-DRDG-main/train_residualgan.py
import sys import PIL import torchvision from yacs.config import CfgNode as CN import argparse import os import numpy as np import math import itertools import time import datetime import logging import torch.nn as nn import torch.nn.functional as F import torch from torch import FloatTensor import torchvision.transfo...
12,278
39.93
182
py
ResiDualGAN-DRDG
ResiDualGAN-DRDG-main/transfer.py
from core.datasets.dual_dataset import TransferDataset from core.models.residualgan import ResizeGenerator from core.utils.utils import UnNormalize, setup_logger from core.models.build import build_generators import torchvision.transforms as transforms import torch.utils.data as D import albumentations as A import os i...
3,849
36.378641
106
py
ResiDualGAN-DRDG
ResiDualGAN-DRDG-main/core/models/output_discriminator.py
import torch.nn as nn class OutputDiscriminator(nn.Module): def __init__(self, num_classes, ndf = 64): super(OutputDiscriminator, self).__init__() self.conv1 = nn.Conv2d(num_classes, ndf, kernel_size=4, stride=2, padding=1) self.conv2 = nn.Conv2d(ndf, ndf*2, kernel_size=4, stride=2, paddin...
1,126
36.566667
84
py
ResiDualGAN-DRDG
ResiDualGAN-DRDG-main/core/models/resize_block.py
import torch.nn as nn import torch.nn.functional as F class ResBlock(nn.Module): def __init__(self, in_channels, out_channels): super(ResBlock, self).__init__() self.block = nn.Sequential( nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=1, padding=1, bias=False), nn.Batc...
2,116
33.704918
100
py
ResiDualGAN-DRDG
ResiDualGAN-DRDG-main/core/models/focal_loss.py
# from: https://github.com/doiken23/focal_segmentation/blob/master/focalloss2d.py import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable class FocalLoss2d(nn.Module): def __init__(self, gamma=0, weight=None, size_average=True, ignore_index=255): super(Focal...
1,495
33
82
py
ResiDualGAN-DRDG
ResiDualGAN-DRDG-main/core/models/residualgan.py
import torch.nn as nn import torch from .resize_block import ResizeBlock import torch.nn.functional as F import segmentation_models_pytorch as smp class UNetDown(nn.Module): def __init__(self, in_size, out_size, normalize=True, dropout=0.0): super(UNetDown, self).__init__() layers = [nn.Conv2d(in_...
10,422
33.062092
103
py
ResiDualGAN-DRDG
ResiDualGAN-DRDG-main/core/models/build.py
from .residualgan import * from .resize_block import * import segmentation_models_pytorch as smp def build_generators(cfg): G_AB = ResizeGenerator( cfg.MODELS.IN_CHANNELS, (cfg.DATASETS.TARGET_SIZE, cfg.DATASETS.TARGET_SIZE), generator=cfg.MODELS.GENERATOR, resize_block=cfg.MODELS....
2,736
43.868852
118
py
ResiDualGAN-DRDG
ResiDualGAN-DRDG-main/core/datasets/seg_dataset.py
import torch import torch.nn as nn import torch.utils.data as D import random from PIL import Image import numpy as np import torchvision.transforms as transforms class SegDataset(D.Dataset): def __init__(self, path, all=False, train=True, transform=None, iter_len=None, in_memory=True, get_label=True) -> None: ...
3,485
31.277778
123
py