repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
mvinyard/vintools | [
"496889c8a89a41cc481b6903453de23bd4a50500"
] | [
"vintools/_utilities/_system_utils/_get_pypi_package_loc.py"
] | [
"import os\nimport string\nimport numpy as np\nimport pandas as pd\n\n\ndef _get_pypi_package_loc(package=\"vintools\"):\n\n \"\"\"\"\"\"\n\n signature = \"\".join(np.random.choice(list(string.ascii_lowercase), 6))\n tmp_info_file = \"info_{}.txt\".format(signature)\n\n os.system(\"pip show {} > {}\".fo... | [
[
"pandas.read_table"
]
] |
Liuhongzhi2018/ClassNet | [
"7d427dc9b8c38abf0a4eedfdeb75c09c59aa7185"
] | [
"baseline/core/model_vgg13.py"
] | [
"from torch import nn\r\nimport torch\r\nimport torch.nn.functional as F\r\nfrom torch.autograd import Variable\r\nfrom core import resnet, densenet, resnext, vgg\r\nimport numpy as np\r\nfrom core.anchors import generate_default_anchor_maps, hard_nms\r\nfrom config import CAT_NUM, PROPOSAL_NUM\r\n\r\n\r\nclass Pro... | [
[
"torch.nn.functional.log_softmax",
"torch.cat",
"torch.zeros",
"torch.nn.Conv2d",
"torch.gather",
"torch.from_numpy",
"torch.nn.Linear",
"torch.nn.functional.relu",
"torch.nn.functional.interpolate",
"torch.stack",
"torch.nn.ReLU",
"numpy.array",
"torch.nn.funct... |
zhouxiaoxu/pytorch-retinanet | [
"72013ee0f46d2da08dd141f143a7a094477aa5e4"
] | [
"retinanet/anchors.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\n\n\nclass Anchors(nn.Module):\n def __init__(self, pyramid_levels=None, strides=None, sizes=None, ratios=None, scales=None):\n super(Anchors, self).__init__()\n\n if pyramid_levels is None:\n self.pyramid_levels = [3, 4, 5, 6, 7]\... | [
[
"numpy.expand_dims",
"numpy.meshgrid",
"numpy.arange",
"numpy.tile",
"numpy.append",
"torch.cuda.is_available",
"numpy.array",
"numpy.zeros"
]
] |
randall-romero/CompEcon-python | [
"c7a75f57f8472c972fddcace8ff7b86fee049d29"
] | [
"_build/jupyter_execute/notebooks/dp/01b Timber Harvesting -- cubic spline.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Timber Harvesting -- using cubic splines\n# \n# **Randall Romero Aguilar, PhD**\n# \n# This demo is based on the original Matlab demo accompanying the <a href=\"https://mitpress.mit.edu/books/applied-computational-economics-and-finance\">Computational Economics and Fi... | [
[
"matplotlib.pyplot.legend",
"numpy.linspace",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.hlines",
"matplotlib.pyplot.vlines",
"numpy.array"
]
] |
lacava/deep-symbolic-regression | [
"d7b98b943740405724c2a9860c4b1ec5d6a532f3"
] | [
"dsr/dsr/utils.py"
] | [
"\"\"\"Utility functions used in deep symbolic regression.\"\"\"\n\nimport os\nimport functools\nimport numpy as np\n\n\ndef is_float(s):\n \"\"\"Determine whether str can be cast to float.\"\"\"\n\n try:\n float(s)\n return True\n except ValueError:\n return False\n\n\n# Adapted from:... | [
[
"numpy.log",
"numpy.unique",
"numpy.arange",
"numpy.any",
"numpy.count_nonzero",
"numpy.zeros",
"numpy.sum"
]
] |
thiagolcmelo/dynamic | [
"9e4e71dd25ce3c778b17b62ef4062273d244a5ac"
] | [
"core/utils.py"
] | [
"########################################################################\n# Useful functions for performing mathmatical calculations #\n# author: Thiago Melo #\n# creation: 2018-10-30 #\n# update: 2018-10-3... | [
[
"numpy.linalg.eig",
"numpy.real"
]
] |
MaxMotovilov/allennlp | [
"d4ee5db1c630d6c631a828ee12fcbf6154de288c"
] | [
"allennlp/tests/modules/maxout_test.py"
] | [
"# pylint: disable=no-self-use,invalid-name\nfrom numpy.testing import assert_almost_equal\nimport pytest\nimport torch\n\nfrom allennlp.common import Params\nfrom allennlp.common.checks import ConfigurationError\nfrom allennlp.modules import Maxout\nfrom allennlp.nn import InitializerApplicator\nfrom allennlp.comm... | [
[
"torch.nn.init.constant_",
"numpy.testing.assert_almost_equal",
"torch.FloatTensor"
]
] |
zjuptian/GoogleNet_Modelarts | [
"8ad4146d061c484e8df01bd018747cdd1dca4a42"
] | [
"inception/model.py"
] | [
"# coding=utf-8\n# Copyright 2018 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... | [
[
"tensorflow.device",
"tensorflow.multiply",
"tensorflow.control_dependencies",
"tensorflow.shape",
"tensorflow.get_collection",
"tensorflow.cast",
"tensorflow.reshape",
"tensorflow.identity",
"tensorflow.train.get_global_step",
"tensorflow.losses.softmax_cross_entropy",
... |
ti-ginkgo/regressor-template | [
"1089d7eb8efe7869dae5df54022736213f2badb0"
] | [
"{{cookiecutter.package_name}}/src/exp_000/ishtos_lightning_module.py"
] | [
"import numpy as np\nimport torch\nfrom pytorch_lightning import LightningModule\n\nfrom ishtos_losses import get_loss\nfrom ishtos_metrics import get_metric\nfrom ishtos_models import get_model\nfrom ishtos_optimizers import get_optimizer\nfrom ishtos_schedulers import get_scheduler\n\n\nclass MyLightningModule(Li... | [
[
"numpy.random.beta",
"torch.cat",
"torch.randperm",
"numpy.random.rand",
"torch.stack"
]
] |
mickael-bdias/OpenCV-projects-with-Python | [
"75e42e9f856650ad997905a85997a817434362fe"
] | [
"Image_Classification/03.ComparisonRGB_HSV.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"03.GreenScreen.py\nComparison between RGB and HSV.\nUsed matplotlib to plot the 6 channels\"\"\"\n\n__author__ = \"Mickaël Dias\"\n__copyright__ = \"Copyright 2021, OpenCV-projects-with-Python\"\n__licence__ = \"MIT\"\n__version__ = \"1.0.0\"\n__maintainer__ = \"Mickaël Dias\"\n__ema... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
Balaji-Ganesh/Furnishing-OpenCV-Basics | [
"54cd8fa09cc6f1298861b12ffb190432f412bd1f"
] | [
"Projects/VirtualCanvas/VirtualCanvas.py"
] | [
"# Import the required libraries\r\nimport cv2\r\nimport numpy as np\r\nimport Projects.VirtualCanvas.utils as utils\r\n\r\n\r\nclass VirtualCanvas:\r\n def __init__(self, num_markers=2, debug_mode=False):\r\n # Mode in which the user would like to run the program..\r\n self.debug_mode = debug_mode... | [
[
"numpy.array"
]
] |
Cybonic/AttDLNet | [
"8f19ac18316c56b00a448a9e0eaac70cb0853407"
] | [
"dataset_utils/kitti/pcl_parser_test.py"
] | [
"import os\nimport numpy as np\nimport torch\nimport dataset_utils.kitti.utils as utils\nfrom torch.utils.data import Dataset\nfrom common.laserscan import LaserScan\nfrom torch.utils.data import DataLoader, random_split\nfrom random import seed\nimport math\n\nEXTENSIONS_SCAN = ['.bin']\nEXTENSIONS_LABEL = ['.labe... | [
[
"numpy.fromfile",
"numpy.random.seed",
"torch.full",
"torch.utils.data.DataLoader",
"torch.from_numpy",
"torch.tensor",
"numpy.ones",
"numpy.concatenate",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.random.randint"
]
] |
sandeepsoni/MHP | [
"288fb56f4d2bffbda519f87320df9f49fb2465aa"
] | [
"HP/HPUtils.py"
] | [
"from __future__ import division\nimport numpy as np\n\ndef kernel (x,y,b):\n\t\"\"\" calculates the exponentially decay kernel for difference of x-y with bandwidth b\"\"\"\n\treturn np.exp (-b * (x-y))\n\ndef drawExpRV (param, rng):\n\t# using the inverse method\n\t#return (1/float (param)) * np.log (rng.uniform (... | [
[
"numpy.squeeze",
"numpy.cumsum",
"numpy.copy",
"numpy.exp",
"numpy.sum"
]
] |
danilkuzin/GP-EnKF | [
"215623e0f322ddae9757854e7278b60e11e570bf"
] | [
"gpenkf/experiments/real_house_prices/run.py"
] | [
"from gpenkf.experiments.experiment_runner import ExperimentRunner\nfrom gpenkf.core.parameters import Parameters\nfrom gpenkf.experiments.real_house_prices.house_data import HouseData\n\nimport numpy as np\n\nif __name__==\"__main__\":\n sample_size=1000\n data_provider = HouseData(sample_size=sample_size, v... | [
[
"numpy.meshgrid",
"numpy.array",
"numpy.linspace",
"numpy.power"
]
] |
BismarckBamfo/ocr-paper | [
"56a60486fb25613fc18ac984c6ca22a4475b3c4b"
] | [
"inference/utils.py"
] | [
"from __future__ import print_function\n\nimport torch\nimport pickle\nimport numpy as np\nimport math\nimport cv2\nfrom PIL import Image, JpegImagePlugin\nfrom scipy import ndimage\nimport hashlib\nimport sys, os\nfrom zipfile import ZipFile\nfrom imgproc import loadImage\n\nif sys.version_info[0] == 2:\n from ... | [
[
"numpy.sqrt",
"numpy.squeeze",
"numpy.mean",
"numpy.where",
"numpy.roll",
"numpy.sin",
"numpy.frombuffer",
"numpy.argmax",
"numpy.diff",
"numpy.insert",
"torch.LongTensor",
"scipy.ndimage.rotate",
"numpy.append",
"numpy.array",
"numpy.maximum",
"nump... |
aferrall/redner | [
"be52e4105140f575f153d640ba889eb6e6015616"
] | [
"tests/test_teapot_reflectance.py"
] | [
"import pyredner\nimport numpy as np\nimport torch\nimport scipy\nimport scipy.ndimage\n\n# Optimize for material parameters and camera pose\n\n# Use GPU if available\npyredner.set_use_gpu(torch.cuda.is_available())\n\n# Load the scene from a Mitsuba scene file\nscene = pyredner.load_mitsuba('scenes/teapot.xml')\n\... | [
[
"torch.optim.Adam",
"torch.abs",
"torch.nn.functional.conv2d",
"torch.from_numpy",
"torch.tensor",
"torch.nn.utils.clip_grad_norm_",
"torch.nn.AvgPool2d",
"scipy.ndimage.filters.gaussian_filter",
"torch.cuda.is_available",
"numpy.zeros"
]
] |
akthiersch-01/DATS6103-Project-Team1 | [
"0abf4114f85c500a2740c097f9abe435df1a5b37"
] | [
"Diabetes_Project 2.py"
] | [
"#%%\n#Import packages\nimport numpy as np\nimport pandas as pd\nimport os\nimport mlxtend\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport math \nimport scipy.stats as stats\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics i... | [
[
"pandas.crosstab",
"pandas.read_csv",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"matplotlib.pyplot.violinplot",
"numpy.ndarray.tolist",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
Fusion-Data-Platform/fdp | [
"d87a52207238f168ed69b9f96dc8f20f4481366d"
] | [
"fdp/methods/diiid/bes/utilities.py"
] | [
"import numpy as np\n\ndef shift_dc_signal(obj, data):\n if obj.isSignal() and obj._parent._name=='slow':\n data = data - np.mean(data[0:100])\n return data"
] | [
[
"numpy.mean"
]
] |
liewmanchoi/NaiveMLA | [
"fea7d6ce9650fb5ff7e31140fd584792dd0d7a2a"
] | [
"unsupervised_learning/kmeans.py"
] | [
"# -*- coding: utf-8 -*-\n# __author__ = wangsheng\n# __copyright__ = \"Copyright 2018, Trump Organization\"\n# __email__ = \"liewmanchoi@gmail.com\"\n# __status__ = \"experiment\"\n# __time__ = 2018/12/9 10:05\n# __file__ = kmeans.py\n\nimport numpy as np\n\n\nclass KMeans(object):\n def __init__(self, n_cluste... | [
[
"numpy.square",
"numpy.random.choice",
"numpy.ndarray",
"numpy.mean",
"numpy.sum"
]
] |
soulsheng/lanenet-lane-detection | [
"f7bc580a73e686a77a5506dbfc57ed424f0715b5"
] | [
"semantic_segmentation_zoo/cnn_basenet.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Time : 17-9-18 下午3:59\n# @Author : MaybeShewill-CV\n# @Site : https://github.com/MaybeShewill-CV/lanenet-lane-detection\n# @File : cnn_basenet.py\n# @IDE: PyCharm Community Edition\n\"\"\"\nThe base convolution neural networks mainly implement some usefu... | [
[
"tensorflow.cond",
"tensorflow.get_variable",
"tensorflow.concat",
"tensorflow.zeros",
"tensorflow.nn.max_pool",
"tensorflow.layers.conv2d_transpose",
"tensorflow.nn.depthwise_conv2d",
"tensorflow.nn.atrous_conv2d",
"tensorflow.nn.conv2d",
"tensorflow.layers.batch_normaliza... |
anandkrishnakumar/ICLV-estimation | [
"e9d5fa2a6d350c130a765da0a07dd929af3aeb7c"
] | [
"dgp.py"
] | [
"import numpy as np\nimport sklearn.datasets\n\n#------------------------------DGP FOR ALL LATENT VARIABLES-------------------\ndef dgp():\n N = 1000\n # alternative specific constants\n ASC = np.array([0, -0.6, 0.8])\n beta = np.array([-1.2, 0.8])\n X = np.random.normal(size=(N, 3, 2))\n ... | [
[
"numpy.random.gumbel",
"numpy.eye",
"numpy.random.normal",
"numpy.argmax",
"numpy.random.binomial",
"numpy.array",
"numpy.zeros",
"numpy.empty",
"numpy.savetxt"
]
] |
Rickitik/evidently | [
"a35aa45c2afa3fe6b2efa0e7d03280f8e6142eb3"
] | [
"tests/analyzers/test_categorical_target_drift_analyzer.py"
] | [
"import pytest\nimport numpy as np\nfrom pandas import DataFrame\nfrom pytest import approx\n\nfrom evidently import ColumnMapping\nfrom evidently.analyzers.cat_target_drift_analyzer import CatTargetDriftAnalyzer\nfrom evidently.options import DataDriftOptions, OptionsProvider\n\n\n@pytest.fixture\ndef analyzer() -... | [
[
"pandas.DataFrame"
]
] |
tehilaogen/IML.HUJI | [
"2d3a11a87e9ffc114474362867e2b451bdc7dd02"
] | [
"exercises/fit_gaussian_estimators.py"
] | [
"from IMLearn.learners import UnivariateGaussian, MultivariateGaussian\nimport numpy as np\nimport plotly.graph_objects as go\nimport plotly.io as pio\npio.templates.default = \"simple_white\"\n\n\ndef test_univariate_gaussian():\n # Question 1 - Draw samples and print fitted model\n mean = 10\n var = 1\n ... | [
[
"numpy.abs",
"numpy.random.seed",
"numpy.linspace",
"numpy.random.multivariate_normal",
"numpy.random.normal"
]
] |
william-yan/CSU_notes | [
"c2b7fb3dea5a6435bf9dbadaad479b06c9297fcb"
] | [
"Yan/code/Spline/demo.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue May 14 09:21:32 2019\r\n\r\n@author: Yan\r\n\"\"\"\r\n\r\n\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom pylab import mpl\r\n\"\"\"\r\n二次样条实现:\r\n函数x的自变量为:3, 4.5, 7, 9\r\n 因变量为:2.5, 1 2.5, 0.5\r\n\"\"\"\r\nx = [3, 4.5, 7, 9]\r\ny =... | [
[
"matplotlib.pyplot.legend",
"numpy.linalg.solve",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.plot",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
ElmiraGhorbani/align_iranian_national_id_card | [
"b1806deb269558ab70ff613911365f79b527632d"
] | [
"rotate_crop_with_HoughLines.py"
] | [
"# MIT License\n#\n# Copyright (c) 2019 https://github.com/ElmiiiRaa/align_iranian_national_id_card\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including ... | [
[
"numpy.arctan2",
"numpy.sin",
"numpy.cos",
"numpy.ones"
]
] |
lunarknight00/Global_warming_data_app | [
"ea4d0f8d66e60671d8b4a41996cdf97e5666f6ee"
] | [
"old_plot.py"
] | [
"from flask import Flask,jsonify,request\nfrom .database import *\nimport json\nimport pandas as pd\nimport bokeh\n\nfrom requests import get\nfrom bokeh.plotting import figure, output_file, show\nfrom bokeh.palettes import inferno\nfrom bokeh.embed import components\n\n# api like data fetch func, not sure is worki... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
mic-tae/leaf-audio | [
"0ebef7691754b7cbd407d2d1b9e7319cccb79427"
] | [
"example/train_test.py"
] | [
"# coding=utf-8\n# Copyright 2021 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl... | [
[
"tensorflow.io.gfile.listdir",
"tensorflow.test.main",
"numpy.ones"
]
] |
finbarrtimbers/pytorch-distillation | [
"76a4b335adbdffb56f104a81594e9abad398e0a5"
] | [
"networks.py"
] | [
"import torch\nimport torch.nn as nn\nimport torchvision.datasets as dsets\nimport torchvision.transforms as transforms\nfrom torch.autograd import Variable\n\n# Image Preprocessing\ntransform = transforms.Compose([\n transforms.Scale(40),\n transforms.RandomHorizontalFlip(),\n transforms.RandomCrop(32),\n... | [
[
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
LeungTsang/Dense-RepPoints | [
"8169da58aac7b1418627e43618e8584b39bbb9e5"
] | [
"mmdet/core/bbox/assigners/point_box_assigner.py"
] | [
"import torch\n\nfrom .assign_result import AssignResult\nfrom .base_assigner import BaseAssigner\n\n\nclass PointBoxAssigner(BaseAssigner):\n \"\"\"Assign a corresponding gt bbox or background to each point.\n\n Each proposals will be assigned with `0`, or a positive integer\n indicating the ground truth ... | [
[
"torch.topk",
"torch.log2",
"torch.nonzero",
"torch.arange",
"torch.stack",
"torch.clamp"
]
] |
bintsi/ICAM | [
"17548567d0c77e315b3bad44f85472c164712d1b"
] | [
"utils.py"
] | [
"##################################################\n# Authors:\n# {Christian F. Baumgartner} (c.f.baumgartner@gmail.com),\n# {Lisa M. Koch} (lisa.margret.koch@gmail.com)\n# https://github.com/baumgach/vagan-code\n##################################################\n\nimport nibabel as nib\nimport numpy as np\nimpor... | [
[
"numpy.amax",
"numpy.sqrt",
"numpy.eye",
"numpy.percentile",
"numpy.std",
"numpy.mean",
"numpy.correlate",
"numpy.zeros",
"numpy.divide"
]
] |
EvilBoom/DNA | [
"9615a1c611aa426e03cd680b91b02f8cc646fef0"
] | [
"attention/pytorch_attention/dataloaders.py"
] | [
"# _*_ coding: utf-8 _*_\n# @Time : 2021/12/6 15:16\n# @Author : 张宝宇\n# @Version:V 1.0\n# @File : dataloaders.py\n# @desc :\nimport torch.utils.data as data\n\nfrom att_data import AttDataset\n\n\ndef att_dataloader(u_data=None, label=None, batch_size=None, shuffle=None, num_workers=0):\n dataset = AttDataset(u_... | [
[
"torch.utils.data.DataLoader"
]
] |
HumbertoDiego/django-ajustamento-redes-nivelamento | [
"47912ccb4ba9fc29709add18bab688af50cfb582"
] | [
"ajunivel/NivParamet.py"
] | [
"# -*- coding: utf-8 -*-\r\nimport matplotlib\r\nmatplotlib.use(\"agg\")\r\nimport matplotlib.pyplot as plt\r\nfrom scipy.stats import chi2\r\nfrom numpy import size, array, linspace, zeros, size\r\nfrom numpy.linalg import inv\r\nfrom math import sqrt\r\nfrom pandas import DataFrame\r\nimport io\r\nimport base64\r... | [
[
"scipy.stats.chi2.ppf",
"matplotlib.pyplot.axvline",
"scipy.stats.chi2.pdf",
"numpy.linalg.inv",
"matplotlib.use",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"numpy.size",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.axis",
"matpl... |
trisct/DIST-Renderer | [
"18e8494f07bfa6487710afacda563a899d74e5d2"
] | [
"core_orthogonal_archived/sdfrenderer/renderer_orthogonal.py"
] | [
"import os, sys\nimport torch\nimport torch.nn as nn\nimport numpy as np\nsys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..'))\nfrom core.utils.decoder_utils_plaintest import decode_sdf, decode_sdf_gradient\nfrom core.visualize.profiler import Profiler\nfrom core.utils.render_utils ... | [
[
"torch.abs",
"torch.linspace",
"torch.norm",
"torch.ones",
"torch.zeros",
"torch.cat",
"torch.cuda.device_count",
"torch.zeros_like",
"torch.nonzero",
"torch.arange",
"torch.stack",
"torch.clamp",
"torch.meshgrid",
"torch.ones_like"
]
] |
Garimagupta85/Accident-Detection | [
"bfb6dd4ef102b4de92adf4f4c78b77ed9a25b127"
] | [
"Code/model.py"
] | [
"import glob\nimport numpy as np\nimport random\nfrom sklearn.model_selection import train_test_split \nimport os\nimport numpy\nimport glob\nimport cv2\nimport random\nfrom skimage import transform\nimport skimage\nimport sklearn\nfrom sklearn.model_selection import train_test_split \n\nimport os\nimport numpy as ... | [
[
"matplotlib.pyplot.legend",
"numpy.random.seed",
"matplotlib.pyplot.title",
"numpy.eye",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.plot",
"numpy.max",
"tensorflow.python.keras.preprocessing.image.load_img",
"matplotlib.pyplot.xlabel",
"numpy.array",
... |
TianhongDai/div-hindsight | [
"68927ec45087ee0d57a123ddad16703a7af050a3",
"68927ec45087ee0d57a123ddad16703a7af050a3"
] | [
"baselines/her/rollout.py",
"baselines/her/experiment/config.py"
] | [
"from collections import deque\nimport numpy as np\nimport pickle\nfrom mujoco_py import MujocoException\nfrom baselines.her.util import convert_episode_to_batch_major, store_args\n\nclass RolloutWorker:\n\n @store_args\n def __init__(self, make_env, policy, dims, logger, T, rollout_batch_size=1,\n ... | [
[
"numpy.isnan",
"numpy.mean",
"numpy.array",
"numpy.zeros",
"numpy.empty"
],
[
"numpy.array"
]
] |
feidaoGavin/matplotlib | [
"84abb5ca1f561921e437f13491be2bfcec0b0847"
] | [
"mtaplotlib.py"
] | [
"import matplotlib.pyplot as plt\nfrom pylab import *\n\n\nx = linspace(0, 5, 10)\ny = x ** 2\n\nfig = plt.figure()\n\naxes = fig.add_axes([0.1, 0.1, 0.8, 0.8]) # left, bottom, width, height (range 0 to 1)\n\naxes.plot(x, y, 'r')\n\naxes.set_xlabel('x')\naxes.set_ylabel('y')\naxes.set_title('title')\n\nplt.savefig(... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure"
]
] |
luozhouyang/smile_datasets | [
"c614314b2e2d83896b252670c6e3d8bd158f055b"
] | [
"rapidnlp_datasets/tf/token_classification_dataset.py"
] | [
"import logging\n\nimport tensorflow as tf\n\nfrom . import utils\nfrom .dataset import TFDataset\n\n\nclass TFDatasetForTokenClassification(TFDataset):\n \"\"\"Dataset for token classification in TensorFlow\"\"\"\n\n def __init__(self, examples=None, **kwargs) -> None:\n super().__init__(examples, **k... | [
[
"tensorflow.sparse.to_dense",
"tensorflow.constant",
"tensorflow.ragged.constant",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.io.VarLenFeature",
"tensorflow.io.parse_example",
"tensorflow.size"
]
] |
QUER01/flask-gentelella | [
"6344c0575abd1f6b1d715462206ebee2727c70de"
] | [
"source/tables/routes.py"
] | [
"from flask import Blueprint, render_template, request\nfrom flask_login import login_required\nfrom database import db\nfrom base.models import data_table_1\nfrom base.models import data_table_2\nimport datetime\nimport pandas as pd\n\nblueprint = Blueprint(\n 'tables_blueprint',\n __name__,\n url_prefix=... | [
[
"pandas.DataFrame"
]
] |
dair-iitd/1oML_workdir | [
"37117de4abf1774548786e9534c90977d67091d8"
] | [
"difflogic/nn/neural_logic/modules/neural_logic.py"
] | [
"#! /usr/bin/env python3\n#\n# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required ... | [
[
"torch.nn.Softmax",
"torch.nn.Sigmoid"
]
] |
luke-who/TFF | [
"fe9f44a504bc51b603a3ab9a181148da0aa9612f"
] | [
"federated/distributed_discrete_gaussian/discrete_gaussian_utils_test.py"
] | [
"# Copyright 2021, Google LLC. 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ap... | [
[
"tensorflow.as_dtype",
"tensorflow.zeros",
"tensorflow.test.main",
"numpy.percentile",
"numpy.std",
"numpy.mean"
]
] |
pyne/magic-cones | [
"0920eefaad6669667059ee9c6b749c2034489893"
] | [
"gaia.py"
] | [
"\"\"\"Defending the earth mother.\"\"\"\nfrom __future__ import print_function\n\nimport numpy as np\n\nimport grimoire\nfrom utils import inventories\n\nP = np.exp(-np.log(2.0)/52.0)\n\"\"\"Cone survival probability per week\"\"\"\n\ndef drop(trans):\n \"\"\"Drops magic cones, maybe.\"\"\"\n spells = list(g... | [
[
"numpy.log",
"numpy.log2",
"numpy.random.rand",
"numpy.random.randint"
]
] |
hth945/pytest | [
"83e2aada82a2c6a0fdd1721320e5bf8b8fd59abc"
] | [
"tf/yolov4tinyza/myYoloData.py"
] | [
"#%%\n# \nfrom tqdm import tqdm\nimport time\nimport os\nimport numpy as np\nimport cv2\nfrom PIL import Image\nfrom utils import get_random_data, get_random_data_with_Mosaic\nfrom matplotlib import pyplot as plt\n\ndef rand(a=0.0, b=1.0):\n return np.random.rand()*(b-a) + a\n\n#---------------------------------... | [
[
"matplotlib.pyplot.imshow",
"numpy.expand_dims",
"numpy.maximum",
"numpy.minimum",
"numpy.reshape",
"numpy.random.shuffle",
"numpy.argmax",
"numpy.random.rand",
"numpy.floor",
"numpy.array"
]
] |
vasugamdha/stylegan2 | [
"df1aace0c48a4f4754cc0c9627571a12be28b0d6"
] | [
"blend_models.py"
] | [
"import tensorflow as tf\nimport sys, getopt, os\n\nimport numpy as np\nimport dnnlib\nimport dnnlib.tflib as tflib\nfrom dnnlib.tflib import tfutil\nfrom dnnlib.tflib.autosummary import autosummary\nimport math\nimport numpy as np\n\nfrom training import dataset\nfrom training import misc\nimport pickle\n\nfrom pa... | [
[
"numpy.prod",
"tensorflow.device",
"numpy.random.RandomState",
"tensorflow.Session"
]
] |
Angel-Vazquez/CS497-7-Intro-to-Deep-Learning | [
"86f6169718c52e314e00dfa937ae27678fe2e977"
] | [
"hw1/softmaxExercise.py"
] | [
"## Softmax Exercise \n\n# Instructions\n# ------------\n# \n# This file contains code that helps you get started on the\n# softmax exercise. You will need to write the softmax cost function and\n# the softmax prediction function in softmax.py. You will also need to write\n# code in computeNumericalGradient.p... | [
[
"matplotlib.pyplot.title",
"numpy.linalg.norm",
"matplotlib.pyplot.savefig",
"numpy.mean",
"numpy.random.randn",
"matplotlib.pyplot.show",
"numpy.zeros",
"numpy.random.randint"
]
] |
ghj-hey/Huawei-cloud-garbage_classify_git | [
"52eb22e4666be1c141b126ff95490de8eb6b8904"
] | [
"timm_ns_swa.py"
] | [
"import argparse\nimport time\nimport yaml\nimport os\nimport logging\nfrom collections import OrderedDict\nfrom contextlib import suppress\nfrom datetime import datetime\n\nimport torch\nimport torch.nn as nn\nimport torchvision.utils\nfrom torch.nn.parallel import DistributedDataParallel as NativeDDP\n\nfrom timm... | [
[
"torch.max",
"torch.utils.data.DataLoader",
"torch.cuda.empty_cache",
"torch.sum",
"torch.no_grad",
"torch.device",
"sklearn.metrics.accuracy_score"
]
] |
howardchenhd/Paraphrase_Copy | [
"a1afbdd88ee62b53ecd714e58c1f504f3eed9a48"
] | [
"src/utils/beam_search.py"
] | [
"import torch\nimport numpy as np\n\nfrom .common_utils import GlobalNames, Vocab\n\n__all__ = [\n 'tile_batch',\n 'mask_scores',\n 'tensor_gather_helper',\n 'reranking_beams'\n]\n\n_FLOAT32_INF = np.float32(np.finfo('float32').max / 10)\n\n\nclass Beam(object):\n \"\"\"\n Class for managing the i... | [
[
"numpy.ones_like",
"torch.unsqueeze",
"numpy.finfo",
"torch.arange",
"torch.stack",
"numpy.argsort"
]
] |
shermelin/pymodaq_plugins_template | [
"e6e4f5c40cb3f1ad99493fcfac31b4f9f51917b6"
] | [
"src/pymodaq_plugins_template/daq_viewer_plugins/plugins_0D/daq_0Dviewer_Template.py"
] | [
"import numpy as np\nfrom easydict import EasyDict as edict\nfrom pymodaq.daq_utils.daq_utils import ThreadCommand, getLineInfo, DataFromPlugins\nfrom pymodaq.daq_viewer.utility_classes import DAQ_Viewer_base, comon_parameters\n\n\nclass DAQ_0DViewer_Template(DAQ_Viewer_base):\n \"\"\"\n \"\"\"\n params = ... | [
[
"numpy.array"
]
] |
abhilash-sw/sunkit-instruments | [
"e5655da3f422e5306930a8139bbf9c839d1ac8ca"
] | [
"sunkit_instruments/lyra/lyra.py"
] | [
"\"\"\"\nThis module provides processing routines for data captured with the LYRA (Lyman\nAlpha Radiometer) instrument on Proba-2.\n\"\"\"\nimport csv\nimport copy\nimport sqlite3\nimport datetime\nfrom warnings import warn\nfrom urllib.parse import urljoin\n\nimport numpy as np\nimport pandas\n\nfrom astropy.time ... | [
[
"numpy.logical_and",
"numpy.ones",
"numpy.concatenate",
"numpy.delete",
"numpy.append",
"numpy.diff",
"numpy.insert",
"numpy.searchsorted",
"numpy.asanyarray",
"numpy.array",
"numpy.where",
"numpy.recarray.sort",
"numpy.empty"
]
] |
wolframalpha/scorecardpy | [
"3642bebd208da52623a99356d310289dbd36dd35"
] | [
"scorecardpy/var_filter.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport pandas as pd\nimport warnings\nimport time\nfrom .condition_fun import *\nfrom .info_value import *\n\n\ndef var_filter(dt, y, x=None, iv_limit=0.02, missing_limit=0.95, \n identical_limit=0.95, var_rm=None, var_kp=None, \n return_rm... | [
[
"pandas.merge",
"pandas.melt",
"pandas.DataFrame",
"numpy.unique"
]
] |
jerryzh168/ClassyVision-1 | [
"e8704ecaa59a15dbb2f4b0724e85d6e5cb2f704e",
"e8704ecaa59a15dbb2f4b0724e85d6e5cb2f704e"
] | [
"classy_vision/hooks/exponential_moving_average_model_hook.py",
"classy_vision/models/mlp.py"
] | [
"#!/usr/bin/env python3\n# 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 itertools\nimport logging\nfrom typing import Any, Dict, Iterable, Tuple\n\nimport torch\nimport torc... | [
[
"torch._foreach_add_",
"torch._foreach_mul_",
"torch.no_grad"
],
[
"torch.nn.Sequential",
"torch.nn.Dropout",
"torch.nn.BatchNorm1d",
"torch.nn.Linear",
"torch.nn.ReLU"
]
] |
hl2500/deepchem | [
"9d0fc5554b286117ae08b21b3f15877b06a1009e"
] | [
"deepchem/data/tests/test_datasets.py"
] | [
"\"\"\"\nTests for dataset creation\n\"\"\"\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\n__author__ = \"Bharath Ramsundar\"\n__copyright__ = \"Copyright 2016, Stanford University\"\n__license__ = \"MIT\"\n\nimport random\nimport math\nimport unittest\nimport tempfile\nimport os\nimpo... | [
[
"numpy.random.random",
"numpy.random.seed",
"numpy.array_equal",
"numpy.eye",
"numpy.sort",
"numpy.ones",
"numpy.testing.assert_array_equal",
"numpy.concatenate",
"numpy.std",
"numpy.mean",
"numpy.random.rand",
"numpy.testing.assert_allclose",
"numpy.random.bino... |
ChaofanTao/litegt | [
"65c8d9ee9a2b9dcc1de9f39df7e9a8af5b69c1d8"
] | [
"train/train_TSP_edge_classification.py"
] | [
"\"\"\"\n Utility functions for training one epoch \n and evaluating one epoch\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport math\nimport dgl\nfrom tqdm import tqdm\nfrom train.metrics import binary_f1_score\n \ndef train_epoch(model, optimizer, device, data_loader, epoch):\n model.train()\n epoc... | [
[
"torch.no_grad"
]
] |
serrhini/CSIKit | [
"1cc9ecb2c0444622b258e9de48841366cbbc667b"
] | [
"CSIKit/util/byteops.py"
] | [
"from typing import Tuple\n\nimport numpy as np\n\ndef signbit_convert(data: int, maxbit: int) -> int:\n if (data & (1 << (maxbit - 1))):\n data -= (1 << maxbit)\n\n return data\n\ndef get_next_bits(buf: bytes, current_data: int, idx: int, bits_left: int) -> Tuple[int, int, int]:\n h_data = buf[idx]... | [
[
"numpy.zeros"
]
] |
dgketchum/csci547 | [
"bbba91c1cd09f672342b11280f79e551968a0037"
] | [
"hw2/titanic.py"
] | [
"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.metrics import confusion_matrix, accuracy_score\n\n\ndef softmax(X, W, N):\n a = np.dot(X, W)\n return np.exp(a) / np.repeat(np.sum(np.exp(a), axis=1, keepdims=True), N, axis... | [
[
"numpy.dot",
"pandas.read_csv",
"numpy.ones_like",
"numpy.isnan",
"pandas.get_dummies",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.plot",
"numpy.random.randn",
"numpy.exp",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.... |
Fredrik00/wavedata | [
"3e9b9b57c3254d84b2384153658206f07310264e"
] | [
"wavedata/tools/core/voxel_grid_2d.py"
] | [
"import numpy as np\n\nfrom wavedata.tools.core import geometry_utils\n\n\nclass VoxelGrid2D(object):\n \"\"\"\n Voxel grids represent occupancy info. The voxelize_2d method projects a point cloud\n onto a plane, while saving height and point density information for each voxel.\n \"\"\"\n\n # Class C... | [
[
"numpy.square",
"numpy.amax",
"numpy.abs",
"numpy.unique",
"numpy.clip",
"numpy.amin",
"numpy.ascontiguousarray",
"numpy.int32",
"numpy.lexsort",
"numpy.dtype",
"numpy.ceil",
"numpy.append",
"numpy.diff",
"numpy.zeros_like",
"numpy.floor",
"numpy.var... |
basp/aya | [
"16614a62d0696ae38721a47fdafbc90ef295ebc2"
] | [
"perlin.py"
] | [
"# http://scratchapixel.com/old/lessons/3d-advanced-lessons/noise-part-1/\nimport numpy as np\n\nMAX_VERTICES = 256\nMAX_VERTICES_MASK = MAX_VERTICES - 1\n\nr = np.random.ranf(MAX_VERTICES)\nperm = [i & MAX_VERTICES_MASK for i in range(MAX_VERTICES * 2)]\nnp.random.shuffle(perm)\n\ndef lerp(v0, v1, t):\n\treturn (1... | [
[
"numpy.random.ranf",
"numpy.random.shuffle"
]
] |
wenlanzsw/pyroms | [
"d1aa8647d4119aef07cbf576100c3e6d44d60931"
] | [
"setup.py"
] | [
"\"\"\"Tools to work with the Regional Ocean Modeling System (ROMS).\n\nBased on:\n + NumPy (http://numpy.scipy.org)\n + matplotlib with the basemap toolkit (http://matplotlib.sourceforge.net)\n + netCDF4 (http://www.cdc.noaa.gov/people/jeffrey.s.whitaker/python/netCDF4.html)\n\nContains:\n + grid\n + Grid - a c... | [
[
"numpy.distutils.core.Extension"
]
] |
raspbian-packages/pandas | [
"fb33806b5286deb327b2e0fa96aedf25a6ed563f"
] | [
"asv_bench/benchmarks/gil.py"
] | [
"from .pandas_vb_common import *\nfrom pandas.core import common as com\n\ntry:\n from cStringIO import StringIO\nexcept ImportError:\n from io import StringIO\n\ntry:\n from pandas.util.testing import test_parallel\n\n have_real_test_parallel = True\nexcept ImportError:\n have_real_test_parallel = F... | [
[
"pandas.core.common.take_1d",
"pandas.util.testing.test_parallel"
]
] |
IEavan/tournaments-analysis | [
"d91050867ff3ca891c0e326fcbf8009f353bf72e"
] | [
"tournaments.py"
] | [
"import numpy as np\nfrom player import Player\n\nclass Elimination():\n def __init__(self, players):\n if np.log2(len(players)) != int(np.log2(len(players))):\n raise ValueError(\"Number of players must be a power of 2\")\n self.players = players\n\n def get_brackets(self):\n ... | [
[
"numpy.random.shuffle"
]
] |
damonchang23/3d_pose_baseline_pytorch | [
"5fedd6b2026be43155829a87d5c7ba6d5db64af6"
] | [
"src/model.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\nimport torch.nn as nn\n\n\ndef weight_init(m):\n if isinstance(m, nn.Linear):\n nn.init.kaiming_normal_(m.weight)\n\n\nclass Linear(nn.Module):\n def __init__(self, linear_s... | [
[
"torch.nn.BatchNorm1d",
"torch.nn.Dropout",
"torch.nn.ModuleList",
"torch.nn.Linear",
"torch.nn.ReLU",
"torch.nn.init.kaiming_normal_"
]
] |
Karlinik/RotationDetection | [
"efd20d56d3964b89fa356e79a052bb53f6ac8ddb"
] | [
"libs/configs/DOTA/retinanet/cfgs_res50_dota_atan_v2.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import division, print_function, absolute_import\n\nimport numpy as np\n\nfrom libs.configs._base_.models.retinanet_r50_fpn import *\nfrom libs.configs._base_.datasets.dota_detection import *\nfrom libs.configs._base_.schedules.schedule_1x import *\nfrom dataloader.pretrain... | [
[
"numpy.array"
]
] |
103yiran/open-vot | [
"9bb4427c300dc2bddf38e6a8c2c257a015d10d4f"
] | [
"lib/experiments/vot.py"
] | [
"from __future__ import absolute_import, division\n\nimport os\nimport cv2\nimport time\nimport numpy as np\nimport glob\nimport json\nimport ast\n\nfrom ..datasets.vot import VOT\nfrom ..utils import dict2tuple\nfrom ..utils.viz import show_frame\nfrom ..metrics import rect_iou, poly_iou\n\n\nclass ExperimentVOT(o... | [
[
"numpy.isnan",
"numpy.asarray",
"numpy.stack",
"numpy.full",
"numpy.concatenate",
"numpy.ones",
"numpy.nanmean",
"numpy.savetxt",
"numpy.zeros",
"numpy.sum",
"numpy.loadtxt"
]
] |
wer010/second.pytorch | [
"cb26f7f4d5a661d14e5b9721958c7b9071612737"
] | [
"second/data/nuscenes/eval/detection/data_classes.py"
] | [
"# nuScenes dev-kit.\n# Code written by Oscar Beijbom, 2019.\n# Licensed under the Creative Commons [see licence.txt]\n\nfrom collections import defaultdict\nfrom typing import List, Dict, Tuple\n\nimport numpy as np\nimport sys\nsys.path.append('/home/lichao/Projects/second.pytorch')\nfrom second.data.nuscenes.eva... | [
[
"numpy.random.random",
"numpy.nonzero",
"numpy.linspace",
"numpy.isnan",
"numpy.ones",
"numpy.nanmean",
"numpy.array",
"numpy.zeros"
]
] |
shagunsodhani/pytorch_sparse | [
"2984f28815c90dd5bae09aa6fdacf1c8a149eb9a"
] | [
"test/test_spspmm.py"
] | [
"from itertools import product\n\nimport pytest\nimport torch\nfrom torch_sparse import spspmm\n\nfrom .utils import dtypes, devices, tensor\n\n\n@pytest.mark.parametrize('dtype,device', product(dtypes, devices))\ndef test_spspmm(dtype, device):\n indexA = torch.tensor([[0, 0, 1, 2, 2], [1, 2, 0, 0, 1]], device=... | [
[
"torch.sparse_coo_tensor",
"torch.matmul",
"torch.Size",
"torch.tensor"
]
] |
covid19-specialist/ssd.pytorch | [
"acafba6e42896f1814d3d7f6807d0ce478715fbb"
] | [
"test.py"
] | [
"from __future__ import print_function\nimport sys\nimport os\nimport argparse\nimport torch\nimport torch.nn as nn\nimport torch.backends.cudnn as cudnn\nimport torchvision.transforms as transforms\n# from torch.autograd import Variable\nfrom data import WHEAT_ROOT, WHEAT_CLASSES\nfrom PIL import Image\nfrom data ... | [
[
"torch.set_default_tensor_type",
"torch.Tensor",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
ParikhKadam/pytorch3d | [
"5cd70067e2ba642d98fd36e8e31273366d1599cb",
"5cd70067e2ba642d98fd36e8e31273366d1599cb"
] | [
"tests/test_cubify.py",
"tests/test_acos_linear_extrapolation.py"
] | [
"# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport unittest\n\nimport torch\nfrom pytorch3d.ops import cubify\n\nfrom .common_testing import Tes... | [
[
"torch.cuda.synchronize",
"torch.ones",
"torch.zeros",
"torch.tensor",
"torch.rand",
"torch.device"
],
[
"torch.cuda.synchronize",
"torch.linspace",
"numpy.random.seed",
"torch.cat",
"torch.sqrt",
"torch.manual_seed",
"torch.randn",
"torch.tensor",
"... |
linea-it/tno_astrometry | [
"4d48e979937e2106da598dc0b2d53152b09a7002"
] | [
"praia_target.py"
] | [
"from astropy.utils import iers\nfrom astropy.time import Time\nfrom astropy.coordinates import GCRS, EarthLocation\nimport os\nimport subprocess\n\nimport numpy as np\nimport spiceypy as spice\n# Deligar o auto Download do Finals2000\n# https://docs.astropy.org/en/stable/utils/iers.html#working-offline\niers.conf.... | [
[
"numpy.degrees",
"numpy.loadtxt"
]
] |
specialforcea/labscript_suite | [
"a4ad5255207cced671990fff94647b1625aa0049"
] | [
"userlib/analysislib/paco_analysis/common/get_raw_images.py"
] | [
"import h5py\nimport numpy as np\n\ndef get_raw_images(fpath):\n with h5py.File(fpath) as h5_file:\n if '/data/imagesYZ_2_Flea3' in h5_file:\n image_group = 'imagesYZ_2_Flea3'\n if '/data/imagesXY_1_Flea3' in h5_file:\n image_group = 'imagesXY_1_Flea3'\n if False: #'/d... | [
[
"numpy.array"
]
] |
SJTU-Thinklab-Det/DOTA-DOAI | [
"eb252da4a32c5b961720a129266881c848659263"
] | [
"FPN_Tensorflow_Rotation/libs/configs/DOTA1.0/cfgs_dota1.0_res152_v1.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import division, print_function, absolute_import\nimport os\nimport tensorflow as tf\n\n\"\"\"\nres152D_freezeC1C2_rmaskP2_Concat_800train_augMS_8conv_CTX\n\nThis is your result for task 1:\n\n mAP: 0.7898724310364561\n ap of each class:\n plane:0.9006183729548372,... | [
[
"tensorflow.random_normal_initializer"
]
] |
brianx0215/deep-reinforcement-learning | [
"606ccb5eb1b302514567e33dcfdb372942671af7"
] | [
"p1_navigation/dqn_agent.py"
] | [
"import numpy as np\nimport random\nfrom collections import namedtuple, deque\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nBUFFER_SIZE = int(1e5) # replay buffer size\nBATCH_SIZE = 64 # minibatch size\nGAMMA = 0.99 # discount factor\nTAU... | [
[
"torch.nn.Sequential",
"torch.LongTensor",
"torch.load",
"torch.manual_seed",
"numpy.arange",
"torch.nn.Conv2d",
"torch.from_numpy",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.functional.mse_loss",
"torch.FloatTensor",
"torch.no_grad",
"torch.cuda.is_ava... |
pdturney/modeling-symbiosis-revised | [
"cf342667def566e1ad26dbe46e4e8acfb9be7cf9"
] | [
"model_functions.py"
] | [
"\"\"\"\r\nModel Functions\r\n\r\nPeter Turney, May 18, 2020\r\n\"\"\"\r\nimport golly as g\r\nimport model_classes as mclass\r\nimport model_parameters as mparam\r\nimport random as rand\r\nimport numpy as np\r\nimport copy\r\nimport time\r\nimport pickle\r\nimport os\r\nimport re\r\nimport sys\r\n\"\"\"\r\nVariou... | [
[
"numpy.amax",
"numpy.sum"
]
] |
Stanislas0/grb | [
"96fc521f57fdb06ab6a3c442fcf4a8bc97894829"
] | [
"grb/utils/trainer.py"
] | [
"import os\nimport time\n\nimport torch\nimport torch.nn.functional as F\n\nimport grb.utils as utils\nfrom grb.evaluator import metric\n\n\nclass Trainer(object):\n def __init__(self,\n dataset,\n optimizer,\n loss,\n adj_norm_func=None,\n ... | [
[
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.nn.functional.log_softmax",
"torch.nn.functional.sigmoid",
"torch.where",
"torch.logical_or"
]
] |
glhr/yolact | [
"5e573ce940a76a54ef58fd0d3d7891f61816c1bc"
] | [
"yolact.py"
] | [
"import torch, torchvision\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision.models.resnet import Bottleneck\nimport numpy as np\nfrom itertools import product\nfrom math import sqrt\nfrom typing import List\nfrom collections import defaultdict\n\nfrom data.config import cfg, mask_type\nfrom... | [
[
"torch.set_default_tensor_type",
"torch.nn.functional.softmax",
"torch.zeros",
"torch.cat",
"torch.sum",
"torch.cuda.is_available",
"torch.nn.functional.interpolate",
"torch.ones",
"torch.nn.functional.relu",
"numpy.load",
"torch.nn.functional.max_pool2d",
"torch.nn... |
JulySinceAndrew/PP-Rec | [
"535272525326d8d1c5f57a2b27dfa48bfac69629"
] | [
"Code/NewsContent.py"
] | [
"import numpy as np\nfrom utils import *\nimport os\nimport json\n\nclass NewsContent():\n def __init__(self,config,):\n self.config = config\n self.read_news()\n self.get_doc_input()\n self.load_entitiy()\n self.load_ctr()\n self.load_publish_time()\n\n def fetch_new... | [
[
"numpy.concatenate",
"numpy.zeros"
]
] |
Phhere/tiktorch | [
"82f109b4d82dda4b63a5d93e5527fc409a9fd4c1"
] | [
"tests/test_server/test_datasets.py"
] | [
"import math\nfrom collections import Counter\n\nimport numpy as np\nimport pytest\nimport torch\n\nfrom tiktorch import tiktypes as types\nfrom tiktorch.server import datasets\n\n\nclass TestDynamicDataset:\n @pytest.fixture\n def dataset(self):\n return datasets.DynamicDataset()\n\n @pytest.fixtur... | [
[
"torch.Tensor",
"numpy.arange",
"torch.equal",
"numpy.ones",
"torch.DoubleTensor"
]
] |
michal-hradis/torchSLAM | [
"23a23f27f66f4c8a7aa11283c87f1aaba0bb1475"
] | [
"src/incremental_slam.py"
] | [
"import logging\nlogging.basicConfig(level=logging.INFO)\n\nimport argparse\nimport torch\nimport numpy as np\nimport cv2\nimport time\nfrom collections import defaultdict\nfrom pytorch3d import transforms\nimport open3d as o3d\nimport laspy\nfrom slam_primitives import CalibratedCamera, CameraMotionSpeedConstraint... | [
[
"numpy.minimum",
"numpy.linspace",
"torch.zeros",
"numpy.asarray",
"numpy.max",
"torch.no_grad",
"torch.cuda.is_available",
"torch.logical_not",
"torch.isin",
"torch.from_numpy",
"torch.arange",
"numpy.zeros",
"torch.optim.Adam",
"numpy.min",
"numpy.isna... |
JeffMII/Questgen.ai | [
"6715eb1f54af44090e146fde157a8bf94de961a3"
] | [
"Questgen/mcq/mcq.py"
] | [
"# import numpy as np # linear algebra\n# import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n# import time\nimport torch\n# from transformers import T5ForConditionalGeneration,T5Tokenizer\nimport random\n# import spacy\n# import boto3\n# import zipfile\n# import os\n# import json\n# from sense2... | [
[
"torch.no_grad"
]
] |
mghasemi/pyProximation | [
"2d19627aac33cc024c7f81b2a3f656794c9a5141"
] | [
"pyProximation/measure.py"
] | [
"from base import Foundation\n\n\nclass Measure(Foundation):\n \"\"\"\n An instance of this class is a measure on a given set `supp`. The support is either\n + a python variable of type `set`, or\n + a list of tuples which represents a box in euclidean space.\n Initializes a measure o... | [
[
"scipy.integrate.nquad",
"scipy.stats.rv_discrete"
]
] |
muyeby/AMR-Dialogue | [
"261535c407be6c166016e4759bc81176b1c99957"
] | [
"DialogRG/run.py"
] | [
"import os\nimport torch\nimport random\nfrom apex import amp\n\nrandom.seed(0)\ntorch.manual_seed(0)\ntorch.cuda.manual_seed(0)\nimport torch.nn as nn\nimport numpy as np\n\nnp.random.seed(0)\ntorch.backends.cudnn.deterministic = True\nimport tqdm\nimport argparse\nimport config_utils\nfrom dataset_utils import (\... | [
[
"numpy.random.get_state",
"torch.max",
"numpy.random.seed",
"torch.cuda.manual_seed",
"torch.load",
"torch.manual_seed",
"torch.cuda.empty_cache",
"torch.nn.DataParallel",
"torch.no_grad",
"torch.cuda.is_available",
"torch.cuda.device_count",
"torch.save"
]
] |
tiendzung-le/weather4cast-stage1 | [
"56bedfa01351e5bea02bfb3a608a68ade329242e"
] | [
"weather4cast/blocks.py"
] | [
"import numpy as np\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.layers import Add, Conv2D, Layer\nfrom tensorflow.keras.layers import ELU, LeakyReLU, ReLU, Activation\nfrom tensorflow.keras.layers import AveragePooling2D\nfrom tensorflow.keras.layers import BatchNormalization, TimeDistributed\... | [
[
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.LeakyReLU",
"tensorflow.keras.layers.ReLU",
"tensorflow.keras.layers.ELU",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.la... |
aleczoeller/SQLServer_Loan_Data_Reporting | [
"229463a652ce54073f0565a74e20f828f8a1d21b"
] | [
"Generate_Report.py"
] | [
"# -*- coding: utf-8 -*-\r\n\r\n\"\"\"\r\n******************************************\r\n* Generate_Report.py *\r\n* ------------------ *\r\n* Connect to SQL Database, retrieve *\r\n* weekly loan data and email to *\r\n* specified recipients as cleaned *\r... | [
[
"pandas.io.json.json_normalize",
"pandas.to_datetime",
"pandas.read_sql",
"pandas.ExcelWriter"
]
] |
ashwindcruz/dgm | [
"b8bfdf2485afe8ff6619ae0bf59705159728e76d"
] | [
"sdgm_mnist/model.py"
] | [
"import pdb\n\nimport numpy as np\nimport math\nimport time\n\nimport chainer\nimport chainer.functions as F\nimport chainer.links as L\nfrom chainer import cuda\n\nfrom util import gaussian_kl_divergence_standard\nfrom util import gaussian_logp\nfrom util import gaussian_logp0\nfrom util import bernoulli_logp\n\nc... | [
[
"numpy.array"
]
] |
1001871302/CSE_6392_Term_Project | [
"899b9bbb15aac1aee5274b14fa69f3a96b0a9714"
] | [
"OnPC_Pipelines/Project DataCode1/VisualizeData.py"
] | [
"import numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom numpy.core.fromnumeric import mean\r\nfrom scipy.fftpack import fft, fftshift\r\nimport math\r\n\r\ndef string2array(input_str):\r\n line = ( input_str.strip('\\n,],[').split(',') ) \r\n line = np.array([ eval(num) for num in line])\r\n return... | [
[
"numpy.abs",
"scipy.fftpack.fft",
"numpy.std",
"numpy.mean",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
sonercandas/fledge | [
"ac107df1236d898ea31f62a60a568cf00a9bda08"
] | [
"examples/run_electric_grid_optimal_power_flow_trust_region.py"
] | [
"\"\"\"Example script for setting up and solving an optimal power flow problem with trust-region algorithm.\"\"\"\n\nimport numpy as np\nimport os\nimport pandas as pd\nimport pyomo.environ as pyo\n\nimport fledge.config\nimport fledge.database_interface\nimport fledge.linear_electric_grid_models\nimport fledge.ele... | [
[
"numpy.real",
"numpy.imag"
]
] |
Siddhant-Ray/relatio | [
"30ad7a6bb143384db2f1b6cf51477bbed20e7b52"
] | [
"relatio/semantic_role_labeling.py"
] | [
"# MIT License\n\n# Copyright (c) 2020-2021 ETH Zurich, Andrei V. Plamada\n# Copyright (c) 2020-2021 ETH Zurich, Elliott Ash\n# Copyright (c) 2020-2021 University of St.Gallen, Philine Widmer\n# Copyright (c) 2020-2021 Ecole Polytechnique, Germain Gauthier\n\n# Semantic Role Labeling\n# ............................... | [
[
"numpy.asarray",
"torch.cuda.device",
"torch.cuda.empty_cache"
]
] |
Javim24/project-based-learning | [
"d13320f28eb74ddf8587c88e2ab9a337b0c77ff2"
] | [
"python/data_science/intro.py"
] | [
"from sklearn import tree, svm\n\n# [height, weight, shoe_size]\nX = [[181, 80, 44], [177, 70, 43], [160, 60, 38], [154, 54, 37], [166, 65, 40],\n [190, 90, 47], [175, 64, 39],\n [177, 70, 40], [159, 55, 37], [171, 75, 42], [181, 85, 43]]\n\nY = ['male', 'male', 'female', 'female', 'male', 'male', 'female',... | [
[
"sklearn.tree.DecisionTreeClassifier",
"sklearn.svm.SVC"
]
] |
baoy-nlp/TextVAE-pytorch | [
"65e53eef4f0c8b6ddd1355c857eff028421c0b4e"
] | [
"encoder/attentive_encoder.py"
] | [
"# MIT License\n\n# Copyright (c) 2018 the NJUNMT-pytorch authors.\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# t... | [
[
"torch.nn.Dropout",
"torch.nn.LayerNorm"
]
] |
GSS-Cogs/sdg-build | [
"16aae08407d920478224648694ab2ab2e2572712"
] | [
"sdg/outputs/OutputGeoJson.py"
] | [
"import os\nimport json\nimport copy\nfrom urllib.request import urlopen\nimport sdg\nimport pandas as pd\nfrom sdg.outputs import OutputBase\n\nclass OutputGeoJson(OutputBase):\n \"\"\"Output SDG data/metadata in GeoJson disaggregated by region.\"\"\"\n\n\n def __init__(self, inputs, schema, output_folder='_... | [
[
"pandas.isna"
]
] |
shawdm/experiments-tensorflow-models | [
"eb4b62fd5cb20dcd8e768f122957a1a1c11ba31b"
] | [
"official/resnet/imagenet_main.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.FixedLenFeature",
"tensorflow.reshape",
"tensorflow.logging.set_verbosity",
"tensorflow.image.convert_image_dtype",
"tensorflow.VarLenFeature",
"tensorflow.one_hot",
"tensorflow.parse_single_example",
"tensorflow.app.run"
]
] |
jmoraga-mines/SparseConvNet | [
"735600176a05259eea5a93a47f320b008f463eaa"
] | [
"setup.py"
] | [
"# Copyright 2016-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport torch, os\nfrom torch.utils.cpp_extension import BuildExtension, CppExtension, CUDAExtension\nfrom setupt... | [
[
"torch.utils.cpp_extension.CUDAExtension"
]
] |
pixel-ports/PPA_Traffic_Prediction | [
"5a4f3e7746bea024a8c05307328548bef934a733"
] | [
"Scripts/WeatherData.py"
] | [
"import pandas as pd\r\nimport ast\r\n\r\n\r\n\r\ndef aggregation_functionWeather(a):\r\n\r\n df = pd.DataFrame()\r\n df = pd.read_csv(r'C:\\Users\\sergi\\Desktop\\Environment\\Raw Data\\WeatherRawData.csv')\r\n weather_data = pd.DataFrame()\r\n\r\n for index, row in df.iterrows():\r\n darkSky = ... | [
[
"pandas.read_csv",
"pandas.to_datetime",
"pandas.Grouper",
"pandas.DataFrame",
"pandas.Timestamp"
]
] |
DongxuGuo1997/TransNet | [
"a720c0b1ac18db19796409b51e1cab96b744a4f0"
] | [
"src/model/baselines.py"
] | [
"import torch\nimport torchvision\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision.ops import RoIAlign\nfrom .basenet import *\n\n\nclass Res18Crop(torch.nn.Module):\n \"\"\"\n CNN for single frame model with cropped image.\n \"\"\"\n\n def __init__(self, backbone, drop_p=0.5):\... | [
[
"torch.nn.Dropout",
"torch.nn.LSTM",
"torch.nn.Conv2d",
"torch.nn.utils.rnn.pad_sequence",
"torch.nn.GRU",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.Sigmoid",
"torch.unsqueeze",
"torch.nn.Linear",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.functional... |
svenkilian/Deep-Reinforcement-Learning-Hands-On | [
"b9ab995722bd692828ce3e6f50026fa87e5f924b"
] | [
"Chapter06/02_dqn_pong.py"
] | [
"#!/usr/bin/env python3\nfrom lib import wrappers\nfrom lib import dqn_model\n\nimport argparse\nimport time\nimport numpy as np\nimport collections\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\nfrom tensorboardX import SummaryWriter\n\n\nDEFAULT_ENV_NAME = \"PongNoFrameskip-v4\"\nMEAN_REWA... | [
[
"torch.ByteTensor",
"numpy.random.random",
"torch.max",
"torch.tensor",
"numpy.mean",
"torch.device",
"numpy.array",
"torch.nn.MSELoss"
]
] |
QuantLaw/legal-data-preprocessing | [
"c5462ba946e858d5e33a4698e9da350402903bca"
] | [
"utils/common.py"
] | [
"import argparse\nimport os\nimport pickle\nimport shutil\nfrom collections import Counter\n\nimport pandas as pd\nfrom quantlaw.utils.files import ensure_exists\nfrom quantlaw.utils.pipeline import PipelineStep\nfrom regex import regex\n\nfrom statics import (\n DATA_PATH,\n DE_LAW_NAMES_COMPILED_PATH,\n ... | [
[
"pandas.read_csv"
]
] |
Guymer/flffc | [
"635f863c3f45158fdf5ea9afa091c1de8439bdf0"
] | [
"run.py"
] | [
"def run(dirOut = \"FLFFCoutput\", country = \"United Kingdom\", steps = 50):\n # Import standard modules ...\n import os\n\n # Import special modules ...\n try:\n import cartopy\n import cartopy.crs\n import cartopy.io\n import cartopy.io.shapereader\n except:\n ra... | [
[
"numpy.linspace",
"matplotlib.use",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
]
] |
kfollette/QuaRCS | [
"9ca0d997d6b20caeac45f1322f82de15f0450b65"
] | [
"tutorials/scoring tutorial/score.py"
] | [
"from factor_analyzer import FactorAnalyzer, Rotator, calculate_bartlett_sphericity, calculate_kmo\nfrom sklearn.utils import check_array\nfrom matplotlib import pyplot as plt\nimport pandas as pd\nimport numpy as np\n\ndef score(database, semester, year, season, answer_key, savedname):\n '''\n Modified so th... | [
[
"pandas.read_csv",
"pandas.isnull",
"numpy.unique",
"matplotlib.pyplot.title",
"sklearn.utils.check_array",
"numpy.arange",
"pandas.DataFrame",
"numpy.nansum",
"pandas.isna"
]
] |
andyreagan/dbdiff | [
"6fccc6cd7c88e1e91def7bfc89057b0c0fd73883"
] | [
"tests/test_dbdiff.py"
] | [
"import logging\nimport os\nfrom pathlib import Path\n\nimport pandas as pd\nimport pytest\nfrom click.testing import CliRunner\n\nfrom dbdiff.main import check_primary_key\nfrom dbdiff.main import create_diff_table\nfrom dbdiff.main import create_joined_table\nfrom dbdiff.main import get_column_diffs\nfrom dbdiff.... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
jessemin/D3BayesNet | [
"75788750a43053fc8fa6965623a1958f6a6f082a"
] | [
"app/bayesian.py"
] | [
"import sys\nimport networkx as nx\nimport numpy as np\nfrom math import lgamma\n\n\ndef write_gph(dag, idx2names, filename):\n with open(filename, 'w') as f:\n for edge in dag.edges():\n f.write(\"{}, {}\\n\".format(idx2names[edge[0]], idx2names[edge[1]]))\n\n\ndef get_idx2names(line):\n id... | [
[
"numpy.max",
"numpy.append",
"numpy.array"
]
] |
co2palm/antivirus_demo | [
"015b2b91042fede067b1d34043a19fe87fb53c4b"
] | [
"demo.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pickle\nimport sklearn.ensemble as ske\nfrom sklearn import cross_validation, tree, linear_model\nfrom sklearn.feature_selection import SelectFromModel\nfrom sklearn.externals import joblib\nfrom sklearn.naive_bayes import GaussianNB\nfrom sklearn.metrics import conf... | [
[
"sklearn.externals.joblib.dump",
"sklearn.cross_validation.train_test_split",
"pandas.read_csv",
"sklearn.naive_bayes.GaussianNB",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.ensemble.ExtraTreesClassifier",
"sklearn.metrics.confusion_matrix",
"sklearn.tree.DecisionTreeClass... |
gregversteeg/esh_dynamics | [
"c0811e62306c0cdff659abf5fa9b884ec6b556df"
] | [
"generate_figures/plot_valley.py"
] | [
"\"\"\"Produce a plot for the paper, comparing ESH MC steps to Langevin dynamics.\"\"\"\nimport numpy as np\nimport torch as t\nfrom esh import samplers, datasets\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nplt.style.use('seaborn-paper')\nsns.set_context(\"paper\", font_scale=1.5, rc={\"lines.linewidth... | [
[
"numpy.log",
"numpy.linspace",
"torch.manual_seed",
"matplotlib.pyplot.subplots",
"torch.tensor",
"torch.no_grad",
"numpy.array",
"numpy.exp",
"matplotlib.pyplot.style.use"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.