repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
alvinlin-pn/tensorflow | [
"c9cd1784bf287543d89593ca1432170cdbf694de",
"c9cd1784bf287543d89593ca1432170cdbf694de",
"c9cd1784bf287543d89593ca1432170cdbf694de"
] | [
"tensorflow/python/keras/layers/preprocessing/text_vectorization_test.py",
"tensorflow/python/keras/layers/pooling_test.py",
"tensorflow/python/data/ops/multi_device_iterator_ops.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.keras.keras_parameterized.run_all_keras_modes",
"tensorflow.python.keras.Input",
"tensorflow.python.keras.Model",
"tensorflow.python.ops.gen_string_ops.string_lower",
"tensorflow.python.keras.utils.generic_utils.register_keras_serializable",
"tensorflow.python.keras.laye... |
christianbrodbeck/Eelbrain | [
"0c24abcc382abb590c062b8bc683f749265f564f",
"0c24abcc382abb590c062b8bc683f749265f564f"
] | [
"eelbrain/plot/_plot_utils.py",
"eelbrain/plot/_base.py"
] | [
"# Utilities working with (and needing to import) plots\nimport os\n\nimport numpy as np\n\nfrom .._utils import ui\nfrom ._base import TimeSlicer\n\n\ndef save_movie(figures, filename=None, time_dilation=4, tstart=None, tstop=None, size=None, **kwargs):\n \"\"\"Save a movie combining multiple figures with movi... | [
[
"numpy.arange",
"numpy.array"
],
[
"numpy.nanmax",
"matplotlib.rcParams.copy",
"numpy.ma.isMaskedArray",
"numpy.linspace",
"numpy.isnan",
"numpy.nanmin",
"matplotlib.pyplot.subplots",
"matplotlib.figure.SubplotParams",
"matplotlib.get_backend",
"numpy.log10",
... |
tongpinmo/R2CNN-Solarpannel | [
"b99754d587bd75c47c53a31e1db2060356a28c51"
] | [
"data/io/Solarpanel/val_crop.py"
] | [
"import os\nimport scipy.misc as misc\nfrom xml.dom.minidom import Document\nimport numpy as np\nimport copy, cv2\n\ndef save_to_xml(save_path, im_width, im_height, objects_axis, label_name):\n im_depth = 0\n object_num = len(objects_axis)\n doc = Document()\n\n annotation = doc.createElement('annotatio... | [
[
"numpy.intersect1d",
"numpy.array",
"numpy.zeros_like",
"numpy.where"
]
] |
mdda/Theano | [
"598d487c118e66875fdd625baa84ed29d283b800",
"598d487c118e66875fdd625baa84ed29d283b800",
"598d487c118e66875fdd625baa84ed29d283b800",
"598d487c118e66875fdd625baa84ed29d283b800",
"6ca7b2b65000e371f009b617d41bc5a90f022d38",
"6ca7b2b65000e371f009b617d41bc5a90f022d38",
"6ca7b2b65000e371f009b617d41bc5a90f022d3... | [
"theano/compile/tests/test_nanguardmode.py",
"doc/hpcs2011_tutorial/pycuda_simple.py",
"theano/sparse/sandbox/sp.py",
"theano/tests/main.py",
"theano/scan_module/scan.py",
"theano/sandbox/gpuarray/tests/test_blas.py",
"theano/d3viz/tests/test_formatting.py"
] | [
"\"\"\"\nThis test is for testing the NanGuardMode.\n\"\"\"\nimport logging\nfrom nose.tools import assert_raises\n\nimport numpy\n\nfrom theano.compile.nanguardmode import NanGuardMode\nimport theano\nimport theano.tensor as T\n\n\ndef test_NanGuardMode():\n \"\"\"\n Tests if NanGuardMode is working by feedi... | [
[
"numpy.asarray",
"numpy.random.randn"
],
[
"numpy.random.randn",
"numpy.zeros_like",
"numpy.allclose"
],
[
"numpy.asarray",
"numpy.hstack",
"numpy.size",
"scipy.sparse.lil_matrix"
],
[
"numpy.testing.noseclasses.KnownFailure",
"numpy.testing.noseclasses.Nump... |
Mokuichi147/ML-VRPose | [
"900bd12adbef64c8553b63e193d49703b54a134b"
] | [
"src/main.py"
] | [
"import cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom utils.camera import WebCam\nfrom utils.ovr import VRTracker\nfrom utils.pose import HumanPose\n\n\nCAMERA_DEVICE = 0\nMAX_POINTS = 100 * 2\n\n# 3D graph\nfig = plt.figure()\nax = Axes3D(fig)\nax.view_init... | [
[
"numpy.matrix",
"numpy.array",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.figure"
]
] |
metabolize/trimesh | [
"3c9a76c9c7714ffb0eb6e68152e6a189469a4005"
] | [
"trimesh/convex.py"
] | [
"\"\"\"\nconvex.py\n\nDeal with creating and checking convex objects in 2, 3 and N dimensions.\n\nConvex is defined as:\n1) \"Convex, meaning \"curving out\" or \"extending outward\" (compare to concave)\n2) having an outline or surface curved like the exterior of a circle or sphere.\n3) (of a polygon) having only ... | [
[
"numpy.fliplr",
"numpy.asarray",
"numpy.sort",
"numpy.asanyarray",
"numpy.average"
]
] |
svitlanavyetrenko/abides | [
"11ae144f4c81de0baaa031ca2c4afb6dc9519e4d"
] | [
"util/OrderBook.py"
] | [
"# Basic class for an order book for one symbol, in the style of the major US Stock Exchanges.\n# List of bid prices (index zero is best bid), each with a list of LimitOrders.\n# List of ask prices (index zero is best ask), each with a list of LimitOrders.\nimport sys\n\nfrom message.Message import Message\nfrom ut... | [
[
"pandas.to_timedelta",
"pandas.io.json.json_normalize",
"pandas.concat"
]
] |
AutoLV/GANmut | [
"a98d00dbe63d18ba2c55b948158bfe0c81e2189e"
] | [
"solver.py"
] | [
"import os\nimport time\nimport datetime\nimport sys\n\nfrom torchvision.utils import save_image\nimport torch\nimport torch.nn.functional as F\nimport numpy as np\n\nimport models.model_linear_2d\nimport models.model_gaussian_2d\nimport models.model_linear_3d\nimport models.model_gaussian_3d\n\n\nclass Solver(obje... | [
[
"torch.nn.Softmax",
"torch.mean",
"torch.nn.KLDivLoss",
"torch.nn.LogSoftmax",
"torch.abs",
"torch.nn.functional.softmax",
"torch.zeros",
"torch.load",
"numpy.arange",
"torch.cat",
"torch.nn.functional.cross_entropy",
"torch.sum",
"torch.nn.functional.mse_loss",... |
tobiasw225/python-pso | [
"38cfb7775b296cdf3cdca0caf760737155e150f1"
] | [
"pso/particle.py"
] | [
"import sys\nimport numpy as np\n\n\nclass Particle:\n\n __slots__ = ['x', 'v', 'dims', 'best_point', 'best_solution']\n\n def __init__(self, n: int, dims: int):\n \"\"\"\n\n ensure particle starts with random velocity\n at random position.\n\n :param n:\n :param dims:\n ... | [
[
"numpy.random.ranf",
"numpy.random.random",
"numpy.zeros"
]
] |
dseuss/kinkycrystals | [
"4d314ea52802c637acd243f5e986434b97a38e91",
"4d314ea52802c637acd243f5e986434b97a38e91"
] | [
"kcrecog/imgproc.py",
"kcrecog/atrous.py"
] | [
"#!/usr/bin/env python\n# encoding: utf-8\n\"\"\"Routines for extracting data from the images.\"\"\"\nfrom __future__ import division, print_function\n\nimport cv2 as cv\nimport numpy as np\nfrom itertools import izip\nfrom skimage.measure import label, regionprops\n\nimport conf\nimport dataio as io\n\ntry:\n f... | [
[
"numpy.max",
"numpy.array",
"numpy.floor",
"numpy.ceil"
],
[
"matplotlib.pyplot.tight_layout",
"numpy.asarray",
"numpy.median",
"numpy.prod",
"scipy.ndimage.filters.convolve",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
bsmind/dpc | [
"e07fef88ee5899aa340b415104048456d1811ac4"
] | [
"core/HXN_databroker.py"
] | [
"#from hxntools.handlers import register\n#import filestore\nfrom metadatastore.mds import MDS\nfrom databroker import Broker\nfrom filestore.fs import FileStore\n\n# database #1\n_mds_config = {'host': 'xf03id-ca1',\n 'port': 27017,\n 'database': 'datastore-new',\n 'timezo... | [
[
"numpy.rot90",
"numpy.sqrt",
"numpy.fft.fftshift",
"numpy.sin",
"numpy.asfarray",
"numpy.shape",
"numpy.array",
"numpy.zeros"
]
] |
lukasHoel/AdversarialTexture | [
"d56e4817e725f45c911f66574f4f164f4e7b371f"
] | [
"src/preprocessing/CudaRender/example.py"
] | [
"import numpy as np\nimport sys\nimport skimage.io as sio\nimport os\n#from gen_poses import GetPoses,WavePose\nimport shutil\nfrom objloader import LoadTextureOBJ\nimport render\nimport objloader\n\n\ninput_obj = sys.argv[1]\nV, F, VT, FT, VN, FN, face_mat, kdmap = objloader.LoadTextureOBJ(input_obj)\n\n# set up c... | [
[
"numpy.linalg.inv",
"numpy.max",
"numpy.array"
]
] |
davidby332/shap | [
"e6e5e0287a5f0503d0c6127d29c10ea2d8dbfafa"
] | [
"shap/plots/_scatter.py"
] | [
"from __future__ import division\n\nimport numpy as np\nimport warnings\ntry:\n import matplotlib.pyplot as pl\n import matplotlib\nexcept ImportError:\n warnings.warn(\"matplotlib could not be loaded!\")\n pass\nfrom ._labels import labels\nfrom . import colors\nfrom ..utils import convert_name, approx... | [
[
"numpy.nanmax",
"matplotlib.pyplot.legend",
"matplotlib.colors.BoundaryNorm",
"numpy.nanmin",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.hstack",
"numpy.unique",
"numpy.arange",
"numpy.diff",
"matplotlib.pyplot.figure",
"numpy.invert",
"numpy.min",
"numpy... |
ngthianhphuong/disaster-response | [
"7585dae9187edf3b364fdb16570f52516ac56bc4"
] | [
"data/process_data.py"
] | [
"import sys\nimport pandas as pd \nfrom sqlalchemy import create_engine\n\ndef load_data(messages_filepath, categories_filepath):\n '''Function to load and merge data from 2 input datasets that contain messages and categories.\n Args:\n messages_filepath: path to dataset that contains messages\n ... | [
[
"pandas.merge",
"pandas.read_csv",
"pandas.to_numeric",
"pandas.concat"
]
] |
cizhenshi/mmdetection | [
"b0fe89677020ebe9e6a736b98d3e791ca0e6536d"
] | [
"mmdet/models/losses/cross_entropy_loss.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom ..registry import LOSSES\nfrom .utils import weight_reduce_loss\nfrom icecream import ic\n\ndef cross_entropy(pred, label, weight=None, reduction='mean', avg_factor=None):\n # element-wise losses\n loss = F.cross_entropy(pred, label... | [
[
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.nn.functional.cross_entropy",
"torch.nonzero",
"torch.arange"
]
] |
keiv-fly/wot_ai | [
"8f073968ae7c4eb88351ebf99fb2428a9862ab75"
] | [
"find_service/gray_conv_cy/setup.py"
] | [
"from distutils.core import setup\nfrom distutils.extension import Extension\nfrom Cython.Build import cythonize\nimport numpy as np\n\next_modules=[\n Extension(\"gray_conv_cy\",\n sources=[\"gray_conv_cy.pyx\"],\n include_dirs=[np.get_include()]\n )\n]\n\nsetup(\n name = \"find_... | [
[
"numpy.get_include"
]
] |
rohitsroch/recurrent_bert | [
"9b47acd081433280fd68849a07ca3ca9b924a1f6"
] | [
"estimator/modeling_test.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | [
[
"tensorflow.compat.v1.local_variables_initializer",
"tensorflow.constant",
"tensorflow.test.main",
"tensorflow.compat.v1.global_variables_initializer"
]
] |
MikhailRyazanov/PyAbel | [
"38728a6ef2321d1325ad96597f56a835de8423be",
"38728a6ef2321d1325ad96597f56a835de8423be",
"38728a6ef2321d1325ad96597f56a835de8423be"
] | [
"abel/tools/polar.py",
"abel/tools/circularize.py",
"abel/tests/test_tools_center.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport numpy as np\nfrom scipy.ndimage import map_coordinates\nfrom scipy.ndimage.interpolation import shift\nfrom scipy.optimize imp... | [
[
"numpy.sqrt",
"numpy.cos",
"numpy.sin",
"numpy.arctan2",
"scipy.ndimage.map_coordinates",
"numpy.meshgrid",
"numpy.vstack"
],
[
"scipy.interpolate.UnivariateSpline",
"numpy.indices",
"scipy.ndimage.interpolation.map_coordinates",
"numpy.arctan2",
"scipy.interpol... |
adamosSol/SC-DNN | [
"482d67ed906535397fd2885aab74c323e024ce1a"
] | [
"src/inference/network_II/fp_inference.py"
] | [
"from __future__ import print_function\n\n# Import MNIST data\nfrom tensorflow.examples.tutorials.mnist import input_data\nmnist = input_data.read_data_sets(\"/tmp/data/\", one_hot=True)\n\nimport numpy as np\nimport tensorflow as tf\n\n# Network parameters \nn_hidden_1 = 128 # 1st layer number of neurons\nn_featur... | [
[
"tensorflow.matmul",
"tensorflow.nn.softmax",
"tensorflow.cast",
"tensorflow.placeholder",
"numpy.genfromtxt",
"tensorflow.Session",
"tensorflow.argmax",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets"
]
] |
Sadique96645/Financial-distress-prediction | [
"0789c76352e14add8a37cf205c81805eb6cb79c6"
] | [
"code.py"
] | [
"# --------------\nimport pandas as pd\nimport numpy as np\nimport os\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom sklearn.model_selection import train_test_split\nimport warnings\nwarnings.filterwarnings('ignore')\n# Path variable\ndf = pd.read_csv(path)\n# First 5 columns\ndf.head(5)\ndf.drop('Un... | [
[
"sklearn.metrics.roc_auc_score",
"matplotlib.pyplot.legend",
"pandas.read_csv",
"sklearn.linear_model.LogisticRegression",
"sklearn.ensemble.RandomForestClassifier",
"matplotlib.pyplot.subplots",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.Imputer",
"skle... |
olivierverdier/odelab | [
"ee3300c663f595c2d185a00605bcfb93649352e0"
] | [
"odelab/scheme/stochastic.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import division\n\nimport numpy as np\nimport scipy.linalg as sl\n\nfrom odelab.scheme import Scheme\nfrom newton import FSolve, Newton\n\nclass EulerMaruyama(Scheme):\n\tdef step(self,t,u,h):\n\t\tsystem = self.system\n\t\tnoise = np.random.normal(size=[len(system.noise(t,... | [
[
"numpy.dot",
"numpy.sqrt"
]
] |
jadenPete/keras_practice | [
"8e06c686f8a93ed7d0d7c244a3ea92d2bd428eb7"
] | [
"main.py"
] | [
"#!/usr/bin/env python3\n\nfrom keras.callbacks import ModelCheckpoint\nfrom keras.layers import Dense, Embedding, LSTM\nfrom keras.models import Sequential, load_model\nfrom keras.preprocessing.text import Tokenizer, text_to_word_sequence\nfrom keras.utils import to_categorical\nimport numpy\nimport os\nimport re\... | [
[
"numpy.array"
]
] |
waidyanatha/quasar | [
"da64dfb1993b013ee09a024bbdaad96d6e984409"
] | [
"lib/cluster_quality.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: UTF-8 -*-\n'''\n CLASS for community detection in graphs, both spatial and temporal, functions necessary for the station-fault analysis\n'''\n\nclass cluster_quality_metric():\n\n def __init__(self):\n\n self._l_reg_methods = ['Absolute','Average','minPoints','Non... | [
[
"sklearn.metrics.davies_bouldin_score",
"sklearn.metrics.calinski_harabasz_score",
"pandas.DataFrame",
"sklearn.metrics.silhouette_score"
]
] |
PhilipeRLeal/QAA | [
"9917b10190e4d96ac6c633f15d4d40bed3240bbe"
] | [
"scripts/IOP_AOPs/tests/QAA_analysis_tests.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom unittest import TestCase\n\nfrom .IOP_AOPs.QAA_analysis import apply_QAA\n\nclass Testgcdistance(TestCase):\n def test_apply_QAA(self):\n \"\"\"\n This is a function to evaluate the QAA algorithm\n\n \"\"\"\n try:\n N_samples =... | [
[
"pandas.DataFrame",
"numpy.random.randint"
]
] |
ashishpatel26/svhn-detection-tf | [
"20946383a039cfddcc43b54f796189290610f29b"
] | [
"svhn_detection/utils.py"
] | [
"#!/usr/bin/env python3\nimport tensorflow as tf\nimport numpy as np\nfrom svhn_dataset import SVHN\n\ndef bbox_area(a):\n return tf.maximum(tf.zeros_like(a[...,2]), a[...,2] - a[...,0]) * tf.maximum(tf.zeros_like(a[...,2]), a[...,3] - a[...,1]) \n\n\ndef bbox_iou(a, b):\n \"\"\" Compute IoU for two bboxes a,... | [
[
"numpy.expand_dims",
"tensorflow.zeros",
"tensorflow.stack",
"tensorflow.reduce_sum",
"tensorflow.cast",
"tensorflow.minimum",
"tensorflow.keras.experimental.CosineDecay",
"numpy.concatenate",
"tensorflow.where",
"numpy.swapaxes",
"tensorflow.logical_or",
"numpy.ara... |
HenriqueVarellaEhrenfried/U2GNN | [
"ade3d617ddd9cd8aadd310fcb33bc8b71fcae7cf"
] | [
"U2GNN_pytorch/util.py"
] | [
"import networkx as nx\nimport numpy as np\nimport random\nimport scipy.sparse as sp\nfrom sklearn.model_selection import StratifiedKFold\n\n\"\"\"Adapted from https://github.com/weihua916/powerful-gnns/blob/master/util.py\"\"\"\n\nclass S2VGraph(object):\n def __init__(self, g, label, node_tags=None, node_featu... | [
[
"scipy.sparse.isspmatrix_coo",
"numpy.stack",
"sklearn.model_selection.StratifiedKFold",
"numpy.array",
"numpy.vstack"
]
] |
mahnooranjum/Tensorflow_DeepLearning | [
"65ab178d4c17efad01de827062d5c85bdfb9b1ca",
"65ab178d4c17efad01de827062d5c85bdfb9b1ca"
] | [
"Tensorflow_2X_PythonFiles/demo59_gradientdescentsigmoid.py",
"Tensorflow_2X_PythonFiles/demo52_rnn_moviereviews.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Demo59_GradientDescentSigmoid.ipynb\n\n# **Delve Deeper**\n\nWe need sound conceptual foundation to be good Machine Learning Artists\n\n## Leggo\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\nprint(tf.__version__)\n\ndef ... | [
[
"matplotlib.pyplot.legend",
"numpy.dot",
"matplotlib.pyplot.title",
"numpy.unique",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"numpy.random.normal",
"numpy.mean",
"matplotlib.colors.ListedColormap",
"numpy.exp",
"matplotlib.pyplot.xlabel",
"sklearn.datasets.... |
LanceaKing/kaldi | [
"eb205a83f08fb8056ba1deb03c505ec8b722d4d9",
"eb205a83f08fb8056ba1deb03c505ec8b722d4d9"
] | [
"egs/chime5/s5b/local/extract_noises.py",
"egs/wsj/s5/steps/segmentation/internal/get_default_targets_for_out_of_segments.py"
] | [
"#!/usr/bin/env python3\n\nimport argparse\nimport json\nimport logging\nimport os\nimport sys\nimport scipy.io.wavfile as siw\nimport math\nimport numpy as np\n\n\ndef get_args():\n parser = argparse.ArgumentParser(\n \"\"\"Extract noises from the corpus based on the non-speech regions.\n e.g. {} ... | [
[
"scipy.io.wavfile.read",
"numpy.nonzero"
],
[
"numpy.matrix",
"numpy.repeat",
"numpy.shape",
"numpy.zeros"
]
] |
vstark21/SDC_in_simulator | [
"18e4cd26de7dcebfa33c0d41e1853400753b5b6b"
] | [
"Track-1/utils.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport csv\nimport cv2\nfrom scipy import ndimage\nimport os\nimport sklearn\nfrom sklearn.model_selection import train_test_split\n\nglobal SOURCE_PATH, EPOCHS\nSOURCE_PATH = 'new_data2/'\nEPOCHS = 1\n\ndef create_model():\n \n print(\"Creating Model\")\n\n # ... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.layers.Dense",
"sklearn.utils.shuffle",
"tensorflow.keras.layers.Conv2D",
"sklearn.model_selection.train_test_split",
"numpy.random.shuffle",
"tensorflow.keras.layers.MaxPooling2D",
"tenso... |
nyu-dl/dl4mt-nonauto | [
"f737794c3ca48ec146e82c387923406130f4b602"
] | [
"utils.py"
] | [
"import math\nimport ipdb\nimport torch\nimport random\nimport numpy as np\nimport _pickle as pickle\nimport revtok\nimport os\nfrom itertools import groupby\nimport getpass\nfrom collections import Counter\n\nfrom torch.autograd import Variable\nfrom torchtext import data, datasets\nfrom nltk.translate.gleu_score ... | [
[
"torch.from_numpy",
"torch.is_tensor",
"numpy.ones",
"numpy.ceil",
"numpy.random.randint",
"torch.sort",
"torch.cuda.device_of",
"numpy.random.rand",
"torch.cuda.device",
"numpy.zeros",
"numpy.sum",
"torch.autograd.Variable"
]
] |
RadioAstronomySoftwareGroup/pyuvdata | [
"3a34a39b95503a908f49bedd9f7289bff9198d2c"
] | [
"pyuvdata/tests/test_utils.py"
] | [
"# -*- mode: python; coding: utf-8 -*-\n# Copyright (c) 2018 Radio Astronomy Software Group\n# Licensed under the 2-clause BSD License\n\n\"\"\"Tests for common utility functions.\"\"\"\nimport os\nimport copy\nimport re\n\nimport pytest\nimport numpy as np\nfrom astropy import units\nfrom astropy.time import Time\... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.linspace",
"numpy.squeeze",
"numpy.vstack",
"numpy.all",
"numpy.max",
"numpy.where",
"numpy.ones_like",
"numpy.allclose",
"numpy.unique",
"numpy.arange",
"numpy.stack",
"numpy.sin",
"numpy.load",
"numpy.zeros",
"... |
Smirenost/sqlflow | [
"244366196e71834ea2a3a67b90406f7e99e4bcf0",
"244366196e71834ea2a3a67b90406f7e99e4bcf0"
] | [
"python/runtime/pai/tensorflow/explain.py",
"python/runtime/explainer.py"
] | [
"# Copyright 2020 The SQLFlow Authors. All rights reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ap... | [
[
"matplotlib.use",
"tensorflow.enable_eager_execution",
"pandas.DataFrame"
],
[
"matplotlib.use",
"matplotlib.pyplot.savefig"
]
] |
nibydlo/modAL | [
"c0fe0200001c8c34e3fabb099fb70cf1e4bfb680",
"c0fe0200001c8c34e3fabb099fb70cf1e4bfb680"
] | [
"experiments/models/topics_autoencoders.py",
"experiments/topics_uncertainty.py"
] | [
"import time\n\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\nfrom torch.utils.data import TensorDataset, DataLoader\n\n\nIMG_LEN = 1024\nTXT_LEN = 300\nN_CLASSES = 50\nBATCH_SIZE = 2048\ncriterion = nn.MSELoss()\n\n\ndef prepare_data_for_torch(X_train, X_val):\n x_img_train, x_txt_train ... | [
[
"torch.nn.BatchNorm1d",
"torch.cat",
"torch.utils.data.TensorDataset",
"torch.utils.data.DataLoader",
"torch.tensor",
"torch.nn.Linear",
"torch.no_grad",
"torch.nn.modules.Dropout",
"torch.nn.MSELoss"
],
[
"sklearn.preprocessing.StandardScaler",
"numpy.delete",
... |
thughes-IAS/OpenNMT-tf | [
"ecdf430ba82c62e520c75b6a30911cbad31d4a16"
] | [
"opennmt/tokenizers/tokenizer.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"Define base tokenizers.\"\"\"\n\nimport sys\nimport abc\nimport yaml\n\nimport tensorflow as tf\n\nfrom opennmt.utils import misc\n\n\nclass Tokenizer(abc.ABC):\n \"\"\"Base class for tokenizers.\"\"\"\n\n @property\n def in_graph(self):\n \"\"\"Returns ``True`` if this token... | [
[
"tensorflow.strings.regex_replace",
"tensorflow.device",
"tensorflow.is_tensor",
"tensorflow.strings.unicode_split",
"tensorflow.constant",
"tensorflow.io.gfile.exists",
"tensorflow.io.gfile.GFile",
"tensorflow.strings.split",
"tensorflow.RaggedTensor.from_tensor",
"tensorf... |
vipermu/bigotis | [
"a40cd50eb533d05e26dd71c5ab78076d425e912f",
"a40cd50eb533d05e26dd71c5ab78076d425e912f"
] | [
"server/models/taming/discriminator.py",
"server/models/taming/vqgan.py"
] | [
"import functools\nimport torch.nn as nn\n\nfrom models.taming.util_modules import ActNorm\n\n\ndef weights_init(m):\n classname = m.__class__.__name__\n if classname.find('Conv') != -1:\n nn.init.normal_(m.weight.data, 0.0, 0.02)\n elif classname.find('BatchNorm') != -1:\n nn.init.normal_(m.... | [
[
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.nn.Conv2d",
"torch.nn.init.normal_",
"torch.nn.LeakyReLU"
],
[
"torch.load",
"torch.randn",
"torch.nn.functional.conv2d",
"torch.nn.Conv2d",
"torch.no_grad",
"torch.nn.functional.one_hot",
"torch.argmax"
... |
seyedrezamirkhani/keras_lstm_vae | [
"94774c9838a37ea533585df21aa1f7dcd36476b7"
] | [
"example.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom lstm_vae import create_lstm_vae\n\ndef get_data():\n # read data from file\n data = np.fromfile('sample_data.dat').reshape(419,13)\n timesteps = 3\n dataX = []\n for i in range(len(data) - timesteps - 1):\n x = data[i:(i+timesteps), ... | [
[
"matplotlib.pyplot.legend",
"numpy.fromfile",
"matplotlib.pyplot.plot",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
ntienvu/TW_NAS | [
"72a6d3c933978663c583661eee765bc316f66572"
] | [
"cyDPP/sample_k.py"
] | [
"import numpy as np\nfrom cyDPP.elem_sympoly import elem_sympoly\n\n\ndef sample_k(eigenvals, k):\n \"\"\"\n Sample a given number of eigenvalues according to p(S) \\propto prod eigenvals \\in S\n \"\"\"\n E = elem_sympoly(eigenvals, k)\n\n i = len(eigenvals)\n remaining = k\n\n S = np.zeros((k... | [
[
"numpy.zeros",
"numpy.random.rand"
]
] |
CongzheUalberta/Deep-learning-based-decoding-of-constrained-sequence-codes | [
"1ab3626dc6034455e3324fa0d054ae48e78d13b2"
] | [
"utils.py"
] | [
"# authors: Congzhe Cao, email:congzhe@ualberta.ca\n# Duanshun Li, email:duanshun@ualberta.ca\n# This is the code repo for the paper \"Deep-learning based decoding of constrained sequence codes\",\n# in IEEE Journal on Selected Areas in Communications, https://ieeexplore.ieee.org/document/8792188.\n# Credi... | [
[
"numpy.amax",
"numpy.log2",
"numpy.random.seed",
"numpy.asarray",
"numpy.repeat",
"numpy.ones",
"numpy.copy",
"numpy.nansum",
"numpy.random.permutation",
"numpy.random.normal",
"numpy.prod",
"numpy.float32",
"numpy.log10",
"numpy.argsort",
"numpy.array",... |
IBM/NeuronAlignment | [
"5b82b60666db1fac72e53db07529a3328ee549c4",
"5b82b60666db1fac72e53db07529a3328ee549c4"
] | [
"utils/birkhoff.py",
"training/train_curve_pam.py"
] | [
"# birkhoff.py - decompose a doubly stochastic matrix into permutation matrices\n#\n# Copyright 2015 Jeffrey Finkelstein.\n#\n# This file is part of Birkhoff.\n#\n# Birkhoff is free software: you can redistribute it and/or modify it under the\n# terms of the GNU General Public License as published by the Free Softw... | [
[
"numpy.hstack",
"numpy.abs",
"numpy.finfo",
"numpy.all",
"numpy.zeros_like",
"scipy.optimize.linear_sum_assignment",
"numpy.zeros",
"numpy.where",
"numpy.vstack"
],
[
"torch.nn.CrossEntropyLoss",
"torch.optim.lr_scheduler.LambdaLR",
"numpy.random.seed",
"tor... |
qai-research/Efficient_Text_Detection | [
"e5cfe51148cc4fbf4c4f3afede040e4ebd624e8b",
"e5cfe51148cc4fbf4c4f3afede040e4ebd624e8b",
"e5cfe51148cc4fbf4c4f3afede040e4ebd624e8b"
] | [
"akaocr/pipeline/pipeline/util.py",
"akaocr/tools/train_recog.py",
"akaocr/models/detec/efficient_heatmap.py"
] | [
"import math\r\nfrom utils.data.collates import NormalizePAD, ResizeNormalize\r\nfrom PIL import ImageFont, ImageDraw, Image\r\nfrom pathlib import Path\r\nfrom utils.utility import initial_logger\r\nlogger = initial_logger()\r\nimport numpy as np\r\nimport cv2\r\n\r\nimport uuid\r\n\r\nclass AlignCollate(object):\... | [
[
"numpy.copy",
"numpy.array"
],
[
"torch.cuda.is_available"
],
[
"torch.nn.BatchNorm2d"
]
] |
gangiman/pytorch-lightning | [
"9b31272cf0f3079a244944096b4a81eec20fe555",
"9b31272cf0f3079a244944096b4a81eec20fe555"
] | [
"tests/base/utils.py",
"tests/base/debug.py"
] | [
"import os\nfrom argparse import Namespace\n\nimport numpy as np\nimport torch\n\n# from pl_examples import LightningTemplateModel\nfrom pytorch_lightning import Trainer\nfrom pytorch_lightning.callbacks import ModelCheckpoint\nfrom pytorch_lightning.loggers import TestTubeLogger, TensorBoardLogger\nfrom tests.base... | [
[
"torch.mean",
"numpy.random.seed",
"numpy.asarray",
"torch.manual_seed",
"torch.argmax",
"torch.sum",
"torch.tensor",
"numpy.alltrue",
"numpy.random.randint"
],
[
"torch.stack",
"torch.nn.Linear",
"torch.nn.functional.cross_entropy"
]
] |
shagunuppal/Riemannian_Geometry_of_Deep_Generative_Models | [
"98ebd17119d6065d4d89e93d6e0c11d82d49eb33",
"98ebd17119d6065d4d89e93d6e0c11d82d49eb33",
"98ebd17119d6065d4d89e93d6e0c11d82d49eb33"
] | [
"CelebA/algo2.py",
"CelebA/preprocess.py",
"CelebA/algo1_without_cuda.py"
] | [
"# Algorithm 2 : Parallel Translation\r\n\r\nimport torch\r\nimport torchvision\r\nfrom torch import nn\r\nfrom torch import optim\r\nimport torch.nn.functional as F\r\nfrom torch.autograd import Variable\r\nfrom torch.utils.data import DataLoader\r\nfrom torchvision import transforms\r\nfrom torchvision.utils impo... | [
[
"matplotlib.use",
"torch.svd",
"torch.FloatTensor",
"torch.zeros"
],
[
"matplotlib.pyplot.imread",
"scipy.misc.imresize",
"matplotlib.pyplot.imsave"
],
[
"torch.mm",
"torch.transpose",
"matplotlib.use",
"torch.FloatTensor",
"torch._utils._rebuild_tensor",
... |
kurusugawa-computer/annofab-cli | [
"8edad492d439bc8fe64e9471464f545d07aba8b7",
"8edad492d439bc8fe64e9471464f545d07aba8b7",
"8edad492d439bc8fe64e9471464f545d07aba8b7"
] | [
"annofabcli/job/list_generated_task_history.py",
"annofabcli/task/put_tasks.py",
"annofabcli/filesystem/mask_user_info.py"
] | [
"import argparse\nimport logging\nfrom typing import Any, Dict, List, Optional\n\nimport annofabapi\nimport pandas\n\nimport annofabcli\nfrom annofabcli import AnnofabApiFacade\nfrom annofabcli.common.cli import AbstractCommandLineInterface, ArgumentParser, build_annofabapi_resource_and_login\nfrom annofabcli.commo... | [
[
"pandas.DataFrame"
],
[
"pandas.DataFrame"
],
[
"numpy.dtype"
]
] |
GReguig/kymatio | [
"e0fc10057f5f8bb947068bc40afff8d3d3729052",
"e0fc10057f5f8bb947068bc40afff8d3d3729052"
] | [
"tests/scattering3d/test_torch_scattering3d.py",
"kymatio/scattering2d/backend/tensorflow_backend.py"
] | [
"\"\"\" This script will test the submodules used by the scattering module\"\"\"\nimport torch\nimport os\nimport io\nimport numpy as np\nimport pytest\nfrom kymatio import HarmonicScattering3D\nfrom kymatio.scattering3d.utils import generate_weighted_sum_of_gaussians\n\n\nbackends = []\n\nskcuda_available = False\... | [
[
"torch.abs",
"numpy.abs",
"numpy.sqrt",
"torch.zeros",
"torch.sqrt",
"torch.randn",
"torch.zeros_like",
"torch.from_numpy",
"numpy.ones",
"numpy.fft.ifftshift",
"torch.cuda.is_available",
"torch.device",
"numpy.load",
"numpy.zeros"
],
[
"tensorflow.s... |
adaptivemgmt/datamonster-api | [
"1c56440d1e9c48380d5cca54bb195ef7ee9d9472",
"1c56440d1e9c48380d5cca54bb195ef7ee9d9472",
"1c56440d1e9c48380d5cca54bb195ef7ee9d9472"
] | [
"datamonster_api/lib/datamonster.py",
"datamonster_api/tests/lib/test_datamonster.py",
"datamonster_api/tests/lib/regression.py"
] | [
"import datetime\nimport fastavro\nimport json\nimport pandas\nimport six\n\nfrom .client import Client\nfrom .company import Company\nfrom .data_group import DataGroup, DataGroupColumn\nfrom .datasource import Datasource\nfrom .errors import DataMonsterError\n\n__all__ = [\"DataMonster\", \"DimensionSet\"]\n\n\ncl... | [
[
"pandas.DataFrame.from_records",
"pandas.to_datetime",
"pandas.Timestamp"
],
[
"pandas.DataFrame.from_records"
],
[
"pandas.DataFrame.from_records",
"pandas.to_datetime",
"numpy.dtype"
]
] |
simonvh/fluff | [
"f8a5d88421a54ec559d1bac52d60643fb814c6f9"
] | [
"fluff/track.py"
] | [
"import os\nimport pyBigWig\nimport re\nimport tempfile\nfrom collections import Counter\nfrom warnings import warn\n\nimport HTSeq\nimport numpy as np\nimport pybedtools\nimport pysam\nfrom scipy.stats import binned_statistic\n\n\nclass SimpleFeature(object):\n def __init__(self, chrom, start, end, value, stran... | [
[
"numpy.isnan",
"numpy.arange",
"numpy.nan_to_num",
"numpy.array",
"numpy.zeros"
]
] |
leoking99-BIT/Constrained_ILQR | [
"08346c0aa9eeb035ae6e3d6643ac9c119cb893d2"
] | [
"scripts/ilqr/obstacles.py"
] | [
"import numpy as np \nimport math\nimport pdb\n\nclass Obstacle:\n def __init__(self, args, track_id, bb):\n self.args = args\n self.car_length = bb[0]\n self.car_width = bb[1]\n self.track_id = track_id\n\n def get_obstacle_cost_derivatives(self, npc_traj, i, ego_state):\n\n ... | [
[
"numpy.diag",
"numpy.exp",
"numpy.matmul"
]
] |
ShintaroMinami/mican | [
"c224975a3ac3766ae82c0c250022ad7b2f2573c1"
] | [
"pymican/main.py"
] | [
"import os\nimport subprocess\nfrom typing import List, Union\nimport numpy as np\nimport pandas as pd\nfrom .parse_result import output2dict\n\n\ndir_script = os.path.dirname(os.path.realpath(__file__))\nBINFILEPATH = os.path.abspath(dir_script+'/bin/mican')\n\n\nclass Alignment:\n \"\"\"\n MICAN alignment c... | [
[
"numpy.reshape",
"numpy.dot",
"numpy.array"
]
] |
wconnell/siamese-triplet | [
"54296bac5bdd861dc4f43c37a5024de8d285afaa"
] | [
"trainer.py"
] | [
"import torch\nimport numpy as np\n\n\ndef fit(train_loader, val_loader, model, loss_fn, optimizer, scheduler, n_epochs, cuda, log_interval, metrics=[],\n start_epoch=0):\n \"\"\"\n Loaders, model, loss function and metrics should work together for a given task,\n i.e. The model should be able to pr... | [
[
"torch.no_grad",
"numpy.mean"
]
] |
00-01/gap_sdk | [
"25444d752b26ccf0b848301c381692d77172852c",
"25444d752b26ccf0b848301c381692d77172852c",
"25444d752b26ccf0b848301c381692d77172852c",
"25444d752b26ccf0b848301c381692d77172852c"
] | [
"tools/nntool/importer/onnx/handlers/backend/slice.py",
"examples/nntool/mnist_rnn/model/save_samples.py",
"tools/nntool/utils/ssd_postprocess_decoder.py",
"tools/nntool/importer/onnx/handlers/backend/tile.py"
] | [
"# Copyright (C) 2020 GreenWaves Technologies, SAS\n\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later version.\n\n... | [
[
"numpy.array",
"numpy.stack"
],
[
"numpy.expand_dims",
"tensorflow.keras.datasets.mnist.load_data"
],
[
"numpy.exp",
"numpy.zeros_like",
"numpy.tile"
],
[
"numpy.tile"
]
] |
triwahyuu/CenterNet | [
"0bdfca453456909e6131e5ee10b2e1f897a54905"
] | [
"src/lib/trains/ddd.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch\nimport numpy as np\n\nfrom models.losses import FocalLoss, L1Loss, BinRotLoss\nfrom models.decode import ddd_decode\nfrom models.utils import _sigmoid\nfrom utils.debugger import Debugger... | [
[
"torch.nn.MSELoss"
]
] |
erasche/biopython | [
"fba3c8a926a07b8b6b821759db8c71d93c51be86"
] | [
"setup.py"
] | [
"\"\"\"Distutils based setup script for Biopython.\n\nThis uses Distutils (http://python.org/sigs/distutils-sig/) the standard\npython mechanism for installing packages. For the easiest installation\njust type the command:\n\npython setup.py install\n\nFor more in-depth instructions, see the installation section of... | [
[
"numpy.get_include"
]
] |
xidianfushuai/DeepCTR | [
"66d173e5736eae2e19c32e28e6d656ef873461a5"
] | [
"tests/models/DIEN_test.py"
] | [
"import numpy as np\nimport pytest\nimport tensorflow as tf\nfrom packaging import version\n\nfrom deepctr.feature_column import SparseFeat, VarLenSparseFeat, DenseFeat, get_feature_names\nfrom deepctr.models import DIEN\nfrom ..utils import check_model\n\n\ndef get_xy_fd(use_neg=False, hash_flag=False):\n featu... | [
[
"numpy.array",
"tensorflow.compat.v1.disable_eager_execution"
]
] |
calista-ai/calista-ml-engine | [
"6c3bfd31908af79d7ccdeb3bc9b7e65ca8fa95da"
] | [
"CNN/src/preprocess.py"
] | [
"import numpy as np\nimport cv2\n\nwidth = 256\nheight = 192\nchannels = 3\n\ndef prepare_image(imagePath):\n\n X = []\n\n X.append(cv2.resize(cv2.imread(imagePath, cv2.IMREAD_COLOR), (width, height), \\\n interpolation=cv2.INTER_AREA))\n return np.array(X)\n"
] | [
[
"numpy.array"
]
] |
TheOnlyCryptoParadise/crypto_package | [
"6ed348712a2477babee16c2cfd87e1fb34584a86"
] | [
"crypto_package/candles/get_candles.py"
] | [
"from datetime import datetime\nfrom time import time\n\nimport pandas\nimport requests\n\nfrom crypto_package.conf import service_config as conf\n\n\ndef get_candles(exchange: str, currency_pair: str, timeframe: str, time_start=None, time_end=None, last_n_candles=None):\n \"\"\"Gets required candles.\n\n ... | [
[
"pandas.DataFrame"
]
] |
salesforce/QAConv | [
"3ab468c51b09fb5301c8bcedc109d451fd4b853d"
] | [
"baseline/span_based/utils_qa.py"
] | [
"# coding=utf-8\n# Copyright 2020 The HuggingFace Team All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n... | [
[
"numpy.argsort",
"numpy.max"
]
] |
travisyates81/object-detection | [
"931bebfa54798c08d2c401e9c1bad39015d8c832",
"931bebfa54798c08d2c401e9c1bad39015d8c832",
"931bebfa54798c08d2c401e9c1bad39015d8c832",
"931bebfa54798c08d2c401e9c1bad39015d8c832",
"931bebfa54798c08d2c401e9c1bad39015d8c832",
"931bebfa54798c08d2c401e9c1bad39015d8c832"
] | [
"object_detection_app.py",
"object_detection/utils/learning_schedules_test.py",
"object_detection/utils/static_shape_test.py",
"object_detection/builders/preprocessor_builder_test.py",
"object_detection/box_coders/keypoint_box_coder.py",
"object_detection/core/batcher.py"
] | [
"import os\nimport cv2\nimport time\nimport argparse\nimport multiprocessing\nimport numpy as np\nimport tensorflow as tf\n\nfrom utils.app_utils import FPS, WebcamVideoStream\nfrom multiprocessing import Queue, Pool\nfrom object_detection.utils import label_map_util\nfrom object_detection.utils import visualizatio... | [
[
"tensorflow.Graph",
"numpy.expand_dims",
"tensorflow.import_graph_def",
"tensorflow.gfile.GFile",
"numpy.squeeze",
"tensorflow.Session",
"tensorflow.GraphDef"
],
[
"tensorflow.placeholder",
"tensorflow.test.main"
],
[
"tensorflow.TensorShape",
"tensorflow.test.m... |
guoshengCS/PaddleNLP | [
"8c6d4fd7b926577a23a91dc977281758760c3c22",
"8c6d4fd7b926577a23a91dc977281758760c3c22"
] | [
"examples/distill/distill_lstm/utils.py",
"benchmark/bert/run_pretrain_single.py"
] | [
"# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless req... | [
[
"numpy.array"
],
[
"numpy.random.normal",
"numpy.random.seed"
]
] |
svenbuder/TheGALAHPayne | [
"fc0b0a227c4f032c6cc26bd8b50c4dce7b50a4f8"
] | [
"The_Payne/process_spectra.py"
] | [
"'''\nCode for reading in combined spectra.\nAny way that you can get your hands on the spectra should be fine, as long as you \n\nHere we adopt APOGEE DR14. Edit os.environs below for a later version of APOGEE data release.\nSince our spectral model training set was normalized using the DR12 wavelength definition,... | [
[
"numpy.abs",
"numpy.zeros",
"numpy.where"
]
] |
jay90099/model-analysis | [
"4389611ae476686d349bd6d16de39855d491cf0c",
"4389611ae476686d349bd6d16de39855d491cf0c"
] | [
"tensorflow_model_analysis/api/model_eval_lib_test.py",
"tensorflow_model_analysis/addons/fairness/metrics/fairness_indicators_test.py"
] | [
"# Lint as: python3\n# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli... | [
[
"tensorflow.io.TFRecordWriter",
"tensorflow.compat.v1.enable_v2_behavior",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.keras.metrics.AUC",
"tensorflow.compat.v2.lite.TFLiteConverter.from_keras_model",
"... |
MahmutOsmanovic/machine-learning-mooc-caltech | [
"deca978e13f6d6950f06417c4d520e71904962d7"
] | [
"lfd_hw4/hw4_7_d.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Feb 24 07:01:07 2021\n\n@author: Mahmu\n\"\"\"\n\n# HYPOTHESIS: h(x) = ax^2\n\nimport numpy as np\n\ndef problem4():\n \n RUNS = 1000\n a_total = 0\n N = 2 # size of data set\n \n for _ in range(RUNS):\n # two random points\n ... | [
[
"numpy.random.uniform",
"numpy.dot",
"numpy.array",
"numpy.sin"
]
] |
thesinepainter/similarity | [
"a9f675b8761c2886ca3aa9ea1215ab7f693ab07d"
] | [
"tensorflow_similarity/callbacks.py"
] | [
"# Copyright 2021 The TensorFlow Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable la... | [
[
"tensorflow.device",
"tensorflow.is_tensor",
"tensorflow.constant",
"tensorflow.reshape",
"tensorflow.cast",
"tensorflow.expand_dims",
"tensorflow.math.reduce_any",
"tensorflow.gather",
"tensorflow.where",
"tensorflow.rank",
"numpy.array",
"tensorflow.summary.scalar... |
biplavc/dqn-multi-agent-rl | [
"0611fec4e1f075d2c642e0aeccc10bdaecb52854"
] | [
"sum_tree.py"
] | [
"import numpy\n\n\nclass SumTree(object):\n\n def __init__(self, capacity):\n self.write = 0\n self.capacity = capacity\n self.tree = numpy.zeros(2*capacity - 1)\n self.data = numpy.zeros(capacity, dtype=object)\n\n def _propagate(self, idx, change):\n parent = (idx - 1) // ... | [
[
"numpy.zeros"
]
] |
nikhil-garg/VDSP_ocl | [
"906867f8cd8a899a1ce309c5ec843fa1ce865373",
"906867f8cd8a899a1ce309c5ec843fa1ce865373",
"906867f8cd8a899a1ce309c5ec843fa1ce865373",
"906867f8cd8a899a1ce309c5ec843fa1ce865373",
"906867f8cd8a899a1ce309c5ec843fa1ce865373",
"906867f8cd8a899a1ce309c5ec843fa1ce865373",
"906867f8cd8a899a1ce309c5ec843fa1ce86537... | [
"mnist_stdp_multiple_exploration_v17.py",
"boise/mnist_multiple_exploration_var_amp_v4.py",
"mnist_multiple_exploration_tio2_v19.py",
"mnist_stdp_multiple_exploration_v16.py",
"mnist_multiple_exploration_baseline_v40.py",
"mnist_vdsp_multiple_baseline_lite.py",
"mnist_multiple_exploration_tio2_v22.py",
... | [
"import itertools\nimport random\nimport logging\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\nfrom mnist_stdp_multiple_baseline import *\nfrom utilis import *\nfrom args_mnist import args as my_args\n# from ax import optimize\nimport pandas as pd\nfrom itertools import product\nimport time\n\n\n... | [
[
"matplotlib.pyplot.tight_layout",
"numpy.random.seed",
"numpy.reshape",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.close",
"matplotlib.pyplot.axis"
],
[
"matplotlib.pyplot.tight_layout",
"numpy.random.seed",
"numpy.r... |
SDJustus/AutoClassifier | [
"e9a9fc563a5df32542a6c9410da4e91e62d8ee4e"
] | [
"split_train.py"
] | [
"import torch\nimport os\nfrom torchvision import datasets\nfrom torchvision import transforms\n\nclass ImageFolderWithPaths(datasets.ImageFolder):\n \"\"\"Custom dataset that includes image file paths. Extends\n torchvision.datasets.ImageFolder\n \"\"\"\n\n # override the __getitem__ method. this is th... | [
[
"torch.sqrt",
"torch.sum",
"torch.utils.data.DataLoader",
"torch.empty"
]
] |
mloo3/stable-baselines3 | [
"e908583e2a716f51e3f84004c7316205d4f0b230",
"e908583e2a716f51e3f84004c7316205d4f0b230"
] | [
"stable_baselines3/common/noise.py",
"stable_baselines3/common/evaluation.py"
] | [
"import copy\nfrom abc import ABC, abstractmethod\nfrom typing import Iterable, List, Optional\n\nimport numpy as np\n\n\nclass ActionNoise(ABC):\n \"\"\"\n The action noise base class\n \"\"\"\n\n def __init__(self):\n super(ActionNoise, self).__init__()\n\n def reset(self) -> None:\n ... | [
[
"numpy.random.normal",
"numpy.zeros_like",
"numpy.sqrt"
],
[
"numpy.std",
"numpy.mean"
]
] |
ikassi/menpo | [
"ca702fc814a1ad50b27c44c6544ba364d3aa7e31",
"ca702fc814a1ad50b27c44c6544ba364d3aa7e31",
"ca702fc814a1ad50b27c44c6544ba364d3aa7e31"
] | [
"menpo/shape/pointcloud.py",
"menpo/interpolation/base.py",
"menpo/image/test/image_warp_test.py"
] | [
"import numpy as np\nfrom scipy.spatial.distance import cdist\nfrom menpo.visualize import PointCloudViewer\nfrom menpo.shape.base import Shape\n\n\nclass PointCloud(Shape):\n r\"\"\"\n An N-dimensional point cloud. This is internally represented as an ndarray\n of shape (``n_points``, ``n_dims``). This cl... | [
[
"numpy.min",
"scipy.spatial.distance.cdist",
"numpy.linalg.norm",
"numpy.max",
"numpy.mean",
"numpy.array"
],
[
"numpy.concatenate",
"scipy.ndimage.map_coordinates"
],
[
"numpy.arange",
"numpy.array",
"numpy.testing.assert_allclose"
]
] |
chalant/trading_calendars | [
"ab4e3ba34f12a7f21eed83976dcb6a358990bef7"
] | [
"tests/test_xtse_calendar.py"
] | [
"from unittest import TestCase\nimport pandas as pd\n\nfrom .test_trading_calendar import ExchangeCalendarTestBase\nfrom trading_calendars.exchange_calendar_xtse import XTSEExchangeCalendar\n\n\nclass XTSECalendarTestCase(ExchangeCalendarTestBase, TestCase):\n\n answer_key_filename = 'xtse'\n calendar_class =... | [
[
"pandas.Timestamp",
"pandas.Period"
]
] |
josephw-ml/model-analysis | [
"3105200fd39aa46e4c4d83aa460d92aa08a4b784",
"3105200fd39aa46e4c4d83aa460d92aa08a4b784",
"3105200fd39aa46e4c4d83aa460d92aa08a4b784"
] | [
"tensorflow_model_analysis/eval_saved_model/encoding.py",
"tensorflow_model_analysis/metrics/multi_class_confusion_matrix_metrics.py",
"tensorflow_model_analysis/api/tfma_unit_test.py"
] | [
"# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"tensorflow.compat.as_bytes",
"tensorflow.compat.v1.saved_model.utils.get_tensor_from_tensor_info",
"tensorflow.core.protobuf.meta_graph_pb2.TensorInfo",
"tensorflow.compat.v1.saved_model.utils.build_tensor_info"
],
[
"numpy.argmax"
],
[
"tensorflow.compat.v1.metrics.mean_absolute_... |
mrsaicharan1/SecTra | [
"2798d9364f306d7780fe6c7e59958b2c4da93dbc"
] | [
"object_detect.py"
] | [
"\n# coding: utf-8\n\n# # Object Detection Demo\n# Welcome to the object detection inference walkthrough! This notebook will walk you step by step through the process of using a pre-trained model to detect objects in an image. Make sure to follow the [installation instructions](https://github.com/tensorflow/models... | [
[
"tensorflow.Graph",
"numpy.expand_dims",
"tensorflow.import_graph_def",
"tensorflow.greater",
"tensorflow.slice",
"tensorflow.gfile.GFile",
"tensorflow.cast",
"tensorflow.squeeze",
"tensorflow.expand_dims",
"tensorflow.Session",
"tensorflow.get_default_graph",
"tens... |
ioanacroi/collaborative-experts | [
"ffd6c0bc8dc3c0375e40982bf5dce2c35359f1b6"
] | [
"test.py"
] | [
"import copy\nimport pickle\nimport random\nimport logging\nimport argparse\nfrom typing import Tuple, Dict\nfrom pathlib import Path\n\nimport numpy as np\nimport torch\nfrom mergedeep import Strategy, merge\nfrom typeguard import typechecked\n\nimport model as module_arch\nimport model.metric as module_metric\nim... | [
[
"numpy.random.seed",
"torch.load",
"torch.manual_seed",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.savetxt",
"numpy.argsort",
"torch.nn.DataParallel"
]
] |
weiyx16/mmsegmentation | [
"6d35d76195f173fbc6b119a7d7815e67d78024c6",
"6d35d76195f173fbc6b119a7d7815e67d78024c6",
"6d35d76195f173fbc6b119a7d7815e67d78024c6",
"6d35d76195f173fbc6b119a7d7815e67d78024c6",
"6d35d76195f173fbc6b119a7d7815e67d78024c6",
"6d35d76195f173fbc6b119a7d7815e67d78024c6"
] | [
"tests/test_models/test_necks/test_fpn.py",
"tools/model_converters/swin2mmseg.py",
"tools/convert_datasets/pascal_context.py",
"tests/test_models/test_losses/test_ce_loss.py",
"tests/test_models/test_heads/test_cc_head.py",
"mmseg/models/decode_heads/dm_head.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport torch\n\nfrom mmseg.models import FPN\n\n\ndef test_fpn():\n in_channels = [256, 512, 1024, 2048]\n inputs = [\n torch.randn(1, c, 56 // 2**i, 56 // 2**i)\n for i, c in enumerate(in_channels)\n ]\n\n fpn = FPN(in_channels, 256, len(i... | [
[
"torch.randn",
"torch.Size"
],
[
"torch.save"
],
[
"numpy.array",
"numpy.unique"
],
[
"torch.ones",
"torch.full",
"torch.Tensor",
"torch.tensor",
"numpy.array"
],
[
"torch.randn",
"torch.cuda.is_available"
],
[
"torch.cat",
"torch.nn.func... |
NixonZ/QNetwork-RL | [
"acf34dd8d598104267da88f3eacc3e44f06265a7"
] | [
"environment/metalog.py"
] | [
"from typing import Callable, List, Tuple\nimport numpy as np\nfrom random import random\n\nU = lambda : random()\nExp = lambda lmbda: -1.0*np.log(U())/lmbda\n\nclass metalog():\n\n def __init__(self,b: int,quantiles: List[Tuple], n_terms: int = 15,bounds:Tuple[float,float] = (-np.inf,np.inf)):\n # Proper... | [
[
"numpy.dot",
"numpy.log",
"numpy.abs",
"numpy.power",
"numpy.isposinf",
"numpy.quantile",
"numpy.isneginf",
"numpy.exp",
"numpy.array"
]
] |
nimRobotics/fnirslib | [
"0273c0da5f4a41d7cf4dac0fc9686c38f2c7b0cd"
] | [
"examples/EC2.py"
] | [
"\"\"\"\nauthor: @nimrobotics\ndescription: calculates the effective connectivity between regions and plots them\n\"\"\"\n\nimport numpy as np\nimport scipy.io\nimport glob\nimport sys\nsys.path.append('../utils')\nfrom plots import plotData\n\ndir = \"./process3/\" #directory of the data\noutdir = 'process3/' #dir... | [
[
"numpy.multiply"
]
] |
jkkummerfeld/dstc7-noesis | [
"05a1952e2e92f690e4b81528bbc4ed45a9767a6e",
"05a1952e2e92f690e4b81528bbc4ed45a9767a6e"
] | [
"noesis-tf/scripts/prepare_data.py",
"noesis-tf/model.py"
] | [
"import os\n\nimport ijson\nimport functools\n\nimport tensorflow as tf\n\ntf.flags.DEFINE_integer(\n \"min_word_frequency\", 1, \"Minimum frequency of words in the vocabulary\")\n\ntf.flags.DEFINE_integer(\"max_sentence_len\", 160, \"Maximum Sentence Length\")\n\ntf.flags.DEFINE_string(\"train_in\", None, \"Pat... | [
[
"tensorflow.train.Example",
"tensorflow.flags.DEFINE_string",
"tensorflow.python_io.TFRecordWriter",
"tensorflow.contrib.learn.preprocessing.VocabularyProcessor",
"tensorflow.flags.DEFINE_integer"
],
[
"tensorflow.constant",
"tensorflow.concat",
"tensorflow.stack",
"tensorf... |
xy6g13/xscale | [
"a0c5809b6005a2016ab85849fa33e24c3fc19518"
] | [
"xscale/_utils.py"
] | [
"\"\"\"This is where useful internal functions are stored.\n\"\"\"\n# Python 2/3 compatibility\nfrom __future__ import absolute_import, division, print_function\nfrom collections import Iterable\n# Pandas\nimport pandas as pd\n# Numpy\nimport numpy as np\n# Warnings\nimport warnings\n\n\ndef is_dict_like(value):\n\... | [
[
"pandas.Series",
"numpy.asarray",
"numpy.timedelta64",
"numpy.diff",
"pandas.core.dtypes.common.is_datetime64_dtype"
]
] |
NunoEdgarGFlowHub/cleverhans | [
"c8fa1510cf00039404956a1b63192f1b759fc625"
] | [
"tutorials/mnist_tutorial_tf.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport keras\nfrom keras import backend\n\nimport tensorflow as tf\nfrom tensorflow.python.platform import app\nfrom tensorflow.python.platform import flags\n\n... | [
[
"tensorflow.python.platform.app.run",
"tensorflow.placeholder",
"tensorflow.python.platform.flags.DEFINE_float",
"tensorflow.python.platform.flags.DEFINE_integer",
"tensorflow.Session",
"tensorflow.set_random_seed"
]
] |
s-jun/OSS_Term_Project | [
"47747a92944f7f94f1393c9072f7ee9034de090a",
"47747a92944f7f94f1393c9072f7ee9034de090a"
] | [
"predict_run.py",
"user_main.py"
] | [
"import data_manager\nimport os\nimport pandas as pd\n\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n\n\nif __name__ == '__main__':\n interval_list = ['day', 'hour12', 'hour6', 'hour']\n\n for interval in interval_list:\n print(interval)\n df = data_manager.get_price(interval)\n pred_file = ... | [
[
"pandas.read_csv"
],
[
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg",
"matplotlib.pyplot.Figure"
]
] |
zabaras/bayesmultiscale | [
"c2f7d36e8ff08a28e5da0809029143a9dd0e2777",
"c2f7d36e8ff08a28e5da0809029143a9dd0e2777",
"c2f7d36e8ff08a28e5da0809029143a9dd0e2777"
] | [
"HM-DenseED/plot/velocity_src/utils.py",
"Bayesian-HM-DenseED/models/model_train.py",
"HM-DenseED/utils/mcs_data_upload.py"
] | [
"'''\nReference: https://github.com/adsodemelk/PRST\n'''\n# -*- coding: utf-8 -*-\nfrom __future__ import print_function, division\nimport copy\n\n__all__ = [\"rldecode\", \"rlencode\", \"units\", \"mcolon\", \"recursive_diff\", \"gridtools\"]\n\nimport plot.velocity_src.gridtools\n\nimport numpy as np\nimport scip... | [
[
"numpy.dot",
"numpy.concatenate",
"numpy.argmin",
"numpy.any",
"numpy.exp",
"numpy.swapaxes",
"numpy.allclose",
"scipy.sparse.diags",
"numpy.sin",
"numpy.argmax",
"numpy.insert",
"scipy.sparse.bmat",
"numpy.log",
"scipy.sparse.csr_matrix",
"numpy.atleast... |
hustzxd/MobulaOP | [
"49e4062f6578b31918ddcc613e38e0fbb92bb015"
] | [
"examples/TVMOp.py"
] | [
"\"\"\" Example for using TVM generated function \"\"\"\nimport sys\nsys.path.append('../') # Add MobulaOP path\nimport mobula\n\nimport tvm\nimport topi\nfrom tvm.contrib.mxnet import to_mxnet_func\nfrom tvm.contrib.dlpack import to_pytorch_func\n\n\ndef get_tvm_add():\n # define compute\n n = tvm.var('n')\... | [
[
"torch.device",
"torch.tensor"
]
] |
xiaoeric/bmusegan | [
"3b54448bb488d7426c1fc4c0f9a65d373dc8c05f"
] | [
"musegan/bmusegan/components.py"
] | [
"\"\"\"Classes for the components of the model, including the generator, the\ndiscriminator and the refiner.\n\"\"\"\nfrom collections import OrderedDict\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\nfrom musegan.utils.neuralnet import NeuralNet\n\nclass Component(object):\n \"\"\"Base class for ... | [
[
"tensorflow.compat.v1.concat",
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.expand_dims",
"tensorflow.compat.v1.reduce_sum",
"tensorflow.compat.v1.reshape",
"tensorflow.compat.v1.get_collection",
"tensorflow.compat.v1.variable_scope",
"tensorflow.compat.v1.pad"... |
loerssoni/pytorch-CycleGAN-and-pix2pix | [
"289287f9e4bd948a306627b32fc6b57b78420121"
] | [
"data/base_dataset.py"
] | [
"\"\"\"This module implements an abstract base class (ABC) 'BaseDataset' for datasets.\n\nIt also includes common transformation functions (e.g., get_transform, __scale_width), which can be later used in subclasses.\n\"\"\"\nimport random\nimport numpy as np\nimport torch.utils.data as data\nimport torch\nfrom PIL ... | [
[
"numpy.maximum",
"torch.cat",
"torch.reshape",
"torch.tensor",
"torch.rand"
]
] |
alxshine/eNNclave | [
"639aa7e8df9440922788d0c2a79846b198f117aa"
] | [
"frontend/python/tests/test_depthwise_conv2d.py"
] | [
"from tensorflow.python.framework.test_util import TensorFlowTestCase\nfrom tensorflow.keras.models import Sequential\nimport tensorflow.keras.layers as layers\n\nimport os\nimport unittest\n\nfrom common import common_test_basis\n\n\nclass DepthwiseConv2dTests(TensorFlowTestCase):\n @staticmethod\n def testS... | [
[
"tensorflow.keras.layers.DepthwiseConv2D"
]
] |
lolgab/scvi-tools | [
"abbadc4172381aaf938f131796393ee113165167",
"abbadc4172381aaf938f131796393ee113165167",
"abbadc4172381aaf938f131796393ee113165167"
] | [
"scvi/core/modules/vaec.py",
"scvi/model/_utils.py",
"scvi/core/models/_utils.py"
] | [
"import torch\nfrom torch.distributions import Categorical, Normal\nfrom torch.distributions import kl_divergence as kl\n\nfrom ._base import DecoderSCVI, Encoder\nfrom .classifier import Classifier\nfrom .utils import broadcast_labels\nfrom .vae import VAE\n\n\nclass VAEC(VAE):\n r\"\"\"\n A semi-supervised ... | [
[
"torch.ones",
"torch.sqrt",
"torch.zeros_like",
"torch.distributions.Categorical",
"torch.log",
"torch.distributions.Normal",
"torch.ones_like"
],
[
"numpy.concatenate",
"numpy.where"
],
[
"pandas.concat",
"numpy.asarray",
"pandas.DataFrame",
"numpy.zero... |
ortslil64/dynamic_map_matcher_ros | [
"f0d6279adf15ea8bf87cba8cd27d18a49a36347d"
] | [
"src/map_matcher.py"
] | [
"#!/usr/bin/env python\nimport numpy as np\nfrom nav_msgs.msg import OccupancyGrid\nfrom scipy.optimize import differential_evolution\nfrom skimage.measure import ransac\nfrom skimage.transform import AffineTransform, SimilarityTransform\nfrom sklearn.neighbors import NearestNeighbors\nimport cv2\n\n\ndef send_map_... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.linspace",
"numpy.random.randint",
"scipy.optimize.differential_evolution",
"numpy.arange",
"numpy.matmul",
"numpy.sin",
"numpy.argmax",
"sklearn.neighbors.NearestNeighbors",
"numpy.zeros",
"numpy.random.choice",
"numpy.power",
... |
kissf-lu/python_test | [
"5df2f31984e385c25cd6b6bc144302450f671d8a"
] | [
"simpy_test/hospital_test.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\n======================================================================================================\n 杭州HUB仿真项目\n\n 项目启动日期:2017年7月6日\n 项目启动标识:AIRPORT OF EZ... | [
[
"numpy.random.choice"
]
] |
vinnamkim/EfficientNet-PyTorch | [
"6671c729c046897d460fda0c97a3f3bf6923ee49"
] | [
"efficientnet_pytorch/utils.py"
] | [
"\"\"\"\nThis file contains helper functions for building the model and for loading model parameters.\nThese helper functions are built to mirror those in the official TensorFlow implementation.\n\"\"\"\n\nimport re\nimport math\nimport collections\nfrom functools import partial\nimport torch\nfrom torch import nn\... | [
[
"torch.sigmoid",
"torch.floor",
"torch.nn.functional.conv2d",
"torch.rand",
"torch.nn.ZeroPad2d",
"torch.utils.model_zoo.load_url",
"torch.nn.functional.pad"
]
] |
lss616263/ganomaly | [
"0e8ddd7b97fdbe35b33d607cddaf62f36cb591c8"
] | [
"lib/data.py"
] | [
"\"\"\"\nLOAD DATA from file.\n\"\"\"\n\n# pylint: disable=C0301,E1101,W0622,C0103,R0902,R0915\n\n##\nimport os\nimport torch\nimport numpy as np\nimport torchvision.datasets as datasets\nfrom torchvision.datasets import MNIST\nfrom torchvision.datasets import CIFAR10\nfrom torchvision.datasets import ImageFolder\n... | [
[
"numpy.random.seed",
"torch.cat",
"numpy.random.shuffle",
"numpy.concatenate",
"numpy.copy",
"numpy.array",
"numpy.where"
]
] |
zhcet19/NeoAlgo-1 | [
"c534a23307109280bda0e4867d6e8e490002a4ee"
] | [
"Python/graphs/Directed_Acyclic_Graph.py"
] | [
"'''\n Author : @anushkrishnav\n Built using : networkx since it is a gold standard for Python DAGs (and other graphs). You can create a networkx directed graph with a list of tuples that represent the graph edges:\n'''\nimport networkx as nx\nfrom matplotlib import pyplot as plt\nclass DAG:\n def __init_... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.clf"
]
] |
GTJuniorDesign0100-2020/anti-malarial-MCMC-bayesian-algorithm | [
"8ab95c9b65275096dd86268fbb99bb37b6806e05",
"8ab95c9b65275096dd86268fbb99bb37b6806e05"
] | [
"tests/test_define_alleles.py",
"tests/test_calculate_frequencies.py"
] | [
"import os\nimport sys\n\nimport pandas as pd\nimport pytest\nimport numpy as np\n\nimport api.define_alleles as Define_Alleles\nfrom api.algorithm_instance import AlgorithmInstance\nimport api.recrudescence_utils as recrudescence_utils\nfrom api.recrudescence_file_parser import RecrudescenceFileParser\n\n# NOTE: M... | [
[
"pandas.concat",
"numpy.array",
"pandas.testing.assert_frame_equal",
"pandas.DataFrame"
],
[
"pandas.concat",
"numpy.array",
"pandas.DataFrame",
"numpy.testing.assert_array_almost_equal"
]
] |
JiaShun-Xiao/SparseLMM | [
"0bca5353ffc129a2d440cec91785da05909af2f2",
"0bca5353ffc129a2d440cec91785da05909af2f2"
] | [
"SparseLmm.py",
"demo_sparselmm.py"
] | [
"import numpy as np\nimport logging\n\nlogging.basicConfig(filename='spaselmm.log', level=logging.DEBUG)\n\n###\n# Input Arguments\n###\n# X: n x p input matrix, where n is the number of samples, and p is the number of variables. X cannot be sparse.\n# Z: n x m covariate data matrix\n# y: Vector of length n contain... | [
[
"numpy.log",
"numpy.absolute",
"numpy.linalg.norm",
"numpy.full",
"numpy.ones",
"numpy.argmax",
"numpy.random.randn",
"numpy.random.rand",
"numpy.isscalar",
"numpy.log10",
"numpy.repeat",
"numpy.exp",
"numpy.zeros"
],
[
"sklearn.metrics.r2_score",
"n... |
qxmd/implicit-recommender | [
"abd0fe8b7da46655861be36cb408b79e23ff6805"
] | [
"implicitmf/validation.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nValidation\n==========\n\"\"\"\nimport numpy as np\nimport pandas as pd\nfrom scipy.sparse import csr_matrix\nfrom implicitmf._utils import _sparse_checker\n\ndef hold_out_entries(X, hold_out_size=0.2, seed=None):\n \"\"\"\n Generates a sparse array of training examples by ma... | [
[
"numpy.random.seed",
"numpy.arange",
"numpy.ones",
"numpy.floor",
"numpy.array"
]
] |
houruiyan/hilearn | [
"44960832769e142babd42de311890c25fe18c943"
] | [
"hilearn/plot/base_plot.py"
] | [
"import numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\n\n# codes for ggplot like backgroud\n# http://messymind.net/making-matplotlib-look-like-ggplot/\n# Or simply import seaborn\n\nfavorite_colors=[\"deepskyblue\", \"limegreen\", \"orangered\", \"cyan\", \"magenta\", \n \"gold\", ... | [
[
"matplotlib.pyplot.contourf",
"matplotlib.pyplot.clabel",
"matplotlib.pyplot.scatter",
"numpy.min",
"numpy.max",
"numpy.argmax",
"matplotlib.pyplot.contour",
"numpy.meshgrid",
"numpy.zeros"
]
] |
s-mizuki-nlp/word_sense_disambiguation | [
"e920b37f879e8db8f2b2d7a55e7997bb8b61ff1a"
] | [
"model/logit_layer.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\nfrom __future__ import division, absolute_import, print_function, unicode_literals\n\nfrom typing import Optional, Union\nimport math\n\nimport torch\nfrom torch import nn\n\nfrom model.encoder_internal import BasePrefixAwareLayer, BaseLogitAdjustableLayer\nfrom model... | [
[
"torch.zeros",
"torch.cat",
"torch.nn.ModuleList",
"torch.arange",
"torch.nn.Embedding",
"torch.nn.Linear",
"torch.matmul",
"torch.split",
"torch.stack",
"torch.nn.init.zeros_",
"torch.cumsum",
"torch.index_select"
]
] |
mikniloes/frcnn-sutdy | [
"f9aacb22f0e4306dc5cc54aebc6172e129bc2d93",
"f9aacb22f0e4306dc5cc54aebc6172e129bc2d93"
] | [
"lib/model/roi/roi_align.py",
"lib/dataset/voc/pascal_voc_org.py"
] | [
"import torch\nimport torch.nn as nn\nfrom _C import roi_align_forward\nfrom _C import roi_align_backward\n\nclass _ROIAlign(torch.autograd.Function):\n @staticmethod\n def forward(ctx, input, rois, spatial_scale, output_size, sampling_ratio, aligned):\n \"\"\"\n Performs Region of Interest (RoI... | [
[
"torch.Tensor",
"torch.tensor"
],
[
"numpy.zeros",
"numpy.mean"
]
] |
chengingx/fibdrv | [
"816f7cab7af1014762a3bbfbef190e922baab276"
] | [
"AutoGenerate.py"
] | [
"import os \nimport pandas as pd\nimport math\nfrom tqdm import tqdm\n\ndef process_data(l, pd, name):\n\n print(f\"Processing {name} data...\")\n mean, std = pd.mean(axis = 1), pd.std(axis = 1)\n \n for i in tqdm(range(len(pd.index))):\n sum = 0\n cnt = 0\n for j in pd.iloc[i]:\n ... | [
[
"pandas.mean",
"pandas.std"
]
] |
aallaire91/phyre | [
"ee882194c12bae5561c25ec65f95a7c0944f8129",
"ee882194c12bae5561c25ec65f95a7c0944f8129"
] | [
"agents/neural_agent.py",
"agents/nets.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app... | [
[
"torch.optim.Adam",
"torch.LongTensor",
"numpy.expand_dims",
"torch.nn.Parameter",
"torch.clamp_",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.load",
"numpy.arange",
"torch.tensor",
"numpy.concatenate",
"torch.FloatTensor",
"torch.no_grad",
"numpy.mean"... |
hugoladret/bw_invariance | [
"ebcd8fb30fa9464e9a4412b16ac435b9a512d3a9",
"ebcd8fb30fa9464e9a4412b16ac435b9a512d3a9"
] | [
"python/bw_powerlaw.py",
"python/stim_figures.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Nov 20 10:18:04 2020\n\n@author: Hugo\n\"\"\"\n\n\nimport stim\nimport plots\nimport LIF\nimport numpy as np \nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\n\nimport matplotlib\nmatplotlib.rcParams['pdf.fonttype'] = 42\nmatplotlib.rcParams['ps.fonttype'] = ... | [
[
"numpy.linspace",
"numpy.asarray",
"matplotlib.pyplot.subplots",
"numpy.concatenate",
"numpy.max",
"numpy.exp"
],
[
"numpy.rot90",
"numpy.linspace",
"numpy.tile",
"matplotlib.pyplot.subplots",
"numpy.cos",
"numpy.zeros"
]
] |
612twilight/CogDL-TensorFlow | [
"f850bae3f7fc2cf98501623b0b2b291ff68c9097"
] | [
"cogdl/models/emb/grarep.py"
] | [
"import numpy as np\nimport networkx as nx\nimport scipy.sparse as sp\nfrom sklearn import preprocessing\nfrom .. import register_model\nfrom ..base_model import BaseModel\n\n\n@register_model(\"grarep\")\nclass GraRep(BaseModel):\n @staticmethod\n def add_args(parser):\n \"\"\"Add model-specific argum... | [
[
"numpy.hstack",
"numpy.log",
"numpy.sqrt",
"sklearn.preprocessing.normalize",
"numpy.zeros"
]
] |
discover-volve/welly | [
"056c1ad6f89363a4c520865af9dbbfb089c6bed2"
] | [
"welly/curve.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nDefines log curves.\n\n:copyright: 2016 Agile Geoscience\n:license: Apache 2.0\n\"\"\"\nfrom __future__ import division\n\nimport numpy as np\nfrom scipy.interpolate import interp1d\n\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nfrom matplotlib.patches import PathPat... | [
[
"numpy.nanmax",
"matplotlib.ticker.MultipleLocator",
"numpy.expand_dims",
"numpy.nanmedian",
"numpy.amax",
"numpy.linspace",
"numpy.asarray",
"numpy.nanmin",
"numpy.flipud",
"numpy.nan_to_num",
"numpy.lib.stride_tricks.as_strided",
"numpy.max",
"scipy.stats.gaus... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.