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 |
|---|---|---|---|---|---|
hyhieu/tensor2tensor | fd9b3150ad72140c05dfad7a4ebc4577be6c1c08 | # 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.convert_to_tensor",
"tensorflow.get_variable",
"tensorflow.logging.warning",
"tensorflow.concat",
"tensorflow.python.ops.variable_scope.EagerVariableStore",
"tensorflow.zeros",
"tensorflow.reduce_sum",
"tensorflow.global_variables",
"tensorflow.equal",
"tensorflow.python.eager.context.... | tensor2tensor/utils/t2t_model.py | [(1024, 'tensor2tensor.utils.registry.parse_modality_name', 'registry.parse_modality_name', (['new_name'], {}), False, 'from tensor2tensor.utils import registry\n'), (1025, 'tensor2tensor.utils.registry.parse_modality_name', 'registry.parse_modality_name', (['old_name'], {}), False, 'from tensor2tensor.utils import reg... |
devhliu/TFDeepSurv | 1847244b68abe987c1d7cb468856c06a912727f0 | from __future__ import print_function
import numpy as np
import tensorflow as tf
from lifelines.utils import concordance_index
from supersmoother import SuperSmoother
from tfdeepsurv import vision, utils
class L2DeepSurv(object):
def __init__(self, X, label,
input_node, hidden_layers_node, output_node,
... | [
"numpy.diag",
"numpy.dot",
"tensorflow.contrib.layers.apply_regularization",
"tensorflow.contrib.layers.l1_l2_regularizer",
"tensorflow.reduce_sum",
"numpy.squeeze",
"numpy.exp",
"tensorflow.cumsum",
"tensorflow.Graph",
"tensorflow.truncated_normal_initializer",
"tensorflow.train.exponential_dec... | tfdeepsurv/L2DeepSurv.py | [(41, 'tfdeepsurv.utils.parse_data', 'utils.parse_data', (['X', 'label'], {}), False, 'from tfdeepsurv import vision, utils\n'), (43, 'tensorflow.Graph', 'tf.Graph', ([], {}), True, 'import tensorflow as tf\n'), (137, 'tensorflow.set_random_seed', 'tf.set_random_seed', (['seed'], {}), True, 'import tensorflow as tf\n')... |
zuoanqh/trfl | eee6c84bc565517c56e74828e26f7e7e401b33a0 | # Copyright 2018 The trfl 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 law... | [
"tensorflow.convert_to_tensor",
"tensorflow.reverse",
"tensorflow.transpose",
"tensorflow.reshape",
"tensorflow.assert_equal",
"tensorflow.reverse_sequence",
"tensorflow.name_scope",
"tensorflow.sequence_mask"
] | trfl/sequence_ops.py | [(39, 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['sequence_lengths'], {}), True, 'import tensorflow as tf\n'), (37, 'tensorflow.reverse', 'tf.reverse', (['sequence', '[0]'], {}), True, 'import tensorflow as tf\n'), (42, 'tensorflow.reverse_sequence', 'tf.reverse_sequence', (['sequence', 'sequence_lengths... |
ADALabUCSD/DeepPostures | f51acc8fea2aa76fe0150f87284f624840016095 | # Copyright 2021 Supun Nakandala. 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.layers.conv2d",
"tensorflow.__version__.split",
"tensorflow.concat",
"tensorflow.transpose",
"tensorflow.nn.rnn_cell.LSTMCell",
"tensorflow.reshape",
"tensorflow.layers.dense",
"tensorflow.nn.bidirectional_dynamic_rnn",
"tensorflow.variable_scope",
"numpy.array"
] | MSSE-2021/commons.py | [(68, 'tensorflow.reshape', 'tf.reshape', (['logits', '[-1, bil_lstm_win_size, 256 * amp_factor]'], {}), True, 'import tensorflow as tf\n'), (70, 'tensorflow.nn.rnn_cell.LSTMCell', 'tf.nn.rnn_cell.LSTMCell', (['(128)'], {}), True, 'import tensorflow as tf\n'), (71, 'tensorflow.nn.rnn_cell.LSTMCell', 'tf.nn.rnn_cell.LST... |
knarfamlap/tensor2tensor | 92ebc7152e0f4f42871251f17dbe6db8409d4fae | # 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.random_uniform",
"tensorflow.contrib.training.HParams",
"tensorflow.test.main",
"tensorflow.random_normal"
] | tensor2tensor/layers/common_image_attention_test.py | [(30, 'absl.testing.parameterized.parameters', 'parameterized.parameters', (['(common_image_attention.DistributionType.DMOL, 5, 50)', '(common_image_attention.DistributionType.CAT, None, 256)'], {}), False, 'from absl.testing import parameterized\n'), (50, 'absl.testing.parameterized.parameters', 'parameterized.paramet... |
chenynCV/SENet | 08b22d9961e3b2a6eb1b8cd25d33287d10eaddd5 | import tensorflow as tf
import numpy as np
import os
from tensorpack import imgaug, dataset, ModelDesc, InputDesc
from tensorpack.dataflow import (PrefetchDataZMQ, BatchData)
from dataflow_input import MyDataFlow
import resnet_model
from IPython import embed
os.environ['CUDA_VISIBLE_DEVICES']= '0'
init_lea... | [
"tensorflow.convert_to_tensor",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.control_dependencies",
"tensorflow.cast",
"tensorflow.global_variables",
"tensorflow.equal",
"tensorflow.nn.l2_loss",
"tensorflow.get_collection",
"tensorflow.summary.image",
"tensorflow.layers.dense",
... | pre_train.py | [(115, 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, image_size, image_size, img_channels]'}), True, 'import tensorflow as tf\n'), (116, 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None]'}), True, 'import tensorflow as tf\n'), (119, 'tensorflow.placeholder',... |
covernal/mask-rcnn-tensorflow | 8d5e6c8adcf1ea5208f361ec29287696ff80cc98 | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# -*- coding: utf-8 -*-
# File: box_ops.py
import tensorflow as tf
from tensorpack.tfutils.scope_utils import under_name_scope
"""
This file is modified from
https://github.com/tensorflow/models/blob/mast... | [
"tensorflow.boolean_mask",
"tensorflow.truediv",
"tensorflow.transpose",
"tensorflow.maximum",
"tensorflow.equal",
"tensorflow.squeeze",
"tensorflow.expand_dims",
"tensorflow.zeros_like",
"tensorflow.split"
] | MaskRCNN/utils/box_ops.py | [(17, 'tensorpack.tfutils.scope_utils.under_name_scope', 'under_name_scope', ([], {}), False, 'from tensorpack.tfutils.scope_utils import under_name_scope\n'), (30, 'tensorpack.tfutils.scope_utils.under_name_scope', 'under_name_scope', ([], {}), False, 'from tensorpack.tfutils.scope_utils import under_name_scope\n'), (... |
RobRomijnders/bbvi | 613c4c9ba79f0b40488fe1d18a0b7f3c023b639f | import numpy as np
import tensorflow as tf
from sklearn.datasets import load_wine
from sklearn.model_selection import train_test_split
from scipy.stats import multivariate_normal
class DataLoader:
"""
Small wrapper to abstract all code relating to loading data
"""
def __init__(self, batch_size=16):
... | [
"tensorflow.get_variable",
"tensorflow.random_uniform_initializer",
"numpy.random.choice",
"sklearn.datasets.load_wine",
"sklearn.model_selection.train_test_split",
"tensorflow.exp",
"numpy.std",
"numpy.mean",
"tensorflow.nn.softplus",
"tensorflow.random_normal"
] | bbvi/util.py | [(110, 'tensorflow.random_uniform_initializer', 'tf.random_uniform_initializer', (['rho_min_init', 'rho_max_init'], {}), True, 'import tensorflow as tf\n'), (113, 'tensorflow.get_variable', 'tf.get_variable', (["(name + '_mean')", 'shape'], {'dtype': 'dtype'}), True, 'import tensorflow as tf\n'), (116, 'tensorflow.get_... |
tongni1975/TensorFlow-Machine-Learning-Cookbook-Second-Edition | 4f57ea4ad79c8111fb29bad3da5d151858c6a050 | # Data gathering
#----------------------------------
#
# This function gives us the ways to access
# the various data sets we will need
# Data Gathering
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.python.framework import ops
ops.reset_default_graph()
# Iris Data
from sklearn import datase... | [
"matplotlib.pyplot.imshow",
"sklearn.datasets.load_iris",
"tensorflow.contrib.keras.datasets.cifar10.load_data",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.python.framework.ops.reset_default_graph"
] | Chapter01/01_Introduction/07_Working_with_Data_Sources/07_data_gathering.py | [(11, 'tensorflow.python.framework.ops.reset_default_graph', 'ops.reset_default_graph', ([], {}), False, 'from tensorflow.python.framework import ops\n'), (17, 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), False, 'from sklearn import datasets\n'), (27, 'requests.get', 'requests.get', (['birthdata_url'],... |
P2333/Reverse-Cross-Entropy | 2514af4a7fbd52423e4cac0da3ea58ac92b841c0 | from __future__ import division
from __future__ import absolute_import
import six
import cifar_input
import mnist_input
import resnet_model_cifar
import resnet_model_mnist
import t_sne
import numpy as np
import tensorflow as tf
import attacks
import sys
sys.path.append('..')
sys.path.append('./../attacks... | [
"tensorflow.reduce_sum",
"tensorflow.cast",
"numpy.concatenate",
"tensorflow.app.flags.DEFINE_string",
"numpy.mean",
"tensorflow.argmin",
"numpy.square",
"scipy.io.loadmat",
"tensorflow.app.flags.DEFINE_integer",
"numpy.save",
"tensorflow.ConfigProto",
"numpy.argmax",
"tensorflow.logging.set... | test_adv.py | [(14, 'sys.path.append', 'sys.path.append', (['""".."""'], {}), False, 'import sys\n'), (15, 'sys.path.append', 'sys.path.append', (['"""./../attacks"""'], {}), False, 'import sys\n'), (22, 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""dataset"""', '""""""', '"""cifar10 or cifar100."""'], {}... |
hongliangduan/Reproducing-the-invention-of-a-named-reaction-Zero-shot-prediction-of-unseen-chemical-reactions | 2d688bff2202e37321dedba7cdac67cd3c1e1fad | # 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.gfile.Open",
"tensorflow.gfile.Exists",
"tensorflow.gfile.GFile",
"tensorflow.Summary.Value",
"tensorflow.logging.info",
"tensorflow.contrib.slim.tfexample_decoder.Tensor",
"tensorflow.VarLenFeature"
] | data_generators/translate.py | [(88, 'tensorflow.logging.info', 'tf.logging.info', (["('%s: BLEU = %6.2f' % (decode_hparams.decode_to_file, bleu))"], {}), True, 'import tensorflow as tf\n'), (112, 'os.path.join', 'os.path.join', (['tmp_dir', 'filename'], {}), False, 'import os\n'), (57, 'tensor2tensor.data_generators.text_problems.text2text_txt_iter... |
KonduitAI/ImportTests | 1b05adac04d1b04fe4492d3fd35f3c4573774ceb | import numpy as np
import tensorflow as tf
from tfoptests.persistor import TensorFlowPersistor
from tfoptests.test_graph import TestGraph
'''
No training.
Tensor Transforms with rearranging values and some random ops
'''
class TensorRearrange(TestGraph):
def __init__(self, *args, **kwargs):
super(TensorR... | [
"tensorflow.transpose",
"tensorflow.count_nonzero",
"tensorflow.divide",
"tensorflow.div",
"tensorflow.dynamic_stitch",
"tensorflow.random_normal",
"numpy.random.uniform",
"tensorflow.trace"
] | tests/OLD/mathops/test_partition_stitch_misc.py | [(44, 'tensorflow.dynamic_stitch', 'tf.dynamic_stitch', (['[[1, 10], [[0, 7, 9], [5, 8, 3]], [[6], [4], [2]]]', '[in_node_a, in_node_b, in_node_c]'], {}), True, 'import tensorflow as tf\n'), (49, 'tensorflow.div', 'tf.div', (['list_of_parts[0]', 'list_of_parts[1]'], {}), True, 'import tensorflow as tf\n'), (50, 'tensor... |
taipahuchu/language-Identification- | 68660bc110d374f0d8802b942792b15f8782e647 | import tensorflow as tf
import numpy as np
class BaseModel(object):
"""Holds code shared between all the different model variants."""
def __init__(self, batch_size, max_sequence_len, out_vocab_size, c2v,
dropout_keep_prob=0.0):
self._batch_size = batch_size
self._dropout_keep_prob = dropou... | [
"tensorflow.get_variable",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.zeros",
"tensorflow.reduce_sum",
"tensorflow.to_int32",
"tensorflow.pack",
"tensorflow.floor",
"tensorflow.squeeze",
"tensorflow.div",
"tensorflow.tile",
"tensorflow.nn.xw_plus_b",
"tensorflow.matmul",
... | code/models.py | [(392, 'tensorflow.clip_by_value', 'tf.clip_by_value', (['probs', 'eps', '(1.0 - eps)'], {}), True, 'import tensorflow as tf\n'), (397, 'tensorflow.reduce_sum', 'tf.reduce_sum', (['xent_mat', 'sumd'], {}), True, 'import tensorflow as tf\n'), (402, 'tensorflow.clip_by_value', 'tf.clip_by_value', (['probs', 'eps', '(1.0 ... |
S4NdeeP/sat-tensorflow | cdc237b2bed24afc655af06b6e9570c557311af7 | # =========================================================================================
# Implementation of "Show, Attend and Tell: Neural Caption Generator With Visual Attention".
# There are some notations.
# N is batch size.
# L is spacial size of feature vector (196).
# D is dimension of image feature vector (5... | [
"tensorflow.get_variable",
"tensorflow.concat",
"tensorflow.reduce_sum",
"tensorflow.stack",
"tensorflow.random_uniform_initializer",
"tensorflow.squeeze",
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.to_float",
"tensorflow.argmax",
"tensorflow.nn.dropout",
"tensorflow.matmul",
... | core/model.py | [(51, 'tensorflow.contrib.layers.xavier_initializer', 'tf.contrib.layers.xavier_initializer', ([], {}), True, 'import tensorflow as tf\n'), (52, 'tensorflow.constant_initializer', 'tf.constant_initializer', (['(0.0)'], {}), True, 'import tensorflow as tf\n'), (53, 'tensorflow.random_uniform_initializer', 'tf.random_uni... |
whigy/chair-gan | 8144b34919a7c61487edc559738801b341a70331 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import tensorflow as tf
import numpy as np
import tfimage as im
import threading
import time
import cv2
from skimage.morphology import thin
edge_pool = None
parser = argparse.Argum... | [
"tensorflow.local_variables_initializer",
"tensorflow.io.gfile.exists",
"numpy.asarray",
"tensorflow.train.start_queue_runners",
"tensorflow.train.Coordinator",
"tensorflow.io.gfile.makedirs",
"numpy.ones",
"numpy.concatenate",
"numpy.float32",
"tensorflow.Session"
] | tools/process.py | [(19, 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), False, 'import argparse\n'), (202, 'threading.Lock', 'threading.Lock', ([], {}), False, 'import threading\n'), (72, 'numpy.ones', 'np.ones', (['[size, size, 3]'], {}), True, 'import numpy as np\n'), (109, 'numpy.concatenate', 'np.concatenate', (['[sr... |
shfshf/ner_s2s | a04311310bddf396b551969fd1e63fdb3fc2ca0b | from pathlib import Path
import tensorflow as tf
import numpy as np
from ner_s2s.metrics import precision, recall, f1, correct_rate
class Model(object):
@classmethod
def default_params(cls):
return {}
@classmethod
def get_model_name(cls):
return cls.__name__
@classmethod
def... | [
"tensorflow.get_variable",
"tensorflow.contrib.lookup.index_table_from_tensor",
"tensorflow.metrics.accuracy",
"tensorflow.layers.dropout",
"numpy.vstack",
"tensorflow.train.AdamOptimizer",
"tensorflow.contrib.crf.crf_decode",
"tensorflow.contrib.crf.crf_log_likelihood",
"tensorflow.summary.scalar",... | ner_s2s/ner_estimator/algorithms/model.py | [(31, 'tensorflow.Variable', 'tf.Variable', (['data'], {}), True, 'import tensorflow as tf\n'), (32, 'tensorflow.contrib.lookup.index_table_from_tensor', 'tf.contrib.lookup.index_table_from_tensor', (['mapping_strings'], {'num_oov_buckets': '(1)'}), True, 'import tensorflow as tf\n'), (37, 'tensorflow.identity', 'tf.id... |
CrazyAlan/nextAI | e871b4078e9d591121f9093f2ba022e1c9115f7b | """Functions for building the face recognition network.
"""
# MIT License
#
# Copyright (c) 2016 David Sandberg
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includ... | [
"tensorflow.convert_to_tensor",
"tensorflow.control_dependencies",
"tensorflow.nn.max_pool",
"tensorflow.train.ExponentialMovingAverage",
"tensorflow.nn.l2_loss",
"tensorflow.nn.conv2d",
"tensorflow.nn.moments",
"tensorflow.truncated_normal_initializer",
"tensorflow.name_scope",
"tensorflow.square... | src/models/network.py | [(72, 'tensorflow.maximum', 'tf.maximum', (['net_1', 'net_2'], {}), True, 'import tensorflow as tf\n'), (36, 'tensorflow.variable_scope', 'tf.variable_scope', (['name'], {}), True, 'import tensorflow as tf\n'), (41, 'tensorflow.nn.conv2d', 'tf.nn.conv2d', (['inpOp', 'kernel', '[1, dH, dW, 1]'], {'padding': 'padType'}),... |
criteo-dexter/deepr | 4de9cb8afc09cb3d2f7c42da248a966bfea5fc83 | # pylint: disable=no-value-for-parameter,unexpected-keyword-arg
"""LSTM layers."""
import tensorflow as tf
from deepr.layers import base
@base.layer(n_in=2, n_out=3)
def LSTM(tensors, num_units: int, bidirectional: bool = False, **kwargs):
"""LSTM layer."""
words, nwords = tensors
t = tf.transpose(words... | [
"tensorflow.concat",
"tensorflow.contrib.rnn.TimeReversedFusedRNN",
"tensorflow.contrib.rnn.LSTMBlockFusedCell",
"tensorflow.transpose"
] | deepr/layers/lstm.py | [(9, 'deepr.layers.base.layer', 'base.layer', ([], {'n_in': '(2)', 'n_out': '(3)'}), False, 'from deepr.layers import base\n'), (13, 'tensorflow.transpose', 'tf.transpose', (['words'], {'perm': '[1, 0, 2]'}), True, 'import tensorflow as tf\n'), (14, 'tensorflow.contrib.rnn.LSTMBlockFusedCell', 'tf.contrib.rnn.LSTMBlock... |
flyliu2017/bert | cc6e676ff8693a6cc31ade9d7a6cbb0789d7877c | # 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.contrib.cluster_resolver.TPUClusterResolver",
"tensorflow.train.LoggingTensorHook",
"tensorflow.metrics.accuracy",
"tensorflow.FixedLenFeature",
"tensorflow.gfile.Exists",
"tensorflow.reduce_sum",
"tensorflow.gfile.GFile",
"tensorflow.cast",
"tensorflow.train.init_from_checkpoint",
"te... | run_token_level_classifier_multigpus.py | [(109, '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'), (115, 'tensorflow.flags.DEFINE_str... |
rohitgirdhar/ActionVLAD | 08d3d65301940991e0a0cdca2c0534edf6749f41 | # ------------------------------------------------------------------------------
# ActionVLAD: Learning spatio-temporal aggregation for action classification
# Copyright (c) 2017 Carnegie Mellon University and Adobe Systems Incorporated
# Please see LICENSE on https://github.com/rohitgirdhar/ActionVLAD/ for details
# -... | [
"tensorflow.convert_to_tensor",
"tensorflow.image.resize_bilinear",
"tensorflow.image.random_flip_left_right",
"tensorflow.shape",
"tensorflow.slice",
"tensorflow.greater",
"tensorflow.reshape",
"tensorflow.equal",
"tensorflow.expand_dims",
"tensorflow.squeeze",
"tensorflow.pack",
"tensorflow.... | preprocessing/vgg_preprocessing.py | [(75, 'tensorflow.shape', 'tf.shape', (['image'], {}), True, 'import tensorflow as tf\n'), (97, 'tensorflow.reshape', 'tf.reshape', (['image', 'cropped_shape'], {}), True, 'import tensorflow as tf\n'), (175, 'tensorflow.random_uniform', 'tf.random_uniform', (['[]'], {'maxval': 'max_offset_height', 'dtype': 'tf.int32'})... |
Rahul-chunduru/meanfield-theory-of-activation-functions | 97abc52b25d7a57dc75ce21dcccc419f58a393d4 | """
Helper functions for FFN with ESP
=================================================================
Author: Mirco Milletari <mirco@bambu.life> (2018)
Tensorflow implementation of a Feed Forward Deep network with ESP
activation, as defined in
"Expectation propagation: a probabilistic view of Deep Feed Forward Netw... | [
"tensorflow.concat",
"numpy.squeeze",
"tensorflow.equal",
"tensorflow.cast",
"tensorflow.train.AdamOptimizer",
"tensorflow.Variable",
"tensorflow.greater",
"numpy.unique",
"tensorflow.gradients",
"tensorflow.train.exponential_decay",
"tensorflow.subtract",
"tensorflow.contrib.layers.xavier_ini... | TF/esp_tf_utils.py | [(61, 'tensorflow.constant', 'tf.constant', (['N_classes'], {'name': '"""C"""'}), True, 'import tensorflow as tf\n'), (62, 'tensorflow.one_hot', 'tf.one_hot', (['(vect - 1)', 'C'], {'axis': '(0)'}), True, 'import tensorflow as tf\n'), (68, 'tensorflow.Session', 'tf.Session', ([], {}), True, 'import tensorflow as tf\n')... |
mehrdad-shokri/tensornets | e36eff73e5fc984977c5ceadefc1adb089e7bab5 | # 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.python.ops.math_ops.log",
"tensorflow.python.training.training.assert_global_step",
"tensorflow.python.summary.summary.scalar",
"tensorflow.python.ops.math_ops.exp",
"tensorflow.python.summary.summary.histogram",
"tensorflow.python.ops.variables.trainable_variables",
"tensorflow.python.ops.i... | tensornets/contrib_layers/optimizers.py | [(154, 'tensorflow.python.framework.ops.convert_to_tensor', 'ops.convert_to_tensor', (['loss'], {}), False, 'from tensorflow.python.framework import ops\n'), (306, 'tensorflow.python.ops.clip_ops.clip_by_global_norm', 'clip_ops.clip_by_global_norm', (['gradients', 'clip_gradients'], {}), False, 'from tensorflow.python.... |
Archer-pro666/BAAF-Net | 663d1681d4d05ad3caaacd98e6dedfdc9caa4930 | """ Wrapper functions for TensorFlow layers.
Author: Charles R. Qi
Date: November 2016
"""
import numpy as np
import tensorflow as tf
def _variable_on_cpu(name, shape, initializer, use_fp16=False):
"""Helper to create a Variable stored on CPU memory.
Args:
name: name of the variable
shape: list ... | [
"tensorflow.device",
"tensorflow.get_variable",
"numpy.sqrt",
"tensorflow.control_dependencies",
"tensorflow.nn.max_pool",
"tensorflow.stack",
"tensorflow.nn.conv2d_transpose",
"tensorflow.train.ExponentialMovingAverage",
"tensorflow.nn.l2_loss",
"tensorflow.nn.conv1d",
"tensorflow.nn.conv2d",
... | helper_tf_util.py | [(20, 'tensorflow.device', 'tf.device', (['"""/cpu:0"""'], {}), True, 'import tensorflow as tf\n'), (22, 'tensorflow.get_variable', 'tf.get_variable', (['name', 'shape'], {'initializer': 'initializer', 'dtype': 'dtype'}), True, 'import tensorflow as tf\n'), (44, 'tensorflow.contrib.layers.xavier_initializer', 'tf.contr... |
renatoviolin/GAN-image-inpainting | 6ba7ccd4ae55b185ee89844e846d4c469f4fa65f | import cv2
import numpy as np
import tensorflow as tf
import neuralgym as ng
from .inpaint_model import InpaintCAModel
checkpoint_dir = 'generative_inpainting/models'
FLAGS = ng.Config('generative_inpainting/inpaint.yml')
def run_fill(file_test, file_mask):
model = InpaintCAModel()
image = cv2.imread(file_... | [
"tensorflow.reverse",
"numpy.expand_dims",
"tensorflow.constant",
"tensorflow.get_collection",
"tensorflow.assign",
"numpy.concatenate",
"tensorflow.ConfigProto",
"tensorflow.reset_default_graph",
"tensorflow.contrib.framework.load_variable",
"tensorflow.Session",
"tensorflow.saturate_cast"
] | generative_inpainting/predict.py | [(10, 'neuralgym.Config', 'ng.Config', (['"""generative_inpainting/inpaint.yml"""'], {}), True, 'import neuralgym as ng\n'), (15, 'cv2.imread', 'cv2.imread', (['file_test'], {}), False, 'import cv2\n'), (16, 'cv2.imread', 'cv2.imread', (['file_mask'], {}), False, 'import cv2\n'), (23, 'numpy.expand_dims', 'np.expand_di... |
sachinpro/sachinpro.github.io | c3bbd8d89818f5d8bb7296c851ed5e52c19728e3 | # pylint: disable=g-bad-file-header
# 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/LICENS... | [
"tensorflow.python.ops.nn.softmax",
"tensorflow.contrib.metrics.streaming_auc",
"tensorflow.python.ops.state_ops.assign_add",
"tensorflow.python.ops.logging_ops.scalar_summary",
"tensorflow.python.ops.logging_ops.histogram_summary",
"tensorflow.python.ops.nn.zero_fraction",
"tensorflow.python.ops.math_o... | tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py | [(144, 'tensorflow.contrib.framework.python.ops.variables.get_global_step', 'variables.get_global_step', ([], {}), True, 'from tensorflow.contrib.framework.python.ops import variables as variables\n'), (148, 'tensorflow.python.ops.logging_ops.scalar_summary', 'logging_ops.scalar_summary', (['"""loss"""', 'loss'], {}), ... |
lucidrains/compare_gan | 2a685ab94129c398620da67d999487fa63b7f741 | # coding=utf-8
# Copyright 2018 Google LLC & Hwalsuk Lee.
#
# 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_variable",
"tensorflow.image.random_contrast",
"tensorflow.concat",
"tensorflow.image.random_saturation",
"tensorflow.image.random_hue",
"numpy.arange",
"tensorflow.stop_gradient",
"tensorflow.image.rgb_to_grayscale",
"tensorflow.tile",
"tensorflow.matmul",
"tensorflow.image.rand... | compare_gan/gans/clgan.py | [(68, 'gin.configurable', 'gin.configurable', ([], {'blacklist': "['kwargs']"}), False, 'import gin\n'), (44, 'tensorflow.random_crop', 'tf.random_crop', (['images'], {'size': '[b, ch, cw, 3]'}), True, 'import tensorflow as tf\n'), (45, 'tensorflow.image.resize', 'tf.image.resize', (['crop', '[h, w]'], {}), True, 'impo... |
ffmpbgrnn/google-research | eb924d158768e0ca91fd382f02818d1440fb5e75 | # 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.initializers.zeros",
"tensorflow.control_dependencies",
"tensorflow.reduce_sum",
"tensorflow.cast",
"tensorflow.nn.l2_loss",
"tensorflow.train.AdamOptimizer",
"tensorflow.add_n",
"tensorflow.get_collection",
"tensorflow.train.get_global_step",
"tensorflow.stop_gradient",
"tensorflow.... | l2tl/train_l2tl.py | [(35, 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""model_dir"""', 'None'], {'help': '"""The directory where the model and training/evaluation summaries are stored."""'}), False, 'from absl import flags\n'), (40, 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""log_step_count_steps"""', '(64)', '""... |
AathmanT/cv-tricks.com | 7367c42d3e2d398b31ebf1b058bdbb5dc2a56253 | import math
import numpy as np
import tensorflow as tf
from enum import Enum, unique
@unique
class InputType(Enum):
TENSOR = 1
BASE64_JPEG = 2
class OpenNsfwModel:
"""Tensorflow implementation of Yahoo's Open NSFW Model
Original implementation:
https://github.com/yahoo/open_nsfw
Weights ha... | [
"tensorflow.nn.relu",
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.nn.softmax",
"tensorflow.reshape",
"tensorflow.placeholder",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.add",
"tensorflow.pad",
"numpy.load"
] | Tensorflow-tutorials/Not-Safe-For-Work-Detection/model.py | [(48, 'tensorflow.pad', 'tf.pad', (['x', '[[0, 0], [3, 3], [3, 3], [0, 0]]', '"""CONSTANT"""'], {}), True, 'import tensorflow as tf\n'), (54, 'tensorflow.nn.relu', 'tf.nn.relu', (['x'], {}), True, 'import tensorflow as tf\n'), (104, 'tensorflow.reshape', 'tf.reshape', (['x'], {'shape': '(-1, 1024)'}), True, 'import ten... |
augustoolucas/iCaRL | 90ac1be39c9e055d9dd2fa1b679c0cfb8cf7335a | import tensorflow as tf
import numpy as np
try:
import cPickle
except:
import _pickle as cPickle
def relu(x, name, alpha):
if alpha > 0:
return tf.maximum(alpha * x, x, name=name)
else:
return tf.nn.relu(x, name=name)
def get_variable(name, shape, dtype, initializer, trainable=True, ... | [
"tensorflow.device",
"tensorflow.get_variable",
"tensorflow.control_dependencies",
"tensorflow.nn.max_pool",
"tensorflow.reduce_sum",
"tensorflow.nn.atrous_conv2d",
"tensorflow.nn.conv2d",
"tensorflow.get_collection",
"tensorflow.nn.moments",
"tensorflow.nn.batch_normalization",
"tensorflow.zero... | iCaRL-Tensorflow/utils_resnet.py | [(26, 'tensorflow.contrib.layers.xavier_initializer_conv2d', 'tf.contrib.layers.xavier_initializer_conv2d', ([], {}), True, 'import tensorflow as tf\n'), (53, 'tensorflow.reduce_max', 'tf.reduce_max', (['target', 'axis'], {'keep_dims': '(True)'}), True, 'import tensorflow as tf\n'), (54, 'tensorflow.exp', 'tf.exp', (['... |
soulsheng/lanenet-lane-detection | f7bc580a73e686a77a5506dbfc57ed424f0715b5 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 17-9-18 下午3:59
# @Author : MaybeShewill-CV
# @Site : https://github.com/MaybeShewill-CV/lanenet-lane-detection
# @File : cnn_basenet.py
# @IDE: PyCharm Community Edition
"""
The base convolution neural networks mainly implement some useful cnn functions
... | [
"tensorflow.cond",
"tensorflow.get_variable",
"tensorflow.concat",
"tensorflow.zeros",
"tensorflow.nn.max_pool",
"tensorflow.layers.conv2d_transpose",
"tensorflow.nn.depthwise_conv2d",
"tensorflow.nn.atrous_conv2d",
"tensorflow.nn.conv2d",
"tensorflow.layers.batch_normalization",
"tensorflow.con... | semantic_segmentation_zoo/cnn_basenet.py | [(133, 'tensorflow.nn.relu', 'tf.nn.relu', ([], {'features': 'inputdata', 'name': 'name'}), True, 'import tensorflow as tf\n'), (143, 'tensorflow.nn.sigmoid', 'tf.nn.sigmoid', ([], {'x': 'inputdata', 'name': 'name'}), True, 'import tensorflow as tf\n'), (177, 'tensorflow.nn.max_pool', 'tf.nn.max_pool', ([], {'value': '... |
luozhouyang/smile_datasets | c614314b2e2d83896b252670c6e3d8bd158f055b | import logging
import tensorflow as tf
from . import utils
from .dataset import TFDataset
class TFDatasetForTokenClassification(TFDataset):
"""Dataset for token classification in TensorFlow"""
def __init__(self, examples=None, **kwargs) -> None:
super().__init__(examples, **kwargs)
self.inp... | [
"tensorflow.sparse.to_dense",
"tensorflow.constant",
"tensorflow.ragged.constant",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.io.VarLenFeature",
"tensorflow.io.parse_example",
"tensorflow.size"
] | rapidnlp_datasets/tf/token_classification_dataset.py | [(95, 'tensorflow.constant', 'tf.constant', (['max_sequence_length'], {'dtype': 'tf.int32'}), True, 'import tensorflow as tf\n'), (96, 'tensorflow.constant', 'tf.constant', (['pad_id'], {'dtype': 'tf.int32'}), True, 'import tensorflow as tf\n'), (105, 'tensorflow.constant', 'tf.constant', (['pad_id'], {'dtype': 'tf.int... |
lianyfei/bert-utils | 5de95a459146482a27deae36464e95a24dfe2bcf | # 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.contrib.cluster_resolver.TPUClusterResolver",
"tensorflow.metrics.accuracy",
"tensorflow.FixedLenFeature",
"tensorflow.nn.log_softmax",
"tensorflow.estimator.export.build_raw_serving_input_receiver_fn",
"tensorflow.reduce_sum",
"tensorflow.gfile.GFile",
"tensorflow.train.init_from_checkpoi... | run_classifier_exporter.py | [(110, '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'), (116, 'tensorflow.flags.DEFINE_str... |
sanket-kamthe/gptf | 7db86b8a608f9ca45548c4e2c9fcb5f48daf9187 | # -*- encoding: utf-8 -*-
"""Provides base classes for models of all kinds."""
from builtins import super, range
from future.utils import with_metaclass
from abc import ABCMeta, abstractmethod
import numpy as np
import tensorflow as tf
from tensorflow.contrib.opt import ScipyOptimizerInterface
from scipy.optimize impo... | [
"tensorflow.batch_matmul",
"tensorflow.transpose",
"tensorflow.contrib.opt.ScipyOptimizerInterface",
"tensorflow.as_dtype",
"tensorflow.shape",
"tensorflow.reshape",
"tensorflow.random_normal"
] | gptf/core/models.py | [(16, 'future.utils.with_metaclass', 'with_metaclass', (['ABCMeta', 'Parameterized'], {}), False, 'from future.utils import with_metaclass\n'), (515, 'tensorflow.random_normal', 'tf.random_normal', (['V_shape'], {'dtype': 'L.dtype'}), True, 'import tensorflow as tf\n'), (517, 'tensorflow.transpose', 'tf.transpose', (['... |
p328188467/edenas | 82fc62528cb25a228d011f2e30f984969d012882 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import time
import numpy as np
import tensorflow as tf
from src.controller import Controller
from src.utils import get_train_ops
from src.common_ops import stack_lstm
from tensorflow.pyt... | [
"tensorflow.get_variable",
"tensorflow.control_dependencies",
"tensorflow.zeros",
"tensorflow.reduce_sum",
"tensorflow.tanh",
"tensorflow.to_int32",
"tensorflow.while_loop",
"tensorflow.Variable",
"tensorflow.random_uniform_initializer",
"numpy.reshape",
"tensorflow.to_float",
"tensorflow.trai... | src/fashion_minst/micro_controller.py | [(86, 'tensorflow.random_uniform_initializer', 'tf.random_uniform_initializer', ([], {'minval': '(-0.1)', 'maxval': '(0.1)'}), True, 'import tensorflow as tf\n'), (122, 'tensorflow.TensorArray', 'tf.TensorArray', (['tf.float32'], {'size': '(self.num_cells + 2)', 'clear_after_read': '(False)'}), True, 'import tensorflow... |
yselivonchyk/DCIGN_tensorflow | ff8d85f3a7b7ca1e5c3f50ff003a1c09a70067cd | """MNIST Autoencoder. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
# os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import numpy as np
import tensorflow as tf
import utils as ut
import input as inp
import visualization as vis
import matplotlib.py... | [
"numpy.expand_dims",
"tensorflow.concat",
"numpy.asarray",
"tensorflow.reduce_sum",
"tensorflow.cast",
"tensorflow.variables_initializer",
"numpy.nan_to_num",
"tensorflow.app.flags.DEFINE_string",
"numpy.random.randn",
"tensorflow.app.flags.DEFINE_boolean",
"tensorflow.add_n",
"tensorflow.summ... | autoencoder.py | [(25, 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""input_path"""', '"""../data/tmp/grid03.14.c.tar.gz"""', '"""input folder"""'], {}), True, 'import tensorflow as tf\n'), (26, 'tensorflow.app.flags.DEFINE_string', 'tf.app.flags.DEFINE_string', (['"""input_name"""', '""""""', '"""input folde... |
ethanm88/lingvo | 46314590ca80a557b6b95c8acdf5956f9e045eb7 | # 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.is_nan",
"tensorflow.get_variable",
"tensorflow.constant",
"numpy.random.seed",
"tensorflow.is_finite",
"tensorflow.ones_like",
"tensorflow.test.main",
"tensorflow.global_variables_initializer",
"tensorflow.no_op",
"tensorflow.log",
"tensorflow.variable_scope"
] | lingvo/core/base_model_test.py | [(390, 'tensorflow.test.main', 'tf.test.main', ([], {}), True, 'import tensorflow as tf\n'), (61, 'lingvo.core.base_model.BaseTask.Params', 'base_model.BaseTask.Params', ([], {}), False, 'from lingvo.core import base_model\n'), (63, 'lingvo.core.base_encoder.BaseEncoder.Params', 'base_encoder.BaseEncoder.Params', ([], ... |
Taosheng-ty/ULTRA | 2541982cb21e0acccbe66cd4437194e40e0828ef | """Training and testing the dual learning algorithm for unbiased learning to rank.
See the following paper for more information on the dual learning algorithm.
* Qingyao Ai, Keping Bi, Cheng Luo, Jiafeng Guo, W. Bruce Croft. 2018. Unbiased Learning to Rank with Unbiased Propensity Estimation. In Proceedings o... | [
"tensorflow.convert_to_tensor",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.get_variable",
"tensorflow.concat",
"tensorflow.math.sign",
"tensorflow.stack",
"tensorflow.reduce_sum",
"tensorflow.global_variables",
"tensorflow.cast",
"tensorflow.nn.l2_loss",
"tensorflow.losses.lo... | ultra/learning_algorithm/dla_attention.py | [(53, 'tensorflow.contrib.training.HParams', 'tf.contrib.training.HParams', ([], {'learning_rate': '(0.05)', 'max_gradient_norm': '(5.0)', 'loss_func': '"""click_weighted_softmax_cross_entropy"""', 'logits_to_prob': '"""softmax"""', 'ranker_learning_rate': '(-1.0)', 'ranker_loss_weight': '(1.0)', 'l2_loss': '(0.0)', 'l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.