repo_name stringlengths 8 75 | hexsha stringlengths 40 40 | code stringlengths 447 163k | apis list | file_path stringlengths 7 127 | api_extract stringlengths 346 104k |
|---|---|---|---|---|---|
kalosisz/tensorflow | b7ecd75b24f577b73500024fe91d2ea0c806d05a | # Lint as: python2, python3
# 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
#
... | [
"tensorflow.python.eager.def_function.function",
"tensorflow.python.training.tracking.tracking.AutoTrackable",
"tensorflow.lite.python.interpreter.Interpreter",
"tensorflow.python.ops.variables.Variable",
"tensorflow.python.ops.array_ops.zeros",
"tensorflow.python.framework.constant_op.constant"
] | tensorflow/lite/python/lite_v2_test_util.py | [(53, 'tensorflow.lite.python.interpreter.Interpreter', 'Interpreter', ([], {'model_content': 'tflite_model'}), False, 'from tensorflow.lite.python.interpreter import Interpreter\n'), (66, 'six.moves.zip', 'zip', (['input_details', 'input_data'], {}), False, 'from six.moves import zip\n'), (87, 'tensorflow.lite.python.... |
ESWZY/federated | 1693d5fdd25938dc9aadede8d103ed117d1d34c9 | # Copyright 2018, The TensorFlow Federated 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 o... | [
"numpy.random.seed",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.layers.Dense",
"tensorflow.reshape",
"tensorflow.keras.optimizers.SGD",
"tensorflow.keras.metrics.SparseCategoricalAccuracy",
"tensorflow.keras.layers.Softmax",
"tensorflow.keras.layers.Input"
] | tensorflow_federated/python/examples/remote_execution/remote_executor_example.py | [(35, 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""host"""', 'None', '"""The host to connect to."""'], {}), False, 'from absl import flags\n'), (36, 'absl.flags.mark_flag_as_required', 'flags.mark_flag_as_required', (['"""host"""'], {}), False, 'from absl import flags\n'), (37, 'absl.flags.DEFINE_string', '... |
leandro-gracia-gil/addons | d981b0f1d1bc23f697d159eb1510c24b3c476d28 | # Copyright 2020 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 applica... | [
"tensorflow.keras.initializers.serialize",
"tensorflow.keras.utils.register_keras_serializable",
"tensorflow.keras.initializers.get"
] | tensorflow_addons/layers/snake.py | [(25, 'tensorflow.keras.utils.register_keras_serializable', 'tf.keras.utils.register_keras_serializable', ([], {'package': '"""Addons"""'}), True, 'import tensorflow as tf\n'), (38, 'tensorflow.keras.initializers.get', 'tf.keras.initializers.get', (['frequency_initializer'], {}), True, 'import tensorflow as tf\n'), (44... |
ganik/DeepSpeedExamples | 174ae3bc8dbb688cfaccb4afa15d6e2cdbe19ce5 | # 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... | [
"tensorflow.convert_to_tensor",
"tensorflow.cast",
"tensorflow.pad",
"tensorflow.squeeze",
"tensorflow.subtract",
"tensorflow.gather",
"tensorflow.name_scope",
"tensorflow.keras.layers.Add",
"tensorflow.tile",
"tensorflow.matmul",
"tensorflow.fill",
"tensorflow.keras.layers.Dense",
"tensorfl... | MoQ/huggingface-transformers/src/transformers/models/mobilebert/modeling_tf_mobilebert.py | [(75, 'tensorflow.keras.layers.Dense', 'tf.keras.layers.Dense', (['config.intermediate_size'], {'name': '"""dense"""'}), True, 'import tensorflow as tf\n'), (123, 'tensorflow.keras.layers.Add', 'tf.keras.layers.Add', ([], {}), True, 'import tensorflow as tf\n'), (124, 'tensorflow.keras.layers.Dense', 'tf.keras.layers.D... |
phunc20/rlcomp2020 | c37f8f05cc86d55fca2648bf5491d6a2218c2cad | ########################################
# Changes compared to 30_11_dDQN_light_tweak71.py
# 01.
# lr_optimizer = 7.3e-4
########################################
import sys
import numpy as np
#import pandas as pd
import datetime
import json
from array import *
import os
import math
from random import randrange
imp... | [
"tensorflow.keras.models.clone_model",
"tensorflow.reduce_sum",
"numpy.zeros_like",
"numpy.mean",
"tensorflow.random.set_seed",
"numpy.random.randint",
"tensorflow.keras.layers.Conv2D",
"numpy.stack",
"numpy.argmax",
"tensorflow.keras.layers.Flatten",
"numpy.zeros",
"tensorflow.keras.layers.De... | round01/30_11_dDQN_light_tweak73.py | [(51, 'tensorflow.keras.losses.Huber', 'keras.losses.Huber', ([], {}), True, 'import tensorflow.keras as keras\n'), (987, 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(42)'], {}), True, 'import tensorflow as tf\n'), (988, 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), True, 'import numpy as np\n'), (1... |
santhoshkumarvs/tensorflow | 5581b91ada226f1ec20f55cd6423853072b2813c | # Copyright 2018 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 applica... | [
"tensorflow.python.training.tracking.util.list_objects",
"tensorflow.python.keras.layers.normalization.BatchNormalization",
"tensorflow.python.ops.variables.Variable",
"tensorflow.python.ops.array_ops.zeros",
"tensorflow.python.layers.core.Dense",
"tensorflow.python.framework.test_util.run_v1_only",
"te... | tensorflow/python/training/tracking/data_structures_test.py | [(76, 'tensorflow.python.framework.test_util.run_v1_only', 'test_util.run_v1_only', (['"""b/120545219"""'], {}), False, 'from tensorflow.python.framework import test_util\n'), (109, 'tensorflow.python.framework.test_util.run_v1_only', 'test_util.run_v1_only', (['"""b/120545219"""'], {}), False, 'from tensorflow.python.... |
magenta/midi-ddsp | 3ff97496b42becead5289b349524b38f5b55d530 | # Copyright 2022 The MIDI-DDSP 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... | [
"tensorflow.reshape",
"tensorflow.concat",
"tensorflow.keras.initializers.GlorotUniform"
] | midi_ddsp/modules/ddsp_inference.py | [(59, 'midi_ddsp.utils.audio_io.tf_log_mel', 'tf_log_mel', (["inputs['audio']", 'self.sample_rate', 'self.win_length', 'self.hop_length', 'self.n_fft', 'self.num_mels', 'self.fmin'], {}), False, 'from midi_ddsp.utils.audio_io import tf_log_mel\n'), (121, 'ddsp.training.nn.FcStack', 'nn.FcStack', (['self.nhid'], {'layer... |
seawavve/Random_CNN | 5dee90ddc8a79d4b4f2d9c5bd83e62e910c6fc83 | # -*- coding: utf-8 -*-
"""0902_rand_cnn.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1p6_O9ie0cDHaiKxQBn935uTVwj85cEz9
"""
'''
pilab seawavve
random cnn
2020.05.20~
Acc: 91.28% Epoch:75
****PATCH NOTE****
0520 cnn network구성
0000 EarlyStop... | [
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.datasets.fashion_mnist.load_data",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.Input",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.Mode... | CNN/0902_rand_cnn.py | [(31, 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), False, 'import warnings\n'), (68, 'tensorflow.keras.datasets.fashion_mnist.load_data', 'keras.datasets.fashion_mnist.load_data', ([], {}), False, 'from tensorflow import keras\n'), (86, 'tensorflow.ker... |
carlgogo/dl4ds | 2675fe772b7e165ab8726a51c75dd3d9d0a7a465 | import tensorflow as tf
from tensorflow.keras.layers import (Add, Conv2D, Input, Concatenate,
TimeDistributed)
from tensorflow.keras.models import Model
from .blocks import (RecurrentConvBlock, ResidualBlock, ConvBlock,
DenseBlock, TransitionBlock, LocalizedC... | [
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.TimeDistributed",
"tensorflow.expand_dims",
"tensorflow.repeat",
"tensorflow.keras.layers.Add",
"tensorflow.keras.layers.Input"
] | dl4ds/models/spt_preups.py | [(91, 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': '(None, None, None, n_channels)'}), False, 'from tensorflow.keras.layers import Add, Conv2D, Input, Concatenate, TimeDistributed\n'), (93, 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': '(None, h_hr, w_hr, n_channels)'}), False, 'from tensorflow.k... |
fwgg8547/deeplean_mc | 1b858e59caf082df0cd4b1ca12dc21875fb00b26 | from absl import app, flags, logging
from absl.flags import FLAGS
import tensorflow as tf
import numpy as np
import cv2
from tensorflow.keras.callbacks import (
ReduceLROnPlateau,
EarlyStopping,
ModelCheckpoint,
TensorBoard
)
from yolov3_tf2.models import (
YoloV3, YoloV3Tiny, YoloLoss,
yolo_an... | [
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.reduce_sum",
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.keras.callbacks.ReduceLROnPlateau",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.callbacks.TensorBoard",... | trainmine.py | [(21, 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""dataset"""', '""""""', '"""path to dataset"""'], {}), False, 'from absl import app, flags, logging\n'), (22, 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""val_dataset"""', '""""""', '"""path to validation dataset"""'], {}), False, 'from absl impo... |
DataLab-CQU/stellargraph | 5ca1e59e91cb6ac470bf19ff3da39b3a1a68650e | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | [
"scipy.sparse.eye",
"tensorflow.keras.backend.int_shape",
"tensorflow.keras.Model",
"tensorflow.keras.models.model_from_json",
"tensorflow.keras.activations.get",
"tensorflow.keras.layers.Input"
] | tests/layer/test_graph_attention.py | [(111, 'tensorflow.keras.Model', 'keras.Model', ([], {'inputs': 'x_inp', 'outputs': 'x_out'}), False, 'from tensorflow import keras\n'), (138, 'tensorflow.keras.Model', 'keras.Model', ([], {'inputs': 'x_inp', 'outputs': 'x_out'}), False, 'from tensorflow import keras\n'), (181, 'tensorflow.keras.Model', 'keras.Model', ... |
hjkim-haga/TF-OD-API | 22ac477ff4dfb93fe7a32c94b5f0b1e74330902b | # Copyright 2021 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... | [
"tensorflow.io.gfile.isdir",
"tensorflow.train.latest_checkpoint",
"tensorflow.train.Checkpoint",
"tensorflow.keras.regularizers.l2",
"tensorflow.reduce_sum",
"tensorflow.cast",
"tensorflow.keras.losses.Huber",
"tensorflow.one_hot",
"tensorflow.distribute.get_strategy",
"tensorflow.keras.layers.In... | official/vision/beta/tasks/retinanet.py | [(34, 'official.core.task_factory.register_task_cls', 'task_factory.register_task_cls', (['exp_cfg.RetinaNetTask'], {}), False, 'from official.core import task_factory\n'), (46, 'tensorflow.keras.layers.InputSpec', 'tf.keras.layers.InputSpec', ([], {'shape': '([None] + self.task_config.model.input_size)'}), True, 'impo... |
iascchen/ai_study_notes | 03f46c5e37670c10bd99000d979940db8878f36c | import os
import numpy as np
import tensorflow.keras as keras
from tensorflow.keras.preprocessing import image
from tensorflow.keras import layers
latent_dim = 32
height = 32
width = 32
channels = 3
# =========================================
generator_input = keras.Input(shape=(latent_dim,))
# First, transform th... | [
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.LeakyReLU",
"tensorflow.keras.Input",
"numpy.random.random",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2DTranspose",
"tensorflow.keras.optimizers.RMSprop",
"tensorflow.keras.layers.Conv2D... | src/study_keras/6_hello_gan/hello_gan_cifar10.py | [(15, 'tensorflow.keras.Input', 'keras.Input', ([], {'shape': '(latent_dim,)'}), True, 'import tensorflow.keras as keras\n'), (38, 'tensorflow.keras.models.Model', 'keras.models.Model', (['generator_input', 'x'], {}), True, 'import tensorflow.keras as keras\n'), (43, 'tensorflow.keras.layers.Input', 'layers.Input', ([]... |
garyxcheng/federated | ba7133ead6127af71ea9356e26bfd05c02f8324a | # Copyright 2021, Google LLC.
#
# 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 to in writing... | [
"pandas.read_csv",
"tensorflow.io.gfile.exists",
"tensorflow.keras.layers.Dense",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.keras.losses.MeanSquaredError",
"tensorflow.keras.Sequential",
"tensorflow.test.main",
"tensorflow.keras.metrics.MeanSquaredError",
"tensorflow.keras.optimizers... | generalization/utils/centralized_training_loop_test.py | [(28, 'tensorflow.data.Dataset.from_tensor_slices', 'tf.data.Dataset.from_tensor_slices', (['([[1.0, 2.0], [3.0, 4.0]], [[5.0], [6.0]])'], {}), True, 'import tensorflow as tf\n'), (44, 'tensorflow.keras.layers.Dense', 'tf.keras.layers.Dense', (['(1)'], {'kernel_initializer': '"""zeros"""', 'bias_initializer': '"""zeros... |
BlackHC/uncertainty-baselines | 1a28be3e41e14d8ab74dfa1e3eed15f113718f03 | # coding=utf-8
# Copyright 2022 The Uncertainty Baselines 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 ap... | [
"tensorflow.random.set_seed",
"tensorflow.io.gfile.makedirs",
"numpy.ceil",
"numpy.max",
"numpy.argmax",
"numpy.array",
"tensorflow.keras.metrics.Mean"
] | baselines/jft/deterministic.py | [(51, 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""output_dir"""'], {'default': 'None', 'help': '"""Work unit directory."""'}), False, 'from absl import flags\n'), (52, 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""num_cores"""'], {'default': 'None', 'help': '"""Unused. How many devices being u... |
xchange11/bundesterminator | d7e92bfa8ffda54821364c74ac33a48ffa5f51b9 | import os
import pickle
from google.cloud import storage
from bundestag import data, utils
from bundestag.bundes_w2v import BundesW2V
import pandas as pd
import numpy as np
from tensorflow import keras
from tensorflow.keras import Sequential, layers
from tensorflow.keras.callbacks import EarlyStopping
from tensorflo... | [
"tensorflow.keras.models.load_model",
"pandas.Series",
"tensorflow.keras.layers.Masking",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Sequential",
"sklearn.model_selection.train_test_split",
"pandas.DataFrame",
"sklearn.preprocessing.LabelEncoder",
"tensorflow.keras.layers.LSTM",
"tensorflo... | bundestag/bundestrainer.py | [(88, 'bundestag.data.get_data', 'data.get_data', ([], {}), False, 'from bundestag import data, utils\n'), (95, 'bundestag.utils.impute_party', 'utils.impute_party', (['self.speech_data', 'self.bio_data'], {}), False, 'from bundestag import data, utils\n'), (96, 'bundestag.utils.remove_non_party', 'utils.remove_non_par... |
powerbi1/keras-tuner | cfc6e20956cb8554ee29ef2a1ba4635da7d0228b | # Copyright 2019 The Keras Tuner 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"tensorflow.keras.utils.get_source_inputs",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.backend.int_shape",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.Model",
"tensorflow.keras.layers.SeparableConv2... | kerastuner/applications/xception.py | [(151, 'tensorflow.keras.layers.add', 'layers.add', (['[x, res]'], {}), False, 'from tensorflow.keras import layers\n'), (49, 'tensorflow.keras.utils.get_source_inputs', 'tf.keras.utils.get_source_inputs', (['self.input_tensor'], {}), True, 'import tensorflow as tf\n'), (52, 'tensorflow.keras.layers.Input', 'layers.Inp... |
ishine/neurst | 2ba322393fcfed4261b33f4a657e12bbe321baaa | # Copyright 2020 ByteDance 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 agreed to in writin... | [
"tensorflow.io.gfile.GFile",
"tensorflow.cast",
"tensorflow.keras.backend.batch_set_value",
"tensorflow.keras.Model"
] | examples/prune_tune/src/mask_sequence_generator.py | [(26, 'neurst.exps.register_exp', 'register_exp', (["['mask_predict', 'mask_generation']"], {}), False, 'from neurst.exps import register_exp\n'), (68, 'tensorflow.keras.Model', 'tf.keras.Model', (['inps', 'generation_ops'], {}), True, 'import tensorflow as tf\n'), (77, 'tensorflow.keras.backend.batch_set_value', 'K.ba... |
mediocretech/patchwork | ad21c81611f74569e93f563d765cba2259b1d4b3 | # -*- coding: utf-8 -*-
import param
import tensorflow as tf
from patchwork._layers import _next_layer
class GlobalPooling(param.Parameterized):
"""
Just a single pooling layer.
"""
pooling_type = param.ObjectSelector(default="max pool", objects=["max pool", "average pool", "flatten"])
descr... | [
"tensorflow.keras.layers.GlobalMaxPool2D",
"tensorflow.keras.layers.GlobalAvgPool2D",
"tensorflow.keras.Model",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Input"
] | patchwork/_fine_tuning_models.py | [(12, 'param.ObjectSelector', 'param.ObjectSelector', ([], {'default': '"""max pool"""', 'objects': "['max pool', 'average pool', 'flatten']"}), False, 'import param\n'), (42, 'param.String', 'param.String', ([], {'default': '"""128,p,d,128"""', 'doc': '"""Comma-separated list of filters"""'}), False, 'import param\n')... |
jemiar/surgery-gesture-recog | 83b98c2ccd937c898eb731ccdf28c9248ce3df8d | import cv2
import os
import numpy as np
import tensorflow as tf
from tensorflow import keras
import tensorflow.keras.layers as layers
from data_generator import DataGenerator
base_directory = './'
# function used to read video data and save normal or transit blocks to folder
def save_data(fromarray=transcriptions, he... | [
"numpy.expand_dims",
"tensorflow.keras.Input",
"tensorflow.keras.layers.MaxPool3D",
"numpy.asarray",
"tensorflow.keras.layers.GlobalAveragePooling3D",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.DropOut",
"tensorflow.keras.layers.Conv3D",
"tensorflow.keras.Model",
"numpy.save",
"te... | transit_classification.py | [(136, 'data_generator.DataGenerator', 'DataGenerator', (['training_ids', 'labels'], {}), False, 'from data_generator import DataGenerator\n'), (137, 'data_generator.DataGenerator', 'DataGenerator', (['validation_ids', 'labels'], {}), False, 'from data_generator import DataGenerator\n'), (19, 'os.chdir', 'os.chdir', ([... |
zcemjjw/MPHY0041_Segmentation | 5840eb6979bb9e3ad19898cd66e0ede8129e3680 | import tensorflow as tf
import numpy as np
import os
import matplotlib.pyplot as plt
from keras.optimizers import Adam, SGD
from tqdm import tqdm
import random
from metrics import dice_coef, dice_coef_loss
img_width = 128
img_height = 128
img_channels = 1
path_to_data = './data/datasets-promise12'
path_to_save = './r... | [
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.layers.Lambda",
"matplotlib.pyplot.figure",
"tensorflow.keras.layers.Conv2DTranspose",
"tensorflow.keras.layers.Conv2D",
"tensorflow.optimizers.Adam",
"tensorflow.keras.layers.concatenate",
"tensorflow.keras.Model",
"tensorflow.keras.ca... | UNet_2D/training.py | [(20, 'numpy.zeros', 'np.zeros', (['(N, img_height, img_width, img_channels)'], {'dtype': 'np.float32'}), True, 'import numpy as np\n'), (21, 'numpy.zeros', 'np.zeros', (['(N, img_height, img_width, 1)'], {'dtype': 'np.float32'}), True, 'import numpy as np\n'), (37, 'numpy.zeros', 'np.zeros', (['(N_test, img_height, im... |
workingloong/elasticdl | 474146e4c347bab53c5f157441a6008dd204575c | import tensorflow as tf
from elasticdl.python.elasticdl.callbacks import LearningRateScheduler
from elasticdl_preprocessing.layers import SparseEmbedding
from elasticdl_preprocessing.layers.concatenate_with_offset import (
ConcatenateWithOffset,
)
from elasticdl_preprocessing.layers.discretization import Discretiz... | [
"tensorflow.keras.layers.Concatenate",
"tensorflow.concat",
"tensorflow.constant",
"tensorflow.reduce_sum",
"tensorflow.keras.layers.Dense",
"tensorflow.reshape",
"tensorflow.sigmoid",
"tensorflow.keras.metrics.AUC",
"tensorflow.keras.Model",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras... | model_zoo/census_model_sqlflow/wide_and_deep/wide_deep_functional_keras.py | [(52, 'tensorflow.reshape', 'tf.reshape', (['deep_embeddings'], {'shape': '(-1, 3 * 8)'}), True, 'import tensorflow as tf\n'), (57, 'tensorflow.concat', 'tf.concat', (['[wide, dnn_input]', '(1)'], {}), True, 'import tensorflow as tf\n'), (59, 'tensorflow.reduce_sum', 'tf.reduce_sum', (['concat_input', '(1)'], {'keepdim... |
SteffenBauer/Deep_RL | 6671c723098037cef1013af9a7f434df993c9d91 | #!/usr/bin/env python3
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'
import tensorflow as tf
import tensorflow.keras as keras
tf.get_logger().setLevel('ERROR')
from rl.games import tromis
from rl.agents import dqn
from rl.memory import uniqmemory
from rl.callbacks... | [
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.GlobalAveragePooling3D",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.optimizers.RMSprop",
"tensorflow.keras.layers.Conv3D",
"tensorflow.keras.losses.LogCosh",
"tensorflow.get_logger",
"tensorflow.keras.layers.AveragePooling3D",
"tensor... | train_tromis.py | [(18, 'rl.games.tromis.Tromis', 'tromis.Tromis', (['width', 'height'], {'max_turn': '(512)'}), False, 'from rl.games import tromis\n'), (20, 'tensorflow.keras.layers.Input', 'keras.layers.Input', ([], {'shape': '(nb_frames, height, width, 3)'}), True, 'import tensorflow.keras as keras\n'), (28, 'tensorflow.keras.models... |
sujeet-ap/keras-idiomatic-programmer | 4db490afea8acf9381cbf3d607583451a2f40a3a | # Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"tensorflow.keras.layers.ReLU",
"tensorflow.keras.Input",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.Model",
"tensorflow.keras.layers.Add",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.laye... | zoo/senet/se_resnet.py | [(193, 'tensorflow.keras.Input', 'Input', ([], {'shape': '(224, 224, 3)'}), False, 'from tensorflow.keras import Input, Model\n'), (205, 'tensorflow.keras.Model', 'Model', (['inputs', 'outputs'], {}), False, 'from tensorflow.keras import Input, Model\n'), (28, 'tensorflow.keras.layers.ZeroPadding2D', 'ZeroPadding2D', (... |
1ucky40nc3/models | 1933222e454f0d2ab8582e48fcc46f26c36ace87 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | [
"tensorflow.TensorShape",
"tensorflow.keras.constraints.get",
"tensorflow.keras.activations.serialize",
"tensorflow.keras.constraints.serialize",
"tensorflow.keras.regularizers.get",
"tensorflow.keras.initializers.serialize",
"tensorflow.keras.utils.register_keras_serializable",
"tensorflow.keras.regu... | official/nlp/keras_nlp/layers/fast_attention_util.py | [(44, 'tensorflow.keras.utils.register_keras_serializable', 'tf.keras.utils.register_keras_serializable', ([], {'package': '"""Text"""'}), True, 'import tensorflow as tf\n'), (93, 'tensorflow.keras.activations.get', 'tf.keras.activations.get', (['activation'], {}), True, 'import tensorflow as tf\n'), (95, 'tensorflow.k... |
UTokyo-ICEPP/multiml_htautau | 5f926c2291a55f57419aa0130d07e2a793fc7353 | from . import HiggsID_BaseTask
class HiggsID_MassTask(HiggsID_BaseTask):
''' HiggsID MLP task
'''
def __init__(self,
layers=None,
activation=None,
batch_norm=False,
scale_mass=1.,
**kwargs):
"""
Args:
... | [
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.backend.cos",
"tensorflow.keras.backend.sin",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.backend.sqrt",
"tensorflow.keras.backend.sum",
"tensorflow.keras.backend.reshape",
"tensorflow.keras.backend.cli... | multiml_htautau/task/keras/higgsId_mass.py | [(33, 'tensorflow.keras.backend.reshape', 'K.reshape', (['tau_4vec', '(-1, self._njets, self._n_features)'], {}), True, 'from tensorflow.keras import backend as K\n'), (43, 'tensorflow.keras.backend.sqrt', 'K.sqrt', (['(epsilon + px ** 2 + py ** 2 + pz ** 2 + mass ** 2)'], {}), True, 'from tensorflow.keras import backe... |
UTokyo-ICEPP/multiml_htautau | 5f926c2291a55f57419aa0130d07e2a793fc7353 | from . import Tau4vec_BaseTask
class Tau4vec_ZeroTask(Tau4vec_BaseTask):
''' Tau4vec Zero task
'''
def __init__(self, **kwargs):
super().__init__(**kwargs)
self._trainable_model = False
def build_model(self):
from tensorflow.keras.models import Model
from tensorflow.k... | [
"tensorflow.keras.backend.reshape",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.models.Model"
] | multiml_htautau/task/keras/tau4vec_zero.py | [(21, 'tensorflow.keras.backend.reshape', 'K.reshape', (['x', '(-1, self._njets * (self._n_features - 1))'], {}), True, 'from tensorflow.keras import backend as K\n'), (26, 'tensorflow.keras.models.Model', 'Model', ([], {'inputs': '[input_energy, input_jet]', 'outputs': '[x]'}), False, 'from tensorflow.keras.models imp... |
jbgh2/speech-denoising-wavenet | 386662527b8da69fb3314531a2a7cff087eac557 | # A Wavenet For Speech Denoising - Dario Rethage - 19.05.2017
# Util.py
# Utility functions for dealing with audio signals and training a Denoising Wavenet
import os
import numpy as np
import json
import warnings
import scipy.signal
import scipy.stats
import soundfile as sf
import tensorflow.keras as keras
def l1_l2_l... | [
"tensorflow.keras.backend.sign",
"numpy.max",
"numpy.mean",
"numpy.iinfo",
"tensorflow.keras.backend.log",
"numpy.square",
"numpy.arange",
"numpy.eye",
"numpy.finfo",
"numpy.argmax",
"numpy.log",
"tensorflow.keras.backend.abs",
"numpy.append",
"numpy.log10",
"numpy.array",
"numpy.log2"... | util.py | [(121, 'numpy.argmax', 'np.argmax', (['x'], {'axis': '(-1)'}), True, 'import numpy as np\n'), (125, 'numpy.append', 'np.append', (['signal[0]', '(signal[1:] - alpha * signal[:-1])'], {}), True, 'import numpy as np\n'), (166, 'soundfile.read', 'sf.read', (['filename'], {}), True, 'import soundfile as sf\n'), (210, 'nump... |
Knarik1/transformers | c2a7d7280250addae38a49c31a57ddd897be2065 | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | [
"tensorflow.convert_to_tensor",
"tensorflow.keras.layers.LayerNormalization",
"tensorflow.stack",
"tensorflow.cast",
"numpy.zeros_like",
"tensorflow.squeeze",
"numpy.sin",
"tensorflow.stop_gradient",
"tensorflow.gather",
"tensorflow.divide",
"tensorflow.subtract",
"tensorflow.add",
"tensorfl... | src/transformers/models/roformer/modeling_tf_roformer.py | [(101, 'tensorflow.cast', 'tf.cast', (['weight'], {'dtype': 'self.weight.dtype'}), True, 'import tensorflow as tf\n'), (116, 'numpy.zeros_like', 'np.zeros_like', (['position_enc'], {}), True, 'import numpy as np\n'), (118, 'numpy.sin', 'np.sin', (['position_enc[:, 0::2]'], {}), True, 'import numpy as np\n'), (119, 'num... |
manhhv87/densenet_bottleneck | fd08eb88514dacaff1bcec8bc52a77ea56ab72c7 | import argparse
import os
from pathlib import Path
import numpy as np
import tensorflow as tf
from sklearn.model_selection import StratifiedKFold
from finetuning.utils import ecg_feature_extractor, train_test_split
from transplant.evaluation import auc, f1, multi_f1, CustomCheckpoint
from transplant.utils import (cr... | [
"tensorflow.keras.metrics.BinaryAccuracy",
"tensorflow.keras.losses.CategoricalCrossentropy",
"numpy.random.seed",
"tensorflow.distribute.MirroredStrategy",
"tensorflow.keras.layers.Dense",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.keras.callbacks.ReduceLROnPlateau",
"tensorflow.keras.... | finetuning/trainer_old.py | [(23, 'tensorflow.data.Dataset.from_tensor_slices', 'tf.data.Dataset.from_tensor_slices', (["(data['x'], data['y'])"], {}), True, 'import tensorflow as tf\n'), (27, 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), False, 'import argparse\n'), (57, 'numpy.random.seed', 'np.random.seed', (['seed'], {}), Tr... |
adfoucart/deephisto | f70fbaad9f95a9b9f2e420c9c33d46bdfab5bdf9 | import tensorflow as tf
class F1Metric(tf.keras.metrics.Metric):
def __init__(self, name=None, dtype=None):
super(F1Metric, self).__init__(name=name, dtype=dtype)
self.tp_ = tf.keras.metrics.TruePositives()
self.fp_ = tf.keras.metrics.FalsePositives()
self.fn_ = tf.keras.metrics.Fal... | [
"tensorflow.keras.metrics.TruePositives",
"tensorflow.keras.metrics.FalsePositives",
"tensorflow.keras.metrics.FalseNegatives"
] | model/F1Metric.py | [(6, 'tensorflow.keras.metrics.TruePositives', 'tf.keras.metrics.TruePositives', ([], {}), True, 'import tensorflow as tf\n'), (7, 'tensorflow.keras.metrics.FalsePositives', 'tf.keras.metrics.FalsePositives', ([], {}), True, 'import tensorflow as tf\n'), (8, 'tensorflow.keras.metrics.FalseNegatives', 'tf.keras.metrics.... |
sahilparekh/imgclsmob | 74d52457b4bf00c82d063b3f4a1a73fb6ba3863a | """
WRN for ImageNet-1K, implemented in TensorFlow.
Original paper: 'Wide Residual Networks,' https://arxiv.org/abs/1605.07146.
"""
__all__ = ['WRN', 'wrn50_2']
import os
import tensorflow as tf
import tensorflow.keras.layers as nn
from .common import Conv2d, MaxPool2d, flatten, is_channels_first
class WRNC... | [
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.keras.layers.ReLU",
"tensorflow.keras.backend.get_value",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Sequential"
] | tensorflow2/tf2cv/models/wrn.py | [(361, 'os.path.join', 'os.path.join', (['"""~"""', '""".tensorflow"""', '"""models"""'], {}), False, 'import os\n'), (230, 'tensorflow.keras.layers.ReLU', 'nn.ReLU', ([], {}), True, 'import tensorflow.keras.layers as nn\n'), (319, 'tensorflow.keras.Sequential', 'tf.keras.Sequential', ([], {'name': '"""features"""'}), ... |
xvalad/ML | baf71a32fe5c5cf8e9f79a7ec46f59b878f87965 | #!/usr/bin/python3
# LinearRegressionWIthSyntheticData by Google
# https://colab.research.google.com/github/google/eng-edu/blob/master/ml/cc/exercises/linear_regression_with_synthetic_data.ipynb
#
import pandas as pd
import tensorflow as tf
from matplotlib import pyplot as plt
#
## DEFINE FUNCTIONS THAT BUILD AND TRAI... | [
"matplotlib.pyplot.legend",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.figure",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.optimizers.RMSprop",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"tensorflow.keras.metrics.RootMeanSquaredError",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot... | LinearRegressionWithSyntheticData.py | [(14, 'tensorflow.keras.models.Sequential', 'tf.keras.models.Sequential', ([], {}), True, 'import tensorflow as tf\n'), (53, 'pandas.DataFrame', 'pd.DataFrame', (['history.history'], {}), True, 'import pandas as pd\n'), (68, 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""feature"""'], {}), True, 'from matplotlib impor... |
svenvanderburg/EEG_age_prediction | 958e8d6445bf277a445608e05d779315dbd9b376 | #!/usr/bin/env python
# ================ IMPORT LIBRARIES ================ #
import sys, os, fnmatch, time
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
sys.path.insert(0, os.path.dirname(os.getcwd()))
from dataset_generator import DataGenerator
import tensorflow as tf... | [
"tensorflow.keras.callbacks.ModelCheckpoint",
"pandas.concat",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.PReLU",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv1D",
"sklearn.model_selection.train_test_split",
"tensorflow.keras.layers.M... | scripts/DL_final_Encoder_regressor.py | [(44, 'os.listdir', 'os.listdir', (['PATH_DATA_PROCESSED_DL'], {}), False, 'import sys, os, fnmatch, time\n'), (56, 'pandas.concat', 'pd.concat', (['frames'], {}), True, 'import pandas as pd\n'), (67, 'sklearn.model_selection.train_test_split', 'train_test_split', (['subject_ids'], {'test_size': '(0.3)', 'random_state'... |
svenvanderburg/EEG_age_prediction | 958e8d6445bf277a445608e05d779315dbd9b376 | #!/usr/bin/env python
# ================ IMPORT LIBRARIES ================ #
import sys, os, fnmatch, time
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
sys.path.insert(0, os.path.dirname(os.getcwd()))
from dataset_generator import DataGenerator
import tensorflow as tf... | [
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.Add",
"tensorflow.keras.callbacks.EarlyStopping",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.callbacks.ModelCheckpoint",
"pandas.concat",
"tensorflow.keras.layers.AveragePooling1D",
"tensorflow.keras.models.Model",
"tensorflow... | scripts/DL_final_InceptionTime_regressor.py | [(44, 'os.listdir', 'os.listdir', (['PATH_DATA_PROCESSED_DL'], {}), False, 'import sys, os, fnmatch, time\n'), (56, 'pandas.concat', 'pd.concat', (['frames'], {}), True, 'import pandas as pd\n'), (67, 'sklearn.model_selection.train_test_split', 'train_test_split', (['subject_ids'], {'test_size': '(0.3)', 'random_state'... |
svenvanderburg/EEG_age_prediction | 958e8d6445bf277a445608e05d779315dbd9b376 | import sys, os, fnmatch, csv
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.utils import shuffle
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.layers import Dropout, Dense, BatchNor... | [
"tensorflow.keras.callbacks.ModelCheckpoint",
"pandas.concat",
"pandas.read_hdf",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.callbacks.ReduceLROnPlateau",
"tensorflow.keras.Sequential",
"sklearn.model_selection.train_test_split",
"tensorflow.keras.optimizers.Adadelta",
"tensorflow.keras.laye... | scripts/ML_train_03.py | [(27, 'os.listdir', 'os.listdir', (['PATH_DATA_PROCESSED_ML'], {}), False, 'import sys, os, fnmatch, csv\n'), (46, 'pandas.concat', 'pd.concat', (['frames'], {}), True, 'import pandas as pd\n'), (51, 'sklearn.model_selection.train_test_split', 'train_test_split', (['subject_ids'], {'test_size': '(0.3)', 'random_state':... |
oliviaweng/imgclsmob | a1f1f52eecbb841fa878bff4d3c311b79864835d | """
GhostNet for ImageNet-1K, implemented in TensorFlow.
Original paper: 'GhostNet: More Features from Cheap Operations,' https://arxiv.org/abs/1911.11907.
"""
__all__ = ['GhostNet', 'ghostnet']
import os
import math
import tensorflow as tf
import tensorflow.keras.layers as nn
from .common import round_channe... | [
"tensorflow.clip_by_value",
"tensorflow.keras.backend.get_value",
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.keras.Sequential"
] | tensorflow2/tf2cv/models/ghostnet.py | [(350, 'os.path.join', 'os.path.join', (['"""~"""', '""".tensorflow"""', '"""models"""'], {}), False, 'import os\n'), (24, 'tensorflow.clip_by_value', 'tf.clip_by_value', (['x', '(0.0)', '(1.0)'], {}), True, 'import tensorflow as tf\n'), (50, 'math.ceil', 'math.ceil', (['(0.5 * out_channels)'], {}), False, 'import math... |
aasir22/tools_classification | f5a2606f5fa07c1ebc161c467d17f4e7a04c5ebb | from tensorflow.keras.layers import Dense, Flatten
from tensorflow.keras.models import Model
from tensorflow.keras.applications.vgg19 import VGG19
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.callbacks import ModelCheckpoint
from datetime import datetime
import numpy as np
i... | [
"tensorflow.keras.callbacks.ModelCheckpoint",
"matplotlib.pyplot.legend",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.keras.models.Model",
"tensorflow.keras.applications.vgg19.VGG19",
"tensorflow.keras.layers.Dense",
"sklearn.metrics.classification_report",
"matplotlib.pyplo... | training.py | [(24, 'Logger.app_logger.App_logger', 'App_logger', ([], {}), False, 'from Logger.app_logger import App_logger\n'), (31, 'os.listdir', 'os.listdir', (['self.train_path'], {}), False, 'import os\n'), (50, 'os.listdir', 'os.listdir', (['self.test_path'], {}), False, 'import os\n'), (73, 'os.listdir', 'os.listdir', (['sel... |
soybase/DroneImageScripts | c077325a868237569592bd3820b3d873eddb4f83 | # import the necessary packages
import sys
import cv2
import numpy as np
import pandas as pd
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from sklearn.preprocessing import LabelBinarizer
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import train_test_split
from tenso... | [
"tensorflow.keras.models.load_model",
"tensorflow.keras.layers.Conv2DTranspose",
"numpy.concatenate",
"pandas.isna",
"sklearn.preprocessing.MinMaxScaler",
"pandas.read_csv",
"tensorflow.keras.layers.LeakyReLU",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.keras.Input",
"t... | CNN/CNNProcessData.py | [(30, 'tensorflow.keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'featurewise_center': '(True)', 'featurewise_std_normalization': '(True)'}), False, 'from tensorflow.keras.preprocessing.image import ImageDataGenerator\n'), (87, 'numpy.array', 'np.array', (['augmented_testX_1'], {}), True, 'i... |
kct22aws/transformers | 28e091430eea9e0d40839e56fd0d57aec262f5f9 | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | [
"tensorflow.keras.layers.LayerNormalization",
"tensorflow.convert_to_tensor",
"tensorflow.concat",
"tensorflow.cast",
"tensorflow.pad",
"tensorflow.squeeze",
"tensorflow.gather",
"tensorflow.name_scope",
"tensorflow.matmul",
"tensorflow.fill",
"tensorflow.keras.layers.Dense",
"tensorflow.split... | src/transformers/models/convbert/modeling_tf_convbert.py | [(78, 'tensorflow.keras.layers.LayerNormalization', 'tf.keras.layers.LayerNormalization', ([], {'epsilon': 'config.layer_norm_eps', 'name': '"""LayerNorm"""'}), True, 'import tensorflow as tf\n'), (79, 'tensorflow.keras.layers.Dropout', 'tf.keras.layers.Dropout', ([], {'rate': 'config.hidden_dropout_prob'}), True, 'imp... |
Yonder-OSS/D3M-Primitives | b5f2c14d2afdadc6e97316aae5dd33fe4b874b09 | '''
Bootstrapped from https://github.com/NewKnowledge/imagenet and refined for D3M purposes
Original implementation from Craig Corcoran
'''
import os
import math
import numpy as np
import tensorflow as tf
from tensorflow.keras.applications import inception_v3, mobilenet_v2, xception
from tensorflow.keras.mode... | [
"tensorflow.constant",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.applications.xception.Xception",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"numpy.prod",
"tensorflow.keras.applications.inception_v3.InceptionV3"
] | primitives/image_classification/utils/imagenet.py | [(17, 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), False, 'import logging\n'), (92, 'tensorflow.keras.models.Model', 'Model', ([], {'inputs': 'self.model.input', 'outputs': 'preds'}), False, 'from tensorflow.keras.models import Model\n'), (255, 'math.ceil', 'math.ceil', (['(self.X.shape[0] / self.batch... |
csepreghy/spectral_analysis | 1cbd9770347a71721164a7daf7b133ad0eeba8e4 | import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import time
from tensorflow.keras.layers import Input, Dense, Flatten, Conv1D, MaxPooling1D, UpSampling1D, BatchNormalization, Reshape
from tensorflow.keras.models import Model, Sequential
from tensorflow.keras.callbacks import TensorBoar... | [
"tensorflow.keras.callbacks.ModelCheckpoint",
"pandas.read_hdf",
"numpy.expand_dims",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.UpSampling1D",
"numpy.arange",
"numpy.squeeze",
"tensorflow.keras.layers.Conv1D",
"tensorflow.keras.layers.MaxPooling1D",
"pandas.DataFrame",
"matplotli... | spectral_analysis/unsupervised_learning/autoencoder/autoencoder_bestmodel.py | [(240, 'pandas.read_hdf', 'pd.read_hdf', (['"""data/sdss/preprocessed/balanced.h5"""'], {'key': '"""wavelengths"""'}), True, 'import pandas as pd\n'), (29, 'spectral_analysis.classifiers.neural_network.helper_functions.train_test_split', 'train_test_split', (['X', '(0.2)'], {'indeces': 'indeces'}), False, 'from spectra... |
non778/examples | d1eed1a6a987b0ebbb0341925a480dc3e60489ee | # 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 applica... | [
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.lite.Interpreter",
"numpy.argmax",
"tensorflow.keras.utils.get_file",
"numpy.float32",
"numpy.zeros",
"tensorflow.compat.v1.keras.experimental.export_saved_model",
"tensorflow.keras.applications.MobileNetV2"
] | lite/examples/model_personalization/converter/tfltransfer/model_correctness_test.py | [(329, 'numpy.zeros', 'np.zeros', (['((batch_size,) + batch.shape[1:])'], {'dtype': 'batch.dtype'}), True, 'import numpy as np\n'), (419, 'unittest.main', 'unittest.main', ([], {}), False, 'import unittest\n'), (52, 'tensorflow.keras.preprocessing.image.ImageDataGenerator', 'tf.keras.preprocessing.image.ImageDataGenera... |
rgerkin/psiz | d540738462b6436a08a472d5e349ca2b813e6d47 | # -*- coding: utf-8 -*-
# Copyright 2020 The PsiZ 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 r... | [
"tensorflow.keras.initializers.Constant",
"tensorflow.keras.losses.CategoricalCrossentropy",
"tensorflow.keras.layers.Embedding",
"tensorflow.stack",
"scipy.stats.pearsonr",
"tensorflow.keras.metrics.CategoricalCrossentropy",
"tensorflow.keras.optimizers.Adam",
"numpy.argsort",
"numpy.array2string",... | examples/rank/mle_3g.py | [(73, 'psiz.trials.RandomRank', 'psiz.trials.RandomRank', (['n_stimuli'], {'n_reference': '(8)', 'n_select': '(2)'}), False, 'import psiz\n'), (79, 'psiz.agents.RankAgent', 'psiz.agents.RankAgent', (['model_true'], {'groups': '[0]'}), False, 'import psiz\n'), (80, 'psiz.agents.RankAgent', 'psiz.agents.RankAgent', (['mo... |
Hammer7/Flowers-TF-Lite | e98f1ce1c354ce4e09a2c045364fa518702619c5 | #@title 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribute... | [
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.keras.layers.Conv2D",
"tensorflow.saved_model.save",
"matplotlib.pyplot.subplot",
"tensorflow.lite.TFLiteConverter.from_saved_model",
"matplotlib.pyplot.figure",
"matplotlib.p... | flowers_tf_lite.py | [(26, 'tensorflow.keras.utils.get_file', 'tf.keras.utils.get_file', ([], {'origin': '_URL', 'fname': '"""flower_photos.tgz"""', 'extract': '(True)'}), True, 'import tensorflow as tf\n'), (33, 'tensorflow.keras.preprocessing.image.ImageDataGenerator', 'tf.keras.preprocessing.image.ImageDataGenerator', ([], {'rescale': '... |
shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | # coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | [
"tensorflow.keras.layers.LayerNormalization",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.matmul",
"tensorflow.concat",
"tensorflow.keras.layers.ReLU",
"tensorflow.range",
"tensorflow.shape",
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.keras.layers.Dense",
"tensorflo... | muzero/atari/network.py | [(120, 'tensorflow.keras.Sequential', 'tf.keras.Sequential', (['encoding_layers'], {'name': '"""observation_encoder"""'}), True, 'import tensorflow as tf\n'), (186, 'tensorflow.concat', 'tf.concat', (['[logits_ab, logits_aa]', '(1)'], {}), True, 'import tensorflow as tf\n'), (187, 'tensorflow.concat', 'tf.concat', (['[... |
thisisjako/UdemyTF | ee4102391ed6bd50f764955f732f5740425a9209 | from tensorflow.keras.applications import MobileNetV2
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.callbacks import LearningRateScheduler
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import GlobalAveragePooling2D
from... | [
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.callbacks.LearningRateScheduler",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.layers.experimental.preprocessing.Rescaling"... | Chapter9_AdvancedDL/Chapter9_7_AdvancedTechniques2/dogsCatsTransferLearning.py | [(23, 'tensorflow.keras.applications.MobileNetV2', 'MobileNetV2', ([], {'include_top': '(False)', 'weights': '"""imagenet"""', 'input_shape': 'IMAGENET_SHAPE'}), False, 'from tensorflow.keras.applications import MobileNetV2\n'), (35, 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': 'img_shape'}), False, 'from t... |
typhoonzero/models-1 | a3559618a013820385f43307261ad34351da2fbf | import tensorflow as tf
class StackedBiLSTMClassifier(tf.keras.Model):
def __init__(self, feature_columns, stack_units=[32], hidden_size=64, n_classes=2):
"""StackedBiLSTMClassifier
:param feature_columns: All columns must be embedding of sequence column with same sequence_length.
:type fea... | [
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.LSTM",
"tensorflow.sequence_mask",
"tensorflow.keras.experimental.SequenceFeatures"
] | sqlflow_models/lstmclassifier.py | [(15, 'tensorflow.keras.experimental.SequenceFeatures', 'tf.keras.experimental.SequenceFeatures', (['feature_columns'], {}), True, 'import tensorflow as tf\n'), (26, 'tensorflow.keras.layers.Dense', 'tf.keras.layers.Dense', (['hidden_size'], {'activation': '"""relu"""'}), True, 'import tensorflow as tf\n'), (34, 'tenso... |
tmkkk/fcn | e2d60fd5d54fd69f2b1d8280fe870f9af8cfda50 | import numpy as np
import tensorflow as tf
from tensorflow.keras.applications.vgg16 import VGG16
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, Conv2D, Dropout, Conv2DTranspose, Add
from tensorflow.keras.initializers import Zeros
def build_fcn32s(nb_classes, target_size=(None, No... | [
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Conv2DTranspose",
"tensorflow.keras.applications.vgg16.VGG16",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Add",
"tensorflow.keras.initializers.Zeros",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Input"
] | src/models.py | [(10, 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': '(*target_size, 3)'}), False, 'from tensorflow.keras.layers import Input, Conv2D, Dropout, Conv2DTranspose, Add\n'), (11, 'tensorflow.keras.applications.vgg16.VGG16', 'VGG16', ([], {'weights': '"""imagenet"""', 'include_top': '(False)', 'input_tensor': 'inp... |
aaavinash85/100-Days-of-ML- | d055d718f7972e3a4469279b9112867a42cf652f | # TensorFlow and tf.keras
import tensorflow as tf
from tensorflow import keras
# Helper libraries
import numpy as np
import matplotlib.pyplot as plt
print(tf.__version__)
fashion_mnist = keras.datasets.fashion_mnist
(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()
class_names = ... | [
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.yticks",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"matplotlib.pyplot.ylim",
"tensorflow.keras.layers.Dense",
"matplotlib.pyplot.colorbar",
"numpy.max",
"numpy.argmax",
"matplotlib.pyplot.subplot",
"m... | Tensorflow/fashionMni1.py | [(23, 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), True, 'import matplotlib.pyplot as plt\n'), (24, 'matplotlib.pyplot.imshow', 'plt.imshow', (['train_images[0]'], {}), True, 'import matplotlib.pyplot as plt\n'), (25, 'matplotlib.pyplot.colorbar', 'plt.colorbar', ([], {}), True, 'import matplotlib.pyplot as plt\... |
xihuaiwen/chinese_bert | 631afbc76c40b0ac033be2186e717885246f446c | """Configurable model specification for CosmoFlow"""
import tensorflow as tf
import tensorflow.keras.layers as layers
from .layers import scale_1p2
def build_model(input_shape, target_size,
conv_size=16, kernel_size=2, n_conv_layers=5,
fc1_size=128, fc2_size=64,
hidde... | [
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv3D",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.models.Sequential",
"tensorflow.keras.layers.Flatten"
] | code_examples/tensorflow/cosmoflow/models/cosmoflow.py | [(21, 'tensorflow.keras.models.Sequential', 'tf.keras.models.Sequential', ([], {}), True, 'import tensorflow as tf\n'), (24, 'tensorflow.keras.layers.Conv3D', 'layers.Conv3D', (['conv_size'], {'input_shape': 'input_shape'}), True, 'import tensorflow.keras.layers as layers\n'), (34, 'tensorflow.keras.layers.Flatten', 'l... |
xiaoweiChen/Tensorflow-2.x-Alexnet | d9161ba6764143d3d8e84bee2268b0ac8ad95355 |
import os, pathlib, PIL
from tqdm import tqdm
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.models import Sequential
from tensorflow.keras import Model
class AlexNet(Model):
def __init__(self, data_shape=(224, 224, 3), num_classes=1000):
super(Al... | [
"tensorflow.keras.models.load_model",
"tensorflow.keras.optimizers.Ftrl",
"tensorflow.keras.preprocessing.image.load_img",
"tensorflow.keras.layers.experimental.preprocessing.RandomFlip",
"numpy.max",
"tensorflow.keras.optimizers.SGD",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.optimizers.Na... | model.py | [(24, 'tensorflow.keras.layers.experimental.preprocessing.Rescaling', 'layers.experimental.preprocessing.Rescaling', (['(1.0 / 255)'], {}), False, 'from tensorflow.keras import layers\n'), (27, 'tensorflow.keras.layers.Conv2D', 'layers.Conv2D', ([], {'filters': '(96)', 'kernel_size': '(11, 11)', 'strides': '(4)', 'padd... |
Bodhis4ttva/LHC_Net | 8b47dff5117b078a99183afd1d103da06f37361c | from abc import ABC
import os
import random
import tensorflow as tf
import tensorflow_addons as tfa
import matplotlib.pyplot as plt
import numpy as np
from shutil import copyfile
import csv
from classification_models.tfkeras import Classifiers
import gc
def get_data(filename):
csvfile = open(filen... | [
"tensorflow.convert_to_tensor",
"tensorflow.image.central_crop",
"tensorflow.image.flip_left_right",
"tensorflow.image.resize",
"tensorflow.keras.metrics.CategoricalAccuracy",
"numpy.array",
"numpy.zeros"
] | Lib/Utils.py | [(17, 'csv.reader', 'csv.reader', (['csvfile'], {'delimiter': '""";"""'}), False, 'import csv\n'), (36, 'numpy.zeros', 'np.zeros', ([], {'shape': '(images.shape[0], 224, 224, 3)', 'dtype': '"""float32"""'}), True, 'import numpy as np\n'), (61, 'tensorflow.image.flip_left_right', 'tf.image.flip_left_right', ([], {'image... |
ixcc/federated | 3fb48ae6d019ee763c5112d23c3bdbcbaea17948 | # Lint as: python3
# Copyright 2018, The TensorFlow Federated 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 ... | [
"tensorflow.compat.v1.enable_v2_behavior",
"numpy.random.seed",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.layers.Dense",
"tensorflow.reshape",
"tensorflow.keras.metrics.SparseCategoricalAccuracy",
"tensorflow.keras.optimizers.SGD"
] | tensorflow_federated/python/examples/remote_executor_example.py | [(34, 'tensorflow.compat.v1.enable_v2_behavior', 'tf.compat.v1.enable_v2_behavior', ([], {}), True, 'import tensorflow as tf\n'), (38, 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""host"""', 'None', '"""The host to connect to."""'], {}), False, 'from absl import flags\n'), (39, 'absl.flags.mark_flag_as_requi... |
Xodarap/models | 08bb9eb5ad79e6bceffc71aeea6af809cc78694b | # 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 applica... | [
"tensorflow.convert_to_tensor",
"tensorflow.executing_eagerly",
"tensorflow.train.latest_checkpoint",
"tensorflow.range",
"tensorflow.train.Checkpoint",
"tensorflow.io.gfile.GFile",
"tensorflow.function",
"tensorflow.summary.scalar",
"tensorflow.keras.metrics.Mean",
"tensorflow.GradientTape"
] | official/modeling/model_training_utils.py | [(36, 'os.path.join', 'os.path.join', (['model_dir', 'checkpoint_prefix'], {}), False, 'import os\n'), (38, 'absl.logging.info', 'logging.info', (['"""Saving model as TF checkpoint: %s"""', 'saved_path'], {}), False, 'from absl import logging\n'), (77, 'os.path.join', 'os.path.join', (['model_dir', '_SUMMARY_TXT'], {})... |
nick-monto/EARShot_TF2 | c1628344b668a5f7ef4bb763e49432b8780c93eb | from numpy import power,min,max,floor
import tensorflow as tf
from tensorflow.keras import Model, Sequential, optimizers, losses
from tensorflow.keras.layers import Dense, GRU, Input, Masking, LSTM
from tensorflow.keras.callbacks import LearningRateScheduler
tf.keras.backend.set_floatx('float64')
'''
Learning rate ad... | [
"tensorflow.keras.layers.Masking",
"numpy.power",
"tensorflow.keras.backend.set_floatx",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.losses.MeanSquaredError",
"tensorflow.keras.callbacks.LearningRateScheduler",
"tensorflow.keras.losses.BinaryCrossentropy",
"tensorflow.keras.optimizers.SGD",
"... | earshot/model.py | [(7, 'tensorflow.keras.backend.set_floatx', 'tf.keras.backend.set_floatx', (['"""float64"""'], {}), True, 'import tensorflow as tf\n'), (24, 'tensorflow.keras.callbacks.LearningRateScheduler', 'LearningRateScheduler', (['schedule'], {}), False, 'from tensorflow.keras.callbacks import LearningRateScheduler\n'), (37, 'te... |
epochlab/xres | 38df268f92efea6ec55909cbe87d3d089977cd88 | #!/usr/bin/env python3
from tensorflow.keras import Input, Model
from tensorflow.keras.layers import Conv2D, Lambda, BatchNormalization, UpSampling2D, Activation, LeakyReLU, PReLU, Add, Dense, Flatten
def edsr_residual(x, num_filters, scaling):
res = Conv2D(num_filters, 3, padding='same', activation='relu')(x)
... | [
"tensorflow.keras.layers.Activation",
"tensorflow.keras.Input",
"tensorflow.keras.layers.LeakyReLU",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.layers.PReLU",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.UpSampling2D",
"tensorflow.keras.Model",... | model/edsr.py | [(39, 'tensorflow.keras.Input', 'Input', ([], {'shape': 'input_shape'}), False, 'from tensorflow.keras import Input, Model\n'), (58, 'tensorflow.keras.Model', 'Model', ([], {'inputs': '[input_layer]', 'outputs': '[output]', 'name': '"""edsr_generator"""'}), False, 'from tensorflow.keras import Input, Model\n'), (68, 't... |
rahhul/GANs | cec9e2f81528099407b8a9d3dce2f1cf85e449be | # python3
import util
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Conv2D, Dropout, Flatten, LeakyReLU
from tensorflow.keras.layers import BatchNormalization
from tensorflow.keras.optimizers import Adam
from tensorflow.k... | [
"tensorflow.keras.layers.LeakyReLU",
"tensorflow.keras.initializers.glorot_normal",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.models.Sequential",
"tensorflow.keras.layers.Flatten"
] | cifar10/trainer/discriminator.py | [(15, 'tensorflow.keras.initializers.glorot_normal', 'glorot_normal', ([], {}), False, 'from tensorflow.keras.initializers import RandomNormal, glorot_normal, VarianceScaling\n'), (16, 'tensorflow.keras.models.Sequential', 'Sequential', ([], {}), False, 'from tensorflow.keras.models import Sequential\n'), (17, 'tensorf... |
MFrassek/CommittorEAE | 88a467e4500bc9ab69834209f4eaec9f2d0d7a61 | import numpy as np
import math
from matplotlib import cm
from matplotlib.colors import ListedColormap
from losses import binaryNegLikelihood
from tensorflow import keras
from data_read import get_toy_paths, get_TPS_and_TIS_paths
class Const():
def __init__(self, dataSetType):
self._dataSetType = dataSetTy... | [
"numpy.vstack",
"tensorflow.keras.losses.MeanAbsoluteError",
"numpy.linspace",
"matplotlib.cm.get_cmap"
] | NucleationModel/globalConstants.py | [(403, 'matplotlib.cm.get_cmap', 'cm.get_cmap', (['"""summer"""', 'resolution'], {}), False, 'from matplotlib import cm\n'), (406, 'matplotlib.cm.get_cmap', 'cm.get_cmap', (['"""Greys"""', '(10)'], {}), False, 'from matplotlib import cm\n'), (409, 'matplotlib.cm.get_cmap', 'cm.get_cmap', (['"""summer"""', 'resolution']... |
wilcoln/transformers | 6331d4fe59e85840bb5693837e791f4caedcd53b | # 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... | [
"tensorflow.convert_to_tensor",
"tensorflow.keras.models.load_model",
"tensorflow.math.abs",
"tensorflow.config.LogicalDeviceConfiguration",
"tensorflow.zeros",
"tensorflow.equal",
"tensorflow.debugging.assert_near",
"tensorflow.config.list_physical_devices",
"torch.no_grad",
"tensorflow.keras.Inp... | tests/test_modeling_tf_common.py | [(30, 'transformers.is_tf_available', 'is_tf_available', ([], {}), False, 'from transformers import is_tf_available\n'), (64, 'copy.deepcopy', 'copy.deepcopy', (['config'], {}), False, 'import copy\n'), (1088, 'tensorflow.constant', 'tf.constant', (['values'], {'shape': 'shape', 'dtype': '(dtype if dtype is not None el... |
QAlexBall/Learning_Py | 8a5987946928a9d86f6807555ed435ac604b2c44 | # Train a model
import tensorflow as tf
tf.executing_eagerly()
(mnist_images, mnist_labels), _ = tf.keras.datasets.mnist.load_data()
dataset = tf.data.Dataset.from_tensor_slices(
(tf.cast(mnist_images[..., tf.newaxis] / 255, tf.float32),
tf.cast(mnist_labels, tf.int64))
)
dataset = dataset.shuffle(1000).batc... | [
"tensorflow.debugging.assert_equal",
"tensorflow.executing_eagerly",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.layers.Dense",
"tensorflow.cast",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.datasets.mnist.load_da... | Three_Part_Moudule/Tensoflow-v2-beta/Eager_Execution/train_model.py | [(3, 'tensorflow.executing_eagerly', 'tf.executing_eagerly', ([], {}), True, 'import tensorflow as tf\n'), (5, 'tensorflow.keras.datasets.mnist.load_data', 'tf.keras.datasets.mnist.load_data', ([], {}), True, 'import tensorflow as tf\n'), (24, 'tensorflow.keras.optimizers.Adam', 'tf.keras.optimizers.Adam', ([], {}), Tr... |
DhruvAwasthi/TensorFlowSpecialization | aeaa57eefd74f96f7389458662e050667eab7a54 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
# ATTENTION: Please do not alter any of the provided code in the exercise. Only add your own code where indicated
# ATTENTION: Please do not add or remove any cells in the exercise. The grader will check specific cells based on the cell position.
# ATTENTION: Please use... | [
"tensorflow.keras.metrics.mean_absolute_error",
"numpy.arange",
"numpy.cos",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.grid",
"numpy.exp",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show",
"tensorflow.keras.metrics.mean_squared_error",
"numpy.r... | 4. Sequences, Time Series and Prediction/Week 1/Exercise_1_Create_and_predict_synthetic_data_Question-FINAL.py | [(50, 'numpy.arange', 'np.arange', (['(4 * 365 + 1)'], {'dtype': '"""float32"""'}), True, 'import numpy as np\n'), (63, 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 6)'}), True, 'import matplotlib.pyplot as plt\n'), (65, 'matplotlib.pyplot.show', 'plt.show', ([], {}), True, 'import matplotlib.pyplot... |
gabrielmahia/obamAI | ba45f0a6efae793d7f5e356a1dbf5c6835a65dba | """Build, train and evaluate an IIC Model
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.keras.layers import Input, Dense, Flatten
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import Adam
from tensorflow.... | [
"tensorflow.keras.backend.repeat_elements",
"tensorflow.keras.backend.batch_dot",
"tensorflow.keras.models.Model",
"numpy.reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.backend.sum",
"tensorflow.keras.callbacks.LearningRateScheduler",
"tensorflow.keras.utils.plot_model",
"tensorflow.ke... | chapter13-mi-unsupervised/iic-13.5.1.py | [(196, 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""IIC Keras"""'}), False, 'import argparse\n'), (244, 'vgg.VGG', 'vgg.VGG', (["vgg.cfg['F']"], {}), False, 'import vgg\n'), (46, 'data_generator.DataGenerator', 'DataGenerator', (['args'], {'siamese': '(True)'}), False, 'from data_gener... |
ryoma-jp/samples | 85c0be62f9de1194121d225adee12c9810229960 | #! -*- coding: utf-8 -*-
#---------------------------------
# モジュールのインポート
#---------------------------------
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras.preprocessing.image import ImageDataGenerator
#-----... | [
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"tensorflow.keras.layers.ZeroPadding2D",
"tensorflow.keras.optimizers.SGD",
"tensorflow.keras.applications.resnet50.ResNet50",
"matplotlib.pyplot.tight_layout",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.keras.layers.Conv2D",
... | python/tensorflow_sample/Ver2.x/06_optimizer/trainer/trainer.py | [(83, 'os.path.join', 'os.path.join', (['self.output_dir', '"""checkpoints"""', '"""model.ckpt"""'], {}), False, 'import os\n'), (84, 'tensorflow.keras.callbacks.ModelCheckpoint', 'keras.callbacks.ModelCheckpoint', (['checkpoint_path'], {'save_weights_only': '(True)', 'verbose': '(1)'}), False, 'from tensorflow import ... |
a5372935/Oct_resnet18 | 9e835634151398bb6704c251807d28b21fde5b86 | import numpy as np
import warnings
from tensorflow.keras.layers import Input, Conv2D, BatchNormalization, Activation, ZeroPadding2D, AveragePooling2D, MaxPooling2D, GlobalAveragePooling2D, GlobalMaxPooling2D
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import add, Flatten
from tensorflo... | [
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.backend.image_data_format",
"tensorflow.keras.models.Model",
"tensorflow.keras.backend.is_keras_tensor",
"tensorflow.keras.layers.Dense",
"tensorflow.ke... | Resnet_models/res50.py | [(35, 'tensorflow.keras.layers.add', 'add', (['[x, input_tensor]'], {}), False, 'from tensorflow.keras.layers import add, Flatten\n'), (66, 'tensorflow.keras.layers.add', 'add', (['[x, shortcut]'], {}), False, 'from tensorflow.keras.layers import add, Flatten\n'), (147, 'tensorflow.keras.models.Model', 'Model', (['inpu... |
blueprintparadise/Embedding_Facenet | 9b4004243047a82f95739ad1cb508019d762e83b | from Face_Recog.basemodels import VGGFace
import os
from pathlib import Path
import gdown
import numpy as np
import tensorflow as tf
tf_version = int(tf.__version__.split(".")[0])
if tf_version == 1:
import keras
from keras.models import Model, Sequential
from keras.layers import Convolution2D, Flatten, Activation... | [
"tensorflow.__version__.split",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Convolution2D",
"tensorflow.keras.models.Sequential",
"numpy.sum",
"tensorflow.keras.layers.Flatten"
] | Face_Recog/extendedmodels/Age.py | [(23, 'Face_Recog.basemodels.VGGFace.baseModel', 'VGGFace.baseModel', ([], {}), False, 'from Face_Recog.basemodels import VGGFace\n'), (28, 'tensorflow.keras.models.Sequential', 'Sequential', ([], {}), False, 'from tensorflow.keras.models import Model, Sequential\n'), (35, 'tensorflow.keras.models.Model', 'Model', ([],... |
MLPA-DKU/Gait-Analysis | 2c288561be65e76bebd894df8293d856c4078e2c | import tensorflow as tf
import tensorflow.keras as keras
from tensorflow.keras.models import Model
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Dropout
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Input... | [
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv1D",
"tensorflow.keras.backend.sum",
"tensorflow.stack",
"tensorflow.keras.layers.LSTM",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.Flatten",
"numpy.zeros",
"tensorflow.keras.... | Code/Model/cropNet_model.py | [(112, 'tensorflow.keras.layers.Flatten', 'Flatten', (['lstm2'], {'name': 'f"""{idx}_gen_lstm_flatten"""'}), False, 'from tensorflow.keras.layers import Flatten\n'), (141, 'tensorflow.keras.layers.Input', 'Input', (['shape_list[0]'], {}), False, 'from tensorflow.keras.layers import Input\n'), (142, 'tensorflow.keras.la... |
AshivDhondea/DFTS_compat_v1 | 976e6087ff629c45f7bbc79a3de25718ed143db5 | """
Downloading and saving Keras models as h5 files.
including the top, in order to do inference later on.
@Hans Dhondea
4 August 2020
"""
import tensorflow as tf
print('TensorFlow version')
print(tf.__version__)
print('VGG16')
vgg16_model = tf.keras.applications.VGG16(weights='imagenet',include_top=True)
vgg16_mo... | [
"tensorflow.keras.applications.ResNet50V2",
"tensorflow.keras.utils.plot_model",
"tensorflow.keras.applications.VGG19",
"tensorflow.keras.applications.Xception",
"tensorflow.keras.applications.ResNet50",
"tensorflow.keras.applications.VGG16",
"tensorflow.keras.applications.InceptionResNetV2"
] | keras_models/main_save_keras_models.py | [(16, 'tensorflow.keras.applications.VGG16', 'tf.keras.applications.VGG16', ([], {'weights': '"""imagenet"""', 'include_top': '(True)'}), True, 'import tensorflow as tf\n'), (19, 'tensorflow.keras.utils.plot_model', 'tf.keras.utils.plot_model', (['vgg16_model'], {'to_file': '"""main_save_keras_models_vgg16_model_archit... |
aarkwright/arkml | a2f3d9bea5298233187d9c82457ed9e83cd37ceb | import glob
import matplotlib.pyplot as plt
from tensorflow.keras.applications.inception_v3 import InceptionV3, preprocess_input
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from keras.optimizers import SGD
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Dense, Glob... | [
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.applications.inception_v3.InceptionV3"
] | transfer_learn.py | [(79, 'tensorflow.keras.applications.inception_v3.InceptionV3', 'InceptionV3', ([], {'weights': '"""imagenet"""', 'include_top': '(False)'}), False, 'from tensorflow.keras.applications.inception_v3 import InceptionV3, preprocess_input\n'), (93, 'tensorflow.keras.models.Model', 'Model', ([], {'inputs': 'InceptionV3_base... |
kimbfs/Proyecto | 3065b2d721365d3e92d93bc449c1cea92bbf4ed8 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""YOLO_v3 VGG16 Model Defined in Keras."""
from tensorflow.keras.layers import Conv2D, UpSampling2D, Concatenate, MaxPooling2D
from tensorflow.keras.models import Model
from tensorflow.keras.applications.vgg16 import VGG16
from common.backbones.layers import YoloConv2D
... | [
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.UpSampling2D",
"tensorflow.keras.applications.vgg16.VGG16",
"tensorflow.keras.models.Model"
] | yolo3/models/yolo3_vgg16.py | [(38, 'tensorflow.keras.applications.vgg16.VGG16', 'VGG16', ([], {'input_tensor': 'inputs', 'weights': '"""imagenet"""', 'include_top': '(False)'}), False, 'from tensorflow.keras.applications.vgg16 import VGG16\n'), (52, 'yolo3.models.layers.make_last_layers', 'make_last_layers', (['x', '(512)', '(num_anchors * (num_cl... |
Neronjust2017/keras-project | 919e67e10b0bf518eb9cc63df68c79fe2bb71b36 | # -*- coding: utf-8 -*-
import os
import numpy as np
import tensorflow as tf
import tensorflow.keras as keras
from tensorflow.keras.layers import Input, Multiply, GlobalAveragePooling1D, Add, Dense, Activation, ZeroPadding1D, \
BatchNormalization, Flatten, Conv1D, AveragePooling1D, MaxPooling1D, GlobalMaxPooling1D,... | [
"numpy.expand_dims",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.UpSampling1D",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.GlobalAveragePooling1D",
"tensorflow.keras.layers.MaxPooling1D",
"numpy.concatenate",
"tensorflow.keras.layers... | models/classification/resnet_attention.py | [(316, 'utils.AFClassication.data.loaddata', 'loaddata', ([], {}), False, 'from utils.AFClassication.data import loaddata\n'), (327, 'numpy.concatenate', 'np.concatenate', (['(X_train[0], Xval[0])'], {'axis': '(0)'}), True, 'import numpy as np\n'), (328, 'numpy.concatenate', 'np.concatenate', (['(y_train, yval)'], {'ax... |
zeeshanbasar/devnagri-classifier | ccd0ba76e0b9c015c5c18e6d8d3d5e5c86900ee8 | # basic imports
import numpy as np
#import matplotlib.pyplot as plt
#import os
#import cv2
import pickle
import tensorflow as tf
from tensorflow.keras.models import Sequential
import tensorflow.keras.layers as tfl
#from tensorflow.keras.callbacks import TensorBoard, LearningRateScheduler, EarlyStopping
#impor... | [
"tensorflow.compat.v1.ConfigProto",
"tensorflow.keras.layers.Activation",
"tensorflow.compat.v1.GPUOptions",
"tensorflow.keras.losses.CategoricalCrossentropy",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.optimizers.Adam",... | devnagri-script-detection_test2.py | [(21, 'tensorflow.compat.v1.GPUOptions', 'tf.compat.v1.GPUOptions', ([], {'per_process_gpu_memory_fraction': '(0.333)'}), True, 'import tensorflow as tf\n'), (38, 'numpy.array', 'np.array', (['y'], {}), True, 'import numpy as np\n'), (39, 'tensorflow.keras.utils.to_categorical', 'tf.keras.utils.to_categorical', (['y'],... |
yubozhao/BentoML | 0d56b35e7a6969947c77a8cea685190f2196440f | # pylint: disable=redefined-outer-name
import json
import numpy as np
import pytest
import tensorflow as tf
import bentoml
from tests.bento_service_examples.tensorflow_classifier import Tensorflow2Classifier
from tests.integration.api_server.conftest import (
build_api_server_docker_image,
export_service_bund... | [
"numpy.asfarray",
"tensorflow.TensorSpec",
"tensorflow.matmul",
"tensorflow.keras.initializers.Ones"
] | tests/integration/test_tensorflow_v2_2_savedmodel_artifact.py | [(22, 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), False, 'import pytest\n'), (57, 'pytest.fixture', 'pytest.fixture', ([], {'params': '[TfKerasModel, TfNativeModel]', 'scope': '"""session"""'}), False, 'import pytest\n'), (62, 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}... |
julesmuhizi/qkeras | eec5a4a9f1930d0ee51319ab7363dd038a6e68c5 | # Copyright 2019 Google LLC
#
#
# 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 to in writing,... | [
"tensorflow.keras.layers.DepthwiseConv2D",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.Input"
] | tests/print_qstats_test.py | [(34, 'tensorflow.keras.layers.Input', 'Input', (['(28, 28, 1)'], {}), False, 'from tensorflow.keras.layers import Input\n'), (39, 'tensorflow.keras.models.Model', 'Model', ([], {'inputs': 'xi', 'outputs': 'x'}), False, 'from tensorflow.keras.models import Model\n'), (44, 'tensorflow.keras.layers.Input', 'Input', (['(2... |
micheleFraccaroli/autokeras | 4c0e36dc0a5418355952dd74f74b2b6e7e87ebf1 | # Copyright 2020 The AutoKeras 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 to i... | [
"tensorflow.keras.layers.experimental.preprocessing.RandomRotation",
"tensorflow.keras.layers.experimental.preprocessing.RandomTranslation",
"tensorflow.keras.layers.experimental.preprocessing.TextVectorization",
"tensorflow.keras.layers.experimental.preprocessing.RandomContrast",
"tensorflow.keras.layers.e... | autokeras/blocks/preprocessing.py | [(44, 'tensorflow.python.util.nest.flatten', 'nest.flatten', (['inputs'], {}), False, 'from tensorflow.python.util import nest\n'), (45, 'tensorflow.keras.layers.experimental.preprocessing.Normalization', 'preprocessing.Normalization', ([], {'axis': 'self.axis'}), False, 'from tensorflow.keras.layers.experimental impor... |
micheleFraccaroli/autokeras | 4c0e36dc0a5418355952dd74f74b2b6e7e87ebf1 | # Copyright 2020 The AutoKeras 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 to i... | [
"tensorflow.python.util.nest.flatten",
"tensorflow.keras.callbacks.History",
"tensorflow.keras.metrics.CategoricalAccuracy",
"tensorflow.summary.scalar",
"tensorflow.keras.metrics.Mean",
"tensorflow.GradientTape"
] | autokeras/utils/utils.py | [(31, 'tensorflow.python.util.nest.flatten', 'nest.flatten', (['inputs'], {}), False, 'from tensorflow.python.util import nest\n'), (40, 're.sub', 're.sub', (['"""(.)([A-Z][a-z0-9]+)"""', '"""\\\\1_\\\\2"""', 'name'], {}), False, 'import re\n'), (154, 'tensorflow.keras.callbacks.History', 'History', ([], {}), False, 'f... |
exajobs/machine-learning-collection | 84444f0bfe351efea6e3b2813e47723bd8d769cc |
# coding: utf-8
# # Script for testing the TensorFlow 2.0 setup
#
# This script is for testing the TensorFlow
# (https://www.tensorflow.org/) setup using the Keras API
# (https://keras.io/). Below is a set of required imports.
#
# No error messages should appear. In particular, **TensorFlow 2 is
# required**.
#
... | [
"tensorflow.keras.layers.Activation",
"tensorflow.python.client.device_lib.list_local_devices",
"tensorflow.keras.layers.Dense",
"numpy.random.rand",
"tensorflow.test.is_gpu_available",
"tensorflow.keras.models.Sequential",
"numpy.random.randint"
] | machine-learning-scripts/examples/tf2-test.py | [(37, 'tensorflow.test.is_gpu_available', 'tf.test.is_gpu_available', ([], {}), True, 'import tensorflow as tf\n'), (55, 'tensorflow.keras.models.Sequential', 'Sequential', ([], {}), False, 'from tensorflow.keras.models import Sequential\n'), (78, 'numpy.random.rand', 'np.random.rand', (['(128)', '(100)'], {}), True, '... |
tansyab1/PhD-project | 15f170c1976e58697454cd992687d808d1b2284a | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
#Importing all required libraries
# In[1]:
from __future__ import absolute_import, division, print_function, unicode_literals
# In[2]:
import tensorflow as tf
import pathlib
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense... | [
"matplotlib.pyplot.legend",
"tensorflow.keras.models.load_model",
"numpy.expand_dims",
"matplotlib.pyplot.plot",
"tensorflow.config.list_physical_devices",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.keras.optimizers.RMSpro... | 2021/src/Classification/Fine-Tuned-ResNet-50/Fine-Tuned-ResNet-50.py | [(48, 'tensorflow.config.list_physical_devices', 'tf.config.list_physical_devices', (['"""GPU"""'], {}), True, 'import tensorflow as tf\n'), (49, 'tensorflow.config.experimental.set_memory_growth', 'tf.config.experimental.set_memory_growth', (['physical_devices[0]', '(True)'], {}), True, 'import tensorflow as tf\n'), (... |
pyoung2778/models | 45fd9249893b07b73447cf849a770891734c7e3a | # Copyright 2021 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 applica... | [
"tensorflow.keras.losses.categorical_crossentropy",
"tensorflow.keras.metrics.RecallAtPrecision",
"tensorflow.cast",
"tensorflow.keras.metrics.CategoricalAccuracy",
"tensorflow.add_n",
"tensorflow.keras.regularizers.l2",
"tensorflow.io.VarLenFeature",
"tensorflow.keras.layers.InputSpec",
"tensorflow... | official/vision/beta/tasks/video_classification.py | [(29, 'official.core.task_factory.register_task_cls', 'task_factory.register_task_cls', (['exp_cfg.VideoClassificationTask'], {}), False, 'from official.core import task_factory\n'), (59, 'tensorflow.keras.layers.InputSpec', 'tf.keras.layers.InputSpec', ([], {'shape': '([None] + common_input_shape)'}), True, 'import te... |
koreybea/tensorflow | e252fffb16f2706688604dc91c426bae367ae5e8 | # 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 applica... | [
"tensorflow.python.data.ops.dataset_ops.Dataset.from_tensors",
"tensorflow.python.keras.Input",
"tensorflow.python.framework.config.set_soft_device_placement",
"tensorflow.python.data.ops.dataset_ops.Dataset.from_tensor_slices",
"tensorflow.python.keras.Model",
"tensorflow.python.keras.layers.preprocessin... | tensorflow/python/keras/layers/preprocessing/text_vectorization_distribution_test.py | [(33, 'tensorflow.python.framework.test_combinations.combine', 'combinations.combine', ([], {'distribution': 'all_strategies', 'mode': "['eager']"}), True, 'from tensorflow.python.framework import test_combinations as combinations\n'), (92, 'tensorflow.python.platform.test.main', 'test.main', ([], {}), False, 'from ten... |
qixuanf/uncertainty-baselines | e965d4e3129825f5710a26a8877d6d8703bbf023 | # coding=utf-8
# Copyright 2021 The Uncertainty Baselines 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 ap... | [
"numpy.ones_like",
"tensorflow.io.gfile.exists",
"tensorflow.keras.metrics.AUC",
"tensorflow.io.gfile.makedirs",
"numpy.ceil",
"numpy.zeros_like",
"numpy.array",
"tensorflow.keras.metrics.Mean"
] | baselines/jft/heteroscedastic.py | [(51, 'ml_collections.config_flags.DEFINE_config_file', 'ml_collections.config_flags.DEFINE_config_file', (['"""config"""', 'None', '"""Training configuration."""'], {'lock_config': '(True)'}), False, 'import ml_collections\n'), (54, 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""output_dir"""'], {'default': ... |
hina-shah/US-famli | f927c89ec9cb51f9e511bbdfa2f59ce15e0e8730 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from tensorflow.keras import layers
import json
import os
import glob
import sys
class Attention(layers.Layer):
def __init__(self, k=25, mask=None, name='attentio... | [
"tensorflow.concat",
"tensorflow.reduce_sum",
"tensorflow.cast",
"tensorflow.nn.sigmoid_cross_entropy_with_logits",
"tensorflow.summary.scalar",
"tensorflow.keras.Input",
"tensorflow.keras.layers.GRU",
"tensorflow.keras.layers.GaussianNoise",
"tensorflow.math.divide",
"tensorflow.keras.layers.Mask... | src/py/dl/nn_v2/gru_ga_nn.py | [(174, 'tensorflow.function', 'tf.function', ([], {'experimental_relax_shapes': '(True)'}), True, 'import tensorflow as tf\n'), (17, 'tensorflow.keras.layers.Dense', 'layers.Dense', (['(1)'], {'activation': '"""relu"""', 'use_bias': '(False)'}), False, 'from tensorflow.keras import layers\n'), (28, 'tensorflow.reshape'... |
yasin-gh/Deep-Learning-for-Computer-Vision | d5b3e153369018029270a6a47349ee8ce7c7641e | import tensorflow as tf
input_height = 360
input_width = 480
kernel = 3
filter_size = 64
pad = 1
pool_size = 2
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Layer(input_shape=(3, input_height, input_width)))
# encoder
model.add(tf.keras.layers.ZeroPadding2D(padding=(pad, pad)))
model.add(tf.keras.la... | [
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.UpSampling2D",
"tensorflow.keras.layers.Layer",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.Permute",
"tensorflow.keras.layers.ZeroPadding2D",
"tensorflow.keras.layers.Reshape",
... | Chapter05/1_segnet.py | [(10, 'tensorflow.keras.models.Sequential', 'tf.keras.models.Sequential', ([], {}), True, 'import tensorflow as tf\n'), (11, 'tensorflow.keras.layers.Layer', 'tf.keras.layers.Layer', ([], {'input_shape': '(3, input_height, input_width)'}), True, 'import tensorflow as tf\n'), (14, 'tensorflow.keras.layers.ZeroPadding2D'... |
zhangAlwin/tf_keras_models | 054c9e596325bcafd107c3f51abf018daab98a14 | # -*- coding: utf-8 -*-
'''
@CreateTime : 2021/12/07 12:43:25
@Author : Alwin Zhang
@Mail : zjfeng@homaytech.com
'''
import tensorflow as tf
from tensorflow.keras.layers import Embedding, Conv1D, GlobalAveragePooling1D, Dense, Concatenate, GlobalMaxPooling1D
from tensorflow.keras import Model
class TextCNN(... | [
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.Input",
"tensorflow.keras.layers.Embedding",
"tensorflow.keras.layers.GlobalMaxPooling1D",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv1D"
] | textcnn/model.py | [(28, 'tensorflow.keras.layers.Embedding', 'Embedding', ([], {'input_dim': 'max_features', 'output_dim': 'embedding_dims', 'input_length': 'max_len'}), False, 'from tensorflow.keras.layers import Embedding, Conv1D, GlobalAveragePooling1D, Dense, Concatenate, GlobalMaxPooling1D\n'), (36, 'tensorflow.keras.layers.Dense',... |
ak110/pytoolk | 8eef7e0add7bbc0ced1f1f1d82ed245388cc6684 | """EfficientNet。
参考: 本来の入力サイズ
- B0: 224
- B1: 240
- B2: 260
- B3: 300
- B4: 380
- B5: 456
- B6: 528
- B7: 600
"""
import tensorflow as tf
def create_b0(
include_top=False, input_shape=None, input_tensor=None, weights="noisy-student"
):
"""ネットワークの作成。"""
import efficientnet.tfkeras as efn
return e... | [
"tensorflow.keras.applications.imagenet_utils.preprocess_input"
] | pytoolkit/applications/efficientnet.py | [(26, 'efficientnet.tfkeras.EfficientNetB0', 'efn.EfficientNetB0', ([], {'include_top': 'include_top', 'input_shape': 'input_shape', 'input_tensor': 'input_tensor', 'weights': 'weights'}), True, 'import efficientnet.tfkeras as efn\n'), (40, 'efficientnet.tfkeras.EfficientNetB1', 'efn.EfficientNetB1', ([], {'include_top... |
dwhite54/arcface-tf2 | b835b17238503942580a325bb408644120b61230 | import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import (
Dense,
Dropout,
Flatten,
Input,
)
from tensorflow.keras.applications import (
MobileNetV2,
ResNet50
)
from .layers import (
BatchNormalization,
ArcMarginPenaltyLogists
)
def _regularizer(we... | [
"tensorflow.norm",
"tensorflow.keras.regularizers.l2",
"tensorflow.keras.Model",
"tensorflow.keras.applications.ResNet50",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.applications.MobileNetV2",
"tensorflow.keras.layers.Input"
] | modules/models.py | [(20, 'tensorflow.keras.regularizers.l2', 'tf.keras.regularizers.l2', (['weights_decay'], {}), True, 'import tensorflow as tf\n'), (80, 'tensorflow.keras.layers.Input', 'Input', (['[size, size, channels]'], {'name': '"""input_image"""'}), False, 'from tensorflow.keras.layers import Dense, Dropout, Flatten, Input\n'), (... |
rostekus/recognition_of_handwritten_digits | 1cdc86572b1aad8da126cd5623a8e857aa6bbc55 | #Import all Necessary Libraries
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, Lambda, MaxPooling2D, Flatten, BatchNormalization, Dense
from tensorflow.keras.utils import to_categorical
import matplotlib.pyplot as plt
from sklearn.model_selection impor... | [
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"sklearn.model_selection.train_test_split",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.utils.normalize",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.callbacks.EarlyS... | model_training.py | [(22, 'sklearn.datasets.fetch_openml', 'fetch_openml', (['"""mnist_784"""'], {}), False, 'from sklearn.datasets import fetch_openml\n'), (35, 'tensorflow.keras.utils.normalize', 'tf.keras.utils.normalize', (['X'], {'axis': '(1)'}), True, 'import tensorflow as tf\n'), (38, 'sklearn.model_selection.train_test_split', 'tr... |
maximoskp/guitar_tab_transcription | 2c4e3b4feb8b2c35020db050c89d33c5165798b1 | # -*- coding: utf-8 -*-
"""
Created on Sun Oct 3 07:30:57 2021
@author: user
"""
import numpy as np
import sys
if sys.version_info >= (3,8):
import pickle
else:
import pickle5 as pickle
import tensorflow as tf
from tensorflow import keras
import os
import matplotlib.pyplot as plt
sys.path.insert(1, '..')
imp... | [
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2DTranspose",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.callbacks.CSVLogger",
"tensorflow.keras.layers.... | flat_tab_in_CNN/train_tab_flat_CNN_out.py | [(18, 'sys.path.insert', 'sys.path.insert', (['(1)', '""".."""'], {}), False, 'import sys\n'), (48, 'tensorflow.keras.models.Sequential', 'keras.models.Sequential', ([], {}), False, 'from tensorflow import keras\n'), (67, 'os.makedirs', 'os.makedirs', (['"""models/tab_flat_CNN_out"""'], {'exist_ok': '(True)'}), False, ... |
abogdanova/FedMed | 72f238c31b6714c664e1b0e40204f9528f764182 | from __future__ import absolute_import, division, print_function
import collections
import numpy as np
from six.moves import range
import tensorflow as tf
import datetime
from tensorflow_federated import python as tff
from tensorflow.python.keras.optimizer_v2 import gradient_descent
from tensorflow.keras import layer... | [
"tensorflow.compat.v1.enable_v2_behavior",
"numpy.random.choice",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.losses.sparse_categorical_crossentropy",
"tensorflow.keras.datasets.cifar10.load_data",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.metri... | Past_experiments/nB128C4.py | [(14, 'tensorflow.compat.v1.enable_v2_behavior', 'tf.compat.v1.enable_v2_behavior', ([], {}), True, 'import tensorflow as tf\n'), (29, 'tensorflow.keras.datasets.cifar10.load_data', 'tf.keras.datasets.cifar10.load_data', ([], {}), True, 'import tensorflow as tf\n'), (39, 'tensorflow_federated.python.learning.build_fede... |
PsycheShaman/Keras-GAN | 9a1f2576af8f67fad7845421ea5feb53012c1c9f | from __future__ import print_function, division
import tensorflow as tf
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import Input, Dense, Reshape, Flatten, Dropout, MaxPooling2D
from tensorflow.keras.layers import BatchNormalization, Activation, ZeroPadding2D, Reshape
#from tensorflow.kera... | [
"numpy.expand_dims",
"numpy.max",
"tensorflow.keras.backend.log",
"numpy.random.randint",
"tensorflow.keras.layers.Conv2D",
"matplotlib.pyplot.close",
"numpy.load",
"numpy.repeat",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.models.Sequential",
"numpy.zeros",
"tensorflow.keras.models.... | bgan/bgan9/bgan9.py | [(21, 'numpy.load', 'np.load', (['"""C:/Users/Gerhard/Documents/6_tracklets_large_calib_train/0_tracks.npy"""'], {}), True, 'import numpy as np\n'), (23, 'numpy.load', 'np.load', (['"""C:/Users/Gerhard/Documents/6_tracklets_large_calib_train/0_info_set.npy"""'], {}), True, 'import numpy as np\n'), (27, 'numpy.repeat', ... |
NodLabs/SHARK | 71f5cfcb30b3e7032c6d1d9f952860ff7769afa0 | from iree import runtime as ireert
from iree.tf.support import module_utils
from iree.compiler import tf as tfc
from iree.compiler import compile_str
from absl import app
import time
import numpy as np
import os
import tensorflow as tf
from official.nlp.modeling import layers
from official.nlp.modeling import network... | [
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.optimizers.SGD",
"tensorflow.GradientTape",
"tensorflow.function",
"tensorflow.TensorSpec",
"numpy.random.randint"
] | tank/tf/bert_large_run.py | [(22, 'tensorflow.TensorSpec', 'tf.TensorSpec', ([], {'shape': '[BATCH_SIZE, SEQUENCE_LENGTH]', 'dtype': 'tf.int32'}), True, 'import tensorflow as tf\n'), (23, 'tensorflow.TensorSpec', 'tf.TensorSpec', ([], {'shape': '[BATCH_SIZE, SEQUENCE_LENGTH]', 'dtype': 'tf.int32'}), True, 'import tensorflow as tf\n'), (24, 'tenso... |
sv641/km | fc7c70bf691692a06f219c2c6a8f658a91e81ae6 | # USAGE
# Start the server:
# python app.py
# Submit a request via cURL:
# curl -X POST -F image=@dog.jpg 'http://localhost:5000/predict'
# import the necessary packages
from tensorflow.keras.applications import ResNet50
from tensorflow.keras.preprocessing.image import img_to_array
from tensorflow.keras.applic... | [
"tensorflow.compat.v1.get_default_graph",
"numpy.expand_dims",
"tensorflow.keras.applications.imagenet_utils.preprocess_input",
"tensorflow.keras.applications.imagenet_utils.decode_predictions",
"tensorflow.compat.v1.Session",
"tensorflow.keras.applications.ResNet50",
"tensorflow.python.keras.backend.se... | demo/test-app/app.py | [(20, 'tensorflow.python.framework.ops.disable_eager_execution', 'disable_eager_execution', ([], {}), False, 'from tensorflow.python.framework.ops import disable_eager_execution\n'), (23, 'flask.Flask', 'flask.Flask', (['__name__'], {}), False, 'import flask\n'), (26, 'tensorflow.compat.v1.Session', 'tf.compat.v1.Sessi... |
n-hutton/colearn | 4e1257dae1316a4366a745fa965ea5e28d0ead14 | # ------------------------------------------------------------------------------
#
# Copyright 2021 Fetch.AI Limited
#
# 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://w... | [
"tensorflow.keras.Input",
"numpy.random.seed",
"tensorflow.keras.layers.Dense",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.keras.layers.Conv2D",
"numpy.arange",
"tensorflow.keras.Model",
"tensorflow.keras.metrics.SparseCategoricalAccuracy",
"tensorflow.keras.layers.MaxPooling2D",
"t... | colearn_keras/keras_cifar10.py | [(81, 'colearn_grpc.factory_registry.FactoryRegistry.register_model_architecture', 'FactoryRegistry.register_model_architecture', (['"""KERAS_CIFAR10"""', "['KERAS_CIFAR10']"], {}), False, 'from colearn_grpc.factory_registry import FactoryRegistry\n'), (129, 'colearn_grpc.factory_registry.FactoryRegistry.register_datal... |
prashantramnani/nn_likelihoods | 94e7a1d8fdf8c4e635eeaa66a7e941aa6b226f41 | import tensorflow as tf
from tensorflow import keras
import os
import pandas as pd
# Function asks for a dictionary as input with the following keys (and associated datatypes)
# params = {'input_shape': 3,
# 'output_shape': 1,
# 'output_activation': 'sigmoid',
# 'hidden_layers': [20, 20... | [
"tensorflow.keras.layers.Dense",
"tensorflow.keras.regularizers.l1_l2",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Input"
] | dnnreg_model_keras.py | [(33, 'tensorflow.keras.layers.Input', 'keras.layers.Input', ([], {'shape': "(params['input_shape'],)"}), False, 'from tensorflow import keras\n'), (56, 'tensorflow.keras.models.Model', 'keras.models.Model', ([], {'inputs': 'inputs', 'outputs': 'outputs'}), False, 'from tensorflow import keras\n'), (53, 'tensorflow.ker... |
jonarani/IAS0360_project | 1f8182dcf6edcba6607a0f287fa3fbaab05f50fd | import json
from PIL.Image import SEQUENCE
import matplotlib
import matplotlib.pyplot as plt
from numpy.random.mtrand import shuffle
import cv2
import numpy as np
import scipy.ndimage as scpy
from tensorflow.keras.layers import Conv2D, MaxPool2D, Dropout, BatchNormalization, Flatten
from tensorflow.keras.callbacks impo... | [
"tensorflow.lite.TFLiteConverter.from_keras_model",
"numpy.random.random",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"scipy.ndimage.median_filter",
"tensorflow.keras.layers.MaxPool2D",
"numpy.random.shuffle",
"numpy.co... | source/preprocess_and_train.py | [(84, 'numpy.copy', 'np.copy', (['img'], {}), True, 'import numpy as np\n'), (85, 'numpy.mean', 'np.mean', (['image'], {}), True, 'import numpy as np\n'), (203, 'random.shuffle', 'random.shuffle', (['img_label_tuple'], {}), False, 'import random\n'), (209, 'numpy.array', 'np.array', (['imgs[:training_amount]'], {}), Tr... |
riverliuc/transformers | 3f51e6a35871fefbdfb705902355d7530a72d1b8 | # 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... | [
"tensorflow.convert_to_tensor",
"numpy.asarray",
"tensorflow.python.keras.backend.int_shape",
"tensorflow.keras.utils.register_keras_serializable",
"tensorflow.python.keras.saving.hdf5_format.load_attributes_from_hdf5_group",
"tensorflow.rank",
"tensorflow.math.reduce_any",
"tensorflow.gather",
"ten... | src/transformers/modeling_tf_utils.py | [(50, 'tensorflow.get_logger', 'tf.get_logger', ([], {}), True, 'import tensorflow as tf\n'), (106, 'functools.wraps', 'functools.wraps', (['initializer'], {}), False, 'import functools\n'), (274, 'tensorflow.executing_eagerly', 'tf.executing_eagerly', ([], {}), True, 'import tensorflow as tf\n'), (556, 'tensorflow.pyt... |
baleian/python-ml-keyword_classifier | 06de1c768934f8382829a91fa7b14f1cb1a78ab7 | import tensorflow as tf
import tensorflow.keras.layers as layers
from .transformer import VALID_CHARS
class InputLayer(layers.Layer):
def __init__(self, num_class, **kwargs):
super(InputLayer, self).__init__(**kwargs)
self.num_class = num_class
self.reshape_layer = layers.Reshape((-1... | [
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.GlobalMaxPool2D",
"tensorflow.keras.layers.Average",
"tensorflow.keras.layers.Dense",
"tensorflow.cast",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.Model",
"tensorflow.one_hot",
"tensorflow.keras.layers.Reshape",
"tensorflow.... | baleian/ml/keyword_classifier/model.py | [(74, 'tensorflow.keras.layers.Input', 'layers.Input', ([], {'shape': 'input_shape', 'dtype': 'tf.int32'}), True, 'import tensorflow.keras.layers as layers\n'), (78, 'tensorflow.keras.Model', 'tf.keras.Model', ([], {'inputs': 'inputs', 'outputs': 'outputs'}), True, 'import tensorflow as tf\n'), (86, 'tensorflow.keras.l... |
404-Brain-Not-Found/Bird-Watcher | 2a9e2033faa17c4a28ae1be5d1145d556f2bc7b8 | import numpy as np
from tensorflow.keras import backend as k
from image_utils import non_max_suppression
def xywh2minmax(xy, wh):
xy_min = xy - wh / 2
xy_max = xy + wh / 2
return xy_min, xy_max
def iou(pred_mins, pred_maxes, true_mins, true_maxes):
intersect_mins = k.maximum(pred_mins, true_mins)
... | [
"tensorflow.keras.backend.maximum",
"tensorflow.keras.backend.tile",
"tensorflow.keras.backend.max",
"tensorflow.keras.backend.sum",
"tensorflow.keras.backend.sqrt",
"tensorflow.keras.backend.transpose",
"tensorflow.keras.backend.reshape",
"tensorflow.keras.backend.arange",
"tensorflow.keras.backend... | yolo_utils.py | [(14, 'tensorflow.keras.backend.maximum', 'k.maximum', (['pred_mins', 'true_mins'], {}), True, 'from tensorflow.keras import backend as k\n'), (15, 'tensorflow.keras.backend.minimum', 'k.minimum', (['pred_maxes', 'true_maxes'], {}), True, 'from tensorflow.keras import backend as k\n'), (16, 'tensorflow.keras.backend.ma... |
CodeProcessor/DeepLab-Training-Pipeline | e6ae556c252703817142828ba28ea51e8cce60e7 | # -*- coding: utf-8 -*-
""" Deeplabv3+ model for Keras.
This model is based on TF repo:
https://github.com/tensorflow/models/tree/master/research/deeplab
On Pascal VOC, original model gets to 84.56% mIOU
MobileNetv2 backbone is based on this repo:
https://github.com/JonathanCMitchell/mobilenet_v2_keras
# Reference
- [... | [
"tensorflow.keras.layers.ZeroPadding2D",
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.backend.int_shape",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Add",
"tensorflow.python.keras.utils.data_utils.get_file",
"tensorflow.keras.layers.DepthwiseConv2D",
"tensorflow.keras.model... | deeplab/modelv2.py | [(360, 'tensorflow.shape', 'tf.shape', (['x'], {}), True, 'import tensorflow as tf\n'), (362, 'tensorflow.keras.backend.int_shape', 'tf.keras.backend.int_shape', (['b4'], {}), True, 'import tensorflow as tf\n'), (370, 'tensorflow.keras.backend.int_shape', 'tf.keras.backend.int_shape', (['x'], {}), True, 'import tensorf... |
youchangxin/DeepLabV3Plus | 2ee1495b7140a4dc3494e9d4b3557640e380d7b6 | # -*- coding: utf-8 -*-
import os
import tensorflow as tf
import shutil
from deeplabv3plus import model
from dataset import Dataset
from config import cfg
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
log = cfg.TRAIN.LOGDIR
EPOCHS = cfg.TRAIN.EPOCHS
save_every_n_epoch = cfg.TRAIN.SAVE_EPOCH
if os.path.exists(log): shuti... | [
"tensorflow.summary.trace_on",
"tensorflow.train.latest_checkpoint",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.summary.create_file_writer",
"tensorflow.saved_model.save"... | train.py | [(16, 'os.path.exists', 'os.path.exists', (['log'], {}), False, 'import os\n'), (16, 'shutil.rmtree', 'shutil.rmtree', (['log'], {}), False, 'import shutil\n'), (20, 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), True, 'import tensorflow as t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.