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
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_gan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_onnx_runti...
3,542
29.282051
107
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_craft.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras, is_tf_keras from keras.applications.vgg16 import VGG16 from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../ke...
6,550
33.298429
107
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_crnn.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from onnxconverter_common.onnx_ex import get_maximum_opset_supported from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__...
9,647
44.084112
118
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_bigan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras, is_tf_keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import r...
4,507
30.305556
168
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_deep_speech.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from onnxconverter_common.onnx_ex import get_maximum_opset_supported from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__...
6,881
39.964286
106
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_pix2pix.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import ru...
5,618
32.446429
168
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_unet.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import keras_segmentation import onnxruntime from os.path import dirname, abspath from mock_keras2onnx.proto import keras, is_keras_older_than from onnxconverter_common.onnx_ex import get_maximum_opset_supported from packaging.version import Ve...
6,020
42.316547
116
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_dcgan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import ru...
4,335
32.353846
107
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_music_generation.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np import tensorflow as tf from onnxconverter_common.onnx_ex import get_maximum_opset_supported from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(...
11,436
33.448795
106
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_deep_speaker.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_keras_and_...
5,827
34.754601
136
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_segnet_2.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras import tensorflow as tf from onnxconverter_common.onnx_ex import get_maximum_opset_supported from os.path import dirname, abspath sys.path.insert(0, os.path.join(...
10,721
37.430108
112
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_fcn.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import keras_segmentation from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_image img_path = os.path.join(os.path.dirname(__file__), '../data...
840
25.28125
87
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_deep_rl.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from keras.initializers import RandomUniform from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_te...
4,790
34.488889
122
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_nonlocal.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath from keras.regularizers import l2 sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) fro...
20,235
37.471483
116
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_mask_rcnn.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx from mock_keras2onnx import set_converter from mock_keras2onnx.proto import keras import onnx import numpy as np from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../kera...
3,410
36.483516
114
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_densenet_1.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import keras_segmentation from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_image img_path = os.path.join(os.path.dirname(__file__), '../dat...
1,202
29.846154
99
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_mlstm_fcn.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath from onnxconverter_common.onnx_ex import get_maximum_opset_supported sys.path.insert(0, os.path.join(dirname(abspath(__file__...
4,770
31.903448
112
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/run_all.py
# SPDX-License-Identifier: Apache-2.0 import os from os import listdir from os.path import isfile, join import argparse parser = argparse.ArgumentParser() parser.add_argument('--exclude') args = parser.parse_args() exclude_set = set(args.exclude.split()) if args.exclude is not None else set() os.environ["PYTHONPATH"...
918
26.848485
108
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_keras_applications_v2.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest from mock_keras2onnx.proto import keras from mock_keras2onnx.proto.tfcompat import is_tf2 from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_i...
2,691
33.512821
87
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_ssrnet.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import onnx import numpy as np from mock_keras2onnx.proto import keras from keras.applications import VGG19 from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onn...
9,524
41.333333
131
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_lsgan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import ru...
3,548
29.076271
107
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_yolov3.py
# SPDX-License-Identifier: Apache-2.0 import os from os.path import dirname, abspath import numpy as np import unittest import sys sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../yolov3')) from keras.models import ...
4,362
39.027523
165
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_pixelda.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import keras_contrib import numpy as np from mock_keras2onnx import set_converter from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '....
5,796
31.027624
119
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_image_outpainting.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx from mock_keras2onnx import set_converter import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests...
5,915
32.805714
116
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_wgan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import ru...
4,302
31.353383
107
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_pspnet.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import keras import keras_segmentation import numpy as np from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_image img_path = os.path.join(os....
3,344
36.58427
108
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_nlp.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras, is_tensorflow_older_than from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_u...
8,385
42.450777
156
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_dual_path_network.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from keras.regularizers import l2 from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) fro...
11,171
38.338028
121
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_ocr.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath import tensorflow as tf sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_uti...
10,561
41.58871
112
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_sgan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import onnx import numpy as np from mock_keras2onnx.proto import keras, is_keras_older_than from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from...
4,549
32.703704
107
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_infogan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import ru...
4,941
34.049645
107
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_aae.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras, is_tf_keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import r...
4,067
30.292308
107
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_bgan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras, is_tf_keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import r...
3,634
30.336207
107
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_inception_v4.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import onnx import numpy as np from mock_keras2onnx.proto import keras from keras.applications import VGG19 from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onn...
6,729
26.469388
108
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_cyclegan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import keras_contrib import numpy as np from mock_keras2onnx import set_converter from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '....
6,164
33.060773
192
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_discogan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import keras_contrib import numpy as np from mock_keras2onnx import set_converter from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '....
6,363
33.4
192
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_se_inc_resnet.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from mock_keras2onnx.proto.tfcompat import is_tf2 from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2on...
10,376
35.797872
112
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_densenet_2.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import keras_segmentation from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_image img_path = os.path.join(os.path.dirname(__file__), '../dat...
1,258
29.707317
107
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_open_face.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras, is_tf_keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import r...
15,525
55.871795
129
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_semantic_segmentation.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np import math from onnxconverter_common.onnx_ex import get_maximum_opset_supported from mock_keras2onnx.proto import keras from keras.initializers import RandomNormal from os.path import dirname, abspath ...
82,051
36.552403
149
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_acgan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import ru...
5,263
34.093333
168
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_cogan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import ru...
4,356
30.572464
107
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/run_all_v2.py
# SPDX-License-Identifier: Apache-2.0 import os os.environ["PYTHONPATH"] = \ os.environ.get("PYTHONPATH", "") + os.pathsep + "../../keras2onnx_unit_tests" + os.pathsep + "../../../" os.environ["TF2ONNX_CATCH_ERRORS"] = "FALSE" files = ['test_keras_applications_v2.py', 'test_transformers.py', 'test_chatbot.py', 't...
652
27.391304
108
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_srgan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import onnx import numpy as np from mock_keras2onnx.proto import keras from keras.applications import VGG19 from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onn...
6,736
33.372449
192
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_series_net.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from keras.regularizers import l2 from keras.initializers import TruncatedNormal from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(absp...
4,217
34.445378
120
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_wgan_gp.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import ru...
5,803
32.94152
107
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_transformers.py
# SPDX-License-Identifier: Apache-2.0 import os from os.path import dirname, abspath import unittest import sys sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) import json import urllib.request import pickle import numpy as np import tensorflow as tf from onnxconverter_common....
24,209
51.516269
135
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_efn.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest from os.path import dirname, abspath from mock_keras2onnx.proto import keras, is_tensorflow_older_than sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_image img_path = os.path...
1,491
32.155556
95
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_chatbot.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from mock_keras2onnx.proto.tfcompat import is_tf2 from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2on...
4,426
40.764151
130
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_unet_plus_plus.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import numpy as np import onnxruntime from os.path import dirname, abspath from mock_keras2onnx.proto import keras, is_keras_older_than from keras.applications.vgg16 import VGG16 from onnxconverter_common.onnx_ex import get_maximum_opset_suppor...
5,964
35.820988
113
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_ccgan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import keras_contrib import numpy as np from mock_keras2onnx import set_converter from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '....
5,232
33.202614
131
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_nbeats.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_keras_and_...
10,673
38.680297
116
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_resnext.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from mock_keras2onnx.proto.tfcompat import is_tf2 if is_tf2: def l2(weight_decay): # old keras layer expects a tuple but tf keras wants a single value...
16,488
41.497423
112
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_lipnet.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_keras_and_...
3,930
37.920792
136
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_deeplab_v3.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from onnxconverter_common.onnx_ex import get_maximum_opset_supported from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__...
16,644
42.233766
117
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_nasnet_mobile.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_keras_and_...
16,919
44.12
118
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_autoencoder.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_keras_and_...
4,717
33.948148
123
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_keras_applications.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from onnxconverter_common.onnx_ex import get_maximum_opset_supported from mock_keras2onnx.proto import keras, is_keras_older_than from os.path import dirname, abspath sys.path.insert(0, os.path.join(di...
16,893
42.096939
144
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_resume_parser.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_keras_and_...
6,421
37.22619
123
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_deepface.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import run_onnx_runti...
3,815
37.16
108
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_semantic_embeddings.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras from keras import regularizers from keras.engine import Layer, InputSpec from keras.utils import layer_utils, conv_utils from os.path import dirname, abspath sys....
17,495
37.537445
120
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_applications/nightly_build/test_dualgan.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx import onnx import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests/')) from test_utils import ru...
4,281
30.485294
168
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_unit_tests/test_layers.py
# SPDX-License-Identifier: Apache-2.0 import pytest import numpy as np from mock_keras2onnx.proto.tfcompat import is_tf2, tensorflow as tf from mock_keras2onnx.proto import (keras, is_tf_keras, is_tensorflow_older_than, is_tensorflow_later_than, is_...
115,744
41.289003
229
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_unit_tests/conftest.py
# SPDX-License-Identifier: Apache-2.0 import os import pytest import numpy as np import tensorflow as tf from mock_keras2onnx.proto import keras, is_tf_keras from test_utils import run_onnx_runtime from mock_keras2onnx.proto.tfcompat import is_tf2 K = keras.backend @pytest.fixture(scope='function') def runner(): ...
880
22.184211
74
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_unit_tests/test_subclassing.py
# SPDX-License-Identifier: Apache-2.0 import pytest import mock_keras2onnx import numpy as np import tensorflow as tf from test_utils import convert_keras_for_test as convert_keras from mock_keras2onnx.proto import is_tensorflow_older_than if (not mock_keras2onnx.proto.is_tf_keras) or (not mock_keras2onnx.proto.tfcom...
8,436
34.599156
102
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_unit_tests/test_cgan.py
# SPDX-License-Identifier: Apache-2.0 import pytest import tensorflow as tf import mock_keras2onnx import numpy as np from mock_keras2onnx.proto import keras, is_tf_keras, is_tensorflow_older_than from tf2onnx.keras2onnx_api import convert_keras from packaging.version import Version Activation = keras.layers.Activati...
4,662
34.325758
111
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_unit_tests/test_utils.py
# SPDX-License-Identifier: Apache-2.0 import os import sys import onnx from onnx import helper import numpy as np import mock_keras2onnx from mock_keras2onnx.proto import keras, is_keras_older_than from mock_keras2onnx.proto.tfcompat import is_tf2 from packaging.version import Version from tf2onnx.keras2onnx_api impor...
13,088
37.497059
122
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_unit_tests/mock_keras2onnx/__init__.py
from tf2onnx.keras2onnx_api import convert_keras def set_converter(*args, **kwargs): pass
96
15.166667
48
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_unit_tests/mock_keras2onnx/proto/tfcompat.py
# SPDX-License-Identifier: Apache-2.0 import os import tensorflow as _tf from packaging.version import Version is_tf2 = Version(_tf.__version__.split('-')[0]) >= Version("2.0.0") def normalize_tensor_shape(tensor_shape): if is_tf2: return [d for d in tensor_shape] else: return [d.value for ...
1,292
27.733333
83
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_unit_tests/mock_keras2onnx/proto/__init__.py
# SPDX-License-Identifier: Apache-2.0 import os import tensorflow from packaging.version import Version # Rather than using ONNX protobuf definition throughout our codebase, we import ONNX protobuf definition here so that # we can conduct quick fixes by overwriting ONNX functions without changing any lines elsewhere....
2,109
29.57971
117
py
tensorflow-onnx
tensorflow-onnx-main/tests/keras2onnx_unit_tests/mock_keras2onnx/ke2onnx/batch_norm.py
convert_keras_batch_normalization = None
40
40
40
py
tensorflow-onnx
tensorflow-onnx-main/tests/tfhub/tfhub_mobile_food_segmenter_V1.py
# SPDX-License-Identifier: Apache-2.0 import os import numpy from _tools import generate_random_images, benchmark import tf2onnx import onnxruntime as ort def main(opset=13): url = "https://tfhub.dev/google/seefood/segmenter/mobile_food_segmenter_V1/1?tf-hub-format=compressed" dest = "tf-mobile_food_segmenter...
1,400
30.840909
106
py
tensorflow-onnx
tensorflow-onnx-main/tests/tfhub/tfhub_lambert_en_uncased_L-24_H-1024_A-16.py
# SPDX-License-Identifier: Apache-2.0 import os from collections import OrderedDict import numpy import numpy.random as rnd from _tools import generate_text_inputs, benchmark def main(opset=13): if False: import tensorflow as tf import tensorflow_text import tensorflow_hub as hub ...
1,706
39.642857
123
py
tensorflow-onnx
tensorflow-onnx-main/tests/tfhub/tfhub_resnet_v1_101_keras.py
# SPDX-License-Identifier: Apache-2.0 import os import numpy import onnxruntime as ort import tensorflow as tf import tensorflow_hub as hub import tf2onnx from _tools import generate_random_images, check_discrepencies imgs = generate_random_images(shape=(1, 224, 224, 3), scale=1.) model = tf.keras.Sequential([ hu...
1,201
29.820513
86
py
tensorflow-onnx
tensorflow-onnx-main/tests/tfhub/tfhub_albert_en_xlarge_keras.py
# Adapted the sample code on https://tfhub.dev/tensorflow/albert_en_xlarge/3 import tensorflow_text as text import tensorflow as tf import tensorflow_hub as hub # Using hub.load instead of KerasLayer lets us easily intercept the results of the # preprocessor before passing it to the encoder preprocessor = hub.load("ht...
2,127
37.690909
98
py
tensorflow-onnx
tensorflow-onnx-main/tests/tfhub/tfhub_mobilebert_en_uncased.py
# SPDX-License-Identifier: Apache-2.0 import os from collections import OrderedDict import numpy import numpy.random as rnd from _tools import generate_text_inputs, benchmark def main(opset=13): if False: import tensorflow as tf import tensorflow_text import tensorflow_hub as hub ...
1,308
35.361111
118
py
sherpa
sherpa-master/generate_readme.py
import os welcome_text = """SHERPA: A Python Hyperparameter Optimization Library ==================================================== .. figure:: https://docs.google.com/drawings/d/e/2PACX-1vRaTP5d5WqT4KY4V57niI4wFDkz0098zHTRzZ9n7SzzFtdN5akBd75HchBnhYI-GPv_AYH1zYa0O2_0/pub?w=522&h=150 :figwidth: 100% :align: ...
1,298
36.114286
151
py
sherpa
sherpa-master/sherpa/core.py
""" SHERPA is a Python library for hyperparameter tuning of machine learning models. Copyright (C) 2018 Lars Hertel, Peter Sadowski, and Julian Collado. This file is part of SHERPA. SHERPA is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the...
31,945
36.060325
112
py
sherpa
sherpa-master/sherpa/database.py
""" SHERPA is a Python library for hyperparameter tuning of machine learning models. Copyright (C) 2018 Lars Hertel, Peter Sadowski, and Julian Collado. This file is part of SHERPA. SHERPA is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the...
10,144
36.161172
177
py
sherpa
sherpa-master/examples/parallel-examples/bianchini/bianchini.py
# Train simple network on 2D data. # Author: Peter Sadowski from __future__ import print_function import numpy as np import sherpa from keras.models import Model from keras.layers import Dense, Input from keras.optimizers import SGD def dataset_bianchini(batchsize, k=1): ''' Synthetic data set where we can c...
2,585
31.734177
123
py
sherpa
sherpa-master/examples/parallel-examples/mnistmlp/trial.py
from __future__ import print_function import os os.environ['CUDA_VISIBLE_DEVICES'] = '' import sherpa import keras from keras.models import Model from keras.layers import Dense, Input, Dropout from keras.optimizers import SGD from keras.datasets import mnist def define_model(params): """ Return compiled model...
2,619
30.95122
93
py
sherpa
sherpa-master/examples/parallel-examples/mnistcnnpbt/mnist_cnn.py
'''Trains a simple convnet on the MNIST dataset. Gets to 99.25% test accuracy after 12 epochs (there is still a lot of margin for parameter tuning). 16 seconds per epoch on a GRID K520 GPU. ''' from __future__ import print_function import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import tensorflow as tf CONFIG = tf....
3,873
37.74
109
py
sherpa
sherpa-master/examples/parallel-examples/fashion_mnist_benchmark/fashion_mlp.py
'''Trains a simple deep NN on the MNIST dataset. Gets to 98.40% test accuracy after 20 epochs (there is *a lot* of margin for parameter tuning). 2 seconds per epoch on a K520 GPU. ''' from __future__ import print_function import os import time os.environ['CUDA_VISIBLE_DEVICES'] = '' import sherpa import keras from ker...
2,681
36.25
137
py
sherpa
sherpa-master/tests/test_database.py
import os import pytest import sys import sherpa import sherpa.core import sherpa.schedulers import sherpa.database try: import unittest.mock as mock except ImportError: import mock import logging import time import warnings from testing_utils import * def test_database(test_dir): test_trial = get_test_tr...
3,431
33.32
79
py
sherpa
sherpa-master/docs/conf.py
""" SHERPA is a Python library for hyperparameter tuning of machine learning models. Copyright (C) 2018 Lars Hertel, Peter Sadowski, and Julian Collado. This file is part of SHERPA. SHERPA is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the...
6,552
30.965854
80
py
socks
socks-main/docs/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If e...
4,549
26.743902
222
py
perm_hmm
perm_hmm-master/example_scripts/plot_binned_histograms.py
import os parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.sys.path.insert(0, parentdir) import fire import numpy as np from scipy.special import logsumexp import matplotlib.pyplot as plt import torch import pyro.distributions as dist from example_systems.beryllium import dimensionful_gamma, ...
3,662
34.563107
151
py
perm_hmm
perm_hmm-master/example_scripts/beryllium_plot.py
import os import sys parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, parentdir) parentdir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, parentdir) import fire import numpy as np import matplotlib.pyplot as plt import torch import pyro.distributions as dist ...
9,318
38.155462
226
py
perm_hmm
perm_hmm-master/example_scripts/exhaustive_three_states.py
import os import matplotlib.pyplot as plt from matplotlib.ticker import FormatStrFormatter parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.sys.path.insert(0, parentdir) import fire import numpy as np import torch from perm_hmm.simulator import HMMSimulator from perm_hmm.util import log1me...
7,615
35.792271
170
py
perm_hmm
perm_hmm-master/perm_hmm/loss_functions.py
r"""Loss functions for the :py:class:`~perm_hmm.postprocessing.ExactPostprocessor` and :py:class:`~perm_hmm.postprocessing.EmpiricalPostprocessor` classes. """ import torch from perm_hmm.util import ZERO def log_zero_one(state, classification): r"""Log zero-one loss. Returns ``log(int(classification != stat...
2,495
27.363636
80
py
perm_hmm
perm_hmm-master/perm_hmm/simulator.py
""" Simulates the initial state discrimination experiment using different methods, to compare the resulting error rates. """ import torch from perm_hmm.util import num_to_data from perm_hmm.postprocessing import ExactPostprocessor, EmpiricalPostprocessor from perm_hmm.classifiers.perm_classifier import PermClassifier...
7,817
38.887755
104
py
perm_hmm
perm_hmm-master/perm_hmm/log_cost.py
r"""Log costs to be used with the :py:class:`~perm_hmm.policies.min_tree.MinTreePolicy` class. """ import torch def log_initial_entropy(log_probs: torch.Tensor): """ Calculates the log of the initial state posterior entropy from log_probs, with dimensions -1: s_k, -2: s_1 :param log_probs: :retur...
1,155
23.595745
97
py
perm_hmm
perm_hmm-master/perm_hmm/util.py
"""This module includes a few utility functions. """ from functools import reduce from operator import mul import torch import numpy as np from scipy.special import logsumexp, expm1, log1p ZERO = 10**(-14) def bin_ent(logits_tensor): """Computes the binary entropy of a tensor of independent log probabilities. ...
8,762
29.217241
127
py
perm_hmm
perm_hmm-master/perm_hmm/binning.py
import warnings import torch from pyro.distributions import Categorical from itertools import combinations from perm_hmm.models.hmms import ExpandedHMM, DiscreteHMM from perm_hmm.simulator import HMMSimulator def bin_histogram(base_hist, bin_edges): r"""Given a histogram, bins it using the given bin edges. B...
7,504
45.32716
133
py
perm_hmm
perm_hmm-master/perm_hmm/rate_comparisons.py
import torch from perm_hmm.models.hmms import PermutedDiscreteHMM from perm_hmm.simulator import HMMSimulator from perm_hmm.loss_functions import log_zero_one def exact_rates(phmm: PermutedDiscreteHMM, num_steps, perm_policy, classifier=None, verbosity=0, log_loss=None): r"""Provides plumbing for comparing the m...
3,152
39.948052
146
py
perm_hmm
perm_hmm-master/perm_hmm/postprocessing.py
""" Classes to be used for postprocessing data after a simulation. """ import warnings import numpy as np import torch from scipy.stats import beta from perm_hmm.util import ZERO from perm_hmm.loss_functions import zero_one, log_zero_one def clopper_pearson(alpha, num_successes, total_trials): """ Computes ...
15,799
39.306122
170
py
perm_hmm
perm_hmm-master/perm_hmm/return_types.py
from typing import NamedTuple import torch hmm_fields = [ ('states', torch.Tensor), ('observations', torch.Tensor), ] HMMOutput = NamedTuple('HMMOutput', hmm_fields)
180
11.928571
47
py
perm_hmm
perm_hmm-master/perm_hmm/policies/belief_tree.py
r"""Provides functions used by strategies that use a tree to select the permutation. To compute optimal permutations, we use the belief states .. math:: b(y^{k-1}) := \mathbb{P}(s_0, s_k|y^{k-1}), where the :math:`s_k` are the states of the HMM at step :math:`k`, and the superscript :math:`y^{k-1}` is the sequen...
12,770
45.44
130
py
perm_hmm
perm_hmm-master/perm_hmm/policies/exhaustive.py
r"""Exhaustively searches the best permutations for all possible observations. This is a policy that exhaustively searches the best permutations for all possible observations. This method is very slow and should only be used for testing purposes. The complexity of this method is O((n*p)**t), where n is the number of p...
12,317
42.373239
188
py
perm_hmm
perm_hmm-master/perm_hmm/policies/belief.py
r"""Computes belief states of HMMs with permutations. This module contains the :py:class:`~perm_hmm.policies.belief.HMMBeliefState` class, which computes belief states of HMMs with permutations in a tree-like manner. This module also contains the :py:class:`~perm_hmm.policies.belief.BeliefStatePolicy` class, which is...
21,372
43.807128
138
py