repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
xinranzhu/GPTune-1
[ "1e502295e790ab68990f657492243fd4fb3dfc0a", "1e502295e790ab68990f657492243fd4fb3dfc0a" ]
[ "examples/GCN/gcn_MB.py", "examples/ButterflyPACK/butterflypack_ie2d.py" ]
[ "#! /usr/bin/env python\n\n# GPTune Copyright (c) 2019, The Regents of the University of California,\n# through Lawrence Berkeley National Laboratory (subject to receipt of any\n# required approvals from the U.S.Dept. of Energy) and the University of\n# California, Berkeley. All rights reserved.\n#\n# If you have ...
[ [ "numpy.log", "numpy.array", "numpy.argmin" ], [ "numpy.set_printoptions", "numpy.array", "numpy.asarray", "numpy.argmin" ] ]
SushmaPyakurel/old-photo-restoration
[ "ae8ef681a3a1f76c074fc5140e6179800e740c64" ]
[ "Face_Detection/detect_all_dlib.py" ]
[ "# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n\nimport torch\nimport numpy as np\nimport skimage.io as io\n\n# from FaceSDK.face_sdk import FaceDetection\n# from face_sdk import FaceDetection\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Rectangle\nfrom skimage.trans...
[ [ "numpy.array", "numpy.reshape", "numpy.zeros", "matplotlib.pyplot.gca", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "matplotlib.patches.Rectangle", "matplotlib.pyplot.imshow" ] ]
Labaien96/SHAP
[ "a6cb866b4f912c1cc0717a6e4356d350bdacbf11" ]
[ "shap/explainers/deep/deep_tf.py" ]
[ "import numpy as np\nimport warnings\nfrom shap.explainers.explainer import Explainer\nfrom distutils.version import LooseVersion\nkeras = None\ntf = None\ntf_ops = None\ntf_gradients_impl = None\n\nclass TFDeepExplainer(Explainer):\n \"\"\"\n Using tf.gradients to implement the backgropagation was\n inspi...
[ [ "tensorflow.exp", "tensorflow.get_default_session", "tensorflow.matmul", "tensorflow.gradients", "tensorflow.keras.backend.get_session", "tensorflow.zeros_like", "tensorflow.to_float", "tensorflow.tile", "numpy.concatenate", "tensorflow.concat", "tensorflow.split", ...
vidursatija/BlazePalm
[ "aa31761ec2b1223c615853ba17c8972c47f4303d" ]
[ "ML/run_detector.py" ]
[ "import os\nimport torch\nimport cv2 as cv\nimport numpy as np\n\nfrom blazepalm import PalmDetector\nfrom handlandmarks import HandLandmarks\n\nm = PalmDetector()\nm.load_weights(\"./palmdetector.pth\")\nm.load_anchors(\"./anchors.npy\")\n\nhl = HandLandmarks()\nhl.load_weights(\"./handlandmarks.pth\")\n\ncap = cv...
[ [ "numpy.pad", "torch.from_numpy" ] ]
yutiansut/cupy
[ "321ab5368ce6091bf7a4d86cfe1a63ff3352b1c4" ]
[ "cupy/creation/ranges.py" ]
[ "import math\n\nimport numpy\n\nimport cupy\nfrom cupy import core\n\n\ndef arange(start, stop=None, step=1, dtype=None):\n \"\"\"Returns an array with evenly spaced values within a given interval.\n\n Values are generated within the half-open interval [start, stop). The first\n three arguments are mapped ...
[ [ "numpy.ceil", "numpy.dtype" ] ]
OlafHaag/NeuroPsyResearchAnalysis
[ "83d750310ee2467979d503d2fb4b6011ead9e9fc" ]
[ "scripts/09-hlm2.py" ]
[ "\"\"\"\nHaving a 3 x (3) Mixed Design: 3 conditions as BETWEEN factor, 3 blocks as WITHIN factor.\nThere are multiple measurements in each block (trials).\nThere are 2 dependent variables: parallel & orthogonal\nSince 'parallel' and 'orthogonal' measures have the same unit, \nit can be viewed as 1 outcome called '...
[ [ "numpy.linalg.norm", "numpy.random.seed", "numpy.linalg.eigh", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "pandas.factorize", "matplotlib.patches.Ellipse", "numpy.arctan", "numpy.arange", "matplotlib.pyplot.style.use", "pandas.read_csv", "scipy.stats....
tiagopereira/glue
[ "ff949ad52e205c20561f48c05f870b2abb39e0b0" ]
[ "glue/core/tests/test_component.py" ]
[ "# pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103\n\nfrom __future__ import absolute_import, division, print_function\n\nimport operator\n\nimport pytest\nimport numpy as np\nfrom mock import MagicMock\n\nfrom glue.external import six\nfrom glue import core\nfrom glue.tests.helpers import requires_astropy\n\nf...
[ [ "numpy.array", "numpy.isnan", "numpy.asarray", "numpy.zeros", "numpy.testing.assert_equal", "pandas.DataFrame", "numpy.testing.assert_array_equal", "numpy.abs", "numpy.all" ] ]
jiaanwong/MyFinanceJourney
[ "5f5a4d7459a3fa447bc7e22c9ef3fb1d78ab0247" ]
[ "GrinoldKronerModelFinal.py" ]
[ "import pandas_datareader.data as web\nimport bs4 as bs\nimport urllib.request\nimport pandas as pd\nimport numpy as np\nimport math\nimport time\nimport good_morning as gm\n\n# Function to add closing prices to key financials data frame\ndef addPrices(kr_keyfin, stock, datelist):\n data = web.get_data_yahoo(sto...
[ [ "numpy.round", "numpy.isnan" ] ]
jlrainbolt/pyunfold
[ "0b50d43d17380d2663c3d1a8c3356fadde4917aa" ]
[ "pyunfold/tests/testing_utils.py" ]
[ "\nimport numpy as np\n\n\ndef diagonal_response(size):\n \"\"\"Returns diagonal response matrix\n \"\"\"\n # Diagonal response matrix\n response = np.eye(size)\n response_err = np.sqrt(response)\n\n return response, response_err\n\n\ndef triangular_response(size):\n \"\"\"Returns upper-triangu...
[ [ "numpy.triu_indices", "numpy.zeros", "numpy.sqrt", "numpy.eye" ] ]
MothNik/robustbase
[ "1b7a68292da38ed5459ea4d82e48fd85c0b93761" ]
[ "src/robustbase.py" ]
[ "import statistics\nimport math\nimport numpy as np\n\n\n#Author: Deepak Yadav\n#E-mail: dky.united@gmail.com\n\ndef bias_corr(n):\n # find out if the number of observations is even or odd\n even = bool((n + 1) % 2) \n\n # find out if the number of observations is gr...
[ [ "numpy.percentile" ] ]
trigovision/once-for-all
[ "6f72bd1e720bd27e9709a35edf3947ccd8bf3656" ]
[ "nas/utils/my_dataloader/my_distributed_sampler.py" ]
[ "import math\nimport torch\nfrom torch.utils.data.distributed import DistributedSampler\n\n__all__ = [\"MyDistributedSampler\", \"WeightedDistributedSampler\"]\n\n\nclass MyDistributedSampler(DistributedSampler):\n \"\"\" Allow Subset Sampler in Distributed Training \"\"\"\n\n def __init__(self, dataset, num_...
[ [ "torch.as_tensor", "torch.Generator" ] ]
piojanu/humblerl
[ "7aa9f30f5af102c2cd8717ee1afb2821e5e13a29" ]
[ "tests/test_wrappers.py" ]
[ "import numpy as np\n\nfrom humblerl import create_gym, QualitativeRewardEnvironment\nfrom humblerl.environments import Discrete, Continuous\n\n\nclass TestGymEnvironment(object):\n \"\"\"Test wrapper on OpenAI Gym toolkit environments.\"\"\"\n\n def test_cartpole_env(self):\n \"\"\"Tests continuous st...
[ [ "numpy.all", "numpy.array" ] ]
Smellly/ShuffleNet_V2_pytorch_caffe
[ "69354f9870c22fff894dca567cfd2035aac9452f" ]
[ "slim.py" ]
[ "#!/usr/bin/env python\n# encoding: utf-8\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch\nimport torch.nn as nn\n\ntry:\n import caffe\n from caffe import layers as L\n from caffe import params as P\nexcept ImportError:\n ...
[ [ "torch.nn.init.constant", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.PReLU" ] ]
mingweima/hintplaygame
[ "31f35a22111a2e5e7e5d8e90f92326bc784c5fe7" ]
[ "sample/marginal_prob.py" ]
[ "import glob\nimport os\nimport pickle\nimport sys\n\nimport numpy as np\n\nsys.path.append(os.getcwd())\nsys.path.append(\"\")\n\nimport torch\nimport pandas as pd\n\n# if gpu is to be used\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\nfrom game.hint_play_game import TwoRoundHintGam...
[ [ "pandas.DataFrame.from_dict", "numpy.array", "torch.cuda.is_available", "torch.tensor" ] ]
amirahmady/Phantom_PI
[ "8a221d2dcd5987da1b87de7d11ca1610e4d48869" ]
[ "sine_wave.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\n\nclass Sine_Wave:\n def __init__(self,A,f,t,res,phase):\n self.A = A\n self.f= f\n self.t= np.arange(0,t,res)\n self.phase= phase \n self.phi= phase*np.pi\n self.calc_x() \n def calc_x(self):\n s...
[ [ "numpy.sin", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.axis" ] ]
multimodallearning/pdd_net
[ "8573113d044ec6e3c20b7acd6977404613c10a8f" ]
[ "apply_pdd_npz.py" ]
[ "import numpy as np\nimport nibabel as nib\nimport struct\nfrom scipy.ndimage.interpolation import zoom as zoom\nfrom scipy.ndimage.interpolation import map_coordinates as map_coordinates\n#import torch\n#import torch.nn as nn\n#import torch.nn.functional as F\n\n\nimport argparse\n\n\n\ndef main():\n\n parser =...
[ [ "numpy.zeros", "scipy.ndimage.interpolation.map_coordinates", "numpy.load", "numpy.eye", "numpy.arange" ] ]
deeprob-org/deeprob-kit
[ "c46050eb8047dcfa0cc2420887624184c042e32e" ]
[ "deeprob/spn/structure/io.py" ]
[ "# MIT License: Copyright (c) 2021 Lorenzo Loconte, Gennaro Gala\n\nimport os\nimport json\nfrom typing import Optional, Union, Type, List, Dict, IO\n\nimport numpy as np\nimport networkx as nx\nimport matplotlib.pyplot as plt\nfrom networkx.drawing import nx_pydot\nfrom networkx.drawing.layout import rescale_layou...
[ [ "matplotlib.pyplot.savefig", "numpy.exp", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.clf", "numpy.around", "matplotlib.pyplot.axis" ] ]
codacy-badger/rowan
[ "dd999363df59daa8d2f69fe56665b88092bae46f" ]
[ "tests/test_calculus.py" ]
[ "\"\"\"Test derivative and integral\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\nimport unittest\n\nimport numpy as np\n\nfrom rowan import calculus\n\none = np.array([1, 0, 0, 0])\nzero_vec = np.array([0, 0, 0])\none_vec = np.array([1, 0, 0])\n\n\nclass TestCalculus(unittest.TestCase)...
[ [ "numpy.array", "numpy.sqrt" ] ]
songjun54cm/ExampleBank
[ "195154ae7aa7fdbee358019248bef77028b8e97e" ]
[ "tensorflow_example/avazu/data_process/utilities.py" ]
[ "# coding:utf-8\nimport numpy as np\nimport pandas as pd\nimport pickle\nimport os\nfrom settings import DATA_DIR\n\n\ndef deepfm_onehot_representation(sample, fields_dict, array_length):\n array = np.zeros([array_length])\n idxs = []\n for field in fields_dict:\n if field == \"click\":\n ...
[ [ "numpy.array", "numpy.zeros", "pandas.read_csv" ] ]
lambday/tesseract
[ "b38cf14545940f3b227285a19d40907260f057e6" ]
[ "plots/plot.py" ]
[ "#!/usr/bin/python\n\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\nwith open(\"10_to_100.log\") as f:\n\tdata = f.read()\n\n\tdata = data.strip().split('\\n')\n\n\tx = [row.split(' ')[0] for row in data]\n\ty = [row.split(' ')[6] for row in data]\n\tz = [row.split(' ')[-1] for row in data]\n\tt = [ro...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.figure" ] ]
wengong-jin/chemprop
[ "3ad3577367d8a53f28aade0be41b56b1f25b6125" ]
[ "chemprop/models/mpn.py" ]
[ "from argparse import Namespace\nfrom collections import defaultdict\nfrom functools import partial\nfrom typing import Dict, List, Union\n\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport numpy as np\n\nfrom chemprop.features import BatchMolGraph, get_atom_fdim, get_bond_fdim, mol2grap...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "torch.cat", "torch.nn.LayerNorm", "torch.nn.LSTM", "torch.stack", "torch.bmm", "torch.ones", "numpy.stack", "torch.nn.functional.softmax", "torch.matmul" ] ]
charlesincharge/vae-seq
[ "0a1bace02c6bac6ab991ab8203a203d3061615ec" ]
[ "vaeseq/vae/srnn.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2018 Google, Inc.,\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 ...
[ [ "tensorflow.TensorShape" ] ]
MaxGenash/face_segmentation
[ "98dedfea1fb72444732dff206f0fe0d448445e74" ]
[ "check_model.py" ]
[ "from __future__ import print_function\nimport os\nimport time\nfrom keras.models import load_model\nfrom keras.utils import CustomObjectScope\nfrom scipy.misc import imresize\nfrom scipy.ndimage import imread\nimport matplotlib.pyplot as plt\nfrom config import *\n\nif CHECK_MODEL_ON_CPU_ONLY:\n os.environ['CUD...
[ [ "matplotlib.pyplot.savefig", "scipy.misc.imresize", "matplotlib.pyplot.show", "scipy.ndimage.imread", "matplotlib.pyplot.imshow", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.axis", "matplotlib.pyplot.subplot" ] ]
sanchitintel/benchmark
[ "1cd8ff536aeddf3ebcafd4837d91684a1d9e58d2" ]
[ "torchbenchmark/util/framework/vision/model_factory.py" ]
[ "import torch\nimport torch.optim as optim\nimport torchvision.models as models\nfrom torchbenchmark.util.model import BenchmarkModel\n\nfrom torchbenchmark.util.framework.vision.args import parse_args, apply_args\n\nclass TorchVisionModel(BenchmarkModel):\n optimized_for_inference = True\n\n def __init__(sel...
[ [ "torch.nn.CrossEntropyLoss", "torch.jit._script_pdt", "torch.jit.optimize_for_inference", "torch.jit.script", "torch.empty", "torch.randn" ] ]
Jsong1836/Portfolio-Management-with-Bitcoin
[ "1e681ec3e24110f047329adf2d895ed95944dade" ]
[ "RandomForestSelection.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sat May 29 01:43:10 2021\r\n\r\n@author: SONG\r\n\"\"\"\r\n\r\nimport quandl as ql\r\nimport numpy as np \r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport tensorflow as tf\r\nfrom sklearn.preprocessing import StandardScaler\r\nfrom sklearn import m...
[ [ "pandas.to_datetime", "sklearn.ensemble.RandomForestClassifier", "pandas.DataFrame", "numpy.stack", "pandas.read_csv" ] ]
prem2017/face-varification
[ "051d6143dc4d33faeb13e19258d61cff977f58a5" ]
[ "models.py" ]
[ "# -*- coding: utf-8 -*-\n\n\nimport pdb\nimport os\n\nimport torch\nimport torch.nn as nn\n\n\nclass FaceNet(nn.Module):\n\t\"\"\"docstring for FaceNet\"\"\"\n\n\n\tdef __init__(self, in_features=512, out_features=1, nonlinearity_function=None, dropout=0.0, use_batchnorm=False):\n\t\tsuper(FaceNet, self).__init__(...
[ [ "torch.nn.ReLU", "torch.nn.Dropout", "torch.nn.BatchNorm1d", "torch.nn.Linear" ] ]
aws-samples/aws-inf1-gcr-workshop
[ "a5712c17a66809fc60cd57a056a00df3b9b2fc8e" ]
[ "src/lab3/infer_resnet50_1000times.py" ]
[ "import os\nimport time\nimport torch\nimport torch_neuron\nimport json\nimport numpy as np\n\nfrom urllib import request\n\nfrom torchvision import models, transforms, datasets\n\n## Create an image directory containing a small kitten\nos.makedirs(\"./torch_neuron_test/images\", exist_ok=True)\nrequest.urlretrieve...
[ [ "torch.jit.load" ] ]
Greatpanc/mindspore_zhb
[ "1b7a38ccd86b55af50a0ea55c7f2f43813ed3e0e" ]
[ "tests/ut/python/dataset/test_datasets_coco.py" ]
[ "# Copyright 2020 Huawei Technologies Co., Ltd\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 l...
[ [ "numpy.array" ] ]
s3pi/Computer-Vision
[ "85fb6366a8b7d9bf055c4bd684c3c9801480ecf3" ]
[ "Image Transformation/Homography/homo.py" ]
[ "import numpy as np\nimport cv2\nfrom numpy.linalg import inv\nimport math\n\n\nimage = cv2.imread('image.png')\n#print(image)\n#b,g,r = cv2.split(image)\nrows,columns,ch = np.shape(image)\n#print(rows,columns)\n#angle = 30\n#theta = np.radians(angle)\n#c, s = np.cos(theta), np.sin(theta)\n#translation works fine 1...
[ [ "numpy.array", "numpy.dot", "numpy.zeros", "numpy.shape", "numpy.logical_and", "numpy.linalg.inv" ] ]
zxlzxlzxlzxlzxl/SSAKT
[ "7049ab90d5e5fa16f92d01ec2509cbb08f37e972" ]
[ "dataloader.py" ]
[ "import torch\nfrom torch.utils.data import Dataset\n\nclass KTData(Dataset):\n def __init__(self, data, train, num_skills, max_seqlen, question=False,sepchar=','):\n self.data = 'data/{}/{}_{}.csv'.format(data,data,train)\n self.num_skills = num_skills\n self.max_seqlen = max_seqlen\n ...
[ [ "torch.Tensor" ] ]
LoSealL/flownet2-tf
[ "7378d186b7461610f3f431625c4bb07eb098b7ed" ]
[ "src/flownet_s/flownet_s.py" ]
[ "from ..net import Net, Mode\nfrom ..utils import LeakyReLU, average_endpoint_error, pad, antipad\nfrom ..downsample import downsample\nimport math\nimport tensorflow as tf\nslim = tf.contrib.slim\n\n\nclass FlowNetS(Net):\n\n def __init__(self, mode=Mode.TRAIN, debug=False):\n super(FlowNetS, self).__ini...
[ [ "tensorflow.losses.compute_weighted_loss", "tensorflow.shape", "tensorflow.concat", "tensorflow.losses.get_total_loss", "tensorflow.variable_scope", "tensorflow.stack" ] ]
dhfromkorea/contextual-bandit-recommender
[ "60dd39cbd97c2a7dd1a84618f3ab603e763662e1" ]
[ "tests/test_context_free_policy.py" ]
[ "import pytest\n\n\nimport numpy as np\n\n\nfrom context import EpsilonGreedyPolicy, UCBPolicy\nfrom context import simulate_cb\nfrom context import sample_synthetic, sample_mushroom\n\ndef get_mushroom_data():\n context_dim = 5\n n_samples = 5000\n n_actions = 2\n\n # mock mushroom data\n X = np.ran...
[ [ "numpy.apply_along_axis", "numpy.random.rand", "numpy.linalg.norm" ] ]
vedatk67/ADM-HW1
[ "21da1ba0c4f08a8d3fb14d40a65476b39761b4f9" ]
[ "hw1scripts/numpy.py" ]
[ "#1 -)ARRAYS\n# reversing numpy array\nimport numpy\n\n\ndef arrays(arr):\n return numpy.array(arr, float)[::-1]\n\n\narr = input().strip().split(' ')\nresult = arrays(arr)\nprint(result)\n\n#2 -)SHAPE AND RESHAPE\n# reshaping with reshape function\nimport numpy\n\nprint(numpy.array(list(map(int, input().rstrip(...
[ [ "numpy.concatenate", "numpy.array", "numpy.ceil", "numpy.matmul", "numpy.zeros", "numpy.set_printoptions", "numpy.rint", "numpy.ones", "numpy.mean", "numpy.std", "numpy.outer", "numpy.inner", "numpy.var", "numpy.floor" ] ]
TimSYQQX/glyce
[ "1542ed30ce104c25aa5c69ffcc9cc5ef2fcda975" ]
[ "glyce/models/latticeLSTM/model/latticelstm.py" ]
[ "\"\"\"Implementation of batch-normalized LSTM.\"\"\"\n\nimport os \nimport sys \n\n\nroot_path = \"/\".join(os.path.realpath(__file__).split(\"/\")[:-5])\nif root_path not in sys.path:\n sys.path.insert(0, root_path) \n\n\nimport torch\nimport torch.autograd as autograd\nfrom torch import nn\nfrom torch.nn imp...
[ [ "torch.cat", "torch.nn.init.constant", "torch.eye", "torch.LongTensor", "torch.sigmoid", "numpy.empty", "torch.FloatTensor", "numpy.sqrt", "torch.div", "torch.zeros", "torch.mm", "torch.addmm", "torch.nn.Dropout", "torch.nn.init.orthogonal", "torch.split...
sarahmish/SDV
[ "b418836b260cbb1395177c46ff6e9d550f388431" ]
[ "sdv/constraints/tabular.py" ]
[ "\"\"\"Table constraints.\n\nThis module contains constraints that are evaluated within a single table,\nand which can affect one or more columns at a time, as well as one or more\nrows.\n\nCurrently implemented constraints are:\n\n * CustomConstraint: Simple constraint to be set up by passing the python\n ...
[ [ "numpy.log", "pandas.to_timedelta", "pandas.api.types.is_datetime64_ns_dtype", "numpy.exp", "pandas.to_numeric" ] ]
lhallock/openarm-multisensor
[ "a49aa381061482916ab299d9f1911c3acd62e732" ]
[ "multisensorimport/tracking/tracking_executor.py" ]
[ "#!/usr/bin/env python3\n\"\"\"Execute and visualize contour tracking of ultrasound frame series.\n\nThis module contains a high-level wrapper to execute contour tracking within an\nultrasound frame series using the parameter-specified optical flow algorithm,\nincluding both visualization and writing out results to...
[ [ "numpy.array" ] ]
VincentStimper/hmc-hyperparameter-tuning
[ "a0464cd80000c7cd45a388d6a5f76c0f1a76104d" ]
[ "vae/train_vcd_fmnist.py" ]
[ "import numpy as np\r\nimport tensorflow as tf\r\nimport json\r\nimport os\r\nimport time\r\n\r\nfrom tensorflow.examples.tutorials.mnist import input_data\r\n\r\nfrom core.ham import hmc_sampler\r\nfrom decoder.vae_dcnn_mnist import VAE_DCNN_GPU, VAEQ_CONV\r\nfrom util.constant import log_2pi\r\nfrom util.utils im...
[ [ "tensorflow.exp", "tensorflow.reshape", "tensorflow.global_variables_initializer", "tensorflow.random_normal", "tensorflow.einsum", "tensorflow.Variable", "tensorflow.train.Saver", "numpy.arange", "numpy.array", "tensorflow.train.AdamOptimizer", "tensorflow.eye", "t...
KailinTong/my-deep-reinforcement-learning
[ "2b284ff9475965303a1c9906c5666064229a90f1" ]
[ "p1_navigation/dqn_agent.py" ]
[ "import numpy as np\nimport random\nfrom collections import namedtuple, deque\n\nfrom model import QNetwork, DuelingQNetwork\n\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nBUFFER_SIZE = int(1e5) # replay buffer size\nBATCH_SIZE = 64 # minibatch size\nGAMMA = 0.99 # discount fact...
[ [ "numpy.max", "torch.device", "numpy.empty", "torch.nn.MSELoss", "numpy.zeros", "numpy.minimum", "torch.no_grad", "numpy.min", "torch.from_numpy", "torch.abs", "numpy.random.uniform", "numpy.arange", "numpy.power", "numpy.vstack" ] ]
zeeshanalipnhwr/Semantic-Segmentation-Keras
[ "304af52c60a16e32da9f1e3f57c653f578cc8bf5" ]
[ "Utils/custom_data_augmenter.py" ]
[ "from keras.preprocessing.image import ImageDataGenerator\nimport numpy as np\n\ndef rotate_segmentation_data(images, masks, percent):\n num_of_images = images.shape[0]\n # include the origional instances to the final list of augmented data\n images_rotated, masks_rotated = list(images), list(masks)\n f...
[ [ "numpy.array" ] ]
Originofamonia/biobert-pytorch
[ "bd6b97ba72d8d45cac385e74b5a61fdf42efcd8f" ]
[ "named-entity-recognition/run_mimic.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. 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...
[ [ "numpy.argmax", "torch.nn.CrossEntropyLoss" ] ]
HemuManju/ahead
[ "402919f2b1864b33de6e90521830b7d2fa31f9e2" ]
[ "src/features/feat_utils.py" ]
[ "import cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.cluster import KMeans\nfrom scipy.stats import multivariate_normal\nfrom torchvision import transforms\nimport torch\n\nNUM_CLUSTERS = 20\nkmeans = KMeans(init='k-means++', n_clusters=NUM_CLUSTERS, n_init=10)\n\n\ndef draw_figs(x_var, x_...
[ [ "torch.stack", "torch.ones", "numpy.multiply", "torch.LongTensor", "torch.sum", "matplotlib.pyplot.waitforbuttonpress", "torch.Tensor", "torch.zeros", "torch.device", "numpy.zeros", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.stack", "numpy...
DandyWei/gui_final
[ "863f41e488ad6eff411df0f57ae19c979ae2a6da" ]
[ "fastclass/split_images.py" ]
[ "\nfrom pathlib import Path\n# import TronGisPy as tgp\nimport numpy as np\nfrom PIL import Image as im\nimport cv2\nfrom matplotlib import cm\n\n# splitedimages = r'D:\\Thinktron\\fastclass\\input_data\\test_001_000_001.tif'\n\n\n\ndef tiff_2_png(img_fp):\n img_split = tgp.read_raster(img_fp).data\n image ...
[ [ "numpy.load" ] ]
Lakonik/MonoRUn
[ "5bcc5278ea7a6b9cac6b7933c66921fa3011ce9a" ]
[ "monorun/models/roi_heads/bbox_3d_heads/global_extractors/fc_extractor.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn.modules.utils import _pair\n\nfrom mmdet.core import auto_fp16, force_fp32\nfrom mmdet.models.builder import HEADS, build_loss\n\nfrom .....core import build_dim_coder\n\n\n@HEADS.register_module()\nclass FCExtractor(nn.Module):\n\n def __init__(self,\n ...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.modules.utils._pair", "torch.cat", "torch.nn.ModuleList", "torch.nn.init.constant_", "torch.nn.init.xavier_uniform_", "torch.nn.ReLU", "torch.nn.init.normal_", "torch.nn.Dropout2d" ] ]
Geidalaodicha/AndroidMalwareDetection
[ "656bccc7e38fccd6d3b3b026cbc7120ea808249b" ]
[ "show/back/handler.py" ]
[ "\n# coding=UTF-8\n'''\n@Date: 2019-05-14 00:49:46\n@Author: p4ssw0rd\n@Blog: http:www.tjuscswyz.cn\n'''\n\nfrom .isvalidapk import *\nimport os\nimport numpy as np\nfrom sklearn.metrics import confusion_matrix, classification_report, roc_auc_score\nfrom sklearn.model_selection import train_test_split\nfrom sklearn...
[ [ "sklearn.externals.joblib.load", "pandas.DataFrame" ] ]
ymguo/RANSAC
[ "0efdb50bbe4f99c32398f15d81b471d9af784483" ]
[ "RANSAC_pseudo_code.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Aug 30 09:44:25 2019\n\n@author: ymguo\n\"\"\"\n'''\n#code2:\n【Reading】\n# We haven't told RANSAC algorithm this week. So please try to do the reading.\n# And now, we can describe it here:\n\nWe have 2 sets of points, say, Points A and Points ...
[ [ "torch.cat", "matplotlib.pylab.savefig", "matplotlib.pylab.show", "matplotlib.pylab.imshow", "torch.sqrt", "torch.FloatTensor", "matplotlib.pylab.subplot", "numpy.sqrt", "numpy.append", "matplotlib.pylab.title", "torch.zeros", "numpy.array", "torch.optim.SGD", ...
akhilbobby/pegasus
[ "4c00483789a4c5c4db58fef95e3f135940a4b82b" ]
[ "pegasus/data/testdata/create_input_data.py" ]
[ "import pandas as pd\nimport tensorflow as tf\n\nsave_path = \"<Your path>/pegasus/data/testdata/test_pattern_1.tfrecords\"\n\ninput_dict = dict(\n inputs=[\n # Your text inputs to be summarized.\n ],\n targets=[\n ...
[ [ "pandas.DataFrame", "tensorflow.io.TFRecordWriter" ] ]
stephenllh/bengali_handwriting
[ "cdb7719934f544daa9dd34326f3a62f455607a64" ]
[ "src/train.py" ]
[ "import pandas as pd\nfrom functools import partial\nfrom csvlogger import CSVLogger\nfrom torchvision.models import densenet121\nfrom fastai.vision.data import ImageList\nfrom fastai.vision.transform import get_transforms\nfrom fastai.learner import Learner\nfrom radam import Over9000\nfrom net import DensenetOneC...
[ [ "pandas.read_csv" ] ]
ieesejin/graduation-project
[ "90e3800a61e138c941e8d4842b806ce23c4867b0" ]
[ "source/analysis/EDA_1.py" ]
[ "# Import Modules\nimport numpy as np\nimport pandas as pd\nimport os\nimport cv2\nimport json\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom collections import Counter\nfrom PIL import Image\nimport math\nimport seaborn as sns\n\n\ndef classid2label(class_id):\n category, *attribute = class_id.sp...
[ [ "pandas.set_option", "pandas.DataFrame", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
volkancirik/keras
[ "a32a4c2ecdb2b0e528fb45e0942d5262ffcd735b" ]
[ "keras/utils/layer_utils.py" ]
[ "from __future__ import print_function\nimport inspect\nimport numpy as np\nimport theano\nimport copy\n\nfrom ..layers.advanced_activations import LeakyReLU, PReLU\nfrom ..layers.core import Dense, Merge, Dropout, Activation, Reshape, Flatten, RepeatVector, Layer, AutoEncoder, Masking, Permute, Lambda, MaskedLambd...
[ [ "numpy.zeros" ] ]
loceyi/CSL_RetinaNet_Tensorflow
[ "c2de594ca1754dfa87f7271aa01052b0d001967a" ]
[ "libs/configs/DOTA1.0/CSL/cfgs_res152_dota_v36.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import division, print_function, absolute_import\nimport os\nimport tensorflow as tf\nimport math\n\n\"\"\"\nv27 + data aug. + MS + atan\nThis is your result for task 1:\n\n mAP: 0.7028884684751898\n ap of each class: plane:0.8667564161146087,\n baseball-diamond:0....
[ [ "tensorflow.constant_initializer", "tensorflow.random_normal_initializer" ] ]
khurrumsaleem/saltproc
[ "d1bbebf1df6037f82414effbad94defdf9226eee" ]
[ "saltproc/app.py" ]
[ "from saltproc import DepcodeSerpent\nfrom saltproc import Simulation\nfrom saltproc import Materialflow\nfrom saltproc import Process\nfrom saltproc import Reactor\nfrom saltproc import Sparger\nfrom saltproc import Separator\n# from depcode import Depcode\n# from simulation import Simulation\n# from materialflow ...
[ [ "numpy.ones_like" ] ]
cloud322/DataSci
[ "1eed8cdf56405b31d24e0ea13a4c97b57547f16c" ]
[ "MNIST.py" ]
[ "#MNIST\n#MNIST 이미지 데이터집합 다운로드\nfrom keras.datasets import mnist\nfrom tensorflow.examples.tutorials.mnist import input_data\n\nimport tensorflow as tf\n\n#mnist 데이터 다운로드\n(x_train, y_train),(x_test, y_test) = mnist.load_data()\n\nmnist = input_data.read_data_sets('MNIST/', one_hot=True)\n\n#손글씨를 픽셀화 한 결과를 저장할 심블릭 ...
[ [ "tensorflow.zeros", "tensorflow.argmax", "tensorflow.Session", "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "tensorflow.matmul", "tensorflow.log", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.cast", "tensorflow.train.G...
luisCossio/pandemic
[ "e175b62feb339406c15ee985d2d0c677fe2be74d" ]
[ "text_renderer.py" ]
[ "# coding=utf-8\n\"\"\"\nDaniel Calderon, CC3501, 2020-1\nSimple Text Renderer using OpenGL Textures\nFont: IBM text mode 8x8\n\"\"\"\n\nfrom OpenGL.GL import *\nimport OpenGL.GL.shaders\nimport font8x8_basic as f88\nimport numpy as np\nimport basic_shapes as bs\nimport easy_shaders as es\nimport easy_shaders2 as e...
[ [ "numpy.copy", "numpy.zeros" ] ]
rupumped/DFL
[ "a4e4d96b7ce7522cf7fee3c2cfdbb54eb7a473f2" ]
[ "examples/big.py" ]
[ "#!/usr/bin/env python\n\nimport dfl.dynamic_system\nimport dfl.dynamic_model as dm\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy import signal\n\nplt.rcParams[\"font.family\"] = \"Times New Roman\"\nplt.rcParams[\"font.size\"] = 18\nplt.rcParams['pdf.fonttype'] = 42\nplt.rcParams['ps.fonttype'...
[ [ "numpy.array", "numpy.zeros", "numpy.sum", "numpy.copy", "numpy.ones", "matplotlib.pyplot.subplots", "numpy.sign", "matplotlib.pyplot.show" ] ]
motschik/Mydesign
[ "886813a6a80e4369c0444b00067ef9190c5671d6" ]
[ "src/mydesign.py" ]
[ "import math\nimport cv2\nimport numpy as np\nimport copy\nimport os, tkinter, tkinter.filedialog, tkinter.messagebox\n\n#HSVテーブル\nhsv_table=[[[None for i in range(15)]for j in range(15)]for k in range(30)]\nfor k in range(15):\n for j in range(15):\n for i in range(30):\n r = k*j\n ...
[ [ "numpy.array", "numpy.copy", "numpy.array_equal" ] ]
quietcoolwu/MLCode
[ "b4bdb7ee3468da597e5d16cfb58728e3c29ca889" ]
[ "Ch7/knn.py" ]
[ "# Code from Chapter 7 of Machine Learning: An Algorithmic Perspective (2nd Edition)\n# by Stephen Marsland (http://stephenmonika.net)\n\n# You are free to use, change, or redistribute the code in any way you wish for\n# non-commercial purposes, but please maintain the name of the original author.\n# This code come...
[ [ "numpy.max", "numpy.zeros", "numpy.sum", "numpy.shape", "numpy.argsort", "numpy.unique" ] ]
hexisyztem/lightseq
[ "25265dabaaee42ee9e7b7ec43c8c04fb90292733", "9a617306fa711a3d6a25ef3eab9bfbe408692189" ]
[ "examples/inference/python/test/ls_quant_gpt2.py", "lightseq/training/cli/fs_modules/ls_transformer.py" ]
[ "import time\n\nimport torch\nfrom torch import nn\nfrom transformers import GPT2Tokenizer, GPT2LMHeadModel, GPT2Config\nimport lightseq.inference as lsi\nfrom lightseq.training.ops.pytorch.quantization import (\n qat_mode,\n QuantLinear,\n TensorQuantizer,\n weight_quant_config,\n)\nfrom lightseq.train...
[ [ "torch.no_grad", "torch.stack", "torch.cuda.synchronize", "torch.load" ], [ "torch.nn.Linear", "torch.empty", "torch.zeros" ] ]
caileighf/gpsd_csv_logger
[ "6a8c5789b204158e4ef3a544a448ed092478b004" ]
[ "utils/plot.py" ]
[ "import matplotlib.pyplot as plt\nimport datetime\n\nimport cartopy.crs as ccrs\nimport cartopy.feature as cf\n\nif __name__ == '__main__':\n\n import argparse\n parser = argparse.ArgumentParser(description=\"\")\n parser.add_argument('-p', '--projection', type=str, \n ...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.get_backend", "matplotlib.pyplot.figure", "matplotlib.pyplot.get_current_fig_manager" ] ]
evanmunro/dswgan-paper
[ "6674ad7223325a2e5c048384993a6a039077a5cc" ]
[ "monotonicity_penalty/monotonicity.py" ]
[ "import wgan\nimport pandas as pd\nimport torch\nimport numpy as np\nimport torch.nn.functional as F\nfrom matplotlib import pyplot as plt\n\n\n########################################\n# setup\n########################################\ndf = pd.read_feather(\"data/original_data/cps_merged.feather\").drop(\"u75\",1)...
[ [ "torch.device", "torch.cat", "numpy.log", "torch.arange", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "torch.optim.Adam", "matplotlib.pyplot.legend", "torch.save", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "matplotlib.pyplot.plot", "...
rgerkin/open-worm-analysis-toolbox
[ "501985138fdcc1941eb6cbf5b5883a2997c700de" ]
[ "examples/WCON demo.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nDemonstrates loading and saving to a WCON file\n\n\"\"\"\nimport sys\nimport os\nimport warnings\n\n# We must add .. to the path so that we can perform the\n# import of open_worm_analysis_toolbox while running this as\n# a top-level script (i.e. with __name__ = '__main__')\nsys.pat...
[ [ "numpy.array", "numpy.empty" ] ]
coclar/pointlike
[ "7088724b5a40cf787371aff69e64c9bec701f578" ]
[ "python/uw/like2/analyze/gardian.py" ]
[ "\"\"\"gardian analysis code\n\nThis extracts files associated with a GarDian run to allow various plots\n\"\"\"\nimport os, sys, glob, healpy\nimport matplotlib.pylab as plt\nimport numpy as np\nimport pandas as pd\n\nfrom uw.utilities import healpix_map as hpm\nfrom uw.like2 import diffuse\nfrom skymaps import Sk...
[ [ "numpy.array", "numpy.exp", "matplotlib.pylab.get_cmap", "matplotlib.pylab.subplots", "numpy.sqrt", "numpy.abs", "numpy.linspace", "matplotlib.pylab.rc" ] ]
hyunynim/DIST-Renderer
[ "4717ee8cea77f4f413b61f380a893c6800d0bde5" ]
[ "common/geometry/camera.py" ]
[ "from collections import namedtuple\nimport numpy as np\n\n# Camera\n'''\nstruct camera\n- projection\tnp.array (3,4)\n- intrinsic\tnp.array (3,3)\n- extrinsic\tnp.array (3,4)\n'''\nCamera = namedtuple(\"Camera\", \"projection intrinsic extrinsic\")\n\n# overwrite camera with methods\nclass Camera(object):\n def...
[ [ "numpy.dot", "numpy.transpose" ] ]
cppshizoidS/Python
[ "dfde647ba4a6fb828ef9a564924416bebd875929" ]
[ "Py_Torch/main.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass Net(nn.Module):\n\n def __init__(self):\n super(Net, self).__init__()\n # 1 input image channel, 6 output channels, 5x5 square convolution\n # kernel\n self.conv1 = nn.Conv2d(1, 6, 5)\n self.conv2 ...
[ [ "torch.nn.Linear", "torch.flatten", "torch.nn.Conv2d" ] ]
webwurst/wifi-locator
[ "3b42721d856ab0dcbea1ccc8f7f5ceb4a615be4b" ]
[ "src/utils_wifi.py" ]
[ "\"\"\"Module that provides all wifi sensor functionality (i.e. returning scan).\"\"\"\n\nimport os\nimport re\nimport subprocess\n\nimport pandas as pd\n\n\ndef get_signals():\n \"\"\"Get wifi signals.\"\"\"\n operating_system = os.name\n if operating_system == 'nt':\n return get_signals_windows()\...
[ [ "pandas.DataFrame" ] ]
bgokden/lstm-recommender-example
[ "77c82fc57e6cf27816d0417dd38327e16fd0541a" ]
[ "trainmodel.py" ]
[ "# multivariate multi-step encoder-decoder lstm example\nfrom numpy import array\nfrom numpy import hstack\nfrom keras.models import Sequential\nfrom keras.layers import LSTM\nfrom keras.layers import Dense\nfrom keras.layers import RepeatVector\nfrom keras.layers import TimeDistributed\nfrom keras.callbacks import...
[ [ "numpy.load" ] ]
travers-rhodes/neurips2021_jlonevae_sanitized
[ "16f729744ae71a4bbc303b15566dfbd780854bdb" ]
[ "jlonevae_lib/evaluate/evaluate_helper.py" ]
[ "# coding=utf-8\n# Copyright 2018 The DisentanglementLib Authors. All rights reserved.\n# Copyright 2021 Travers Rhodes. 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 ...
[ [ "numpy.array", "tensorflow.io.gfile.rmtree", "tensorflow.io.gfile.isdir", "numpy.random.RandomState" ] ]
dashu233/SparseR-CNN
[ "77397aa4abbfeaa55a6be7e5672c05bee05ce442" ]
[ "projects/SparseRCNN/sparsercnn/detector.py" ]
[ "#\n# Modified by Peize Sun, Rufeng Zhang\n# Contact: {sunpeize, cxrfzhang}@foxmail.com\n#\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport logging\nimport math\nfrom typing import List\n\nimport numpy as np\nimport torch\nimport torch.distributed as dist\nimport torch.nn.functional a...
[ [ "torch.device", "torch.sigmoid", "torch.stack", "torch.arange", "torch.nn.init.constant_", "torch.tensor", "torch.nn.functional.softmax", "torch.as_tensor", "torch.Tensor", "torch.nn.Embedding" ] ]
hero9968/PaddlePaddle-book
[ "1ff47b284c565d030b198705d5f18b4bd4ce53e5", "1ff47b284c565d030b198705d5f18b4bd4ce53e5" ]
[ "python/paddle/v2/fluid/tests/test_while_op.py", "python/paddle/v2/fluid/tests/test_dyn_rnn.py" ]
[ "import unittest\nimport paddle.v2.fluid.layers as layers\nfrom paddle.v2.fluid.executor import Executor\nimport paddle.v2.fluid.core as core\nfrom paddle.v2.fluid.backward import append_backward_ops\nimport numpy\n\n\nclass TestWhileOp(unittest.TestCase):\n def test_simple_forward(self):\n d0 = layers.da...
[ [ "numpy.sum", "numpy.random.random" ], [ "numpy.isnan" ] ]
jlerman44/cameo
[ "6aa4b9db7ebcc3e52547821e64b13675cf73f73a" ]
[ "cameo/strain_design/heuristic/evolutionary_based.py" ]
[ "# Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU.\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# Unle...
[ [ "pandas.DataFrame" ] ]
henryzord/AUTOCVE
[ "ab502557cad79aa6585292a31f8501439498d0c5" ]
[ "nestedcv_autocve.py" ]
[ "from multiprocessing import set_start_method\n\ntry:\n set_start_method(\"spawn\")\nexcept RuntimeError:\n pass # is in child process, trying to set context to spawn but failing because is already set\n\nimport os\nimport json\nimport time\nimport argparse\nimport numpy as np\nimport pandas as pd\nfrom scip...
[ [ "sklearn.impute.SimpleImputer", "numpy.array", "numpy.isnan", "sklearn.model_selection.StratifiedKFold", "numpy.zeros", "scipy.io.arff.loadarff", "numpy.argmax", "sklearn.metrics.roc_auc_score", "numpy.unique" ] ]
mosout/oneflow
[ "afbb221d900f1a340568ae2462b2022f8fcc4b3d" ]
[ "python/oneflow/test/modules/test_loss_consistent.py" ]
[ "\"\"\"\nCopyright 2020 The OneFlow Authors. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ap...
[ [ "numpy.random.uniform", "numpy.random.randint" ] ]
florianazefi/anomaly_detection
[ "1cf93826af6b59310c2212b4410064f4a7913c12" ]
[ "datasets.py" ]
[ "# MIT License; see ./LICENSE\n\n# AUTHOR : Floriana ZEFI\n# CONTACT : florianagjzefi@gmail.com or floriana.zefi@ing.com\n\n\nimport numpy as np\nimport pandas as pd\nimport torch\nimport torch.nn as nn\n\ndef _split_n_in_m_parts(n, m):\n \"\"\" Split integer n in m integers which sum up to n again, even if m * ...
[ [ "numpy.zeros_like", "torch.nn.LSTM", "numpy.random.seed", "pandas.concat", "numpy.random.shuffle", "numpy.diff", "torch.manual_seed", "numpy.where", "numpy.abs", "numpy.cumsum", "numpy.linspace", "torch.randn" ] ]
ychzhang/aqt
[ "54427ea65120af980b8f2540e94ebe2db1dd3ccd" ]
[ "aqt/jax_legacy/utils/tfevent_utils.py" ]
[ "# Copyright 2022 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.array", "numpy.lexsort", "tensorflow.io.gfile.isdir", "numpy.diff", "tensorflow.io.gfile.listdir", "numpy.append", "tensorflow.make_ndarray" ] ]
r9y9/dnnsvs
[ "b028f76fd4f081859ec99a2034e0e0dc8ce1a409" ]
[ "nnsvs/model.py" ]
[ "from warnings import warn\n\nimport torch\nfrom nnsvs.base import BaseModel, PredictionType\nfrom nnsvs.dsp import TrTimeInvFIRFilter\nfrom nnsvs.layers.conv import ResnetBlock, WNConv1d\nfrom nnsvs.layers.layer_norm import LayerNorm\nfrom nnsvs.mdn import MDNLayer, mdn_get_most_probable_sigma_and_mu\nfrom nnsvs.m...
[ [ "torch.nn.Linear", "torch.sigmoid", "torch.cat", "torch.nn.Dropout", "torch.nn.LSTM", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.nn.Sequential", "torch.no_grad", "torch.nn.LeakyReLU", "torch.nn.ReLU", "torch.nn.utils.rnn.pad_packed_sequence", "torch.nn.Bat...
mlares/computacion2020
[ "185bfded8ef1670e80b1c2cdc1fceb365d962b0e" ]
[ "codes/kondo/interpolation.py" ]
[ "import numpy as np\nfrom matplotlib import pyplot as plt\n\ndef NDD(x, y):\n \"\"\"Devuelve las diferencias divididas de Newton.\n\n Args:\n x : lista o array\n Los valores de x\n y : lista o array\n Los valores de y\n Returns:\n NDD : array\n Array con las diferencias dividi...
[ [ "matplotlib.pyplot.show", "numpy.linspace", "matplotlib.pyplot.plot", "numpy.zeros" ] ]
Bearchat/VGG16_TXQ
[ "30ee6b2ebf231d83ba5c09f313d3a9211f3cd7e3" ]
[ "cifar.py" ]
[ "\"\"\"\nmnist tester (train and test accuracy)\n\ndate: 9/24\nauthor: arabian9ts\n\"\"\"\n\n# escape matplotlib error\nimport matplotlib\nmatplotlib.use('Agg')\n\n# escape tensorflow warning\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL']='2'\n\nimport sys\nimport tensorflow as tf\nimport _pickle as pickle\nimport ...
[ [ "matplotlib.use", "numpy.array", "numpy.random.choice", "matplotlib.pyplot.xlabel", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.matmul", "tensorflow.truncated_normal", "tensorflow.log", "tensorflow.placeholder", "matplotlib.pyplot.ylabel", "matplotli...
tum-fml/marsDemonstrator
[ "49f45d883eea27b678f10ec6e385e4c0d2e3b409" ]
[ "marsDemonstrator/designMethods/en_13001_3_3/input_error_check.py" ]
[ "from typing import Dict, List, Optional, Tuple, Any\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\n\r\nclass InputFileError(Exception):\r\n pass\r\n\r\n\r\nclass ErrorCheck():\r\n def __init__(self, fn_check_val: Any, error_msg: Dict[str, str], gp_input: Optional[bool] = None) -> None:\r\n se...
[ [ "pandas.to_numeric" ] ]
lobrien/MachineLearningNotebooks
[ "7e2c1ca152e280dc544f3c9654e9906a7f17c89b" ]
[ "how-to-use-azureml/ml-frameworks/chainer/train-hyperparameter-tune-deploy-with-chainer/chainer_score.py" ]
[ "import numpy as np\nimport os\nimport json\n\nfrom chainer import serializers, using_config, Variable, datasets\nimport chainer.functions as F\nimport chainer.links as L\nfrom chainer import Chain\n\nfrom azureml.core.model import Model\n\n\nclass MyNetwork(Chain):\n\n def __init__(self, n_mid_units=100, n_out=...
[ [ "numpy.asarray" ] ]
jagadeesh6jaga/indicAsr--inference
[ "569f867ed2d72cbd225f83d9b004666cf5c76c35" ]
[ "lm_training/utils/clean_corpus.py" ]
[ "import pandas as pd\nfrom tqdm import tqdm\nimport string\nimport re\nimport os\nimport glob\nimport itertools\nfrom collections import Counter\nimport argparse\nimport re\n\ndef main(args):\n lang = args.lang\n dir_path = args.dir_path\n os.makedirs(f'{dir_path}/{lang}', exist_ok=True)\n dict_path = f...
[ [ "pandas.read_csv" ] ]
armusc/lhotse
[ "d5e66aded223476700127d02fbf66af91643c24c" ]
[ "lhotse/dataset/collation.py" ]
[ "import warnings\nfrom concurrent.futures import Executor\nfrom functools import partial\nfrom typing import Iterable, List, Optional, Tuple, Union\n\nimport numpy as np\nimport torch\nfrom torch.nn import CrossEntropyLoss\n\nfrom lhotse import CutSet\nfrom lhotse.audio import AudioLoadingError, DurationMismatchErr...
[ [ "numpy.array", "torch.stack", "torch.from_numpy", "torch.ones", "torch.tensor", "torch.nn.CrossEntropyLoss" ] ]
ymnliu/AMIA19_W22_large_scale_nlp
[ "efcc7fe45a5827942dbcb2297dfcbccb79d92772" ]
[ "scripts/ensemble.py" ]
[ "import os\nfrom pathlib import Path\nfrom gensim.models import KeyedVectors\nfrom gensim.scripts.glove2word2vec import glove2word2vec\nfrom nltk import word_tokenize\nimport pandas as pd\nimport numpy as np\nfrom sklearn import tree\nfrom sklearn.svm import SVC\nfrom sklearn.linear_model import LogisticRegression\...
[ [ "sklearn.ensemble.VotingClassifier", "sklearn.ensemble.AdaBoostClassifier", "sklearn.ensemble.RandomForestClassifier", "pandas.DataFrame", "sklearn.neural_network.MLPClassifier", "sklearn.svm.SVC", "sklearn.metrics.classification_report", "sklearn.linear_model.LogisticRegression", ...
junru-xiong/EiR-Reinforcement-Learning
[ "1198d76050778942774c839d71dc35a39c719327" ]
[ "blackjack/blackjack.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom tqdm import tqdm\nimport random\n\n# actions: hit or stand\nACTION_HIT = 0\nACTION_STICK = 1\nACTIONS = [ACTION_HIT, ACTION_STICK]\nALPHA = 0.1\nT = 0.2\n\nAVAILABLE_CARDS = [x for x in range(1, 11)] *...
[ [ "numpy.array", "numpy.random.choice", "numpy.exp" ] ]
tomwhite/datashader
[ "569520dc47493591ebdd058ab552e305420ac527" ]
[ "datashader/spatial/hilbert_curve.py" ]
[ "from __future__ import absolute_import\nfrom datashader.utils import ngjit\nfrom numba import vectorize, int64\nimport numpy as np\nimport os\n\n\"\"\"\nInitially based on https://github.com/galtay/hilbert_curve, but specialized\nfor 2 dimensions with numba acceleration\n\"\"\"\n\nNUMBA_DISABLE_JIT = os.environ.ge...
[ [ "numpy.array", "numpy.zeros" ] ]
MartinHahner/OpenPCDet
[ "c9d31d393acaae34d74cb03bd6ccff9976d3d1f3" ]
[ "pcdet/ops/pointnet2/pointnet2_stack/voxel_pool_modules.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom . import voxel_query_utils\nfrom typing import List\n\n\nclass NeighborVoxelSAModuleMSG(nn.Module):\n \n def __init__(self, *, query_ranges: List[List[int]], radii: List[float], \n nsamples: List[int], mlps: List[L...
[ [ "torch.cat", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.nn.init.constant_", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm1d" ] ]
samuelbaltanas/face-pose-dataset
[ "84c864c155ac7c0b231032d403c0e2b2bc10b871" ]
[ "face_pose_dataset/third_party/fsa_estimator/utils.py" ]
[ "import numpy as np\nfrom tensorflow.keras.utils import get_custom_objects\n\n\ndef get_initial_weights(output_size):\n b = np.zeros((2, 3), dtype=\"float32\")\n b[0, 0] = 1\n b[1, 1] = 1\n W = np.zeros((output_size, 6), dtype=\"float32\")\n weights = [W, b.flatten()]\n return weights\n\n\ndef reg...
[ [ "numpy.zeros", "tensorflow.keras.utils.get_custom_objects" ] ]
aaroncwhite/SPRINT_gan
[ "a3b64cdf0d6c139c82ec07bbf0c9534a3fd5991a" ]
[ "privacy_accountant/accountant.py" ]
[ "# Copyright 2016 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.exp", "tensorflow.multiply", "tensorflow.zeros", "numpy.zeros", "tensorflow.group", "tensorflow.reshape", "numpy.float64", "tensorflow.assign_add", "tensorflow.log", "tensorflow.reduce_sum", "tensorflow.greater", "tensorflow.slice", "tensorflow.squar...
ajsilveira/perses
[ "adff6cecb8c710dabac1dcddf0d05306409b2362" ]
[ "perses/tests/test_coordinate_numba.py" ]
[ "import simtk.openmm as openmm\nimport openmoltools\nimport simtk.openmm.app as app\nimport simtk.unit as unit\nimport logging\nimport numpy as np\nimport parmed\nimport copy\nimport os\nfrom unittest import skipIf\nfrom pkg_resources import resource_filename\nfrom openmmtools.constants import kB\nfrom perses.rjmc ...
[ [ "numpy.random.normal", "numpy.array", "numpy.linalg.norm", "numpy.random.randint", "numpy.arange" ] ]
YingtongDou/Nash-Detect
[ "cda62b7a1c899b5640e46b11582cbdd68c89d5a6" ]
[ "Utils/yelpFeatureExtraction.py" ]
[ "import math\nfrom copy import deepcopy\nfrom datetime import datetime\nimport numpy as np\nimport sys\nimport os\nsys.path.insert(0, os.path.abspath('../'))\n\nfrom Utils.iohelper import *\n\n\"\"\"\n\tConstruct account, product and review features given a review dataset.\n\"\"\"\n\n\nclass FeatureExtractor:\n\n\t...
[ [ "numpy.array", "numpy.nonzero", "numpy.arange", "numpy.log2", "numpy.unique" ] ]
gaodong2/transformers
[ "83984a61c657023a69e78951b338e378a0f866c2" ]
[ "src/transformers/modeling_longformer.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Allen Institute for AI team and The HuggingFace Inc. team.\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/lice...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "torch.cat", "torch.nn.MSELoss", "torch.arange", "torch.einsum", "torch.tanh", "torch.nn.functional.dropout", "torch.bmm", "torch.ones", "torch.masked_fill", "torch.tensor", "torch.nn.functional.softmax",...
K2OKOH/DG_FasterRCNN
[ "0106010cb433570a5b62bb822d3eaef7579a53f1", "0106010cb433570a5b62bb822d3eaef7579a53f1" ]
[ "lib/model/da_faster_rcnn/faster_rcnn.py", "lib/roi_dg_data_layer/roibatchLoader.py" ]
[ "import random\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom torch.autograd import Variable\r\nimport torchvision.models as models\r\nfrom torch.autograd import Variable\r\nimport numpy as np\r\nfrom lib.model.utils.config import cfg\r\nfrom lib.model.rpn.rpn import _RPN\r\nfro...
[ [ "torch.stack", "torch.nn.MSELoss", "torch.autograd.Variable", "torch.nn.functional.log_softmax", "torch.nn.functional.cross_entropy", "torch.nn.BCELoss", "torch.nn.functional.softmax", "torch.nn.functional.nll_loss", "torch.nn.functional.max_pool2d", "torch.mean" ], [ ...
pvtien96/Detectron2DeepSortPlus
[ "ff9cd9150a1984a37bbde3a299edeb317c4d274b" ]
[ "models/export.py" ]
[ "\"\"\"Exports a YOLOv5 *.pt model to ONNX and TorchScript formats\n\nUsage:\n $ export PYTHONPATH=\"$PWD\" && python models/export.py --weights ./weights/yolov5s.pt --img 640 --batch 1\n\"\"\"\n\nimport argparse\n\nimport torch\n\nfrom utils.google_utils import attempt_download\nfrom utils.general import set_lo...
[ [ "torch.zeros", "torch.device", "torch.onnx.export", "torch.jit.trace" ] ]
Feecely/fairseq_bertnmt
[ "86a97432ba27a44b4a5cb66a35569c8517fbc66d" ]
[ "fairseq/criterions/distillation_loss.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport math\nfrom dataclasses import dataclass, field\n\nimport torch\nfrom fairseq import metrics, utils\nfrom fairseq.criterions i...
[ [ "torch.mean", "torch.nn.MSELoss", "torch.sum" ] ]
peircej/matplotlib
[ "8a590fa2475e2350cf350d155089cfef18846765" ]
[ "lib/mpl_toolkits/mplot3d/axis3d.py" ]
[ "#!/usr/bin/python\n# axis3d.py, original mplot3d version by John Porter\n# Created: 23 Sep 2005\n# Parts rewritten by Reinier Heeres <reinier@heeres.eu>\n\nimport math\nimport copy\n\nfrom matplotlib import lines as mlines, axis as maxis, \\\n patches as mpatches\nimport art3d\nimport proj3d\n\nimport numpy...
[ [ "matplotlib.lines.Line2D", "numpy.array", "numpy.asarray", "numpy.where", "matplotlib.axis.XAxis.get_major_ticks", "matplotlib.axis.XAxis.__init__", "numpy.asanyarray" ] ]
reyllama/ANGELS
[ "7aae7640b78e0ce6184d2c38731171bd6d79b062" ]
[ "train.py" ]
[ "import argparse\r\nimport math\r\nimport random\r\nimport os\r\n\r\nimport numpy as np\r\nimport torch\r\nfrom torch import nn, autograd, optim\r\nfrom torch.nn import functional as F\r\nfrom torch.utils import data\r\nimport torch.distributed as dist\r\nfrom torchvision import transforms, utils\r\nfrom tqdm impor...
[ [ "torch.utils.data.RandomSampler", "torch.nn.functional.softplus", "torch.distributed.init_process_group", "torch.no_grad", "torch.utils.data.SequentialSampler", "torch.lerp", "torch.nn.parallel.DistributedDataParallel", "torch.linspace", "torch.cuda.set_device", "torch.rand...
NadimKawwa/RosieMcRoseFace
[ "f8cc8f3a62c6bdd6f2794b51332c7a5f3a92b9c9" ]
[ "process_image.py" ]
[ "import numpy as np\nfrom PIL import Image\nfrom crop_image import crop_image\n\n\ndef process_image(image, mean= np.array([0.485, 0.456, 0.406]), std=np.array([0.229, 0.224, 0.225])):\n ''' Scales, crops, and normalizes a PIL image for a PyTorch model,\n returns an Numpy array\n '''\n \n #op...
[ [ "numpy.array" ] ]
kamalrbg/Machining-Feature-Retrieval
[ "fa1b149c4d3d0e465af0e36aab836824adbe85af" ]
[ "util/feature_extraction.py" ]
[ "import os\nimport numpy as np\nimport open3d as o3d\nimport torch\nfrom numpy import linalg as LA\nimport openmesh as om\nimport MinkowskiEngine as ME\n\n\n#In case we have to use lare CAD files like in ModelNet \ndef down_sample(pcd):\n if(len(pcd.points)>10000):\n pcd = pcd.voxel_down_sample(voxel_size...
[ [ "numpy.array", "numpy.any", "torch.cuda.is_available", "torch.tensor", "numpy.hstack", "numpy.floor" ] ]
varshith15/ins
[ "a1d422dbb950309bff5291419f0a58aeb581cfbd" ]
[ "sandbox/plot.py" ]
[ "import sys\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport pandas as pd\n\nfile = sys.argv[1]\nbool = int(sys.argv[2])\nsave = sys.argv[3]\nflag = int(sys.argv[4])\nif flag:\n plt.ylim(0,0.005)\nxs = []\nys = []\nwith open(file) as f:\n for line in f.readlines():\n try:\n li...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "pandas.DataFrame" ] ]
ustcsky/recommenders
[ "64f0dd4653cf7f1d687c45c61807841415e111c7" ]
[ "NewsRecommendation/src/model/TANR/news_encoder.py" ]
[ "import torch\nimport torch.nn as nn\nfrom model.TANR.attention import Attention\n\nclass NewsEncoder(torch.nn.Module):\n def __init__(self, args, word_embedding):\n super(NewsEncoder, self).__init__()\n self.args = args\n # title\n if word_embedding is None:\n self.word_em...
[ [ "torch.nn.Dropout", "torch.nn.Embedding.from_pretrained", "torch.stack", "torch.nn.Sequential", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.Embedding" ] ]
aaronhallaert/RIFE-Interpolation-Attack
[ "d90162fe1fc00357ff53753a1580c8b1b31b407c" ]
[ "model/IFNet_HDv2.py" ]
[ "import torch\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom model.warplayer import warp\n\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\ndef conv_wo_act(in_planes, out_planes, kernel_size=3, stride=1, padding=1, dilation=1):\n return nn.Sequent...
[ [ "torch.zeros", "numpy.random.normal", "torch.cat", "torch.nn.functional.interpolate", "torch.nn.ConvTranspose2d", "torch.nn.Conv2d", "torch.cuda.is_available", "torch.nn.PReLU" ] ]
fionanealon/iris-data-set-project
[ "c6d586126f32f6486ba5372108df9a85684c6cf3" ]
[ "average.py" ]
[ "# Fiona Nealon, 2018-04-19\r\n# Iris data set analysis\r\n# Calculate the mean of each column.\r\n\r\n# Use numpy library to analyse Iris file\r\nimport numpy\r\n\r\n# Read csv file into python using numpy\r\ndata = numpy.genfromtxt('data/iris.csv', delimiter=',')\r\n\r\n# Select all values in first column of nump...
[ [ "numpy.genfromtxt", "numpy.mean" ] ]