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
DeeBERT
DeeBERT-master/examples/run_tf_glue.py
import os import tensorflow as tf import tensorflow_datasets from transformers import BertTokenizer, TFBertForSequenceClassification, BertConfig, glue_convert_examples_to_features, BertForSequenceClassification, glue_processors # script parameters BATCH_SIZE = 32 EVAL_BATCH_SIZE = BATCH_SIZE * 2 USE_XLA = False USE_AM...
3,978
41.329787
166
py
DeeBERT
DeeBERT-master/examples/run_multiple_choice.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,296
50.945035
168
py
DeeBERT
DeeBERT-master/examples/contrib/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,742
42.785714
111
py
DeeBERT
DeeBERT-master/examples/contrib/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...
31,683
45.731563
154
py
DeeBERT
DeeBERT-master/examples/contrib/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,471
48.731959
132
py
DeeBERT
DeeBERT-master/examples/contrib/run_camembert.py
from pathlib import Path import tarfile import urllib.request import torch from transformers.tokenization_camembert import CamembertTokenizer from transformers.modeling_camembert import CamembertForMaskedLM def fill_mask(masked_input, model, tokenizer, topk=5): # Adapted from https://github.com/pytorch/fairseq/...
2,015
40.142857
114
py
DeeBERT
DeeBERT-master/examples/distillation/grouped_batch_sampler.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,368
40.216981
125
py
DeeBERT
DeeBERT-master/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
DeeBERT
DeeBERT-master/examples/distillation/lm_seqs_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...
5,453
34.881579
111
py
DeeBERT
DeeBERT-master/examples/distillation/run_squad_w_distillation.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...
33,733
55.129784
151
py
DeeBERT
DeeBERT-master/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...
13,598
45.731959
135
py
DeeBERT
DeeBERT-master/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...
25,933
46.848708
163
py
DeeBERT
DeeBERT-master/examples/distillation/scripts/extract.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...
4,326
47.077778
158
py
DeeBERT
DeeBERT-master/examples/distillation/scripts/extract_distilbert.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...
4,255
50.277108
158
py
DeeBERT
DeeBERT-master/templates/adding_a_new_model/modeling_xxx.py
# coding=utf-8 # Copyright 2018 XXX 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 applicable law or agreed ...
34,579
51.473445
151
py
DeeBERT
DeeBERT-master/templates/adding_a_new_model/convert_xxx_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 applicable...
2,565
37.878788
100
py
DeeBERT
DeeBERT-master/templates/adding_a_new_model/modeling_tf_xxx.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,575
53.605941
193
py
DeeBERT
DeeBERT-master/templates/adding_a_new_model/tests/modeling_xxx_test.py
# coding=utf-8 # Copyright 2018 XXX 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 applicable law or agreed...
11,628
44.425781
160
py
DeeBERT
DeeBERT-master/templates/adding_a_new_example_script/run_xxx.py
# coding=utf-8 # Copyright 2018 XXX. 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...
30,654
53.741071
151
py
DeeBERT
DeeBERT-master/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 applicable...
15,827
49.893891
472
py
DeeBERT
DeeBERT-master/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...
7,658
44.052941
134
py
DeeBERT
DeeBERT-master/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 used a...
7,085
53.507692
135
py
DeeBERT
DeeBERT-master/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,830
50.822967
296
py
DeeBERT
DeeBERT-master/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 a cop...
12,356
41.610345
166
py
DeeBERT
DeeBERT-master/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...
39,452
49.710797
201
py
DeeBERT
DeeBERT-master/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 License...
32,228
49.834385
193
py
DeeBERT
DeeBERT-master/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 Lice...
36,425
45.820051
193
py
DeeBERT
DeeBERT-master/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 applicable...
36,704
70.970588
472
py
DeeBERT
DeeBERT-master/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...
44,706
51.596471
472
py
DeeBERT
DeeBERT-master/transformers/modeling_highway_bert.py
import torch from torch import nn from torch.nn import CrossEntropyLoss, MSELoss from .modeling_bert import BertLayer, BertLayerNorm, BertPreTrainedModel def entropy(x): # x: torch.Tensor, logits BEFORE softmax x = torch.softmax(x, dim=-1) # softmax normalized prob distribution return -torc...
22,285
48.414634
150
py
DeeBERT
DeeBERT-master/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 License...
30,118
49.535235
193
py
DeeBERT
DeeBERT-master/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...
67,826
52.239403
187
py
DeeBERT
DeeBERT-master/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...
34,421
49.920118
148
py
DeeBERT
DeeBERT-master/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...
31,203
48.687898
148
py
DeeBERT
DeeBERT-master/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 applicable...
3,074
39.460526
111
py
DeeBERT
DeeBERT-master/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 a cop...
22,329
51.789598
193
py
DeeBERT
DeeBERT-master/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 applicable...
8,486
45.889503
188
py
DeeBERT
DeeBERT-master/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...
22,451
43.636183
183
py
DeeBERT
DeeBERT-master/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 applicable...
5,518
45.771186
121
py
DeeBERT
DeeBERT-master/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 # # htt...
5,775
39.111111
120
py
DeeBERT
DeeBERT-master/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 Lice...
8,325
46.306818
110
py
DeeBERT
DeeBERT-master/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...
57,790
50.92363
193
py
DeeBERT
DeeBERT-master/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 applicable...
3,161
40.605263
118
py
DeeBERT
DeeBERT-master/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 of the...
17,760
59.411565
217
py
DeeBERT
DeeBERT-master/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 applicable...
3,235
37.52381
117
py
DeeBERT
DeeBERT-master/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 # # Un...
39,276
49.942931
193
py
DeeBERT
DeeBERT-master/transformers/modeling_beam_search.py
# coding=utf-8 # Copyright (c) 2019 Yang Liu # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publi...
10,385
37.183824
100
py
DeeBERT
DeeBERT-master/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...
11,692
34.978462
144
py
DeeBERT
DeeBERT-master/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 # # h...
24,528
47.380671
151
py
DeeBERT
DeeBERT-master/transformers/__init__.py
__version__ = "2.1.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.logging...
10,661
58.898876
128
py
DeeBERT
DeeBERT-master/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 a cop...
55,995
51.283847
193
py
DeeBERT
DeeBERT-master/transformers/modeling_highway_roberta.py
from __future__ import (absolute_import, division, print_function, unicode_literals) import torch import torch.nn as nn from torch.nn import CrossEntropyLoss, MSELoss from .modeling_roberta import RobertaEmbeddings from .modeling_highway_bert import BertModel, BertPreTrainedModel, entropy, Hig...
9,356
50.983333
139
py
DeeBERT
DeeBERT-master/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 applicable...
2,577
38.060606
101
py
DeeBERT
DeeBERT-master/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.apache.or...
37,652
48.674142
201
py
DeeBERT
DeeBERT-master/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 applicable...
4,478
33.19084
115
py
DeeBERT
DeeBERT-master/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...
41,005
44.012075
157
py
DeeBERT
DeeBERT-master/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 applicable...
4,334
40.285714
126
py
DeeBERT
DeeBERT-master/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...
74,020
52.252518
169
py
DeeBERT
DeeBERT-master/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...
46,645
50.542541
163
py
DeeBERT
DeeBERT-master/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 a cop...
26,511
51.812749
472
py
DeeBERT
DeeBERT-master/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 # # h...
24,667
48.139442
146
py
DeeBERT
DeeBERT-master/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,824
36.62931
133
py
DeeBERT
DeeBERT-master/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
DeeBERT
DeeBERT-master/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 applicable...
15,133
61.02459
215
py
DeeBERT
DeeBERT-master/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...
30,485
53.634409
151
py
DeeBERT
DeeBERT-master/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 # # ...
55,072
50.422035
372
py
DeeBERT
DeeBERT-master/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,700
38.912844
94
py
DeeBERT
DeeBERT-master/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,975
35.292683
120
py
DeeBERT
DeeBERT-master/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,855
39.81106
124
py
DeeBERT
DeeBERT-master/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 ...
11,393
41.834586
143
py
DeeBERT
DeeBERT-master/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...
35,615
42.593635
137
py
DeeBERT
DeeBERT-master/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,263
42.510204
122
py
DeeBERT
DeeBERT-master/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 ...
18,964
50.256757
235
py
DeeBERT
DeeBERT-master/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 applicable...
1,960
35.314815
77
py
DeeBERT
DeeBERT-master/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,670
43.178808
143
py
DeeBERT
DeeBERT-master/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,578
42.519403
131
py
DeeBERT
DeeBERT-master/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 ...
10,800
43.632231
152
py
DeeBERT
DeeBERT-master/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 required by ...
9,856
43.201794
151
py
DeeBERT
DeeBERT-master/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 required by ...
8,483
37.917431
104
py
DeeBERT
DeeBERT-master/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 law or ag...
21,957
44.556017
140
py
DeeBERT
DeeBERT-master/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 ...
13,845
41.472393
171
py
DeeBERT
DeeBERT-master/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 ...
10,296
40.353414
135
py
DeeBERT
DeeBERT-master/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 required by a...
8,667
39.12963
135
py
mvksc-rkm
mvksc-rkm-main/kernels.py
import concurrent import copy from abc import ABC, abstractmethod from concurrent.futures.thread import ThreadPoolExecutor from typing import Callable, List import numpy as np import scipy as sp import torch from torch import nn from torch.nn import Parameter Tensor = torch.Tensor def kernel_factory(name: str, param:...
4,124
33.090909
108
py
mvksc-rkm
mvksc-rkm-main/ksc.py
import socket import time from argparse import Namespace from datetime import datetime from functools import partial from typing import List import scipy.sparse.linalg import torch import os from definitions import OUT_DIR from utils import my_sign import utils from dataloader import get_dataloader, get_dataset os.envi...
7,621
40.423913
271
py
mvksc-rkm
mvksc-rkm-main/mvksclssvm.py
import socket import time from argparse import Namespace from datetime import datetime from functools import partial import scipy.sparse.linalg import os from definitions import OUT_DIR from mvkscrkm import omega_mv, degree_matrix, centered_omegas, codebook, compute_alphaCenters, closest_code, assign_uncoupled, assign_...
6,512
41.019355
157
py
mvksc-rkm
mvksc-rkm-main/definitions.py
import os from wcmatch import pathlib import torch import sys import numpy as np torch.cuda.empty_cache() Tensor = torch.Tensor device = torch.device("cpu") TensorType = torch.FloatTensor if "dataset=reuters" in sys.argv else torch.DoubleTensor torch.set_default_tensor_type(TensorType) ROOT_DIR = pathlib.Path(os.path...
544
33.0625
95
py
mvksc-rkm
mvksc-rkm-main/mvkscrkm.py
import socket import time from argparse import Namespace from typing import List import scipy.sparse.linalg import torch import os import definitions from definitions import OUT_DIR from utils import my_sign import utils from dataloader import get_dataloader, get_dataset os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE" from k...
11,411
39.183099
149
py
mvksc-rkm
mvksc-rkm-main/dataloader.py
import math import os from argparse import Namespace from typing import List import numpy as np import scipy.io import torch import torchvision from torch.utils.data import Dataset, DataLoader, SubsetRandomSampler from torchvision import datasets, transforms from definitions import DATA_DIR, device, TensorType, Tensor ...
16,212
40.359694
198
py
mvksc-rkm
mvksc-rkm-main/utils.py
import collections import logging import sys from datetime import datetime from torch.utils.data import Dataset import numpy as np import utils def merge_two_dicts(x, y): # In case of same key, it keeps the value of y return {**x, **y} def merge_dicts(list_of_dicts): from functools import reduce ret...
3,385
37.044944
139
py
mvksc-rkm
mvksc-rkm-main/metrics.py
from functools import partial import numpy as np from sklearn.metrics.cluster import adjusted_rand_score, normalized_mutual_info_score from sklearn.metrics.cluster._unsupervised import check_number_of_labels from sklearn.metrics.pairwise import cosine_similarity from sklearn.metrics import silhouette_score, calinski_ha...
6,726
40.524691
179
py
more
more-main/more_main.py
import argparse from collections import defaultdict import math import time from constants import ( COLOR_MEAN, COLOR_STD, DEPTH_MEAN, DEPTH_STD, GRASP_Q_GRASP_THRESHOLD, GRASP_Q_PUSH_THRESHOLD, GRIPPER_GRASP_WIDTH_PIXEL, GRIPPER_PUSH_RADIUS_PIXEL, IMAGE_PAD_WIDTH, IS_REAL, M...
20,203
35.143113
155
py
more
more-main/lifelong_trainer.py
import numpy as np import utils import torch from models import PushNet, reinforcement_net from dataset import LifelongDataset import argparse import time import datetime import cv2 from torchvision.transforms import ToPILImage import os from constants import ( GRIPPER_GRASP_INNER_DISTANCE, GRIPPER_GRASP_INNER_...
17,323
38.825287
112
py
more
more-main/ppn_main.py
import argparse from collections import defaultdict import math import time from constants import ( COLOR_MEAN, COLOR_STD, DEPTH_MEAN, DEPTH_STD, GRASP_Q_GRASP_THRESHOLD, GRIPPER_GRASP_WIDTH_PIXEL, GRIPPER_PUSH_RADIUS_PIXEL, IMAGE_PAD_WIDTH, IS_REAL, NUM_ROTATION, PIXEL_SIZE,...
20,013
36.270019
155
py
more
more-main/train_maskrcnn.py
import torch import torchvision from dataset import SegmentationDataset import log_utils import torch_utils import datetime import argparse import time import os from vision.coco_utils import get_coco_api_from_dataset from vision.coco_eval import CocoEvaluator import vision.transforms as T import math from torchvision....
12,144
36.254601
168
py
more
more-main/collect_train_grasp_data.py
import numpy as np import time import cv2 import utils import datetime import os import glob import argparse from threading import Thread import pybullet as p import torch from trainer import Trainer from constants import ( TARGET_LOWER, TARGET_UPPER, DEPTH_MIN, PUSH_DISTANCE, NUM_ROTATION, GRA...
67,276
46.646601
179
py
more
more-main/dataset.py
from torch.utils.data.sampler import Sampler import os import math import re import numpy as np import torch import torch.utils.data import cv2 import imutils from torchvision.transforms import functional as TF from PIL import Image import random from constants import ( IMAGE_OBJ_CROP_SIZE, IMAGE_SIZE, WORK...
59,575
39.973865
139
py
more
more-main/old_utils.py
from collections import defaultdict, deque import time import datetime import torch.distributed as dist import torch import torch.nn as nn import torch.nn.functional as F # Cross entropy loss for 2D outputs class CrossEntropyLoss2d(nn.Module): def __init__(self, weight=None, size_average=True): super(Cros...
9,084
31.216312
112
py
more
more-main/train_push_prediction.py
import torch from torchvision import transforms as T from push_net import PushPredictionNet from dataset import PushPredictionMultiDataset, ClusterRandomSampler import argparse import time import datetime import os import numpy as np import cv2 from torch.utils.tensorboard import SummaryWriter from constants import ( ...
44,879
38.402985
170
py
more
more-main/torch_utils.py
import torch import torch.distributed as dist def warmup_lr_scheduler(optimizer, warmup_iters, warmup_factor): """ https://github.com/pytorch/vision/blob/master/references/detection/utils.py """ def f(x): if x >= warmup_iters: return 1 alpha = float(x) / warmup_iters ...
1,845
27.4
80
py