repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
generem/generem
[ "b77387d33d177a3cc79742f873a73b636024fe38" ]
[ "genEM3/inference/prediction_modifier.py" ]
[ "import os\nfrom scipy import stats, ndimage\nimport numpy as np\nfrom genEM3.data.wkwdata import WkwData\n\nFILTER_KERNELS = {\n '3d_gauss_sandwich_9': np.array([\n [[-0.025, -0.05, -0.025],\n [-0.05, -0.2, -0.05],\n [-0.025, -0.05, -0.025]],\n [[0.125, 0.25, 0.125],\n [0.2...
[ [ "numpy.array", "numpy.isnan", "scipy.ndimage.filters.convolve", "scipy.stats.rankdata", "numpy.expand_dims" ] ]
Uttam580/Traffic_Signal_Detection
[ "855948941b009f9a88cbcbf4f2c45c9e426808ee" ]
[ "gputest.py" ]
[ "# this script is for testing for gpu\nimport tensorflow as tf \nfrom tensorflow.python.client import device_lib\nprint(tf.test.is_built_with_cuda())\nprint(device_lib.list_local_devices())\nprint(tf.config.experimental.list_physical_devices('GPU'))\n \n" ]
[ [ "tensorflow.python.client.device_lib.list_local_devices", "tensorflow.config.experimental.list_physical_devices", "tensorflow.test.is_built_with_cuda" ] ]
foamliu/i-Cloud
[ "c5eb0a22c1c0c78d5195d4f62237fd6c2b5e6a32" ]
[ "utils/match.py" ]
[ "import math\nimport os\nimport pickle\nimport time\n\nimport cv2 as cv\nimport numpy as np\nimport torch\nfrom PIL import Image\nfrom flask import request\nfrom scipy.stats import norm\nfrom torchvision import transforms\nfrom werkzeug.utils import secure_filename\n\nimport ps_demo as ps\nfrom config import device...
[ [ "torch.zeros", "scipy.stats.norm.pdf", "numpy.dot", "numpy.empty", "numpy.linalg.norm", "torch.no_grad", "numpy.argmax", "torch.load", "numpy.clip" ] ]
laihuihui/htc
[ "8467b567ccace5f2e81a3bdf0f68bca97a63376e" ]
[ "ppdet/data/transform/operators.py" ]
[ "# Copyright (c) 2020 PaddlePaddle 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 re...
[ [ "numpy.dot", "numpy.ones_like", "numpy.random.rand", "numpy.minimum", "numpy.min", "numpy.where", "numpy.cos", "numpy.frombuffer", "numpy.concatenate", "numpy.random.normal", "numpy.sin", "numpy.max", "numpy.full", "numpy.logical_and", "numpy.take", ...
Samanwaya1301/bilby-BHNS
[ "5670212daf48e5c54c26e1978f3e0ff66c5c3f83", "5670212daf48e5c54c26e1978f3e0ff66c5c3f83" ]
[ "bilby/gw/sampler/proposal.py", "examples/core_examples/15d_gaussian.py" ]
[ "import random\n\nimport numpy as np\n\nfrom ...core.sampler.proposal import JumpProposal\n\n\nclass SkyLocationWanderJump(JumpProposal):\n \"\"\"\n Jump proposal for wandering over the sky location. Does a Gaussian step in\n RA and DEC depending on the temperature.\n \"\"\"\n\n def __call__(self, sa...
[ [ "numpy.sqrt" ], [ "numpy.array", "numpy.zeros", "numpy.where", "numpy.std", "numpy.diag" ] ]
CharlieZhuGJ/pytorch_applications
[ "f76644ac85a9632a756e0516596a02cf0ef70b16" ]
[ "src/dnn/conv_gan.py" ]
[ "__author__ = 'ShelockLiao'\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader\nfrom torchvision import transforms\nfrom torchvision import datasets\nfrom torchvision.utils import save_image\nimport os\n\nif not os.path.exists('./dc_img'):\n os.mk...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Sigmoid", "torch.autograd.Variable", "torch.nn.AvgPool2d", "torch.nn.LeakyReLU", "torch.nn.BatchNorm2d", "torch.nn.Tanh", "torch.ones", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.utils.data.DataLoader", "torch.nn.BCELo...
565353780/py-faster-rcnn
[ "8e373ade70a1c196fb738d80966a6968ff889887" ]
[ "lib/utils/timer.py" ]
[ "# --------------------------------------------------------\r\n# Fast R-CNN\r\n# Copyright (c) 2015 Microsoft\r\n# Licensed under The MIT License [see LICENSE for details]\r\n# Written by Ross Girshick\r\n# --------------------------------------------------------\r\n\r\nimport time\r\nimport torch\r\n\r\n\r\nclass ...
[ [ "torch.cuda.is_available", "torch.cuda.synchronize" ] ]
tblume1992/ThymeBoost_v0
[ "403409c83316736db6c09741834b791076218a71" ]
[ "ThymeBoost/utils/trend_dampen.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport pandas as pd\n\n\ndef trend_dampen(damp_fact, trend):\n zeroed_trend = trend - trend[0]\n damp_fact = 1 - damp_fact\n if damp_fact < 0:\n damp_fact = 0\n if damp_fact > 1:\n damp_fact = 1\n if damp_fact == 1:\n dampened_trend...
[ [ "numpy.gradient", "pandas.Series" ] ]
Duyang56/SliceGAN
[ "0de8eccc310ed5e9e17b31b5cc4fabcbcac8886b" ]
[ "slicegan/model.py" ]
[ "from slicegan import preprocessing, util\nimport torch\nimport torch.nn as nn\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport time\nimport matplotlib\n\ndef train(pth, imtype, datatype, real_data, Disc, Gen, nc, l, nz, sf):\n \"\"\"\n train the generator\n :param pth: path to sa...
[ [ "matplotlib.use", "torch.no_grad", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.randn" ] ]
RichterLab/LCS-VAE
[ "6cbc33d2f668e5e87ce2464b6d4a7b9a97bb6a4f" ]
[ "analysis2.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Jun 27 14:21:31 2020\n\n@author: theomacmillan\n\"\"\"\n\n#%%\n\nimport torch\nimport numpy as np\nfrom models import AE\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nfrom utils import trajectory_jet\nfrom mpl_toolkits.mplot3d ...
[ [ "numpy.max", "matplotlib.pyplot.colorbar", "numpy.savetxt", "numpy.reshape", "numpy.empty", "numpy.squeeze", "matplotlib.pyplot.pcolor", "matplotlib.pyplot.plot", "torch.Tensor", "matplotlib.pyplot.subplots", "numpy.transpose", "torch.load", "numpy.linspace", ...
winnerineast/taichi
[ "641c4b83bcf98e7354b135964cd23759b0110c6b" ]
[ "examples/renderer.py" ]
[ "import taichi as ti\nimport os\nimport numpy as np\nimport cv2\nimport math\nimport time\nimport random\nfrom renderer_utils import out_dir, ray_aabb_intersection, inf, eps, \\\n intersect_sphere, sphere_aabb_intersect_motion, inside_taichi\nimport sys\n\nres = 1280, 720\nnum_spheres = 1024\ncolor_buffer = ti.Vec...
[ [ "numpy.sqrt", "numpy.zeros" ] ]
bensloane/python-dlpy
[ "ff724c01800e7774100572386309c262aa90d4bb" ]
[ "dlpy/network.py" ]
[ "#!/usr/bin/env python\n# encoding: utf-8\n#\n# Copyright SAS Institute\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# U...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.concat" ] ]
fendouai/2018_mldm-deep_metric_learing
[ "57e71f3d3d4c16833351d438f0c1e96387fe7587" ]
[ "experiment/imports.py" ]
[ "import tensorflow as tf\nassert tf.__version__.startswith(\"1.4\") # the version we used\nimport numpy as np\nimport logging\n\nimport os\nfrom os.path import join as jp\nimport library.helpers as h\nimport library.tensorflow_helpers as tfh\nimport time\nfrom library.vocabulary import *\nfrom tensorflow.contrib.te...
[ [ "matplotlib.use", "tensorflow.__version__.startswith" ] ]
wumouyan/GNSS-SDR-Python
[ "61292c2ba151724538808663e2a6d0b048635401", "61292c2ba151724538808663e2a6d0b048635401" ]
[ "acquire-glonass-l1.py", "gnsstools/beidou/b2ad.py" ]
[ "#!/usr/bin/env python\n\nimport optparse\n\nimport numpy as np\nimport scipy.signal\nimport scipy.fftpack as fft\n\nimport gnsstools.glonass.ca as ca\nimport gnsstools.nco as nco\nimport gnsstools.io as io\nimport gnsstools.util as util\n\n#\n# Acquisition search\n#\n\ndef search(x,chan,doppler_search,ms):\n fs =...
[ [ "numpy.zeros", "numpy.real", "scipy.fftpack.fft", "numpy.arange", "numpy.argmax", "numpy.absolute", "numpy.imag" ], [ "numpy.array", "numpy.zeros", "numpy.arange", "numpy.mod", "numpy.floor" ] ]
Vipendra-pal-rajput/Text-and-image-detection-using-YoloV3
[ "1cc6cfb8886dd89c3a9a9edebf34b6750f02aab0" ]
[ "3_Inference/Detector.py" ]
[ "import os\nimport sys\n\n\ndef get_parent_dir(n=1):\n \"\"\"returns the n-th parent dicrectory of the current\n working directory\"\"\"\n current_path = os.path.dirname(os.path.abspath(__file__))\n for _ in range(n):\n current_path = os.path.dirname(current_path)\n return current_path\n\n\nsr...
[ [ "pandas.DataFrame", "numpy.array" ] ]
aureliancnx/vaccintracker
[ "1a4cc28b78aa50da6ef679ef40f82a6297574dbd" ]
[ "scripts/livraisons.py" ]
[ "import json\nimport pandas as pd\nimport requests\nimport numpy as np\n\n## FRANCE\ndef download_data():\n #Flux a\n url = \"https://www.data.gouv.fr/fr/datasets/r/6c39a8be-cd65-465a-a656-f8c645c839ac\"\n data = requests.get(url)\n\n with open('data/input/flux-a-pfizer-nat.csv', 'wb') as f:\n f.write(...
[ [ "pandas.read_csv" ] ]
echelon/Voice_Converter_CycleGAN
[ "e4fff957f4dab9a9993d65f4ea880752020290eb" ]
[ "demo_chunking_server.py" ]
[ "#!/usr/bin/env python3\n\n\"\"\"\nStarts a demo HTTP server to capture and transform audio\nas a live demonstration of the trained model.\n\nAs an experiment, this version attempts to break the audio\ninto a stream of chunks and evaluate each one independently\nof one another.\n\nBrandon Thomas 2019-07-29 <bt@bran...
[ [ "numpy.concatenate", "numpy.array", "numpy.ascontiguousarray", "numpy.copy", "numpy.tile" ] ]
MaryumSayeed/TheSwan
[ "3e186e15acb41faec7dd508d8a8cd250659eba9c" ]
[ "code/melissa_cannon_og_testing.py" ]
[ "\"\"\" This file is part of The Cannon analysis project.\nCopyright 2014 Melissa Ness.\n# NOTE THE ISSUE MAY BE THE Fe_H SCALE THIS IS DIFFERENT IN THE UNFILTERED VERSIONA\n# TO DO - CHECK THE UNFILTERED VERSION WITH THE 5 LABELS HERE GIVES THE SAME RESULTS \n# urls\n- http://iopscience.iop.org/1538-3881/146/5/133...
[ [ "numpy.polynomial.chebyshev.Chebyshev.fit", "numpy.dot", "numpy.argmin", "numpy.exp", "numpy.where", "numpy.cumsum", "numpy.outer", "numpy.zeros_like", "numpy.log", "numpy.logical_and", "numpy.arange", "numpy.polyfit", "numpy.sqrt", "numpy.poly1d", "nump...
marinakiseleva/thex_model
[ "9d498b697b7c4b03e1db31cae4d7a469311229f7" ]
[ "models/ind_model/ind_model.py" ]
[ "\"\"\"\nIndependent Model\n\nEnsemble of binary classifiers with resulting probabilities normalized across all classes. Assumes all classes are independent and are not related by any class hierarchy.\n\n\"\"\"\n\nimport numpy as np\nfrom mainmodel.mainmodel import MainModel\nfrom classifiers.binary.optbinary impor...
[ [ "numpy.array", "numpy.copy", "numpy.isnan" ] ]
Pranav-Goel/Naive_IR_Baseline_qanta
[ "c220ae153fcef34895e5d88d3afade2ebdd851a2" ]
[ "evaluate.py" ]
[ "import os\nimport json\nimport time\nimport click\nimport pickle\nimport signal\nimport requests\nimport subprocess\nimport numpy as np\nimport logging\nimport socket\nimport errno\nfrom tqdm import tqdm\n\n\n\nelog = logging.getLogger('eval')\nformatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s ...
[ [ "numpy.asarray" ] ]
kazushi-fa/RotationDetection
[ "79c3b51822aa8aeed3fbf68a58c8802fc3fe12bb" ]
[ "tools/fcos/train_batch_quad.py" ]
[ "# -*- coding:utf-8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport os\nimport sys\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\nimport numpy as np\nimport cv2\nsys.path.append(\"../../\")\n\nfrom tools.train_base im...
[ [ "tensorflow.constant_initializer", "tensorflow.reshape", "tensorflow.cast", "tensorflow.add_n", "tensorflow.constant", "tensorflow.contrib.slim.learning.clip_gradient_norms", "tensorflow.get_variable_scope", "tensorflow.get_collection", "tensorflow.summary.scalar", "tensorf...
evanweissburg/judging-a-book
[ "b273988485047e1496387e91529ed25b6688b88f" ]
[ "src/figures/attention_directed_graph.py" ]
[ "import heapq\nimport pathlib\nimport pickle\nimport string\nfrom collections import defaultdict\nfrom typing import List, Tuple\n\nimport click\nimport matplotlib.pyplot as plt\nimport networkx as nx\nimport numpy as np\nimport torch\nfrom pydantic import BaseModel\nfrom spacy.lang.en.stop_words import STOP_WORDS\...
[ [ "matplotlib.pyplot.savefig", "numpy.array", "torch.no_grad", "matplotlib.pyplot.figure" ] ]
Justin-Yuan/mpe_hierarchy
[ "6eda6a189511edfb2dad22d867f53b3402666d9a" ]
[ "multiagent/scenarios/simple_spread.py" ]
[ "import numpy as np\nfrom multiagent.core import World, SkilledAgent, Landmark\nfrom multiagent.scenario import BaseScenario\nfrom multiagent.utils import bound_reward, ObsDecorator\n\n\nclass Scenario(BaseScenario):\n def make_world(self, **kwargs):\n self.before_make_world(**kwargs)\n\n world = W...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.square" ] ]
agerasimenkoz/semantic_similarity_ru
[ "eee43d678f67f6969678b75db41e56d9ea361a74" ]
[ "app/similarity/similarity_class.py" ]
[ "from transformers import AutoModel, AutoTokenizer\nimport numpy as np\nimport torch\n\n\nclass BertSimilarity:\n def __init__(self):\n # self.model_name_or_path = \"DeepPavlov/rubert-base-cased-sentence\"\n self.model_name_or_path = \"/rubert\"\n self.device = \"cuda:0\" if torch.cuda.is_av...
[ [ "numpy.array", "torch.cuda.is_available", "torch.sum" ] ]
tyleracorn/covid_alberta
[ "9ffd77c638728808d99be4a8f44bdcb5cf65b28c" ]
[ "covid_alberta/analysis.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: 01_analysis.ipynb (unless otherwise specified).\n\n__all__ = ['calculate_doublingtimes']\n\n# Cell\nimport pandas as pd\nimport numpy as np\n\n# Cell\ndef calculate_doublingtimes(df:pd.DataFrame, col_suffix:str='cumCases',\n median_incubation_p...
[ [ "pandas.DataFrame", "numpy.ceil", "numpy.log" ] ]
burakcuhadar/NeuralRecon
[ "e576aa2571dbf229a1b8a9e26ce539d4c32b1cb8" ]
[ "ops/back_project.py" ]
[ "import torch\nfrom torch.nn.functional import grid_sample\nimport math\n\ndef back_project(coords, origin, voxel_size, feats, KRcam, use_sparse_method1=False, depth_im=None):\n '''\n Unproject the image fetures to form a 3D (sparse) feature volume\n\n :param coords: coordinates of voxels,\n dim: (num o...
[ [ "torch.zeros", "torch.nonzero", "torch.cat", "torch.stack", "torch.arange", "torch.norm", "torch.argmin", "torch.ones", "torch.abs", "torch.nn.functional.grid_sample" ] ]
mingruimingrui/laser-keep-alive
[ "9f06ec825d7a8aadf46f1f1c96dae2537b101b17" ]
[ "laser/encoder.py" ]
[ "# Copyright (c) 2020 mingruimingrui\n# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the MIT-style license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"LASER LSTM sequence encoder\"\"\"\n\nimport torch\nfrom tor...
[ [ "torch.nn.LSTM", "torch.nn.utils.rnn.pad_packed_sequence", "torch.nn.utils.rnn.pack_padded_sequence", "torch.load", "torch.nn.Embedding" ] ]
JRC1995/CapsuleRoutingEncoders
[ "a99c666f33a2ea98f60b944df19d699ee3f3b009" ]
[ "models/modules/dynamic_routing.py" ]
[ "import torch as T\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport numpy as np\nimport math\n\n\nclass routing(nn.Module):\n def __init__(self, D, n_in, n_out, in_dim, out_dim, device):\n super(routing, self).__init__()\n\n self.D = D\n self.in_di...
[ [ "torch.zeros", "torch.cat", "torch.einsum", "torch.nn.init.xavier_uniform_", "torch.nn.functional.softmax", "torch.matmul", "torch.randn", "torch.sum" ] ]
rashid-islam/Differential_Fairness
[ "1e90232fdb688a538bb534319ff3c9a7e0dee576" ]
[ "learning-algorithm-batch/DNN_model.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Mar 9 16:00:04 2020\n\n@author: islam\n\"\"\"\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.autograd import Variable\nfrom DF_Training import computeBatchCounts, fairness_loss, sf_loss, prule_loss\n\nfrom fairnes...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.Sigmoid", "torch.nn.ReLU", "torch.nn.BCELoss" ] ]
arsalan0004/6DRepNet
[ "aa28f95516cacb1cac31313b981b9fd3f51f5c28" ]
[ "model.py" ]
[ "import torch\nfrom torch import nn\nimport torch.nn.functional as F\nimport math\nfrom backbone.repvgg import get_RepVGG_func_by_name\nimport utils\n\nclass SixDRepNet(nn.Module):\n def __init__(self,\n backbone_name, backbone_file, deploy,\n bins=(1, 2, 3, 6),\n ...
[ [ "torch.nn.Linear", "torch.flatten", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.load", "torch.nn.AdaptiveAvgPool2d" ] ]
frk2/opencaret
[ "35be29ff2a6c546e71c4bb3bf76c1bc32b567a86" ]
[ "ros/src/perception/src/perception/loadData.py" ]
[ "import numpy as np\nimport cv2\nimport pickle\n\n__author__ = \"Sachin Mehta\"\n\nclass LoadData:\n '''\n Class to laod the data\n '''\n def __init__(self, data_dir, classes, cached_data_file, normVal=1.10):\n '''\n :param data_dir: directory where the dataset is kept\n :param clas...
[ [ "numpy.histogram", "numpy.log", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.mean", "numpy.std", "numpy.unique" ] ]
ardayigit/acados
[ "131e6d1167cc69ae848751402d10663bd3bea4e7" ]
[ "interfaces/acados_template/acados_template/acados_sim_solver.py" ]
[ "# -*- coding: future_fstrings -*-\n#\n# Copyright 2019 Gianluca Frison, Dimitris Kouzoupis, Robin Verschueren,\n# Andrea Zanelli, Niels van Duijkeren, Jonathan Frey, Tommaso Sartor,\n# Branimir Novoselnik, Rien Quirynen, Rezart Qelibari, Dang Doan,\n# Jonas Koenemann, Yutao Chen, Tobias Schöls, Jonas Schlagenhauf,...
[ [ "numpy.array", "numpy.zeros" ] ]
codetyphon/AnimeGAN-web
[ "6a49296cc039bd86d133a8d023ad94199c19ed2b" ]
[ "testcpu.py" ]
[ "import os\nimport argparse\nimport gc\nfrom PIL import Image\nimport numpy as np\n\nimport torch\nfrom torchvision.transforms.functional import to_tensor, to_pil_image\n\nfrom model import Generator\n\n\ngc.collect()\n\n\ntorch.backends.cudnn.enabled = False\ntorch.backends.cudnn.benchmark = False\ntorch.backends....
[ [ "torch.no_grad", "torch.load" ] ]
sudojarvis/arviz
[ "73531be4f23df7d764b2e3bec8c5ef5cb882590d", "73531be4f23df7d764b2e3bec8c5ef5cb882590d" ]
[ "arviz/plots/backends/matplotlib/distplot.py", "arviz/plots/backends/matplotlib/posteriorplot.py" ]
[ "\"\"\"Matplotlib distplot.\"\"\"\nimport matplotlib.pyplot as plt\nfrom matplotlib import _pylab_helpers\nimport numpy as np\n\nfrom ....stats.density_utils import get_bins\nfrom ...kdeplot import plot_kde\nfrom ...plot_utils import _scale_fig_size\nfrom . import backend_kwarg_defaults, backend_show, create_axes_g...
[ [ "matplotlib._pylab_helpers.Gcf.get_active", "matplotlib.pyplot.show", "numpy.deg2rad", "numpy.asarray" ], [ "matplotlib.pyplot.show", "numpy.ravel", "numpy.atleast_2d" ] ]
devitocodes/daks
[ "45ee97727c6024b48844a2c66b602d9897f212d1" ]
[ "fwi/overthrust.py" ]
[ "import numpy as np\nimport h5py\n\nfrom examples.seismic import AcquisitionGeometry, Model\nfrom examples.seismic.acoustic import AcousticWaveSolver\n\nfrom fwi.azureio import load_blob_to_hdf5\nfrom fwi.io import Blob\nfrom fwi.solvers import DensityWaveSolver, DensityModel\n\n\ndef overthrust_solver_iso(h5_file,...
[ [ "numpy.array", "numpy.ones", "numpy.transpose", "numpy.sqrt", "numpy.linspace", "numpy.expand_dims" ] ]
PierreSanson/centrale
[ "45bf1944c46f22f21b018bd19d8c3b504548d25f" ]
[ "backend/suggestion/algo_genre.py" ]
[ "import numpy as np\nfrom get_dictionaries import *\nimport pandas as pd\n\ndef meilleur_score(d,n):\n liste=[]\n new_d={}\n for k, v in sorted(d.items(), key=lambda x: x[1]):\n liste.append([k,v])\n liste.reverse()\n for i in range(n):\n new_d[liste[i][0]]=liste[i][1]\n return new_d...
[ [ "pandas.DataFrame" ] ]
rronan/flownet2-pytorch
[ "a11f550ff41b0fa8804a0369fd6413ec05b7eb96" ]
[ "datasets.py" ]
[ "import torch\nimport torch.utils.data as data\n\nimport os, math, random\nfrom os.path import *\nimport numpy as np\n\nfrom glob import glob\nimport utils.frame_utils as frame_utils\n\nfrom scipy.misc import imread, imresize\n\nclass StaticRandomCrop(object):\n def __init__(self, image_size, crop_size):\n ...
[ [ "numpy.array", "scipy.misc.imresize" ] ]
dlobelle/Local_postpro
[ "de8319e854fd3a014cfc52642cb12d165e80b8ac" ]
[ "Kooi_github/scripts/post-process_plots/plot_NPac3yrs_Ts_2004_allsizes.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Oct 1 09:46:24 2020\n\n@author: Lobel001\n\"\"\"\n\n# Adapted from plot_Ts_Vs_2004_allsizes.py but only for particles released in N Pacific and run for 3 yrs\n\nimport matplotlib.pyplot as plt\nfrom netCDF4 import Dataset\nimport numpy as np ...
[ [ "matplotlib.pyplot.colorbar", "numpy.zeros", "matplotlib.pyplot.close", "numpy.seterr", "matplotlib.pyplot.rc", "matplotlib.pyplot.figure", "numpy.where", "numpy.arange", "matplotlib.pyplot.cm.get_cmap" ] ]
tateobori/AD-peps
[ "ab93b8a69f280e1fa6012ef0c09595b7c237b134" ]
[ "optim/sgd_modified.py" ]
[ "import torch\nfrom math import sqrt\nfrom functools import reduce\nfrom torch.optim.sgd import SGD\nimport logging\nlog = logging.getLogger(__name__)\n\n# from https://github.com/scipy/scipy/blob/master/scipy/optimize/linesearch.py\ndef _scalar_search_armijo(phi, phi0, derphi0, args=(), c1=1e-4, alpha0=1, amin=1.0...
[ [ "torch.no_grad", "torch.cat", "torch.clone", "torch.enable_grad" ] ]
murray91/mikeio
[ "82760a899f4294bdddab6a0eb18f34b0754b21e0" ]
[ "tests/test_dfsu_plot.py" ]
[ "import os\nimport numpy as np\nimport pytest\nimport matplotlib as mpl\n\nmpl.use(\"Agg\")\nfrom mikeio import Dfsu, Mesh\n\n##################################################\n# these tests will not run if matplotlib is not installed\n##################################################\npytest.importorskip(\"matpl...
[ [ "matplotlib.use", "numpy.arange", "matplotlib.pyplot.subplots" ] ]
SilverQ/Multi-Label-Text-Classification-master
[ "eb9ff3aca793915a35f1145245c73da2fb98dc86" ]
[ "CRNN/train_crnn.py" ]
[ "# -*- coding:utf-8 -*-\n__author__ = 'Randolph'\n\nimport os\nimport sys\nimport time\nimport logging\nimport numpy as np\nimport tensorflow as tf\n\nfrom tensorboard.plugins import projector\nfrom text_crnn import TextCRNN\nfrom utils import checkmate as cm\nfrom utils import data_helpers as dh\nfrom sklearn.metr...
[ [ "tensorflow.flags.DEFINE_integer", "tensorflow.local_variables_initializer", "tensorflow.global_variables_initializer", "tensorflow.flags.DEFINE_string", "tensorflow.train.latest_checkpoint", "tensorflow.train.global_step", "tensorflow.global_variables", "tensorflow.flags.DEFINE_fl...
sukjunhwang/IFC
[ "fb2ee4571dba4700eab3b52f10e147225b763e2a" ]
[ "projects/IFC/demo/clip/visualizer.py" ]
[ "import torch\nimport numpy as np\n\nfrom detectron2.utils.colormap import random_color\nfrom detectron2.utils.visualizer import ColorMode, GenericMask, Visualizer, _create_text_labels\n\n\n_SMALL_OBJECT_AREA_THRESH = 1000\n_LARGE_MASK_AREA_THRESH = 120000\n_OFF_WHITE = (1.0, 1.0, 240.0 / 255)\n_BLACK = (0, 0, 0)\n...
[ [ "numpy.array", "numpy.clip", "numpy.asarray", "numpy.zeros", "numpy.prod", "numpy.argsort", "numpy.sqrt" ] ]
anmol1455/python
[ "8e3858bdebb21ec3c9e8147ceef17a82b4a36926" ]
[ "plot4.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\ncourse=np.array(['c','c++','java','python'])\ngirl=np.array([40,50,45,20])\nboy=np.array([45,43,37,50])\nfig=plt.figure()\nax=fig.add_axes([0.1,0.1,0.5,0.5])\nax.bar(course,girl,color='red',width=.30)\nax.bar(course,boy,color='yellow',bottom=girl,width=.30)\nax....
[ [ "matplotlib.pyplot.show", "numpy.array", "matplotlib.pyplot.figure" ] ]
spasmann/1DQMC
[ "f56483428f03c63d06c16b7fd7f56231296dd940" ]
[ "src/functions/samples.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport math\nfrom scipy.stats.qmc import Sobol, Halton, LatinHypercube\nfrom src.functions.particle import Particle\nfrom src.functions.moment_matching import shift_samples\n\nclass Samples:\n \"\"\"\n Class for generating list of Particles given various initial...
[ [ "numpy.array", "numpy.zeros", "numpy.random.seed", "scipy.stats.qmc.Sobol", "scipy.stats.qmc.LatinHypercube", "numpy.random.uniform", "scipy.stats.qmc.Halton", "numpy.abs", "numpy.sqrt" ] ]
skosukhin/yago
[ "c11a2de369e2099415111aa3e0dfb09bf758bbce" ]
[ "lib/cmd/gengrid.py" ]
[ "\"\"\"\nExample parameters:\nCommon:\n--x-start=-2695000.0\n--x-count=386\n--x-step=14000.0\n--y-start=-2331000.0\n--y-count=334\n--y-step=14000.0\n--orig-lat=88.9899731326\n--orig-lon=-129.805571092\n--adjust-angle=-39.805571092\n\nFor Polar stereographic:\n--proj-name=stereo\n--true-scale-lats=71.6577131288\n\nF...
[ [ "numpy.float64", "numpy.ones", "numpy.arctan2", "numpy.zeros" ] ]
Daweek/Edgar-pytorch-image-models
[ "ca3398c64a8fb8b2e01f7057679440ff6a6c6672" ]
[ "finetune_with_separate.py" ]
[ "#!/usr/bin/env python3\n\"\"\" ImageNet Training Script\n\nThis is intended to be a lean and easily modifiable ImageNet training script that reproduces ImageNet\ntraining results with some of the latest networks and training techniques. It favours canonical PyTorch\nand standard Python style over trying to be able...
[ [ "torch.cuda.synchronize", "torch.nn.SyncBatchNorm.convert_sync_batchnorm", "torch.distributed.init_process_group", "torch.no_grad", "torch.nn.parallel.DistributedDataParallel", "torch.cuda.device_count", "torch.cuda.set_device", "torch.nn.BCEWithLogitsLoss", "torch.jit.script",...
DavidKo3/mctorch
[ "53ffe61763059677978b4592c8b2153b0c15428f" ]
[ "torch/distributions/transformed_distribution.py" ]
[ "import torch\nfrom torch.distributions import constraints\nfrom torch.distributions.distribution import Distribution\nfrom torch.distributions.transforms import Transform\nfrom torch.distributions.utils import _sum_rightmost\n\n\nclass TransformedDistribution(Distribution):\n r\"\"\"\n Extension of the Distr...
[ [ "torch.Size", "torch.no_grad" ] ]
unpilbaek/OpenFermion-Cirq
[ "d2f5a871bb5aea1e53d280c0a0e4be999b0c8d9d" ]
[ "openfermioncirq/gates/common_gates.py" ]
[ "# 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 to in writing, software...
[ [ "numpy.array", "numpy.diag" ] ]
google-research/jax3d
[ "f08ae174c80cd6c597f8fe5417168c82857eb236" ]
[ "jax3d/projects/nesf/utils/shape_utils.py" ]
[ "# Copyright 2022 The jax3d 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 law or ...
[ [ "tensorflow.TensorSpec", "tensorflow.data.Dataset.range", "numpy.dtype", "tensorflow.nest.map_structure" ] ]
deepmind/ithaca
[ "3911440932f2e501d1920c6cc430d94299116253" ]
[ "ithaca/models/common_layers.py" ]
[ "# Copyright 2021 the Ithaca 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or...
[ [ "numpy.array", "numpy.sin", "numpy.zeros", "numpy.log", "numpy.arange", "numpy.cos", "numpy.repeat" ] ]
willrogers/aapy
[ "cea4cb490571bc61668af01b7ac852e20f4446fc" ]
[ "tests/test_js.py" ]
[ "import json\nfrom datetime import datetime\n\nimport jsonschema\nimport mock\nimport numpy\nimport pytest\nimport utils\n\nfrom aa import js\n\nEARLY_DATE = datetime(2001, 1, 1, 1, 1)\nLATE_DATE = datetime(2010, 2, 3, 4, 5)\nEMPTY_ARRAY = numpy.array((0,))\n\n\n@pytest.fixture\ndef json_fetcher():\n return js.J...
[ [ "numpy.array" ] ]
BoyuanChen/visual_behavior_modeling
[ "8b6eb0516c562306c5d775632223ad0de775f170" ]
[ "evaluation/bezier3.py" ]
[ "\nimport os\nimport cv2\nimport sys\nimport shutil\nimport imutils\nimport numpy as np\nfrom PIL import Image\nfrom tqdm import tqdm\n\ndef mkdir(folder):\n if os.path.exists(folder):\n shutil.rmtree(folder)\n os.makedirs(folder)\n\n\ntest_results_folder = './test_results'\nexample_measure_imgs_path =...
[ [ "numpy.concatenate", "numpy.array", "numpy.load", "numpy.transpose" ] ]
kusumikakd/Real_time_seizurecast
[ "e7c186d8116d16d6a03bb42e943c3af86b489d81", "e7c186d8116d16d6a03bb42e943c3af86b489d81" ]
[ "test/test_nedc_pystream.py", "seizurecast/utils.py" ]
[ "import os\nfrom seizurecast.data.tu_pystream import nedc_pystream as ps\nimport numpy.testing as testing\n\n\ndef test_nedc_load_parameters_lbl():\n train_path = '../tusz_1_5_2/edf/train'\n tcp_type = '01_tcp_ar'\n patient_group = '023'\n patient = '00002348'\n session = 's008_2015_07_21'\n token...
[ [ "numpy.testing.assert_array_equal" ], [ "numpy.repeat", "numpy.array", "numpy.arange", "numpy.shape" ] ]
marcowurth/flc_atacama
[ "7890db9426af176e5155063f0d861cc834a88ecd" ]
[ "scripts/general/image_enhancement_algorithms.py" ]
[ "\n########################################################################################################################\n### ###\n### This module uses a width of max. 120 characters ...
[ [ "numpy.zeros_like", "numpy.ones_like", "numpy.array", "numpy.where", "numpy.deg2rad" ] ]
alexander-maier/pylife
[ "a9dceb3f364af16bf0a2d3015e34fa47192bfcf6" ]
[ "src/pylife/stress/timesignal.py" ]
[ "# Copyright (c) 2019-2021 - for information on the respective copyright owner\n# see the NOTICE file and/or the repository\n# https://github.com/boschresearch/pylife\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 ma...
[ [ "numpy.max", "numpy.sin", "scipy.stats.norm.rvs", "numpy.random.rand", "numpy.asarray", "numpy.zeros", "pandas.DataFrame", "scipy.signal.butter", "numpy.interp", "numpy.mean", "numpy.min", "scipy.signal.filtfilt", "numpy.arange", "numpy.abs", "numpy.lins...
manoj7410/trackerSortAndMediaPipe
[ "7e0c5faabfdd0929cf0e02c8baff1e8eeddc38ca" ]
[ "detectionTracker/examples/tracker_package/object_tracking/camshift_object_tracker.py" ]
[ "# Lint as: python3\n# Copyright 2020 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...
[ [ "numpy.array", "numpy.float32", "numpy.zeros" ] ]
Juan7655/whatsapp_chat_analyzer
[ "6baa39f87c81f6d391ab607f89317e36acd1af1c" ]
[ "analyzer.py" ]
[ "import matplotlib.pyplot as plt\nimport datetime\nimport pandas as pd\n\ndate_config = '%m/%d/%y'\n# separation character\nstart_line = \"//-\"\n# if the lines contains any word on this list, they will be omitted\nforbidden_keywords = [\"added\", \"left\", \"changed\", \"created\", \"removed\", \"Creaste\", \"Añad...
[ [ "pandas.to_datetime", "matplotlib.pyplot.xlabel", "pandas.DataFrame", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.bar" ] ]
FengJunJian/ssl_detection
[ "cf0b28c8f5863be4f6f2b6c4493092e7d49ead69" ]
[ "pb2onnx.py" ]
[ "import tensorflow as tf\nimport os\nimport cv2\n# tf.python.gfile.GFile\nmodel_name='detection/model.pb'\nf=tf.python.gfile.FastGFile(model_name,'rb')#['image'] ['output/boxes', 'output/scores', 'output/labels']\n# a=tf.compat.v1.GraphDef()\ngraph_def=tf.GraphDef()\nprint(graph_def)\ngraph_def.ParseFromString(f.re...
[ [ "tensorflow.get_default_graph", "tensorflow.GraphDef", "tensorflow.Session", "tensorflow.import_graph_def", "tensorflow.python.gfile.FastGFile" ] ]
nikita5494/COVID19-Enterprise-Data-Science
[ "2a0cadd15573346c3cc9f468a9b311b084539f10" ]
[ "src/visualization/visualization_combined.py" ]
[ "import pandas as pd\nimport numpy as np\nimport plotly.graph_objects as go\nimport dash\ndash.__version__\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input,Output\nimport dash_bootstrap_components as dbc\nimport plotly.io as pio\n\nimport os\nprint(os.get...
[ [ "numpy.array", "pandas.read_csv", "numpy.linspace", "pandas.DataFrame" ] ]
acaciawater/rapid
[ "8842885a702fcd2b4dcf2c95a7138c266891b52e" ]
[ "ogc/models/legend.py" ]
[ "from django.db import models\nfrom django.utils.translation import gettext_lazy as _\nfrom colorsys import hsv_to_rgb\nfrom ogc.models.layer import Layer\nimport json\nimport pandas as pd\n\ndef hsv2hex(h,s=1,v=1):\n h = 0.6667 * (1.0 - h) # reverse colors and clip at 245 degrees (blue)\n r,g,b = map(lambda ...
[ [ "pandas.isnull", "pandas.api.types.is_numeric_dtype" ] ]
vincentcheny/distributed-bert
[ "e8b20be5063999f27f3bffec8acec4807d619b45" ]
[ "run_pretraining.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.contrib.tpu.TPUEstimatorSpec", "tensorflow.data.TFRecordDataset", "tensorflow.contrib.tpu.TPUEstimator", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.metrics.mean", "tensorflow.one_hot", "tensorflow.parse_single_example", "tensorflow.trainable_variables", ...
suakow/transformers
[ "0ec3619bb2c212737d2472cccaf6658317d2bfa1", "0ec3619bb2c212737d2472cccaf6658317d2bfa1" ]
[ "src/transformers/data/data_collator.py", "examples/legacy/token-classification/run_ner.py" ]
[ "# 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# Unless requir...
[ [ "torch.stack", "torch.nn.utils.rnn.pad_sequence", "torch.randint", "torch.full", "torch.tensor", "torch.bernoulli" ], [ "numpy.argmax", "torch.nn.CrossEntropyLoss" ] ]
Best-ROB-group-EU/group466-p4
[ "962d2aba1738d37eedac07a644ba549b862c71fa" ]
[ "flicker/src/Contour_flicker.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Jun 14 12:13:34 2020\n\n@author: frederik\n\"\"\"\n\nimport rospy\n#import video_stream_opencv\nimport cv2\nimport sys\nimport numpy as np\nfrom std_msgs.msg import Bool\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge, CvBri...
[ [ "numpy.ones", "numpy.zeros" ] ]
amrutn/SILIA
[ "6fe991adffd642a7e6bb13fbc257e063b01a16f1" ]
[ "SILIA/main.py" ]
[ "import numpy as np\nimport sys\nfrom .reference_signal import *\nfrom .helper import *\n\nclass Amplifier:\n\t\"\"\"\n\tA software Lock-in Amplifier\n\t\"\"\"\n\n\tdef __init__(self, cutoff, pbar = True):\n\t\t\"\"\"\n\t\tTakes in a cutoff frequency (float) as an input\n\t\tas well as whether or not to display the...
[ [ "numpy.reshape", "numpy.asarray" ] ]
build-week-medcabinet-ch/data-science
[ "113fcd9c3e226ce5209f1d615374e26ee16d4337" ]
[ "app/api/predict.py" ]
[ "import logging\nimport numpy as np\nimport pandas as pd\nfrom fastapi import APIRouter\nfrom pydantic import BaseModel, Field\nimport pickle\n\nwith open(\"app/api/vec\", 'rb') as file:\n vec = pickle.load(file)\n\nwith open(\"app/api/near\", 'rb') as file:\n near = pickle.load(file)\n\nlog = logging.getLogg...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.concat" ] ]
davidson16807/tectonics-approximations
[ "f69570fd0a9693fad8e8ec27ccc34e0d6b3fd50b" ]
[ "graphics/chapman-approximation/approximate.py" ]
[ "from math import pi, sqrt, exp\nimport itertools\nimport plotly.express as px\nimport numpy as np\nimport multiprocessing\n\ndef clamp(lo, hi, x):\n return max(lo, min(hi, x))\n\ndef mix(lo, hi, x):\n return (hi-lo)*x+lo\n\ndef step(lo, hi, x):\n return (x-lo)/(lo-hi)\n\n\ndef rho(x,z,r):\n return exp(...
[ [ "numpy.concatenate", "numpy.argmin", "numpy.load", "numpy.save", "numpy.abs", "numpy.sqrt", "numpy.unique" ] ]
maguec/FraudDetectionDemo
[ "4b2bc94da1afef6f4506b2e1fd0323c9963c0f89" ]
[ "tests/test_data_generator.py" ]
[ "import unittest\nimport redis\nimport pandas as pd\nfrom app.demo import DataGenerator\n\n\nclass DataGeneratorTest(unittest.TestCase):\n @classmethod\n def setUpClass(cls):\n # Set up redis connection\n cls.redis_conn = redis.Redis(host=\"localhost\", port=\"6379\")\n if not cls.redis_c...
[ [ "pandas.read_csv" ] ]
jysohn23/vision
[ "05ba3f53d1a40f497d4af4768428b7fb1a8dd550" ]
[ "test/test_transforms.py" ]
[ "from __future__ import division\nimport os\nimport torch\nimport torchvision.transforms as transforms\nimport torchvision.transforms.functional as F\nfrom torch._utils_internal import get_file_path_2\nimport unittest\nimport math\nimport random\nimport numpy as np\nfrom PIL import Image\ntry:\n import accimage\...
[ [ "numpy.dot", "numpy.array_equal", "numpy.random.rand", "torch.ShortTensor", "torch.ones", "numpy.where", "torch.sum", "torch.IntTensor", "torch.FloatTensor", "torch.ByteTensor", "numpy.random.randint", "torch.tensor", "numpy.sqrt", "torch.equal", "numpy....
mateoKutnjak/PointNetGPD
[ "ea51622ab6c92d401a13bf78df52651760bea833" ]
[ "PointNetGPD/main_1v_gpd.py" ]
[ "import argparse\nimport os\nimport time\nimport pickle\n\nimport torch\nimport torch.utils.data\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport numpy as np\nfrom tensorboardX import SummaryWriter\nfrom torch.optim.lr_scheduler import StepLR\n\nfrom model.dataset import ...
[ [ "torch.cuda.manual_seed", "torch.optim.lr_scheduler.StepLR", "torch.initial_seed", "torch.save", "torch.cuda.set_device", "torch.nn.functional.nll_loss", "torch.utils.data.dataloader.default_collate", "torch.set_grad_enabled", "torch.nn.DataParallel" ] ]
OrangeBai/C3DLab
[ "24c3a92706aad43fe7a4d559bba1f956f8f0bef7" ]
[ "models/SPGAN.py" ]
[ "from tensorflow.python.keras.engine.training import Model\nfrom tensorflow.keras.optimizers import Adam, SGD\nfrom models.nets import *\nfrom helper.losses import *\nimport math\n\n\ndef sr_gan(hr_shape, upscale_num, gen_loss='vgg'):\n if gen_loss == 'vgg':\n loss_fun = vgg_loss(hr_shape)\n elif gen_l...
[ [ "tensorflow.python.keras.engine.training.Model", "tensorflow.keras.optimizers.Adam" ] ]
tycoer/rfvision-1
[ "db6e28746d8251d1f394544c32b9e0af388d9964", "db6e28746d8251d1f394544c32b9e0af388d9964", "db6e28746d8251d1f394544c32b9e0af388d9964" ]
[ "rfvision/components/roi_heads/bbox_heads/convfc_bbox_head.py", "tests/test_utils/test_visualization.py", "rfvision/components/roi_heads/htc_roi_head.py" ]
[ "import torch.nn as nn\nfrom rflib.cnn import ConvModule\n\nfrom rfvision.models.builder import HEADS\nfrom rfvision.components.utils import build_linear_layer\nfrom .bbox_head import BBoxHead\n\n\n@HEADS.register_module()\nclass ConvFCBBoxHead(BBoxHead):\n r\"\"\"More general bbox head, with shared conv and fc ...
[ [ "torch.nn.ReLU", "torch.nn.Linear", "torch.nn.ModuleList" ], [ "numpy.array", "numpy.zeros", "numpy.ones", "torch.ones", "numpy.allclose", "torch.tensor", "numpy.random.random" ], [ "torch.cat", "torch.nn.functional.adaptive_avg_pool2d", "torch.no_grad",...
gariciodaro/Automatic-Measurements-of-Fishes-physical-traits-V2
[ "0886c8de5f43fbd07ee088eb90799d7f6c8242fb" ]
[ "darkflow/net/build.py" ]
[ "import tensorflow as tf\nimport time\nfrom . import help\nfrom . import flow\nfrom .ops import op_create, identity\nfrom .ops import HEADER, LINE\nfrom .framework import create_framework\nfrom ..dark.darknet import Darknet\nimport json\nimport os\n\nclass TFNet(object):\n\n\t_TRAINER = dict({\n\t\t'rmsprop': tf.tr...
[ [ "tensorflow.GPUOptions", "tensorflow.get_default_graph", "tensorflow.Graph", "tensorflow.Session", "tensorflow.import_graph_def", "tensorflow.GraphDef", "tensorflow.global_variables", "tensorflow.ConfigProto", "tensorflow.placeholder", "tensorflow.gfile.FastGFile", "ten...
bareblackfoot/repulsion_loss
[ "87ba35fff84c7c935b1334227263dad91161b560" ]
[ "lib/model/bbox_transform.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ impor...
[ [ "tensorflow.exp", "tensorflow.minimum", "numpy.zeros", "numpy.log", "numpy.minimum", "tensorflow.subtract", "tensorflow.expand_dims", "numpy.exp", "numpy.vstack", "tensorflow.stack", "tensorflow.add", "tensorflow.cast" ] ]
daniel620/QunatPlayground
[ "dd70dfdcf1d4274d15c374451842863312fd9665" ]
[ "src/utils.py" ]
[ "import pandas as pd\r\nimport numpy as np\r\nfrom dateutil.parser import parse\r\nimport time\r\n\r\n# 生成样例数据\r\ntable = {}\r\ntable['time'] = ['2021-01-04 09:30', '2021-02-10 09:30', '2021-03-03 09:30', '2021-03-29 09:30', '2021-04-19 09:30', '2021-05-31 09:30']\r\ntable['value'] = [1000, 1005, 1018, 1025, 1030, ...
[ [ "pandas.DataFrame", "pandas.merge" ] ]
rguan-uoft/OpenPNM
[ "b3873d35270b0acaad019264368d0055c677d159" ]
[ "tests/unit/models/misc/MiscTest.py" ]
[ "import openpnm as op\nimport scipy as sp\nimport openpnm.models.misc as mods\nfrom numpy.testing import assert_approx_equal, assert_array_almost_equal_nulp\n\n\nclass MiscTest:\n\n def setup_class(self):\n self.net = op.network.Cubic(shape=[5, 5, 5])\n self.geo = op.geometry.GenericGeometry(networ...
[ [ "numpy.testing.assert_array_almost_equal_nulp", "scipy.random.random", "scipy.rand", "scipy.amin", "scipy.zeros", "scipy.in1d", "scipy.unique", "scipy.all", "scipy.amax", "scipy.isnan", "scipy.mean" ] ]
zhuxiangru/CLIP-finetune-v1
[ "48bbe2c203667d94bcc82ea3fcdd2acec7ada8ab" ]
[ "evaluation/evaluation.py" ]
[ "import os\nimport sys\nsys.path.append(os.path.abspath(\".\") + \"/../\")\nsys.path.append(os.path.abspath(\".\"))\nimport clip\nimport torch\nimport json\nfrom PIL import Image\n\n# Load the model\ndevice = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n#model, preprocess = clip.load('ViT-B/32', device)\n# 华...
[ [ "torch.no_grad", "torch.cuda.is_available" ] ]
DeepK/distance-embed
[ "03d9df75d50a5d5a23e6f1c750bf4c35e26e8685" ]
[ "lib/py/classification/classifier.py" ]
[ "from sklearn.metrics import classification_report, f1_score, accuracy_score\nfrom sklearn.svm import SVC\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\n\n\ndef train_best(X_train, Y_train, X_test, Y_test):\n \"\"\"\n - Trains a linear SVM classifier.\n - Tunes the L2 regularization coefficient, ...
[ [ "sklearn.metrics.classification_report", "sklearn.svm.SVC", "sklearn.metrics.f1_score", "sklearn.metrics.accuracy_score" ] ]
raulsaavedr/problema_plano
[ "9c95c92102e97168de53d6993e40f831f01e8c0a" ]
[ "problema_plano/constantes_k.py" ]
[ "import pandas as pd\n\nfrom config import conf\n\n__doc__ = \"\"\"\nModulo encargado de definir algunas funciones para el manejo de las constantes\nk utilizadas en el calculo (k1, k2, ..., kn)\nEs equivalente a una parte del principio de f09_Matriz_de_Gauss()\n\"\"\"\n\ndef cargar_constantes_k():\n \"\"\"\n ...
[ [ "pandas.read_csv" ] ]
adrn/joaquin
[ "8ebab35f24d2a7d216e8dfdd33edd0e9621f39c6" ]
[ "joaquin/apogee_data.py" ]
[ "# Third-party\nfrom astropy.io import fits\nimport numpy as np\nfrom tqdm.auto import tqdm\n\n# Joaquin\nfrom .logger import logger\nfrom .features import get_phot_features, get_lsf_features, get_spec_features\n\n\ndef get_aspcapstar_path(config, star):\n filename = f\"aspcapStar-{config.apogee_reduction}-{star...
[ [ "numpy.concatenate", "numpy.full", "numpy.arange" ] ]
diogo149/tfu
[ "8928c85c9f8050dc25061e2882757dd64927b59d" ]
[ "tfu/base.py" ]
[ "import collections\nimport functools\nimport contextlib\nimport six\nimport tensorflow as tf\n\nimport du\nimport du.sandbox.summary\n\nfrom . import utils\n\n# ############################### state class ###############################\n\n\nclass GraphState(object):\n\n def __init__(self, graph=None):\n ...
[ [ "tensorflow.get_default_session", "tensorflow.summary.merge", "tensorflow.zeros", "tensorflow.assign", "tensorflow.summary.Summary", "tensorflow.get_default_graph", "tensorflow.group", "tensorflow.ones", "tensorflow.variable_scope", "tensorflow.get_variable_scope", "ten...
1582795529/KGNet
[ "1e19025c04e5fe18f66a273b350e2ef99d56cec4" ]
[ "modeling/modules/srfbn_arch.py" ]
[ "import torch\nimport torch.nn as nn\nfrom .blocks import ConvBlock, DeconvBlock \n\nclass FeedbackBlock(nn.Module):\n def __init__(self, num_features, num_groups, upscale_factor, act_type, norm_type, device=torch.device('cuda')):\n super(FeedbackBlock, self).__init__()\n if upscale_factor == 2:\n ...
[ [ "torch.device", "torch.cat", "torch.nn.ModuleList", "torch.nn.functional.interpolate" ] ]
mrikitoku/LightGBM
[ "34f873bdc54b18260ca4913c263b8e518356ec8e" ]
[ "examples/python-guide/logistic_regression.py" ]
[ "# pylint: disable = no-name-in-module\n'''\nBLUF: The `xentropy` objective does logistic regression and generalizes\nto the case where labels are probabilistic (i.e. numbers between 0 and 1).\n\nDetails: Both `binary` and `xentropy` minimize the log loss and use\n`boost_from_average = TRUE` by default. Possibly th...
[ [ "numpy.random.normal", "numpy.random.binomial", "numpy.log", "numpy.random.seed", "scipy.special.expit", "numpy.repeat", "numpy.corrcoef" ] ]
yusukeurakami/env2gym
[ "5c3e7073fa30a3a951c1db34eccbb07c75276da0" ]
[ "env2gym/wrappers.py" ]
[ "from gym import core, spaces, make\nfrom dm_control import suite\nfrom dm_env import specs\nimport numpy as np\n\n\ndef _spec_to_box(spec):\n def extract_min_max(s):\n assert s.dtype == np.float64 or s.dtype == np.float32\n dim = np.int(np.prod(s.shape))\n if type(s) == specs.Array:\n ...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.ones", "numpy.prod", "numpy.isscalar" ] ]
karazijal/clevrtex
[ "fe982ab224689526f5e2f83a2f542ba958d88abd" ]
[ "ool/picture/models/thirdparty/dti_sprites/utils.py" ]
[ "\"\"\"\nThe following code is adjusted from https://github.com/monniert/dti-sprites/\n\n\n\"Unsupervised Layered Image Decomposition into Object Prototypes\"\nTom Monnier, Elliot Vincent, Jean Ponce, Mathieu Aubry\nhttps://arxiv.org/abs/2104.14575\n\"\"\"\n\nfrom abc import ABCMeta, abstractmethod\nfrom collection...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.functional.unfold", "torch.stack", "torch.nn.ModuleList", "torch.einsum", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.inverse", "torch.ones", "torch.eye", "numpy.outer", "torch.exp", "torch.sigmoi...
nicolaseberle/publifactory-reviewer-matcher
[ "a26ccff7fd4a16f822a7694dcb12f30f421714c6" ]
[ "venv/lib/python3.7/site-packages/gensim/test/test_tfidfmodel.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>\n# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html\n\n\"\"\"\nAutomated tests for checking transformation algorithms (the models package).\n\"\"\"\n\n\nimport logging\nimport unit...
[ [ "numpy.allclose" ] ]
konodyuk/kts
[ "3af5ccbf1d2089cb41d171626fcde4b0ba5aa8a7" ]
[ "kts/tests/test_backend.py" ]
[ "import time\nfrom itertools import product\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom kts.core.backend.address_manager import get_address_manager\nfrom kts.core.backend.progress import pbar\nfrom kts.core.backend.signal import get_signal_manager\nfrom kts.core.feature_constructor.user_define...
[ [ "pandas.DataFrame", "numpy.random.randint" ] ]
alexvmt/Master-Thesis
[ "805fbf1c59c1dbb682cef627aba5894a9e7ecb61" ]
[ "code/06_feature_selection.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n##### FEATURE SELECTION #####\n\nprint('Starting feature selection...')\n\n# import libraries\nfrom datetime import datetime,date\nstart_time = datetime.now()\nprint('Start time: ', start_time)\n\nimport sys\nparams = sys.argv\n\nimport numpy as np\nimport pandas as pd\nim...
[ [ "pandas.read_pickle", "sklearn.feature_selection.SelectKBest", "pandas.DataFrame", "sklearn.preprocessing.StandardScaler" ] ]
spongezhang/pytorch-CycleGAN-and-pix2pix
[ "01875b21d537512c304f37fb0eb65fea7f57f4ba" ]
[ "models/networks.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport functools\nfrom torch.optim import lr_scheduler\n\n\n###############################################################################\n# Helper Functions\n###############################################################################\ndef get_n...
[ [ "torch.optim.lr_scheduler.StepLR", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.nn.LeakyReLU", "torch.nn.init.kaiming_normal_", "torch.cuda.is_available", "torch.nn.BCEWithLogitsLoss", "torch.nn.DataParallel", "torch.nn.init.constant_", "torch.nn.ConvTranspose2d", "...
arfeen93/ZSDG
[ "21f44071cebebe6da32d1032ef96395de997c6cf" ]
[ "src/data/PACS/pacs.py" ]
[ "import os\nimport numpy as np\nimport pickle\nimport sys\nsys.path.append('/home/arfeen/ZSDG_main/src/')\nfrom utils.utils import process_txt\n\nBASE_PATH = '/home/arfeen/ZSDG_main/src/data/PACS'\nDATA_PATH = 'PACS/kfold/'\n\n\ndef create_trvalte_splits(args):\n\n\twith open(os.path.join(BASE_PATH, 'PACS_glove300....
[ [ "numpy.setdiff1d" ] ]
joaquimcampos/HTV-Learn
[ "dfc6c3b022ba010e18316d941af44d87c98cfa98", "dfc6c3b022ba010e18316d941af44d87c98cfa98" ]
[ "tests/test_delaunay.py", "htvlearn/data.py" ]
[ "import pytest\nimport numpy as np\nimport torch\nimport time\n\nfrom htvlearn.delaunay import Delaunay\nfrom htvlearn.plots.plot_cpwl import Plot\nfrom htvlearn.data import (\n BoxSpline,\n SimplicialSpline,\n CutPyramid,\n SimpleJunction,\n DistortedGrid,\n Data\n)\n\n\n@pytest.fixture(autouse=T...
[ [ "numpy.zeros_like", "numpy.array", "numpy.array_equal", "numpy.sum", "numpy.allclose", "numpy.where", "numpy.abs" ], [ "torch.cat", "numpy.random.rand", "numpy.where", "scipy.spatial.ConvexHull", "scipy.spatial.Delaunay", "numpy.concatenate", "torch.manu...
GeoscienceAustralia/wagl
[ "523f574b4a4b62c3aed3a378e13a7548a7f21c0c" ]
[ "tests/test_blrb.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\nUnit test for the bilinear recursive bisection function found in\nwagl.interpolation.bilinear\n\"\"\"\n\nfrom __future__ import absolute_import\nimport unittest\nimport numpy\nimport math\nfrom wagl.interpolation import bilinear, subdivide, indices, interpolate_block\n\n\nclass BLR...
[ [ "numpy.max" ] ]
barentsen/exoplanet
[ "d788f5003091141fbe69df8b8a26064ed2e4c747" ]
[ "exoplanet/gp/terms.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import division, print_function\n\n__all__ = [\n \"Term\", \"TermSum\", \"TermProduct\", \"TermDiff\",\n \"RealTerm\", \"ComplexTerm\",\n \"SHOTerm\", \"Matern32Term\", \"RotationTerm\",\n]\n\nimport numpy as np\nfrom itertools import chain\n\nimport theano\nimpo...
[ [ "numpy.sqrt" ] ]
lmxhappy/awd-lstm-lm
[ "a1a358617527b626a34d6e32470345f3d01e5c1f" ]
[ "generate.py" ]
[ "###############################################################################\r\n# Language Modeling on Penn Tree Bank\r\n#\r\n# This file generates new sentences sampled from the language model\r\n#\r\n###############################################################################\r\n\r\nimport argparse\r\n\r\n...
[ [ "torch.rand", "torch.cuda.manual_seed", "torch.manual_seed", "torch.multinomial", "torch.cuda.is_available", "torch.load" ] ]
krishanrana/rl_algorithms
[ "c12fe447a70f2f99f37f6c1157907755d38fde81" ]
[ "rl_algorithms/bc/sac_learner.py" ]
[ "import torch\nimport torch.nn.functional as F\n\nfrom rl_algorithms.common.abstract.learner import TensorTuple\nimport rl_algorithms.common.helper_functions as common_utils\nfrom rl_algorithms.registry import LEARNERS\nfrom rl_algorithms.sac.learner import SACLearner\n\n\n@LEARNERS.register_module\nclass BCSACLear...
[ [ "torch.zeros", "torch.cat", "torch.mul" ] ]
djzdjzdl/Data_Based_Security
[ "db91f628c39cbdbd15adf9d74d48872438b0e9a1" ]
[ "EDA_pltbar.py" ]
[ "import csv\nfrom hashlib import new\nimport matplotlib.pyplot as plt\nimport numpy\nimport os\nimport pefile\nimport shutil\n\nNormal_Correct = 0\nNormal_Num = 0\nMal_Correct = 0\nMal_Num = 0\nnum = 26\n\n#Compare label number / label\nwith open('./pe_features.csv', 'r') as f:\n\n cr = csv.reader(f)\n next(c...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.bar", "matplotlib.pyplot.xticks" ] ]
evantancy/CrowdNav_DSRNN
[ "bb8ddfea5991f91c78f7f50c8eb371a82753eafa" ]
[ "crowd_sim/envs/crowd_sim.py" ]
[ "import logging\nimport random\nfrom collections import deque\n\nimport gym\nimport matplotlib.legend as legend\nimport matplotlib.lines as mlines\nimport matplotlib.pyplot as plt\nimport matplotlib.text as mtext\nimport numpy as np\nfrom crowd_nav.policy.orca import ORCA\nfrom crowd_nav.policy.policy_factory impor...
[ [ "numpy.dot", "matplotlib.patches.FancyArrowPatch", "numpy.cos", "numpy.random.random", "numpy.random.normal", "numpy.sin", "numpy.linalg.norm", "numpy.random.randint", "numpy.sqrt", "matplotlib.lines.Line2D", "numpy.array", "numpy.reshape", "numpy.zeros", "m...
ShepherdCode/Soars2021
[ "ab4f304eaa09e52d260152397a6c53d7a05457da", "ab4f304eaa09e52d260152397a6c53d7a05457da", "ab4f304eaa09e52d260152397a6c53d7a05457da" ]
[ "Scripts/ORF_CNN_204.py", "Scripts/ORF_CNN_112.py", "Scripts/ORF_GRU_101.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# \n\n# # ORF recognition by CNN\n# \n# In 105, we used Conv1D layers with filter width=3 with dropout to reduce overfitting. The simulated RNA lengths were 1000.\n# \n# Here, try really short simulated RNA.\n# \n# \n# \n# RNA_LENS=15 and was cut in half with layers with f...
[ [ "numpy.zeros", "matplotlib.pyplot.gca", "numpy.set_printoptions", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.grid", "pandas.DataFrame", "matplotlib.pyplot.ylabel", "sklearn.model_select...
JLDaniel77/lambdata
[ "86c61f2f07dbe8dd175214e7f60d2175130ec92b" ]
[ "lambdata_jldaniel77/wrangle_helper.py" ]
[ "class WrangleHelper:\n \"\"\"A class to help wrangle data\"\"\"\n def split_data(X, y, test_size=0.2, val_size=len(X_test), \n random_state=42, shuffle=True, stratify=None):\n from sklearn.model_selection import train_test_split\n\n # Splite dataset into t...
[ [ "sklearn.model_selection.train_test_split" ] ]
marcocalamai/Link-stream-diameter
[ "7cdccc6db19bf9adc589b5b38912c9eed93f76d4" ]
[ "src/pivot_ifub_diameter.py" ]
[ "import temporal_distances as td\nimport temporal_graph as tg\n\nimport numpy as np\n\n\nclass PivotIfubDiameter:\n def __init__(self, graph: tg.Graph, pivots, t_alpha=None, t_omega=None):\n \"\"\"\n :param graph: Temporal Graph (sorted in non-decreasing order with respect to the edge starting time...
[ [ "numpy.logical_or", "numpy.count_nonzero", "numpy.asarray", "numpy.argsort" ] ]
nhemion/tfmodellib
[ "f4190adaf1584e3463c05c97a42a3083345a4e00" ]
[ "tfmodellib/linreg.py" ]
[ "# Copyright 2018 Nikolas Hemion. 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 required by ...
[ [ "tensorflow.train.AdamOptimizer", "numpy.random.rand", "matplotlib.pyplot.plot", "numpy.random.randn", "tensorflow.placeholder", "tensorflow.losses.mean_squared_error", "tensorflow.layers.dense", "matplotlib.pyplot.show" ] ]