repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
ndeutschmann/face_gans | [
"84f2e92f2f674de5052aeee1dac8c20a29190be4"
] | [
"src/models/dcgan32/dcgan32_inversion.py"
] | [
"\"\"\"A regression model to invert dcgan32 (image -> latent space vector\nIt is hardcoded but works\n\"\"\"\nimport torch\n\n\nclass DCGAN32Inverter(torch.nn.Module):\n def __init__(self, channels=32,dropout_rate=.3):\n super(DCGAN32Inverter, self).__init__()\n\n self.conv = torch.nn.Sequential(\n... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d"
]
] |
rgg81/Neural-Fictitous-Self-Play | [
"4462845f159554b9a9812e3af43d07c2b5cd2059"
] | [
"NFSP/AvgWrapper.py"
] | [
"# Copyright (c) 2019 Eric Steinberger\n\n\nimport torch\nimport torch.nn.functional as nnf\n\nfrom PokerRL.rl import rl_util\nfrom PokerRL.rl.neural.AvrgStrategyNet import AvrgStrategyNet\nfrom PokerRL.rl.neural.NetWrapperBase import NetWrapperArgsBase as _NetWrapperArgsBase\nfrom PokerRL.rl.neural.NetWrapperBase ... | [
[
"torch.no_grad",
"torch.nn.functional.softmax",
"torch.arange",
"torch.from_numpy"
]
] |
cooper-org/cooper | [
"de1c6fec6aef68ca024c017e06812c3dd453e5c4"
] | [
"tutorials/scripts/plot_max_entropy.py"
] | [
"\"\"\"\nFinding a discrete maximum entropy distribution\n===============================================\n\nHere we consider a simple convex optimization problem to illustrate how to use\n**Cooper**. This example is inspired by `this StackExchange question\n<https://datascience.stackexchange.com/questions/107366/h... | [
[
"torch.rand",
"numpy.random.seed",
"matplotlib.pyplot.subplots",
"torch.manual_seed",
"torch.all",
"numpy.stack",
"torch.tensor",
"matplotlib.pyplot.show",
"torch.log",
"torch.sum"
]
] |
jonzarecki/coord2vec | [
"4f267fdd87af7b3d3558ca834b88e9ab7c309c18"
] | [
"coord2vec/common/visualizations/photo_slider.py"
] | [
"import os\nimport pickle as pkl\n\nimport numpy as np\nfrom PIL import Image\nfrom auto_tqdm import tqdm\nfrom bokeh.layouts import column\nfrom bokeh.layouts import row\nfrom bokeh.models import CustomJS, ColumnDataSource, Slider\nfrom bokeh.models.glyphs import ImageURL\nfrom bokeh.plotting import figure\nfrom b... | [
[
"numpy.random.randint"
]
] |
IBM/neuroaikit | [
"2c26a0a1376e2773aa1fb5c3f360f419d1da1483"
] | [
"Website/Examples/MNIST_LatInh.py"
] | [
"# -*- coding: utf-8 -*-\n# ---\n# jupyter:\n# jupytext:\n# formats: ipynb,py:percent\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.3'\n# jupytext_version: 1.11.4\n# kernelspec:\n# display_name: ToolkitEnv2\n# language: python\n# ... | [
[
"tensorflow.keras.utils.to_categorical",
"tensorflow.keras.datasets.mnist.load_data",
"tensorflow.keras.layers.GlobalAveragePooling1D",
"tensorflow.keras.layers.InputLayer",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"tensorflow.keras.Sequentia... |
Ameybot/Bosch | [
"8fc81d7d95350c5c37c9f9a980c829ac9f09d555"
] | [
"backend/gradcam.py"
] | [
"import torch\r\nimport torchvision\r\nfrom torchvision.models.detection.faster_rcnn import FastRCNNPredictor\r\nimport time\r\nimport cv2\r\nimport numpy as np\r\nimport argparse\r\nimport matplotlib.pyplot as plt\r\nimport os\r\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\r\nimport pandas as pd\r\nfrom tqdm import t... | [
[
"torch.cuda.is_available",
"torch.load",
"pandas.read_csv",
"numpy.uint8",
"tensorflow.GradientTape",
"pandas.DataFrame",
"tensorflow.argmax",
"torch.tensor",
"tensorflow.squeeze",
"numpy.arange",
"numpy.expand_dims",
"torch.device",
"matplotlib.cm.get_cmap",
... |
tu-darmstadt-ros-pkg/ouster_example | [
"2b49e6a2f3dbd0462c557974a3f428915067fd2f"
] | [
"python/src/ouster/sdk/examples/reference.py"
] | [
"\"\"\"Reference implementations of common operations.\"\"\"\n\nfrom itertools import product\nfrom math import cos, pi, sin\nfrom typing import List\n\nimport numpy as np\n\nfrom ouster import client\n\n\ndef xyz_proj(metadata: client.SensorInfo,\n scan: client.LidarScan) -> np.ndarray:\n \"\"\"Comp... | [
[
"numpy.roll",
"numpy.zeros"
]
] |
xiaoyufenfei/EDDSNet | [
"dcca15ce41bb3ab475fdfc1756db3cc2882a80ed",
"dcca15ce41bb3ab475fdfc1756db3cc2882a80ed"
] | [
"models/our_net.py",
"datasets/pascal_voc_loader.py"
] | [
"# ERFNet full model definition for Pytorch\n# Sept 2017\n# Eduardo Romera\n#######################\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.init as init\nimport torch.nn.functional as F\n\n# shuffle operation from https://github.com/jaxony/ShuffleNet/blob/master/model.py\ndef channel_shuffle(x, grou... | [
[
"torch.nn.ModuleList",
"torch.nn.MaxPool2d",
"torch.nn.functional.upsample",
"torch.nn.BatchNorm2d",
"torch.transpose",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.functional.relu",
"torch.nn.Dropout2d"
],
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"... |
Lunchb0ne/PConv-Keras | [
"bf0d971cfeb7db029893c53668e3856918100c76",
"bf0d971cfeb7db029893c53668e3856918100c76"
] | [
"libs/util.py",
"libs/gconv_layer.py"
] | [
"import os\nfrom random import randint, seed\nimport numpy as np\nimport cv2\n\n\nclass MaskGenerator():\n\n def __init__(self,\n height, width, channels=3, rand_seed=None, filepath=None,\n rotation=True, dilation=True, cropping=True, invert=False,\n random_draws=70, target_ratio=None\n )... | [
[
"numpy.random.choice",
"numpy.zeros",
"numpy.ones",
"numpy.mean",
"numpy.random.randint"
],
[
"tensorflow.keras.backend.sigmoid",
"tensorflow.python.framework.tensor_shape.TensorShape",
"tensorflow.keras.layers.InputSpec",
"tensorflow.keras.backend.concatenate",
"tensor... |
Rafael-Romano/Python | [
"ca105e6f56737b99ce773720017c531790327894"
] | [
"Covid-19.py"
] | [
"import covid19pandas as cod\nimport matplotlib.pyplot as plt\nler = cod.get_deaths()\nplt.pie(ler['3/30/20'],labels=ler['Country/Region'], autopct=\"%1.0f%%\")\nplt.show()\n\n\n"
] | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.pie"
]
] |
Vokda/master_thesis | [
"7fee16ec31c2b10592cbb525b643d241bc526165"
] | [
"scripts/histogram_weights.py"
] | [
"import sys\nimport matplotlib.pyplot as plt\nimport math\n\nif len(sys.argv) < 1:\n sys.exit(\"usage: %s [*.weights]\" %sys.argv[0])\n\ndata_file = sys.argv[1]\ndata=[]\nwith open(data_file) as f:\n line = next(f)\n for x in line.split():\n data+=[float(x)]\n\n#print data\n\nn, bins, patches = plt.... | [
[
"matplotlib.pyplot.show"
]
] |
yzl19940819/test | [
"f001960b7359f3a88b7dd96e1f34500b90566ceb"
] | [
"paddlex/cv/models/slim/visualize.py"
] | [
"# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.ylabel",
... |
tritemio/lmfit-py | [
"9002013a853efa50d11fdbcfafa4b17216bcc3ff"
] | [
"tests/lmfit_testutils.py"
] | [
"from lmfit import Parameter\nfrom numpy.testing import assert_allclose\n\ndef assert_paramval(param, val, tol=1.e-3):\n \"\"\"assert that a named parameter's value is close to expected value\"\"\"\n\n assert(isinstance(param, Parameter))\n pval = param.value\n\n assert_allclose([pval], [val], rtol=tol,... | [
[
"numpy.testing.assert_allclose"
]
] |
akhakimova/openvino | [
"519951a4a9f979c1b04529dda821111c56113716"
] | [
"tools/pot/openvino/tools/pot/algorithms/finetuning/layers.py"
] | [
"# Copyright (C) 2020-2021 Intel Corporation\n# SPDX-License-Identifier: Apache-2.0\n\nimport numpy as np\nimport torch\n\nfrom openvino.tools.pot.graph import node_utils as nu\nfrom openvino.tools.pot.utils.logger import get_logger\nfrom .utils import get_weight_node\n\nlogger = get_logger(__name__)\n\n\n# pylint:... | [
[
"numpy.array",
"torch.nn.Parameter",
"torch.from_numpy",
"torch.nn.functional.linear",
"torch.tensor",
"numpy.abs",
"torch.nn.functional.pad",
"torch.nn.functional.conv2d"
]
] |
norlandrhagen/verde | [
"b53ae759bf56b82637b2c8d041018780c1076132"
] | [
"verde/tests/test_minimal.py"
] | [
"# Copyright (c) 2017 The Verde Developers.\n# Distributed under the terms of the BSD 3-Clause License.\n# SPDX-License-Identifier: BSD-3-Clause\n#\n# This code is part of the Fatiando a Terra project (https://www.fatiando.org)\n#\n\"\"\"\nA minimal integration test to make sure the most critical parts of Verde wor... | [
[
"numpy.testing.assert_allclose"
]
] |
15103669921/automl | [
"14548b7175e093c9f0586b372180c41ffc04fbc1"
] | [
"efficientdet/backbone/efficientnet_model.py"
] | [
"# Copyright 2020 Google Research. 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.compat.v1.keras.layers.Dropout",
"tensorflow.compat.v1.nn.avg_pool",
"tensorflow.compat.v1.keras.layers.Dense",
"tensorflow.compat.v1.name_scope",
"numpy.zeros",
"tensorflow.compat.v1.add",
"numpy.meshgrid",
"tensorflow.compat.v1.squeeze",
"tensorflow.compat.v1.iden... |
BogdanBintu/Megafish | [
"bc310172b4e85813d8cfc44b55ffec3bd5dc3a3c"
] | [
"storm_control/sc_hardware/thorlabs/ucScientificCamera.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nCaptures pictures from a Thorlabs Scientific series cameras (such as Zelux).\nThis follows the structure of uc480 written by Hazen\n\nRun python setup.py install inside: Temp1_Scientific_Camera_Interfaces-Rev_H.zip\\Scientific Camera Interfaces\\SDK\\Python Compact Scientific Camera ... | [
[
"numpy.max",
"numpy.zeros",
"numpy.sum",
"numpy.copy",
"numpy.arange",
"numpy.clip",
"numpy.average"
]
] |
adematti/legacysim | [
"3a0106039e54dbad4ddcaa6141a5edaccf8e26be"
] | [
"py/tests/test_runbrick.py"
] | [
"import os\nimport logging\nimport shutil\n\nimport numpy as np\nimport fitsio\nfrom legacypipe.catalog import read_fits_catalog\nfrom tractor.basics import PointSource\nfrom tractor.galaxy import DevGalaxy\nfrom tractor.sersic import SersicGalaxy\nfrom legacypipe import runbrick as lprunbrick\nfrom legacypipe.surv... | [
[
"numpy.concatenate",
"numpy.random.RandomState",
"numpy.sort",
"numpy.sqrt",
"numpy.argsort",
"numpy.all"
]
] |
gyalpodongo/6.0002_PSETs_Fall_2020_MIT | [
"210d5ba96113624376f5ce1afab083029f021800"
] | [
"2_ps6/ps6_test.py"
] | [
"import unittest\nimport numpy as np\nimport math\nimport warnings\nfrom sklearn.datasets import make_blobs\n\nimport ps6 as ps6\n\nclass TestPS6(unittest.TestCase):\n \n \n \n def test_01_prep_dataset(self):\n raw_data = np.random.randint(10, size=(10,100))\n prepped_data = ps6.prep_datas... | [
[
"numpy.array",
"numpy.array_equal",
"sklearn.datasets.make_blobs",
"numpy.sum",
"numpy.random.randint"
]
] |
iamunr4v31/NewsCluster | [
"1266e31b2fd7b6fb15d7a3cd23b80fcf2e58a691"
] | [
"csv_df.py"
] | [
"import csv\r\nimport pandas as pd\r\nfrom scraper import scraper\r\n\r\n\r\nLINKS = ['https://timesofindia.indiatimes.com/', 'https://www.thehindu.com/', 'https://www.bbc.com/news', 'https://www.theguardian.co.uk/']\r\n\r\ndef create_df(content_list):\r\n '''\r\n To write the data to csv file\r\n ... | [
[
"pandas.DataFrame"
]
] |
tvlearn/evo | [
"772a9493ae805831f6730654708a26d8db560707"
] | [
"examples/image-inpainting/viz.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright (C) 2022 Machine Learning Group of the University of Oldenburg.\n# Licensed under the Academic Free License version 3.0\n\nfrom __future__ import division, print_function\n\nimport os\nimport re\nimport glob\nimport numpy as np\nfrom utils import eval_fn\nimport matplotlib\nfro... | [
[
"matplotlib.use",
"numpy.max",
"numpy.ceil",
"numpy.isnan",
"matplotlib.ticker.MaxNLocator",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"numpy.nanmin",
"matplotlib.pyplot.figure",
"numpy.min",
"numpy.ndim",
"numpy.argsort",
"numpy.sqrt",
"numpy.... |
ultimus11/Dynamic-HSV-Thresholding | [
"066fb73163e6793987d68386be62c4cd966afe45"
] | [
"code/hsv_thresh.py"
] | [
"import cv2\r\nimport numpy as np\r\n\r\ndef nothing(x):\r\n pass\r\n\r\n# Load image\r\nimage = cv2.imread('1.jpg')\r\n\r\n# Create a window\r\ncv2.namedWindow('image')\r\n\r\n# Create trackbars for color change\r\n# Hue is from 0-179 for Opencv\r\ncv2.createTrackbar('HMin', 'image', 0, 179, nothing)\r\ncv2.cre... | [
[
"numpy.array"
]
] |
7wik/joint-vae | [
"4ba1ba7c202cb7c2dd8f1467e1f1b82ef5efd344"
] | [
"jointvae/models.py"
] | [
"import torch\nfrom torch import nn, optim\nfrom torch.nn import functional as F\n\nEPS = 1e-12\n\n\nclass VAE(nn.Module):\n def __init__(self, img_size, latent_spec, temperature=.67, use_cuda=False):\n \"\"\"\n Class which defines model and forward pass.\n\n Parameters\n ----------\n... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.Sigmoid",
"torch.nn.Sequential",
"torch.max",
"torch.nn.ConvTranspose2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.functional.softmax",
"torch.log",
"torch.exp"
]
] |
godotalgorithm/quantum-metropolis | [
"83f31da2a1b9eadac14113bfdf8d79709eaea91e"
] | [
"figure2.py"
] | [
"import numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\nimport itertools\n\n# switch to Physical Review compatible font\nmatplotlib.rcParams['text.usetex'] = True\nmatplotlib.rcParams['text.latex.preamble'] = r'\\usepackage{amsmath,amssymb,txfonts}'\nmatplotlib.r... | [
[
"numpy.log",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"numpy.loadtxt",
"numpy.power",
"numpy.logspace"
]
] |
stefanoborto/optimization-equilibrium-dcm | [
"3b671d42bdcc6908c02aa0b3f1cb13dc866c1f6d"
] | [
"case-study-intercity-travel/nested_logit.py"
] | [
"# General\r\nimport numpy as np\r\n\r\n# Data\r\nimport data_intercity as data_file\r\n\r\ndef logsumNestedLogitRegulator(data):\r\n \r\n data['LogitUtility'] = np.empty([data['I_tot'],data['N'],data['R']])\r\n data['Logsum'] = np.empty([data['I_tot'],data['N'],data['R']])\r\n\r\n #PART 1: LOGIT\r\n ... | [
[
"numpy.empty",
"numpy.exp",
"numpy.power"
]
] |
icsme2020/WS-DREAM | [
"80a97f0a5cc272596d96fa86f4b5a42ae76e437c"
] | [
"benchmarks/time-aware/PMF/evaluator.py"
] | [
"########################################################\r\n# evaluator.py\r\n# Author: Jamie Zhu <jimzhu@GitHub>\r\n# Created: 2014/2/6\r\n# Last updated: 2015/8/30\r\n########################################################\r\n\r\nimport numpy as np\r\nimport time\r\nfrom commons.utils import logger # import fro... | [
[
"numpy.where"
]
] |
airalcorn2/vqvae-pytorch | [
"021a7d79cbde845dd322bc0b97f37b08230d3cdc"
] | [
"vqvae.py"
] | [
"# Ported from: https://github.com/deepmind/sonnet/blob/v2/examples/vqvae_example.ipynb.\n\nimport torch\n\nfrom torch import nn\nfrom torch.nn import functional as F\n\n\nclass ResidualStack(nn.Module):\n def __init__(self, num_hiddens, num_residual_layers, num_residual_hiddens):\n super().__init__()\n ... | [
[
"torch.zeros",
"torch.nn.functional.one_hot",
"torch.relu",
"torch.nn.ModuleList",
"torch.nn.Sequential",
"torch.no_grad",
"torch.nn.ConvTranspose2d",
"torch.FloatTensor",
"torch.nn.Parameter",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
Pandinosaurus/keras-idiomatic-programmer | [
"760e4a86892c5684907dc66aa96ebc3b0897f608"
] | [
"zoo/senet/se_resnet_c.py"
] | [
"# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"tensorflow.keras.layers.Add",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.Model",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.regularizers.l2",
"tensorflow.keras.Input",
"tensorflow.keras.layers.ZeroPadding2D... |
philthiel/Ensembler | [
"943efac3c673eb40165927e81336386788e3a19f"
] | [
"ensembler/conditions/box_conditions.py"
] | [
"import numpy as np\n\nfrom ensembler.conditions._basicCondition import _conditionCls\nfrom ensembler.util.ensemblerTypes import systemCls as systemType, Iterable, Number, Union\n\n\nclass _boundaryCondition(_conditionCls):\n \"\"\"\n This parent class is defining some functions for the actual box conditions... | [
[
"numpy.max",
"numpy.array",
"numpy.squeeze",
"numpy.min"
]
] |
dkow72/singstatdata | [
"5592b40864d5a6cb025efd7e5eba58d703d123e3"
] | [
"singstatdata/singstatdata.py"
] | [
"import requests\nimport pandas as pd\nimport re\nfrom requests.exceptions import HTTPError\nfrom IPython.display import display \n\ndef get_json(url, params=None):\n if params != None:\n try:\n response = requests.get(url, params=params)\n response.raise_for_status()\n re... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
Siemingfong/Credit-AI-Doctor | [
"13ec201cfcdb1354ec3ab89514db087f5ec67789"
] | [
"old/twrating_crawler.py"
] | [
"from bs4 import BeautifulSoup\nfrom tqdm import trange\nimport pandas as pd\nimport requests\nimport sys\n\n\ndef main(params):\n url = 'https://www.taiwanratings.com/portal/front/sp?fbclid=IwAR2h6sYLuv_ZrfpIX_Li4X0CLAnTM4stgQqLVCkGzw77lM7yXcGTCYYluh0'\n response = requests.get(url)\n content = response.c... | [
[
"pandas.DataFrame"
]
] |
rosspalmer/DataTools | [
"7857e68af56e243598dd6b0e95aa1cc592df4b6b"
] | [
"dtools/evaluate.py"
] | [
"import pandas as pd\n\ndef threshold_analysis(model, cv_iterator, feat, param):\n\n res = pd.DataFrame()\n\n cv_num = 1\n\n for train_index, test_index in cv_iterator:\n\n mod = model.fit(feat, param, train_index)\n pred, act = model.predict(mod, feat,\n para... | [
[
"pandas.DataFrame"
]
] |
liesaweigert/shap | [
"334cd2cef7a35a0b05b109587c94a383a4eeb26f"
] | [
"tests/explainers/test_tree.py"
] | [
"import matplotlib\nimport numpy as np\nmatplotlib.use('Agg')\nimport shap\n\n\ndef test_front_page_xgboost():\n try:\n import xgboost\n except Exception as e:\n print(\"Skipping test_front_page_xgboost!\")\n return\n import shap\n\n # load JS visualization code to notebook\n sha... | [
[
"numpy.random.choice",
"numpy.exp",
"numpy.mean",
"sklearn.feature_extraction.text.CountVectorizer",
"numpy.random.normal",
"numpy.log",
"pandas.DataFrame",
"matplotlib.use",
"numpy.square",
"numpy.array",
"sklearn.ensemble.GradientBoostingRegressor",
"numpy.matmul"... |
Ayushk4/MedImaging | [
"dbc8968f076385be0c8db42210817ae0940fa26a"
] | [
"transformers/mt_train.py"
] | [
"import random\nimport torch \nimport numpy as np\nimport torchvision\nfrom torch import nn\nfrom tqdm import tqdm\nimport mt_loader as loader\nfrom datetime import datetime\nimport timm\nimport os\nfrom utils import accuracy\n\nMODEL_NAME = 'vit_base_patch16_224'#'tf_efficientnet_b4_ns'\nDEVICE = torch.device(\"cu... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.Sigmoid",
"torch.nn.LeakyReLU",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.utils.data.DataLoader",
"torch.nn.BCELoss",
"torch.load",
"torch.randn"
]
] |
JiahaoYao/Cirq | [
"b8334a190f9236d6874dd1403eaf36d98f417594"
] | [
"cirq-google/cirq_google/api/v2/results.py"
] | [
"# Copyright 2019 The Cirq Developers\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 o... | [
[
"numpy.array",
"numpy.pad",
"numpy.packbits",
"numpy.unpackbits",
"numpy.frombuffer"
]
] |
nodtem66/ca-hub-rpi | [
"898c893c1a6944a999919a69d1f9527cb2af096b"
] | [
"ringbuffer/example_numpy.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"Simple example with numpy arrays.\"\"\"\n\nimport multiprocessing\n\nimport numpy\nimport numpy.matlib\nimport ringbuffer\n\n\ndef writer(ring):\n for i in range(10000):\n m = numpy.matlib.randn(25, 100)\n x = numpy.ctypeslib.as_ctypes(m)\n try:\n ... | [
[
"numpy.linalg.norm",
"numpy.matlib.asmatrix",
"numpy.matlib.randn",
"numpy.frombuffer",
"numpy.ctypeslib.as_ctypes"
]
] |
Daesung-Jung/baseball_pitchdesign | [
"d4dc1eb5fb42bbf0bb3564be8def0492b80a0074"
] | [
"yolov5/utils/loss.py"
] | [
"# Loss functions\n\nimport torch\nimport torch.nn as nn\n\nfrom utils.metrics import bbox_iou\nfrom utils.torch_utils import is_parallel\n\n\ndef smooth_BCE(eps=0.1): # https://github.com/ultralytics/yolov3/issues/238#issuecomment-598028441\n # return positive, negative label smoothing BCE targets\n return ... | [
[
"torch.zeros",
"torch.sigmoid",
"torch.cat",
"torch.arange",
"torch.max",
"torch.argsort",
"torch.ones",
"torch.abs",
"torch.full_like",
"torch.tensor",
"torch.nn.BCEWithLogitsLoss",
"torch.ones_like",
"torch.zeros_like",
"torch.exp"
]
] |
tcrundall/chronostar | [
"bdb5cd965e862ba5cc21bee75d5c8620e106c0cc"
] | [
"unit_tests/mpi_script.py"
] | [
"#from schwimmbad import MPIPool, MultiPool\r\nimport emcee\r\nfrom emcee.utils import MPIPool\r\nimport sys\r\nif sys.version[0] == '2':\r\n from cPickle import PicklingError\r\nelse:\r\n from _pickle import PicklingError\r\nimport numpy as np\r\n\r\nclass not_really_a_class(object):\r\n def __init__(self... | [
[
"numpy.random.uniform"
]
] |
buoyancy99/glove | [
"aa0e6eaaaafb47fc3a5d4eb693c8f24e90b8f402"
] | [
"riss2018/check_synonyms.py"
] | [
"\"\"\"Author: Brandon Trabucco.\nGets the closest neighbors to the given words in embedding space.\n\"\"\"\n\n\nimport glove\nimport glove.configuration\nimport glove.neighbors\n\n\nimport numpy as np\nimport json\n\n\nif __name__ == \"__main__\":\n\n\n config = glove.configuration.Configuration(\n embed... | [
[
"numpy.linalg.norm"
]
] |
Noba1anc3/Faster-RCNN-tensorflow2 | [
"c908dc7a99981b3fab8062af44838943ab5b82d9"
] | [
"detection/models/rpn_heads/rpn_head.py"
] | [
"from tensorflow.keras import layers\n\nfrom detection.core.bbox import transforms\nfrom detection.utils.misc import *\n\nfrom detection.core.anchor import anchor_generator, anchor_target\nfrom detection.core.loss import losses\n\n\nclass RPNHead(tf.keras.Model):\n\n def __init__(self,\n anchor_s... | [
[
"tensorflow.keras.layers.Conv2D"
]
] |
chao-tan/TCLNet | [
"4f48bd3430d8915e5407f0f22aa6676fc2f48957"
] | [
"evaluation.py"
] | [
"import numpy as np\r\n\r\ndef calculate_l2_distance(predictions):\r\n targets = np.load('datasets/data/TCLD/TEST_LABEL.npy').astype(np.float)\r\n predictions = predictions.astype(np.float)\r\n targets = targets[1:,:]\r\n predictions = predictions[1:,:]\r\n targets = targets * 512.\r\n predictions... | [
[
"numpy.sum",
"numpy.load",
"numpy.mean",
"numpy.power",
"numpy.sqrt"
]
] |
fornaxai/pyparams | [
"f0d70c06f7d3a4710dfa5fcafe5f2801491f19d0"
] | [
"resources/modules_samples/fun_module_import.py"
] | [
"from pyparams import *\nimport numpy as np\n\nmatmul1: Module = IncludeModule(\"fun_module\", scope=\"a\")\nmatmul2: Module = IncludeModule(\"fun_module\", scope=\"b\")\nsome_param: int = PyParam(4, scope=\"some_param\")\n\nW = np.random.rand(10, 10)\nX = np.random.rand(10, 1)\nY = matmul1.matmul(W, X)\nY = matmul... | [
[
"numpy.random.rand"
]
] |
Yukyin/AM-GCN | [
"136d40711afcf2b1f4bbdc66b4a4180c25fda749"
] | [
"AMGCN/utils.py"
] | [
"import numpy as np\nimport scipy.sparse as sp\nimport torch\nimport sys\nimport pickle as pkl\nimport numpy as np\nimport networkx as nx\n\ndef common_loss(emb1, emb2):\n emb1 = emb1 - torch.mean(emb1, dim=0, keepdim=True)\n emb2 = emb2 - torch.mean(emb2, dim=0, keepdim=True)\n emb1 = torch.nn.functional.... | [
[
"numpy.genfromtxt",
"torch.ones",
"torch.LongTensor",
"torch.eye",
"torch.Size",
"scipy.sparse.diags",
"scipy.sparse.eye",
"scipy.sparse.csr_matrix",
"numpy.vstack",
"numpy.array",
"numpy.zeros",
"torch.mm",
"numpy.loadtxt",
"numpy.power",
"scipy.sparse.... |
hci-unihd/batchlib | [
"e7e4ce34228346c5dcf1d1f01c512d5fad5ba5c1"
] | [
"test/test_workflows.py"
] | [
"import os\nimport unittest\nfrom abc import ABC\nfrom glob import glob\nfrom shutil import rmtree\n\nimport numpy as np\n\nfrom batchlib.workflows import run_cell_analysis, cell_analysis_parser\nfrom batchlib.workflows.mean_and_sum_cell_analysis import mean_and_sum_cell_analysis\nfrom batchlib.util import read_tab... | [
[
"numpy.array_equal"
]
] |
seungwonpark/LearningToProtect | [
"b0b4367acd8f998b2eff18ed34eeb7bd3e9a14ed"
] | [
"nncrypt/train.py"
] | [
"import os\nimport math\nimport tqdm\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport itertools\nimport traceback\n\nfrom .model import Alice, Bob, Eve\nfrom .validation import validate\n\n\ndef train(args, trainloader, valloader, writer, logger, hp, hp_str):\n alice = Alice(hp).cuda... | [
[
"torch.no_grad",
"torch.nn.L1Loss"
]
] |
ahrvoje/colorio | [
"90abeb509cea50f7f9a6eb02d38bfbe409a5a257"
] | [
"test/test_observers.py"
] | [
"# -*- coding: utf-8 -*-\n#\nimport matplotlib.pyplot as plt\nimport pytest\n\nimport colorio\n\n\n@pytest.mark.parametrize('observer', [\n colorio.observers.cie_1931_2(),\n colorio.observers.cie_1964_10(),\n ])\ndef test_observers(observer):\n lmbda, data = observer\n\n # For plot colors, take the S... | [
[
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
]
] |
weras2/BatchLabelMap | [
"56af3d20df79f6b10a5d932278a33d02020d1e59"
] | [
"BatchLabelMap/automatic/pydicom/dataset.py"
] | [
"# Copyright 2008-2018 pydicom authors. See LICENSE file for details.\n\"\"\"Define the Dataset and FileDataset classes.\n\nThe Dataset class represents the DICOM Dataset while the FileDataset class\nadds extra functionality to Dataset when data is read from or written to file.\n\nOverview of DICOM object model\n--... | [
[
"numpy.asarray"
]
] |
mmabrouk/seaborn | [
"2894b1eeb2810f795a62acd3bb6426c2904692cb"
] | [
"seaborn/tests/test_algorithms.py"
] | [
"import numpy as np\nfrom scipy import stats\nfrom ..external.six.moves import range\n\nimport numpy.testing as npt\nfrom numpy.testing import assert_array_equal\nimport nose.tools\nfrom nose.tools import assert_equal, raises\n\nfrom .. import algorithms as algo\n\nrs = np.random.RandomState(sum(map(ord, \"test_alg... | [
[
"numpy.array",
"numpy.dot",
"numpy.triu_indices",
"numpy.median",
"numpy.testing.assert_array_equal",
"numpy.ones",
"numpy.testing.assert_array_less",
"scipy.stats.percentileofscore",
"numpy.corrcoef",
"numpy.vstack"
]
] |
virtualclone/reverb | [
"ab7458a707101aaad7c28da9bafd837c7044f563"
] | [
"reverb/server_test.py"
] | [
"# Lint as: python3\n# Copyright 2019 DeepMind Technologies Limited.\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# Unles... | [
[
"tensorflow.TensorSpec"
]
] |
khushbooG9/nvm | [
"c065af6ae1cb330cf0716d35bc4aebd46547888e"
] | [
"src/graveyard/nvm_viz.py"
] | [
"import multiprocessing as mp\nimport Tkinter as tk\nimport PIL as pil\nimport PIL.ImageTk as itk # on fedora 24 needed $ dnf install python-pillow-tk\nimport numpy as np\nimport time\n\nclass NVMViz:\n def __init__(self, pipe_to_nvm, history=512, padding=16):\n self.pipe_to_nvm = pipe_to_nvm\n sel... | [
[
"numpy.array",
"numpy.roll",
"numpy.zeros"
]
] |
Nabel0721/pandas | [
"82ccf04142a32fddbb202d6dcaed36915d942333"
] | [
"pandas/core/frame.py"
] | [
"\"\"\"\nDataFrame\n---------\nAn efficient 2D container for potentially mixed-type time series or other\nlabeled data series.\n\nSimilar to its R counterpart, data.frame, except providing automatic data\nalignment and a host of useful data manipulation methods having to do with the\nlabeling information\n\"\"\"\ni... | [
[
"pandas.core.ops.add_flex_arithmetic_methods",
"pandas.core.common.asarray_tuplesafe",
"pandas.core.dtypes.common.is_float_dtype",
"pandas.core.dtypes.cast.maybe_convert_platform",
"pandas.core.common._unpickle_array",
"numpy.empty",
"pandas.io.formats.style.Styler",
"pandas.core.c... |
nguyenpe17/sqlalchemy-challenge | [
"36c0257750bf97bd8db7dd38d73b83756ce08b14"
] | [
"climate-app.py"
] | [
"import numpy as np\nimport pandas as pd\nimport datetime as dt\nimport sqlalchemy\nfrom sqlalchemy.ext.automap import automap_base\nfrom sqlalchemy.orm import Session\nfrom sqlalchemy import create_engine, func\nfrom flask import Flask, jsonify\n\nengine = create_engine(\"sqlite:///Resources/hawaii.sqlite\", conne... | [
[
"numpy.ravel"
]
] |
kevjn/simplegrad | [
"08b31d588904b890df2e377e5e0591b3ad9273fa"
] | [
"accel/symbolic.py"
] | [
"import numpy as np\nimport itertools as it\n\nclass SymbolicArray(np.ndarray):\n def __new__(cls, arr, symbolic=None, **kwargs):\n if isinstance(arr, cls):\n return arr\n\n arr = np.array(arr, copy=False, **kwargs)\n obj = arr.view(cls)\n obj.symbolic = str(symbolic or np.... | [
[
"numpy.array",
"numpy.core.overrides.array_function_dispatch",
"numpy.array2string"
]
] |
franceoliver/workflow_demo | [
"8c6b0fa547ebe1f74463c68bdaa277b2282dcfcb"
] | [
"RDA_module/module/wage_trust_rda/_db_data.py"
] | [
"import pandas as pd\nimport psycopg2\nimport psycopg2.extras\n\nclass DBData():\n def __init__(self, schema='wage_trust_demo'):\n self._CSTR = {\n 'user' : 'postgres',\n 'password' : 'docker',\n 'host' : 'wage_trust_db'\n }\n self._schema = schema... | [
[
"pandas.read_sql"
]
] |
Akshaysharma29/tapas | [
"8c711670ffbda7650eae0f63bd1b4e90cf5020c4"
] | [
"tapas/datasets/table_dataset_test.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | [
[
"tensorflow.compat.v1.disable_v2_behavior",
"numpy.testing.assert_equal",
"numpy.testing.assert_almost_equal",
"numpy.random.seed"
]
] |
xiaonanchong/facenet-pytorch | [
"1414156b3cd90846b7ebfbb6261b2c59f3d50a0b"
] | [
"general_test.py"
] | [
"#config_file = 'casia_face_regis_list.txt'\n#test_file = 'casia_face_test_list.txt'\nconfig_file = 'ms1m_face_regis_list.txt'\ntest_file = 'ms1m_face_test_list.txt'\n\nimport torch\nfrom torch.utils.data import DataLoader\nfrom torchvision import datasets\nimport numpy as np\nimport pandas as pd\nimport os\n\n\nde... | [
[
"torch.device",
"torch.stack"
]
] |
PierreTsr/EEND | [
"bbaf8286f83c05c65c73d2820601a117b8faa382"
] | [
"eend/chainer_backend/train.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright 2019 Hitachi, Ltd. (author: Yusuke Fujita)\n# Licensed under the MIT license.\n#\nimport os\nimport numpy as np\nimport chainer\nfrom chainer import optimizers\nfrom chainer import serializers\nfrom chainer import iterators\nfrom chainer import training\nfrom chainer.training ... | [
[
"numpy.random.seed"
]
] |
laekov/Megatron-LM | [
"37cec9af5ce93cd0da05a52513928bf55b70f3ac"
] | [
"megatron/data/bert_dataset.py"
] | [
"# coding=utf-8\n# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0... | [
[
"numpy.random.RandomState",
"numpy.load",
"numpy.save",
"torch.LongTensor",
"torch.distributed.get_rank",
"numpy.iinfo"
]
] |
wethepeopleonline/law-net | [
"e8b01136360078c89b666e2b127672644ed0c54b"
] | [
"vertex_metrics_experiment/chalboards/rankscore_experiment_search.py"
] | [
"import glob\nimport numpy as np\nimport random as random\nimport pandas as pd\nfrom math import *\nfrom datetime import datetime\n\nfrom experiment_helper_functions import *\nfrom pipeline_helper_functions import *\nfrom attachment_model_inference import *\n\n\ndef get_rankscores_search(G, test_params, metrics, su... | [
[
"pandas.DataFrame",
"pandas.Series"
]
] |
sinamalakouti/vilbert-multi-task | [
"e4720ff767e342b7978f4b3ffbd16312ba4db459",
"e4720ff767e342b7978f4b3ffbd16312ba4db459",
"e4720ff767e342b7978f4b3ffbd16312ba4db459"
] | [
"cluster_vilbert.py",
"vilbert/main.py",
"script/prepare_file.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport argparse\nimport json\nimport logging\nimport os\nimport random\nfrom io import open\nimport numpy as np\nimport math\n\nfrom ... | [
[
"torch.device",
"torch.distributed.is_available",
"numpy.array",
"torch.utils.data.RandomSampler",
"sklearn.cluster.MiniBatchKMeans",
"numpy.random.seed",
"torch.distributed.init_process_group",
"torch.no_grad",
"torch.is_tensor",
"torch.cuda.device_count",
"torch.manua... |
ZNHU/tf-keras-vis | [
"6e010665d697195b7e3e39c9bd63c30ff5730975"
] | [
"tf_keras_vis/gradcam.py"
] | [
"import warnings\n\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow.keras.backend as K\nfrom packaging.version import parse as version\nfrom scipy.ndimage.interpolation import zoom\nfrom tensorflow.python.keras.layers.convolutional import Conv\n\nfrom tf_keras_vis import ModelVisualization\nfrom tf_k... | [
[
"tensorflow.keras.backend.sum",
"tensorflow.GradientTape",
"numpy.sum",
"tensorflow.keras.backend.relu",
"numpy.ones",
"tensorflow.reshape",
"tensorflow.keras.Model",
"scipy.ndimage.interpolation.zoom",
"tensorflow.keras.optimizers.RMSprop",
"tensorflow.cast"
]
] |
cpagravel/randomness_testsuite | [
"90576ed92c6cdafc34658fc2b1e159fdb5b0fa66"
] | [
"nist80022/RandomExcursions.py"
] | [
"from typing import List, Tuple\n\nimport numpy as np\nfrom scipy.special import erfc\nfrom scipy.special import gammaincc\n\nclass RandomExcursions:\n\n @staticmethod\n def random_excursions_test(\n binary_data:str, verbose=False, state=1\n ) -> List[Tuple[str, float, bool]]:\n \"\"\"\n ... | [
[
"numpy.array",
"numpy.clip",
"numpy.zeros",
"numpy.where",
"numpy.transpose",
"numpy.abs",
"numpy.append",
"numpy.cumsum",
"scipy.special.gammaincc"
]
] |
rkiman/wdwarfdate | [
"ffcc07016337dc14cffd983674c64400ca7e57cd"
] | [
"wdwarfdate/wdwarfdate.py"
] | [
"import numpy as np\nfrom astropy.table import Table\nimport matplotlib.pyplot as plt\nimport os\nimport emcee\nimport corner\nfrom .cooling_age import calc_cooling_age, get_cooling_model\nfrom .ifmr import calc_initial_mass, ifmr_bayesian\nfrom .ms_age import calc_ms_age, get_isochrone_model\nfrom .extra_func impo... | [
[
"numpy.median",
"numpy.copy",
"numpy.mean",
"numpy.random.normal",
"numpy.empty",
"matplotlib.pyplot.savefig",
"numpy.nanmin",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.log10",
"numpy.nanmax",
"numpy.array",
"matp... |
santiago1234/MZT-rna-stability | [
"80a303a4f240308bccbadc29abeaa61a39d91861"
] | [
"results/19-03-18-LassoFindKmers/lassopath.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom sklearn.linear_model import lasso_path\nfrom lassoloaddata import get_folds\n\n# define the grid of lambda values to explore\nalphas = np.logspace(-4, -0.5, 30)\n\n\ndef get_lasso_path(X_train, y_train, alphas=alphas):\n \"\"\"\n compute the lasso path for the gi... | [
[
"pandas.concat",
"sklearn.linear_model.lasso_path",
"numpy.logspace",
"pandas.DataFrame"
]
] |
Sean16SYSU/Algorithms4N | [
"24f06c29d476c4bd9c90bcc89dac90ba3a448c27"
] | [
"Sort/SimpleSort/SimpleSort_GenerateGIF.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport os\nimport shutil\nimport imageio\n\n\ndef plotAndSave(X, Y, path):\n plt.cla()\n plt.bar(X, Y)\n plt.savefig(path)\n\n\ndef checkfile(path):\n if not os.path.exists(path):\n os.mkdir(path)\n else:\n shutil.rmtree(path)\n ... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.bar",
"numpy.random.randint",
"matplotlib.pyplot.cla"
]
] |
Tobias-Fischer/snn_toolbox | [
"a85ada7b5d060500703285ef8a68f06ea1ffda65"
] | [
"tests/simulation/test_pooling.py"
] | [
"import os\nimport numpy as np\nimport pytest\nfrom tensorflow.keras import Input, Model, models, backend\nfrom tensorflow.keras.layers import MaxPooling2D, Flatten, Dense\n\nfrom snntoolbox.bin.utils import run_pipeline\nfrom tests.core.test_models import get_correlations, get_ann_acc\n\nDATA_FORMAT = backend.imag... | [
[
"tensorflow.keras.backend.set_image_data_format",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.backend.image_data_format",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.Model",
"numpy.all",
"tensorflow.keras.Input"
]
] |
databricks-academy/deep-learning-with-databricks | [
"b579a75e12cbd3df59894c1bfa917b5a14df9a8c"
] | [
"Deep-Learning-with-Databricks/Solutions/Reference/NLP - LSTM for Sentiment Analysis.py"
] | [
"# Databricks notebook source\n# MAGIC %md-sandbox\n# MAGIC \n# MAGIC <div style=\"text-align: center; line-height: 0; padding-top: 9px;\">\n# MAGIC <img src=\"https://databricks.com/wp-content/uploads/2018/03/db-academy-rgb-1200px.png\" alt=\"Databricks Learning\" style=\"width: 600px\">\n# MAGIC </div>\n\n# COM... | [
[
"tensorflow.keras.preprocessing.sequence.pad_sequences",
"numpy.array",
"numpy.median",
"pandas.DataFrame",
"tensorflow.keras.layers.Embedding",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Model",
"tensorflow.keras.preprocessing.text.Tokenizer",
"tensorflow.keras.layers.... |
xinli94/models | [
"a98b67629c5099dbc7f07103def02d51302ed104"
] | [
"research/object_detection/legacy/evaluator.py"
] | [
"# Copyright 2017 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.train.latest_checkpoint",
"tensorflow.expand_dims",
"tensorflow.python.platform.tf_logging.info",
"tensorflow.train.Saver",
"tensorflow.global_variables",
"tensorflow.to_float",
"tensorflow.train.get_or_create_global_step",
"tensorflow.train.ExponentialMovingAverage",
... |
jungtaekkim/bayeso | [
"d11c9ff8037cf7fd3f9b41362eaab120f1224c71",
"d11c9ff8037cf7fd3f9b41362eaab120f1224c71",
"d11c9ff8037cf7fd3f9b41362eaab120f1224c71"
] | [
"examples/04_bo_with_surrogates/example_bo_w_tp.py",
"tests/common/test_bo_bo_w_tp.py",
"bayeso/bo/bo_w_trees.py"
] | [
"# example_bo_w_tp\n# author: Jungtaek Kim (jtkim@postech.ac.kr)\n# last updated: October 10, 2021\n\nimport numpy as np\nimport os\n\nfrom bayeso.bo import bo_w_tp\nfrom bayeso.tp import tp\nfrom bayeso.utils import utils_plotting\n\n\nPATH_SAVE = '../figures/bo_with_surrogates/'\nSTR_FUN_TARGET = 'bo_w_tp'\n\ndef... | [
[
"numpy.array",
"numpy.sin",
"numpy.reshape",
"numpy.vstack",
"numpy.cos",
"numpy.linspace",
"numpy.squeeze",
"numpy.expand_dims"
],
[
"numpy.array",
"numpy.random.seed",
"numpy.sum",
"numpy.random.randn",
"numpy.arange",
"numpy.abs"
],
[
"numpy.m... |
jecoz/transformers | [
"cbfda413389830fc2788f82f49279c4c566b4194"
] | [
"examples/pytorch/question-answering/run_qa_beam_search_no_trainer.py"
] | [
"#!/usr/bin/env python\n# coding=utf-8\n# Copyright 2021 The HuggingFace Inc. 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.... | [
[
"numpy.concatenate",
"torch.no_grad",
"torch.utils.data.DataLoader"
]
] |
btanner/differential_value_iteration | [
"5b734397cd158b6783f5fb44106774ba2a28049f"
] | [
"src/differential_value_iteration/algorithms/mdvi.py"
] | [
"\"\"\"Evaluation and Control Multichain Differential Value Iteration.\"\"\"\nfrom typing import Union\n\nimport numpy as np\nfrom absl import logging\nfrom differential_value_iteration.algorithms import algorithm\nfrom differential_value_iteration.environments import structure\n\n\n_DEBUG_ITER = -1\n\nclass Evalua... | [
[
"numpy.max",
"numpy.full",
"numpy.dot",
"numpy.zeros",
"numpy.allclose",
"numpy.where",
"numpy.argmax",
"numpy.isfinite",
"numpy.array2string"
]
] |
Chinmoy-Prasad-Dutta/scrapy_scraper | [
"09f6abfc3bcf10ee28f486d83b450c89a07e066e"
] | [
"SCRAPE/Lib/site-packages/pandas/tests/frame/test_ufunc.py"
] | [
"from functools import partial\n\nimport numpy as np\nimport pytest\n\nfrom pandas.compat.numpy import np_version_gte1p22\nimport pandas.util._test_decorators as td\n\nimport pandas as pd\nimport pandas._testing as tm\nfrom pandas.api.types import is_extension_array_dtype\n\ndtypes = [\n \"int64\",\n \"Int64\... | [
[
"numpy.array",
"numpy.add",
"numpy.zeros_like",
"pandas._testing.assert_produces_warning",
"pandas.DataFrame",
"numpy.maximum.accumulate",
"numpy.subtract.outer",
"numpy.modf",
"numpy.heaviside",
"pandas._testing.assert_frame_equal",
"pandas._testing.assert_numpy_array_... |
amnikoo/Saffron-Detection | [
"deccabe22bfa9d69d14c2c3e7b4bba30a45fb298"
] | [
"main.py"
] | [
"import pandas as pd\nimport glob\nimport csv\nimport os\nimport cv2\nimport json\nimport numpy as np\nimport os\nimport time\nimport glob\nfrom matplotlib import pyplot as plt\nimport csv\nimport sys\nimport train\n\n\nfrom model import efficientdet\nfrom utils import preprocess_image, postprocess_boxes\nfrom util... | [
[
"numpy.sin",
"numpy.minimum",
"numpy.where",
"numpy.random.randint",
"numpy.cos",
"numpy.squeeze",
"numpy.expand_dims",
"numpy.maximum"
]
] |
TevenLeScao/transformer-xl | [
"f15c845d83fe7952e841cda92e277919e8ec10fe"
] | [
"pytorch/utils/torch_utils.py"
] | [
"import torch\n\n\ndef repeat_parameter(parameter, *sizes):\n parameter.data = parameter.data.repeat(*sizes)\n if parameter.grad is not None:\n parameter.grad = parameter.grad.repeat(*sizes)\n\n\ndef qkv_weight_repeat(parameter, ratio):\n q, k, v = torch.chunk(parameter, 3, dim=0)\n q = q.repeat(... | [
[
"torch.cat",
"torch.chunk"
]
] |
ismaelxyz/graphic-concentration | [
"2573ed7dc5df907bf5fe89704bf3f009cb083784"
] | [
"DemOpenGL/NeHe/lesson42.py"
] | [
"# NeHe Tutorial Lesson: 42 - Multiple Viewports\n#\n# Ported to PyOpenGL 2.0 by Brian Leair 18 Jan 2004\n#\n# This code was created by Jeff Molofee 2000\n#\n# The port was based on the PyOpenGL tutorials and from\n# PyOpenGLContext (tests/glprint.py)\n#\n# If you've found this code useful, feel free to let me know... | [
[
"numpy.zeros"
]
] |
shouwangzhe134/simpledet | [
"8da8efe2c2d07e428a81e0b69909b661dfa5bce6"
] | [
"core/detection_input.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\n\nimport cv2\nimport numpy as np\nimport mxnet as mx\n\nfrom queue import Queue\nfrom threading import Thread\nfrom operator_py.cython.bbox import bbox_overlaps_cython\nfrom operator_py.bbox_transform import nonlinear_transform as bbox_transfo... | [
[
"numpy.full",
"numpy.array",
"numpy.zeros",
"numpy.round",
"numpy.sum",
"numpy.random.shuffle",
"numpy.where",
"numpy.stack",
"numpy.random.randint",
"numpy.arange",
"numpy.sqrt",
"numpy.clip",
"numpy.outer",
"numpy.meshgrid"
]
] |
lakehanne/RAL2017 | [
"49f9eddc5a1120b4a116f101d49a74af90462f4a"
] | [
"pyrnn/src/utils/data_parser.py"
] | [
"import torch\nimport time\nfrom torch.autograd import Variable\nimport scipy.io as sio\nimport pandas as pd\nimport gzip\nimport bz2\nimport csv\nfrom random import shuffle\n\ntorch.set_default_tensor_type('torch.DoubleTensor')\n\ndef loadSavedMatFile(x):\n\tdata = sio.loadmat(x)\n\t# populate each column of arra... | [
[
"torch.cat",
"torch.min",
"torch.set_default_tensor_type",
"scipy.io.loadmat",
"torch.from_numpy",
"torch.LongTensor",
"torch.Tensor"
]
] |
guohaoyu110/taivision | [
"eb78bd079d98a58dcbc4995e9f04198bc6592e2b"
] | [
"tests/test_examples/imagenet_test/test/tools/test_classification_model.py"
] | [
"import os\nimport sys\nimport warnings\n\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n# print(BASE_DIR)\n# /home/xuel/xw/guohaoyu/taivision/tests/test_examples/Imagenet\nsys.path.append(BASE_DIR)\nwarnings.filterwarnings('ignore')\n\nimport argparse\nimport random\nimport numpy as np\n\... | [
[
"torch.device",
"torch.distributed.init_process_group",
"torch.cuda.get_device_name",
"torch.nn.parallel.DistributedDataParallel",
"torch.cuda.device_count",
"torch.cuda.set_device",
"torch.cuda.empty_cache",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.... |
cosmic119/DiscoGAN | [
"5a86f36f45a3dafdc028fc2100eb477e54dc83cd"
] | [
"TensorArtist/tartist/app/rl/utils.py"
] | [
"# -*- coding:utf8 -*-\n# File : utils.py\n# Author : Jiayuan Mao\n# Email : maojiayuan@gmail.com\n# Date : 3/18/17\n# \n# This file is part of TensorArtist.\n\nfrom .base import ProxyRLEnvironBase\nfrom tartist.core import get_logger \nfrom tartist.core.utils.meta import run_once\nimport functools\nimport col... | [
[
"numpy.concatenate",
"numpy.zeros_like"
]
] |
lithium-ion/cellpy | [
"5345912dbd51a8f546542ef7797a074aac9ba3c7"
] | [
"cellpy/utils/batch.py"
] | [
"\"\"\"Routines for batch processing of cells (v2).\"\"\"\n\nimport logging\nimport pathlib\nimport shutil\nimport warnings\nimport os\n\nimport pandas as pd\n\nfrom cellpy import prms\nfrom cellpy import log\nfrom cellpy.utils.batch_tools.batch_exporters import CSVExporter\nfrom cellpy.utils.batch_tools.batch_expe... | [
[
"pandas.concat"
]
] |
wang-jinchao/BabyCare | [
"3a8b8daf7950e65f54a35150b5654fac9d4918c3"
] | [
"src/segmentation/chessboard.py"
] | [
"# matlab的方法如下\n'''\nJ = (checkerboard(300,3,4)>0.5); %生成黑白棋盘图像\nfigure, imshow(J) %显示黑白棋盘图像\nimwrite(J,'plate.jpg');%保存黑白棋盘图像\n'''\n\nimport cv2\nimport numpy as np\n\nwidth = 1000*5\nheight = 700*5\nlength = 100*5\n\nimage = np.zeros((width,height),dtype = np.uint8)\nprint(image.shape[0],image.shape[1])\n\nfor ... | [
[
"numpy.zeros"
]
] |
Unfinishedgod/streamlit_sample | [
"4baff6494ca5b76da37d42a080606e158013735d"
] | [
"naver_crawler.py"
] | [
"from urllib.request import urlopen\nfrom bs4 import BeautifulSoup\n\nimport re\nimport pandas as pd\nfrom datetime import datetime, timedelta\n\n# https://search.shopping.naver.com/best100v2/detail.nhn?catId=50000190\n\ncategory_df = pd.DataFrame({\n 'category' : ['스킨케어', '베이스메이크업', '색조메이크업', '클렌징', \n ... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
NovelResearchInvestment/akshare | [
"ccce37101b26e89a46b9b8b7b27b4eebf49edccd",
"ccce37101b26e89a46b9b8b7b27b4eebf49edccd"
] | [
"akshare/stock_fundamental/stock_finance_hk.py",
"akshare/futures/futures_roll_yield.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\"\"\"\nDate: 2022/5/1 19:15\nDesc: 港股-基本面数据\nhttps://emweb.securities.eastmoney.com/PC_HKF10/FinancialAnalysis/index?type=web&code=00700\n\"\"\"\nimport pandas as pd\nimport requests\n\n\ndef stock_financial_hk_report_em(\n stock: str = \"00700\", symbol: str = \"... | [
[
"pandas.to_datetime"
],
[
"pandas.DataFrame",
"pandas.to_numeric"
]
] |
ForeverZyh/NLP_training_framework | [
"d5cc28bf389a3f57439a5650a614e341ea333bb8"
] | [
"a3t/diffai/ai.py"
] | [
"import torch\nimport torch.nn.functional as F\nimport torch.autograd\n\n\nimport a3t.diffai.helpers as h\n\n\ndef catNonNullErrors(op, ref_errs=None): # the way of things is ugly\n def doop(er1, er2):\n erS, erL = (er1, er2)\n sS, sL = (erS.size()[0], erL.size()[0])\n\n if sS == sL: # TOD... | [
[
"torch.cat",
"torch.nn.functional.avg_pool2d",
"torch.nn.functional.softplus",
"torch.min",
"torch.arange",
"torch.max",
"torch.isnan",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.abs",
"torch.nn.functional.cross_entropy",
"torch.nn.functional.relu",
"torch.ex... |
Thijsvanede/chess | [
"8a86e54e275f09cbbc62d9ac7afbd7442cb06b75"
] | [
"chess/pieces/rook.py"
] | [
"from .base import Piece, PieceRepresentation\nimport numpy as np\n\nclass Rook(Piece):\n\n def __init__(self, color, *args, **kwargs):\n \"\"\"Initialise bishop, sets color of piece.\"\"\"\n # Initialise bishop with correct symbol\n super().__init__(\n color,\n symbol ... | [
[
"numpy.zeros"
]
] |
dwillmer/hypertools | [
"80df3a37651afd09b5b29ad8e771896bc4f54a46"
] | [
"hypertools/datageometry.py"
] | [
"from __future__ import unicode_literals\nfrom builtins import object\nimport copy\nimport deepdish as dd\nimport numpy as np\nfrom .tools.normalize import normalize as normalizer\nfrom .tools.reduce import reduce as reducer\nfrom .tools.align import align as aligner\nfrom .tools.format_data import format_data\nfro... | [
[
"numpy.array"
]
] |
zhenglab/neon | [
"1597082ad0bab59102f1ceb20feb08c5a0bf9d04"
] | [
"neon/backends/cc2.py"
] | [
"# ----------------------------------------------------------------------------\n# Copyright 2014 Nervana Systems Inc.\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:/... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.zeros",
"numpy.random.seed",
"numpy.ones",
"numpy.random.uniform"
]
] |
Shivaani9/OCR-Using-EAST | [
"9f79c44454dc096ff393195d78f0d534392189b6"
] | [
"text_detection.py"
] | [
"\n\nfrom imutils.object_detection import non_max_suppression\nimport numpy as np\nimport argparse\nimport time\nimport cv2\n\n\nap = argparse.ArgumentParser()\nap.add_argument(\"-i\", \"--image\", type=str,\n\thelp=\"path to input image\",default =\"path to input image\" )\nap.add_argument(\"-east\", \"--east\", t... | [
[
"numpy.array",
"numpy.sin",
"numpy.cos"
]
] |
INGEOTEC/b4msa | [
"d2fba40d208112a7a9f93dead2d43221543eade2"
] | [
"b4msa/tests/test_command_line.py"
] | [
"# Copyright 2016 Mario Graff (https://github.com/mgraffg) and Ranyart R. Suarez (https://github.com/RanyartRodrigo)\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://w... | [
[
"numpy.random.seed.assert_called_once_with"
]
] |
FraPorta/pepper_mediapipe_teleoperation | [
"a42b094309e3db0d77e4c9a126683d960170d390"
] | [
"pepper_teleoperation/utils/head_motion.py"
] | [
"# -*- encoding: UTF-8 -*-\n\n\"\"\"Use getTransform Method to get the yaw and pitch to control the head to point the arm end-effector\"\"\"\n\nimport qi\nimport argparse\nimport sys\nimport motion\n# import time\n# import random\n\nfrom scipy import signal\nimport numpy as np\nfrom threading import Thread\n\n\ncla... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.matmul",
"scipy.signal.butter",
"scipy.signal.lfilter",
"numpy.transpose",
"numpy.arctan2",
"numpy.sqrt",
"scipy.signal.lfilter_zi"
]
] |
Iherrbenza/SMB100A_Python | [
"80af83faa306a31f323869c2d20f121bb941d85b"
] | [
"labscript_devices.py"
] | [
"# @Date: 2020-04-05T14:08:33+10:00\n# @Last modified time: 2020-04-13T15:36:05+10:00\n\n\nfrom __future__ import division, unicode_literals, print_function, absolute_import\nfrom labscript_utils import PY2\nif PY2:\n str = unicode\nimport h5py\nimport numpy as np\nimport pyvisa\nfrom labscript import Device, ... | [
[
"numpy.array"
]
] |
ajinkyakhoche/argoverse-api | [
"b1730f9e4377325436f3364abb4c1fe54ec71b0a"
] | [
"tests/test_cv2_plotting_utils.py"
] | [
"# <Copyright 2019, Argo AI, LLC. Released under the MIT license.>\n\nimport numpy as np\n\nfrom argoverse.utils.cv2_plotting_utils import (\n draw_point_cloud_in_img_cv2,\n draw_polygon_cv2,\n draw_polyline_cv2,\n plot_bbox_polygon_cv2,\n)\n\n\ndef test_draw_point_cloud_in_img_cv2_smokescreen() -> None... | [
[
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.tile",
"numpy.allclose"
]
] |
thunlp/HATT-Proto-for-Few-Shot-Relation-Classification | [
"8630f048ecc52714dda45e3d731ec68156439b4f"
] | [
"fewshot_re_kit/framework.py"
] | [
"import os\nimport sklearn.metrics\nimport numpy as np\nimport sys\nimport time\nfrom . import sentence_encoder\nfrom . import data_loader\nimport torch\nfrom torch import autograd, optim, nn\nfrom torch.autograd import Variable\nfrom torch.nn import functional as F\n\nclass FewShotREModel(nn.Module):\n def __in... | [
[
"torch.__version__.split",
"torch.optim.lr_scheduler.StepLR",
"torch.nn.Module.__init__",
"torch.load",
"torch.nn.CrossEntropyLoss"
]
] |
zarnihpyoe/facenet | [
"0c76fa74ea6cde442a834375806ccf8a89d76db3"
] | [
"src/face_positions.py"
] | [
"import os\nimport numpy as np\nimport facenet\n\ndef save_position_into_file(src, dest):\n # storing bounding boxes' centers with their respective images name\n d = {}\n with open(src) as f:\n for line in f:\n line = line.split()\n line[0] = line[0].split('/')[-1]\n ... | [
[
"numpy.zeros"
]
] |
burnpanck/chaco | [
"6457cdd28625991ba69fbbee105051cab237aa51",
"6457cdd28625991ba69fbbee105051cab237aa51"
] | [
"chaco/tests/arraydatasource_test_case.py",
"examples/demo/financial_plot.py"
] | [
"\"\"\"\nTest of basic dataseries behavior.\n\"\"\"\n\nimport unittest\n\nfrom numpy import arange, array, allclose\nfrom chaco.api import ArrayDataSource, PointDataSource\n\n\nclass ArrayDataTestCase(unittest.TestCase):\n def test_basic_set_get(self):\n myarray = arange(10)\n sd = ArrayDataSource(... | [
[
"numpy.allclose",
"numpy.array",
"numpy.arange"
],
[
"numpy.cumprod",
"numpy.random.normal",
"numpy.random.lognormal",
"numpy.arange"
]
] |
arokem/napari | [
"e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd",
"e16e1163cf422d3aba6d86d1ae7dcd70a85b87dd"
] | [
"examples/to_screenshot.py",
"napari/_vispy/vispy_image_layer.py"
] | [
"\"\"\"\nDisplay one shapes layer ontop of one image layer using the add_shapes and\nadd_image APIs. When the window is closed it will print the coordinates of\nyour shapes.\n\"\"\"\n\nimport numpy as np\nfrom skimage import data\nfrom skimage.io import imsave\nimport napari\nfrom vispy.color import Colormap\n\n\nw... | [
[
"numpy.array",
"numpy.sin",
"numpy.zeros",
"numpy.cos",
"numpy.linspace"
],
[
"numpy.dtype",
"numpy.zeros"
]
] |
erikmannerfelt/pandas | [
"4ec6925c19ca5b083a644b409fe1e9052af1e587"
] | [
"asv_bench/benchmarks/strings.py"
] | [
"import warnings\n\nimport numpy as np\n\nfrom pandas import (\n Categorical,\n DataFrame,\n Series,\n)\n\nfrom .pandas_vb_common import tm\n\n\nclass Construction:\n\n params = [\"str\", \"string\"]\n param_names = [\"dtype\"]\n\n def setup(self, dtype):\n self.series_arr = tm.rands_array(... | [
[
"numpy.random.choice",
"pandas.DataFrame",
"pandas.Categorical",
"numpy.random.randint",
"pandas.Series"
]
] |
bh-chaker/wetterdienst | [
"b0d51bb4c7392eb47834e4978e26882d74b22e35"
] | [
"wetterdienst/provider/dwd/index.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright (c) 2018-2021, earthobservations developers.\n# Distributed under the MIT License. See LICENSE for more info.\nfrom functools import reduce\nfrom urllib.parse import urljoin\n\nimport pandas as pd\n\nfrom wetterdienst.metadata.period import Period\nfrom wetterdienst.metadata.re... | [
[
"pandas.DataFrame"
]
] |
camall3n/pfrl | [
"8a0db8bde42696d64512b2ba7ce221dbb715bee3"
] | [
"tools/plot_scores.py"
] | [
"import argparse\nimport os\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\nmatplotlib.use(\"Agg\") # Needed to run without X-server\n\n\ndef main():\n parser = argparse.ArgumentParser()\n parser.add_argument(\"--title\", type=str, default=\"\")\n parser.add_argument(\n ... | [
[
"matplotlib.use",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"pandas.read_csv"
]
] |
TuKo/dRNN | [
"150acff49f8cbc0147125ae848da1bb5b3ca8af4"
] | [
"run_time_mlm.py"
] | [
"from experiments import MLMExperiment\nimport torch\nimport argparse\nfrom pathlib import Path\nimport numpy as np\nimport os\n\n\nUSE_CUDA = torch.cuda.is_available()\ndevice = torch.device(\"cuda\" if USE_CUDA else \"cpu\")\n\n\ndef main(delay, batch_size, rnn_units, layers, bidi,\n experiment_name, data... | [
[
"torch.device",
"torch.cuda.is_available",
"numpy.savez"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.