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
SMedBERT
SMedBERT-main/pytorch_pretrained_bert/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...
12,271
40.459459
139
py
SMedBERT
SMedBERT-main/pytorch_pretrained_bert/modeling.py
# coding=utf-8 # dsafdsafdsa # 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 ma...
132,631
54.751156
233
py
SMedBERT
SMedBERT-main/pytorch_pretrained_bert/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...
9,207
32.483636
112
py
SMedBERT
SMedBERT-main/pytorch_pretrained_bert/attention.py
import enum import math import copy import json import torch import torch.nn as nn # from torch_geometric.nn import GraphConv,AGNNConv,FastRGCNConv,RGCNConv,DNAConv from torch.nn.utils.rnn import pack_sequence, pad_packed_sequence # from apex.normalization import FusedLayerNorm def attention(query, key, value, mask=No...
10,999
42.478261
108
py
SMedBERT
SMedBERT-main/transformers/modeling_encoder_decoder.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 a...
16,137
24.987118
472
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_albert.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 L...
40,503
24.522369
193
py
SMedBERT
SMedBERT-main/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/license...
9,084
25.79941
134
py
SMedBERT
SMedBERT-main/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( "This command line utility let you convert original (author released) model checkpoint to pytorch.\n" "It should be ...
7,214
26.857143
135
py
SMedBERT
SMedBERT-main/transformers/configuration_utils_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...
11,365
25.618267
296
py
SMedBERT
SMedBERT-main/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...
11,363
25.738824
296
py
SMedBERT
SMedBERT-main/transformers/optimization_tf.py
# Copyright 2019 The TensorFlow 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...
10,082
18.80943
155
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_pytorch_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...
12,757
20.808547
166
py
SMedBERT
SMedBERT-main/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.ap...
40,520
24.991661
201
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_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 L...
32,884
24.955012
193
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_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...
37,204
22.926045
193
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_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 a...
37,941
35.377756
472
py
SMedBERT
SMedBERT-main/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...
46,390
25.95584
472
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_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 L...
30,715
24.790092
193
py
SMedBERT
SMedBERT-main/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...
86,962
31.460993
187
py
SMedBERT
SMedBERT-main/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 L...
35,117
24.994078
148
py
SMedBERT
SMedBERT-main/transformers/convert_albert_original_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 a...
2,663
19.030075
103
py
SMedBERT
SMedBERT-main/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 L...
31,920
24.354249
148
py
SMedBERT
SMedBERT-main/transformers/convert_gpt2_original_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 a...
3,149
19.860927
111
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_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...
22,767
25.944379
193
py
SMedBERT
SMedBERT-main/transformers/convert_roberta_original_pytorch_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 a...
8,666
23.00831
188
py
SMedBERT
SMedBERT-main/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/license...
22,953
21.839801
183
py
SMedBERT
SMedBERT-main/transformers/convert_transfo_xl_original_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 a...
5,635
22.982979
121
py
SMedBERT
SMedBERT-main/transformers/configuration_ctrl.py
# coding=utf-8 # Copyright 2018 Salesforce 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 at # # ...
5,918
19.623693
120
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_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...
8,504
23.230769
110
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_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...
60,836
51.220601
193
py
SMedBERT
SMedBERT-main/transformers/convert_openai_original_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 a...
3,236
20.437086
118
py
SMedBERT
SMedBERT-main/transformers/modeling_camembert.py
# coding=utf-8 # Copyright 2019 Inria, Facebook AI Research 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 copy ...
18,053
29.756388
217
py
SMedBERT
SMedBERT-main/transformers/convert_xlm_original_pytorch_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 a...
3,318
18.874251
117
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_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...
40,046
24.98767
193
py
SMedBERT
SMedBERT-main/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 impor...
13,210
17.899857
144
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_ctrl.py
# coding=utf-8 # Copyright 2018 Salesforce 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 at # ...
25,054
23.733465
151
py
SMedBERT
SMedBERT-main/transformers/__init__.py
__version__ = "2.2.1" # Work around to update TensorFlow's absl.logging threshold which alters the # default Python logging output behavior when present. # see: https://github.com/abseil/abseil-py/issues/99 # and: https://github.com/tensorflow/tensorflow/issues/26691#issuecomment-500369493 try: import absl....
11,975
29.945736
128
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_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...
57,109
25.674451
193
py
SMedBERT
SMedBERT-main/transformers/convert_bert_original_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 a...
2,642
19.175573
101
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_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.ap...
41,430
24.717567
201
py
SMedBERT
SMedBERT-main/transformers/convert_bert_pytorch_checkpoint_to_original_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 a...
4,608
16.659004
115
py
SMedBERT
SMedBERT-main/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...
41,915
22.018122
157
py
SMedBERT
SMedBERT-main/transformers/convert_xlnet_original_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 a...
4,438
20.239234
126
py
SMedBERT
SMedBERT-main/transformers/modeling_albert.py
# coding=utf-8 # Copyright 2018 Google AI, Google Brain 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-...
40,592
24.323144
171
py
SMedBERT
SMedBERT-main/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...
82,665
26.582916
169
py
SMedBERT
SMedBERT-main/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...
47,549
25.28524
163
py
SMedBERT
SMedBERT-main/transformers/modeling_tf_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...
27,528
25.701261
472
py
SMedBERT
SMedBERT-main/transformers/modeling_ctrl.py
# coding=utf-8 # Copyright 2018 Salesforce 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 at # ...
25,310
24.185075
146
py
SMedBERT
SMedBERT-main/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...
22,391
18.522232
133
py
SMedBERT
SMedBERT-main/transformers/file_utils_bert.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 impor...
13,205
17.892704
144
py
SMedBERT
SMedBERT-main/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...
13,898
19.963801
132
py
SMedBERT
SMedBERT-main/transformers/convert_pytorch_checkpoint_to_tf2.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 a...
15,807
30.806841
215
py
SMedBERT
SMedBERT-main/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...
31,042
26.841256
151
py
SMedBERT
SMedBERT-main/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...
60,557
25.677533
372
py
SMedBERT
SMedBERT-main/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 req...
8,975
19.446469
94
py
SMedBERT
SMedBERT-main/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 req...
2,964
17.190184
90
py
SMedBERT
SMedBERT-main/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 req...
9,163
19.970252
124
py
SMedBERT
SMedBERT-main/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 req...
11,690
20.852336
143
py
SMedBERT
SMedBERT-main/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 ...
37,341
21.240619
137
py
SMedBERT
SMedBERT-main/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 req...
4,296
21.035897
122
py
SMedBERT
SMedBERT-main/transformers/tests/modeling_albert_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 req...
11,132
22.14553
163
py
SMedBERT
SMedBERT-main/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 req...
19,305
24.983849
235
py
SMedBERT
SMedBERT-main/transformers/tests/utils.py
import os import unittest from distutils.util import strtobool from transformers.file_utils import _tf_available, _torch_available try: run_slow = os.environ["RUN_SLOW"] except KeyError: # RUN_SLOW isn't set, default to skipping slow tests. _run_slow_tests = False else: # RUN_SLOW is s...
1,662
11.891473
76
py
SMedBERT
SMedBERT-main/transformers/tests/modeling_encoder_decoder_test.py
# coding=utf-8 # Copyright 2018 The Hugging Face 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...
1,983
17.895238
77
py
SMedBERT
SMedBERT-main/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 req...
6,812
21.634551
143
py
SMedBERT
SMedBERT-main/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 req...
18,266
21.862328
137
py
SMedBERT
SMedBERT-main/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 req...
11,205
21.822811
152
py
SMedBERT
SMedBERT-main/transformers/tests/modeling_tf_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 req...
10,037
21.659142
151
py
SMedBERT
SMedBERT-main/transformers/tests/modeling_tf_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 req...
8,659
19
104
py
SMedBERT
SMedBERT-main/transformers/tests/modeling_tf_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 ...
14,623
21.814353
134
py
SMedBERT
SMedBERT-main/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 req...
14,334
20.752656
171
py
SMedBERT
SMedBERT-main/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 req...
10,636
20.231537
135
py
SMedBERT
SMedBERT-main/transformers/tests/modeling_ctrl_test.py
# coding=utf-8 # Copyright 2018 Salesforce and 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 requi...
8,938
19.644342
135
py
SMedBERT
SMedBERT-main/transformers/__pycache__/modeling_utils_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...
46,368
25.911782
472
py
KeypointNet
KeypointNet-master/benchmark_scripts/test.py
from utils import load_geodesics import hydra import omegaconf import logging logger = logging.getLogger(__name__) import os import torch import numpy as np import importlib import dataset from utils import ModelWrapper import torch.nn.functional as F from metrics import eval_iou, eval_map from tqdm import tqdm import ...
4,117
35.442478
152
py
KeypointNet
KeypointNet-master/benchmark_scripts/utils.py
import torch import torch.nn.functional as F import os import pickle from tqdm import tqdm import numpy as np from sklearn import neighbors from sklearn.utils.graph import graph_shortest_path import multiprocessing from dataset import normalize_pc BASEDIR = os.path.dirname(os.path.abspath(__file__)) class AverageMete...
3,323
31.910891
185
py
KeypointNet
KeypointNet-master/benchmark_scripts/dataset.py
import numpy as np from glob import glob import os import torch import json from scipy.stats import special_ortho_group from sklearn.metrics import pairwise_distances_argmin BASEDIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..') ID2NAMES = {"02691156": "airplane", "02808440": "bathtub", ...
8,204
38.258373
186
py
KeypointNet
KeypointNet-master/benchmark_scripts/train.py
import os import hydra import torch import logging logger = logging.getLogger(__name__) import omegaconf import importlib from tqdm import tqdm from utils import AverageMeter, ModelWrapper import dataset import utils def train(cfg): KeypointDataset = getattr(dataset, 'Keypoint{}Dataset'.format(cfg.task.capitaliz...
2,768
29.428571
152
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/dgcnn.py
import torch import torch as t import torch.nn as nn import torch.nn.functional as F import numpy as np def knn(x, k): inner = -2 * t.matmul(x.transpose(2, 1), x) xx = t.sum(x ** 2, dim=1, keepdim=True) pairwise_distance = -xx - inner - xx.transpose(2, 1) idx = pairwise_distance.topk(k=k, dim=-1)[1] ...
6,310
34.655367
180
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/pointnet.py
import torch import torch.nn as nn import torch.nn.parallel import torch.utils.data from torch.autograd import Variable import numpy as np import torch.nn.functional as F class STN3d(nn.Module): def __init__(self): super(STN3d, self).__init__() self.conv1 = torch.nn.Conv1d(3, 64, 1) self.c...
7,343
31.64
128
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/pointnet2.py
import torch import torch.nn as nn from .pointnet2_utils import etw_pytorch_utils as pt_utils from collections import namedtuple import torch.nn.functional as F from .pointnet2_utils import utils as pointnet2_utils class _PointnetSAModuleBase(nn.Module): def __init__(self): super(_PointnetSAModuleBase, se...
10,919
32.394495
112
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/spidercnn.py
import os, sys import torch import torch.nn as nn import torch.nn.functional as F from .spidercnn_utils import utils as pt_utils import os, sys def _knn_indices(feat, k, centroid=None, dist=False): ''' feat : B x C x N centroid : B x C x n dist : whether return dist value k : int return ...
8,346
31.478599
103
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/pointconv.py
import torch import torch.nn as nn import torch.nn.functional as F from time import time import numpy as np from sklearn.neighbors.kde import KernelDensity def timeit(tag, t): print("{}: {}s".format(tag, time() - t)) return time() def square_distance(src, dst): """ Calculate Euclid distance between ...
21,470
38.46875
147
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/graphcnn.py
import warnings warnings.simplefilter("ignore", UserWarning) import torch import torch.nn as nn import numpy as np import torch.nn.functional as F import scipy from sklearn import neighbors from torch.autograd import Variable class my_sparse_mm(torch.autograd.Function): """ Implementation of a new autograd fu...
7,218
30.251082
128
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/rscnn.py
import os, sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) sys.path.append(os.path.join(BASE_DIR, "../utils")) import torch import torch.nn as nn from torch.autograd import Variable from .rscnn_utils import pytorch_utils as pt_utils from .rscnn_utils.pointnet2_modules import Pointne...
6,112
35.386905
112
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/rsnet.py
import torch import torch.nn as nn import math import torch.nn.functional as F from torch.autograd import Variable import numpy as np #-- slice processing utils def gen_slice_idx(data, resolution, axis=2): indices = np.zeros(( data.shape[0], data.shape[2] )) for n in range(data.shape[0]): indices[n] ...
9,278
42.768868
236
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/rscnn_utils/pointnet2_utils.py
import torch from torch.autograd import Variable from torch.autograd import Function import torch.nn.functional as F import torch.nn as nn from collections import namedtuple from . import pytorch_utils as pt_utils from typing import List, Tuple import rscnn_ops._ext as _ext class RandomDropout(nn.Module): def _...
11,947
26.850816
103
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/rscnn_utils/pointnet2_modules.py
import torch import torch.nn as nn from . import pointnet2_utils from . import pytorch_utils as pt_utils from typing import List import math class _PointnetSAModuleBase(nn.Module): def __init__(self): super().__init__() self.npoint = None self.groupers = None self.mlps = None ...
9,293
33.422222
176
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/rscnn_utils/pytorch_utils.py
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from torch.autograd.function import InplaceFunction from itertools import repeat import numpy as np import shutil, os from typing import List, Tuple from scipy.stats import t as student_t import statistics as stats im...
22,600
28.466754
140
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/rscnn_utils/custom_ops/setup.py
import glob import os.path as osp from setuptools import find_packages, setup from torch.utils.cpp_extension import BuildExtension, CUDAExtension _ext_src_root = osp.join('src_root') _ext_sources = glob.glob(osp.join(_ext_src_root, "csrc", "*.cpp")) + glob.glob( osp.join(_ext_src_root, "csrc", "*.cu") ) _ext_head...
596
28.85
105
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/pointnet2_utils/utils.py
import torch from torch.autograd import Function import torch.nn as nn from . import etw_pytorch_utils as pt_utils import builtins try: import pointnet2._ext as _ext except ImportError: if not getattr(builtins, "__POINTNET2_SETUP__", False): raise ImportError( "Could not import _ext module...
10,160
26.314516
103
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/pointnet2_utils/custom_ops/setup.py
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from setuptools import setup from torch.utils.cpp_extension import BuildExtension, CUDAExtension import glob _ext_src_root = "_ext_src" _ext...
927
28.935484
83
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/pointnet2_utils/etw_pytorch_utils/persistent_dataloader.py
from __future__ import division, absolute_import, with_statement, print_function, unicode_literals import torch import torch.multiprocessing as multiprocessing from torch.utils.data.sampler import (SequentialSampler, RandomSampler, BatchSampler) import signal import collections imp...
16,786
35.572985
98
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/pointnet2_utils/etw_pytorch_utils/sacred_trainer.py
from __future__ import division, absolute_import, with_statement, print_function, unicode_literals import torch import torch.nn as nn import numpy as np import tqdm import sacred import os.path as osp from .pytorch_utils import checkpoint_state if False: # Workaround for type hints without depending on the `typi...
7,292
30.847162
116
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/pointnet2_utils/etw_pytorch_utils/seq.py
from __future__ import division, absolute_import, with_statement, print_function, unicode_literals import torch.nn as nn from .pytorch_utils import (BatchNorm1d, BatchNorm2d, BatchNorm3d, Conv1d, Conv2d, Conv3d, FC) if False: # Workaround for type hints without depending on the `typing...
5,281
28.841808
152
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/pointnet2_utils/etw_pytorch_utils/__init__.py
from __future__ import division, absolute_import, with_statement, print_function, unicode_literals __version__ = '1.1.1' try: __ETW_PT_UTILS_SETUP__ except: __ETW_PT_UTILS_SETUP__ = False if not __ETW_PT_UTILS_SETUP__: from .pytorch_utils import * from .persistent_dataloader import DataLoader from...
360
24.785714
98
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/pointnet2_utils/etw_pytorch_utils/pytorch_utils.py
from __future__ import division, absolute_import, with_statement, print_function, unicode_literals import torch import torch.nn as nn from torch.autograd.function import InplaceFunction from itertools import repeat import numpy as np import shutil import tqdm from scipy.stats import t as student_t import statistics as ...
24,423
30.353017
175
py
KeypointNet
KeypointNet-master/benchmark_scripts/models/spidercnn_utils/utils.py
import torch import torch.nn as nn from torch.autograd import Variable from torch.autograd.function import InplaceFunction from itertools import repeat import numpy as np import shutil, os import tqdm from operator import itemgetter from typing import List, Tuple from scipy.stats import t as student_t import statistics...
24,731
28.869565
140
py
pyGAT
pyGAT-master/utils.py
import numpy as np import scipy.sparse as sp import torch def encode_onehot(labels): # The classes must be sorted before encoding to enable static class encoding. # In other words, make sure the first class always maps to index 0. classes = sorted(list(set(labels))) classes_dict = {c: np.identity(len(...
2,729
34.921053
138
py
pyGAT
pyGAT-master/layers.py
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F class GraphAttentionLayer(nn.Module): """ Simple GAT layer, similar to https://arxiv.org/abs/1710.10903 """ def __init__(self, in_features, out_features, dropout, alpha, concat=True): super(GraphAttentionLaye...
5,074
33.52381
109
py