repo_name
stringlengths
9
109
hexsha
stringlengths
40
40
code
stringlengths
547
141k
apis
list
file_path
stringlengths
6
143
api_extract
stringlengths
142
58.4k
ddddwee1/SULT
0ff31b602d20dd8bc5cf4a6f4f5bc193d636e784
import tensorflow as tf import model3 as M import datareader import numpy as np import tqdm import network def grad_loss(x, model): x2d, x3d = x with tf.GradientTape() as tape: pred, K, reprojected, crit_fake = model(x2d) crit_real = model.crit(x3d) crit_dis = tf.reduce_mean(tf.square(crit_real - tf.ones...
[ "tensorflow.matmul", "tensorflow.ones_like", "tensorflow.eye", "tensorflow.zeros_like", "tensorflow.GradientTape", "tensorflow.square", "tensorflow.optimizers.Adam", "tensorflow.trace" ]
example/RepNet/train.py
[(30, 'datareader.DataReader', 'datareader.DataReader', (['(16)'], {}), False, 'import datareader\n'), (31, 'network.RepNet', 'network.RepNet', ([], {}), False, 'import network\n'), (32, 'tensorflow.optimizers.Adam', 'tf.optimizers.Adam', (['(0.0001)', '(0.5)'], {}), True, 'import tensorflow as tf\n'), (33, 'model3.Sav...
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.convert_to_tensor", "tensorflow.TensorShape", "tensorflow.constant", "tensorflow.concat", "tensorflow.zeros", "tensorflow.shape", "tensorflow.expand_dims", "tensorflow.nest.flatten", "tensorflow.size" ]
neurst/tasks/multilingual_translation.py
[(44, 'neurst.data.data_pipelines.multilingual_text_data_pipeline.MultilingualTextDataPipeline', 'MultilingualTextDataPipeline', ([], {'vocab_path': "args['vocab_path']", 'spm_model': "args['spm_model']", 'languages': "args['languages']"}), False, 'from neurst.data.data_pipelines.multilingual_text_data_pipeline import ...
totucuong/vae-seq
0a1bace02c6bac6ab991ab8203a203d3061615ec
# Copyright 2018 Google, 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.contrib.lookup.index_to_string_table_from_tensor", "tensorflow.to_int64", "tensorflow.contrib.lookup.index_table_from_tensor", "tensorflow.gfile.Open", "numpy.asarray", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.compat.as_bytes", "tensorflow.data.TextLineDataset", "tensorf...
vaeseq/examples/text/dataset.py
[(24, 'tensorflow.compat.as_text', 'tf.compat.as_text', (['string'], {}), True, 'import tensorflow as tf\n'), (44, 'tensorflow.py_func', 'tf.py_func', (['_unique_chars', '[filename]', '[tf.string]'], {}), True, 'import tensorflow as tf\n'), (45, 'tensorflow.contrib.lookup.index_table_from_tensor', 'tf.contrib.lookup.in...
alexus37/MasterThesisCode
a7eada603686de75968acc8586fd307a91b0491b
from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import numpy as np from skimage.util import view_as_windows import warnings import logging import tensorflow as tf from tqdm import tqdm from tensorflow.python.ops import nn_grad, math_grad from de...
[ "tensorflow.compat.v1.get_default_graph", "numpy.linspace", "numpy.reshape", "numpy.arange", "numpy.isnan", "tensorflow.gradients", "tensorflow.ones_like", "numpy.ones", "tensorflow.zeros_like", "numpy.delete", "numpy.random.permutation", "numpy.zeros_like", "numpy.prod", "numpy.zeros", ...
deepexplain/tf/v2_x/methods.py
[(30, 'tensorflow.gradients', 'tf.gradients', ([], {'ys': 'self.T', 'xs': 'self.X'}), True, 'import tensorflow as tf\n'), (35, 'tensorflow.zeros_like', 'tf.zeros_like', (['input'], {}), True, 'import tensorflow as tf\n'), (152, 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), False, 'import sys\n'), (155, 'tensorflow....
jheo4/incubator-tvm
c4c61cb766608fb2f0fd8c9facc480a43afed3f5
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ "tensorflow.executing_eagerly", "tensorflow.config.experimental.set_memory_growth", "tensorflow.ConfigProto", "tensorflow.config.list_physical_devices", "numpy.random.rand", "tensorflow.Session", "numpy.random.uniform" ]
tests/python/frontend/keras/test_forward.py
[(27, 'tensorflow.executing_eagerly', 'tf.executing_eagerly', ([], {}), True, 'import tensorflow as tf\n'), (28, 'tensorflow.config.list_physical_devices', 'tf.config.list_physical_devices', (['"""GPU"""'], {}), True, 'import tensorflow as tf\n'), (33, 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), True, 'import...
hhy37/tensor2tensor
b4094d065fa0ae8842cd667fb0e5a2c652407c9c
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
[ "tensorflow.contrib.eager.run_test_in_graph_and_eager_modes", "tensorflow.test.main", "tensorflow.global_variables_initializer", "tensorflow.uniform_unit_scaling_initializer", "tensorflow.train.create_global_step", "tensorflow.random_uniform" ]
tensor2tensor/layers/latent_layers_test.py
[(34, 'tensor2tensor.models.transformer.transformer_small', 'transformer.transformer_small', ([], {}), False, 'from tensor2tensor.models import transformer\n'), (92, 'tensorflow.contrib.eager.run_test_in_graph_and_eager_modes', 'tf.contrib.eager.run_test_in_graph_and_eager_modes', ([], {}), True, 'import tensorflow as ...
wladimir-crypto/TensowFlow-Food
c5e115f96d3fca04fe256e9b2f3075f77e083a75
# Copyright 2020 Google Research. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
[ "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.cast", "tensorflow.random.uniform", "tensorflow.ones", "tensorflow.image.flip_left_right", "tensorflow.image.resize", "tensorflow.argmax" ]
tensorflow_examples/lite/model_maker/third_party/efficientdet/keras/segmentation.py
[(31, 'tensorflow_datasets.load', 'tfds.load', (['"""oxford_iiit_pet:3.*.*"""'], {'with_info': '(True)'}), True, 'import tensorflow_datasets as tfds\n'), (26, 'tensorflow.argmax', 'tf.argmax', (['pred_mask'], {'axis': '(-1)'}), True, 'import tensorflow as tf\n'), (42, 'tensorflow.image.resize', 'tf.image.resize', (["da...
varunjha089/tensorflow_cookbook
c1fa5051c860ecb6de875db975465ced06f43ba6
# Working with Bag of Words #--------------------------------------- # # In this example, we will download and preprocess the ham/spam # text data. We will then use a one-hot-encoding to make a # bag of words set of features to use in logistic regression. # # We will use these one-hot-vectors for logistic regression...
[ "tensorflow.reduce_sum", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "numpy.round", "numpy.mean", "tensorflow.Session", "tensorflow.python.framework.ops.reset_default_graph", "tensorflow.matmul", "matplotlib.pyplot.title", "tensorflow.placeholder", "tensorflow.global_variables_initializer",...
07_Natural_Language_Processing/02_Working_with_Bag_of_Words/02_bag_of_words.py
[(22, 'tensorflow.python.framework.ops.reset_default_graph', 'ops.reset_default_graph', ([], {}), False, 'from tensorflow.python.framework import ops\n'), (25, 'tensorflow.Session', 'tf.Session', ([], {}), True, 'import tensorflow as tf\n'), (28, 'os.path.join', 'os.path.join', (['"""temp"""', '"""temp_spam_data.csv"""...
51616/split
58b6efa8ab2c24e85c0a14922ee6a2a83aaa7e19
import numpy as np import tensorflow as tf import tensorflow_probability as tfp import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' width = height = 32 channel = 3 patch_size_x = 8 ;patch_size_y = 8 class Augmentator(object): def __init__(self,type,size=1,mean=0,std=1): self.size = size if type==...
[ "tensorflow.convert_to_tensor", "tensorflow.concat", "tensorflow.range", "numpy.random.choice", "tensorflow.unstack", "tensorflow.reduce_sum", "tensorflow.reshape", "tensorflow.random.uniform", "tensorflow.squeeze", "tensorflow.expand_dims", "tensorflow.einsum", "tensorflow.eye", "tensorflow...
augmentation.py
[(35, 'tensorflow_probability.distributions.Normal', 'tfp.distributions.Normal', (['mean', 'std'], {}), True, 'import tensorflow_probability as tfp\n'), (37, 'tensorflow.einsum', 'tf.einsum', (['"""i,j->ij"""', 'vals', 'vals'], {}), True, 'import tensorflow as tf\n'), (41, 'numpy.random.choice', 'np.random.choice', (['...
tracysaber/terngrad
cd7e5f1c59e87712a208fc1351defa029a340146
# Copyright 2016 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.Graph", "tensorflow.gfile.DeleteRecursively", "tensorflow.gfile.Open", "tensorflow.gfile.Exists", "numpy.squeeze", "tensorflow.app.flags.DEFINE_integer", "tensorflow.placeholder", "tensorflow.python_io.TFRecordWriter", "tensorflow.image.encode_png", "tensorflow.gfile.MakeDirs", "tens...
slim/datasets/download_convert_and_shard_cifar10.py
[(41, 'tensorflow.app.flags.DEFINE_integer', 'tf.app.flags.DEFINE_integer', (['"""train_shards"""', '(1000)', '"""Number of shards in training TFRecord files."""'], {}), True, 'import tensorflow as tf\n'), (95, 'tensorflow.python_io.TFRecordWriter', 'tf.python_io.TFRecordWriter', (['record_filename'], {}), True, 'impor...
TanguyUrvoy/normalizing-flows
e485fe0875c117517353a9ab40e19ff951561cfc
import tensorflow as tf import tensorflow_probability as tfp from normalizing_flows.flows import Transform from . import Parameterize def gaussianize(x, mus, log_sigmas, inverse=tf.constant(False)): if inverse: z = tf.math.exp(log_sigmas)*x + mus ldj = tf.math.reduce_sum(log_sigmas, axis=[1,2,3]) ...
[ "tensorflow.constant", "tensorflow.math.log", "tensorflow.math.exp", "tensorflow.zeros_like", "tensorflow.math.reduce_sum", "tensorflow.where" ]
normalizing_flows/flows/glow/gaussianize.py
[(6, 'tensorflow.constant', 'tf.constant', (['(False)'], {}), True, 'import tensorflow as tf\n'), (34, 'tensorflow.constant', 'tf.constant', (['(False)'], {}), True, 'import tensorflow as tf\n'), (85, 'tensorflow.constant', 'tf.constant', (['(False)'], {}), True, 'import tensorflow as tf\n'), (111, 'tensorflow.constant...
jleni/lola
9b9a2122aefc97d9ed1529b875912816f1acb5d6
""" Various utility functions. """ import numpy as np import tensorflow as tf def batch_to_seq(h, nbatch, nsteps, flat=False): if flat: h = tf.reshape(h, [nbatch, nsteps]) else: h = tf.reshape(h, [nbatch, nsteps, -1]) return [tf.squeeze(v, [1]) for v in tf.split(axis=1, num_or_size_splits=...
[ "tensorflow.concat", "tensorflow.zeros", "tensorflow.stack", "tensorflow.tanh", "tensorflow.group", "numpy.linalg.svd", "numpy.reshape", "tensorflow.gradients", "tensorflow.squeeze", "tensorflow.clip_by_norm", "numpy.zeros", "tensorflow.matmul", "tensorflow.nn.sigmoid", "tensorflow.placeho...
lola/utils.py
[(34, 'tensorflow.split', 'tf.split', ([], {'axis': '(1)', 'num_or_size_splits': '(2)', 'value': 's'}), True, 'import tensorflow as tf\n'), (47, 'tensorflow.concat', 'tf.concat', ([], {'axis': '(1)', 'values': '[c, h]'}), True, 'import tensorflow as tf\n'), (70, 'tensorflow.get_default_session', 'tf.get_default_session...
mjbigdel/baselines
ea25b9e8b234e6ee1bca43083f8f3cf974143998
"""Deep Q learning graph The functions in this file can are used to create the following functions: ======= act ======== Function to chose an action given an observation Parameters ---------- observation: object Observation that can be feed into the output of make_obs_ph stochastic: bool...
[ "tensorflow.cond", "tensorflow.control_dependencies", "tensorflow.stack", "tensorflow.where", "tensorflow.group", "tensorflow.Variable", "tensorflow.stop_gradient", "tensorflow.clip_by_norm", "tensorflow.trainable_variables", "tensorflow.argmax", "tensorflow.shape", "tensorflow.placeholder", ...
baselines/deepq/build_graph.py
[(123, 'tensorflow.get_variable_scope', 'tf.get_variable_scope', ([], {}), True, 'import tensorflow as tf\n'), (132, 'tensorflow.trainable_variables', 'tf.trainable_variables', ([], {}), True, 'import tensorflow as tf\n'), (176, 'tensorflow.variable_scope', 'tf.variable_scope', (['scope'], {'reuse': 'reuse'}), True, 'i...
10jqka-aicubes/opinion_classification
43f193522b033bd857d294737b3f9dbaac7aed9f
# coding=utf-8 # Copyright 2020 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.gfile.Exists", "tensorflow.data.TFRecordDataset", "tensorflow.cast", "tensorflow.python_io.TFRecordWriter", "tensorflow.contrib.data.map_and_batch", "tensorflow.train.Features", "tensorflow.parse_single_example" ]
opinion_classification/electra/finetune/preprocessing.py
[(45, 'finetune.feature_spec.get_shared_feature_specs', 'feature_spec.get_shared_feature_specs', (['config'], {}), False, 'from finetune import feature_spec\n'), (61, 'os.path.join', 'os.path.join', (['self._config.preprocessed_data_dir', 'dataset_name'], {}), False, 'import os\n'), (66, 'util.utils.log', 'utils.log', ...
moondaiy/TensorFlowTutorials
c7f0255e3704c5a40f72ac0707684fb201123c1c
import tensorflow as tf #add_layer 函数里面所有的with都是为了tensorboard添加上去的 def add_layer(inputs, in_size, out_size, activation_function=None,nameScope="layer"): # add one more layer and return the output of this layer with tf.name_scope(nameScope): with tf.name_scope('weights'): Weights = tf.Var...
[ "tensorflow.matmul", "tensorflow.__version__.split", "tensorflow.summary.FileWriter", "tensorflow.zeros", "tensorflow.placeholder", "tensorflow.train.SummaryWriter", "tensorflow.global_variables_initializer", "tensorflow.initialize_all_variables", "tensorflow.name_scope", "tensorflow.Session", "...
TensorFlowBasic/tensorBoard.py
[(41, 'tensorflow.Session', 'tf.Session', ([], {}), True, 'import tensorflow as tf\n'), (30, 'tensorflow.name_scope', 'tf.name_scope', (['"""inputs"""'], {}), True, 'import tensorflow as tf\n'), (32, 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, 1]'], {'name': '"""x_input"""'}), True, 'import tens...
qianhk/FeiPython
c87578d3c04b7345a99fef7390c8ea12c6f2c716
#!/usr/bin/env python3 # coding=utf-8 import tensorflow as tf import numpy as np # with tf.device('/cpu:0'): # # sess = tf.Session() # # # a_gpu = tf.Variable(0, name="a_gup") # # sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True)) # # hello = tf.constant('Hello, TensorFlow!') # pr...
[ "tensorflow.floordiv", "tensorflow.matrix_determinant", "tensorflow.diag", "tensorflow.cholesky", "tensorflow.Variable", "tensorflow.div", "tensorflow.nn.top_k", "tensorflow.self_adjoint_eig", "tensorflow.Session", "tensorflow.square", "tensorflow.nn.in_top_k", "tensorflow.cross", "tensorflo...
Python3Test/TensorflowTest.py
[(27, 'tensorflow.diag', 'tf.diag', (['[1.0, 3.0, 1.0]'], {}), True, 'import tensorflow as tf\n'), (28, 'tensorflow.truncated_normal', 'tf.truncated_normal', (['[2, 3]'], {}), True, 'import tensorflow as tf\n'), (29, 'tensorflow.fill', 'tf.fill', (['[2, 3]', '(5.0)'], {}), True, 'import tensorflow as tf\n'), (30, 'tens...
drewlinsley/ffn_membrane
4b4638c00eed847fa6a7958a7fdbeedca4236561
"""Contextual model with partial filters.""" import warnings import numpy as np import tensorflow as tf import initialization from pooling import max_pool3d # Dependency for symmetric weight ops is in models/layers/ff.py class hGRU(object): def __getitem__(self, name): return getattr(self, name) def ...
[ "tensorflow.get_variable", "tensorflow.zeros", "tensorflow.minimum", "tensorflow.get_default_graph", "tensorflow.while_loop", "tensorflow.gather", "tensorflow.nn.conv3d_transpose", "tensorflow.image.resize_images", "tensorflow.identity", "tensorflow.nn.conv3d", "tensorflow.contrib.layers.batch_n...
ffn/training/models/prc/feedback_hgru_3l_temporal.py
[(145, 'tensorflow.transpose', 'tf.transpose', (['w', '(2, 3, 0, 1)'], {}), True, 'import tensorflow as tf\n'), (147, 'tensorflow.transpose', 'tf.transpose', (['conv_w_symm', '(2, 3, 0, 1)'], {'name': 'name'}), True, 'import tensorflow as tf\n'), (916, 'tensorflow.constant', 'tf.constant', (['(0)'], {}), True, 'import ...
taoshen58/ReSAN
f65f3fe656907be0ec14ddf18cd7d2608e7ef905
import tensorflow as tf from resan.utils.nn import bn_dense_layer, dropout, linear from resan.utils.general import exp_mask_for_high_rank, mask_for_high_rank from resan.rl_nn import reduce_data_rep_max_len def reinforced_self_attention( rep_tensor, rep_mask, dep_selection, head_selection, hn=None, ke...
[ "tensorflow.concat", "tensorflow.zeros", "tensorflow.reduce_sum", "tensorflow.stack", "tensorflow.equal", "tensorflow.cast", "tensorflow.greater", "tensorflow.add", "tensorflow.name_scope", "tensorflow.logical_not", "tensorflow.shape", "tensorflow.less", "tensorflow.nn.tanh", "tensorflow.n...
resan/resa.py
[(114, 'resan.utils.nn.dropout', 'dropout', (['rep_map', 'keep_prob', 'is_train'], {}), False, 'from resan.utils.nn import bn_dense_layer, dropout, linear\n'), (115, 'resan.rl_nn.reduce_data_rep_max_len', 'reduce_data_rep_max_len', (['rep_map_dp', 'dep_selection'], {}), False, 'from resan.rl_nn import reduce_data_rep_m...
agrawalayan/R-net-1
1748d108a8248466d99cdf3c3f284619d88bcc73
from __future__ import print_function import tensorflow as tf from tensorflow.python.ops import variable_scope from tensorflow.python.ops import nn_ops def add_first_word_prob_to_atten_dists(in_passage_words, phrase_starts, vocab_dist, attn_dist): ''' in_passage_words: [batch_size, passage_length] phrase_s...
[ "tensorflow.get_variable", "tensorflow.device", "tensorflow.concat", "tensorflow.zeros", "tensorflow.reduce_sum", "tensorflow.stack", "tensorflow.cast", "tensorflow.equal", "tensorflow.minimum", "tensorflow.map_fn", "tensorflow.tanh", "tensorflow.python.ops.nn_ops.softmax", "tensorflow.rando...
src/generator_utils.py
[(25, 'tensorflow.map_fn', 'tf.map_fn', (['singel_instance', 'elems'], {'dtype': 'tf.float32'}), True, 'import tensorflow as tf\n'), (374, 'tensorflow.clip_by_value', 'tf.clip_by_value', (['word_probs', 'epsilon', '(1.0 - epsilon)'], {}), True, 'import tensorflow as tf\n'), (385, 'tensorflow.shape', 'tf.shape', (['word...
jfacoustic/MyTwitterBot
15a9509c41ba8c7049675048b4d05ab457270a7d
import tensorflow as tf def init_wb(shape, name): """ Function initialize one matrix of weights and one bias vector. :type shape: tuple :type name: str :rtype: dictionary """ Winit = tf.truncated_normal(shape, mean=0, stddev=0.1) binit = tf.zeros(shape[-1]) layer = {} layer["w...
[ "tensorflow.get_variable", "tensorflow.truncated_normal", "tensorflow.matmul", "tensorflow.zeros" ]
src/tftools/basic_functions.py
[(12, 'tensorflow.truncated_normal', 'tf.truncated_normal', (['shape'], {'mean': '(0)', 'stddev': '(0.1)'}), True, 'import tensorflow as tf\n'), (13, 'tensorflow.zeros', 'tf.zeros', (['shape[-1]'], {}), True, 'import tensorflow as tf\n'), (15, 'tensorflow.get_variable', 'tf.get_variable', (["(name + '/weights')"], {'dt...
congchan/nnnlp
9a2026a2577817d485d139bf442de7fd602418e6
# coding=utf-8 """GLUE tasks.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import six import json import copy import glue_utils as classifier_utils import modeling import optimization import tokenization import tensorflow as tf f...
[ "tensorflow.contrib.cluster_resolver.TPUClusterResolver", "tensorflow.metrics.true_negatives", "tensorflow.metrics.accuracy", "tensorflow.nn.log_softmax", "tensorflow.gfile.Exists", "tensorflow.reduce_sum", "tensorflow.gfile.GFile", "tensorflow.cast", "tensorflow.train.init_from_checkpoint", "tens...
tf/train_glue_baseline.py
[(108, 'tensorflow.flags.DEFINE_string', 'tf.flags.DEFINE_string', (['"""tpu_name"""', 'None', '"""The Cloud TPU to use for training. This should be either the name used when creating the Cloud TPU, or a grpc://ip.address.of.tpu:8470 url."""'], {}), True, 'import tensorflow as tf\n'), (114, 'tensorflow.flags.DEFINE_str...
junkilee/simple_baselines
cc5cc4b8d83119bf144abb08900762b76b1a33ac
"""Deep Q learning graph The functions in this file can are used to create the following functions: ======= act ======== Function to chose an action given an observation Parameters ---------- observation: object Observation that can be feed into the output of make_obs_ph stochastic: bool...
[ "tensorflow.cond", "tensorflow.control_dependencies", "tensorflow.stack", "tensorflow.where", "tensorflow.group", "tensorflow.Variable", "tensorflow.stop_gradient", "tensorflow.trainable_variables", "tensorflow.argmax", "tensorflow.shape", "tensorflow.placeholder", "tensorflow.one_hot", "ten...
baselines/deepq/build_graph.py
[(101, 'tensorflow.trainable_variables', 'tf.trainable_variables', ([], {}), True, 'import tensorflow as tf\n'), (145, 'tensorflow.variable_scope', 'tf.variable_scope', (['scope'], {'reuse': 'reuse'}), True, 'import tensorflow as tf\n'), (147, 'tensorflow.placeholder', 'tf.placeholder', (['tf.bool', '()'], {'name': '""...
fol21/domain-adaptation-in-deforestation
ae1c37b1634f54230f1d2217c209dabd6780568a
import os import numpy as np import tensorflow as tf class Networks(): def __init__(self, args): super(Networks, self).__init__() self.args = args # Wittich design def VNET_16L(self, I, is_train, reuse_unet=False, reuse_ada=False, adaption_net=False): def encoder_conf(name, ...
[ "tensorflow.get_variable", "tensorflow.concat", "tensorflow.layers.dropout", "tensorflow.layers.conv2d_transpose", "tensorflow.pad", "tensorflow.contrib.layers.group_norm", "tensorflow.nn.conv2d", "tensorflow.layers.batch_normalization", "tensorflow.contrib.layers.variance_scaling_initializer", "t...
src/ADDA/Networks.py
[(252, 'tensorflow.layers.conv2d', 'tf.layers.conv2d', (['input', 'channels'], {'kernel_size': 'size', 'strides': '[stride, stride]', 'padding': 'padding', 'kernel_initializer': 'init', 'name': "('conv' + id)", 'use_bias': 'use_bias', 'dilation_rate': '(dilation, dilation)'}), True, 'import tensorflow as tf\n'), (261, ...
tum-ai/expingo-inpainting-service
657f65316c179f85507350d55e4ab4ac429552a0
import numpy as np import cv2 import uvicorn import tensorflow as tf import neuralgym as ng from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel from fastapi import FastAPI, UploadFile, File from fastapi import HTTPException from inpaint.inpainting_model import InpaintCAModel class Pain...
[ "tensorflow.reverse", "numpy.expand_dims", "tensorflow.constant", "tensorflow.get_collection", "tensorflow.assign", "numpy.transpose", "numpy.concatenate", "tensorflow.ConfigProto", "tensorflow.reset_default_graph", "tensorflow.contrib.framework.load_variable", "tensorflow.Session", "tensorflo...
app/main.py
[(20, 'neuralgym.Config', 'ng.Config', (['"""inpaint.yml"""'], {}), True, 'import neuralgym as ng\n'), (22, 'inpaint.inpainting_model.InpaintCAModel', 'InpaintCAModel', ([], {}), False, 'from inpaint.inpainting_model import InpaintCAModel\n'), (23, 'fastapi.FastAPI', 'FastAPI', ([], {}), False, 'from fastapi import Fas...
lywong92/garage
96cb8887fcae90531a645d540653010e7fe10fcc
""" The local runner for tensorflow algorithms. A runner setup context for algorithms during initialization and pipelines data between sampler and algorithm during training. """ import copy import time from types import SimpleNamespace from dowel import logger, tabular import tensorflow as tf from garage.experiment ...
[ "tensorflow.get_default_session", "tensorflow.global_variables", "tensorflow.report_uninitialized_variables", "tensorflow.name_scope", "tensorflow.Session" ]
src/garage/experiment/local_tf_runner.py
[(136, 'dowel.logger.log', 'logger.log', (['self.sess.graph'], {}), False, 'from dowel import logger, tabular\n'), (139, 'types.SimpleNamespace', 'SimpleNamespace', ([], {'sampler_cls': 'sampler_cls', 'sampler_args': 'sampler_args'}), False, 'from types import SimpleNamespace\n'), (196, 'dowel.logger.log', 'logger.log'...
jason9075/ithome_tensorflow_series
e8f92de2a73a88e7b03a9ac58ece4c4a604f066e
import cv2 import tensorflow as tf TFRECORD_PATH = '../tfrecord/member.tfrecord' def main(): data_set = tf.data.TFRecordDataset(TFRECORD_PATH) data_set = data_set.map(parse_function) data_set = data_set.shuffle(buffer_size=9) data_set = data_set.batch(3) iterator = data_set.make_initializable_ite...
[ "tensorflow.image.random_brightness", "tensorflow.image.random_contrast", "tensorflow.image.random_flip_left_right", "tensorflow.data.TFRecordDataset", "tensorflow.image.decode_png", "tensorflow.io.parse_single_example", "tensorflow.image.random_saturation", "tensorflow.io.FixedLenFeature", "tensorf...
14/record_dataset.py
[(8, 'tensorflow.data.TFRecordDataset', 'tf.data.TFRecordDataset', (['TFRECORD_PATH'], {}), True, 'import tensorflow as tf\n'), (37, 'tensorflow.io.parse_single_example', 'tf.io.parse_single_example', (['example_proto', 'features'], {}), True, 'import tensorflow as tf\n'), (38, 'tensorflow.image.decode_png', 'tf.image....
kevslinger/stable-baselines
4bf9f3c1db49f462f5fb35df967d836d92a3dbcd
"""Deep Q learning graph The functions in this file can are used to create the following functions: ======= act ======== Function to chose an action given an observation :param observation: (Any) Observation that can be feed into the output of make_obs_ph :param stochastic: (bool) if set to False all th...
[ "tensorflow.cond", "tensorflow.control_dependencies", "tensorflow.stack", "tensorflow.where", "tensorflow.group", "tensorflow.summary.scalar", "tensorflow.all_variables", "tensorflow.Variable", "tensorflow.summary.image", "tensorflow.stop_gradient", "tensorflow.clip_by_norm", "tensorflow.train...
stable_baselines/deepq_lstm/build_graph.py
[(143, 'tensorflow.argmax', 'tf.argmax', (['policy.q_values'], {'axis': '(1)'}), True, 'import tensorflow as tf\n'), (156, 'tensorflow.all_variables', 'tf.all_variables', ([], {}), True, 'import tensorflow as tf\n'), (163, 'tensorflow.where', 'tf.where', (['chose_random', 'random_actions', 'deterministic_actions'], {})...
hssinejihene/deepchem-1.1.0
6efbe6b638b77bb2685ac617f4d6649755c01335
"""Ops for graph construction. Large amounts of code borrowed from Keras. Will try to incorporate into DeepChem properly. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import os import sys import traceback import numpy as np import tensorflow as tf f...
[ "tensorflow.convert_to_tensor", "tensorflow.cond", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.concat", "tensorflow.zeros", "numpy.asarray", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.nn.l2_loss", "tensorflow.wher...
deepchem/nn/model_ops.py
[(21, 'collections.defaultdict', 'defaultdict', (['int'], {}), False, 'from collections import defaultdict\n'), (29, 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['x'], {}), True, 'import tensorflow as tf\n'), (42, 'tensorflow.get_default_graph', 'tf.get_default_graph', ([], {}), True, 'import tensorflow as...
YuHe0108/cvmodule
ea00a90fc9bbca5b2c7809791cbd1f7b0da526cd
from tensorflow import keras import tensorflow as tf def joint_mse_loss(y_pred, y_true, true_weight): """ 损失函数想要表达的意思: 输出的特征图数量为关键点的数量,意味着输出的是每一个像素属于各个关键点的置信度 """ batch_size = y_pred.shape[0] num_of_joints = y_pred.shape[-1] # 有多少个关键点 y_pred = tf.reshape(y_pred, shape=(batch_size, -...
[ "tensorflow.losses.mean_squared_error", "tensorflow.reduce_mean", "tensorflow.reshape", "tensorflow.losses.MeanSquaredError", "tensorflow.squeeze", "tensorflow.split" ]
HumeanPoseEstimate/loss.py
[(11, 'tensorflow.reshape', 'tf.reshape', (['y_pred'], {'shape': '(batch_size, -1, num_of_joints)'}), True, 'import tensorflow as tf\n'), (12, 'tensorflow.split', 'tf.split', ([], {'value': 'y_pred', 'num_or_size_splits': 'num_of_joints', 'axis': '(-1)'}), True, 'import tensorflow as tf\n'), (15, 'tensorflow.reshape', ...
danielvarga/vat_tf
0b40b256922b7996558504a5d2c3556b5f9fff15
import time import numpy as np import tensorflow as tf import layers as L import vat FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string('device', '/gpu:0', "device") tf.app.flags.DEFINE_string('dataset', 'cifar10', "{cifar10, svhn}") tf.app.flags.DEFINE_string('log_dir', "", "log_dir") tf.app.flags.DEFINE_inte...
[ "tensorflow.device", "tensorflow.global_variables", "tensorflow.app.flags.DEFINE_string", "tensorflow.train.AdamOptimizer", "numpy.random.randint", "tensorflow.Graph", "tensorflow.app.flags.DEFINE_integer", "tensorflow.trainable_variables", "numpy.load", "tensorflow.Summary", "tensorflow.app.run...
train_semisup.py
[(11, 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""device"""', '"""/gpu:0"""', '"""device"""'], {}), True, 'import tensorflow as tf\n'), (13, 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""dataset"""', '"""cifar10"""', '"""{cifar10, svhn}"""'], {}), True, 'import ...
yijunyu/demo-fast
11c0c84081a3181494b9c469bda42a313c457ad2
# Copyright 2015 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.core.framework.function_pb2.FunctionDef", "tensorflow.core.framework.op_def_pb2.OpDef", "tensorflow.python.ops.variable_scope.get_variable_scope", "tensorflow.python.ops.variable_scope._get_default_variable_store", "tensorflow.core.framework.op_def_pb2.OpDef.ArgDef", "tensorflow.python.framewo...
datasets/tensorflow-1.0.1/tensorflow/python/framework/function.py
[(45, 'tensorflow.core.framework.op_def_pb2.OpDef.ArgDef', 'op_def_pb2.OpDef.ArgDef', ([], {}), False, 'from tensorflow.core.framework import op_def_pb2\n'), (147, 'tensorflow.core.framework.function_pb2.FunctionDef', 'function_pb2.FunctionDef', ([], {}), False, 'from tensorflow.core.framework import function_pb2\n'), ...
priumoraes/tpu
c7fbe70f00956e802c23c9e831d7482613968fa7
# 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.contrib.cluster_resolver.TPUClusterResolver", "tensorflow.contrib.tpu.TPUEstimator", "tensorflow.estimator.Estimator", "tensorflow.train.latest_checkpoint", "tensorflow.gfile.MkDir", "tensorflow.cast", "tensorflow.estimator.export.TensorServingInputReceiver", "tensorflow.placeholder", "t...
models/official/amoeba_net/amoeba_net.py
[(44, 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""tpu"""'], {'default': 'None', 'help': '"""The Cloud TPU to use for training. This should be either the name used when creating the Cloud TPU, or a grpc://ip.address.of.tpu:8470 url."""'}), False, 'from absl import flags\n'), (49, 'absl.flags.DEFINE_string',...
zeuseyera/baselines-kr
c9926418d2d8efee21ef20d548366eaaaa193011
import os import numpy as np import tensorflow as tf from collections import deque def sample(logits): noise = tf.random_uniform(tf.shape(logits)) return tf.argmax(logits - tf.log(-tf.log(noise)), 1) def cat_entropy(logits): a0 = logits - tf.reduce_max(logits, 1, keepdims=True) ea0 = tf.exp(a0) z...
[ "tensorflow.concat", "tensorflow.reduce_sum", "tensorflow.stack", "tensorflow.tanh", "numpy.mean", "tensorflow.nn.conv2d", "numpy.linalg.svd", "numpy.reshape", "tensorflow.nn.moments", "tensorflow.squeeze", "tensorflow.square", "tensorflow.trainable_variables", "tensorflow.matmul", "tensor...
baselines/a2c/utils.py
[(12, 'tensorflow.exp', 'tf.exp', (['a0'], {}), True, 'import tensorflow as tf\n'), (13, 'tensorflow.reduce_sum', 'tf.reduce_sum', (['ea0', '(1)'], {'keepdims': '(True)'}), True, 'import tensorflow as tf\n'), (89, 'tensorflow.split', 'tf.split', ([], {'axis': '(1)', 'num_or_size_splits': '(2)', 'value': 's'}), True, 'i...
rejux/rklearn-lib
56bc4f087a8c971cb545d65b0c1f9bafaaec3d67
#!/usr/bin/env python # -*- coding: utf-8 -*- ############# ## Imports ## ############# import os import sys ; sys.path.append("/home/developer/workspace/rklearn-lib") import tensorflow as tf from rklearn.tfoo_v1 import BaseModel ################# ## CIFAR10CNN ## ################# class CIFAR10CNN(BaseModel): ...
[ "tensorflow.layers.conv2d", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.layers.dropout", "tensorflow.reshape", "tensorflow.contrib.framework.arg_scope", "tensorflow.layers.max_pooling2d", "tensorflow.cast", "tensorflow.contrib.layers.ful...
rklearn/tests/it/cifar10_cnn.py
[(9, 'sys.path.append', 'sys.path.append', (['"""/home/developer/workspace/rklearn-lib"""'], {}), False, 'import sys\n'), (57, 'tensorflow.compat.v1.placeholder', 'tf.compat.v1.placeholder', (['tf.float32'], {'shape': "(None, self.config.data['image_size'], self.config.data['image_size'], self\n .config.data['num_ch...
topsun888/tensorflow
bad7c50b9dc9789ad7dd0a62daca40b7269841ed
# Copyright 2016 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.platform.tf_logging.warning", "tensorflow.python.training.saver.latest_checkpoint", "tensorflow.contrib.framework.python.ops.variables.get_global_step", "tensorflow.contrib.learn.python.learn.summary_writer_cache.SummaryWriterCache.get", "tensorflow.contrib.learn.python.learn.session_run_...
tensorflow/contrib/learn/python/learn/monitors.py
[(903, 'tensorflow.contrib.framework.deprecated_arg_values', 'deprecated_arg_values', (['"""2016-09-23"""', '"""The signature of the input_fn accepted by export is changing to be consistent with what\'s used by tf.Learn Estimator\'s train/evaluate. input_fn (and in most cases, input_feature_key) will both become requir...
gmum/cwae
50592903c321de25f339f3b00cbd2143741e5037
import tensorflow as tf import math as m from rec_errors import euclidean_norm_squared def silverman_rule_of_thumb(N: int): return tf.pow(4/(3*N), 0.4) def cw_1d(X, y=None): def N0(mean, variance): return 1.0/(tf.sqrt(2.0 * m.pi * variance)) * tf.exp((-(mean**2))/(2*variance)) N = tf.cast(tf.s...
[ "tensorflow.shape", "tensorflow.pow", "tensorflow.zeros", "tensorflow.maximum", "tensorflow.cast", "tensorflow.minimum", "tensorflow.exp", "tensorflow.expand_dims", "tensorflow.ones", "tensorflow.sqrt" ]
src/cw.py
[(7, 'tensorflow.pow', 'tf.pow', (['(4 / (3 * N))', '(0.4)'], {}), True, 'import tensorflow as tf\n'), (62, 'rec_errors.euclidean_norm_squared', 'euclidean_norm_squared', (['X'], {'axis': '(1)'}), False, 'from rec_errors import euclidean_norm_squared\n'), (85, 'tensorflow.cast', 'tf.cast', (['D', 'tf.int32'], {}), True...
nonu116/HDR-GAN
239f68dd07f1970e0317515a313b69a9c3914f74
import os import tensorflow as tf from tensorkit.log import logger, Color class Restore(object): def __init__(self): self._var_list = None self._restore_saver = None self._restore_optimistic = False self.restore_ckpt_file = None self._inited = False def init(self, va...
[ "tensorflow.train.Saver", "tensorflow.train.NewCheckpointReader", "tensorflow.variable_scope", "tensorflow.global_variables" ]
tensorkit/restore.py
[(69, 'tensorflow.train.NewCheckpointReader', 'tf.train.NewCheckpointReader', (['self.restore_ckpt_file'], {}), True, 'import tensorflow as tf\n'), (29, 'os.path.exists', 'os.path.exists', (['ckpt_dir'], {}), False, 'import os\n'), (54, 'tensorflow.train.Saver', 'tf.train.Saver', (['self._var_list'], {'name': '"""tk_re...
wyyy04/scene-graph-TF-release
4c9e3c6a5cb0e6a241a92dc9b786f74e69ca35c4
import tensorflow as tf def exp_average_summary(ops, dep_ops, decay=0.9, name='avg', scope_pfix='', raw_pfix=' (raw)', avg_pfix=' (avg)'): averages = tf.train.ExponentialMovingAverage(decay, name=name) averages_op = averages.apply(ops) for op in ops: tf.scalar_summary(scope...
[ "tensorflow.concat", "tensorflow.control_dependencies", "tensorflow.reduce_mean", "tensorflow.segment_mean", "tensorflow.assign", "tensorflow.reshape", "tensorflow.scalar_summary", "tensorflow.expand_dims", "tensorflow.gather", "tensorflow.train.ExponentialMovingAverage", "tensorflow.zeros_like"...
lib/networks/net_utils.py
[(5, 'tensorflow.train.ExponentialMovingAverage', 'tf.train.ExponentialMovingAverage', (['decay'], {'name': 'name'}), True, 'import tensorflow as tf\n'), (20, 'tensorflow.reduce_mean', 'tf.reduce_mean', (['vec', '(0)'], {}), True, 'import tensorflow as tf\n'), (21, 'tensorflow.assign', 'tf.assign', (['curr_avg', '(curr...
jiajunhua/asyml-texar
22d7b8eea5bd43eef68b615ba87b2e8220bafdf8
# Copyright 2018 The Texar 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 applicable ...
[ "tensorflow.get_collection_ref", "tensorflow.placeholder_with_default", "tensorflow.equal" ]
texar/tf/context.py
[(53, 'tensorflow.get_collection_ref', 'tf.get_collection_ref', (['_GLOBAL_MODE_KEY'], {}), True, 'import tensorflow as tf\n'), (84, 'tensorflow.equal', 'tf.equal', (['mode', 'tf.estimator.ModeKeys.TRAIN'], {}), True, 'import tensorflow as tf\n'), (91, 'tensorflow.equal', 'tf.equal', (['mode', 'tf.estimator.ModeKeys.EV...
microsoft/DistributedBERT
e6245fee4d7123466a3e3b53f8afacffd6baa75f
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
[ "tensorflow.train.LoggingTensorHook", "tensorflow.metrics.accuracy", "tensorflow.nn.log_softmax", "tensorflow.FixedLenFeature", "tensorflow.gfile.Exists", "tensorflow.reduce_sum", "tensorflow.gfile.GFile", "tensorflow.train.init_from_checkpoint", "tensorflow.contrib.data.parallel_interleave", "ten...
run_pretraining.py
[(100, 'tensorflow.flags.DEFINE_string', 'tf.flags.DEFINE_string', (['"""tpu_name"""', 'None', '"""The Cloud TPU to use for training. This should be either the name used when creating the Cloud TPU, or a grpc://ip.address.of.tpu:8470 url."""'], {}), True, 'import tensorflow as tf\n'), (106, 'tensorflow.flags.DEFINE_str...
stephenjfox/trax
918b1ce2ad63a24cb957ebc8e8ea0af1ee272666
# coding=utf-8 # Copyright 2022 The Trax 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 a...
[ "tensorflow.device", "tensorflow.concat", "tensorflow.zeros", "tensorflow.cast", "tensorflow.image.random_crop", "numpy.concatenate", "tensorflow.compat.v1.gfile.GFile", "tensorflow.nest.flatten", "tensorflow.nest.pack_sequence_as", "numpy.random.randint", "tensorflow.image.random_flip_left_righ...
trax/data/tf_inputs.py
[(74, 'gin.configurable', 'gin.configurable', ([], {'module': '"""trax.data"""'}), False, 'import gin\n'), (288, 'gin.configurable', 'gin.configurable', ([], {'module': '"""trax.data"""'}), False, 'import gin\n'), (457, 'gin.configurable', 'gin.configurable', ([], {'module': '"""trax.data"""'}), False, 'import gin\n'),...
tombroz/berkeley-cs294_homework
5419b772c734093c750362d2e09b46ce59d79da6
import os import sys import time import gym.spaces import itertools import numpy as np import random import tensorflow as tf import tensorflow.contrib.layers as layers from collections import namedtuple from dqn_utils import * OptimizerSpec = namedtuple("OptimizerSpec", ["constructor", "kwargs", "lr_sc...
[ "tensorflow.reduce_max", "tensorflow.summary.FileWriter", "numpy.random.choice", "tensorflow.get_collection", "tensorflow.shape", "tensorflow.cast", "tensorflow.global_variables", "tensorflow.placeholder", "tensorflow.Summary.Value", "numpy.mean", "tensorflow.argmax", "tensorflow.group" ]
hw3/dqn.py
[(14, 'collections.namedtuple', 'namedtuple', (['"""OptimizerSpec"""', "['constructor', 'kwargs', 'lr_schedule']"], {}), False, 'from collections import namedtuple\n'), (89, 'tensorflow.summary.FileWriter', 'tf.summary.FileWriter', (['out_dir'], {}), True, 'import tensorflow as tf\n'), (103, 'tensorflow.placeholder', '...
mihirp1998/sbnet_3d_tensorflow
2a990c6e16d33b5b89815c9543819a3e42ebab1d
""" Sparse Blocks Network Copyright (c) 2017, Uber Technologies, 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 re...
[ "tensorflow.cond", "tensorflow.get_variable", "numpy.expand_dims", "numpy.sqrt", "tensorflow.control_dependencies", "tensorflow.zeros", "tensorflow.nn.max_pool", "tensorflow.stack", "tensorflow.cast", "tensorflow.nn.l2_loss", "tensorflow.pad", "tensorflow.nn.conv2d", "tensorflow.strided_slic...
sbnet_tensorflow/benchmark/sparse_conv_lib.py
[(72, 'logger.get', 'logger.get', ([], {}), False, 'import logger\n'), (74, 'tensorflow.load_op_library', 'tf.load_op_library', (['"""../sbnet_ops/libsbnet.so"""'], {}), True, 'import tensorflow as tf\n'), (76, 'collections.namedtuple', 'namedtuple', (['"""BlockParams"""', "['bsize', 'bsize_out', 'boffset', 'bcount', '...
yougoforward/tensorpackwithmscnn
8d5ae5cc2cfcf2e4e53b4d1064ac9e727f736d09
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: mnist-addition.py # Author: Yuxin Wu <ppwwyyxxc@gmail.com> import cv2 import numpy as np import tensorflow as tf import os import argparse from tensorpack import * from tensorpack.dataflow import dataset from tensorpack.tfutils import sesscreate, optimizer, summa...
[ "tensorflow.get_variable", "tensorflow.concat", "tensorflow.train.AdamOptimizer", "tensorflow.pad", "tensorflow.add_n", "numpy.matmul", "numpy.stack", "tensorflow.name_scope", "tensorflow.nn.in_top_k", "tensorflow.matmul", "tensorflow.nn.sparse_softmax_cross_entropy_with_logits", "numpy.transp...
examples/SpatialTransformer/mnist-addition.py
[(100, 'tensorpack.dataflow.dataset.Mnist', 'dataset.Mnist', (["('train' if isTrain else 'test')"], {}), False, 'from tensorpack.dataflow import dataset\n'), (125, 'numpy.array', 'np.array', (['[[0, 0, 1], [WARP_TARGET_SIZE, 0, 1], [WARP_TARGET_SIZE, WARP_TARGET_SIZE, \n 1], [0, WARP_TARGET_SIZE, 1]]'], {'dtype': '"...
aikakysymys/transformers
34e11fab167a7beb78fbe6991ff8721dc9208793
# coding=utf-8 # Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
[ "tensorflow.convert_to_tensor", "tensorflow.not_equal", "tensorflow.range" ]
src/transformers/modeling_tf_flaubert.py
[(278, 'random.uniform', 'random.uniform', (['(0)', '(1)'], {}), False, 'import random\n'), (202, 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['([slen] * bs)', 'tf.int32'], {}), True, 'import tensorflow as tf\n'), (224, 'tensorflow.range', 'tf.range', (['slen'], {}), True, 'import tensorflow as tf\n'), (20...
StijnMatsHendriks/adversarial_attack_demo
956fd8a96c0c8abf1f4a3e0ffb9d83eeda79b8ff
""" This module provide the defence method for SpatialSmoothingDefence's implement. Feature Squeezing: Detecting Adversarial Examples in Deep Neural Networks """ from __future__ import division from builtins import range from past.utils import old_div import logging logger=logging.getLogger(__name__) import numpy a...
[ "tensorflow.clip_by_value", "tensorflow.sign", "tensorflow.gradients", "tensorflow.stop_gradient", "tensorflow.square", "tensorflow.sqrt", "tensorflow.abs" ]
adversarialbox/attacks/tf/tools.py
[(12, 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), False, 'import logging\n'), (28, 'tensorflow.gradients', 'tf.gradients', (['loss', 'x'], {}), True, 'import tensorflow as tf\n'), (67, 'tensorflow.gradients', 'tf.gradients', (['loss', 'x'], {}), True, 'import tensorflow as tf\n'), (37, 'past.utils.old...
lixusign/euler
c8ce1968367aec2807cc542fcdb5958e3b1b9295
# Copyright 2018 Alibaba Group Holding Limited. 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.unique", "tensorflow.stack", "tensorflow.cast", "tensorflow.reshape", "tensorflow.SparseTensor", "tensorflow.sparse_reorder", "tensorflow.size" ]
tf_euler/python/euler_ops/neighbor_ops.py
[(41, 'tf_euler.python.euler_ops.base._LIB_OP.get_full_neighbor', 'base._LIB_OP.get_full_neighbor', (['nodes', 'edge_types'], {}), False, 'from tf_euler.python.euler_ops import base\n'), (59, 'tf_euler.python.euler_ops.base._LIB_OP.get_sorted_full_neighbor', 'base._LIB_OP.get_sorted_full_neighbor', (['nodes', 'edge_typ...
NWPU-903PR/MTDDI
ee4b7f9641aa55681757136f86bae540b046f40b
from __future__ import division from __future__ import print_function from operator import itemgetter from itertools import combinations import time import os import pandas as pd import random import copy import scipy.io as sio import tensorflow as tf import numpy as np import networkx as nx import scipy.sparse as sp f...
[ "sklearn.metrics.roc_auc_score", "tensorflow.sparse_placeholder", "numpy.nan_to_num", "sklearn.metrics.confusion_matrix", "sklearn.metrics.f1_score", "numpy.exp", "numpy.hstack", "tensorflow.placeholder_with_default", "sklearn.metrics.precision_recall_curve", "tensorflow.name_scope", "tensorflow...
main.py
[(39, 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), True, 'import numpy as np\n'), (209, 'scipy.sparse.identity', 'sp.identity', (['n_drugs'], {}), True, 'import scipy.sparse as sp\n'), (274, 'MTDDI.minibatch.EdgeMinibatchIterator', 'EdgeMinibatchIterator', ([], {'adj_mats': 'adj_mats_orig', 'drug_similarity': ...
nelsonsaturno/keras-yolo3
5fcdd0ef4ec17c952ccbe38612d2f1d97a029937
from functools import reduce, wraps import tensorflow as tf import keras.backend as K from keras.layers import Input, Lambda from keras.models import Model from keras.layers import Conv2D, Add, ZeroPadding2D, UpSampling2D, Concatenate, MaxPooling2D from keras.layers.advanced_activations import LeakyReLU from keras.lay...
[ "tensorflow.boolean_mask" ]
tiny_model.py
[(170, 'functools.wraps', 'wraps', (['Conv2D'], {}), False, 'from functools import reduce, wraps\n'), (39, 'keras.backend.expand_dims', 'K.expand_dims', (['b1', '(-2)'], {}), True, 'import keras.backend as K\n'), (47, 'keras.backend.expand_dims', 'K.expand_dims', (['b2', '(0)'], {}), True, 'import keras.backend as K\n'...
bluemonk482/tdlstm
29032c3d116866e3d30b29fdf1a0af605c054d93
import sys sys.path.insert(0, r'../') import data.util import tensorflow as tf import numpy as np class LSTMClassifier: def __init__(self, args, embedding_init): self.learning_rate = args.learning_rate self.num_hidden = args.num_hidden self.num_classes = args.num_classes self.dropout_output = args.dropout_o...
[ "tensorflow.nn.dynamic_rnn", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.train.AdamOptimizer", "tensorflow.gradients", "tensorflow.gather", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.trainable_variables", "tensorflow.argmax", "tensorflow.nn.dropout", "tensorflow.matm...
models/lstm_classifier.py
[(2, 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../"""'], {}), False, 'import sys\n'), (19, 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32', '[None, None]', '"""input"""'], {}), True, 'import tensorflow as tf\n'), (20, 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32', '[None, self.num_classes]'...
hzhwcmhf/contk_docs
d4874cce5347bcf9f33d9fe99756c7145f181b88
import os import json import numpy as np import tensorflow as tf from cotk.dataloader import MultiTurnDialog from cotk.wordvector import WordVector, Glove from utils import debug, try_cache from model import HredModel def create_model(sess, data, args, embed): with tf.variable_scope(args.name): model = HredModel(...
[ "tensorflow.train.get_checkpoint_state", "tensorflow.train.latest_checkpoint", "tensorflow.global_variables", "tensorflow.variables_initializer", "tensorflow.ConfigProto", "tensorflow.Session", "tensorflow.variable_scope", "numpy.array" ]
hred-tensorflow-master/main.py
[(44, 'cotk.dataloader.MultiTurnDialog.load_class', 'MultiTurnDialog.load_class', (['args.dataset'], {}), False, 'from cotk.dataloader import MultiTurnDialog\n'), (45, 'cotk.wordvector.WordVector.load_class', 'WordVector.load_class', (['args.wvclass'], {}), False, 'from cotk.wordvector import WordVector, Glove\n'), (63...
samuelfneumann/RLControl
71430b1de2e4262483908932eb44579c2ec8216d
import tensorflow as tf class BaseNetwork(object): def __init__(self, sess, config, learning_rate): """ base network for actor and critic network. Args: sess: tf.Session() config: Configuration object learning_rate: learning rate for training (Could be a...
[ "tensorflow.contrib.layers.layer_norm" ]
agents/network/base_network.py
[(56, 'tensorflow.contrib.layers.layer_norm', 'tf.contrib.layers.layer_norm', (['net'], {'center': '(True)', 'scale': '(True)', 'activation_fn': 'activation_fn'}), True, 'import tensorflow as tf\n')]
Veluga/agents
c9c690841cd188a2d2d10a4e586a990c075e887d
# coding=utf-8 # Copyright 2020 The TF-Agents 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 la...
[ "tensorflow.compat.v1.enable_v2_behavior", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.device" ]
tf_agents/bandits/agents/examples/v2/train_eval_stationary_linear.py
[(42, 'absl.flags.DEFINE_enum', 'flags.DEFINE_enum', (['"""agent"""', '"""LinUCB"""', "['LinUCB', 'LinTS', 'epsGreedy', 'Mix']", '"""Which agent to use. Possible values are `LinUCB` and `LinTS`, `epsGreedy`, and `Mix`."""'], {}), False, 'from absl import flags\n'), (47, 'absl.flags.DEFINE_bool', 'flags.DEFINE_bool', ([...
OmidPoursaeed/Self_supervised_Learning_Point_Clouds
4f684cc761347f329eb967823f80522a8a3aedc0
''' Created on May 22, 2018 Author: Achlioptas Panos (Github ID: optas) ''' import numpy as np import time import tensorflow as tf import importlib import os import os.path as osp from tflearn import * from . gan import GAN from functools import partial # sys.path.append(BASE_DIR) # from train_rotation_prediction ...
[ "tensorflow.convert_to_tensor", "tensorflow.concat", "tensorflow.global_variables", "tensorflow.random_shuffle", "numpy.random.randint", "tensorflow.Variable", "tensorflow.ConfigProto", "tensorflow.gather", "numpy.argmax", "tensorflow.Session", "tensorflow.square", "tensorflow.trainable_variab...
latent_3d_points_py3/src/w_gan_gp_rot.py
[(39, 'tensorflow.Variable', 'tf.Variable', (['(0)'], {}), True, 'import tensorflow as tf\n'), (50, 'os.path.join', 'osp.join', (['self.flags.top_out_dir', '"""rotated_pc/"""', 'name'], {}), True, 'import os.path as osp\n'), (58, 'importlib.import_module', 'importlib.import_module', (['self.flags.model'], {}), False, '...
Mckiev/homework
f2e05dce1571d3398c148376f1f31a28ef8f2c2f
import uuid import os, inspect import time import pickle import sys import gym.spaces import itertools import numpy as np import random import tensorflow as tf import tensorflow.contrib.layers as layers from collections import namedtuple from dqn_utils import * import logz OptimizerSpec = namedtuple("Op...
[ "tensorflow.shape", "tensorflow.get_collection", "tensorflow.math.reduce_max", "tensorflow.RunOptions", "tensorflow.cast", "tensorflow.global_variables", "tensorflow.placeholder", "numpy.argmax", "numpy.mean", "tensorflow.trainable_variables", "numpy.random.uniform", "tensorflow.group", "num...
hw3/dqn.py
[(16, 'collections.namedtuple', 'namedtuple', (['"""OptimizerSpec"""', "['constructor', 'kwargs', 'lr_schedule']"], {}), False, 'from collections import namedtuple\n'), (20, 'logz.configure_output_dir', 'logz.configure_output_dir', (['logdir'], {}), False, 'import logz\n'), (25, 'logz.save_params', 'logz.save_params', ...
shpach/ssd_keras
08aca69e8cc1b1917aaec78d4c34a5cde22f404a
from tensorflow.python.lib.io import file_io from keras.optimizers import Adam, SGD from keras.callbacks import ModelCheckpoint, LearningRateScheduler, TerminateOnNaN, CSVLogger from keras import backend as K import tensorflow as tf from keras.models import load_model from keras.utils import plot_model from math import...
[ "tensorflow.python.lib.io.file_io.FileIO", "tensorflow.device", "tensorflow.python.client.device_lib.list_local_devices" ]
train_ssd.py
[(37, 'keras.backend.tensorflow_backend._get_available_gpus', 'K.tensorflow_backend._get_available_gpus', ([], {}), True, 'from keras import backend as K\n'), (36, 'tensorflow.python.client.device_lib.list_local_devices', 'device_lib.list_local_devices', ([], {}), False, 'from tensorflow.python.client import device_lib...
elentail/Serving
5aad0d310420bae31ab06972e4837b8309fda057
import os import numpy as np import tensorflow as tf # fixed folder saved_model_dir = "tf_cnn_model/1/" target_dir = "tflite_cnn_model" def convert_tflite(): if not os.path.exists(target_dir): os.makedirs(target_dir) converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir) ...
[ "numpy.expand_dims", "tensorflow.lite.Interpreter", "tensorflow.keras.datasets.mnist.load_data", "tensorflow.lite.TFLiteConverter.from_saved_model", "tensorflow.argmax", "numpy.sum" ]
convert_tflite.py
[(14, 'tensorflow.lite.TFLiteConverter.from_saved_model', 'tf.lite.TFLiteConverter.from_saved_model', (['saved_model_dir'], {}), True, 'import tensorflow as tf\n'), (25, 'tensorflow.keras.datasets.mnist.load_data', 'tf.keras.datasets.mnist.load_data', ([], {}), True, 'import tensorflow as tf\n'), (29, 'tensorflow.lite....
reachlin/machinelearning
eb8ba02aa0da86ccf9991fa609afa84d8c180a21
""" Modified from: https://github.com/tensorflow/models/blob/master/tutorials/rnn/ptb/ptb_word_lm.py RNN with LSTM cells """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import numpy as np import tensorflow as tf import reader import util f...
[ "tensorflow.device", "tensorflow.concat", "tensorflow.python.client.device_lib.list_local_devices", "tensorflow.zeros", "tensorflow.reduce_sum", "tensorflow.contrib.rnn.LSTMBlockCell", "numpy.exp", "tensorflow.summary.scalar", "tensorflow.Graph", "tensorflow.Variable", "tensorflow.random_uniform...
tensorflow/sample_rnn.py
[(335, 'time.time', 'time.time', ([], {}), False, 'import time\n'), (366, 'numpy.exp', 'np.exp', (['(costs / iters)'], {}), True, 'import numpy as np\n'), (401, 'reader.ptb_raw_data', 'reader.ptb_raw_data', (['FLAGS.data_path'], {}), False, 'import reader\n'), (472, 'tensorflow.app.run', 'tf.app.run', ([], {}), True, '...
chisyliu/RotationDetection
4249720ea4dacdd60e696901df8034e5cd0a1843
# -*- coding:utf-8 -*- # Author: Xue Yang <yangxue-2019-sjtu@sjtu.edu.cn>, <yangxue0827@126.com> # License: Apache-2.0 license # Copyright (c) SJTU. ALL rights reserved. from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import numpy as n...
[ "tensorflow.device", "tensorflow.cast", "tensorflow.random_shuffle", "tensorflow.summary.scalar", "tensorflow.add_n", "tensorflow.py_func", "tensorflow.Graph", "tensorflow.contrib.slim.get_or_create_global_step", "tensorflow.get_collection", "tensorflow.summary.image", "tensorflow.train.Momentum...
tools/r3det_dcl/train.py
[(17, 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), False, 'import sys\n'), (37, 'tensorflow.device', 'tf.device', (['"""/cpu:0"""'], {}), True, 'import tensorflow as tf\n'), (40, 'tensorflow.contrib.slim.get_or_create_global_step', 'slim.get_or_create_global_step', ([], {}), True, 'import tensorflow.co...
nikhilsu/Mixed-modal-learning
4e18877cd010665324d46885530e81226cfc1821
import tensorflow as tf import numpy as np import time from tensorflow.contrib.rnn import GRUCell from util.infolog import log def prenet(inputs, is_training, layer_sizes, scope=None): x = inputs drop_rate = 0.5 if is_training else 0.0 with tf.variable_scope(scope or 'prenet'): for i, size in enu...
[ "tensorflow.layers.conv1d", "tensorflow.concat", "tensorflow.contrib.rnn.GRUCell", "tensorflow.nn.max_pool", "tensorflow.layers.dropout", "tensorflow.nn.conv2d", "tensorflow.layers.max_pooling1d", "tensorflow.layers.batch_normalization", "tensorflow.layers.dense", "numpy.load", "tensorflow.matmu...
models/modules.py
[(12, 'tensorflow.variable_scope', 'tf.variable_scope', (["(scope or 'prenet')"], {}), True, 'import tensorflow as tf\n'), (43, 'tensorflow.variable_scope', 'tf.variable_scope', (['scope'], {}), True, 'import tensorflow as tf\n'), (52, 'tensorflow.layers.max_pooling1d', 'tf.layers.max_pooling1d', (['conv_outputs'], {'p...
jtraviesor/alfred-tf-trainer
9747d24bef418415a31abfe0c9982d2f1d9d8298
from tensorflow.python.platform import gfile from tensorflow.contrib.learn.python.learn.preprocessing.text import CategoricalVocabulary import re import numpy as np try: import cPickle as pickle except ImportError: import pickle TOKENIZER_RE = re.compile(r"[A-Z]{2,}(?![a-z])|[A-Z][a-z]+(?=[A-Z])|[\'\w\-]+", ...
[ "tensorflow.contrib.learn.python.learn.preprocessing.text.CategoricalVocabulary", "tensorflow.python.platform.gfile.Open" ]
similarity/preprocessing.py
[(12, 're.compile', 're.compile', (['"""[A-Z]{2,}(?![a-z])|[A-Z][a-z]+(?=[A-Z])|[\\\\\'\\\\w\\\\-]+"""', 're.UNICODE'], {}), False, 'import re\n'), (45, 'tensorflow.contrib.learn.python.learn.preprocessing.text.CategoricalVocabulary', 'CategoricalVocabulary', ([], {'support_reverse': '(True)'}), False, 'from tensorflow...
subex/Tefla
34f8fd0e2f2ee02aa73c6289753e08a95cc41880
# -------------------------------------------------------------------# # Written by Mrinal Haloi # Contact: mrinal.haloi11@gmail.com # Copyright 2017, Mrinal Haloi # -------------------------------------------------------------------# from __future__ import division, print_function, absolute_import import os import ti...
[ "tensorflow.device", "tensorflow.concat", "tensorflow.control_dependencies", "tensorflow.to_int64", "tensorflow.Graph", "tensorflow.python.ops.control_flow_ops.with_dependencies", "tensorflow.get_collection", "tensorflow.summary.image", "tensorflow.merge_all_summaries", "tensorflow.subtract", "t...
tefla/core/learning_ss.py
[(87, 'tensorflow.train.Saver', 'tf.train.Saver', ([], {'max_to_keep': 'None'}), True, 'import tensorflow as tf\n'), (95, 'tensorflow.global_variables_initializer', 'tf.global_variables_initializer', ([], {}), True, 'import tensorflow as tf\n'), (263, 'tensorflow.reduce_mean', 'tf.reduce_mean', (['real_data_features'],...
oplatek/ndm
d32bd9d685902d9da52b7e7abd286fb5d9c7274a
#!/usr/bin/env python3 import tensorflow as tf from tfx.bricks import embedding, dense_to_one_hot, linear, dropout, reduce_max, batch_norm_lin, conv2d_bn, \ pow_1, softmax_2d from model import ModelW2TArgs class Model(ModelW2TArgs): def __init__(self, data, FLAGS): super(Model, self).__init__(data,...
[ "tensorflow.clip_by_value", "tensorflow.nn.relu", "tensorflow.nn.softmax", "tensorflow.concat", "tensorflow.Variable", "tensorflow.scalar_summary", "tensorflow.cast", "tensorflow.stop_gradient", "tensorflow.gather", "tensorflow.name_scope", "tensorflow.trainable_variables", "tensorflow.argmax"...
ndm/model_cnn12_bn_w2targs.py
[(26, 'tensorflow.name_scope', 'tf.name_scope', (['"""data"""'], {}), True, 'import tensorflow as tf\n'), (27, 'tensorflow.Variable', 'tf.Variable', (['data.batch_histories'], {'name': '"""histories"""', 'trainable': '(False)'}), True, 'import tensorflow as tf\n'), (29, 'tensorflow.Variable', 'tf.Variable', (['data.bat...
floregol/gae
d5db3f32a8d26001a9b44f7a863a75a61807461f
import time import os # Train on CPU (hide GPU) due to memory constraints os.environ['CUDA_VISIBLE_DEVICES'] = "" import tensorflow as tf import numpy as np import scipy.sparse as sp from sklearn.metrics import roc_auc_score from sklearn.metrics import average_precision_score from optimizer import OptimizerAE, O...
[ "numpy.dot", "numpy.hstack", "tensorflow.sparse_placeholder", "sklearn.metrics.roc_auc_score", "scipy.sparse.eye", "tensorflow.placeholder_with_default", "tensorflow.sparse_tensor_to_dense", "tensorflow.global_variables_initializer", "scipy.sparse.identity", "tensorflow.name_scope", "tensorflow....
gae/train.py
[(40, 'input_data.load_data', 'load_data', (['dataset_str'], {}), False, 'from input_data import load_data\n'), (47, 'preprocessing.mask_test_edges', 'mask_test_edges', (['adj'], {}), False, 'from preprocessing import preprocess_graph, construct_feed_dict, sparse_to_tuple, mask_test_edges\n'), (54, 'preprocessing.prepr...
scorelab/Elphas
be3e3906fa1f69155dc3f61f5c0bf21568e712c9
# Copyright 2017 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.constant", "tensorflow.image.resize_images", "tensorflow.reduce_sum", "tensorflow.reshape", "tensorflow.global_variables", "tensorflow.test.main", "tensorflow.contrib.layers.fully_connected", "tensorflow.contrib.layers.flatten", "tensorflow.random_uniform" ]
back-end/object_detection/trainer_test.py
[(34, 'tensorflow.random_uniform', 'tf.random_uniform', (['[32, 32, 3]'], {'dtype': 'tf.float32'}), True, 'import tensorflow as tf\n'), (35, 'tensorflow.constant', 'tf.constant', (['"""image_000000"""'], {}), True, 'import tensorflow as tf\n'), (36, 'tensorflow.random_uniform', 'tf.random_uniform', (['[1]'], {'minval':...
yangw1234/models-1
7e7f484f4f22c760f9a5af836f57a3602b4fa7a6
# # -*- coding: utf-8 -*- # # Copyright (c) 2018 Intel Corporation # # 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 app...
[ "tensorflow.Graph", "tensorflow.import_graph_def", "tensorflow.compat.v1.ConfigProto", "tensorflow.constant", "tensorflow.io.write_graph", "tensorflow.compat.v1.Session", "numpy.count_nonzero", "tensorflow.compat.v1.GraphDef", "tensorflow.argmax" ]
models/image_recognition/tensorflow/resnet101/int8/calibration.py
[(55, 'tensorflow.Graph', 'tf.Graph', ([], {}), True, 'import tensorflow as tf\n'), (56, 'tensorflow.compat.v1.GraphDef', 'tf.compat.v1.GraphDef', ([], {}), True, 'import tensorflow as tf\n'), (73, 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), False, 'import argparse\n'), (116, 'datasets.ImagenetData'...
VirgiAgl/GPflow
95e77a5f2fe1514a30f87b5ed03ad72bbce8dead
# Copyright 2017 the GPflow 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 in writi...
[ "tensorflow.convert_to_tensor", "tensorflow.reduce_sum", "numpy.eye", "tensorflow.reshape", "tensorflow.ones_like", "tensorflow.test.main", "tensorflow.diag", "tensorflow.log", "tensorflow.square", "numpy.transpose", "numpy.random.RandomState" ]
tests/test_kldiv.py
[(71, 'pytest.fixture', 'pytest.fixture', ([], {}), False, 'import pytest\n'), (75, 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""white"""', '[True, False]'], {}), False, 'import pytest\n'), (89, 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""diag"""', '[True, False]'], {}), False, 'import py...
DanielDimanov/tpu
883065e163e4f7745a60aa726b426cdca35d38aa
# 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.contrib.cluster_resolver.TPUClusterResolver", "tensorflow.Graph", "tensorflow.summary.FileWriter", "tensorflow.contrib.tpu.RunConfig", "tensorflow.gfile.MakeDirs", "tensorflow.Summary.Value", "numpy.mean", "tensorflow.contrib.tpu.TPUConfig", "tensorflow.Summary", "tensorflow.Session.re...
models/official/detection/executor/tpu_executor.py
[(31, 'tensorflow.Summary', 'tf.Summary', ([], {'value': 'summaries'}), True, 'import tensorflow as tf\n'), (41, 'evaluation.factory.evaluator_generator', 'factory.evaluator_generator', (['params.eval'], {}), False, 'from evaluation import factory\n'), (74, 'tensorflow.contrib.tpu.TPUConfig', 'tf.contrib.tpu.TPUConfig'...
trisct/ldif
3dfa33c88b15178eebac3c7d93e5de1ca2682d23
# Copyright 2020 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.io.FixedLenFeature", "tensorflow.train.Features", "tensorflow.train.BytesList", "tensorflow.py_func" ]
ldif/datasets/process_element.py
[(34, 'time.time', 'time.time', ([], {}), False, 'import time\n'), (36, 'ldif.inference.example.InferenceExample.from_directory', 'example.InferenceExample.from_directory', (['example_directory'], {'verbose': '(False)'}), False, 'from ldif.inference import example\n'), (37, 'time.time', 'time.time', ([], {}), False, 'i...
StanislavParovoy/tf_multispeakerTTS_fc
8663a9b6aad39d4e30e83668ff9525ead1aa01e1
from synthesizer.utils.symbols import symbols from synthesizer.utils.text import sequence_to_text from synthesizer.hparams import hparams_debug_string from synthesizer.feeder import Feeder from synthesizer.models import create_model from synthesizer.utils import ValueWindow, plot from synthesizer import infolog, audio ...
[ "tensorflow.summary.scalar", "tensorflow.Variable", "tensorflow.ConfigProto", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.Summary", "tensorflow.norm", "numpy.isnan", "tensorflow.train.Coordinator", "tensorflow.global_variables_initializer", "tensorflow.summary.merge_all", "tens...
synthesizer/train.py
[(21, 'tensorflow.contrib.tensorboard.plugins.projector.ProjectorConfig', 'tf.contrib.tensorboard.plugins.projector.ProjectorConfig', ([], {}), True, 'import tensorflow as tf\n'), (32, 'tensorflow.contrib.tensorboard.plugins.projector.visualize_embeddings', 'tf.contrib.tensorboard.plugins.projector.visualize_embeddings...
dvbvr/batch-ppo
ab0688eef8622a512b27206dfd4da095d7ddeb39
# Copyright 2017 The TensorFlow Agents 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 ag...
[ "tensorflow.scatter_update", "tensorflow.zeros", "tensorflow.check_numerics", "tensorflow.identity", "tensorflow.ones", "tensorflow.zeros_like", "tensorflow.name_scope", "tensorflow.variable_scope", "tensorflow.py_func" ]
agents/tools/in_graph_batch_env.py
[(121, 'tensorflow.py_func', 'tf.py_func', (['self._batch_env.reset', '[indices]', 'observ_dtype'], {'name': '"""reset"""'}), True, 'import tensorflow as tf\n'), (123, 'tensorflow.check_numerics', 'tf.check_numerics', (['observ', '"""observ"""'], {}), True, 'import tensorflow as tf\n'), (124, 'tensorflow.zeros_like', '...
takanobu-watanabe/bert-japanese
c4ccf65c01f515b6de9ddece7b04c8bd61a4a262
# coding=utf-8 # This file is based on https://github.com/google-research/bert/blob/master/run_classifier.py. # It is changed to use SentencePiece tokenizer and https://www.rondhuit.com/download/ldcc-20140209.tar.gz. """BERT finetuning runner.""" from __future__ import absolute_import from __future__ import division f...
[ "tensorflow.contrib.cluster_resolver.TPUClusterResolver", "tensorflow.metrics.accuracy", "tensorflow.FixedLenFeature", "tensorflow.nn.log_softmax", "tensorflow.reduce_sum", "tensorflow.gfile.GFile", "tensorflow.cast", "tensorflow.train.init_from_checkpoint", "tensorflow.gfile.MakeDirs", "tensorflo...
src/run_classifier.py
[(22, 'os.path.join', 'os.path.join', (['CURDIR', 'os.pardir', '"""config.ini"""'], {}), False, 'import os\n'), (23, 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), False, 'import configparser\n'), (25, 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {'mode': '"""w+t"""', 'encodin...
prasys/embedding-as-service
b1691cbf1ea1df39c109ace18562c8dc332750ec
"""doc.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tensorflow as tf from embedding_as_service.text.xlnet.models import modeling import xlnet def construct_scalar_host_call( monitor_dict, model_dir, prefix="", reduce...
[ "tensorflow.concat", "tensorflow.nn.log_softmax", "tensorflow.reduce_sum", "tensorflow.layers.dropout", "tensorflow.cast", "tensorflow.contrib.summary.always_record_summaries", "tensorflow.layers.dense", "tensorflow.train.get_or_create_global_step", "tensorflow.squeeze", "tensorflow.nn.top_k", "...
server/embedding_as_service/text/xlnet/models/function_builder.py
[(53, 'tensorflow.transpose', 'tf.transpose', (["features['input_k']", '[1, 0]'], {}), True, 'import tensorflow as tf\n'), (54, 'tensorflow.transpose', 'tf.transpose', (["features['input_q']", '[1, 0]'], {}), True, 'import tensorflow as tf\n'), (56, 'tensorflow.transpose', 'tf.transpose', (["features['seg_id']", '[1, 0...
returncode13/tensorflow
c5f94b10bbb30e525fa3ca313e7ccb173040c90a
# Copyright 2016 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.ops.math_ops.reduce_sum", "tensorflow.python.ops.array_ops.rank", "tensorflow.python.ops.math_ops.sigmoid", "tensorflow.python.ops.math_ops.greater_equal", "tensorflow.python.ops.nn.softmax", "tensorflow.python.ops.array_ops.shape", "tensorflow.python.ops.math_ops.argmax", "tensorfl...
tensorflow/contrib/layers/python/layers/target_column.py
[(353, 'tensorflow.python.ops.nn.sparse_softmax_cross_entropy_with_logits', 'nn.sparse_softmax_cross_entropy_with_logits', (['logits', 'target'], {}), False, 'from tensorflow.python.ops import nn\n'), (359, 'tensorflow.python.ops.math_ops.cast', 'math_ops.cast', (['targets', 'predictions.dtype'], {}), False, 'from tens...
RangK/models
a1ce90442e3205b82ffca3badd3c65408f4450cb
# Copyright 2017 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.string_to_hash_bucket_fast", "tensorflow.constant", "tensorflow.concat", "tensorflow.shape", "tensorflow.cast", "tensorflow.ones_like", "tensorflow.squeeze", "tensorflow.minimum", "tensorflow.equal", "tensorflow.placeholder", "tensorflow.expand_dims", "tensorflow.reshape", "tenso...
research/object_detection/inputs.py
[(134, 'tensorflow.squeeze', 'tf.squeeze', (['preprocessed_resized_image'], {'axis': '(0)'}), True, 'import tensorflow as tf\n'), (136, 'tensorflow.squeeze', 'tf.squeeze', (['true_image_shape'], {'axis': '(0)'}), True, 'import tensorflow as tf\n'), (150, 'tensorflow.one_hot', 'tf.one_hot', (['zero_indexed_groundtruth_c...
maxorange/surface-to-structure
b7227ea34a6ebc358d491eea70f0fa6cca400265
import tensorflow as tf import numpy as np class Model(object): def __init__(self, vars): self.saver = tf.train.Saver(vars) def session(self, sess): if sess is not None: self.sess = sess else: config_proto = tf.ConfigProto() config_proto.gpu_options...
[ "tensorflow.cond", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.concat", "tensorflow.control_dependencies", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.nn.conv2d_transpose", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.moving_average_variables", "ten...
ops.py
[(44, 'tensorflow.nn.softmax_cross_entropy_with_logits', 'tf.nn.softmax_cross_entropy_with_logits', ([], {'labels': 'labels', 'logits': 'logits'}), True, 'import tensorflow as tf\n'), (47, 'tensorflow.nn.sigmoid_cross_entropy_with_logits', 'tf.nn.sigmoid_cross_entropy_with_logits', ([], {'labels': 'labels', 'logits': '...
YorkUCVIL/Wavelet-Flow
8d6d63fa116ec44299c32f37e66817594510f644
import tensorflow as tf import os from util import * class Validation_data: def __init__(self,batch_override=None,shuffle_repeat=True,partial_level=0): with tf.variable_scope(None,default_name='validation_data'): self.crop_factor = config.validation.partial_training_crops[partial_level] datasetRoot = config.v...
[ "tensorflow.read_file", "tensorflow.shape", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.cast", "tensorflow.floor", "tensorflow.image.random_crop", "tensorflow.variable_scope", "tensorflow.random_uniform" ]
src/models/lsun_bedroom_64_haar/Validation_data.py
[(44, 'tensorflow.image.random_crop', 'tf.image.random_crop', (['rgb'], {'size': '[h, w, c]'}), True, 'import tensorflow as tf\n'), (49, 'tensorflow.image.random_crop', 'tf.image.random_crop', (['rgb'], {'size': '[crop_h, crop_w, c]'}), True, 'import tensorflow as tf\n'), (52, 'tensorflow.cast', 'tf.cast', (['rgb', 'tf...
YorkUCVIL/Wavelet-Flow
8d6d63fa116ec44299c32f37e66817594510f644
import tensorflow as tf import os from util import * class Training_data: def __init__(self,partial_level=0): with tf.variable_scope(None,default_name='training_data'): self.crop_factor = config.training.partial_training_crops[partial_level] datasetRoot = config.training.data.root_path data_list_path = os....
[ "tensorflow.image.random_flip_left_right", "tensorflow.read_file", "tensorflow.shape", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.cast", "tensorflow.floor", "tensorflow.image.random_crop", "tensorflow.variable_scope", "tensorflow.random_uniform" ]
src/models/lsun_bedroom_64_haar/Training_data.py
[(49, 'tensorflow.image.random_crop', 'tf.image.random_crop', (['rgb'], {'size': '[h, w, c]'}), True, 'import tensorflow as tf\n'), (54, 'tensorflow.image.random_crop', 'tf.image.random_crop', (['rgb'], {'size': '[crop_h, crop_w, c]'}), True, 'import tensorflow as tf\n'), (57, 'tensorflow.image.random_flip_left_right',...
ryanxjhan/AI-Space-Invader
256365ca5e55af93fdf6db45d604d08aa4fad905
"""Common functions you may find useful in your implementation.""" import semver import tensorflow as tf from six.moves import cPickle def get_uninitialized_variables(variables=None): """Return a list of uninitialized tf variables. Parameters ---------- variables: tf.Variable, list(tf.Variable), opt...
[ "tensorflow.get_default_session", "tensorflow.global_variables", "tensorflow.is_variable_initialized" ]
deeprl_p2/utils.py
[(23, 'tensorflow.get_default_session', 'tf.get_default_session', ([], {}), True, 'import tensorflow as tf\n'), (32, 'semver.match', 'semver.match', (['tf.__version__', '"""<1.0.0"""'], {}), False, 'import semver\n'), (64, 'six.moves.cPickle.load', 'cPickle.load', (['fin'], {}), False, 'from six.moves import cPickle\n'...
gyshi/intel-models
4ead44aa254a84109ac8019f5d386e3adb75ac26
"""Validate a face recognizer on the "Labeled Faces in the Wild" dataset (http://vis-www.cs.umass.edu/lfw/). Embeddings are calculated using the pairs from http://vis-www.cs.umass.edu/lfw/pairs.txt and the ROC curve is calculated and plotted. Both the model metagraph and the model parameters need to exist in the same d...
[ "tensorflow.Graph", "tensorflow.get_default_graph", "numpy.ones_like", "numpy.arange", "tensorflow.train.start_queue_runners", "tensorflow.train.Coordinator", "tensorflow.placeholder", "tensorflow.ConfigProto", "numpy.std", "scipy.interpolate.interp1d", "numpy.zeros_like", "numpy.mean", "ten...
models/face_detection_and_alignment/tensorflow/facenet/fp32/validate_on_lfw.py
[(123, 'numpy.zeros_like', 'np.zeros_like', (['labels_array', 'np.int32'], {}), True, 'import numpy as np\n'), (134, 'numpy.zeros', 'np.zeros', (['(nrof_images, embedding_size)'], {}), True, 'import numpy as np\n'), (135, 'numpy.zeros', 'np.zeros', (['(nrof_images,)'], {}), True, 'import numpy as np\n'), (156, 'numpy.z...
MaxInGaussian/ZS-VAFNN
d80846248eb244adf3c56560b15155d1682550cc
''' SGPA_graph.py ''' import tensorflow as tf ## Computation graph for SGPA def build_SGPA_graph(X, layers_width, n_samples, n_basis): KL = 0 Z = tf.expand_dims(tf.tile(tf.expand_dims(X, 0), [n_samples, 1, 1]), 2) for h, n_out in enumerate(layers_width[1:]): # Hidden layer if(h < len(layers...
[ "tensorflow.matmul", "tensorflow.sin", "tensorflow.nn.sigmoid", "tensorflow.concat", "tensorflow.cos", "tensorflow.reduce_mean", "tensorflow.shape", "tensorflow.layers.dense", "tensorflow.exp", "tensorflow.expand_dims", "tensorflow.cosh", "tensorflow.sinh", "tensorflow.sqrt", "tensorflow.r...
demo/SGPA_graph.py
[(7, 'tensorflow.expand_dims', 'tf.expand_dims', (['X', '(0)'], {}), True, 'import tensorflow as tf\n'), (12, 'tensorflow.layers.dense', 'tf.layers.dense', (['Z', '(n_basis // 2)'], {}), True, 'import tensorflow as tf\n'), (20, 'tensorflow.exp', 'tf.exp', (['alpha_logstd'], {}), True, 'import tensorflow as tf\n'), (23,...
xiaoshicae/Others
a5df75f1da527f94c1c79870a8f5ac7c9a7353c2
# Copyright 2016 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 applicable ...
[ "tensorflow.device", "tensorflow.summary.scalar", "tensorflow.python.ops.control_flow_ops.with_dependencies", "tensorflow.get_collection", "tensorflow.get_variable_scope", "tensorflow.div", "tensorflow.logging.info", "tensorflow.name_scope", "tensorflow.histogram_summary", "tensorflow.group", "t...
SSD/deployment/model_deploy.py
[(121, 'collections.namedtuple', 'collections.namedtuple', (['"""Clone"""', "['outputs', 'scope', 'device']"], {}), False, 'import collections\n'), (128, 'collections.namedtuple', 'collections.namedtuple', (['"""DeployedModel"""', "['train_op', 'summary_op', 'total_loss', 'clones']"], {}), False, 'import collections\n'...
LinghengMeng/spinningup
f52615a0081ac6c20aade7efd55c2a4a7047c968
import numpy as np import tensorflow as tf class VariationalDense: """Variational Dense Layer Class""" def __init__(self, n_in, n_out, dropout_mask_ph, model_prob=0.9, model_lam=3e-4, activation=None, name="hidden"): self.model_prob = model_prob # probability to keep units s...
[ "tensorflow.concat", "tensorflow.zeros", "tensorflow.shape", "tensorflow.layers.dropout", "tensorflow.reshape", "tensorflow.global_variables", "tensorflow.layers.dense", "tensorflow.placeholder", "tensorflow.initializers.truncated_normal", "tensorflow.einsum", "tensorflow.squeeze", "numpy.rand...
spinup/algos/ude_td3_batchP/core.py
[(70, 'tensorflow.placeholder', 'tf.placeholder', ([], {'dtype': 'tf.float32', 'shape': '((None, dim) if dim else (None,))'}), True, 'import tensorflow as tf\n'), (116, 'tensorflow.layers.dropout', 'tf.layers.dropout', (['x'], {'rate': 'dropout_rate', 'training': '(True)'}), True, 'import tensorflow as tf\n'), (117, 't...
yyht/PyCLUE_albert
06f131241163a745747da33c5f563abe4413897b
# -*- coding: utf-8 -*- # @Author: Liu Shaoweihua # @Date: 2019-11-18 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
[ "tensorflow.range", "tensorflow.shape", "tensorflow.matrix_band_part", "tensorflow.reshape", "tensorflow.ones_like", "tensorflow.ones", "tensorflow.expand_dims", "tensorflow.gather", "tensorflow.get_variable_scope" ]
PyCLUE/utils/utils/classifier_utils/bert_utils.py
[(65, 'tensorflow.shape', 'tf.shape', (['tensor'], {}), True, 'import tensorflow as tf\n'), (80, 'tensorflow.reshape', 'tf.reshape', (['input_tensor', '[-1, width]'], {}), True, 'import tensorflow as tf\n'), (93, 'tensorflow.reshape', 'tf.reshape', (['output_tensor', '(orig_dims + [width])'], {}), True, 'import tensorf...
JJXiangJiaoJun/DQN_FlappyBird
4d7b56427bf3e0c38f67298ac7e4bf6f5ae318db
#coding=utf-8 from __future__ import print_function #导入一些必要的包 import tensorflow as tf import cv2 import sys sys.path.append("game/") import wrapped_flappy_bird as game import random import numpy as np from collections import deque class Flappy_Bird(object): def __init__(self): self.GAM...
[ "tensorflow.nn.max_pool", "numpy.max", "tensorflow.train.AdamOptimizer", "tensorflow.nn.conv2d", "numpy.reshape", "tensorflow.truncated_normal_initializer", "numpy.stack", "numpy.argmax", "tensorflow.Session", "tensorflow.square", "tensorflow.train.Saver", "numpy.zeros", "tensorflow.matmul",...
DQN_FlappyBird.py
[(8, 'sys.path.append', 'sys.path.append', (['"""game/"""'], {}), False, 'import sys\n'), (30, 'collections.deque', 'deque', ([], {}), False, 'from collections import deque\n'), (33, 'wrapped_flappy_bird.GameState', 'game.GameState', ([], {}), True, 'import wrapped_flappy_bird as game\n'), (34, 'tensorflow.Session', 't...
RitwickGhosh/retinaface-tf2
01ac9b4fe41dc11678034b4c5ffb14c51d52d809
import tensorflow as tf def _smooth_l1_loss(y_true, y_pred): t = tf.abs(y_pred - y_true) return tf.where(t < 1, 0.5 * t ** 2, t - 0.5) def MultiBoxLoss(num_class=2, neg_pos_ratio=3): """multi-box loss""" def multi_box_loss(y_true, y_pred): num_batch = tf.shape(y_true)[0] num_prior = ...
[ "tensorflow.boolean_mask", "tensorflow.reduce_mean", "tensorflow.logical_or", "tensorflow.maximum", "tensorflow.shape", "tensorflow.reshape", "tensorflow.equal", "tensorflow.keras.losses.sparse_categorical_crossentropy", "tensorflow.cast", "tensorflow.argsort", "tensorflow.where", "tensorflow....
modules/losses.py
[(5, 'tensorflow.abs', 'tf.abs', (['(y_pred - y_true)'], {}), True, 'import tensorflow as tf\n'), (6, 'tensorflow.where', 'tf.where', (['(t < 1)', '(0.5 * t ** 2)', '(t - 0.5)'], {}), True, 'import tensorflow as tf\n'), (15, 'tensorflow.reshape', 'tf.reshape', (['y_pred[0]', '[num_batch * num_prior, 4]'], {}), True, 'i...
krishpop/google-research
3b5ac2325cb61920624859f7ac2faf2198e9c38d
# coding=utf-8 # Copyright 2019 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.train.get_checkpoint_state", "numpy.pad", "tensorflow.contrib.summary.create_file_writer", "tensorflow.keras.layers.Lambda", "tensorflow.io.gfile.exists", "numpy.arange", "tensorflow.compat.v1.train.remove_checkpoint", "tensorflow.io.gfile.makedirs", "matplotlib.pyplot.subplots", "tens...
safemrl/utils/misc.py
[(55, 'scipy.signal.butter', 'butter', (['order', '[low, high]'], {'btype': '"""band"""'}), False, 'from scipy.signal import butter, lfilter\n'), (61, 'scipy.signal.lfilter', 'lfilter', (['b', 'a', 'data'], {}), False, 'from scipy.signal import butter, lfilter\n'), (66, 'tf_agents.utils.common.Checkpointer', 'common.Ch...
DarkTheCross/rl_experiments
3b448d946e18b8d8e40b45b71f4da2fba4e6eb66
import argparse import gym from gym import wrappers import os.path as osp import random import numpy as np import tensorflow as tf import tensorflow.contrib.layers as layers import dqn from dqn_utils import * from atari_wrappers import * def atari_model(img_in, num_actions, scope, reuse=False): # as described in...
[ "tensorflow.contrib.layers.convolution2d", "numpy.random.seed", "tensorflow.python.client.device_lib.list_local_devices", "tensorflow.set_random_seed", "tensorflow.ConfigProto", "tensorflow.contrib.layers.fully_connected", "tensorflow.reset_default_graph", "tensorflow.contrib.layers.flatten", "tenso...
pong/run_dqn_atari.py
[(63, 'dqn.learn', 'dqn.learn', (['env'], {'q_func': 'atari_model', 'optimizer_spec': 'optimizer', 'session': 'session', 'exploration': 'exploration_schedule', 'stopping_criterion': 'stopping_criterion', 'replay_buffer_size': '(1000000)', 'batch_size': '(32)', 'gamma': '(0.99)', 'learning_starts': '(50000)', 'learning_...
TropComplique/single-shot-detector
3714d411305f1a55bebb7e38ee58dfea70aa328d
import tensorflow as tf from detector import SSD from detector.anchor_generator import AnchorGenerator from detector.box_predictor import RetinaNetBoxPredictor from detector.feature_extractor import RetinaNetFeatureExtractor from detector.backbones import mobilenet_v1, shufflenet_v2 from metrics import Evaluator MOVI...
[ "tensorflow.control_dependencies", "tensorflow.train.ExponentialMovingAverage", "tensorflow.nn.l2_loss", "tensorflow.train.AdamOptimizer", "tensorflow.summary.scalar", "tensorflow.losses.get_total_loss", "tensorflow.train.cosine_decay", "tensorflow.get_collection", "tensorflow.train.get_global_step"...
model.py
[(34, 'detector.feature_extractor.RetinaNetFeatureExtractor', 'RetinaNetFeatureExtractor', (['is_training', 'backbone'], {}), False, 'from detector.feature_extractor import RetinaNetFeatureExtractor\n'), (37, 'detector.anchor_generator.AnchorGenerator', 'AnchorGenerator', ([], {'strides': '[8, 16, 32, 64, 128]', 'scale...
digimatronics/Deepmind-Pythons-TF
9b1c649e7a241ba8a70631378146dc92f742deec
# Copyright 2016 Google 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 writing, ...
[ "tensorflow.contrib.layers.python.layers.utils.constant_value", "tensorflow.get_variable", "tensorflow.nn.batch_normalization", "tensorflow.logging.warning", "tensorflow.python.training.moving_averages.assign_moving_average", "tensorflow.nn.normalize_moments", "tensorflow.identity", "tensorflow.contri...
nn/batch_norm.py
[(118, 'nn.util.check_initializers', 'util.check_initializers', (['initializers', 'self.POSSIBLE_INITIALIZER_KEYS'], {}), False, 'from nn import util\n'), (150, 'tensorflow.get_variable', 'tf.get_variable', (['"""moving_mean"""'], {'shape': 'self._mean_shape', 'collections': '[tf.GraphKeys.MOVING_AVERAGE_VARIABLES, tf....
wangguizhu27/tensorflow1
3462966ac7d3884c2153b1655e8528a0f6bac0f4
# Copyright 2016 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.framework.tensor_shape.scalar", "tensorflow.python.ops.math_ops.log", "tensorflow.python.ops.array_ops.shape", "tensorflow.contrib.distributions.python.ops.distribution_util.assert_integer_form", "tensorflow.python.ops.control_flow_ops.with_dependencies", "tensorflow.python.ops.check_op...
tensorflow/contrib/distributions/python/ops/poisson.py
[(115, 'tensorflow.contrib.distributions.python.ops.distribution_util.AppendDocstring', 'distribution_util.AppendDocstring', (['_poisson_sample_note'], {}), False, 'from tensorflow.contrib.distributions.python.ops import distribution_util\n'), (119, 'tensorflow.contrib.distributions.python.ops.distribution_util.AppendD...
christopher-hsu/ray
abe84b596253411607a91b3a44c135f5e9ac6ac7
from __future__ import division import warnings import keras.backend as K from keras.models import Model from keras.layers import Lambda, Input, Layer, Dense from rl.core import Agent from rl.policy import EpsGreedyQPolicy, GreedyQPolicy from rl.util import * import pdb def mean_q(y_true, y_pred): return K.mean(...
[ "tensorflow.transpose", "tensorflow.concat", "tensorflow.scan", "tensorflow.shape", "tensorflow.gather" ]
python/ray/rllib/RL/BRL/DRL/keras/dqn.py
[(14, 'keras.backend.max', 'K.max', (['y_pred'], {'axis': '(-1)'}), True, 'import keras.backend as K\n'), (181, 'keras.layers.Input', 'Input', ([], {'name': '"""y_true"""', 'shape': '(self.nb_actions,)'}), False, 'from keras.layers import Lambda, Input, Layer, Dense\n'), (182, 'keras.layers.Input', 'Input', ([], {'name...
boldjoel/tensorlayer
bb52f4fc40ec88b55fcfcea38a3d4f36a5573541
# -*- coding: utf-8 -*- import time import numpy as np import tensorflow as tf from tensorflow.python.util.deprecation import deprecated from .. import _logging as logging from .. import files, iterate, utils, visualize from ..deprecation import deprecated_alias __all__ = [ 'LayersConfig', 'TF_GRAPHKEYS_VA...
[ "tensorflow.get_variable", "tensorflow.count_nonzero", "tensorflow.reduce_sum", "tensorflow.global_variables", "tensorflow.train.AdamOptimizer", "tensorflow.nn.nce_loss", "tensorflow.all_variables", "tensorflow.random_uniform_initializer", "tensorflow.truncated_normal_initializer", "tensorflow.div...
tensorlayer/layers/core.py
[(91, 'tensorflow.python.util.deprecation.deprecated', 'deprecated', (['"""2018-06-30"""', '"""TensorLayer relies on TensorFlow to check naming."""'], {}), False, 'from tensorflow.python.util.deprecation import deprecated\n'), (96, 'tensorflow.python.util.deprecation.deprecated', 'deprecated', (['"""2018-06-30"""', '""...
antonykamp/GPflow
1831a5d19a50ff525af0ce931c8b82f6306d8196
# --- # jupyter: # jupytext: # formats: ipynb,.pct.py:percent # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.4.0 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # %% [markdown] ...
[ "matplotlib.pyplot.legend", "numpy.linspace", "matplotlib.pyplot.plot", "numpy.mean", "numpy.exp", "tensorflow.random.set_seed", "matplotlib.pyplot.tight_layout", "numpy.arange", "numpy.eye", "tensorflow.squeeze", "numpy.stack", "numpy.sin", "numpy.argmax", "numpy.zeros", "matplotlib.pyp...
doc/source/notebooks/advanced/mcmc.pct.py
[(34, 'gpflow.config.set_default_float', 'gpflow.config.set_default_float', (['np.float64'], {}), False, 'import gpflow\n'), (35, 'gpflow.config.set_default_jitter', 'gpflow.config.set_default_jitter', (['(0.0001)'], {}), False, 'import gpflow\n'), (36, 'gpflow.config.set_default_summary_fmt', 'gpflow.config.set_defaul...
jpmarques19/tensorflwo-test
0ff8b06e0415075c7269820d080284a42595bb2e
from rl_coach.agents.clipped_ppo_agent import ClippedPPOAgentParameters from rl_coach.agents.policy_gradients_agent import PolicyGradientsAgentParameters from rl_coach.graph_managers.basic_rl_graph_manager import BasicRLGraphManager from rl_coach.graph_managers.graph_manager import ScheduleParameters from rl_coach.base...
[ "tensorflow.saved_model.simple_save", "tensorflow.train.init_from_checkpoint", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "tensorflow.get_default_graph" ]
reinforcement_learning/common/sagemaker_rl/coach_launcher.py
[(23, 'rl_coach.logger.screen.set_use_colors', 'screen.set_use_colors', (['(False)'], {}), False, 'from rl_coach.logger import screen\n'), (63, 'os.environ.get', 'os.environ.get', (['"""sagemaker_job_name"""', '"""sagemaker-experiment"""'], {}), False, 'import os\n'), (64, 'rl_coach.logger.get_experiment_name', 'logger...
BeyonderXX/tensorflow-serving-java
e8cbb502c8fb1b00da9b0ea8115847931e8129f1
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
[ "tensorflow.metrics.accuracy", "tensorflow.FixedLenFeature", "tensorflow.nn.log_softmax", "tensorflow.estimator.export.build_raw_serving_input_receiver_fn", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.gfile.GFile", "tensorflow.train.init_from_checkpoint", "tensorflow.distribute.cluster_r...
python/bert_model.py
[(34, 'os.getcwd', 'os.getcwd', ([], {}), False, 'import os\n'), (47, 'os.path.join', 'os.path.join', (['current_dir', '"""./bert/chinese_L-12_H-768_A-12/"""'], {}), False, 'import os\n'), (111, 'tensorflow.flags.DEFINE_string', 'tf.flags.DEFINE_string', (['"""tpu_name"""', 'None', '"""The Cloud TPU to use for training...
a-rahman/gpt-2
afe2f087c243823885f714c53b5f910585f54878
import numpy as np # Communication to TensorFlow server via gRPC import grpc import tensorflow as tf # TensorFlow serving stuff to send messages from tensorflow_serving.apis import predict_pb2 from tensorflow_serving.apis import prediction_service_pb2_grpc from tensorflow.contrib.util import make_tensor_proto from o...
[ "tensorflow.make_ndarray", "numpy.array", "tensorflow.contrib.util.make_tensor_proto" ]
src/grpc_test.py
[(18, 'grpc.insecure_channel', 'grpc.insecure_channel', (['"""localhost:8501"""'], {}), False, 'import grpc\n'), (19, 'tensorflow_serving.apis.prediction_service_pb2_grpc.PredictionServiceStub', 'prediction_service_pb2_grpc.PredictionServiceStub', (['channel'], {}), False, 'from tensorflow_serving.apis import predictio...
YuxuanXie/ma-gym
dac30805ddcdfe3dee5f7cac520868505a9bcd5e
import gym import ma_gym import random import datetime import numpy as np import tensorflow as tf def get_variable(name, shape): return tf.get_variable(name, shape, tf.float32, tf.initializers.truncated_normal(0,0.01)) def Qmix_mixer(agent_qs, state, state_dim, n_agents, n_h_mixer): ...
[ "tensorflow.get_variable", "numpy.squeeze", "numpy.max", "numpy.random.randint", "tensorflow.get_collection", "tensorflow.layers.dense", "tensorflow.initializers.truncated_normal", "numpy.stack", "tensorflow.squeeze", "numpy.argmax", "tensorflow.Session", "tensorflow.trainable_variables", "t...
run.py
[(280, 'gym.make', 'gym.make', (['"""Switch2-v0"""'], {}), False, 'import gym\n'), (22, 'tensorflow.reshape', 'tf.reshape', (['agent_qs', '[-1, 1, n_agents]'], {}), True, 'import tensorflow as tf\n'), (28, 'tensorflow.get_variable', 'tf.get_variable', (['"""hyper_b_1"""', '[state_dim, n_h_mixer]'], {}), True, 'import t...
takesi0627/ddc
c9a9cd8a8858f6fe8842585ea7fefd523b818691
import random import tensorflow as tf import numpy as np dtype = tf.float32 np_dtype = dtype.as_numpy_dtype class OnsetNet: def __init__(self, mode, batch_size, audio_context_radius, audio_nbands, audio_nchannels, ...
[ "tensorflow.get_variable", "tensorflow.concat", "tensorflow.nn.max_pool", "tensorflow.reduce_sum", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.uniform_unit_scaling_initializer", "numpy.zeros_like", "tensorflow.summary.scalar", "numpy.where", "tensorflow.nn.conv2d", "numpy.ones...
infer/onset_net.py
[(53, 'tensorflow.placeholder', 'tf.placeholder', (['dtype'], {'shape': '[batch_size, rnn_nunroll + zack_hack, audio_context_len, audio_nbands,\n audio_nchannels]', 'name': '"""feats_audio"""'}), True, 'import tensorflow as tf\n'), (54, 'tensorflow.placeholder', 'tf.placeholder', (['dtype'], {'shape': '[batch_size, ...
LiuHao-THU/frame3d
2c3e35a6ab3226a963257c689ee177d69dead001
""" A Trainable ResNet Class is defined in this file Author: Kaihua Tang """ import math import numpy as np import tensorflow as tf from functools import reduce from configs import configs class ResNet: # some properties """ Initialize function """ def __init__(self, ResNet_npy_path=None,...
[ "tensorflow.device", "tensorflow.get_variable", "tensorflow.concat", "tensorflow.nn.max_pool", "tensorflow.nn.conv2d_transpose", "tensorflow.nn.conv2d", "tensorflow.layers.batch_normalization", "tensorflow.contrib.layers.variance_scaling_initializer", "numpy.save", "tensorflow.add", "numpy.load"...
resnet50.py
[(36, 'tensorflow.split', 'tf.split', ([], {'axis': '(3)', 'num_or_size_splits': '(3)', 'value': 'rgb'}), True, 'import tensorflow as tf\n'), (40, 'tensorflow.concat', 'tf.concat', ([], {'axis': '(3)', 'values': "[blue - configs['VGG_MEAN'][0], green - configs['VGG_MEAN'][1], red -\n configs['VGG_MEAN'][2]]"}), True...