repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
cbstanley/privacy
[ "5493a3baf0031710ab27679f94010caa1fcc0f6d" ]
[ "tutorials/lm_dpsgd_tutorial.py" ]
[ "# Copyright 2019, The TensorFlow Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ...
[ [ "numpy.array", "tensorflow.estimator.EstimatorSpec", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.compat.v1.estimator.inputs.numpy_input_fn", "tensorflow.argmax", "tensorflow.reshape", "tensorflow.compat.v1.train.get_global_step", "tensorflow.keras.layers.Dense", "te...
on-reading/tensorflow
[ "ebb7486830432cf82cef9848bcada9a71a7f3386" ]
[ "tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.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.python.ops.state_ops.assign_add", "tensorflow.contrib.layers.fully_connected", "tensorflow.python.ops.clip_ops.clip_by_global_norm", "tensorflow.python.ops.math_ops.reduce_sum", "tensorflow.python.framework.ops.get_default_graph", "tensorflow.python.ops.math_ops.sigmoid", "...
alleboudy/point2mesh
[ "0e3d288c03b5165e28430aada841bd6c25db8cb7" ]
[ "options.py" ]
[ "import argparse\nimport os\nimport numpy as np\nimport torch\n\nMANIFOLD_DIR = '~/code/Manifold/build' # path to manifold software (https://github.com/hjwdzh/Manifold)\n\n\nclass Options:\n def __init__(self):\n self.args = None\n self.parse_args()\n\n def parse_args(self):\n parser = a...
[ [ "numpy.digitize" ] ]
tsumita/implicit_emotion
[ "dae2d5a8162a2665b8e76812716068650feae710" ]
[ "SentEval/examples/data.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\nfrom __future__ import absolute_import, division, unicode_literals\n\nimport io\nimport numpy as np\nimport logging...
[ [ "numpy.fromstring" ] ]
xuyufan936831611/vo_imu
[ "8a5753384b4a5c08dc83edf718d76a2ac308a298" ]
[ "LR_eval/evaluate_kitti_depth_all_and_display.py" ]
[ "#!/usr/bin/env python\n# _*_ coding:utf-8 _*_\nimport numpy as np\nimport cv2\nimport argparse\nfrom evaluation_utils import *\nfrom glob import glob\nimport matplotlib.pyplot as plt\nimport scipy.misc\n\nparser = argparse.ArgumentParser(description='Evaluation on the KITTI dataset')\nparser.add_argument('--split'...
[ [ "numpy.isinf", "numpy.array", "numpy.zeros", "numpy.percentile", "matplotlib.pyplot.get_cmap", "numpy.load", "numpy.logical_and", "numpy.abs", "numpy.clip", "numpy.squeeze" ] ]
kumar-harin/HAL_9000
[ "99eeca33b73fa61c11f290cdd27da51ad7c9d1ce" ]
[ "HAL_9000/neural_network.py" ]
[ "import numpy as np\nimport progressbar\nfrom terminaltables import AsciiTable\nfrom HAL_9000.utils import batch_iterator, bar_widgets\n\n\nclass Brain:\n def __init__(self, loss, opt, val_data=None):\n self.layers = []\n self.loss_fn = loss()\n self.opt = opt\n self.losses = {\"train...
[ [ "numpy.mean" ] ]
AnonymousAddress/ExplorationConsciousRL
[ "9836335d3f0bb8e733076be7011167a89732d887" ]
[ "baselines/ddpg/main.py" ]
[ "import argparse\nimport time\nimport os\nimport os.path as osp\nimport logging\nfrom baselines import logger, bench\nfrom baselines.common.misc_util import (\n set_global_seeds,\n boolean_flag,\n)\nimport baselines.ddpg.training as training\nfrom baselines.ddpg.models import Actor, Critic\nfrom baselines.ddp...
[ [ "tensorflow.reset_default_graph" ] ]
ChuningWang/pyroms
[ "4f3773d39683ce78e76b30d0e41955f47d56edc2" ]
[ "pyroms/pyroms/obsolete/extern/kdtree.py" ]
[ "# Copyright Anne M. Archibald 2008\n# Released under the scipy license\nimport numpy as np\nfrom heapq import heappush, heappop\n# import scipy.sparse ### removed method that uses this -rdh\n\n\ndef minkowski_distance_p(x, y, p=2):\n \"\"\"Compute the pth power of the L**p distance between x and y\n\n For ...
[ [ "numpy.minimum", "numpy.copy", "numpy.ndindex", "numpy.empty", "numpy.nonzero", "numpy.prod", "numpy.arange", "numpy.argmax", "numpy.array", "numpy.zeros", "numpy.shape", "numpy.amax", "numpy.amin", "numpy.searchsorted", "numpy.asarray", "numpy.sum",...
lynch829/Radiomics-1
[ "4c7c5c89883baad94f10ee2d1748be097f0dec7b" ]
[ "src/Radiomics/group1_features.py" ]
[ "import numpy as np\nimport math\n#import scipy.stats as stat\n\nimport profiling_tools\n\n\"\"\"\nGroup 1 : First order statistics\nX : numpy 1-d array\n\"\"\"\n\n# comment\n\ndef energy(X):\n\n return np.sum(np.dot(X, X))\n\ndef entropy(X):\n\n hist, bin_edges = np.histogram(X, density = True)\n\n return...
[ [ "numpy.max", "numpy.histogram", "numpy.dot", "numpy.median", "numpy.min", "numpy.mean", "numpy.std", "numpy.log2", "numpy.var" ] ]
chihyunsong/oc-nn
[ "f57130545f221fee67e9780d2a93ca48b9d10ba5" ]
[ "src/models/ocnnFakeNoise.py" ]
[ "# Import libraries for data wrangling, preprocessing and visualization\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.preprocessing import StandardSc...
[ [ "tensorflow.matmul", "numpy.load", "numpy.mean", "numpy.cos", "tensorflow.global_variables_initializer", "tensorflow.random_normal", "tensorflow.cast", "numpy.concatenate", "tensorflow.set_random_seed", "tensorflow.Variable", "numpy.save", "numpy.sqrt", "tensorf...
Okroshiashvili/PyRoMetrics
[ "5bb736bf95da8b092347127f2c98a93e0c16abd8" ]
[ "tests/conftest.py" ]
[ "import numpy as np\nimport pytest\n\n\n@pytest.fixture\ndef data():\n\n actual = np.array([544, 422, 269, 241, 424, 376, 464, 572, 254, 296])\n predicted = np.array([529, 474, 301, 325, 346, 381, 461, 544, 280, 310])\n\n return actual, predicted\n" ]
[ [ "numpy.array" ] ]
louisenaud/time_series_prediction
[ "4428f8ba5ef9548f700ca5a9f4284066782cbf46" ]
[ "src/run_attention_rnn.py" ]
[ "\"\"\"\nProject: stock_prediction\nFile: run_attention_rnn.py\nCreated by: louise\nOn: 08/02/18\nAt: 12:53 PM\n\"\"\"\nimport torch\nfrom torch import nn\nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader\nfrom torch import optim\nfrom torch.optim import lr_sched...
[ [ "numpy.array", "torch.optim.lr_scheduler.StepLR", "torch.nn.MSELoss", "torch.save", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "torch.cuda.is_available", "torch.utils.data.DataLoader", "matplotlib.pyplot.show", "numpy.column_stack"...
BlenderGamer/Open3D
[ "8c6a7e74582fe09f3a2295933794bfc16026c21f" ]
[ "examples/python/t_reconstruction_system/dense_slam.py" ]
[ "# ----------------------------------------------------------------------------\n# - Open3D: www.open3d.org -\n# ----------------------------------------------------------------------------\n# The MIT License (MIT)\n#\n# Copyright (c) 2018-2021 www.open3d.org\n#\n# ...
[ [ "numpy.identity" ] ]
AndrewTrefilov/ru-dalle
[ "d1dd6951d1c2f045341df05a2b6427b323f97ed3" ]
[ "rudalle/dalle/image_attention.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport torch\n\n\ndef _init_mask(text_tokens, image_tokens_per_dim):\n attn_size = text_tokens + image_tokens_per_dim**2\n mask = torch.tril(torch.ones(attn_size, attn_size, dtype=torch.bool))\n return mask\n\n\ndef get_row_mask(text_tokens=256, image_tokens_per_dim=32):\n ma...
[ [ "torch.zeros", "torch.ones" ] ]
LPD-EPFL/FeGAN
[ "e67382ba53f6782f55b6367376c4cb103d5ef715" ]
[ "dist-dcgan.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n###\n # @file dist-dcgan.py\n # @author Arsany Guirguis <arsany.guirguis@epfl.ch>\n #\n # @section LICENSE\n #\n # Copyright (c) 2020 Arsany Guirguis.\n #\n # Permission is hereby granted, free of charge, to any person obtaining a copy\n # of this software and associated ...
[ [ "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.cuda.is_available", "numpy.sort", "torch.cuda.FloatTensor", "torch.distributed.reduce", "torch.multiprocessing.set_sharing_strategy", "torch.distributed.new_group", "torch.nn.init.constant_", "torch.distributed.init_proce...
CityU-AIM-Group/HTD
[ "0be9fd844118c275abc6053b3cbd5ffb589e62ee" ]
[ "build/lib/mmdet/models/roi_heads/final_roi_head.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom mmdet.core import (bbox2result, bbox2roi, bbox_mapping, build_assigner,\n build_sampler, merge_aug_bboxes, merge_aug_masks,\n multiclass_nms)\nfrom ..builder import HEADS, build_head, build_roi_extractor\nfrom .base_roi_head ...
[ [ "torch.zeros_like", "torch.no_grad", "torch.nn.ModuleList", "torch.sum" ] ]
rechardchen123/Crowded_analysis
[ "1d5cf100ab977c0c02e762e973638aaaac121fa2" ]
[ "deep_sort/kalman_filter.py" ]
[ "\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*\n# ***********************************************\n# @Time : 06/05/2021 01:50\n# @File : calibrate_img.py\n# @email : xiang.chen.17@ucl.ac.uk\n# @author: Xiang Chen\n# ***********************************************\n\nimport numpy as np\nimport scipy.linalg\n\n\...
[ [ "numpy.square", "numpy.zeros_like", "numpy.dot", "numpy.linalg.multi_dot", "numpy.sum", "numpy.eye", "numpy.linalg.cholesky" ] ]
nwcd-samples/NWCD-Industry-Customized-OCR-Solution
[ "3f9c25d89e012e0376466ece7493c50b2ff727e4", "3f9c25d89e012e0376466ece7493c50b2ff727e4" ]
[ "local/ocr_main.py", "local/data_generate/create_lmdb_dataset.py" ]
[ "import argparse\nfrom multiprocessing import Pool\nfrom pathlib import Path\nfrom PIL import Image\nimport argparse\nimport shutil\nimport errno\nimport time\nimport uuid\nimport fitz\nimport json\nimport glob\nimport uuid\nimport cv2\nimport os\nfrom collections import OrderedDict\n\nimport traceback\nimport torc...
[ [ "torch.device", "torch.nn.DataParallel", "torch.load", "torch.cuda.device_count" ], [ "numpy.frombuffer" ] ]
MikeCun/PersonReID
[ "9c7c122212410f79edc2b5582ed75e8a727ea88a" ]
[ "package/utils/misc.py" ]
[ "import numpy as np\nimport itertools\n\n\ndef concat_dict_list(dict_list):\n ret_dict = {}\n keys = dict_list[0].keys()\n for k in keys:\n if isinstance(dict_list[0][k], list):\n ret_dict[k] = list(itertools.chain.from_iterable([dict_[k] for dict_ in dict_list]))\n elif isinstance...
[ [ "numpy.concatenate" ] ]
alicebarthel/model2roms
[ "ea90f750dd4ce1b2f6ff68428d9b0a8899d4b1de" ]
[ "clim2bry.py" ]
[ "\"\"\"\nThis is CLM2BRY\n\"\"\"\nfrom datetime import datetime\nfrom netCDF4 import Dataset\nfrom netCDF4 import num2date\nimport numpy as np\nimport IOBry\n\n__author__ = 'Trond Kristiansen'\n__email__ = 'me@trondkristiansen.com'\n__created__ = datetime(2009, 3, 2)\n__modified__ = datetime(2018, 4, 5)\n__version_...
[ [ "numpy.array", "numpy.squeeze" ] ]
YeShenWork/PySpectralRadar
[ "6b3106117ee2998b7bf8add7d7d2c395d66658dc" ]
[ "PySpectralRadar.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue May 21 14:18:32 2019\r\nPython wrapper for Thorlabs SpectralRadar SDK\r\n@author: sstucker\r\nVersion 0.1.0\r\n\"\"\"\r\nimport ctypes as C\r\nfrom enum import IntEnum\r\nimport numpy as np\r\nfrom numpy.ctypeslib import ndpointer\r\n\r\n#Imports SpectralRadar li...
[ [ "numpy.array", "numpy.ctypeslib.ndpointer" ] ]
intrepid42/apfelxx
[ "34b0bb4f134ddf42aa7eccceaa6c3b91b5414cd6" ]
[ "doc/src/plots/FOvsAsy.py" ]
[ "import numpy as np\n#import pylab as pl\nimport matplotlib.pyplot as pl\n\npl.style.use('seaborn-talk')\npl.rc('axes', linewidth=2)\nax = pl.gca()\n\nax.get_yaxis().set_tick_params(which='both', direction='in', width=2, right='on')\nax.get_xaxis().set_tick_params(which='both', direction='in', width=2, top='on')\na...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.xscale", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.yticks", "matplotlib.pyplot.rc", "matplotlib.pyplot.savefig", ...
XunDong-Shi/Material_balance_calculation
[ "d81c003738f3e5b59263078acd5b3336f03fd32d" ]
[ "Main.py" ]
[ "from value_update import initial_value_update\r\nimport gl\r\nfrom Chemical_Process import main_process\r\nimport time\r\nimport pandas as pd\r\nimport numpy as np\r\nimport seaborn as sns\r\nimport matplotlib.pyplot as plt\r\n\r\n\r\ndef main(emission_ratio):\r\n init_array, iter_array, error_array, flow, frac...
[ [ "pandas.DataFrame", "numpy.arange", "matplotlib.pyplot.show", "pandas.concat" ] ]
Lyle-zhang/literature
[ "c1266d326ee8a733e801c23aca89ab34edc09b6e" ]
[ "Harris-2002/rtd_Fig15.py" ]
[ "\"\"\"\nCompare RTD data from Figure 15 in Harris 2002 paper to the RTD results from \nVusse 1962.\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as py\n\n# Function for residence time distribution\n#------------------------------------------------------------------------------\n\ndef rtd(n, tau, t, q=1, ...
[ [ "numpy.sin", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "numpy.exp", "matplotlib.pyplot.figure", "numpy.loadtxt", "matplotlib.pyplot.ylabel", "numpy.cos", "numpy.linspace" ...
moonfire-ventures/tokenomics
[ "4152bfd0e831262139ce50c6baae2748f19af850" ]
[ "moonfire_tokenomics/analysis.py" ]
[ "import matplotlib\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom matplotlib.ticker import PercentFormatter\n\nfrom moonfire_tokenomics.make_dataset import tokens_to_df\nfrom moonfire_tokenomics.tokens import Tokens\n\nmatplotlib.rc(\"figure\", dpi=192)\n\nrename_dict = {\n \"advisors\": \"Advisor...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "matplotlib.rc", "matplotlib.ticker.PercentFormatter", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot...
chunjenpeng/pyBandit
[ "df14bf0cc263d8fa0ad0a539e94327ac35e33d1c" ]
[ "pybandit/evolutionary/OnePlusOne_ES.py" ]
[ "import numpy as np\n\nclass OnePlusOne_ES:\n def __init__(self, obj, dimension, parent = None, step = None, max_iteration = 1e4):\n\n self.obj = obj\n self.parent = parent if parent is not None \\\n else np.random.uniform(0, 1, size=(dimension))\n self.step = ste...
[ [ "numpy.random.normal", "numpy.random.uniform", "numpy.power", "numpy.log" ] ]
toddrme2178/PyWaffle
[ "c1ad63064f62143a38fe7ca985a2b9141f4ee3f8" ]
[ "pywaffle/waffle.py" ]
[ "#!/usr/bin/python\n# -*-coding: utf-8 -*-\n\nimport copy\nimport math\nimport warnings\nfrom itertools import product\nfrom typing import List, Tuple, Union\n\nimport matplotlib.font_manager as fm\nfrom matplotlib.figure import Figure\nfrom matplotlib.legend_handler import HandlerBase\nfrom matplotlib.patches impo...
[ [ "matplotlib.font_manager.FontProperties", "matplotlib.text.Text", "matplotlib.figure.Figure.__init__", "matplotlib.patches.Rectangle", "matplotlib.pyplot.cm.get_cmap" ] ]
jasoriya/Low-Latency-Keyword-Spotting-System
[ "7b523b0bb581af9c0d480a8f17b85c09a4148e13" ]
[ "src/mfccModel_dscnn.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Apr 10 23:30:06 2019\n\n@author: shreyans\n\"\"\"\nimport numpy as np\nimport pandas as pd\nfrom keras.applications.inception_resnet_v2 import InceptionResNetV2\nfrom keras.models import Model, load_model\nfrom keras.layers import Dense, Input, Flatten, Dropout\nfrom...
[ [ "sklearn.model_selection.train_test_split", "pandas.read_csv", "numpy.load", "numpy.random.shuffle" ] ]
phmalek/freud
[ "cb0781f2009758638cd79a0bb6d44801e5473774" ]
[ "benchmarks/benchmark_locality_LinkCell.py" ]
[ "import numpy as np\nimport freud\nfrom benchmark import Benchmark\nfrom benchmarker import run_benchmarks\n\n\nclass BenchmarkLocalityLinkCell(Benchmark):\n def __init__(self, L, rcut):\n self.L = L\n self.rcut = rcut\n\n def bench_setup(self, N):\n self.box = freud.box.Box.cube(self.L)\...
[ [ "numpy.random.seed", "numpy.random.uniform" ] ]
Flash-Of-Thunder/testing
[ "bb74c3ff3047d2f60a839fa05a4e621587225205" ]
[ "papercode/utils.py" ]
[ "\"\"\"\nThis file is part of the accompanying code to our manuscript:\n\nKratzert, F., Klotz, D., Herrnegger, M., Sampson, A. K., Hochreiter, S., & Nearing, G. S. ( 2019). \nToward improved predictions in ungauged basins: Exploiting the power of machine learning.\nWater Resources Research, 55. https://doi.org/10.1...
[ [ "numpy.array" ] ]
aadimator/drl-nd
[ "fa467e0fb98ce6d0e92d4a3566f521fabfeeeef6" ]
[ "p2_continuous-control/ddpg_agent.py" ]
[ "import numpy as np\nimport random\nimport copy\nfrom collections import namedtuple, deque\n\nfrom model import Actor, Critic\n\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nBUFFER_SIZE = int(1e6) # replay buffer size\nBATCH_SIZE = 128 # minibatch size\nGAMMA = 0.99 ...
[ [ "torch.no_grad", "numpy.ones", "torch.from_numpy", "torch.nn.functional.mse_loss", "torch.cuda.is_available", "numpy.clip", "numpy.vstack" ] ]
pkannetwork/wmfdata
[ "a5620af60322f165fb97e655f37309ccdabc48e8" ]
[ "wmfdata/utils.py" ]
[ "import sys\nfrom math import log10, floor\nimport re\nimport requests\nimport subprocess\nfrom packaging import version\n\nfrom IPython.display import HTML\nimport pandas as pd\n\ndef print_err(*args, **kwargs):\n print(*args, file=sys.stderr, **kwargs)\n\ndef sig_figs(x, n_figs):\n exponent = floor(log10(ab...
[ [ "pandas.option_context" ] ]
cizhenshi/Rscup2019-Object-Detection-Track-3th-Solution
[ "e2ffe1a0c01789c369cfe21a7d0372239a4a4682" ]
[ "mmdet/apis/inference.py" ]
[ "import warnings\n\nimport mmcv\nimport numpy as np\nimport pycocotools.mask as maskUtils\nimport torch\nfrom mmcv.runner import load_checkpoint\n\nfrom mmdet.core import get_classes\nfrom mmdet.datasets import to_tensor\nfrom mmdet.datasets.transforms import ImageTransform\nfrom mmdet.models import build_detector\...
[ [ "numpy.concatenate", "numpy.full", "torch.no_grad", "numpy.where", "numpy.random.randint", "numpy.vstack" ] ]
odp/adaptdl
[ "8a0ad47da91ab4b8f5e13c819cb4701a2ebe8ca8" ]
[ "adaptdl/adaptdl/torch/_metrics.py" ]
[ "# Copyright 2020 Petuum, Inc. 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 ap...
[ [ "numpy.all", "numpy.array", "numpy.asarray" ] ]
Jack-XHP/LabPicV2-MaskRCNN
[ "b0586b2827000c7b7337d5110b2b1fd6185053a8" ]
[ "Reader/InstanceReader/ChemScapeVesselInstanceReader.py" ]
[ "import cv2\r\nimport numpy as np\r\nimport random\r\n#############################################################################################\r\ndef show(Im):\r\n cv2.imshow(\"show\",Im.astype(np.uint8))\r\n cv2.waitKey()\r\n cv2.destroyAllWindows()\r\n################################################...
[ [ "numpy.max", "numpy.concatenate", "numpy.random.rand", "numpy.zeros", "numpy.ones", "numpy.min", "numpy.random.shuffle", "numpy.fliplr", "numpy.float32", "numpy.random.randint", "numpy.expand_dims", "numpy.floor" ] ]
Gopi-Durgaprasad/Kaggle-Cornell-Birdcall-Identification
[ "9eafbcba3323c29b0f9271911debc2f18af78f23" ]
[ "stage2/classifiers.py" ]
[ "import numpy as np\nfrom functools import partial\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport timm\nfrom timm.models.efficientnet import tf_efficientnet_b4_ns, tf_efficientnet_b3_ns, \\\n tf_efficientnet_b5_ns, tf_efficientnet_b2_ns, tf_efficientnet_b6_ns, tf_efficientnet_b7_...
[ [ "torch.nn.Linear", "torch.nn.modules.linear.Linear", "torch.sigmoid", "torch.nn.functional.avg_pool2d", "torch.nn.Conv1d", "torch.max", "torch.nn.modules.pooling.AdaptiveAvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.functional.dropout", "torch.nn.init.xavier_uniform_", ...
mikepm35/TfLambdaDemo
[ "be799830984feed85b56890c555be443c6901ca7" ]
[ "infer.py" ]
[ "try:\n import unzip_requirements\nexcept ImportError:\n pass\n\nimport json\nimport os\nimport tarfile\n\nimport boto3\nimport tensorflow as tf\nimport numpy as np\n\nimport census_data\n\nFILE_DIR = '/tmp/'\nBUCKET = os.environ['BUCKET']\n\n\ndef _easy_input_function(data_dict, batch_size=64):\n \"\"\"\n ...
[ [ "tensorflow.estimator.LinearClassifier", "numpy.array", "tensorflow.data.Dataset.from_tensor_slices" ] ]
chetanchougle/customerinsight
[ "b23858d57637357ef7317f5458ee3ba49810f950" ]
[ "custinsight - Copy (2).py" ]
[ "import pandas as pd\nfrom sklearn import ensemble\nfrom sklearn.feature_extraction import DictVectorizer\nimport locale\nimport datetime\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pylab as py\nfrom sklearn.metrics import r2_score\nfrom scipy.stats import spearmanr, pearsonr\n# xl = pd.ExcelFile('...
[ [ "scipy.stats.spearmanr", "scipy.stats.pearsonr", "pandas.ExcelFile", "numpy.arange", "sklearn.ensemble.RandomForestRegressor", "sklearn.metrics.r2_score", "sklearn.feature_extraction.DictVectorizer" ] ]
yuanyyf/Super-Mario-Bro-version-A3C
[ "42660bc3f327a2d8e014634615666c5d68eaee90" ]
[ "src/optimizer.py" ]
[ "\"\"\"\nUsing Adam as optimizer to to improve training speed\n\"\"\"\nimport torch\n\nclass Adam_global(torch.optim.Adam):\n def __init__(self,params,lr,betas,eps,weight_decay):\n super(Adam_global,self).__init__(params,lr,betas,eps,weight_decay)\n # state initialization\n for group in self...
[ [ "torch.zeros_like" ] ]
klauer/transfocate
[ "46480d5cfe7f057dc1250bc307b576b3dd76f52b" ]
[ "transfocate/tests/test_lens.py" ]
[ "############\n# Standard #\n############\n\n###############\n# Third Party #\n###############\nimport numpy as np\n\n##########\n# Module #\n##########\n\ndef test_lens_properties(lens):\n assert np.isclose(500.0, lens.radius, atol=0.1)\n assert np.isclose(100.0, lens.z, atol=0.1)\n assert np.isclose...
[ [ "numpy.isclose" ] ]
titikakakuko/CrowdDet
[ "9f916757bcd1db5d834a5d86a4aab7d83d47d0de" ]
[ "lib/data/CrowdHuman.py" ]
[ "import os\nimport glob, cv2, torch\nimport numpy as np\n\nfrom utils import misc_utils\n\nclass CrowdHuman(torch.utils.data.Dataset):\n def __init__(self, config, if_train):\n if if_train:\n self.training = True\n source = config.train_source\n self.short_size = config.tr...
[ [ "numpy.max", "numpy.array", "numpy.zeros", "numpy.min", "torch.tensor", "numpy.random.randint" ] ]
athallahmaajid/clifter_highway
[ "57a74901cd63cc6f8b052e7f4443196a0f54eff8" ]
[ "highway_env/envs/summon_env.py" ]
[ "from gym.envs.registration import register\nimport numpy as np\n\nfrom highway_env import utils\nfrom highway_env.envs import ParkingEnv\nfrom highway_env.road.lane import StraightLane, LineType\nfrom highway_env.road.road import Road, RoadNetwork\nfrom highway_env.vehicle.kinematics import Vehicle\nfrom highway_e...
[ [ "numpy.linalg.norm", "numpy.arange" ] ]
hectornauta/legraf
[ "13562190f12e40f553076d82949f409fa1646c62" ]
[ "src/coso.py" ]
[ "###################################################################\n# #\n# PLOTTING A LIVE GRAPH #\n# ---------------------------- #\n# EMBED A MATPLOTLIB ANIMATI...
[ [ "matplotlib.use", "matplotlib.lines.Line2D", "matplotlib.animation.TimedAnimation.__init__", "numpy.sin", "matplotlib.animation.TimedAnimation._step", "numpy.roll", "matplotlib.animation.TimedAnimation._stop", "matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg.__init__", "nu...
pentium3/PySyft
[ "5df62e453c6c40d2944348a1cd72e5443d6d5148" ]
[ "syft/frameworks/torch/tensors/interpreters/additive_shared.py" ]
[ "import math\nimport torch\nimport warnings\n\nimport syft as sy\nfrom syft.frameworks.torch.mpc import crypto_protocol\nfrom syft.frameworks.torch.mpc import spdz\nfrom syft.frameworks.torch.mpc import securenn\nfrom syft.frameworks.torch.mpc import fss\nfrom syft.generic.utils import memorize\n\nfrom syft.generic...
[ [ "torch.zeros", "torch.roll", "torch.cat", "torch.stack", "torch.unbind", "torch.split", "torch.tensor", "torch.nn.functional.pad" ] ]
PDA-UR/latency_measurements
[ "c9d86d2cd7ebaade65590b2427049d46c836b390" ]
[ "plot_scatterplot.py" ]
[ "#!/usr/bin/env python3\n# coding: utf-8\n\nimport seaborn as sns\nimport matplotlib\nfrom matplotlib import pyplot as plt\n#import pandas as pd\nimport os\nimport csv\nimport sys\n\n# common setup BEGIN\ncur_dir = os.path.dirname(os.path.realpath(__file__))\nplt.figure(figsize=[3.6, 2.8])\nsns.set_style(\"whitegr...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure", "matplotlib.rcParams.update", "matplotlib.pyplot.show", "matplotlib.pyplot.gca" ] ]
mwinding/connectome_analysis
[ "dbc747290891805863c9481921d8080dc2043d21", "dbc747290891805863c9481921d8080dc2043d21" ]
[ "scripts/network_analysis/hubs_exploratory.py", "scripts/identify_neuron_classes/plot_LNs-PNs_supplemental.py" ]
[ "#%%\nimport os\nimport sys\ntry:\n os.chdir('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')\n sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/maggot_models/')\n sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')\nexcept:\n pass\n\nfrom pymaid_creds ...
[ [ "numpy.array", "numpy.setdiff1d", "matplotlib.pyplot.axhline", "pandas.DataFrame", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylim", "matplotlib.pyplot.subplots", "numpy.mean", "numpy.std", "numpy.where", "numpy.nanmean", "matplotlib.pyplot.axvline", "panda...
christiankevintraore/Regression-and-Classification-Model-Selection-Beginners-Playbook
[ "d784a6d1246a1617c3f84ab38dc6f252105f7946" ]
[ "src/models/regressors/polynomial_regression.py" ]
[ "\"\"\"polynomial_regression.py\n~~~~~~~~~~~~~~\n\nAn implementation of Polynomial Regression.\n\nDesirable features :\n - Tune the regressor input parameters for better performance.\n\n\"\"\"\n\n#### Libraries\nfrom sklearn.preprocessing import PolynomialFeatures\nfrom sklearn.linear_model import LinearRegressi...
[ [ "sklearn.preprocessing.PolynomialFeatures", "sklearn.linear_model.LinearRegression" ] ]
Mahesh1822/evalml
[ "aa0ec2379aeba12bbd0dcaaa000f9a2a62064169" ]
[ "evalml/tests/data_checks_tests/test_natural_language_nan_data_check.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom evalml.data_checks import (\n DataCheckError,\n DataCheckMessageCode,\n NaturalLanguageNaNDataCheck,\n)\n\n\ndef test_nl_nan_data_check_error():\n data = pd.DataFrame(\n {\n \"natural_language\": [\n None,\n ...
[ [ "pandas.DataFrame", "numpy.random.randint", "pandas.Series" ] ]
ajvengo/tpot-demo
[ "908e8bb6917d41c8917215666a1ff899169db536" ]
[ "tpot-demo.py" ]
[ "from tpot import TPOTClassifier\nfrom sklearn.datasets import load_digits\nfrom sklearn.model_selection import train_test_split\n\ndigits = load_digits()\nX_train, X_test, y_train, y_test = train_test_split(digits.data, digits.target,\n train_size=0.75, test_size=...
[ [ "sklearn.model_selection.train_test_split", "sklearn.datasets.load_digits" ] ]
luwei0917/LeagueOfLegends
[ "8756ce1f568a266cca03e2cfbfec3357ea2a1a16" ]
[ "helper_functions.py" ]
[ "import pandas as pd\nfrom collections import defaultdict\n\ndef getFromTranscript(data):\n d = data.split(\":\")[1]\n d = d.split(\"|\")[1]\n return d\n\ndef getToGene(data):\n try:\n gene = data.split(\"|\")[0]\n except:\n gene = \"None\"\n return gene\n\ndef getToTranscript(data):...
[ [ "pandas.read_csv" ] ]
imitrob/surftask
[ "65faada3e6a33a59a062566d7ef022ddb025fd94" ]
[ "traj_complete_ros/scripts/similarity.py" ]
[ "import numpy as np\nimport similaritymeasures\nimport matplotlib.pyplot as plt\n\n# Generate random experimental data\nx = np.random.random(100)\ny = np.random.random(100)\nexp_data = np.zeros((100, 2))\nexp_data[:, 0] = x\nexp_data[:, 1] = y\n\n# Generate random numerical data\nx = np.random.random(100)\ny = np.r...
[ [ "numpy.zeros", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "numpy.random.random" ] ]
dingmyu/Pytorch-Topology-Aware-Delineation
[ "beaedccf0f5ac5bbff873b338a46224da6aa3e74" ]
[ "seg_vgg19_3layer/lanenet.py" ]
[ "#--coding:utf-8--\nimport torch.nn as nn\nimport torch\nimport math\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"3x3 convolution with padding\"\n return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,\n padding=1, bias=False)\n\n\nclass conv2DBatchNormRelu(nn.Module...
[ [ "torch.cat", "torch.nn.MSELoss", "torch.nn.init.kaiming_normal", "torch.nn.Parameter", "torch.nn.Upsample", "torch.ones", "torch.nn.Conv2d", "torch.nn.ReLU", "torch.load", "torch.zeros_like" ] ]
youngwoon/robosuite
[ "8f77c0ce364f88902467d011aac137bb3ffbf5cb" ]
[ "robosuite/models/grippers/pushing_gripper.py" ]
[ "\"\"\"\nA version of TwoFingerGripper but always closed.\n\"\"\"\nimport numpy as np\nfrom robosuite.models.grippers.two_finger_gripper import TwoFingerGripper\n\n\nclass PushingGripper(TwoFingerGripper):\n \"\"\"\n Same as TwoFingerGripper, but always closed\n \"\"\"\n\n def format_action(self, action...
[ [ "numpy.array" ] ]
minghanz/d3d
[ "1d08013238b300489f61be57cdd20a105d16a632" ]
[ "d3d/vis/pcl.py" ]
[ "import numpy as np\n\nfrom d3d.abstraction import ObjectTarget3DArray\n\n_pcl_available = False\ntry:\n import pcl\n import pcl.visualization as pv\n _pcl_available = True\nexcept:\n pass\n\ndef visualize_detections(visualizer: pcl.Visualizer, visualizer_frame: str, targets: ObjectTarget3DArray, calib,...
[ [ "numpy.linalg.det" ] ]
mrateike/carefl
[ "ef789958bb03f316a070052b0134cc1b2b9cd456" ]
[ "data/generate_synth_data.py" ]
[ "import numpy as np\nimport torch\nfrom torch.utils.data import Dataset\n\n\ndef sigmoid(x):\n return 1. / (1 + np.exp(-x))\n\n\ndef gen_synth_causal_dat(nObs=100, causalFunc='nueralnet_l1', noise_dist='laplace'):\n \"\"\"\n generate causal data where one variable causes another\n Inputs:\n - nOb...
[ [ "numpy.random.normal", "numpy.array", "numpy.ones_like", "numpy.zeros", "numpy.random.seed", "numpy.sum", "numpy.ones", "numpy.exp", "torch.from_numpy", "numpy.random.uniform", "numpy.random.randint", "numpy.random.standard_t", "numpy.sqrt", "numpy.arange", ...
sanjoy1111/NLP
[ "97ecb4fe31bb43b97010e7ff7c503d833d816ce5" ]
[ "BagofWords.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Jan 2 22:19:40 2019\r\n\r\n@author: Krish.Naik\r\n\"\"\"\r\n\r\nimport nltk\r\n\r\nparagraph = \"\"\"I have three visions for India. In 3000 years of our history, people from all over \r\n the world have come and invaded us, captured our lands, co...
[ [ "sklearn.feature_extraction.text.CountVectorizer" ] ]
openefsa/asreview
[ "aec14fcad0532a3989befe577ceb369a9dbba243", "aec14fcad0532a3989befe577ceb369a9dbba243" ]
[ "asreview/models/nn_2_layer.py", "asreview/io/csv_reader.py" ]
[ "# Copyright 2020 The ASReview 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 requir...
[ [ "scipy.sparse.issparse", "tensorflow.logging.set_verbosity", "tensorflow.keras.regularizers.l1", "tensorflow.keras.wrappers.scikit_learn.KerasClassifier", "tensorflow.keras.layers.Dense", "tensorflow.keras.models.Sequential", "tensorflow.keras.regularizers.l2" ], [ "pandas.read...
FasT93/cognigraph
[ "d0373c1a6ca30f3627fd0d5791b0e5517d9814a0" ]
[ "tests/systemtest_mce.py" ]
[ "\"\"\"Integration test to check mce performance\"\"\"\nimport numpy as np\nnp.warnings.filterwarnings('ignore') # noqa\nimport os\nos.environ['PYQTGRAPH_QT_LIB'] = 'PyQt5' # noqa\n\nimport time\nimport sys\nimport os.path as op\n\nfrom PyQt5 import QtCore, QtGui\n\nfrom cognigraph.helpers.brainvision import read_...
[ [ "numpy.warnings.filterwarnings" ] ]
angshine/pyslam
[ "39a14a4875de84ef96fe654ecbd7465535c03f46" ]
[ "pyslam/torch_utils.py" ]
[ "from torch import autograd\n\n# jacobian计算方法1 (使用for循环)\n# 思路: 对于output中的每一个dim(每一个dim需要是一个scalar),分别计算其关于input的导数,组成jacobian矩阵\n# 缺点: 串行计算,无法利用GPU\ndef jacobian_loop(outputs, inputs, create_graph=False):\n \"\"\"Computes the jacobian of outputs with respect to inputs\n\n :param outputs: tensor for the outpu...
[ [ "torch.autograd.grad" ] ]
BrunoBreggia/Spectrogeny
[ "0bf5200457bd5f8560f1b05d06b063f5b79a2426" ]
[ "main.py" ]
[ "from BioSequence import DnaSeq\nimport numpy as np\nfrom Matrix import Matrix\nfrom BinaryTree import BinaryTree\nfrom CFPPSmethod import CFPPS\nfrom UPGMA import UPGMA\nfrom TreeDrawing import Phylogram\n\n###################################################\n## Spectrogeny\n#######################################...
[ [ "numpy.linalg.norm" ] ]
lostsword/character_recognition
[ "92380b18b47c91e16bf0d7a7e92c1669aec2572b" ]
[ "code/ctpn/src/CTPN/proposal_generator.py" ]
[ "\"\"\"CTPN proposal generator.\"\"\"\n\nimport numpy as np\nimport mindspore.nn as nn\nimport mindspore.common.dtype as mstype\nfrom mindspore.ops import operations as P\nfrom mindspore import Tensor\nfrom src.CTPN.BoundingBoxDecode import BoundingBoxDecode\n\nclass Proposal(nn.Cell):\n \"\"\"\n Proposal sub...
[ [ "numpy.ones" ] ]
prckent/qmcpack
[ "127caf219ee99c2449b803821fcc8b1304b66ee1" ]
[ "utils/afqmctools/afqmctools/wavefunction/mol.py" ]
[ "import ast\nimport h5py\nimport numpy\nimport scipy.linalg\nimport sys\nfrom pyscf import fci\nfrom afqmctools.utils.io import to_qmcpack_complex, add_group, add_dataset\n\ndef write_wfn_mol(scf_data, ortho_ao, filename, wfn=None,\n init=None, verbose=False):\n \"\"\"Generate QMCPACK trial wave...
[ [ "numpy.array", "numpy.dot", "numpy.zeros", "numpy.eye", "numpy.identity", "numpy.abs", "numpy.cumsum", "numpy.searchsorted" ] ]
zepinglee/berkeleydeeprlcourse-homework
[ "f985b82bcd2bf00f0970d26bac91dba7e4b10c82" ]
[ "hw3/plot_dqn.py" ]
[ "#!/usr/bin/env python3\n\nimport argparse\nimport logging\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pickle\n\n\ndef plot(ax, path, label):\n max_steps = 5e6\n with open(path, 'rb') as f:\n data = pickle.load(f)\n timestep = np.array(data['timestep'])\n mean_episode_reward = np...
[ [ "numpy.where", "numpy.array", "matplotlib.pyplot.subplots" ] ]
Howdy-Personally/tensorlayer-master
[ "bb92e4e187419d5e7ded8331d5c7cbf5615ee744" ]
[ "examples/basic_tutorials/tutorial_mnist_mlp_dynamic_2.py" ]
[ "import time\n\nimport numpy as np\nimport tensorflow as tf\n\nimport tensorlayer as tl\nfrom tensorlayer.layers import Dense, Dropout, Input, LayerList\nfrom tensorlayer.models import Model\n\n## enable debug logging\ntl.logging.set_verbosity(tl.logging.DEBUG)\n\n## prepare MNIST data\nX_train, y_train, X_val, y_v...
[ [ "tensorflow.optimizers.Adam", "tensorflow.GradientTape", "numpy.argmax", "tensorflow.nn.relu" ] ]
cgarciae/catalyst
[ "391ff89ab0d9a1961b88719e894f917ac0fb7fc3" ]
[ "examples/mnist_gans/transforms.py" ]
[ "# flake8: noqa\nfrom typing import Tuple, Union\n\nimport numpy as np\n\nfrom albumentations.core.transforms_interface import ImageOnlyTransform\nimport torch\n\nfrom catalyst.dl import registry\n\n\nclass AsImage(ImageOnlyTransform):\n def __init__(self, always_apply=False, p=1.0):\n super().__init__(al...
[ [ "numpy.expand_dims", "torch.tensor", "torch.randn", "numpy.zeros" ] ]
jiawen9611/vis-mmdetection
[ "7551821491208b1d15dde9de46e9b0ec2a270ea1" ]
[ "mmdet/core/bbox/transforms.py" ]
[ "import mmcv\nimport numpy as np\nimport torch\n\nimport cv2\nimport pycocotools.mask as mask_util\n\n\ndef bbox2delta(proposals, gt, means=[0, 0, 0, 0], stds=[1, 1, 1, 1]):\n assert proposals.size() == gt.size()\n\n proposals = proposals.float()\n gt = gt.float()\n px = (proposals[..., 0] + proposals[....
[ [ "torch.cat", "numpy.array", "torch.stack", "numpy.log", "numpy.zeros", "torch.log", "torch.addcmul" ] ]
shirte/datasets
[ "16ab1566d963f521a1a3df9c41a20f599078bb2e" ]
[ "tests/test_metric_common.py" ]
[ "# coding=utf-8\n# Copyright 2020 HuggingFace 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 by appl...
[ [ "numpy.array", "tensorflow.compat.v1.flags.DEFINE_string" ] ]
AmrMKayid/KayDDRL
[ "3f22a6e778e668f4665ff7bbd32ceaea67c53964" ]
[ "kayddrl/configs/default.py" ]
[ "import torch\n\n\nclass Configs(object):\n def __init__(self, **kwargs):\n self.__dict__ = dict(kwargs)\n\n def __getitem__(self, key):\n return self.__dict__[key]\n\n def __setitem__(self, key, value):\n self.__dict__[key] = value\n\n def __delitem__(self, key):\n del self....
[ [ "torch.cuda.is_available" ] ]
daweiliucsd/pahmc-ode-cpu
[ "03275a3eec45c447a5e0921cf0e7ab136b58771c" ]
[ "unit_tests/test-def_dynamics (lorenz96).py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\n@author: Zheng Fang\r\n\r\nThis is a unit test. If you would like to further develop pahmc_ode_cpu, you \r\nshould visit here frequently. You should also be familiar with the Python (3.7)\r\nbuilt-in module 'unittest'.\r\n\r\nTo run this unit test, copy this file into its paren...
[ [ "numpy.array", "numpy.array_equal", "numpy.ones", "numpy.roll", "numpy.shape", "numpy.identity", "numpy.random.uniform" ] ]
homayoonfarrahi/cycle-time-study
[ "3939d1ffa7e74eaea2ebf059290dd817f4fe084c" ]
[ "sac/utils.py" ]
[ "import math\nimport torch\n\ndef create_log_gaussian(mean, log_std, t):\n quadratic = -((0.5 * (t - mean) / (log_std.exp())).pow(2))\n l = mean.shape\n log_z = log_std\n z = l[-1] * math.log(2 * math.pi)\n log_p = quadratic.sum(dim=-1) - log_z.sum(dim=-1) - 0.5 * z\n return log_p\n\ndef logsumexp...
[ [ "torch.max" ] ]
sttollgrin/hydrus
[ "dab05074dacdbd1f9574c4afa6b35bf31f1ee36b" ]
[ "hydrus/client/ClientSerialisable.py" ]
[ "import collections\nimport cv2\nimport numpy\nimport os\nimport shutil\nimport struct\n\nfrom qtpy import QtCore as QC\nfrom qtpy import QtGui as QG\nfrom qtpy import QtWidgets as QW\n\nfrom hydrus.core import HydrusCompression\nfrom hydrus.core import HydrusData\nfrom hydrus.core import HydrusGlobals as HG\nfrom ...
[ [ "numpy.concatenate", "numpy.fromstring" ] ]
mspector/expertise
[ "6c50b794bfaeaf3a3a9ae271397f177a326d11f2" ]
[ "expertise/models/centroid_scibert/centroid_scibert.py" ]
[ "import numpy as np\n\n# import fastText as ft\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn import BCEWithLogitsLoss\nfrom expertise import utils\n\nfrom expertise.evaluators.mean_avg_precision import eval_map\nfrom expertise.evaluators.hits_at_k import eval_hits_at_k\n\nimport ipdb\n\nclass Model(torch.nn...
[ [ "torch.nn.Linear", "torch.stack", "numpy.asarray", "torch.ones", "torch.nn.BCEWithLogitsLoss" ] ]
adgilbert/med-seg
[ "825ea068c6cf5328e437e3ba85b894aeae58cf25" ]
[ "seg_utils/visualizer.py" ]
[ "import logging\nimport os\nimport random\nimport sys\nfrom subprocess import Popen, PIPE\n\nimport matplotlib.pyplot as plt\nimport mlflow\nimport numpy as np\nimport torch\nfrom PIL import Image\nfrom .utils import tensor2im, mk_clean_dir, mkdirs\n\nif sys.version_info[0] == 2:\n VisdomExceptionBase = Exceptio...
[ [ "numpy.array", "numpy.ones_like", "numpy.zeros", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "numpy.expand_dims", "matplotlib.pyplot.imshow" ] ]
gahan9/pycuda-1
[ "7cb47f1741efed8d5306bf826b821110ef8c0b60" ]
[ "test/test_driver.py" ]
[ "from __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nimport numpy as np\nimport numpy.linalg as la\nfrom pycuda.tools import mark_cuda_test, dtype_to_ctype\nimport pytest\nfrom six.moves import range\n\n\ndef have_pycuda():\n try:\n import pycuda...
[ [ "numpy.zeros_like", "numpy.array", "numpy.empty", "numpy.linalg.norm", "numpy.zeros", "numpy.random.rand", "numpy.random.randn", "numpy.arange", "numpy.random.randint", "numpy.transpose", "numpy.intp", "numpy.int32", "numpy.empty_like" ] ]
shoumikdey/PlaneSpotting2
[ "5707fcf8b3d52d8cdd702c7d92298a3862665a3f" ]
[ "planespotting/utils.py" ]
[ "import os\nimport json\nimport math\nimport numpy as np\nimport gzip\n\ndef get_all_files(filename):\n\n processing_files = []\n for root, dirs, files in os.walk(filename):\n for file in files:\n filepath = os.path.join(root, file)\n if os.path.isfile(filepath):\n ...
[ [ "numpy.array2string" ] ]
PnS2019/pnslib
[ "d1249bec0d35839fe0e5fa74efd1c2b73cecb552" ]
[ "scripts/fashion-mnist-pca.py" ]
[ "\"\"\"Perform PCA on Fashion-MNIST.\n\nAuthor: Yuhuang Hu\nEmail : yuhuang.hu@ini.uzh.ch\n\"\"\"\nfrom __future__ import print_function, absolute_import\n\nimport numpy as np\n\nfrom pnslib import utils\nfrom pnslib import ml\n\n# load data\n(train_x, train_y, test_x, test_y) = utils.binary_fashion_mnist_load(\n ...
[ [ "numpy.mean" ] ]
dantuluri/gpt-2
[ "5818a76b680aabc21482c2736cea03e329b92cf3" ]
[ "src/sm3.py" ]
[ "# coding=utf-8\n# Copyright 2019 The Google Research 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 requ...
[ [ "tensorflow.scatter_sub", "tensorflow.convert_to_tensor", "tensorflow.zeros", "tensorflow.minimum", "tensorflow.assign", "tensorflow.shape", "tensorflow.scatter_update", "tensorflow.assign_sub", "tensorflow.reshape", "tensorflow.colocate_with", "tensorflow.assign_add", ...
zhaokai-l/bag
[ "a496368ad8fc92ff0f5bf3bfb4ebaa45c540a104" ]
[ "src/bag/data/ltv.py" ]
[ "# SPDX-License-Identifier: BSD-3-Clause AND Apache-2.0\n# Copyright 2018 Regents of the University of California\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Redistributions of...
[ [ "numpy.dot", "numpy.tile", "numpy.imag", "matplotlib.pyplot.colorbar", "numpy.indices", "numpy.empty", "matplotlib.pyplot.get_cmap", "numpy.nonzero", "numpy.flipud", "numpy.argmax", "numpy.arange", "scipy.interpolate.interp1d", "numpy.zeros", "numpy.roll", ...
0h-n0/GRU-D
[ "ecf0adf067daa4b5528715908ed2b0fda9d87a76" ]
[ "model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import PackedSequence\n\n\nclass GRUDCell(nn.GRUCell):\n def __init__(self, input_size, hidden_size, bias=True):\n super(GRUDCell, self).__init__(input_size, hidden_size)\n self.input_size = input_size\n ...
[ [ "torch.nn.Linear", "torch.nn.functional.sigmoid", "torch.mul", "torch.stack", "torch.autograd.Variable", "torch.randn" ] ]
m-c-frank/Nonogram-Toolkit
[ "a6aa8975d8f39c5fa20d0f6342df584a396da205" ]
[ "src/nono_generator/random_nono.py" ]
[ "\"\"\"\nsimple file for generating random 2d binary numpy array\n\"\"\"\n\nimport numpy as np\nimport cv2\nfrom nono_generator.generate_labels import get_labels\n\n\ndef rand_pix(rows=10, cols=10):\n \"\"\"\n returns 2d binary array row x cols\n \"\"\"\n res = np.random.rand(rows, cols)\n res[res < ...
[ [ "numpy.random.rand" ] ]
bryanvriel/Gld-timeseries
[ "6741a3f427538361aa3eed412327048ca0a5b80e" ]
[ "prepStack-EHU.py" ]
[ "#!/usr/bin/env python3\n\nimport numpy as np\n# import matplotlib.pyplot as plt\nfrom scipy.ndimage.interpolation import map_coordinates\nfrom sklearn.linear_model import RANSACRegressor\nimport datetime\nfrom tqdm import tqdm\nimport glob\nimport gdal\nimport h5py\nimport sys\nimport os\n\ndef main():\n\n # Tr...
[ [ "numpy.full", "numpy.array", "numpy.ones_like", "numpy.zeros", "scipy.ndimage.interpolation.map_coordinates", "sklearn.linear_model.RANSACRegressor", "numpy.invert", "numpy.arctan", "numpy.arange", "numpy.isfinite", "numpy.argsort", "numpy.sqrt", "numpy.abs", ...
cpcloud/dpyr
[ "bc9ff911f2832be7bbbb953aab124969356fe4cd" ]
[ "dpyr/tests/test_api.py" ]
[ "import os\nimport operator\n\nfrom typing import Union, Type, Callable\n\nimport pytest\nimport _pytest as pt\n\nimport pandas as pd\nimport pandas.util.testing as tm\n\nimport ibis\nimport ibis.expr.types as ir\nimport ibis.expr.datatypes as dt\n\nfrom dpyr import (\n anti_join,\n cast,\n desc,\n dist...
[ [ "pandas.read_csv", "pandas.util.testing.assert_series_equal" ] ]
kuwarkapur/Hacktoberfest-2022
[ "efaafeba5ce51d8d2e2d94c6326cc20bff946f17" ]
[ "python/Desktop-tools-tkinter/hand-gesture-volume/hand.py" ]
[ "import cv2\r\nimport numpy as np\r\nimport time\r\nimport math\r\nimport mediapipe as mp\r\ncap =cv2.VideoCapture(0)\r\npTime=0\r\nmpHands = mp.solutions.hands\r\nhands = mpHands.Hands(min_detection_confidence=0.7)\r\nmpDraw=mp.solutions.drawing_utils\r\nfrom ctypes import cast, POINTER\r\nfrom comtypes import CLS...
[ [ "numpy.interp" ] ]
xiviu123/rlcard
[ "2a5273dff6c9dd49a3d4ab84a952fed9a387955b" ]
[ "rlcard/games/bridge/game.py" ]
[ "'''\n File name: bridge/game.py\n Author: William Hale\n Date created: 11/25/2021\n'''\n\nfrom typing import List\n\nimport numpy as np\n\nfrom .judger import BridgeJudger\nfrom .round import BridgeRound\nfrom .utils.action_event import ActionEvent, CallActionEvent, PlayCardAction\n\n\nclass BridgeGame:\n...
[ [ "numpy.random.RandomState" ] ]
aaniin/DeepPrivacy
[ "3516f6f3bf2dcb6e7ed4d86195a7c1974077cdf8" ]
[ "deep_privacy/experiments/truncation_experiment.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport os\nfrom deep_privacy import torch_utils\nfrom deep_privacy.inference import infer\nfrom deep_privacy.data_tools.dataloaders import load_dataset_files, cut_bounding_box\n\n\ndef truncated_z(z, x_in, generator, truncation_level):\n if truncation_level =...
[ [ "numpy.concatenate", "numpy.linspace", "matplotlib.pyplot.imsave" ] ]
LinZichuan/emdqn
[ "b62ec7603afd36f3fad4b37532298fbd95061445" ]
[ "baselines/deepq/simple.py" ]
[ "import numpy as np\nimport os\nimport dill\nimport tempfile\nimport tensorflow as tf\nimport zipfile\n\nimport baselines.common.tf_util as U\n\nfrom baselines import logger\nfrom baselines.common.schedules import LinearSchedule\nfrom baselines import deepq\nfrom baselines.deepq.replay_buffer import ReplayBuffer, P...
[ [ "numpy.array", "numpy.ones_like", "tensorflow.train.AdamOptimizer", "numpy.mean", "numpy.abs" ] ]
fregu856/ebms_regression
[ "95e5b513808d2ea1c2a0aea107727f6e66918f16" ]
[ "detection/maskrcnn_benchmark/structures/segmentation_mask.py" ]
[ "import cv2\r\nimport copy\r\nimport torch\r\nimport numpy as np\r\nfrom maskrcnn_benchmark.layers.misc import interpolate\r\nfrom maskrcnn_benchmark.utils import cv2_util\r\nimport pycocotools.mask as mask_utils\r\n\r\n# transpose\r\nFLIP_LEFT_RIGHT = 0\r\nFLIP_TOP_BOTTOM = 1\r\n\r\n\r\n\"\"\" ABSTRACT\r\nSegmenta...
[ [ "torch.stack", "torch.from_numpy", "torch.tensor", "torch.as_tensor", "torch.empty" ] ]
ShanzhiGu/EverybodyDanceNow_reproduce_pytorch
[ "d4d360c8269121cb7479d542727921e988307464" ]
[ "src/pix2pixHD/data/base_dataset.py" ]
[ "### Copyright (C) 2017 NVIDIA Corporation. All rights reserved. \n### Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).\nimport torch.utils.data as data\nfrom PIL import Image\nimport torchvision.transforms as transforms\nimport numpy as np\nimport random\n\n...
[ [ "numpy.maximum" ] ]
StanfordASL/NASA_ULI_Xplane_Simulator
[ "051fa492b650545442c790cf04a8cdb19632bd02" ]
[ "src/simulation/run_sim.py" ]
[ "import settings\nimport cv2\nimport mss\nimport time\nimport numpy as np\nimport sys\nimport os\n\n# make sure this is a system variable in your bashrc\nNASA_ULI_ROOT_DIR = os.environ['NASA_ULI_ROOT_DIR']\nXPC3_DIR = NASA_ULI_ROOT_DIR + '/src/'\nsys.path.append(XPC3_DIR)\n\nimport xpc3_helper\nimport xpc3\n\ndef m...
[ [ "numpy.sin", "numpy.tan", "numpy.rad2deg", "numpy.cos", "numpy.deg2rad" ] ]
heyong4725/ray
[ "3506910c5da257215d38d02f424acc4f419ddbaf" ]
[ "rllib/tests/test_rollout_worker.py" ]
[ "from collections import Counter\nimport gym\nimport numpy as np\nimport os\nimport random\nimport time\nimport unittest\n\nimport ray\nfrom ray.rllib.agents.pg import PGTrainer\nfrom ray.rllib.agents.a3c import A2CTrainer\nfrom ray.rllib.env.vector_env import VectorEnv\nfrom ray.rllib.evaluation.rollout_worker imp...
[ [ "numpy.max", "numpy.zeros_like", "numpy.min", "numpy.mean", "numpy.argmax" ] ]
kuihao/Gomoku-With-Robot-Arm
[ "b1509b22b7c31f09871abf8782ad5c42af19153c" ]
[ "ESgomoku/mcts_alphaZero.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nMonte Carlo Tree Search in AlphaGo Zero style, which uses a policy-value\nnetwork to guide the tree search and evaluate the leaf nodes\n\n@author: Junxiao Song\n\"\"\"\n\nimport numpy as np\nimport copy\n\ndef softmax(x):\n probs = np.exp(x - np.max(x))\n probs /= np.sum(prob...
[ [ "numpy.max", "numpy.array", "numpy.random.choice", "numpy.zeros", "numpy.sum", "numpy.sqrt" ] ]
morrolinux/RTM3D
[ "7f3f982070fb84dac01cc8d28280a31950406317" ]
[ "src/tools/kitti-object-eval-python/rotate_iou.py" ]
[ "#####################\n# Based on https://github.com/hongzhenwang/RRPN-revise\n# Licensed under The MIT License\n# Author: yanyan, scrin@foxmail.com\n#####################\nimport math\n\nimport numba\nimport numpy as np\nfrom numba import cuda\n\n@numba.jit(nopython=True)\ndef div_up(m, n):\n return m // n + (...
[ [ "numpy.zeros" ] ]
Christovis/wys-ars
[ "bb15f2d392842f9b32de12b5db5c86079bc97105" ]
[ "src/astrild/simcoll.py" ]
[ "import os, re, glob\nimport logging\nfrom pathlib import Path\nfrom typing import Dict, List, Optional, Tuple, Union\n\nimport yaml\nimport numpy as np\nimport pandas as pd\nimport xarray as xr\n\nfrom astrild.rays.rayramses import RayRamses\nfrom astrild.particles.ecosmog import Ecosmog\n\ndir_src = Path(__file__...
[ [ "numpy.asarray", "numpy.load", "pandas.read_hdf", "numpy.abs", "numpy.intersect1d" ] ]
Shruti478/greyatom-python-for-data-science
[ "9158bb88bff8cef99eb3cf82d1c942d9ab78c770" ]
[ "loan-analysis-/code.py" ]
[ "# --------------\n# Importing header files\r\n# Import packages\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom scipy.stats import mode \r\n\r\n\r\n\r\n# code starts here\r\n\r\n#Load Dataset\r\n\r\nbank = pd.read_csv(path)\r\n \r\n# Display categorical variable\r\n\r\ncategorical_var=bank.select_dtypes(in...
[ [ "pandas.read_csv" ] ]
Raukk/tf-keras-surgeon
[ "4bd5bbee1619970f6eab9fd10baa7a7b95799fa3" ]
[ "src/tfkerassurgeon/utils.py" ]
[ "\"\"\"Utilities used across other modules.\"\"\"\nimport warnings\nimport numpy as np\nimport collections\nfrom tensorflow.python.keras.layers import Layer\nfrom tensorflow.python.keras.activations import linear\n\n\ndef clean_copy(model):\n \"\"\"Returns a copy of the model without other model uses of its laye...
[ [ "numpy.array_equal" ] ]
yyuting/stylegan2
[ "1fd790c822b64ad8c3a1832bbdb09da173a00c43", "1fd790c822b64ad8c3a1832bbdb09da173a00c43" ]
[ "eval_video_quality.py", "dnnlib/tflib/custom_ops.py" ]
[ "import tensorflow as tf\nimport sys\nimport os\nimport numpy\nimport numpy as np\nimport skimage\nimport skimage.io\nimport dnnlib.tflib as tflib\n\ndef generate_metric(metric, drange=1, nbatches=1):\n img0 = tf.placeholder(tf.float32, (nbatches, None, None, 3))\n img1 = tf.placeholder(tf.float32, (nbatches,...
[ [ "numpy.mean", "numpy.sign", "tensorflow.sign", "tensorflow.placeholder", "tensorflow.image.ssim", "numpy.expand_dims", "tensorflow.reduce_mean", "numpy.var" ], [ "tensorflow.sysconfig.get_lib", "tensorflow.load_op_library", "tensorflow.sysconfig.get_include", "t...
rajach/spectre
[ "50ec95b4f554002f7316e9eba9306b04b078e49d" ]
[ "spectre/factors/statistical.py" ]
[ "\"\"\"\n@author: Heerozh (Zhang Jianhao)\n@copyright: Copyright 2019, Heerozh. All rights reserved.\n@license: Apache 2.0\n@email: heeroz@gmail.com\n\"\"\"\nimport torch\nimport math\nfrom .factor import CustomFactor, CrossSectionFactor\nfrom .engine import OHLCV\nfrom ..parallel import (linear_regression_1d, quan...
[ [ "torch.isnan", "torch.stack", "torch.arange", "torch.ones" ] ]
iml1111/Pytorch-Recommender
[ "2f8f205051afa5e13b2932e70e8b90b36c549012" ]
[ "src/4_AutoEncoder-Meet-Collaborative-Filtering/data_loader.py" ]
[ "import torch\nfrom torch.utils.data import Dataset, DataLoader\nimport pandas as pd\n\n\nclass KMRDDataset(Dataset):\n\n\tdef __init__(self, data_path):\n\n\t\tdata = pd.read_csv(data_path)\n\t\tself.user2idx = {origin: idx for idx, origin in enumerate(data.user.unique())}\n\t\tself.movie2idx = {origin: idx for id...
[ [ "torch.FloatTensor", "pandas.read_csv", "torch.LongTensor" ] ]
drguilbe/comp-syn
[ "89b05f2bec8a4d17ec614b079920b5fcf870fac7" ]
[ "compsyn/visualisation.py" ]
[ "import gzip\nimport os\n\nimport colorsys\nimport matplotlib.cm as cm\nimport matplotlib.colors as colors\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pylab\nimport scipy.cluster.hierarchy as sch\nimport seaborn as sns\nfrom matplotlib.offsetbox import OffsetImage, AnnotationBbox\nfrom matplotlib.t...
[ [ "numpy.random.rand", "numpy.min", "numpy.mean", "matplotlib.pyplot.xticks", "numpy.max", "matplotlib.ticker.MaxNLocator", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "scipy.cluster.hierarchy.dendrogram", "scipy.cluster.hierarchy.linkage", "numpy.array", ...
tgolsson/appJar
[ "5e2f8bff44e927e7c2bae17fccddc6dbf79952f0" ]
[ "examples/issues/issue529_b.py" ]
[ "#!/usr/bin/env python2\n\nimport sys\nsys.path.append(\"../../\")\n\nimport numpy as np\n#import matplotlib.pyplot as plt\n#from appJar import gui\n\nfrom numpy import sin, pi, arange\nfrom appJar import gui\nfrom matplotlib.backends.backend_tkagg import NavigationToolbar2TkAgg\nimport random\n\ndef getXY():\n ...
[ [ "numpy.arange" ] ]