repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
chebee7i/buhmm | [
"81c421919b4b8bc09030cd0d6a277b0e2fd01cee"
] | [
"buhmm/misc.py"
] | [
"# encoding: utf-8\n\"\"\"\nMiscellaneous functions.\n\n\"\"\"\nfrom __future__ import division\n\nimport numpy as np\n\n__all__ = [\n 'logspace_int'\n]\n\ndef logspace_int(limit, num=50):\n \"\"\"\n Returns integers spaced (approximately) evenly on a log scale.\n\n This means the integers are exponenti... | [
[
"numpy.round",
"numpy.array"
]
] |
FullStackD3vs/Detectron-PYTORCH | [
"b42c78b393098c8b678bb21bd4a48cc41028141b"
] | [
"libs/layers/roi_align_tf/test.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport numpy as np\nimport torch\nfrom torch.autograd import Variable, gradcheck\ntry:\n import tensorflow as tf\nexcept ImportError:\n tf = None\n\nfrom .crop_and_resize i... | [
[
"torch.autograd.Variable",
"tensorflow.image.crop_and_resize",
"tensorflow.Session",
"torch.autograd.gradcheck",
"numpy.random.randn",
"tensorflow.transpose",
"torch.from_numpy",
"tensorflow.gradients",
"numpy.random.uniform",
"numpy.random.randint",
"tensorflow.placeho... |
faturita/mne-python | [
"2c8cac5cf618351503d8f39e23fee80a66892fee",
"2c8cac5cf618351503d8f39e23fee80a66892fee"
] | [
"mne/report.py",
"mne/lib/python2.7/site-packages/libmushu/driver/labstreaminglayer.py"
] | [
"\"\"\"Generate html report from MNE database.\"\"\"\n\n# Authors: Alex Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# Mainak Jas <mainak@neuro.hut.fi>\n# Teon Brooks <teon.brooks@gmail.com>\n#\n# License: BSD (3-clause)\n\nimport os\nimport os.path as op\nimport fnmatch\nimport re\nimport ... | [
[
"numpy.rot90",
"numpy.array",
"numpy.zeros",
"numpy.roll",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"scipy.misc.imread",
"numpy.isscalar",
"numpy.arange",
"numpy.array_split",
"matplotlib.figure.Figure",
"matplotlib.backends.backend_agg.FigureCanvasAgg... |
BrandonBian/OSDR-GNN | [
"0f631d5ddad77df7260c11de3507af014f9447ed"
] | [
"GNN/train.py"
] | [
"import sys\n\nsys.path.append(\"..\")\nimport os\nimport time\nimport json\nimport torch\nimport argparse\nimport numpy as np\nimport torch.nn as nn\nfrom tqdm import tqdm\nfrom GNN.dataset import DataSet\nfrom itertools import product\nfrom gnn import HierarchicalGNN, MLP, Linear, CustomizedGNN\nfrom torch.nn imp... | [
[
"sklearn.metrics.confusion_matrix",
"torch.cat",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"numpy.mean",
"torch.load",
"sklearn.metrics.f1_score",
"torch.nn.CrossEntropyLoss",
"matplotlib.pyplot.xticks",
"numpy.concatenate",
"matplotlib.pyplot.savefig",
"matplotlib.... |
JavisDaDa/COMP540ML | [
"9c50a7d0fcca02050e0269bf4337fe6caa3c65db"
] | [
"HW1/submit/part2/plot_utils.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport sklearn\nfrom sklearn.preprocessing import PolynomialFeatures\n\ndef plot_data(X,y,xlabel,ylabel):\n fig = plt.figure()\n plt.plot(X,y,'bo')\n plt.xlabel(xlabel)\n plt.ylabel(ylabel)\n\n\ndef plot_line(X,y,xlabel,ylabel):\n fig = plt.figure... | [
[
"numpy.dot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"sklearn.preprocessing.PolynomialFeatures",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"numpy.ones",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot... |
NodLabs/SHARK | [
"71f5cfcb30b3e7032c6d1d9f952860ff7769afa0"
] | [
"tank/tf/bert_large_run.py"
] | [
"from iree import runtime as ireert\nfrom iree.tf.support import module_utils\nfrom iree.compiler import tf as tfc\nfrom iree.compiler import compile_str\nfrom absl import app\nimport time\n\nimport numpy as np\nimport os\nimport tensorflow as tf\n\nfrom official.nlp.modeling import layers\nfrom official.nlp.modeli... | [
[
"tensorflow.TensorSpec",
"tensorflow.keras.optimizers.SGD",
"tensorflow.GradientTape",
"tensorflow.function",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"numpy.random.randint"
]
] |
RobertClay/DUST-RC | [
"09f7ec9d8d093021d068dff8a7a48c15ea318b86",
"09f7ec9d8d093021d068dff8a7a48c15ea318b86"
] | [
"Projects/ABM_DA/stationsim/stationsim_validation/stationsim_validation.py",
"Projects/ABM_DA/experiments/ukf_experiments/modules/aggregate_critique.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Feb 10 10:49:24 2020\n\n@author: RC\n\nValidation test for comparing model outputs from python and cpp stationsim.\nWe do this as follows:\n- Generate two random samples of models \n- Calculate corresponding Ripley's K (RK) curves for each mod... | [
[
"numpy.array",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"pandas.DataFrame",
"matplotlib.pyplot.figure",
"numpy.ravel",
"matplotlib.pyplot.ylabel",
... |
higherorderfunctor/snmp-fetch | [
"c95e9f60d38901c500456dc6f07af343b36b4938"
] | [
"snmp_fetch/pandas_extension/__init__.py"
] | [
"\"\"\"Extended DataFrame functionality.\"\"\"\n\nfrom typing import Any, Iterator, Optional, Sequence, Text, Tuple, Union, cast\n\nimport numpy as np\nimport pandas as pd\n\nfrom snmp_fetch.utils import cuint8_to_int\nfrom .types import ip_address as ip\n\n\ndef column_names(\n n: Optional[int] = None, alph... | [
[
"pandas.api.extensions.register_series_accessor",
"pandas.to_timedelta",
"pandas.api.extensions.register_dataframe_accessor",
"pandas.Series"
]
] |
angus-lherrou/scikit-learn | [
"ec48b246785f37f3d976693c03dc5a3702ccedde"
] | [
"maint_tools/test_docstrings.py"
] | [
"import re\nfrom inspect import signature\nimport pkgutil\nimport inspect\nimport importlib\nfrom typing import Optional\n\nimport pytest\nfrom sklearn.utils import all_estimators\nimport sklearn\n\nnumpydoc_validation = pytest.importorskip(\"numpydoc.validate\")\n\nFUNCTION_DOCSTRING_IGNORE_LIST = [\n \"sklearn... | [
[
"sklearn.utils.all_estimators"
]
] |
tempstabilizer2018group/mfli_labber_dynamic_integration | [
"d51bd0ce2de9435e8a243040b6373b54b497b120"
] | [
"Drivers/python_libs/linux/zhinst/examples/deprecated/example_swtrigger_grid_average.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nZurich Instruments LabOne Python API Example\n\nPython API Example for the Software Trigger (ziDAQRecorder) Core Module in Grid\nMode with averaging enabled. This example demonstrates how to obtain averaged\ndemodulator data when a demodulator's R value is larger than a specified\n... | [
[
"numpy.nanmax",
"matplotlib.pyplot.ion",
"numpy.empty",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"numpy.nanmin",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.ioff",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyp... |
haimadrian/AlgorithmsInMultimediaUsingPython | [
"7062e11c557588cebfd576f20b727ec273a1108d"
] | [
"ClassWork/CW5/myHistEqLogic.py"
] | [
"__author__ = \"Haim Adrian\"\r\n\r\nimport collections\r\n\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\nimport cv2\r\n\r\n\r\n# Probability Density Function\r\n# Result is a histogram containing weights (density) e.g. colorCount / sum(colorsCount)\r\ndef myPDF(tensor, p=8):\r\n if not isinst... | [
[
"numpy.uint8",
"numpy.zeros",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.title",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot"
]
] |
gngdb/pytorch-acdc | [
"60044f39b018cfe7190381c08e9adff546c3bc66"
] | [
"obj.py"
] | [
"import torch\nfrom scipy import optimize\nimport torch.nn.functional as F\nimport math\nimport numpy as np\nfrom functools import reduce\nfrom collections import OrderedDict\n\ndef branin(x, a=1., b=5.1/(4.*math.pi**2), c=5./math.pi, r=6., s=10.,\n t=1./(8*math.pi)):\n # branin function, global min of 0.3978... | [
[
"numpy.concatenate",
"torch.cos",
"numpy.array",
"numpy.random.rand",
"torch.from_numpy",
"numpy.abs",
"scipy.optimize.minimize"
]
] |
alexei-v-ivanov/icefall | [
"b702281e9031309cdc862ce61ea057f9ee7e7972"
] | [
"egs/aishell/ASR/conformer_mmi/train.py"
] | [
"#!/usr/bin/env python3\n# Copyright 2021 Xiaomi Corp. (authors: Fangjun Kuang,\n# Wei Kang)\n# Copyright 2021 Pingfeng Luo\n#\n# See ../../../../LICENSE for clarification regarding multiple authors\n#\n# Licensed under the Apache ... | [
[
"torch.device",
"torch.utils.tensorboard.SummaryWriter",
"torch.multiprocessing.spawn",
"torch.set_num_interop_threads",
"torch.nn.parallel.DistributedDataParallel",
"torch.cuda.is_available",
"torch.tensor",
"torch.distributed.barrier",
"torch.set_grad_enabled",
"torch.set... |
InsaneLife/tensorflow-ASP-MTL | [
"7da305f44e3b7bc028e586e3222a7fc24cb73b0b"
] | [
"core/data.py"
] | [
"# coding=utf-8\nimport os\nimport numpy as np\n\n\nclass DataLoader(object):\n\n @staticmethod\n def _load_inner(file_name):\n X = []\n y = []\n with open(file_name, \"r\") as f:\n for line in f:\n try:\n terms = line.strip().split(\"\\t\")\n ... | [
[
"numpy.array"
]
] |
umami-ware/lightly | [
"5d70b34df7f784af249f9e9a6bfd6256756a877f"
] | [
"lightly/models/utils.py"
] | [
"\"\"\" Utils for working with SSL models \"\"\"\n\n# Copyright (c) 2020. Lightly AG and its affiliates.\n# All Rights Reserved\n\nfrom typing import Tuple\n\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\n\n@torch.no_grad()\ndef batch_shuffle(\n batch: torch.Tensor, \n distributed: bo... | [
[
"torch.distributed.get_world_size",
"torch.cat",
"torch.norm",
"torch.no_grad",
"torch.argsort",
"torch.distributed.all_gather",
"torch.randperm",
"torch.empty_like",
"torch.distributed.get_rank",
"torch.distributed.broadcast"
]
] |
PannenetsF/QuantizationPool | [
"504d7cfa70ba08e9ab3c314527526c5ba5003dda"
] | [
"examples/tqt/shiftadder/retrain.py"
] | [
"import argparse\nimport os, time\nimport torch\nimport shutil\nimport numpy as np\nimport torch.nn as nn\nimport torchvision.transforms as transforms\nimport torchvision.datasets as datasets\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.autograd import Variable\nimport torch.backends.cu... | [
[
"torch.cuda.manual_seed",
"torch.autograd.Variable",
"torch.optim.SGD",
"torch.optim.Adam",
"torch.manual_seed",
"torch.nn.functional.cross_entropy",
"torch.cuda.is_available",
"torch.load",
"torch.nn.DataParallel"
]
] |
sbrt/wot | [
"cb8e2ef2800a93314067d8ec77b8a337e71a337f",
"cb8e2ef2800a93314067d8ec77b8a337e71a337f"
] | [
"wot/commands/transition_table.py",
"docs/notebook/03_plotting_cell_sets.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argparse\n\nimport anndata\nimport numpy as np\nimport pandas as pd\n\nimport wot.io\n\n\ndef get_set_id_to_indices(cell_sets, tmap, is_columns):\n cell_set_id_to_indices = {}\n for i in range(len(cell_sets)):\n cell_set_name = cell_sets[i]['nam... | [
[
"pandas.read_table",
"numpy.zeros",
"pandas.DataFrame",
"numpy.sum",
"numpy.isin"
],
[
"matplotlib.pyplot.autoscale",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.axis"
]
] |
matiji66/car_light_dection | [
"75effbe7835473700d6617b3a407edee0a011135"
] | [
"3_2_HelloWorld.py"
] | [
"#%%\n# 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... | [
[
"tensorflow.zeros",
"tensorflow.argmax",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.matmul",
"tensorflow.log",
"tensorflow.placeholder",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.global_variables_initializer",
"tensorflow.cast",
... |
pavithrasv/cloud | [
"5b9af97dadd4e1545580604f9a579e77aa370e22"
] | [
"src/python/tensorflow_cloud/tuner/utils.py"
] | [
"# Lint as: python3\n# Copyright 2020 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | [
[
"numpy.linspace",
"numpy.arange",
"numpy.diff"
]
] |
GaganNarula/permafrostanalytics | [
"f136f19d8d19211d7a085f2d75d640d8f9008312"
] | [
"ideas/gagan/utils.py"
] | [
"import numpy as np\nfrom PIL import Image\nimport torch\nfrom torchvision import models\nimport torchvision.transforms as T\nimport os\n\ndef get_image(path, crop = []):\n img = Image.open(path)\n img = img.rotate(90, expand = 1)\n return img.crop(crop)\n\ndef crop_grid(img, box_size = [900,500], top_offs... | [
[
"numpy.floor"
]
] |
vikaskushwah312/DS | [
"cf8382d9ac5e24acd29ffe5da084e118e9fa4869"
] | [
"numpy/5seedfuntion.py"
] | [
"import numpy as np\n\nnp.random.seed(123)\narr=np.random.randint(1,100,10)\nprint(arr)"
] | [
[
"numpy.random.seed",
"numpy.random.randint"
]
] |
donalee/METAS | [
"1b6ea1a226feff5adf95dfccc4b5fba2fd9c0080"
] | [
"network.py"
] | [
"import tensorflow as tf\nimport pandas as pd\nimport numpy as np\nimport math, heapq, random, time\nfrom utils import getHitRatio, getNDCG\n\n\nclass ActionNetwork(object):\n\t\"\"\"\n\tThis class includes MLP networks to obtain the action space\n\t(i.e., embedding vectors of (1) behavior models and (2) actions)\n... | [
[
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.matmul",
"tensorflow.sqrt",
"tensorflow.nn.embedding_lookup",
"tensorflow.global_variables_initializer",
"tensorflow.concat",
"tensorflow.subtract",
"tensorflow.ConfigProto",
"tensorflow.variable_scope",
"numpy.app... |
AlfaPigeon/CheatClassification | [
"3fcff83b74f6f6946295aa49bcbfd894866f3c5f"
] | [
"python servers/main_9099.py"
] | [
"import sys\nimport os\n\nfrom charset_normalizer import detect\nfrom pandas import value_counts\n\nfrom RegionGazeCounter import RegionGazeCounter\nsys.path.append('Proctoring-AI')\nimport argparse\nimport asyncio\nimport json\nimport logging\nimport os\nimport ssl\nimport uuid\nimport numpy as np\nimport cv2\nfro... | [
[
"numpy.array",
"numpy.argmax",
"numpy.zeros"
]
] |
ain-soph/DI-star | [
"f12d79403488e7df0498d7b116fc23a67506112b"
] | [
"ctools/pysc2/lib/colors.py"
] | [
"# Copyright 2017 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 app... | [
[
"numpy.array",
"numpy.arange",
"numpy.zeros",
"numpy.mod"
]
] |
lobachevzky/on-policy-curiosity | [
"1d1e9c05b04d313d15e698fb8a05c3116085381f"
] | [
"scripts/no_grad.py"
] | [
"import torch\n\nx = torch.ones(1, requires_grad=True)\nnet = torch.nn.Linear(1, 1)\n\n# optim_x = torch.optim.Adam([x], lr=1)\n# optim_net = torch.optim.Adam(net.parameters(), lr=1)\n\ny = net(x)\ngrads = torch.autograd.grad(y, net.parameters(), create_graph=True)\nnorms = [grad.norm(2) for grad in grads]\nnorm = ... | [
[
"torch.nn.Linear",
"torch.sum",
"torch.stack",
"torch.ones"
]
] |
shihchengli/ARC | [
"9c5b03c27dac41f213dfc4b26888c01c8c6f4e83"
] | [
"arc/species/xyz_to_2d.py"
] | [
"#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"\nWritten by Colin Grambow\n\"\"\"\n\nimport numpy as np\n\nfrom openbabel import openbabel as ob\nfrom openbabel import pybel\nfrom rdkit import Chem\nfrom rdkit.Chem import GetPeriodicTable\n\nfrom arc.exceptions import SanitizationError\n\n\n_rdkit_periodic_tab... | [
[
"numpy.array",
"numpy.reshape"
]
] |
ktxlh/HMGNN | [
"66299909ca02f8e61f09304d2a064fd4fc983a78"
] | [
"output/plot.py"
] | [
"\nfrom os import getcwd, mkdir\nfrom os.path import isdir, join\n\nimport matplotlib.pyplot as plt\n\ndef plot(exp_name, value_dict, scatter=False):\n save_path = join(getcwd(), f'{exp_name}.png')\n for label, values in value_dict.items():\n if scatter:\n iters = [i for i, v in enumerate(va... | [
[
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.show"
]
] |
JuliaBru/pymor | [
"46343b527267213f4279ea36f208b542ab291c4e"
] | [
"src/pymor/algorithms/error.py"
] | [
"# -*- coding: utf-8 -*-\n# This file is part of the pyMOR project (http://www.pymor.org).\n# Copyright 2013-2016 pyMOR developers and contributors. All rights reserved.\n# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)\n\nfrom numbers import Number\nimport time\n\nimport numpy as np\n\... | [
[
"numpy.max",
"numpy.array",
"numpy.argmin",
"numpy.min",
"matplotlib.pyplot.figure",
"numpy.argmax",
"numpy.linspace"
]
] |
hkhpub/opennmt-hkh | [
"63dceae7f8737a1780e91f2e727c7875ec0ebfdf"
] | [
"onmt/translate/translator.py"
] | [
"#!/usr/bin/env python\n\"\"\" Translator Class and builder \"\"\"\nfrom __future__ import print_function\nimport configargparse\nimport codecs\nimport os\nimport math\n\nimport torch\n\nfrom itertools import count\nfrom onmt.utils.misc import tile\n\nimport onmt.model_builder\nimport onmt.translate.beam\nimport on... | [
[
"torch.zeros",
"torch.cat",
"torch.arange",
"torch.no_grad",
"torch.full",
"torch.tensor",
"torch.div",
"torch.ge",
"torch.Tensor",
"torch.distributions.Multinomial",
"torch.topk"
]
] |
Abdktefane/Smart-Ordering | [
"c8ccb6adfae83f4cd505e16c445b958f0f2b3e60"
] | [
"utils/overlay_util.py"
] | [
"from typing import Text, Dict, Any, List, Tuple, Union\nimport numpy as np\nimport collections\nimport six\nimport PIL.Image as Image\nimport PIL.ImageDraw as ImageDraw\nimport PIL.ImageFont as ImageFont\n\ncoco_id_mapping = {\n 1: 'person', 2: 'bicycle', 3: 'car', 4: 'motorcycle', 5: 'airplane',\n 6: 'bus',... | [
[
"numpy.uint8",
"numpy.array",
"numpy.ceil",
"numpy.abs"
]
] |
sedonaprice/mosdef_dv | [
"753f87114c476f7e5fa50b7e3a609555bbb2bcfd"
] | [
"mosdef_dataviewer/viewer_lib/database.py"
] | [
"# ###################\n# Licensed under the MIT license. See LICENSE\n# ###################\n###\n# MOSDEF data viewer--\n# io.py:\n# provide functions to make Data Viewer databse, \n# and query it.\n###\n\nfrom __future__ import print_function\n\nimport sqlite3\nimport os... | [
[
"numpy.int",
"pandas.DataFrame",
"numpy.float64",
"numpy.where",
"numpy.int64"
]
] |
vfdev-5/Detectron.pytorch | [
"b7d39421454fc9b8da71cb469d9ac27a02a4395e"
] | [
"tools/infer_simple.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport distutils.util\nimport os\nimport sys\nimport pprint\nimport subprocess\nfrom collections import defaultdict\nfrom six.moves import xrange\n\n# Use a non-interactive backend\nim... | [
[
"matplotlib.use",
"torch.cuda.is_available",
"torch.load"
]
] |
ricklentz/OpenSfM | [
"b44b5f2b533b6fce8055b3a5a98a59bc22ae2cf6"
] | [
"opensfm/geotag_from_gpx.py"
] | [
"#!/usr/bin/python3\n\nimport datetime\nimport math\nimport os\nimport shutil\nimport sys\nimport time\n\nimport numpy as np\nfrom opensfm import geo\n\n\ntry:\n # pyre-fixme[21]: Could not find module `pyexiv2`.\n import pyexiv2\n # pyre-fixme[21]: Could not find module `pyexiv2.utils`.\n from pyexiv2.... | [
[
"numpy.array",
"numpy.sqrt"
]
] |
Kiike5/akg | [
"f16019261cca6b2d33b3b6f27c45ee8e6f7a834b"
] | [
"tests/common/test_run/fused_batch_norm_grad_run.py"
] | [
"# Copyright 2019 Huawei Technologies Co., Ltd\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 l... | [
[
"numpy.full",
"numpy.array",
"numpy.random.rand",
"numpy.sum",
"numpy.mean",
"numpy.allclose",
"numpy.sqrt",
"numpy.var"
]
] |
nv-hiep/NeuralNetworkSnake | [
"979d547df716b1cdeb3e1d41fa4f813094e2306e"
] | [
"GA/mutation.py"
] | [
"# 9.3.2\r\n# 11.2.1\r\n# 12.4.3\r\n\r\nimport numpy as np\r\nfrom typing import List, Union, Optional\r\nfrom .individual import Individual\r\n\r\n\r\ndef gaussian_mutation(chromosome: np.ndarray, prob_mutation: float, \r\n mu: List[float] = None, sigma: List[float] = None,\r\n ... | [
[
"numpy.random.normal",
"scipy.stats.cauchy.rvs",
"numpy.empty",
"numpy.log",
"numpy.random.uniform",
"numpy.abs",
"numpy.random.random"
]
] |
wikibook/deep-learning-reference | [
"18d2ca2ded4256b2ddbac6e76d57531ca13e6e30"
] | [
"Chapter05/multiclass_classifier.py"
] | [
"# Deep Learning Quick Reference Chapter 5: Multiclass Classification\n# Mike Bernico <mike.bernico@gmail.com>\n\nfrom keras.datasets import mnist\nfrom keras.utils import to_categorical\nfrom keras.models import Model\nfrom keras.layers import Input, Dense\nfrom keras.callbacks import TensorBoard, ModelCheckpoint\... | [
[
"sklearn.metrics.classification_report"
]
] |
zhaohj2017/FAoC-tool | [
"9931a87a4831d45f4109af2cd1f990d4b30fc2dd"
] | [
"acti.py"
] | [
"import torch\nimport torch.nn as nn\nimport superp\n\n############################################\n# self-defined activation function\n############################################\nclass my_act(nn.Module):\n def __init__(self, bd):\n super(my_act, self).__init__()\n self.bent_degree = bd\n ... | [
[
"torch.sqrt"
]
] |
aminabedi/FaceX-Zoo | [
"2a3d7c8ac1df94a56c43affec8514ec458687f37"
] | [
"server.py"
] | [
"from fastapi import FastAPI, WebSocket\nimport uvicorn\nimport torch\nimport time\nimport json\nfrom torch import optim\nfrom torch.utils.data import DataLoader\nimport logging\nfrom aux import train_one_epoch, get_lr\nfrom threading import Thread\nimport copy\nfrom utils.AverageMeter import AverageMeter\nimport i... | [
[
"torch.cat",
"torch.max",
"torch.optim.SGD",
"torch.optim.lr_scheduler.MultiStepLR",
"torch.cuda.set_device",
"torch.logical_or",
"torch.utils.data.DataLoader",
"torch.nn.KLDivLoss",
"torch.load",
"torch.exp"
]
] |
anarkiwi/desidulate | [
"32466d8c2f831122511c1dc70eebab3da7dc2dcf"
] | [
"ssf2thumb.py"
] | [
"#!/usr/bin/python3\n\n# Copyright 2020 Josh Bailey (josh@vandervecken.com)\n\n## Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights ... | [
[
"pandas.Int64Dtype",
"numpy.right_shift",
"numpy.left_shift",
"pandas.notna"
]
] |
broco347/coup-predictor | [
"f25bd0838f825a0c3f5e4717010f9426df93c51a"
] | [
"Notebooks/common7.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\nimport pickle\nfrom imblearn.over_sampling import RandomOverSampler, SMOTE, ADASYN\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler\nimport os\n\n# Load Data\nfilepath = '/Users/tim/src/Metis/Project_3/data/interim/df_... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.StandardScaler"
]
] |
aeraeg/first_leader | [
"f027e9e90c5c99b28f4fccb912afe32430874fda"
] | [
"apps/analysis/molds.py"
] | [
"'''this module for the data was emported from excel sheet analysis'''\n\nimport pandas as pd\nimport openpyxl as xl\nfrom openpyxl import load_workbook\n\nimport numpy as np\nimport os\nfrom copy import copy\nimport random\nfrom random import randint,seed\nfrom openpyxl.chart import BarChart, Reference, Series,Lin... | [
[
"pandas.DataFrame",
"pandas.read_excel",
"pandas.crosstab",
"pandas.ExcelWriter"
]
] |
kyuhyoung/Deep_Visual_Inertial_Odometry | [
"ac2eed0088a3dd3c9d8a23caa9caeb473b28da82"
] | [
"main_KF.py"
] | [
"from src.DataReader.KF_Data.KF_PrepData import DataManager\nfrom scipy import signal\nfrom src.Params import *\nfrom src.Models.KF_Model.KF_BLock import *\nfrom src.Models.KF_Model.KF_Model import *\nimport torch.optim as optim\nimport matplotlib.pyplot as plt\nfrom src.Params import getNoiseLevel\n\n\ndsName, sub... | [
[
"matplotlib.pyplot.plot",
"scipy.signal.butter",
"matplotlib.pyplot.figure",
"scipy.signal.filtfilt",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot"
]
] |
GabrielKS/e-mission-server | [
"bb83b428e648353e91b55de90274bdf8109b1a12"
] | [
"emission/analysis/modelling/tour_model_first_only/data_preprocessing.py"
] | [
"import emission.storage.decorations.analysis_timeseries_queries as esda\nimport emission.analysis.modelling.tour_model.cluster_pipeline as pipeline\nimport emission.analysis.modelling.tour_model.similarity as similarity\nimport pandas as pd\nfrom sklearn.model_selection import KFold\n\n\n# read data that have user... | [
[
"sklearn.model_selection.KFold",
"pandas.DataFrame"
]
] |
ashnair1/PANet | [
"ffe8a07ed20b4808a25c7036e727509f25004465"
] | [
"tools/infer_simple.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport distutils.util\nimport os\nimport sys\nimport pprint\nimport subprocess\nfrom collections import defaultdict\nfrom six.moves import xrange\n\n# Use a non-interactive backend\nim... | [
[
"matplotlib.use",
"torch.cuda.is_available",
"torch.load"
]
] |
Fexilus/MVE385-code | [
"4b77f69e72ff927a90ade8bca6e6e9a473225b00"
] | [
"tracking/filter/bicycle.py"
] | [
"\"\"\"An implementation of a basic Kalman with the bicycle motion model.\nThis module implements an \"interface\" for modules that pairs a filter type with\na motion model, and can thus be directly used to track objects.\n\"\"\"\nimport numpy as np\n\nfrom . import extended\n\n\nNUM_STATES = 9\nNUM_MEASUREMENTS = ... | [
[
"numpy.array",
"numpy.sin",
"numpy.asarray",
"numpy.tan",
"numpy.identity",
"numpy.cos"
]
] |
DeMoriarty/gmm-torch | [
"9bc2062573b376fb6a0c0d380df2141dc5cef27e"
] | [
"utils.py"
] | [
"import torch\r\nimport math\r\n\r\ndef calculate_matmul_n_times(n_components, mat_a, mat_b):\r\n \"\"\"\r\n Calculate matrix product of two matrics with mat_a[0] >= mat_b[0].\r\n Bypasses torch.matmul to reduce memory footprint.\r\n args:\r\n mat_a: torch.Tensor (n, k, 1, d)\r\n mat_... | [
[
"torch.zeros",
"torch.device",
"torch.cuda.get_device_properties",
"torch.cuda.memory_allocated",
"torch.empty"
]
] |
tvottra/qml | [
"edfa19ff3ff371f06bc5cdc3122d277793211498"
] | [
"demonstrations/tutorial_gbs.py"
] | [
"r\"\"\"\r\n.. role:: html(raw)\r\n :format: html\r\n\r\nQuantum advantage with Gaussian Boson Sampling\r\n==============================================\r\n\r\n.. meta::\r\n :property=\"og:description\": Using light to perform tasks beyond the reach of classical computers.\r\n\r\n :property=\"og:image\": h... | [
[
"numpy.dot",
"numpy.random.seed",
"numpy.cosh",
"numpy.tanh",
"scipy.stats.unitary_group.rvs"
]
] |
bigwater/deephyper | [
"4427e30c7b76b6f87cc417d0871768efe078f850"
] | [
"deephyper/nas/space/keras_search_space.py"
] | [
"from collections.abc import Iterable\nfrom functools import reduce\n\nimport networkx as nx\nfrom tensorflow import keras\nfrom tensorflow.python.keras.utils.vis_utils import model_to_dot\n\nfrom deephyper.core.exceptions.nas.space import (\n InputShapeOfWrongType,\n NodeAlreadyAdded,\n StructureHasACycle... | [
[
"tensorflow.python.keras.utils.vis_utils.model_to_dot",
"tensorflow.keras.layers.Input",
"tensorflow.keras.Model"
]
] |
hwp/fairseq | [
"f5cf2278d10a2aa8ee5759ce924d23aef6f82e6f"
] | [
"fairseq/tasks/language_modeling.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 logging\nimport os\nfrom dataclasses import dataclass, field\nfrom typing import Optional\n\nimport numpy as np\nimport torch... | [
[
"numpy.array",
"torch.no_grad"
]
] |
Sharath302/popmon | [
"43755048ad419109afabaca6c81b50b4e39c60b7",
"43755048ad419109afabaca6c81b50b4e39c60b7"
] | [
"tests/popmon/base/test_pipeline.py",
"tests/popmon/spark/test_spark.py"
] | [
"import logging\n\nimport numpy as np\n\nfrom popmon.base import Module, Pipeline\n\n\nclass LogTransformer(Module):\n _input_keys = (\"input_key\",)\n _output_keys = (\"output_key\",)\n\n def __init__(self, input_key, output_key):\n super().__init__()\n self.input_key = input_key\n se... | [
[
"numpy.sum",
"numpy.array",
"numpy.power",
"numpy.log"
],
[
"pandas.Timestamp",
"pandas.Timedelta"
]
] |
edaaydinea/365-days-of-coding-challenge | [
"baf06a9bef75ff45194e57357e20085b9cde2498"
] | [
"Books/An Introduction to Statistics with Python/Chapter 4 - Display of Statistical Data/Pyplot Style.py"
] | [
"# Import the required packages, with their conventional names\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Generate the data\nx = np.arange(start=0, stop=10, step=0.2)\ny = np.sin(x)\n\n# Generate the plot\nplt.plot(x, y)\n\n# Display it on the screen\nplt.savefig(\"Pyplot Style.png\", bbox_inches='ti... | [
[
"matplotlib.pyplot.savefig",
"numpy.sin",
"matplotlib.pyplot.plot",
"numpy.arange"
]
] |
compi1234/spchutils | [
"87c67cdb3aa85d2612ef6972b3320585d418f579"
] | [
"pyspch/display_mpl.py"
] | [
"\nimport os,sys,io \nimport scipy.signal\n\nfrom urllib.request import urlopen\nfrom IPython.display import display, Audio, HTML, clear_output\n\nimport math\nimport numpy as np\nimport pandas as pd\n\nimport librosa\nfrom .constants import EPS_FLOAT, LOG10, SIGEPS_FLOAT\n\nimport matplotlib as mpl\nimport matplot... | [
[
"numpy.max",
"numpy.min",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.abs"
]
] |
jacobhinkle/bayescache | [
"1728aaaec112a375a7341776ccb5c2d4b67242d6"
] | [
"bayescache/api/data/loaders.py"
] | [
"import numpy as np\nfrom math import floor\n\nfrom torch.utils import data\n\n\nclass DataSplitter(data.Dataset):\n \"\"\"\n Subset dataset by index.\n\n Helper class to be used with `train_valid_splitter`.\n\n Parameters\n ----------\n data : torch.utils.data.Dataset instance\n\n length : int... | [
[
"numpy.random.seed",
"numpy.random.shuffle"
]
] |
jessijzhao/fast-dpsgd | [
"143370bd1a11076a461e1d06e235db9b1d6b5de5"
] | [
"pytorch.py"
] | [
"'''\nModel file and non-differentially private file\n'''\nimport time\n\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn, optim\n\nimport data\nimport utils\n\n\nclass EmbeddingNet(nn.Module):\n def __init__(self, vocab_size: int, **_):\n super().__init__()\n # Embedding dimens... | [
[
"torch.nn.Linear",
"torch.nn.functional.sigmoid",
"torch.nn.LSTM",
"torch.nn.AvgPool2d",
"torch.nn.CrossEntropyLoss",
"torch.from_numpy",
"torch.nn.ReLU",
"torch.mean",
"torch.nn.Conv2d",
"torch.nn.BCELoss",
"torch.nn.functional.relu",
"torch.nn.functional.max_pool2... |
adaptive-kernel/adaptive-kernel | [
"f1b69d5c160ffb0ed5fd35b29d8bc5777389262c"
] | [
"backend_extra.py"
] | [
"import tensorflow as tf\nfrom tensorflow.python.client import device_lib\n\ndef scatter_update(ref, indices, updates):\n \"\"\"Update the value of `ref` at indecies to `updates`.\n \"\"\"\n return tf.scatter_update(ref, indices, updates)\n\ndef hasGPU():\n devs = device_lib.list_local_devices()\n re... | [
[
"tensorflow.python.client.device_lib.list_local_devices",
"tensorflow.scatter_update"
]
] |
SsnL/geoopt | [
"47e7e6b79c177e3172161afaef8424d61b917a7b",
"47e7e6b79c177e3172161afaef8424d61b917a7b"
] | [
"tests/test_lorentz_math.py",
"tests/test_random.py"
] | [
"import torch\nimport random\nimport numpy as np\nimport pytest\nfrom geoopt.manifolds import lorentz\n\n\n@pytest.fixture(\"module\", autouse=True, params=range(30, 40))\ndef seed(request):\n seed = request.param\n torch.manual_seed(seed)\n random.seed(seed)\n np.random.seed(seed)\n return seed\n\n\... | [
[
"torch.zeros",
"numpy.testing.assert_allclose",
"torch.sqrt",
"torch.rand_like",
"numpy.random.seed",
"torch.linspace",
"torch.manual_seed",
"torch.ones_like",
"torch.zeros_like",
"torch.empty",
"torch.Tensor"
],
[
"torch.rand"
]
] |
RodrigoNaves/ginan-bitbucket-update-tests | [
"4bd5cc0a9dd0e94b1c2d8b35385e128404009b0c"
] | [
"scripts/backup_old/plotIONEX.py"
] | [
"import cartopy.crs as ccrs\nimport matplotlib\nmatplotlib.use('agg')\nimport matplotlib.pyplot as plt\nfrom math import floor\nimport numpy as np\n\nfilename = input(\"Input filename: \")\n\ntinp = input(\"Starting time (hhmmss): \")\nhour=int(tinp[:2])\nmint=int(tinp[2:4])\nsecd=int(tinp[4:])\ntstart=(hour-1)*360... | [
[
"matplotlib.use",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.pcolormesh",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.clf"
]
] |
VeggieBaconator/astronomy-data-analysis | [
"e7eecd323a5499ee4206d22c41c91f149553512a"
] | [
"astronomy_data_analysis/image_stacking.py"
] | [
"\"\"\"\nSome functions used for image stacking - including scalable mean and median algorithms\nfor large data sets.\n\"\"\"\nimport numpy as np\nfrom astropy.io import fits\nfrom . import fits_tools\nimport matplotlib.pyplot as plt\n\n\ndef mean_fits(data_stack):\n \"\"\"\n Returns the mean value across the... | [
[
"numpy.array",
"numpy.zeros",
"numpy.median",
"numpy.mean",
"numpy.shape",
"numpy.std",
"numpy.argmax",
"numpy.dstack"
]
] |
qmichalski/1d-rocket-flow | [
"7c9b38e42a1cd4b0343fdd36f89c52b9f2337b5b"
] | [
"main.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Dec 19 12:38:13 2021\n\n@author: quent\n\"\"\"\n\nimport numpy as np\n\nimport geometrylib\nimport flowsolver\nimport massflowlib\nimport matplotlib.pyplot as plt\n\ndef initFlow(P0,T0,X0,A,grid,gas,process='quick'):\n from scipy.interpolate import interp1d\n r... | [
[
"numpy.array",
"scipy.interpolate.interp1d",
"matplotlib.pyplot.xscale",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.argmin",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
... |
sohaibrabbani/weather-removal-GAN | [
"be89be28e610d7466c6cced1e11c2564f17c4c24",
"34e277737d4842f1aa3559919b27d3622ab25075"
] | [
"attentive_gan_model/vgg16.py",
"tools/test_model.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# @Time : 18-6-26 下午8:52\n# @Author : MaybeShewill-CV\n# @Site : https://github.com/MaybeShewill-CV/attentive-gan-derainnet\n# @File : vgg16.py\n# @IDE: PyCharm\n\"\"\"\n实现pretrained vgg用于特征提取计算attentive gan损失\n\"\"\"\nfrom collections import OrderedDict\n... | [
[
"tensorflow.constant",
"tensorflow.variable_scope",
"tensorflow.equal",
"tensorflow.placeholder"
],
[
"numpy.max",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"tensorflow.Session",
"tensorflow.train.Saver",
"numpy.min",
"matplotlib.pyplot.figure",... |
sebastiendazy/tensorflow | [
"2edf3621622a0d2b2140a31d8030d826a82562e0",
"2edf3621622a0d2b2140a31d8030d826a82562e0"
] | [
"tensorflow/python/ops/embedding_ops.py",
"tensorflow/python/kernel_tests/rnn_cell_test.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... | [
[
"tensorflow.python.ops.math_ops.sparse_segment_sum",
"tensorflow.python.ops.data_flow_ops.dynamic_stitch",
"tensorflow.python.ops.array_ops.unique",
"tensorflow.python.framework.ops.device",
"tensorflow.python.ops.constant_op.constant",
"tensorflow.python.ops.math_ops.cast",
"tensorflo... |
denzelayala1/pysimpleplotter | [
"58e6474b6177eb1780fdcd5a2d4e093f18ad8614"
] | [
"pysimpleplotter/dataset.py"
] | [
"#!/usr/bin/env python3\n\nfrom re import findall\nfrom typing import List\n\nfrom dataclasses import dataclass\nfrom exceptions import UnknownFileTypeError\nfrom numpy import float64\nfrom pandas import DataFrame\n\n\n@dataclass(frozen=True)\nclass Dataset:\n file_name: str\n file_type: str\n cols: List[s... | [
[
"pandas.DataFrame"
]
] |
shanham/legume | [
"859243a5523c6ea89ea2ed7520209c44d6f2dc1c"
] | [
"tests/test_guided_modes.py"
] | [
"import unittest\n\nimport numpy as np\n\nimport legume\nimport matplotlib.pyplot as plt\nimport scipy.io\n\nclass Test_Guided(unittest.TestCase):\n \"\"\"\n Test of the guided mode computation vs. stored data for a three-layer\n grating as in Zhou et al. Optica 3 (2016)\n \"\"\" \n def test_gm(self)... | [
[
"numpy.array",
"numpy.zeros",
"numpy.load",
"numpy.arange",
"numpy.abs"
]
] |
alexcoca/gcdf1 | [
"bad3ef91084a006a8c99d7e43288d572460b321f"
] | [
"src/gcdf1/utils/print.py"
] | [
"from __future__ import annotations\n\nimport json\nimport os.path\n\nimport numpy as np\n\nfrom gcdf1.utils.dialogue import (\n get_dialogue_outline,\n get_intent_by_turn,\n get_utterances,\n)\n\nnp.random.seed(0)\n\n\ndef print_dialogue(\n dialogue: dict, print_index: bool = False, show_intent: bool =... | [
[
"numpy.random.seed"
]
] |
sflippl/patches | [
"c19889e676e231af44669a01c61854e9e5791227"
] | [
"patches/datasets/pilgrimm/test/pilgrimm.py"
] | [
"\"\"\"Test patches.datasets.pilgrimm.pilgrimm.\n\"\"\"\n\nimport unittest\n\nimport numpy as np\n\nfrom .. import messages as msg\nfrom .. import layers\nfrom .. import pilgrimm\nfrom .layers import TestOccluder\n\nclass TestAtom(TestOccluder):\n \"\"\"Test atoms.\n \"\"\"\n\n def setUp(self):\n su... | [
[
"numpy.random.RandomState"
]
] |
javicordon/ml-demo | [
"a1d95766c26101cee71b25ebdc2e972139e620bc"
] | [
"packages/randomForest_classifier/randomForest_classifier/processing/features.py"
] | [
"import numpy as np\nfrom itertools import compress\nfrom sklearn.base import BaseEstimator, TransformerMixin\n\nfrom randomForest_classifier.processing.errors import InvalidModelInputError\n\n\nclass LogTransformer(BaseEstimator, TransformerMixin):\n \"\"\"Logarithm transformer.\"\"\"\n\n def __init__(self, ... | [
[
"numpy.log"
]
] |
fimoziq/tutorials | [
"a5c3f1fed6c5c4d23f59a41c024f7499055c8d81"
] | [
"neural_networks_tutorial_part_2/neural_networks_part2_2.py"
] | [
"# Import required libraries :\nimport numpy as np\n\n# Define input features :\ninput_features = np.array([[0,0],[0,1],[1,0],[1,1]])\nprint (input_features.shape)\nprint (input_features)# Define target output :\ntarget_output = np.array([[0,1,1,1]])\n\n# Reshaping our target output into vector :\ntarget_output = t... | [
[
"numpy.array",
"numpy.dot",
"numpy.exp"
]
] |
C0PEP0D/sheld0n | [
"497d4ee8b6b1815cd5fa1b378d1b947ee259f4bc"
] | [
"modules/pyp0st/post_dsm.py"
] | [
"#!/usr/bin/env python3\n\n# command line program\nimport argparse\n# deepcopy\nimport copy\n# file\nimport os.path\n# numpy\nimport numpy as np\nimport scipy as sp\nimport scipy.integrate\nimport scipy.linalg\nimport scipy.interpolate\n# internal modules\nimport libpost\n# tmp plot\nimport matplotlib.pyplot as plt... | [
[
"scipy.interpolate.interp1d",
"numpy.column_stack",
"numpy.empty",
"numpy.zeros",
"numpy.log",
"numpy.load",
"numpy.exp",
"scipy.integrate.cumtrapz",
"numpy.save",
"numpy.identity",
"numpy.linalg.eigvalsh",
"numpy.power",
"numpy.sqrt",
"numpy.trapz",
"nu... |
djhoese/pyproj | [
"9669f623596ef19ba7cf2754639814ccc81cc4a9"
] | [
"test/crs/test_crs.py"
] | [
"import concurrent.futures\nimport json\n\nimport numpy\nimport pytest\n\nimport pyproj\nfrom pyproj import CRS\nfrom pyproj.crs import (\n CoordinateOperation,\n CoordinateSystem,\n Datum,\n Ellipsoid,\n PrimeMeridian,\n)\nfrom pyproj.crs.enums import CoordinateOperationType, DatumType\nfrom pyproj.... | [
[
"numpy.array"
]
] |
abhishekgoyal1/darts | [
"176e7aeb597216f99f54c5e4a74c8926d7f62471"
] | [
"cnn/model.py"
] | [
"import torch\nimport torch.nn as nn\nfrom operations import *\nfrom torch.autograd import Variable\nfrom utils import drop_path\n\n\nclass Cell(nn.Module):\n\n def __init__(self, genotype, C_prev_prev, C_prev, C, reduction, reduction_prev):\n super(Cell, self).__init__()\n print(C_prev_prev, C_prev, C)\n\n ... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
neonnnnn/pyrfm | [
"e88fe8cb7bf3062616d33826e955e828fc6d8ba6"
] | [
"pyrfm/random_feature/tests/test_signed_circulant_matrix.py"
] | [
"import numpy as np\nfrom scipy.sparse import csr_matrix\nfrom sklearn.utils.testing import (assert_allclose,\n assert_allclose_dense_sparse)\nfrom pyrfm import SignedCirculantRandomMatrix\nfrom sklearn.metrics.pairwise import rbf_kernel\nfrom scipy.linalg import circulant\nfrom sc... | [
[
"numpy.max",
"sklearn.utils.testing.assert_allclose_dense_sparse",
"numpy.dot",
"numpy.sin",
"numpy.random.RandomState",
"numpy.sum",
"sklearn.metrics.pairwise.rbf_kernel",
"numpy.mean",
"sklearn.utils.testing.assert_allclose",
"scipy.fft.ifft",
"numpy.sqrt",
"numpy... |
underchemist/glue | [
"4aa8c64a6f65629207e40df9963232473a24c9f6"
] | [
"glue/viewers/image/ds9norm.py"
] | [
"\"\"\"\nThis file implements a matplotlib Normalize object\nwhich mimics the functionality of scaling functions in ds9\n\nThe transformation from data values to normalized (0-1) display\nintensities are as follows:\n\n- Data to normal:\n y = clip( (x - vmin) / (vmax - vmin), 0, 1)\n- normal to warped: Apply a mo... | [
[
"numpy.divide",
"numpy.max",
"numpy.add",
"numpy.log",
"numpy.min",
"numpy.multiply",
"numpy.subtract",
"numpy.ma.MaskedArray",
"numpy.power",
"numpy.sqrt",
"numpy.clip"
]
] |
Mithilesh1609/tensorflow | [
"f8c0e68a8aa5d575a19129ec67c9ed6262652082"
] | [
"tensorflow/python/keras/layers/preprocessing/category_crossing.py"
] | [
"# Copyright 2020 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.framework.tensor_shape.TensorShape",
"tensorflow.python.util.tf_export.keras_export",
"tensorflow.python.ops.array_ops.concat",
"tensorflow.python.ops.sparse_ops.sparse_concat_v2",
"tensorflow.python.ops.sparse_ops.sparse_cross",
"tensorflow.python.ops.ragged.ragged_arra... |
HwangJohn/model_compression | [
"dd537d306d100ce53cc5f24ef0ff315cccf8c9da"
] | [
"src/plotter.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Plotter.\n\n- Author: Junghoon Kim\n- Email: jhkim@jmarple.ai\n\"\"\"\n\nimport os\nfrom typing import List, NamedTuple, Sequence, Tuple, Union\n\nimport PIL.Image\nimport matplotlib.axes\nimport matplotlib.pyplot as plt\nfrom matplotlib.ticker import FixedLocator\nimport numpy as np... | [
[
"numpy.linspace",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure"
]
] |
jk96491/SMAC | [
"7aaf4673b0eecafc4ab25f381eea20fc762af56a",
"7aaf4673b0eecafc4ab25f381eea20fc762af56a"
] | [
"controllers/basic_controller.py",
"envs/starcraft2/starcraft2.py"
] | [
"from modules.agents import REGISTRY as agent_REGISTRY\nfrom components.action_selectors import REGISTRY as action_REGISTRY\nimport torch as th\n\n\n# This multi-agent controller shares parameters between agents\nclass BasicMAC:\n def __init__(self, scheme, groups, args):\n self.n_agents = args.n_agents\n... | [
[
"torch.zeros_like",
"torch.eye",
"torch.ones_like",
"torch.nn.functional.softmax"
],
[
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.eye",
"numpy.arange",
"numpy.append"
]
] |
flxai/Confident_classifier | [
"91753e0f815460fa0048ffa5f659acc4ec6fa4ee"
] | [
"src/models/vgg.py"
] | [
"import torch.nn as nn\nimport math\n\n\n__all__ = [\n 'VGG', 'vgg13',\n]\n\nclass VGG(nn.Module):\n\n def __init__(self, features, num_classes=10):\n super(VGG, self).__init__()\n self.features = features\n self.classifier = nn.Sequential(\n nn.Linear(512, 512),\n n... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
admariner/polyaxon | [
"ba355c38166047eb11e60de4cee4d7c3b48db323"
] | [
"examples/tracking/tensorflow1/mnist/model.py"
] | [
"import argparse\nimport gzip\nimport numpy as np\nimport os\nimport tensorflow as tf\n\nfrom six.moves.urllib.request import urlretrieve\n\n# Polyaxon\nfrom polyaxon.tracking import Run\n\nACTIVATIONS = {\n 'relu': tf.nn.relu,\n 'sigmoid': tf.sigmoid,\n 'tanh': tf.tanh,\n}\n\nOPTIMIZERS = {\n 'gradient... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.nn.conv2d",
"numpy.zeros",
"tensorflow.argmax",
"tensorflow.matmul",
"tensorflow.Session",
"tensorflow.reshape",
"numpy.random.shuffle",
"tensorflow.truncated_normal",
"tensorflow.constant",
"tensorflow.plac... |
HeRaNO/ChickenRibs | [
"9aa8dd8f915aa39a7168940b5ff99a1d665f5212"
] | [
"MachineLearning/mailSpamFilterCN.py"
] | [
"'''\n\tmailSpamFilterCN.py:用于中文垃圾邮件分类,采用 Naive Bayes 方法\n\tAuthor:HeRaNO\n'''\n# coding: utf-8\n\nimport re\nimport sys\nimport math\n\nimport jieba\nimport pandas as pd\n\ndef readContent(path):\n\twith open(path, 'r', encoding = 'gbk', errors = 'ignore') as f:\n\t\tl = f.readlines()\n\tl = filter(lambda line: li... | [
[
"pandas.read_csv"
]
] |
aliprf/ASMNet | [
"f203962ce171e09f92b596b1a04e60c5717d872d"
] | [
"test.py"
] | [
"from configuration import DatasetName, WflwConf, W300Conf, DatasetType, LearningConfig, InputDataSize\nimport tensorflow as tf\n\nimport cv2\nimport os.path\nimport scipy.io as sio\nfrom cnn_model import CNNModel\nfrom tqdm import tqdm\nimport numpy as np\nfrom os import listdir\nfrom os.path import isfile, join\n... | [
[
"tensorflow.keras.models.load_model",
"numpy.expand_dims"
]
] |
bit-bots/bitbots_behavior | [
"313d4a76d9af524c21f1922e283f4dffbc2af699"
] | [
"bitbots_blackboard/src/bitbots_blackboard/capsules/world_model_capsule.py"
] | [
"\"\"\"\nWorldModelCapsule\n^^^^^^^^^^^^^^^^^^\n\nProvides information about the world model.\n\"\"\"\nimport math\nimport ros_numpy\nimport numpy as np\nfrom scipy.ndimage import gaussian_filter\nimport matplotlib.pyplot as plt\nfrom scipy.interpolate import griddata\nfrom PIL import Image, ImageDraw\n\nimport ros... | [
[
"numpy.max",
"numpy.zeros_like",
"numpy.linalg.norm",
"numpy.array",
"scipy.ndimage.gaussian_filter",
"numpy.min",
"numpy.linspace",
"numpy.where",
"scipy.interpolate.griddata",
"matplotlib.pyplot.show",
"matplotlib.pyplot.quiver",
"numpy.gradient",
"matplotlib.... |
jhvics1/vit-pytorch | [
"bad4b94e7b4baa544ca36149431f7912eccd4b49"
] | [
"vit_pytorch/levit.py"
] | [
"from math import ceil\n\nimport torch\nfrom torch import nn, einsum\nimport torch.nn.functional as F\n\nfrom einops import rearrange, repeat\nfrom einops.layers.torch import Rearrange\n\n# helpers\n\ndef exists(val):\n return val is not None\n\ndef default(val, d):\n return val if exists(val) else d\n\ndef c... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.AdaptiveAvgPool2d",
"torch.arange",
"torch.nn.ModuleList",
"torch.einsum",
"torch.nn.Softmax",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d",
"torch.meshgrid",
"torch.nn.GELU",
"torch.nn.Embeddi... |
JonasKemmer/juliet | [
"867084ba4b407a44c73ee533315560b5868f671f"
] | [
"juliet/fit.py"
] | [
"# Import batman, for lightcurve models:\nimport batman\n# Try to import catwoman:\ntry:\n import catwoman\n have_catwoman = True\nexcept:\n have_catwoman = False\n\n# Import radvel, for RV models:\nimport radvel\n# Import george for detrending:\ntry:\n import george\nexcept:\n print(\n 'Warni... | [
[
"numpy.arccos",
"numpy.double",
"numpy.median",
"numpy.copy",
"numpy.exp",
"numpy.min",
"numpy.where",
"numpy.count_nonzero",
"numpy.sin",
"numpy.log",
"numpy.arange",
"numpy.sqrt",
"numpy.append",
"numpy.nanmedian",
"numpy.array",
"numpy.zeros",
... |
sunsyw/nlp | [
"87799a34f701f73055941048efe12450c793bd8b"
] | [
"Chatbot/encoder.py"
] | [
"import torch.nn as nn\n\"\"\"\nConvert word indexes to embeddings.\nPack padded batch of sequences for RNN module.\nForward pass through GRU.\nUnpack padding.\nSum bidirectional GRU outputs.\nReturn output and final hidden state.\n\"\"\"\n\n\nclass EncoderRNN(nn.Module):\n def __init__(self, hidden_size, embedd... | [
[
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.GRU",
"torch.nn.utils.rnn.pack_padded_sequence"
]
] |
Grimmp/RustTensorflowTraining | [
"0b43dadd8dd84b2c8830836c03a5a3ed28331ec4"
] | [
"create_model/create_model.py"
] | [
"#Run this file to create a model to be used in Rust\n\nimport tensorflow as tf\nfrom tensorflow.keras.layers import Dense\n\n#Define a custom keras model\nclass custom_model(tf.keras.Model):\n def __init__(self, *args, **kwargs):\n super(custom_model, self).__init__(*args, **kwargs)\n self.dense... | [
[
"tensorflow.TensorSpec",
"tensorflow.keras.layers.Dense"
]
] |
tomwhite/inaturalist-datashader-map | [
"1b2bc7fd48ed17d1865d980644deb5c07443adfa"
] | [
"datashader_fix/tiles.py"
] | [
"from __future__ import absolute_import, division, print_function\nfrom io import BytesIO\n\nimport math\nimport os\nimport timeit\n\nimport dask\nimport dask.bag as db\n\nimport numpy as np\n\nfrom PIL.Image import fromarray\n\n\n__all__ = ['render_tiles', 'MercatorTileDefinition']\n\n\n\n# helpers ---------------... | [
[
"numpy.flip",
"numpy.nanmax",
"numpy.nanmin"
]
] |
PAmcconnell/mriqc | [
"190931970c4d51c4baa679bc7cdf4f8047e6636d"
] | [
"mriqc/qc/functional.py"
] | [
"# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n# pylint: disable=no-member\nr\"\"\"\nMRIQC: image quality metrics for functional MRI.\n\nMeasures for the spatial information\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nDefinitions are given in the\n:... | [
[
"numpy.median",
"numpy.roll",
"numpy.mean"
]
] |
guptarohit/tensorflow | [
"6aa83398ab03bfae822f36772757097bcb98b6ed",
"a0b0a503287d019a28ef4f670b157eb3605a12f3"
] | [
"tensorflow/contrib/seq2seq/python/ops/attention_wrapper.py",
"tensorflow/python/ops/nn_ops.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.python.ops.array_ops.identity",
"tensorflow.python.ops.variable_scope.variable_scope",
"tensorflow.python.ops.variable_scope.get_variable",
"tensorflow.python.ops.math_ops.matmul",
"tensorflow.python.ops.array_ops.where",
"tensorflow.python.ops.array_ops.ones",
"tensorflow.... |
astromancer/recipes | [
"8870769b13bab02301b68692515acf373dba50f1"
] | [
"src/recipes/special.py"
] | [
"import numpy as np\n\n#====================================================================================================\ndef Gaussian(p, x):\n '''Gaussian function'''\n #kw.get('sigma')\n #kw.get('mean')\n #kw.get('amplitude')\n\n A, b, mx = p\n return A * np.exp(-b * (x-mx)**2)\n\ndef Gaussi... | [
[
"numpy.array",
"numpy.asarray",
"numpy.exp",
"numpy.eye",
"numpy.la.inv",
"numpy.allclose",
"numpy.tensordot",
"numpy.la.det",
"numpy.sqrt"
]
] |
jkulhanek/deep-rl-pytorch | [
"6fa7ceee8524f002d4a8d93295b231f6b9b7c29c",
"6fa7ceee8524f002d4a8d93295b231f6b9b7c29c"
] | [
"deep_rl/common/storage.py",
"experiments/navmaze_a2c.py"
] | [
"import numpy as np\n\n\ndef batch_items(items):\n if isinstance(items[0], tuple):\n return tuple(map(batch_items, zip(*items)))\n\n elif isinstance(items[0], list):\n return list(map(batch_items, zip(*items)))\n\n else:\n return np.stack(items)\n\ndef split_batched_items(items, axis =... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.sum",
"numpy.split",
"numpy.where",
"numpy.stack",
"numpy.squeeze"
],
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.LSTM",
"torch.nn.Sequential",
"torch.nn.Conv2d"
]
] |
frevson/Qiskit-Aqua | [
"d1050e3362276894b0e3442717f0f2a774a177b0",
"d1050e3362276894b0e3442717f0f2a774a177b0"
] | [
"test/test_svm_classical.py",
"qiskit_aqua/components/initial_states/zero.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright 2018 IBM.\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 appli... | [
[
"numpy.concatenate",
"numpy.asarray"
],
[
"numpy.power"
]
] |
agnitm/aurora_ops | [
"892cd4aca5c956ac1750622321cf54fa951138e5"
] | [
"ampere_read.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nampere_read.py\n--------------\n\nThis module reads in netCDF files from AMPERE Satellite constellation and\nconverts them into regular data matrices to compare with SWMF-RIM.\n\nCreated on Tue Jun 5 15:35:01 2018\nLast Update on Wed Sep 23 16:52:40 2020\n\... | [
[
"matplotlib.pyplot.show",
"matplotlib.colors.Normalize",
"numpy.zeros",
"matplotlib.pyplot.subplot"
]
] |
fatihes1/statistics-calculator | [
"f3dc29261563c024ca86a748e49670da4a548ddf"
] | [
"script.py"
] | [
"from flask import Flask, render_template, redirect, url_for, request, flash\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport statistics as s\nimport base64\nfrom io import BytesIO\nfrom matplotlib.figure import Figure\n\napp = Flask(__name__)\n\ndef geometrik(self):\n geo = self... | [
[
"matplotlib.figure.Figure",
"numpy.array",
"pandas.Series"
]
] |
crazydemo/batch-dropblock-network | [
"1ab89d4ffab3b8002e9401d95d929001da6f158e"
] | [
"trainers/evaluator.py"
] | [
"# encoding: utf-8\nimport numpy as np\nimport os\nimport torch\nfrom PIL import Image\nimport matplotlib.pyplot as plt\n\nfrom trainers.re_ranking import re_ranking as re_ranking_func\n\n\nclass ResNetEvaluator:\n def __init__(self, model):\n self.model = model\n\n def save_incorrect_pairs(self, distm... | [
[
"torch.cat",
"numpy.asarray",
"torch.no_grad",
"matplotlib.pyplot.close",
"numpy.mean",
"matplotlib.pyplot.subplots",
"numpy.invert",
"numpy.any",
"numpy.argsort",
"numpy.sqrt",
"torch.Tensor",
"torch.sort",
"torch.pow"
]
] |
Nrgeup/review_assistant | [
"bf03d62773501b84069afcc8b3da66d6d7829218"
] | [
"datasets/amazon-fine-food-reviews/dev_split.py"
] | [
"import pandas as pd\n\n\ndf = pd.read_csv(\"./Reviews.csv\", encoding='utf-8')\ndf.drop_duplicates(keep='first', inplace=True) # 去重,只保留第一次出现的样本\n\n# print(df.shape) # (568454, 10)\n# columns = df.columns.values\n# ['Id' 'ProductId' 'UserId' 'ProfileName' 'HelpfulnessNumerator' 'HelpfulnessDenominator' 'Score' 'Ti... | [
[
"pandas.read_csv"
]
] |
shikhar-srivastava/aws-cv-task2vec | [
"b377474328b318f8911068a4d735e07aa9be1342"
] | [
"attribute_vectors_save.py"
] | [
"from task2vec import Task2Vec\nfrom models import get_model\nimport datasets\nimport task_similarity\nimport argparse\nimport torch\nimport torch.nn.functional as F\nimport torchvision.transforms as tt\nfrom tqdm import tqdm\n\nfrom synbols_utils import Synbols\n\ndef _similarity_matrix(attrs, epsilon = 1e-8):\n ... | [
[
"torch.mul",
"torch.bmm",
"torch.ones",
"torch.mm",
"torch.tensor",
"torch.div"
]
] |
catherine-martlin/ExoCTK | [
"51c7808209cfb205b1b2eb23e0b619a7c61838c6"
] | [
"exoctk/exoctk_app/app_exoctk.py"
] | [
"import datetime\nfrom functools import wraps\nimport os\nimport json\nfrom pkg_resources import resource_filename\n\nimport astropy.constants as constants\nfrom astropy.coordinates import SkyCoord\nfrom astropy.extern.six.moves import StringIO\nimport astropy.table as at\nimport astropy.units as u\nfrom bokeh.reso... | [
[
"numpy.array",
"numpy.isnan",
"numpy.unique"
]
] |
cprogrammer1994/glnext | [
"6f510ae0b4dcb0556f859c703b788964611ef47a"
] | [
"tests/test_transform.py"
] | [
"from glnext_compiler import glsl\nimport pytest\nimport numpy as np\n\n\ndef test_transform_input_output(instance):\n task = instance.task()\n transfrom = task.compute(\n compute_count=8,\n compute_shader=glsl('''\n #version 450\n #pragma shader_stage(compute)\n\n ... | [
[
"numpy.testing.assert_array_almost_equal",
"numpy.array"
]
] |
iaindillingham/property-prices | [
"0109c3b130afc7da367306c5430dcfff3e4e0c8e"
] | [
"src/data/make_aggregated_price_paid_data.py"
] | [
"\"\"\"Aggregates processed Land Registry Price Paid Data.\n\nFilters standard entries (category type A), groups by property type and\nadministrative district, and computes the median price.\n\"\"\"\nimport numpy\nimport pandas\n\nfrom src import PROCESSED_DIR\n\nPROCESSED_PP_DIR = PROCESSED_DIR / \"price_paid_data... | [
[
"pandas.read_feather"
]
] |
SamProell/bcg-hr-dl | [
"24b80fd92b93f25aba6dc02d2e4a20330feb1d87"
] | [
"models/rnn_gru.py"
] | [
"\"\"\"Recurrent architecture used for heart rate estimation from\nballistocardiographic signals.\n\nThe RNN features 3 layers with gated recurrent units (GRUs) to obtain a\nsingle output value for an arbitrary lenght input stream.\n\n`create` returns the compiled keras model implementation obtained with\n`get`. B... | [
[
"tensorflow.keras.layers.CuDNNGRU",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.CuDNNLSTM",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense"
]
] |
platybrowser/mobie-python | [
"43341cd92742016a3a0d602325bb93b94c3b4c36"
] | [
"test/htm/test_grid_views.py"
] | [
"import os\nimport multiprocessing\nimport unittest\nfrom shutil import rmtree\n\nimport h5py\nimport numpy as np\nfrom mobie.htm import add_images\nfrom mobie.metadata import read_dataset_metadata\nfrom mobie.validation import validate_view_metadata\n\n\nclass TestGridViews(unittest.TestCase):\n test_folder = \... | [
[
"numpy.random.randint"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.