repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
lbasora/traffic | [
"775d2ad6a92f1a6be66bfa0728a658240983f3e0"
] | [
"traffic/core/mixins.py"
] | [
"from functools import lru_cache, partial\nfrom pathlib import Path\nfrom typing import Tuple, Union\n\nfrom matplotlib.axes._subplots import Axes\n\nimport pandas as pd\nimport pyproj\nfrom shapely.geometry import Point, base\nfrom shapely.ops import transform\n\n\nclass DataFrameMixin(object):\n\n \"\"\"DataFr... | [
[
"pandas.read_pickle",
"pandas.read_hdf",
"pandas.read_csv",
"matplotlib.transforms.offset_copy"
]
] |
HAIbingshuai/chinese_ocr | [
"36c06226b3762b2e516427579f2c2614770e60ae"
] | [
"Text_A_yolo_model_file/common_yolo/text_proposal_connector.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport numpy as np\nfrom Text_A_yolo_model_file.common_yolo.text_proposal_graph_builder import TextProposalGraphBuilder\n\n\nclass TextProposalConnector:\n\n def __init__(self, MAX_HORIZONTAL_GAP=30, MIN_V_OVERLAPS=0.6, MIN_SIZE_SIM=0.6):\n self.graph_buil... | [
[
"numpy.max",
"numpy.sum",
"numpy.min",
"numpy.mean",
"numpy.polyfit"
]
] |
JingdiC/SARNet | [
"05d668c2d1c0d3f8009ecb98ab33cd5a496cd4ea"
] | [
"multiagent-particle-envs/multiagent/scenarios/simple_spread_10.py"
] | [
"import numpy as np\nfrom multiagent.core import World, Agent, Landmark, Border\nfrom multiagent.scenario import BaseScenario\n\n\nclass Scenario(BaseScenario):\n def make_world(self):\n world = World()\n # set any world properties first\n world.dim_c = 2\n num_agents = 10\n nu... | [
[
"numpy.concatenate",
"numpy.square",
"numpy.array",
"numpy.zeros",
"numpy.random.uniform",
"numpy.argsort"
]
] |
wanjinchang/deepface-1 | [
"97c16a664795223f976987febfeb8d23657deb65",
"97c16a664795223f976987febfeb8d23657deb65"
] | [
"deepface/detectors/detector_dlib.py",
"deepface/recognizers/recognizer_resnet.py"
] | [
"import os\n\nimport dlib\nimport numpy as np\n\nfrom deepface.confs.conf import DeepFaceConfs\nfrom deepface.utils.bbox import BoundingBox\n\nfrom .detector_base import FaceDetector\n\n\nclass FaceDetectorDlib(FaceDetector):\n \"\"\"\n reference : https://www.pyimagesearch.com/2017/04/03/facial-landmarks-dli... | [
[
"numpy.zeros"
],
[
"numpy.load",
"tensorflow.global_variables_initializer",
"numpy.linalg.norm",
"tensorflow.layers.flatten",
"tensorflow.layers.batch_normalization",
"tensorflow.constant",
"tensorflow.variable_scope",
"tensorflow.layers.dense",
"tensorflow.add",
"t... |
rbli-john/VisTR | [
"f49b4a2773cbbd2502e21c879fc3ad8e832f6296"
] | [
"inference.py"
] | [
"'''\nInference code for VisTR\nModified from DETR (https://github.com/facebookresearch/detr)\n'''\nimport argparse\nimport datetime\nimport json\nimport random\nimport time\nfrom pathlib import Path\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader, DistributedSampler\n\nimport datasets\... | [
[
"numpy.max",
"torch.device",
"torch.cat",
"numpy.bincount",
"torch.stack",
"numpy.array",
"numpy.random.seed",
"torch.no_grad",
"torch.manual_seed",
"torch.tensor",
"numpy.argmax",
"torch.load"
]
] |
gregorgebhardt/agents | [
"b6aeae5e0ed68dd4e4ec2ca73ef971254d3208f3"
] | [
"tf_agents/agents/sac/sac_agent.py"
] | [
"# coding=utf-8\n# Copyright 2018 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b... | [
[
"tensorflow.exp",
"tensorflow.compat.v2.summary.scalar",
"tensorflow.minimum",
"tensorflow.GradientTape",
"tensorflow.debugging.check_numerics",
"tensorflow.concat",
"tensorflow.group",
"tensorflow.nest.flatten",
"tensorflow.clip_by_value",
"tensorflow.name_scope",
"ten... |
coupetmaxence/finance-cheatsheets | [
"4f3e1cef1653da808c296c15908e9f6d5b0575f3"
] | [
"Greeks/greeks_monte_carlo_method.py"
] | [
"import matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom time import time\r\nimport pandas as pd\r\nfrom scipy.stats import norm\r\n\r\n# Underlying informations\r\nS0 = 100.0\r\nsigma = 0.2\r\n\r\n# European option informations\r\nT = 1.0\r\nK = 100.0\r\nr = 0.05\r\n\r\n# Simulation parameters\r\nnbr_steps =... | [
[
"numpy.random.standard_normal",
"numpy.log",
"numpy.random.seed",
"numpy.exp",
"numpy.sqrt",
"numpy.cumsum",
"numpy.abs",
"numpy.linspace"
]
] |
aiwizzard/transformer | [
"26d5173c533ab98fa431fcfd926d4c9833f3ef80"
] | [
"model/generator.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass Generator(nn.Module):\n r\"\"\"Generator class\n\n Args:\n model_dim(int): dimension of the model\n vocab(int): vocab size\n \"\"\"\n def __init__(self, model_dim, vocab):\n super(Generator, self).__init_... | [
[
"torch.nn.Linear",
"torch.nn.functional.log_softmax"
]
] |
tlochmanczyk/faceRecognition | [
"75819cc32ff323eae24a4766b2e285ec80115971"
] | [
"src/ml_cloud_model/custom_predictor/predictor.py"
] | [
"import os\nimport pickle\n\nimport numpy as np\nfrom tensorflow import keras\n\n\nclass MyPredictor(object):\n \"\"\"An example Predictor for an AI Platform custom prediction routine.\"\"\"\n\n def __init__(self, model, embedder):\n \"\"\"Stores artifacts for prediction. Only initialized via `from_pat... | [
[
"tensorflow.keras.models.load_model",
"numpy.asarray"
]
] |
shamanDevel/AdaptiveSampling | [
"2d3014a61fc8128b2b5c578a3fc6bade4cb3fe4e"
] | [
"network/models/videotools.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass VideoTools:\n\n @staticmethod\n def flatten_high(image_high, upscale_factor):\n \"\"\"\n Reshapes the high resolution input image with shape\n B x C x H*upscale_factor x W*upscale_factor\n to a low res... | [
[
"torch.cat",
"torch.nn.functional.interpolate",
"torch.broadcast_tensors",
"torch.linspace",
"torch.unsqueeze",
"torch.nn.functional.grid_sample",
"torch.chunk"
]
] |
upura/kaggle_utils | [
"72a02d11091acc9ce6ca679b5533a531293e61d8"
] | [
"kaggle_utils/features/image.py"
] | [
"import multiprocessing\nimport operator\nimport os\nfrom collections import defaultdict\nfrom functools import partial\n\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom PIL import Image\nfrom skimage import feature\nfrom sklearn.metrics.pairwise import euclidean_distance... | [
[
"numpy.fft.ifft2",
"numpy.fft.fft2",
"numpy.exp",
"numpy.mean",
"pandas.concat",
"numpy.imag",
"sklearn.metrics.pairwise.euclidean_distances",
"numpy.fft.fftfreq",
"numpy.max",
"numpy.uint8",
"numpy.linalg.norm",
"numpy.zeros_like",
"numpy.eye",
"numpy.argma... |
garrettkatz/cubies | [
"1e9e5cf8ca9aec336061c289f745c20ffe9bde86"
] | [
"algorithm.py"
] | [
"import numpy as np\n\ndef macro_search(state, domain, bfs_tree, pattern_database, max_depth, color_neutral=True):\n # returns result = (recolor index, actions, rule index, macro, triggering state, new_state)\n # or result = False if there is no path to a macro or solved state\n\n patterns = pattern_databa... | [
[
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.subplot"
]
] |
thigm85/optuna | [
"4680f36a470ffb9ead89abf65dcc7e7533fd789f"
] | [
"tests/multi_objective_tests/hypervolume_tests/test_wfg.py"
] | [
"import numpy as np\nimport pytest\n\nimport optuna\n\n\ndef test_wfg_2d() -> None:\n for n in range(2, 30):\n r = n * np.ones(2)\n s = np.asarray([[n - 1 - i, i] for i in range(n)])\n for i in range(n + 1):\n s = np.vstack((s, np.asarray([i, n - i])))\n np.random.shuffle(s... | [
[
"numpy.asarray",
"numpy.zeros",
"numpy.ones",
"numpy.random.shuffle",
"numpy.random.randint"
]
] |
LBJ-Wade/SPT_SZ_cluster_likelihood | [
"1d6eece3c46b084569d00cd4a29db75c9d0847a6"
] | [
"Mconversion_concentration.py"
] | [
"from __future__ import division\nimport numpy as np\nimport scipy.optimize as op\nfrom scipy.interpolate import InterpolatedUnivariateSpline\nfrom scipy.interpolate import RectBivariateSpline\nfrom scipy import integrate\nimport cosmo\n\nclass ConcentrationConversion:\n\n def __init__(self, MCrelation, cosmolog... | [
[
"numpy.sin",
"numpy.log",
"scipy.optimize.brentq",
"scipy.interpolate.RectBivariateSpline",
"numpy.exp",
"numpy.where",
"numpy.atleast_1d",
"numpy.trapz",
"numpy.cos",
"numpy.append",
"numpy.linspace",
"numpy.logspace",
"scipy.integrate.quad"
]
] |
yxd886/tensorflow | [
"a26413ef0a179dd93b5228b031de83dce97a8684"
] | [
"tensorflow/python/keras/backend.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.array_ops.identity",
"tensorflow.python.ops.math_ops.less",
"tensorflow.python.ops.state_ops.assign_add",
"tensorflow.python.ops.nn.atrous_conv2d_transpose",
"tensorflow.python.ops.math_ops.matmul",
"tensorflow.python.distribute.distribute_coordinator.run_distribute_... |
Jaidon-Smith/ddsp | [
"6df89d20d0398c76612c5f45b71483f49df945f8"
] | [
"ddsp/losses_test.py"
] | [
"# Copyright 2021 The DDSP Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or a... | [
[
"tensorflow.ones",
"numpy.isfinite",
"tensorflow.test.main"
]
] |
Oslandia/urbansprawl | [
"afbc1da6ce640569571d26900a2cc97a063fb0a9"
] | [
"urbansprawl/osm/utils.py"
] | [
"###############\n# Repository: https://github.com/lgervasoni/urbansprawl\n# MIT License\n###############\n\nimport osmnx as ox\nimport pandas as pd\nimport geopandas as gpd\nimport numpy as np\n\nfrom .tags import height_tags\n\nfrom ..settings import storage_folder\n\n# Format for load/save the geo-data ['geojson... | [
[
"pandas.notnull"
]
] |
nwaftp23/safe_ppo | [
"fe9ffb18d6cd45dbb020c870ab1131b0e0ac3787"
] | [
"src/check_final.py"
] | [
"import numpy as np\nimport pickle\n\nwith open('sum_rew_final_policy.pkl','rb') as f:\n\tli = pickle.load(f)\n\n\nch = np.array(li)\ncatastrophes = np.sum(ch<-1000)\nopt = np.sum((ch>(max(li)-20))&(ch <= max(li)))\nprint('first 300 rollouts')\nprint(li[1:300])\nprint('min rew', min(li))\nprint('max rew', max(li))\... | [
[
"numpy.sum",
"numpy.array",
"numpy.mean"
]
] |
suhasjains/pysph | [
"4f815a738abad43531d02ac66f5bd0d9a1def52a"
] | [
"pysph/solver/tests/test_solver_utils.py"
] | [
"import numpy as np\nimport shutil\nimport os\nfrom os.path import join\nfrom tempfile import mkdtemp\nfrom pysph import has_h5py\n\ntry:\n # This is for Python-2.6.x\n from unittest2 import TestCase, main, skipUnless\nexcept ImportError:\n from unittest import TestCase, main, skipUnless\n\nfrom pysph.base... | [
[
"numpy.allclose",
"numpy.linspace"
]
] |
sixy6e/gost | [
"43c99952bb3d5a7f668981477b4b3522889ac4db"
] | [
"tests/test_utils.py"
] | [
"import numpy\nimport structlog\n\nfrom gost.utils import evaluate, evaluate_themes, evaluate_nulls, FmaskThemes\nfrom gost.data_model import Measurement\n\n_LOG = structlog.get_logger(\"fmask\")\n\n\ndef test_evaluate_themes_identical(\n ref_fmask_measurement1: Measurement, test_fmask_measurement1: Measurement\... | [
[
"numpy.count_nonzero"
]
] |
Anon1428/magnum | [
"384e148c24293f513df69e6c03f94a2d4a1e3b6a"
] | [
"src/Magnum/DebugTools/Implementation/cool-warm.py"
] | [
"#!/usr/bin/env python3\n\n#\n# This file is part of Magnum.\n#\n# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,\n# 2020, 2021, 2022 Vladimír Vondruš <mosra@centrum.cz>\n# Copyright © 2020 janos <janos.meny@googlemail.com>\n#\n# Permission is hereby granted, free of c... | [
[
"numpy.genfromtxt"
]
] |
arielrz02/AI_Final_project | [
"18685120a89be2efcf6fa6f8e75763980ee140a4"
] | [
"Plot/plot_model_preformance.py"
] | [
"import pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n\n\"\"\"\nCreating two dataframes, for the second and third models,\nand using then to plot model performance.\n\"\"\"\ndef plot_model_pref(folder=\"plots\", name=\"Model preformance\", bf=False):\n # the dataframes\n df = pd.Data... | [
[
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots"
]
] |
kroML/kroml | [
"cfa5e505aaac01c31c1a4811e27ce70c41e0b1ae"
] | [
"kroml/utils/training/cramers.py"
] | [
"import pandas as pd\nimport numpy as np\nimport scipy.stats as ss\n\n\ndef cramers_v(confusion_matrix: pd.DataFrame) -> int:\n \"\"\"\n Calculate Cramers V statistic for categorial-categorial association.\n uses correction from Bergsma and Wicher,\n Journal of the Korean Statistical Society 42 (2013): ... | [
[
"scipy.stats.chi2_contingency",
"pandas.crosstab"
]
] |
victor-gp/tfg-H16b | [
"cfc55796e42337c26753aee7034e305a1ee386fe"
] | [
"app/models/scan_maps/sign_change.py"
] | [
"import matplotlib.pyplot as plt\n\nclass SignChangeSparseMap:\n\n def __init__(self):\n self.x_plus = []\n self.x_minus = []\n self.y_plus = []\n self.y_minus = []\n\n\n def add_right_change(self, x, y):\n self.x_plus.append([x, y])\n\n def add_left_change(self, x, y):\n... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
DaHaiHuha/DORN_pytorch | [
"ea4cf1814d38a2d08849149750f13fe07b6e47ce"
] | [
"network/backbone.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n @Time : 2019/3/3 19:55\n @Author : Wang Xin\n @Email : wangxin_buaa@163.com\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn import BatchNorm2d\nimport torchvision.models.resnet\n\naffine_par = True\n\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"\"\"3... | [
[
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.no_grad",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.load",
"torch.randn"
]
] |
CMargreitter/ChemCharts | [
"ec47b8f572f6b77518051aafc578557a5a10c2d0"
] | [
"tests/test_plots/test_trisurf_static_plot.py"
] | [
"import unittest\nimport os\nimport numpy as np\nimport shutil\n\nfrom chemcharts.core.container.chemdata import ChemData\nfrom chemcharts.core.container.embedding import Embedding\nfrom chemcharts.core.container.fingerprint import *\nfrom chemcharts.core.container.smiles import Smiles\n\nfrom chemcharts.core.plots... | [
[
"numpy.array"
]
] |
georgeAccnt-GH/daks | [
"ae78d59ab792264288329411d8e5bf9387d7b4e5"
] | [
"fwi.py"
] | [
"import click\nfrom distributed import wait\nfrom util import write_results, to_hdf5\nimport numpy as np\n\nimport time\nfrom devito import Function, TimeFunction\nfrom devito.logger import error\nfrom examples.seismic import Receiver, Model\nfrom examples.seismic.acoustic import AcousticWaveSolver\n\nfrom overthru... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.ones"
]
] |
bckim92/sequential-knowledge-transformer | [
"1e9c47bb61291a0b15e5b1e6901eafebc73db8db"
] | [
"data/vocabulary.py"
] | [
"import os\nimport pickle\nfrom typing import Dict\n\nimport colorlog\nimport tensorflow as tf\nimport numpy as np\n\n__PATH__ = os.path.abspath(os.path.dirname(__file__))\n\n_PARLAI_PAD = '__null__'\n_PARLAI_GO = '__start__'\n_PARLAI_EOS = '__end__'\n_PARLAI_UNK = '__unk__'\n_PARLAI_START_VOCAB = [_PARLAI_PAD, _PA... | [
[
"tensorflow.lookup.KeyValueTensorInitializer",
"tensorflow.cast"
]
] |
Salazar-Prime/Shallow_learn | [
"a6e31383d44f505b897302cd916a157b27582f97"
] | [
"HW3/ie590/rnn_layers.py"
] | [
"from __future__ import print_function, division\nfrom builtins import range\nimport numpy as np\n\n\n\"\"\"\nThis file defines layer types that are commonly used for recurrent neural\nnetworks.\n\"\"\"\n\n\ndef rnn_step_forward(x, prev_h, Wx, Wh, b, use_tanh = True):\n \"\"\"\n Run the forward pass for a sin... | [
[
"numpy.max",
"numpy.zeros_like",
"numpy.ones_like",
"numpy.dot",
"numpy.zeros",
"numpy.sum",
"numpy.exp",
"numpy.tanh",
"numpy.arange",
"numpy.add.at",
"numpy.hstack"
]
] |
jperez999/models-1 | [
"44c71fd5168cae60c56ad300c6e21522a86c1908"
] | [
"merlin/models/tf/core.py"
] | [
"#\n# Copyright (c) 2021, NVIDIA CORPORATION.\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.control_dependencies",
"tensorflow.zeros",
"tensorflow.GradientTape",
"tensorflow.expand_dims",
"tensorflow.assert_rank",
"tensorflow.python.keras.utils.generic_utils.to_snake_case",
"tensorflow.TensorShape",
"tensorflow.Variable",
"tensorflow.keras.layers.Dense",
... |
jan3zk/audio_validation | [
"dc3283f1bfc1e487baee494b6a949ae4a55c591f"
] | [
"utils.py"
] | [
"# -*- coding: utf-8 -*-\nfrom glob import glob\nimport os, sys\nimport argparse\nimport soundfile as sf\nimport librosa\nimport numpy as np\nfrom pydub import AudioSegment,silence\nimport matplotlib.pyplot as plt\nimport scipy.signal as sps\nfrom io import BytesIO\nimport contextlib\nimport wave\nimport webrtcvad\... | [
[
"numpy.array",
"matplotlib.pyplot.axvspan",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
gradientsky/autogluon-benchmark | [
"32da64c8a73f9b22fdd9a167c21f205a3881c7c6"
] | [
"examples/train_us_crime.py"
] | [
"\nimport numpy as np\n\nfrom autogluon_benchmark.tasks import task_loader, task_utils\n\n\nif __name__ == \"__main__\":\n task_dict = task_loader.get_task_dict()\n task_name = 'us_crime' # task name in yaml config\n # task_id = task_dict[task_name]['openml_task_id'] # openml task id\n task_id = 35994... | [
[
"numpy.std",
"numpy.mean"
]
] |
LeoSBastos/SiteCalculoNumerico | [
"20d5c3b45432583f26ec71fa5df9e210ed1802d7"
] | [
"Trab2/Ex2/B.py"
] | [
"from GaussSeidel import *\r\nimport numpy as np\r\n\r\nA=np.array([[1.0,0.0,-1.0],[-0.5,1.0,-0.25],[1.0,-0.5,1.0]])\r\nb=[0.2,-1.425,2.0]\r\n\r\nvalB = gaussseidel(A,b,1e-2,300)\r\nvalfinalB = calcularVetor()\r\nprint(valB)"
] | [
[
"numpy.array"
]
] |
tomkennedy22/gm-games | [
"249545e4dc08c6090ba832a7014e37c2f5d22204"
] | [
"analysis/team-ovr-basketball/process.py"
] | [
"import json\nimport matplotlib.pyplot as plt \nimport pandas as pd\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.metrics import r2_score\n\ndef get_cols():\n cols = {\n \"ovr0\": [],\n \"ovr1\": [],\n \"ovr2\": [],\n \"ovr3\": [],\n \"ovr4\": [],\n \... | [
[
"sklearn.linear_model.LinearRegression",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"sklearn.metrics.r2_score",
"matplotlib.pyplot.show"
]
] |
rizar/Theano | [
"b8efebd94572f1cf172790ce70583f506289bcac"
] | [
"theano/tensor/subtensor.py"
] | [
"from copy import copy\nfrom itertools import izip\nimport sys\nfrom textwrap import dedent\nimport warnings\nimport logging\n_logger = logging.getLogger(\"theano.tensor.subtensor\")\n\nimport numpy\n\nimport theano\nfrom theano.gradient import DisconnectedType\nfrom theano import gof\nfrom theano.gof import Apply,... | [
[
"numpy.uint32",
"numpy.empty",
"numpy.zeros",
"numpy.any",
"numpy.can_cast",
"numpy.all",
"numpy.int64",
"numpy.unique"
]
] |
jason-r-becker/dfspy | [
"a3dd2d49dd6d1a3349eefc7f2515a562c798867f"
] | [
"dfspy/_build_standardized_player_names.py"
] | [
"\"\"\"\nCreate standardized player name .json file from NFL.com scrapes.\n\"\"\"\n\nimport json\nfrom glob import glob\nfrom itertools import chain\n\nimport pandas as pd\n\n\ndef main():\n positions = 'QB RB WR TE K DST'.split()\n \n names = {}\n for pos in positions:\n # Find all NFL.com files... | [
[
"pandas.read_csv"
]
] |
HelloWorldCN/EPIRNX | [
"b225dd67c4494076a7b0c58cfcd04fb0fb47b729"
] | [
"model_onehot_ResNeXt.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras.backend import concatenate\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.layers import Lambda, BatchNormalization, Conv1D, Activation, add, MaxPooling1D, Input, \\\n Flatten, Dense, Dropout\nfrom tensorflow.keras.optimizers import Adam\nfrom ten... | [
[
"tensorflow.keras.layers.add",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.MaxPooling1D",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.backend.concatenate... |
malllabiisc/CaRE | [
"8d6f0b93301a55f1db517acce2708102d73fb3e7"
] | [
"CaRe(B=ConvE)/utils.py"
] | [
"import numpy as np\nimport random\nimport copy\nimport time\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.cuda as cuda\nimport torch.optim as optim\nimport torch.nn.functional as F\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\ndef seq_batch(phrase_id, args, ... | [
[
"numpy.array",
"torch.arange",
"numpy.zeros",
"torch.autograd.Variable",
"torch.from_numpy",
"torch.tensor",
"torch.LongTensor",
"numpy.argsort"
]
] |
prio-data/stepshift | [
"b7cf7ec01b7250c57c1f283b665970d4b65d95c0"
] | [
"tests/test_views_utilities.py"
] | [
"\nimport unittest\nimport hashlib\nimport random\nimport pandas as pd\nimport numpy as np\nfrom sklearn.dummy import DummyClassifier\nfrom stepshift import views\n\nclass TestViewsUtilities(unittest.TestCase):\n def test_col_name_inference(self):\n \"\"\"\n Checks that step numbers can be casted b... | [
[
"numpy.concatenate",
"numpy.array",
"sklearn.dummy.DummyClassifier",
"numpy.zeros"
]
] |
modin-project/modin | [
"f1f3aabd0ecd75086dfe7fb70be6a040958e0045"
] | [
"modin/conftest.py"
] | [
"# Licensed to Modin Development Team under one or more contributor license agreements.\n# See the NOTICE file distributed with this work for additional information regarding\n# copyright ownership. The Modin Development Team licenses this file to you under the\n# Apache License, Version 2.0 (the \"License\"); you... | [
[
"pandas.DataFrame",
"pandas.util._decorators.doc",
"numpy.arange"
]
] |
ogrisel/scipy | [
"e356524e69eebb2135d64724073f71138c15dc9e"
] | [
"scipy/linalg/setup.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import division, print_function, absolute_import\n\nimport os\nfrom os.path import join\n\n\ndef configuration(parent_package='',top_path=None):\n from numpy.distutils.system_info import get_info, NotFoundError\n from numpy.distutils.misc_util import Configuration\n ... | [
[
"numpy.distutils.system_info.get_info",
"numpy.distutils.system_info.NotFoundError",
"numpy.distutils.misc_util.Configuration",
"scipy._build_utils.get_g77_abi_wrappers"
]
] |
westernesque/a-history-of-birds | [
"7a2ad35ef3d337fa273a04551d5cfacd14e0b174"
] | [
"data/render_engine/master_renderer.py"
] | [
"from OpenGL.GL import *\r\nimport data.shaders.static_shader as ss\r\nimport data.shaders.terrain_shader as ts\r\nimport data.render_engine.entity_renderer as er\r\nimport data.render_engine.terrain_renderer as tr\r\nimport data.skybox.skybox_renderer as sr\r\nimport numpy\r\n\r\nclass MasterRenderer:\r\n\tFIELD_O... | [
[
"numpy.radians",
"numpy.zeros"
]
] |
maihde/home-assistant | [
"688d70644949a658e0607e52b3896a2c4c8a85e7"
] | [
"homeassistant/components/binary_sensor/trend.py"
] | [
"\"\"\"\nA sensor that monitors trends in other components.\n\nFor more details about this platform, please refer to the documentation at\nhttps://home-assistant.io/components/sensor.trend/\n\"\"\"\nimport asyncio\nfrom collections import deque\nimport logging\nimport math\n\nimport voluptuous as vol\n\nfrom homeas... | [
[
"numpy.array",
"numpy.polyfit"
]
] |
insilicomedicine/BiAAE | [
"71a2df2c0d7ed5d775a560e66da029ce63b46007"
] | [
"training_scripts/lincs_experiment_reverse.py"
] | [
"import sys\nsys.path.append('..')\n\nimport argparse\n\nimport torch\n\nfrom networks import JointEncoder, RNNEncoder, FinetunedEncoder, ExprDiffEncoder\nfrom networks import FCDiscriminator\n\nfrom dataloader import LincsDataSet, LincsSampler\n\nfrom torch.utils.data import DataLoader, TensorDataset\n\nimport pyt... | [
[
"torch.cat",
"torch.stack",
"torch.nn.ModuleList",
"torch.norm",
"numpy.random.permutation",
"torch.optim.Adam",
"torch.manual_seed",
"torch.utils.data.DataLoader"
]
] |
mowolf/awesome-semantic-segmentation-pytorch | [
"5410200573df3d0529377680877e0d1c0e27175f"
] | [
"core/models/psanet_old.py"
] | [
"\"\"\"Point-wise Spatial Attention Network\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom core.nn import CollectAttention, DistributeAttention\nfrom .segbase import SegBaseModel\nfrom .fcn import _FCNHead\n\n__all__ = ['PSANet', 'get_psanet', 'get_psanet_resnet50_voc', 'get_psa... | [
[
"torch.device",
"torch.cat",
"torch.nn.functional.interpolate",
"torch.mm",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.randn"
]
] |
mshobair/invitro_cheminformatics | [
"17201496c73453accd440646a1ee81726119a59c"
] | [
"Enrichment_Table_Generator/Enrichment_Table_Generator.py"
] | [
"import os, sys\nnewsyspath = os.path.realpath(__file__).split('\\\\')[:-2]\nif len(newsyspath) == 0:\n newsyspath = os.path.realpath(__file__).split('/')[:-2]\n sys.path.append('/'.join(newsyspath))\nelse:\n sys.path.append('\\\\'.join(newsyspath))\n\nimport click\nimport sys\nimport pandas as pd\nimport ... | [
[
"pandas.read_csv",
"pandas.read_excel"
]
] |
xchaoinfo/pyhanlp | [
"724c60d5281ba3911ca065d9e144bb1b09e8257f"
] | [
"tests/book/ch05/plot_name.py"
] | [
"# -*- coding:utf-8 -*-\n# Author:hankcs\n# Date: 2018-06-20 10:02\n# 《自然语言处理入门》5.2 线性分类模型与感知机算法\n# 配套书籍:http://nlp.hankcs.com/book.php\n# 讨论答疑:https://bbs.hankcs.com/\n\nimport matplotlib.pyplot as plt\nimport matplotlib.lines as mlines\n\nplt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签\nplt.rcParams['a... | [
[
"matplotlib.lines.Line2D",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca",
... |
mrrakesh1318/ga-learner-dsb-repo | [
"a5bf13c6ba8739de8fc918d61825388bbc12f2fc"
] | [
"inferential_statistic_learning/code.py"
] | [
"# --------------\nimport pandas as pd\r\nimport scipy.stats as stats\r\nimport math\r\nimport numpy as np\r\nimport warnings\r\n\r\nwarnings.filterwarnings('ignore')\r\n#Sample_Size\r\nsample_size=2000\r\n\r\n#Z_Critical Score\r\nz_critical = stats.norm.ppf(q = 0.95) \r\n\r\n\r\n# path [File location varia... | [
[
"numpy.array",
"scipy.stats.norm.ppf",
"matplotlib.pyplot.subplots",
"scipy.stats.chi2_contingency",
"pandas.Series",
"pandas.read_csv",
"scipy.stats.chi2.ppf"
]
] |
polyaxon/polyaxon-lib | [
"d357b7fee03b2f47cfad8bd7e028d3e265a10575"
] | [
"examples/reinforcement_learning_examples/dqn_cartpole.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function\n\nimport polyaxon_lib as plx\nimport tensorflow as tf\n\nfrom polyaxon_schemas.losses import HuberLossConfig\nfrom polyaxon_schemas.optimizers import SGDConfig\nfrom polyaxon_schemas.rl.explorations import DecayExplorationCo... | [
[
"tensorflow.app.run",
"tensorflow.logging.set_verbosity"
]
] |
tianrenheyi09/tf-rnn-attention-master1 | [
"019ae28a3d6bde5b0d1893530e52739d18c10c95"
] | [
"train_one.py"
] | [
"#!/usr/bin/python\n\"\"\"\nToy example of attention layer use\n\nTrain RNN (GRU) on IMDB dataset (binary classification)\nLearning and hyper-parameters were not tuned; script serves as an example\n\"\"\"\nfrom __future__ import print_function, division\n\nimport numpy as np\nimport tensorflow as tf\nfrom keras.dat... | [
[
"tensorflow.summary.FileWriter",
"tensorflow.nn.embedding_lookup",
"tensorflow.global_variables_initializer",
"tensorflow.cast",
"tensorflow.concat",
"tensorflow.sigmoid",
"tensorflow.summary.histogram",
"tensorflow.random_uniform",
"tensorflow.train.Saver",
"tensorflow.con... |
ParthBhatt05/UNO-RL | [
"7a1d4435959207d3e95aa8406a132e056e430b0e"
] | [
"play.py"
] | [
"import sys\nimport time\nimport pygame\nimport numpy as np\nfrom keras.models import load_model\nfrom environment import UnoEnvironment\nfrom renderer import *\n\nPOSSIBLE_PLAYER_TYPES = ['DQN', 'Manual', 'Random']\n\nplayer_types = []\nplayer_names = []\nfor player in sys.argv[1:]:\n found = False\n for i, ... | [
[
"numpy.concatenate",
"numpy.sum"
]
] |
NeuroLaunch/mne-python | [
"6c9fca05e49f23da2794f4a5f112e90f6552e882"
] | [
"mne/viz/topomap.py"
] | [
"\"\"\"Functions to plot M/EEG data e.g. topographies.\"\"\"\n\n# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Denis Engemann <denis.engemann@gmail.com>\n# Martin Luessi <mluessi@nmr.mgh.harvard.edu>\n# Eric Larson <larson.eric.d@gmail.com>\n# Robert Luke <mail@ro... | [
[
"matplotlib.widgets.Slider",
"numpy.dot",
"scipy.interpolate.CloughTocher2DInterpolator",
"numpy.median",
"numpy.min",
"numpy.mean",
"numpy.sign",
"numpy.where",
"numpy.finfo",
"matplotlib.patches.Ellipse",
"numpy.cos",
"numpy.deg2rad",
"numpy.max",
"numpy.c... |
sourcery-ai-bot/neural-style | [
"b5d9338dec8b58a7ea56f4d5fff0022485d6f89f"
] | [
"neural_style/slow_neural_style/slow_neural_style.py"
] | [
"import sys\nimport argparse\n\nimport theano\nimport theano.tensor as T\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom neural_style.utils import *\n\narg_parser = argparse.ArgumentParser()\narg_parser.add_argument(\"--content-image\", type=str, required=True)\narg_parser.add_argument(\"--content-size\", type=i... | [
[
"numpy.random.normal",
"numpy.array"
]
] |
yyfrankyy/PyTorch-BigGraph | [
"9f86bc35b07e4619bd4f9e44d399774fbdc0997c"
] | [
"tests/model_tests.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its 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\n# In order to keep values visually aligned in matrix form we use double spac... | [
[
"torch.zeros",
"torch.arange",
"torch.no_grad",
"torch.manual_seed",
"torch.full",
"torch.tensor",
"torch.allclose",
"torch.empty"
]
] |
SunDevilThor/Wanderlist_Wine | [
"99525651ad19c2e1621969739e161a486be5c0ee"
] | [
"Wanderlust-Wine.py"
] | [
"# Wanderlust Wine - UK\n# Tutorial from John Watson Rooney YouTube channel\n\nimport requests\nfrom bs4 import BeautifulSoup\nfrom requests.api import head\nimport pandas as pd\nimport re\n\nwine_list = []\n\n# Step 1 - Request\ndef request(x):\n url = f'http://www.wanderlustwine.co.uk/buy-wine-online/page/{x}/... | [
[
"pandas.DataFrame"
]
] |
sbailey/surveyqa | [
"6160828626a9b27eed1f5a2a6de275049251046d"
] | [
"py/surveyqa/core.py"
] | [
"\"\"\"\nCore functions for DESI survey quality assurance (QA)\n\"\"\"\n\nimport sys, os, shutil\nimport numpy as np\nimport re\nfrom os import walk\nimport bokeh\nimport urllib.request\n\nimport surveyqa.summary\nimport surveyqa.nightly\nfrom pathlib import PurePath\nimport json\n\nimport multiprocessing as mp\n\n... | [
[
"numpy.unique"
]
] |
whatevery1says/we1s-templates | [
"ce16ae4a39e3286ed7d9bf4a95bff001ac2d123e"
] | [
"src/templates/v0.1.9/modules/counting/scripts/count_docs.py"
] | [
"\"\"\"count_docs.py.\n\nCount the number of documents per unique source per year in a given project.\n\nFor use with count_documents.ipynb v 2.0.\n\nLast update: 2020-06-25\n\"\"\"\n\nimport csv\nimport os\nimport string\nimport unidecode\nimport json\nimport re\nimport shutil\nimport collections\nimport operator\... | [
[
"pandas.DataFrame.from_dict",
"pandas.DataFrame"
]
] |
dkaliroff/phitnet | [
"1ace33ddf7336ff8953eeb270e2428e7cd76b731"
] | [
"train_test_functions/loss_functions.py"
] | [
"from __future__ import division\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as NN\nfrom train_test_functions.utils import square_center_crop\n\ndef corr_dist_batch(x1, x2):\n return 1 - ((x1 * x2).sum(-1).sum(-1) * torch.rsqrt((x1 ** 2).sum(-1).sum(-1) * (x2 ** 2).sum(-1).sum(-1)))\n\ndef ge... | [
[
"torch.flatten",
"torch.abs",
"torch.zeros_like",
"torch.nn.functional.relu",
"torch.nn.CosineSimilarity",
"torch.pow"
]
] |
stevillis/ParkingSpaceDetection | [
"df29e8d8f44ceb177ddd4f3d7a06bca278401baf"
] | [
"main.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\nCreated on Wed Jan 03 11:19:25 2018\n\n@author: Stévillis and Valdinilson\ntitle: Smart Parking System\n\"\"\"\n\nimport cv2\nimport numpy as np\nimport yaml\nimport time\nimport markpolygons\n\n\ndef draw_masks(parking_data):\n \"\"\"\n Draw masks in parking_data points.\n... | [
[
"numpy.array",
"numpy.zeros",
"numpy.abs"
]
] |
BechirTr/datacamp-assignment-pandas | [
"41680e089a0eca01adf40e37b937118510f00d9a"
] | [
"pandas_questions.py"
] | [
"\"\"\"Plotting referendum results in pandas.\n\nIn short, we want to make beautiful map to report results of a referendum. In\nsome way, we would like to depict results with something similar to the maps\nthat you can find here:\nhttps://github.com/x-datascience-datacamp/datacamp-assignment-pandas/blob/main/exampl... | [
[
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
tensorturtle/iou-tracker | [
"6ad51ab143d4c5f27c97b1872eb88b133d10251b"
] | [
"viou_tracker.py"
] | [
"# ---------------------------------------------------------\n# IOU Tracker\n# Copyright (c) 2019 TU Berlin, Communication Systems Group\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Erik Bochinski\n# ---------------------------------------------------------\n\nimport cv2\nimport numpy a... | [
[
"numpy.nan_to_num"
]
] |
YosefQiu/VIS_Final | [
"6568eb8800101e7dffbc704235d608053312c504"
] | [
"part_seg/train.py"
] | [
"import argparse\nimport subprocess\nimport tensorflow.compat.v1 as tf\n\ntf.disable_v2_behavior() \nimport numpy as np\nfrom datetime import datetime\nimport json\nimport os\nimport sys\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(BASE_DIR)\nsys.path.append(os.path.dirname(BASE_DIR))\nim... | [
[
"tensorflow.compat.v1.Graph",
"tensorflow.compat.v1.disable_v2_behavior",
"numpy.mean",
"tensorflow.compat.v1.trainable_variables",
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.compat.v1.summary.FileWriter",
"tensorflow.compat... |
pyviz/holoviews | [
"22db2d1dd3b5d0b42a08f00645e04f693ad63dbb"
] | [
"holoviews/tests/plotting/bokeh/test_links.py"
] | [
"import numpy as np\n\nfrom holoviews.core.spaces import DynamicMap\nfrom holoviews.element import Curve, Polygons, Table, Scatter, Path, Points\nfrom holoviews.plotting.links import (Link, RangeToolLink, DataLink)\n\nfrom bokeh.models import ColumnDataSource\n\nfrom .test_plot import TestBokehPlot, bokeh_renderer\... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.random.rand"
]
] |
darrenjs/qsec | [
"46348712891a5c3a1b58060078caf580d70fd32b"
] | [
"tools/binance-fetch-bars.py"
] | [
"import datetime as dt\nimport requests\nimport json\nimport time\nimport pandas as pd\nimport logging\nimport pyarrow as pa\nimport pyarrow.parquet as pq\nimport os, sys\nimport numpy as np\nimport argparse\n\n\nimport qsec.logging\nimport qsec.time\nimport qsec.app\nimport common\n\n\napi = \"https://api.binance.... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.concat"
]
] |
tatref/nemesys | [
"5043986dd6084ba2d9b7719aa1911462eed3f1b2"
] | [
"src/validation/reportWriter.py"
] | [
"\"\"\"\nWrite Format Match Score report for a list of analysed messages.\n\"\"\"\n\nimport os\nimport time\nimport csv\nimport numpy\nfrom typing import Dict, Tuple, Iterable\nfrom os.path import abspath, isdir, splitext, basename, join\nfrom itertools import chain\n\nfrom netzob.Model.Vocabulary.Messages.Abstract... | [
[
"numpy.max",
"numpy.min",
"numpy.mean"
]
] |
randlet/qatrackplus-ci | [
"ba11d39a07382b11394aaffd0df692b4ddc6239b"
] | [
"qatrack/qa/views/charts.py"
] | [
"import collections\nimport io\nimport itertools\nimport json\nimport textwrap\n\nfrom braces.views import JSONResponseMixin, PermissionRequiredMixin\nfrom django.conf import settings\nfrom django.contrib.contenttypes.models import ContentType\nfrom django.db.models import Count\nfrom django.db.utils import Program... | [
[
"matplotlib.figure.Figure",
"numpy.array",
"matplotlib.backends.backend_agg.FigureCanvasAgg",
"numpy.seterr"
]
] |
julianolm/lbcnn.pytorch | [
"f35fedb4ba911e5e56281f6fbff27df9b12b3653"
] | [
"lbcnn/models.py"
] | [
"import numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass RandomBinaryConv(nn.Module):\n \"\"\"Random Binary Convolution.\n \n See Local Binary Convolutional Neural Networks.\n \"\"\"\n def __init__(self, in_channels,\n out_channels,\n ... | [
[
"torch.zeros",
"torch.nn.Unfold",
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d",
"torch.ones_like",
"torch.zeros_like",
"torch.nn.functional.conv2d",
"torch.sum"
]
] |
TrueNobility303/slbi | [
"39913a3226945b5f64fd1f53cc5ac9ccd1c5ef58"
] | [
"optim/slbi_sgd.py"
] | [
"#from https://github.com/DessiLBI2020/DessiLBI/blob/master/DessiLBI/code/slbi_opt.py\n\nimport torch\nfrom torch.optim.optimizer import Optimizer, required\nimport copy\nimport torch.nn.functional as F\nfrom typing import List, Optional\nfrom torch import Tensor\nimport math\nimport numpy as np\n\n#定义SLBI优化器\n\nDE... | [
[
"torch.min",
"torch.gt",
"torch.max",
"torch.norm",
"numpy.percentile",
"torch.transpose",
"torch.clamp",
"torch.abs",
"torch.sum",
"torch.ones_like",
"torch.zeros_like",
"torch.diag",
"torch.qr",
"torch.ge",
"torch.sort",
"torch.reshape"
]
] |
Aceticia/tianshou | [
"6377dc5006ba1111adac42472447b9de4a021c2d"
] | [
"tianshou/policy/modelfree/a2c.py"
] | [
"from typing import Any, Dict, List, Optional, Type\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\n\nfrom tianshou.data import Batch, ReplayBuffer, to_torch_as\nfrom tianshou.policy import PGPolicy\n\n\nclass A2CPolicy(PGPolicy):\n \"\"\"Implementation of Synchronous ... | [
[
"torch.nn.functional.mse_loss",
"torch.no_grad",
"torch.cat",
"numpy.sqrt"
]
] |
eisber/ray | [
"94a286ef1d8ad5a3093b7f996a811727fa0e2d3e"
] | [
"python/ray/experimental/sgd/pytorch/examples/dcgan.py"
] | [
"#!/usr/bin/env python\n\nimport argparse\nimport os\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data\nimport torchvision.datasets as dset\nimport torchvision.transforms as transforms\nimport numpy as np\n\nfrom torch.autograd import Variable\nfrom torch.nn import functiona... | [
[
"torch.nn.Linear",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"scipy.stats.entropy",
"numpy.mean",
"torch.cuda.is_available",
"torch.load",
"torch.nn.init.constant_",
"torch.autograd.Variable",
"torch.nn.ConvTranspose2d",
"torch.nn.init.normal_",
"torch.utils.dat... |
StrikerCC/Teaser-plusplus-testing | [
"434392f379b17e29e1485cc2c9e42fd26ff7837d"
] | [
"tester.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\n@author: Cheng Chen\n@email: chengc0611@gmail.com\n@time: 8/19/21 5:22 PM\n\"\"\"\nimport glob\nimport json\nimport os\nimport numpy as np\n\nfrom dataset import Reader\nfrom registration import registrations, VOXEL_SIZE_GLOBAL, VOXEL_SIZE_LOCAL\nfrom vis import draw_registration... | [
[
"numpy.asarray"
]
] |
nekobean/pytorch-examples | [
"7fabe40abc543644594ec815028fa929aed20d79"
] | [
"pytorch-explainable-cnn/vanilla_backprop.py"
] | [
"import argparse\nfrom collections import defaultdict\nfrom pathlib import Path\n\nimport torch.nn.functional as F\nimport torch.utils.data as data\nimport torchvision.transforms as transforms\nfrom PIL import Image\n\nimport utils\n\n\nclass VanillaBackprop:\n def __init__(self, model):\n self.model = mo... | [
[
"torch.utils.data.DataLoader",
"torch.nn.functional.softmax"
]
] |
epicfaace/pyshgp | [
"ab6fc85e6a474f1603c43ad3d298bcf5cf4a53c6",
"ab6fc85e6a474f1603c43ad3d298bcf5cf4a53c6"
] | [
"tests/gp/test_estimator_validation.py",
"tests/gp/test_individual.py"
] | [
"import numpy as np\nimport random\nfrom math import pow, sqrt\nfrom functools import partial\n\nfrom pyshgp.gp.estimators import PushEstimator\nfrom pyshgp.gp.genome import GeneSpawner\nfrom pyshgp.push.interpreter import PushInterpreter\nfrom pyshgp.push.instruction_set import InstructionSet\nfrom pyshgp.push.ato... | [
[
"numpy.arange"
],
[
"numpy.array",
"numpy.arange"
]
] |
HakureiReimyyy/HSLC-3DSG | [
"855b828f5d83f8c3b6dedbc5c9f478ce5376483b",
"855b828f5d83f8c3b6dedbc5c9f478ce5376483b"
] | [
"model/modeling/detector/models/loss_helper_boxnet.py",
"my_utils/balanced_positive_negative_sampler.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 torch\nimport torch.nn as nn\nimport numpy as np\nimport sys\nimport os\nBASE_DIR = os.path.dirname(os.path.abspath(__file__... | [
[
"torch.gather",
"torch.ones",
"torch.Tensor",
"torch.argmax",
"torch.sum"
],
[
"torch.zeros_like",
"torch.nonzero"
]
] |
WolfDanny/Homeostatic_Competition_Scripts | [
"1b98ac4d3d86b6c63f7f5194eae73ce0e6bf86ac"
] | [
"Results/Division distribution/DD-plots.py"
] | [
"# %% Packages\n\nimport os\nimport sys\n\nsys.path.append(\n os.path.join(os.path.join(os.path.dirname(__file__), os.pardir), os.pardir)\n)\n\nimport pickle\nfrom distutils.spawn import find_executable\n\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nfrom homeostatic.definitions import level_positio... | [
[
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots"
]
] |
tdgriffith/modal_wave_decomp | [
"1e6a8a78c7032020565e9897e73d2433445c90f2"
] | [
"src/data/utils.py"
] | [
"import os\nimport sys\nfrom tempfile import gettempdir\nfrom subprocess import call\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn import svm\nfrom scipy.signal import butter, lfilter, lfilter_zi\n\n\nNOTCH_B, NOTCH_A = butter(4, np.array([55, 65]) / (256 / 2), btype='bandstop')\n\n\ndef epoc... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.mean",
"numpy.where",
"numpy.hamming",
"numpy.fft.fft",
"scipy.signal.lfilter",
"numpy.log10",
"scipy.signal.lfilter_zi"
]
] |
CameronBodine/segmentation_gym | [
"49d1e2b09cd409189909e8eb4f0e5aac7dc73ec7"
] | [
"utils/merge_nd_inputs4pred.py"
] | [
"# Written by Dr Daniel Buscombe, Marda Science LLC\n# for the USGS Coastal Change Hazards Program\n#\n# MIT License\n#\n# Copyright (c) 2021-2022, Marda Science LLC\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Softw... | [
[
"numpy.full",
"numpy.array",
"numpy.zeros",
"numpy.savez_compressed",
"numpy.dstack",
"numpy.vstack"
]
] |
0shimax/Kftest | [
"c2d1384206f03c37e8309a058dd083d38896a9cc"
] | [
"src/model/tag_net.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\nimport torch\n\n\nclass TagNet(nn.Module):\n def __init__(self, num_embeddings, embedding_dim=300):\n super().__init__()\n self.embed = nn.Embedding(num_embeddings, embedding_dim)\n\n def forward(self, x):\n return self.embed(x)"
] | [
[
"torch.nn.Embedding"
]
] |
brad-mengchi/benchmark | [
"d39385defcbee54d0945804a36545c20fa50b9c6"
] | [
"torchbenchmark/models/yolov3/yolo_train.py"
] | [
"import argparse\n\nimport torch.distributed as dist\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as lr_scheduler\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom .test import test # import test.py to get mAP after each epoch\nfrom .yolo_models import *\nfrom .yolo_utils.datasets import ... | [
[
"torch.optim.lr_scheduler.LambdaLR",
"torch.optim.Adam",
"torch.optim.SGD"
]
] |
SimonSuster/allennlp | [
"236876017ada9eba060106ca02394c9d6c09605b"
] | [
"allennlp/training/trainer.py"
] | [
"\"\"\"\nA :class:`~allennlp.training.trainer.Trainer` is responsible for training a\n:class:`~allennlp.models.model.Model`.\n\nTypically you might create a configuration file specifying the model and\ntraining parameters and then use :mod:`~allennlp.commands.train`\nrather than instantiating a ``Trainer`` yourself... | [
[
"torch.nn.parallel.replicate",
"torch.isnan",
"torch.no_grad",
"torch.save",
"torch.tensor",
"torch.nn.parallel.parallel_apply"
]
] |
Ping-C/CertifiedObjectDetection | [
"b16b20bef68ba9c1a27918039fd75f82a03a5eb4"
] | [
"utils/datasets.py"
] | [
"import glob\nimport random\nimport os\nimport sys\nimport numpy as np\nfrom PIL import Image\nimport torch\nimport torch.nn.functional as F\n\nfrom utils.augmentations import horisontal_flip\nfrom torch.utils.data import Dataset\nimport torchvision.transforms as transforms\nimport pdb\n\ndef pad_to_square(img, pad... | [
[
"torch.cat",
"torch.nn.functional.interpolate",
"torch.ones",
"numpy.loadtxt",
"numpy.abs",
"torch.nn.functional.pad",
"numpy.random.random"
]
] |
xuzhuang1996/hierarchical_loc | [
"05a1be3d3c6a7f9bf0ff46525f8b4af8878f3e3e"
] | [
"retrievalnet/retrievalnet/models/base_model.py"
] | [
"from abc import ABCMeta, abstractmethod\nimport tensorflow as tf\nimport numpy as np\nfrom tqdm import tqdm\nimport itertools\n\n\nclass Mode:\n TRAIN = 'train'\n EVAL = 'eval'\n PRED = 'pred'\n\n\nclass BaseModel(metaclass=ABCMeta):\n \"\"\"Base model class.\n\n Arguments:\n data: A dictiona... | [
[
"tensorflow.gradients",
"numpy.nanmean",
"tensorflow.stack",
"tensorflow.control_dependencies",
"tensorflow.local_variables_initializer",
"tensorflow.global_variables_initializer",
"tensorflow.identity",
"tensorflow.trainable_variables",
"tensorflow.train.latest_checkpoint",
... |
nuriale207/preprocesspack | [
"cc06a9cb79c5e3b392371fcd8d1ccf7185e71821"
] | [
"venv/lib/python2.7/site-packages/plotnine/stats/stat_ecdf.py"
] | [
"from __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nimport numpy as np\nimport pandas as pd\nfrom statsmodels.distributions.empirical_distribution import ECDF\n\nfrom ..doctools import document\nfrom .stat import stat\n\n\n@document\nclass stat_ecdf(stat... | [
[
"pandas.DataFrame",
"numpy.unique"
]
] |
dineshneela/class-111 | [
"3d9c591cbe0dec7f79025b3ba1e4ce008bdc2a79"
] | [
"z-score.py"
] | [
"import plotly.figure_factory as ff\nimport plotly.graph_objects as go\nimport statistics\nimport random\nimport pandas as pd\nimport csv\n\n#Change the School data here\ndf = pd.read_csv(\"School2.csv\")\ndata = df[\"Math_score\"].tolist()\n\n\n## code to find the mean of 100 data points 1000 times \n#function to... | [
[
"pandas.read_csv"
]
] |
jupito/dwilib | [
"6655eea21037977ed528b992b3a8471393127b77"
] | [
"dwi/minimize.py"
] | [
"\"\"\"Minimization functions.\"\"\"\n\nimport numpy as np\nimport scipy.optimize\n\nEPSILON = np.sqrt(np.finfo(np.float64).eps)\ntry:\n irange = xrange\nexcept NameError:\n irange = range\n\n\ndef gradient(f, x, args=[]):\n \"\"\"Approximate gradient of f at x.\"\"\"\n return scipy.optimize.approx_fpri... | [
[
"numpy.finfo",
"numpy.linalg.norm",
"numpy.dot",
"numpy.asarray"
]
] |
gmacgilchrist/so_decadal_variability | [
"d8422102ce2d41e4218db393510f7507d360a574"
] | [
"scripts/calc_b-factor_EN4.py"
] | [
"# Python script to calculate the b-factor from EN4 hydrographic data\n# gmac 8/10/20\n# gmac 2/12/20: adjusting to also work with iap\n\nimport xarray as xr\nimport numpy as np\nfrom xgcm import Grid\nfrom numba import jit\nimport glob\n\nrootdir = '/local/projects/so_decadal_variability/'\nlocaldir = ''\nprefix =... | [
[
"numpy.sin",
"numpy.empty",
"numpy.zeros",
"numpy.cos",
"numpy.append"
]
] |
shawwn/mesh | [
"9625f34e00a201775249ddb887529da859aa83a8"
] | [
"mesh_tensorflow/tpu_variables.py"
] | [
"# coding=utf-8\n# Copyright 2021 The Mesh TensorFlow Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.control_flow_ops.group",
"tensorflow.python.framework.ops.convert_to_tensor",
"tensorflow.python.framework.ops.register_dense_tensor_like_type",
"tensorflow.python.ops.gen_resource_variable_ops.assign_variable_op",
"tensorflow.python.framework.ops.register_tensor_convers... |
gazzar/tmm_model | [
"b50a8cb2d58e70333015c0ecf5759d887f785047"
] | [
"tests/test_maia.py"
] | [
"#!/usr/bin/python3\n\nfrom __future__ import absolute_import, division, print_function\nimport six\nimport context\n\nimport unittest\nfrom acsemble.maia import Maia, Pad\nimport warnings\nwith warnings.catch_warnings():\n warnings.simplefilter(\"ignore\")\n import acsemble.transformations as tx\nimport nump... | [
[
"numpy.testing.run_module_suite",
"numpy.min",
"numpy.eye",
"numpy.allclose",
"numpy.abs"
]
] |
StepNeverStop/RLs | [
"25cc97c96cbb19fe859c9387b7547cbada2c89f2"
] | [
"rls/algorithms/multi/vdn.py"
] | [
"#!/usr/bin/env python3\n# encoding: utf-8\n\nimport numpy as np\nimport torch as th\nimport torch.nn.functional as F\n\nfrom rls.algorithms.base.marl_off_policy import MultiAgentOffPolicy\nfrom rls.common.data import Data\nfrom rls.common.decorator import iton\nfrom rls.nn.mixers import Mixer_REGISTER\nfrom rls.nn... | [
[
"numpy.random.randint",
"torch.nn.functional.one_hot",
"torch.stack"
]
] |
zhiminzhang0830/FCENet_Paddle | [
"b39a8bf5d2ad76685634e94d997be43af0e15ece"
] | [
"ppocr/postprocess/db_postprocess.py"
] | [
"# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.max",
"numpy.concatenate",
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"numpy.round",
"numpy.min"
]
] |
dcstrandberg/scrape | [
"73c2b1c8691f09dde936aeeb666f91e1e8b20aa7"
] | [
"amazon_scrape.py"
] | [
"#TODO: Add some form of analysis?, \r\n#Edit proxy cycling, so the process originator loop passes the # of proxy to use\r\n#Additionally, need to add a fail state -- raised exception if there's more than x loops of proxy or captcha cycling....\r\n#Research whether we can pull more than 20 proxyList at once\r\n####... | [
[
"pandas.DataFrame"
]
] |
icarus945/Torch_Detection | [
"4cb8ca22a7fa2f45c72b60d794ae2a2ed1a35cd8"
] | [
"models/utils/layers.py"
] | [
"import warnings\n\nimport torch.nn as nn\n\n\ndef conv1x1_group(in_planes, out_planes, stride=1, groups=1):\n \"\"\"\n 1x1 convolution with group, without bias\n - Normal 1x1 convolution when groups == 1\n - Grouped 1x1 convolution when groups > 1\n \"\"\"\n return nn.Conv2d(in_channels=in_planes... | [
[
"torch.nn.Linear",
"torch.nn.Sigmoid",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.ReLU6",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
anonxyz123/fgk62af5 | [
"ec4f9c40c7e1e7afdc07fc58e23f3006435edc76",
"6dd028b0c5e90c3f296eb32dfae033c5612fcae1"
] | [
"exps/NATS-Bench/draw-ranks.py",
"exps/algos/ENAS.py"
] | [
"###############################################################\n# NATS-Bench (https://arxiv.org/pdf/2009.00437.pdf) #\n# The code to draw Figure 2 / 3 / 4 / 5 in our paper. #\n###############################################################\n# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2020.06 ... | [
[
"matplotlib.use",
"scipy.stats.kendalltau",
"torch.save",
"matplotlib.pyplot.subplots",
"torch.load"
],
[
"torch.no_grad",
"torch.cuda.is_available",
"numpy.argmax",
"torch.load",
"torch.nn.DataParallel",
"torch.set_num_threads"
]
] |
kgjamieson/NEXT_data | [
"7cbe8080b441fc91e2e8198ec47c750e6517f83f"
] | [
"contests/summaries/_data-munging/data_munge.py"
] | [
"import os\nimport pandas as pd\n\ndef format_csv(file, dir='summaries-raw'):\n \"\"\"\n Used to convert to uniform CSV interface (pandas w/ unfirom columns)\n \"\"\"\n with open(dir + file) as f:\n lines = [line[:-1] for line in f.readlines()]\n header = lines[0].split(',')\n complete = 's... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
Frayal/Stage | [
"d4f1085ad57cdda2a8e38c70d6c765b6ca35dc8b",
"d4f1085ad57cdda2a8e38c70d6c765b6ca35dc8b"
] | [
"ML/CatBoost.py",
"Time-series/processingdata.py"
] | [
"#################################################\n#created the 04/05/2018 09:52 by Alexis Blanchet#\n#################################################\n#-*- coding: utf-8 -*-\n'''\n\n'''\n\n'''\nAméliorations possibles:\n\n'''\nimport warnings\nwarnings.filterwarnings('ignore')\n##################################... | [
[
"numpy.clip",
"sklearn.preprocessing.StandardScaler",
"pandas.DataFrame",
"numpy.sum",
"pandas.concat",
"pandas.read_csv"
],
[
"pandas.DataFrame",
"numpy.exp",
"numpy.mean",
"numpy.sign",
"sklearn.preprocessing.MinMaxScaler",
"pandas.read_csv"
]
] |
dlalsrl203/detectron2-1 | [
"bcfd861f77683f25e12761a07103145a3dd3b82c"
] | [
"detectron2/modeling/poolers.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\nimport math\nfrom typing import List\nimport torch\nfrom torch import nn\nfrom torchvision.ops import RoIPool\n\nfrom detectron2.layers import ROIAlign, ROIAlignRotated, cat, nonzero_tuple, shapes_to_tensor\nfrom detectron2.structures import Boxes\n\n\"\"\"\nTo e... | [
[
"torch.zeros",
"torch.cat",
"torch.clamp",
"torch.log2"
]
] |
Zeverin/Coded-Shuffling | [
"348a1b7bba92dd269c6f0961a92d1eee6b63eaea"
] | [
"evaluation/binsearch.py"
] | [
"############################################################################\n# Copyright 2017 Albin Severinson #\n# #\n# Licensed under the Apache License, Version 2.0 (the \"License\"); #\n#... | [
[
"scipy.special.comb",
"pandas.DataFrame",
"numpy.zeros"
]
] |
imironhead/ml_dcgan_mnist | [
"0e88aeb668a6b915daf4c02a4b9c6f38cd0115f5"
] | [
"input_data.py"
] | [
"# Copyright 2015 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"numpy.zeros",
"tensorflow.as_dtype",
"numpy.random.shuffle",
"numpy.multiply",
"numpy.arange",
"numpy.frombuffer",
"numpy.dtype"
]
] |
sfcurre/SQuAD-GAN | [
"8fff7b13e6d9e37d35e0878e65310f09313b7582"
] | [
"squad_gan.py"
] | [
"import spacy\nimport numpy as np\nimport os, shutil, json, sys\nimport json, argparse\nfrom tqdm import tqdm\nimport tensorflow as tf\nfrom collections import defaultdict\nimport logging\n\nfrom GAN import *\nfrom MultiHeadAttention import *\nfrom DataLoader import *\n\n\nos.environ['CUDA_VISIBLE_DEVICES'] = '-1'\... | [
[
"tensorflow.compat.v1.logging.set_verbosity",
"numpy.squeeze",
"numpy.save",
"tensorflow.keras.optimizers.Adam"
]
] |
PAC-Bayesian/GPy | [
"7fe76385dc832de7cf9e4ce37832902c4d35593f",
"7fe76385dc832de7cf9e4ce37832902c4d35593f"
] | [
"GPy/kern/_src/sde_linear.py",
"GPy/util/datasets.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nClasses in this module enhance Linear covariance function with the\nStochastic Differential Equation (SDE) functionality.\n\"\"\"\nfrom .linear import Linear\n\nimport numpy as np\n\nclass sde_Linear(Linear):\n \"\"\"\n \n Class provide extra functionality to transfer this... | [
[
"numpy.array",
"numpy.min",
"numpy.zeros"
],
[
"numpy.dot",
"numpy.ones_like",
"numpy.double",
"numpy.rollaxis",
"numpy.genfromtxt",
"numpy.tile",
"numpy.exp",
"numpy.mean",
"numpy.where",
"pandas.concat",
"pandas.read_csv",
"numpy.concatenate",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.