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
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_flax_wav2vec2.py
# Copyright 2021 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
18,483
39.270153
200
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_m2m_100.py
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
16,613
42.721053
305
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_skip_decorators.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,519
28.090909
98
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_tf_common.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...
68,904
43.483538
137
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_tf_bert.py
# coding=utf-8 # Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
15,608
38.920716
117
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_generation_beam_search.py
# coding=utf-8 # Copyright 2020 The HuggingFace Team 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 clone of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
10,535
40.976096
119
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_lxmert.py
# coding=utf-8 # Copyright 2018 LXMERT Authors, The Hugging Face 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 b...
29,186
37.658278
119
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_bert.py
# coding=utf-8 # Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
24,037
38.996672
119
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_openai.py
# coding=utf-8 # Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
10,133
36.672862
117
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_benchmark.py
# Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
10,670
39.267925
91
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_data_collator.py
# Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
13,906
46.464164
106
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_tokenization_luke.py
# coding=utf-8 # Copyright 2021 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
26,619
45.135182
213
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_roberta.py
# coding=utf-8 # Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
22,372
39.311712
117
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_tf_convbert.py
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
16,754
39.667476
117
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_deberta.py
# coding=utf-8 # Copyright 2018 Microsoft 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 # # Unless ...
11,366
39.024648
119
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_tf_pytorch.py
# coding=utf-8 # Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
10,228
40.922131
114
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_transfo_xl.py
# coding=utf-8 # Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
20,524
47.752969
763
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_hubert.py
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
22,763
38.113402
128
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_tf_albert.py
# coding=utf-8 # Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
13,730
39.62426
118
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_tf_marian.py
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
17,784
39.512528
117
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_auto.py
# coding=utf-8 # Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
12,065
42.876364
119
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_funnel.py
# coding=utf-8 # Copyright 2020 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 law...
19,285
36.741683
119
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_pegasus.py
# coding=utf-8 # Copyright 2021, The HuggingFace Inc. team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
24,082
42.628623
1,802
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_tokenization_fsmt.py
# coding=utf-8 # Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
6,444
37.136095
141
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/test_modeling_albert.py
# coding=utf-8 # Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
12,943
40.620579
119
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/deepspeed/test_deepspeed.py
# Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
38,102
39.92696
126
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/deepspeed/test_model_zoo.py
# Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
7,943
29.553846
113
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/sagemaker/conftest.py
# we define a fixture function below and it will be "used" by # referencing its name from tests import os import pytest from attr import dataclass os.environ["AWS_DEFAULT_REGION"] = "us-east-1" # defaults region @dataclass class SageMakerTestEnvironment: framework: str role = "arn:aws:iam::558105141721:...
2,183
32.090909
148
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/sagemaker/test_single_node_gpu.py
import json import os import subprocess import unittest from ast import literal_eval import pytest from parameterized import parameterized_class from . import is_sagemaker_available if is_sagemaker_available(): from sagemaker import Session, TrainingJobAnalytics from sagemaker.huggingface import HuggingFac...
3,554
35.649485
117
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/sagemaker/test_multi_node_data_parallel.py
import json import os import subprocess import unittest from ast import literal_eval import pytest from parameterized import parameterized, parameterized_class from . import is_sagemaker_available if is_sagemaker_available(): from sagemaker import Session, TrainingJobAnalytics from sagemaker.huggingface im...
4,260
37.387387
118
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/sagemaker/test_multi_node_model_parallel.py
import json import os import subprocess import unittest from ast import literal_eval import pytest from parameterized import parameterized, parameterized_class from . import is_sagemaker_available if is_sagemaker_available(): from sagemaker import Session, TrainingJobAnalytics from sagemaker.huggingface im...
4,521
35.176
117
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/sagemaker/scripts/pytorch/run_ddp.py
import json import logging import os import subprocess from argparse import ArgumentParser logger = logging.getLogger(__name__) def parse_args(): parser = ArgumentParser() parsed, unknown = parser.parse_known_args() for arg in unknown: if arg.startswith(("-", "--")): parser.add_argum...
1,468
26.716981
102
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/sagemaker/scripts/tensorflow/run_tf.py
import argparse import logging import sys import time import tensorflow as tf from datasets import load_dataset from transformers import AutoTokenizer, TFAutoModelForSequenceClassification if __name__ == "__main__": parser = argparse.ArgumentParser() # Hyperparameters sent by the client are passed as comm...
3,690
39.119565
112
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/sagemaker/scripts/tensorflow/run_tf_dist.py
import argparse import logging import os import sys import time import tensorflow as tf from datasets import load_dataset from tqdm import tqdm from transformers import AutoTokenizer, TFAutoModelForSequenceClassification from transformers.file_utils import is_sagemaker_dp_enabled if os.environ.get("SDP_ENABLED") or...
7,331
36.6
110
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/tests/extended/test_trainer_ext.py
# Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
11,054
34.892857
119
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/utils/tests_fetcher.py
# coding=utf-8 # Copyright 2021 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...
17,434
39.358796
118
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/utils/check_copies.py
# coding=utf-8 # Copyright 2020 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...
13,736
37.695775
119
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/utils/notification_service.py
# Copyright 2020 The HuggingFace Team. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
7,977
39.090452
127
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/utils/check_repo.py
# coding=utf-8 # Copyright 2020 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...
23,065
39.824779
141
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/utils/check_dummies.py
# coding=utf-8 # Copyright 2020 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...
6,848
33.943878
118
py
Match-Prompt
Match-Prompt-main/mytransformers_ptunning/utils/check_table.py
# coding=utf-8 # Copyright 2020 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,578
39.747312
116
py
Match-Prompt
Match-Prompt-main/data_utils/dataset_ptunning.py
from torch.utils.data import Dataset import json import pandas as pd from data_utils.vocab import get_vocab_by_strategy, token_wrapper import os import random import json_lines def load_file(filename): data = [] with open(filename, "r") as f: for line in f.readlines(): data.append(json.load...
74,394
36.860051
174
py
Match-Prompt
Match-Prompt-main/data_utils/dataset_evaluate.py
from torch.utils.data import Dataset import json import pandas as pd from data_utils.vocab import get_vocab_by_strategy, token_wrapper import os import random import json_lines def load_file(filename): data = [] with open(filename, "r") as f: for line in f.readlines(): data.append(json.load...
30,039
34.634638
105
py
Match-Prompt
Match-Prompt-main/data_utils/dataset_all_layer.py
from torch.utils.data import Dataset import json import pandas as pd from data_utils.vocab import get_vocab_by_strategy, token_wrapper import os import random import json_lines def load_file(filename): data = [] with open(filename, "r") as f: for line in f.readlines(): data.append(json.load...
42,447
35.064571
105
py
aum
aum-master/docs/source/conf.py
# -*- coding: utf-8 -*- # # AUM documentation build configuration file, created by # sphinx-quickstart on Fri Mar 20 17:28:42 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
9,407
31
82
py
locating-objects-without-bboxes
locating-objects-without-bboxes-master/object-locator/losses.py
__copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and no commercial use is allowed. For any ...
11,043
37.750877
110
py
locating-objects-without-bboxes
locating-objects-without-bboxes-master/object-locator/paint.py
from __future__ import print_function __copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and ...
2,896
27.126214
110
py
locating-objects-without-bboxes
locating-objects-without-bboxes-master/object-locator/argparser.py
__copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and no commercial use is allowed. For any ...
21,664
50.096698
110
py
locating-objects-without-bboxes
locating-objects-without-bboxes-master/object-locator/utils.py
__copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and no commercial use is allowed. For any ...
12,060
33.658046
110
py
locating-objects-without-bboxes
locating-objects-without-bboxes-master/object-locator/logger.py
__copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and no commercial use is allowed. For any ...
9,445
39.891775
123
py
locating-objects-without-bboxes
locating-objects-without-bboxes-master/object-locator/data.py
__copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and no commercial use is allowed. For any ...
18,646
36.900407
110
py
locating-objects-without-bboxes
locating-objects-without-bboxes-master/object-locator/data_plant_stuff.py
__copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and no commercial use is allowed. For any ...
11,228
40.743494
110
py
locating-objects-without-bboxes
locating-objects-without-bboxes-master/object-locator/find_lr.py
from __future__ import print_function __copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and ...
6,709
33.587629
110
py
locating-objects-without-bboxes
locating-objects-without-bboxes-master/object-locator/train.py
from __future__ import print_function __copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and ...
19,843
40.341667
133
py
locating-objects-without-bboxes
locating-objects-without-bboxes-master/object-locator/locate.py
from __future__ import print_function __copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and ...
16,663
38.394799
110
py
locating-objects-without-bboxes
locating-objects-without-bboxes-master/object-locator/models/unet_model.py
__copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and no commercial use is allowed. For any ...
6,377
35.445714
110
py
locating-objects-without-bboxes
locating-objects-without-bboxes-master/object-locator/models/utils.py
__copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and no commercial use is allowed. For any ...
1,631
32.306122
110
py
locating-objects-without-bboxes
locating-objects-without-bboxes-master/object-locator/models/unet_parts.py
__copyright__ = \ """ Copyright &copyright © (c) 2019 The Board of Trustees of Purdue University and the Purdue Research Foundation. All rights reserved. This software is covered by US patents and copyright. This source code is to be used for academic research purposes only, and no commercial use is allowed. For any ...
3,590
28.195122
110
py
adversarial-recurrent-ids
adversarial-recurrent-ids-master/learn.py
#!/usr/bin/env python3 import sys import os import pickle import json import math import argparse import random import time from functools import reduce from tqdm import tqdm import collections import itertools import numpy as np import torch import torch.nn as nn import torch.optim as optim from torch.utils.data imp...
81,799
49.431566
549
py
adversarial-recurrent-ids
adversarial-recurrent-ids-master/weight_feat_imp.py
#!/usr/bin/env python3 import matplotlib.pyplot as plt import torch import numpy as np import sys import json from learn import pretty_print hidden_size = 512 n_layers = 3 absolute_values = True assert len(sys.argv) > 1, 'No model specified' parameters = torch.load(sys.argv[1]) with open('features_meaningful_names...
3,233
43.30137
194
py
interp-net
interp-net-master/src/multivariate_example.py
import argparse import numpy as np import logging, os logging.disable(logging.WARNING) os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" import tensorflow as tf from sklearn.model_selection import StratifiedKFold from sklearn.metrics import average_precision_score as auprc from sklearn.metrics import roc_auc_score as auc_score ...
7,678
35.918269
79
py
interp-net
interp-net-master/src/univariate_example.py
import argparse import pickle import numpy as np import logging, os logging.disable(logging.WARNING) os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" import tensorflow as tf import keras from keras.models import Model from keras.layers import Input, Dense, GRU, Lambda, Permute from sklearn.preprocessing import MultiLabelBinari...
4,505
36.55
107
py
interp-net
interp-net-master/src/interpolation_layer.py
from keras import backend as K from keras.engine.topology import Layer import numpy as np import tensorflow as tf import keras from keras import activations class single_channel_interp(Layer): def __init__(self, ref_points, hours_look_ahead, **kwargs): self.ref_points = ref_points self.hours_look...
4,502
38.849558
78
py
brain-tumor-segmentation
brain-tumor-segmentation-master/src/trainers.py
import abc import os import sys import tqdm import torch import datetime from torch.utils.data import DataLoader from typing import Callable, Any from typing import NamedTuple, List from torchvision.utils import make_grid def to_np(x): return x.data.cpu().numpy() class BatchResult(NamedTuple): """ Repres...
11,931
39.175084
151
py
brain-tumor-segmentation
brain-tumor-segmentation-master/src/loss.py
import torch def dice_loss(pred, target, epsilon=1e-7, use_sigmoid=True): pred = pred.contiguous() if use_sigmoid: pred = torch.sigmoid(pred) target = target.contiguous() intersection = (pred * target).sum(dim=2).sum(dim=2) loss = (1 - ((2. * intersection + epsilon) / (pred.sum(dim=2).sum(d...
392
38.3
120
py
brain-tumor-segmentation
brain-tumor-segmentation-master/src/datasets.py
from torch.utils.data import Dataset from src.utils.data import get_data_if_needed, convert_landmark_to_bounding_box from torchvision.transforms import ToPILImage import os import math import hdf5storage from enum import Enum class ClassesLabels(Enum): Meningioma = 1 Glioma = 2 Pituitary = 3 def __le...
5,862
41.79562
136
py
brain-tumor-segmentation
brain-tumor-segmentation-master/src/models.py
import torch import torch.nn as nn class PreActivateDoubleConv(nn.Module): def __init__(self, in_channels, out_channels): super(PreActivateDoubleConv, self).__init__() self.double_conv = nn.Sequential( nn.BatchNorm2d(in_channels), nn.ReLU(inplace=True), nn.Conv2...
8,616
35.205882
89
py
brain-tumor-segmentation
brain-tumor-segmentation-master/src/metrics.py
import torch def dice_coeff(pred, target, threshold=0.5, epsilon=1e-6, use_sigmoid = True): # make sure the tensors are align in memory and convert to probabilities if needed pred = pred.contiguous() if use_sigmoid: pred = torch.sigmoid(pred) target = target.contiguous() pred = (pred > thr...
528
39.692308
112
py
brain-tumor-segmentation
brain-tumor-segmentation-master/src/.ipynb_checkpoints/models-checkpoint.py
import torch import torch.nn as nn import torch.nn.functional as F def freeze(layer): for p in layer.parameters(): p.requires_grad = False class DoubleConv(nn.Module): def __init__(self, in_channels, out_channels): super(DoubleConv, self).__init__() self.double_conv = nn.Sequen...
4,633
33.325926
89
py
brain-tumor-segmentation
brain-tumor-segmentation-master/cs236605/dataloader_utils.py
import torch from torch.utils.data import DataLoader def flatten(dataloader: DataLoader): """ Combines batches from a DataLoader into a single tensor. If there are multiple tensors returned in each batch, they will be flattened separately, returning multiple tensors. For example, if the DataLoade...
1,518
32.021739
78
py
brain-tumor-segmentation
brain-tumor-segmentation-master/cs236605/plot.py
import math import itertools import numpy as np import matplotlib.pyplot as plt from .train_results import FitResult def tensors_as_images(tensors, nrows=1, figsize=(8, 8), titles=[], wspace=0.1, hspace=0.2, cmap=None): """ Plots a sequence of pytorch tensors as images. :param tens...
3,796
29.134921
77
py
brain-tumor-segmentation
brain-tumor-segmentation-master/cs236605/tests/test_dataloader_utils.py
import pytest import torch from torch.utils.data import DataLoader, Dataset import cs236605.dataloader_utils as dl_utils DATASET_SIZE = 1000 DATA_SIZE = 100 class TestFlatten(object): def test_tensor(self): loader = DataLoader(TensorDataset(), batch_size=256) x, = dl_utils.flatten(loader) ...
1,891
26.42029
89
py
rlgraph
rlgraph-master/setup.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2,803
35.894737
92
py
rlgraph
rlgraph-master/docs/conf.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
6,367
31
103
py
rlgraph
rlgraph-master/rlgraph/__init__.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
5,253
30.088757
114
py
rlgraph
rlgraph-master/rlgraph/spaces/box_space.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
11,258
43.856574
117
py
rlgraph
rlgraph-master/rlgraph/spaces/space_utils.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
30,509
45.0181
121
py
rlgraph
rlgraph-master/rlgraph/agents/agent.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
36,445
47.986559
120
py
rlgraph
rlgraph-master/rlgraph/agents/sac_agent.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
30,786
45.788754
145
py
rlgraph
rlgraph-master/rlgraph/agents/ppo_agent.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
32,237
51.676471
166
py
rlgraph
rlgraph-master/rlgraph/tests/test_util.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
5,848
35.329193
115
py
rlgraph
rlgraph-master/rlgraph/tests/component_test.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
10,766
38.877778
118
py
rlgraph
rlgraph-master/rlgraph/tests/core/test_pytorch_backend.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
13,266
41.251592
118
py
rlgraph
rlgraph-master/rlgraph/tests/core/test_pytorch_util.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
1,962
34.053571
121
py
rlgraph
rlgraph-master/rlgraph/tests/agent_functionality/test_all_compile.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
8,675
38.981567
113
py
rlgraph
rlgraph-master/rlgraph/tests/components/test_neural_networks_keras_style_assembly.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
14,792
50.186851
131
py
rlgraph
rlgraph-master/rlgraph/tests/performance/test_backends.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3,420
32.871287
88
py
rlgraph
rlgraph-master/rlgraph/components/component.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
68,049
48.133574
182
py
rlgraph
rlgraph-master/rlgraph/components/neural_networks/variational_auto_encoder.py
# Copyright 2018/2019 ducandu GmbH. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
4,242
39.798077
104
py
rlgraph
rlgraph-master/rlgraph/components/neural_networks/neural_network.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
23,282
49.070968
120
py
rlgraph
rlgraph-master/rlgraph/components/neural_networks/stack.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
11,095
52.090909
119
py
rlgraph
rlgraph-master/rlgraph/components/neural_networks/sac/sac_networks.py
# Copyright 2018/2019 The RLgraph authors, 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3,864
42.920455
100
py
rlgraph
rlgraph-master/rlgraph/components/distributions/normal.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2,673
39.515152
106
py
rlgraph
rlgraph-master/rlgraph/components/distributions/squashed_normal.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
7,295
39.533333
118
py
rlgraph
rlgraph-master/rlgraph/components/distributions/gumbel_softmax.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
4,234
39.333333
113
py
rlgraph
rlgraph-master/rlgraph/components/distributions/joint_cumulative_distribution.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
8,335
46.908046
131
py
rlgraph
rlgraph-master/rlgraph/components/distributions/beta.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3,718
38.56383
106
py
rlgraph
rlgraph-master/rlgraph/components/distributions/distribution.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
9,476
39.5
188
py
rlgraph
rlgraph-master/rlgraph/components/distributions/multivariate_normal.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
3,744
45.234568
117
py
rlgraph
rlgraph-master/rlgraph/components/distributions/categorical.py
# Copyright 2018/2019 The RLgraph authors. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
2,100
38.641509
109
py