repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
Navid-github/LAMP_benchmark | [
"bd0bea7c9d50b4be271f0a2301add073ca8105f5",
"bd0bea7c9d50b4be271f0a2301add073ca8105f5"
] | [
"python/tensorflow/exp04_update_of_c.py",
"python/numpy/exp01_gemm.py"
] | [
"import logging\nfrom benchmarker import benchmark\nimport tensorflow as tf\n\nlogger = logging.getLogger('exp04_update_of_c')\n\n\n@benchmark\ndef add(A, B):\n B = A + B\n return B\n\n\n@benchmark\ndef scal(A):\n A = 3.0 * A\n return A\n\n\n# from exp01_gemm\n\n@benchmark\ndef gemm_implicit(A, B, C):\n... | [
[
"tensorflow.transpose",
"tensorflow.linalg.band_part",
"tensorflow.debugging.assert_near",
"tensorflow.random.normal"
],
[
"numpy.random.randn"
]
] |
tjtum-chenlab/2DLiDAR-VehicleDetection | [
"bd195458d227e2f3044e601903c0c87381d5184e"
] | [
"src/Hybrid ResNet Lite/src/test_pre.py"
] | [
"import os\nimport torch\nimport numpy as np\n\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader\n\nfrom Dataset import VehcileDataset\nfrom network import VehicleDetection\nfrom tqdm import tqdm \n\nimport argparse\n\ndevice = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n\npars... | [
[
"numpy.diag",
"torch.sigmoid",
"torch.mm",
"torch.Tensor",
"torch.load",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.cuda.is_available",
"torch.clamp",
"torch.atan2"
]
] |
caoyulong/CDRTR | [
"f61cf84c096a124066af90f6536d85be630ecdff"
] | [
"CDRTR/core/DeepModel/SentiRec/__init__.py"
] | [
"import os\nfrom collections import namedtuple\n\nfrom ..basic import cnn_text\nfrom ..basic import factorization_machine\nfrom ..basic import embedding_layer, embedding_lookup\nfrom CDRTR.utils import pkdump\n\nimport tensorflow as tf\n\nbatchConfig = namedtuple(\"batchConfig\", [\"sentc_ipt\", \"rating\"])\n\n\nc... | [
[
"tensorflow.pow",
"tensorflow.expand_dims",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.summary.merge_all",
"tensorflow.train.AdamOptimizer",
"tensorflow.square",
"tensorflow.sqrt",
"tensorflow.summary.scalar",
"tensorflow.abs"
]
] |
Eric89GXL/nitime | [
"34adc1ddd6b93255764160057c1ea653426b36b8",
"34adc1ddd6b93255764160057c1ea653426b36b8"
] | [
"nitime/analysis/tests/test_coherence.py",
"nitime/utils.py"
] | [
"import warnings\n\nimport numpy as np\nimport numpy.testing as npt\nimport matplotlib\nimport matplotlib.mlab as mlab\n\nimport nitime.timeseries as ts\nimport nitime.analysis as nta\n\nimport platform\n\n# Some tests might require python version 2.5 or above: \nif float(platform.python_version()[:3]) < 2.5:\n ... | [
[
"numpy.testing.assert_equal",
"numpy.testing.dec.skipif",
"numpy.abs",
"numpy.arange",
"numpy.sin",
"numpy.testing.assert_almost_equal",
"numpy.testing.assert_raises",
"numpy.random.rand",
"numpy.vstack"
],
[
"numpy.rollaxis",
"numpy.dot",
"numpy.product",
"... |
zacker150/text | [
"742e1d3eced47905bc73271b6f4a42a6489be58c"
] | [
"test/experimental/test_vectors.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\nimport platform\nimport torch\nimport unittest\nfrom test.common.torchtext_test_case import TorchtextTestCase\nfrom torchtext.experimental.vectors import (\n build_vectors,\n)\n\n\nclass TestVectors(TorchtextTestCase):\n def tearDown(self):\n super().tearDown()\n ... | [
[
"torch.empty",
"torch.load",
"torch.tensor",
"torch.jit._recursive.ConcreteTypeStore",
"torch.stack",
"torch._C._jit_clear_class_registry",
"torch.save"
]
] |
anhvth/Pseudo_Lidar_V2 | [
"d7a29ffc811e315df25bba2a43acf288d4ceb30e"
] | [
"waymo_kitti_converter/tools/kitti_crop_car.py"
] | [
"import numpy as np\nfrom multiprocessing import Pool\nfrom os.path import join, basename, splitext\nfrom glob import glob\nfrom tqdm import tqdm\n\npoint_cloud_load_dir = 'test_point_cloud'\nlabel_load_dir = 'test_label'\ncalib_load_dir = 'test_calib'\ncropped_point_cloud_save_dir = 'test_crop_car'\nnum_proc = 8\n... | [
[
"numpy.fromfile",
"numpy.linalg.inv",
"numpy.cos",
"numpy.ones",
"numpy.sin",
"numpy.transpose",
"numpy.array"
]
] |
beckrob/AvERA_ISW | [
"2eb3fe6d0346513e1b50bbfdbfa1714c6353a35d"
] | [
"runner_map.py"
] | [
"import numpy as np\nimport sys\nfrom scipy import integrate\n\nsims=['BR','LCDM']\n\nstartPointNum = 3 \n\nsimulationTypes = 3\n\n\npairings=[]\n\nfor i in range(len(sims)):\n \n for j in range(startPointNum):\n \n for k in [2]:#range(simulationTypes):\n \n pairings.append([sims[i],j,... | [
[
"numpy.sum"
]
] |
JunlinHan/BID | [
"c509fa64b3dec082737567936d34a856015386c8"
] | [
"options/base_options.py"
] | [
"import argparse\nimport os\nfrom util import util\nimport torch\nimport models\nimport data\n\n\nclass BaseOptions():\n \"\"\"This class defines options used during both training and test time.\n\n It also implements several helper functions such as parsing, printing, and saving the options.\n It also gat... | [
[
"torch.cuda.set_device"
]
] |
lei-lab1/JointBERT | [
"eb2e7f3c15329bdbabb3d8bf87b315a5f4fbd037"
] | [
"model/modeling_jointdistilbert.py"
] | [
"import torch\nimport torch.nn as nn\nfrom transformers.modeling_distilbert import DistilBertPreTrainedModel, DistilBertModel, DistilBertConfig\nfrom torchcrf import CRF\nfrom .module import IntentClassifier, SlotClassifier\n\n\nclass JointDistilBERT(DistilBertPreTrainedModel):\n def __init__(self, config, args,... | [
[
"torch.nn.CrossEntropyLoss",
"torch.nn.MSELoss"
]
] |
sainathadapa/custom-feed-from-reddit | [
"56441ac834861ec0b1fc82f4fdf740caf1d049dd"
] | [
"generate_feed.py"
] | [
"import json\nimport praw # to connect to reddit\nfrom feedgen.feed import FeedGenerator # to generate the feed\nfrom hackernews import HackerNews # to get entries from hackernews\nimport feedparser # to parse feeds\nimport numpy as np\nimport pandas as pd\nf... | [
[
"pandas.read_pickle",
"numpy.setdiff1d"
]
] |
guilherme9820/StaticAttitudeDetermination | [
"f6e380b95476054672e775beef134cb53af4706d"
] | [
"tests/plot_test_scenarios.py"
] | [
"import numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nsns.set()\npaper_rc = {'lines.markersize': 15}\n# sns.set_context(\"paper\", rc=paper_rc)\nsns.set(style='ticks', context='talk', rc=paper_rc)\nplt.rcParams['font.family'] = 'serif'\nplt.rcParams['font.weight'] = 'no... | [
[
"matplotlib.pyplot.tight_layout",
"pandas.read_csv",
"matplotlib.pyplot.show",
"numpy.where",
"matplotlib.pyplot.figure"
]
] |
grantcooksey/pandas | [
"b4375bde87afdc037056ff90e4f93b606c76e140"
] | [
"pandas/tests/indexes/timedeltas/test_ops.py"
] | [
"import pytest\n\nimport numpy as np\nfrom datetime import timedelta\n\nimport pandas as pd\nimport pandas.util.testing as tm\nfrom pandas import to_timedelta\nfrom pandas import (Series, Timedelta, Timestamp, TimedeltaIndex,\n timedelta_range,\n _np_version_under1p10, Index)\n... | [
[
"pandas.Series",
"numpy.asarray",
"numpy.max",
"pandas.util.testing.assert_index_equal",
"numpy.argmin",
"pandas.util.testing.assert_numpy_array_equal",
"numpy.arange",
"pandas.Index",
"pandas.util.testing.assert_series_equal",
"numpy.argmax",
"numpy.repeat",
"numpy... |
sblisesivdin/gpaw-tools | [
"671ce999afa9844f13ed5695f17b062bb81e346b"
] | [
"examples/Bulk-Al-noCIF/bulk_aluminum.py"
] | [
"from ase import Atoms\nimport numpy as np\n\nOutdirname = 'bulk-aluminum-results'\n\nbulk_configuration = Atoms('Al',\n cell=[[0, 2.025, 2.025],\n [2.025, 0, 2.025],\n [2.025, 2.025, 0]],\n pb... | [
[
"numpy.array"
]
] |
midvalestudent/dsearch | [
"cb3fbf7182207c6f7f654e9013922c1da8d3d9b7"
] | [
"dsearch/hasher.py"
] | [
"''' main hashing functions\n'''\nimport string\nfrom collections import defaultdict\n\nimport numpy as np\n\n\ndef symbol_encode(n, symbols):\n nb_symbols = len(symbols)\n \n if n < nb_symbols:\n return symbols[n]\n \n retval = ''\n while n > 0:\n n, k = divmod(n, nb_symbols)\n ... | [
[
"numpy.log",
"numpy.sqrt",
"numpy.multiply",
"numpy.linalg.norm",
"numpy.flatnonzero",
"numpy.random.RandomState"
]
] |
liangqianqian123/FPCNN | [
"97736c15527d40b7050f6cb975732476ba618423"
] | [
"base_options.py"
] | [
"import argparse\nimport os\nfrom util import util\nimport torch\n\n\nclass BaseOptions:\n def __init__(self):\n self.parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n self.initialized = False\n\n def initialize(self):\n # data params\n self... | [
[
"torch.manual_seed",
"numpy.random.seed",
"torch.cuda.set_device"
]
] |
ryanbrand/GANTextToImage | [
"2f01b26d31b56b258e29ba5207156adc44903931"
] | [
"gan/custom_model.py"
] | [
"\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nfrom miscc.config import cfg\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nfrom torchvision import models\nimport torch.utils.model_zoo as model_zoo\n\n\n# Class for computation of inception score\nclass INCEPTION_V3(nn.Modul... | [
[
"torch.nn.Sequential",
"torch.nn.Softmax",
"torch.nn.BatchNorm1d",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.Tanh",
"torch.nn.Sigmoid",
"torch.nn.Linear",
"torch.nn.functional.sigmoid",
"torch.nn.Upsample",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.ut... |
znwilkins/cougar | [
"0f5b6f8b763e63d4892f5b77871cc4c924b813fc"
] | [
"src/score.py"
] | [
"\n##############################################################################################################\n# #\n# File: score.py ... | [
[
"pandas.concat",
"pandas.read_csv",
"pandas.merge",
"pandas.Series",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"sklearn.metrics.precision_recall_fscore_support",
"matplotlib.pyplot.close",
"sklearn.metrics.f... |
hahahahaman/geometric_spanners | [
"7793372ed771e0d2da3af17523fb58346589b100"
] | [
"load_graph.py"
] | [
"import networkx as nx\nimport matplotlib.pyplot as plt\nimport math, pickle, random\n\nfilename = 'graphs.data'\ngraphs = []\nwith open(filename, \"rb\") as f:\n graphs = pickle.load(f)\n\nmax_stretch = 0\nmin_stretch = 1000000000\nmin_index = 0\nmax_index = 0\nfor i in range(len(graphs)):\n g = graphs[i]\n ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure"
]
] |
preethamam/DGR-FCGF-3D-PointCloud-ChangeDetection | [
"8272b0bc73ff555d422d7eff33f6166573fe813c"
] | [
"fcgf.py"
] | [
"# Copyright (c) Chris Choy (chrischoy@ai.stanford.edu) and Wei Dong (weidong@andrew.cmu.edu)\n#\n# Please cite the following papers if you use any part of the code.\n# - Christopher Choy, Wei Dong, Vladlen Koltun, Deep Global Registration, CVPR 2020\n# - Christopher Choy, Jaesik Park, Vladlen Koltun, Fully Convolu... | [
[
"numpy.savetxt"
]
] |
ascust/WSSCoseg | [
"7965d48e073cb7db58199d00b6ceaae49d003a42"
] | [
"cores/symbols/net_symbols.py"
] | [
"import mxnet as mx\nimport numpy as np\n\n\ndef _attr_scope_lr(lr_type, lr_owner):\n assert lr_type in ('alex', 'alex10', 'torch', 'psp', 'mxnet')\n # weight (lr_mult, wd_mult); bias;\n # 1, 1; 2, 0;\n if lr_type == 'alex':\n if lr_owner == 'weight':\n return mx.AttrScope()\n e... | [
[
"numpy.ceil"
]
] |
collector-m/overlap_localization | [
"df03a8f27408f33d07010774de3b11b0d272e065"
] | [
"src/fast_infer.py"
] | [
"#!/usr/bin/env python3\n# Developed by Xieyuanli Chen and Thomas Läbe\n# This file is covered by the LICENSE file in the root of this project.\n# Brief: This script contains the fast inferring class which is used for online overlap and yaw estimations.\n\nimport os\nimport sys\nimport numpy as np\n\nfrom FeatureVo... | [
[
"numpy.ones",
"numpy.savez_compressed",
"numpy.load",
"numpy.array",
"numpy.zeros"
]
] |
sylejroy/apex-analysis-tool | [
"452f980716c16e014e2d9d46bb723e969f2ec0b9"
] | [
"kalman_filter.py"
] | [
"import numpy as np\n\n\nclass KalmanFilter(object):\n def __init__(self, dt, u_x,u_y, std_acc, x_std_meas, y_std_meas):\n \"\"\"\n :param dt: sampling time (time for 1 cycle)\n :param u_x: acceleration in x-direction\n :param u_y: acceleration in y-direction\n :param std_acc: ... | [
[
"numpy.matrix",
"numpy.dot",
"numpy.eye",
"numpy.linalg.inv"
]
] |
pioy/dgl | [
"bc2fff15910f4bad8d533b47ad7ba4956cd28cfb"
] | [
"python/dgl/nn/pytorch/conv/graphconv.py"
] | [
"\"\"\"Torch modules for graph convolutions(GCN).\"\"\"\n# pylint: disable= no-member, arguments-differ, invalid-name\nimport torch as th\nfrom torch import nn\nfrom torch.nn import init\n\nfrom .... import function as fn\nfrom ....base import DGLError\n\n# pylint: disable=W0235\nclass GraphConv(nn.Module):\n r\... | [
[
"torch.Tensor",
"torch.reshape",
"torch.matmul",
"torch.nn.init.xavier_uniform_",
"torch.nn.init.zeros_",
"torch.pow"
]
] |
jeammimi/ipyvolume | [
"2828f934e30d05a5552e2dfc94663393ba1311f3"
] | [
"ipyvolume/serialize.py"
] | [
"import logging\nimport numpy as np\nimport math\nlogger = logging.getLogger(\"ipyvolume\")\nfrom io import BytesIO as StringIO\nfrom base64 import b64encode\nimport warnings\n\n\ndef cube_to_png(grid, vmin, vmax, file):\n\timage_width = 2048\n\tslices = grid.shape[0]\n\tcolumns = image_width // grid.shape[2]\n\tro... | [
[
"numpy.nanmax",
"numpy.sqrt",
"numpy.isfinite",
"numpy.gradient",
"numpy.clip",
"numpy.nanmin",
"numpy.log10",
"numpy.load",
"numpy.array",
"numpy.zeros"
]
] |
phiweger/picotext | [
"d3bb1053f18552835fa7eb15b72f8f9489cb278a",
"d3bb1053f18552835fa7eb15b72f8f9489cb278a",
"d3bb1053f18552835fa7eb15b72f8f9489cb278a"
] | [
"picotext/scripts/preprocess.py",
"picotext/models/RNN_LM_deprecated/main.py",
"picotext/models/RNN_LM_deprecated/model.py"
] | [
"#! /usr/bin/env python\n\n'''\nThis script takes a file of protein sequences in fasta/q format, subsamples them if needed, filters out sequences that are very long or contain noncanonical amino-acid symbols and encodes them to the Dayhoff alphabet. You're welcome.\n\n> We removed proteins longer than 2,000 amino a... | [
[
"numpy.random.uniform"
],
[
"torch.nn.NLLLoss",
"torch.load",
"torch.multinomial",
"torch.no_grad",
"torch.save"
],
[
"torch.nn.Dropout",
"torch.nn.functional.log_softmax",
"torch.nn.RNN",
"torch.nn.Embedding",
"torch.nn.Linear"
]
] |
srimani-programmer/Opencv-with-Python-Blueprints-second-Edition | [
"8762022a58a379229f02d7250d8344087d98516d"
] | [
"chapter3/feature_matching.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"A module containing an algorithm for feature matching\"\"\"\n\nimport numpy as np\nimport cv2\nfrom typing import Tuple, Optional, List, Sequence\nPoint = Tuple[float, float]\n\n__author__ = \"Michael Beyeler\"\n__license__ = \"GNU GPL 3.0 or later\"\n\n__rev... | [
[
"numpy.linalg.norm",
"numpy.prod",
"numpy.array",
"numpy.zeros",
"numpy.roll"
]
] |
nce11/deepcover | [
"129488e3593f8d69e352be1e613f44480e4033e6"
] | [
"exps/exp5-3/DVC/exp-dvc.py"
] | [
"import sys\nsys.path.insert(0, '../../../src/')\nimport random\nimport numpy as np\nimport json\nimport os\nfrom datetime import datetime\n\nfrom util import *\nfrom nnett import *\nfrom lp import *\n\n\ndef dvc_pair(nnet, I, J, test_data, di):\n\n index=-1\n tot=len(test_data[0].eval())\n\n ordering=list(range... | [
[
"numpy.random.shuffle"
]
] |
yiyang186/autostatest | [
"7c6160a752d769e1d2b527196d1eca3456e55b3a",
"7c6160a752d769e1d2b527196d1eca3456e55b3a"
] | [
"test/all_test.py",
"discrete.py"
] | [
"# pytest path_to_test.py\r\nimport os,sys\r\nparentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\r\nsys.path.insert(0,parentdir)\r\n\r\nimport numpy as np\r\nimport continuous\r\nimport discrete\r\nimport discriminate\r\nimport utils\r\nimport base\r\n\r\n# xtab = np.array([\r\n# [1021, 805... | [
[
"numpy.array",
"numpy.allclose",
"numpy.isclose"
],
[
"numpy.abs",
"numpy.arange",
"pandas.DataFrame",
"scipy.stats.fisher_exact",
"numpy.array",
"scipy.stats.chi2.sf"
]
] |
Tom556/structural-probes | [
"633a57ef0eea665857c0e21bdbcfdc6a7d50adf7"
] | [
"structural-probes/probe.py"
] | [
"\"\"\"Classes for specifying probe pytorch modules.\"\"\"\n\nimport torch.nn as nn\nimport torch\n\nclass Probe(nn.Module):\n pass\n\nclass TwoWordPSDProbe(Probe):\n \"\"\" Computes squared L2 distance after projection by a matrix.\n\n For a batch of sentences, computes all n^2 pairs of distances\n for each se... | [
[
"torch.matmul",
"torch.nn.init.uniform_",
"torch.sum",
"torch.zeros"
]
] |
Xoreus/neuroptica | [
"2ab6771ea3cfe94a62701078a83712d2a33409e3"
] | [
"neuroptica/component_layers.py"
] | [
"'''The componet_layers submodule contains functionality for assembling optical components on a simulated chip and\ncomputing their transfer operations. A ComponentLayer represents a physical \"column\" of optical components which\nacts on an input in parallel. ComponentLayers can be assembled into an OpticalMesh o... | [
[
"numpy.dot",
"numpy.imag",
"numpy.unique",
"numpy.arange",
"numpy.eye",
"numpy.ones",
"numpy.copy",
"numpy.log10",
"numpy.array",
"numpy.zeros",
"numpy.vstack"
]
] |
donghaiwang/Reinforcement-learning-with-tensorflow | [
"46cae1464bcdfcd757a761a1cfd450d28dd89513"
] | [
"contents/11_Dyna_Q/RL_brain.py"
] | [
"\"\"\"\nThis part of code is the Dyna-Q learning brain, which is a brain of the agent.\nAll decisions and learning processes are made in here.\n\nView more on my tutorial page: https://morvanzhou.github.io/tutorials/\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\n\n\nclass QLearningTable:\n def __init__(se... | [
[
"numpy.random.uniform",
"numpy.random.permutation",
"pandas.DataFrame",
"numpy.random.choice"
]
] |
pescap/bempp-cl | [
"3a68666e8db0e873d418b734289067483f68f12e",
"3a68666e8db0e873d418b734289067483f68f12e"
] | [
"bempp/api/assembly/blocked_operator.py",
"bempp/api/fmm/helpers.py"
] | [
"\"\"\"Definition of blocked operator structures.\"\"\"\r\n\r\nimport numpy as _np\r\nfrom bempp.api.assembly.discrete_boundary_operator import _DiscreteOperatorBase\r\n\r\n\r\ndef _sum(op1, op2):\r\n \"\"\"Sum of two operators, allowing for one of them to be None.\"\"\"\r\n if op1 is None:\r\n return ... | [
[
"numpy.hstack",
"numpy.imag",
"numpy.vstack",
"numpy.promote_types",
"numpy.dtype",
"numpy.ones",
"numpy.block",
"numpy.real",
"numpy.isscalar",
"numpy.iscomplexobj",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.empty"
],
[
"numpy.expand_dims",
... |
RoderickGu/TorchFly | [
"a60bec4cceb4f43357ba4e1c25fb64b7b7b42bd5"
] | [
"torchfly/text/model/bidaf_model.py"
] | [
"import torch\nimport torch.nn as nn\n\nfrom .models import CharCNN\n\nclass TextEmbedder(nn.Module):\n def __init__(self):\n super(TextEmbedder, self).__init__()\n self.word_embed = nn.Embedding(97914, 100, padding_idx=0)\n self.char_embed = CharCNN()\n \n def forward(self, word, ... | [
[
"torch.nn.Embedding",
"torch.cat"
]
] |
GwenStacey/github-commit-analysis-ds | [
"682e9ce8d5e4a2a37af2de962291f101707e6f26"
] | [
"api/utils.py"
] | [
"'''Borrowed utils file from Elisabeth Shah'''\nfrom datetime import datetime\nfrom decouple import config\nimport pandas as pd\nimport os\nimport requests\nimport nltk\nfrom nltk.stem import WordNetLemmatizer\nfrom nltk.sentiment.vader import SentimentIntensityAnalyzer\nfrom api.models import DB, Repo\nfrom api.qu... | [
[
"pandas.DataFrame.from_records",
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
wonderseen/PCKMT | [
"d81142405076a4d322985936316cfff9d2460273"
] | [
"codes/fairseq/models/transformer_knn_projection.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 math\nfrom os import remove\nfrom typing import Any, Dict, List, Optional, Tuple\nimport time\n\nfrom tqdm import tqdm\nimpor... | [
[
"numpy.diag",
"numpy.dot",
"torch.nn.Softmax",
"torch.max",
"torch.cat",
"torch.zeros",
"torch.nn.Embedding",
"sklearn.cluster.DBSCAN",
"torch.FloatTensor",
"torch.no_grad",
"torch.cuda.is_available",
"torch.topk",
"torch.nn.Dropout",
"numpy.arange",
"to... |
gosiqueira/cs330-assignments | [
"54b973db23a11d5a6253eb525897103a02cee1ba"
] | [
"hw1/load_data.py"
] | [
"import numpy as np\nimport os\nimport random\nfrom imageio import imread\nfrom sklearn.utils import shuffle\nfrom pprint import pprint\n\n\ndef get_images(paths, labels, nb_samples=None, shuffle=True):\n\t\"\"\"\n\tTakes a set of character folders and labels and returns paths to image files\n\tpaired with labels.\... | [
[
"numpy.swapaxes",
"numpy.reshape",
"numpy.eye",
"numpy.stack",
"numpy.random.shuffle",
"numpy.concatenate",
"numpy.prod",
"numpy.array"
]
] |
cubonacci/mixed-anomaly | [
"b4cfa5bbae8429585214b1d2dfeac864d49a3158"
] | [
"anomaly/isolation/column_selection.py"
] | [
"from typing import List\n\nimport pandas as pd\nimport numpy as np\n\n\ndef random_selector(diverse_columns: List[str], data: pd.DataFrame):\n return np.random.choice(diverse_columns)\n"
] | [
[
"numpy.random.choice"
]
] |
ShabadVaswani/responsible-ai-widgets | [
"fdf5ac3a869fdeef24bb4964f3b0ee8111f26fec"
] | [
"responsibleai/responsibleai/modelanalysis/model_analysis.py"
] | [
"# Copyright (c) Microsoft Corporation\n# Licensed under the MIT License.\n\n\"\"\"Defines the ModelAnalysis class.\"\"\"\n\nimport json\nimport numpy as np\nimport pandas as pd\nfrom pathlib import Path\nimport pickle\nimport warnings\n\n\nfrom responsibleai._input_processing import _convert_to_list\nfrom responsi... | [
[
"numpy.shape",
"pandas.read_json"
]
] |
Ping-C/certifiedpatchdefense | [
"f1dbb7e399c320413c17e1412d2fb0ee0d6c812a"
] | [
"config.py"
] | [
"## Copyright (C) 2019, Huan Zhang <huan@huan-zhang.com>\n## Hongge Chen <chenhg@mit.edu>\n## Chaowei Xiao <xiaocw@umich.edu>\n## \n## This program is licenced under the BSD 2-Clause License,\n## contained in the LICENCE file in this directory.\n##\nimport os\nimport json\nim... | [
[
"torch.zeros",
"torch.load"
]
] |
rouseguy/cricket-analytics | [
"6b87ef83aab327ea9d08ee683cbcbff29390acf4"
] | [
"src/ipl_stats/teamutils.py"
] | [
"import streamlit as st\nfrom streamlit_folium import folium_static\nimport folium\nimport altair as alt\nimport numpy as np\nimport pandas as pd\nimport os\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom matplotlib.cm import hot, viridis, Blues, plasma, magma, Greens\nimport plotly.express as px\nsns... | [
[
"matplotlib.pyplot.figure",
"pandas.read_csv",
"numpy.unique"
]
] |
AllenCellModeling/napari | [
"3566383e6310d02e8673b564b6f63411fa176708"
] | [
"image_loader.py"
] | [
"import numpy as np\nfrom skimage.io import imread, imsave\nimport os\n\nfrom vispy.color import Colormap\nimport aicsimageio\n\nfrom napari import ViewerApp\nfrom napari.util import app_context\nimport napari.layers._labels_layer._constants as layer_constants\n\n\ndef get_default_range(image, mode):\n\n if mode... | [
[
"numpy.zeros",
"numpy.percentile"
]
] |
sahasuman343/Facial-Expression-recognizer | [
"40cdf6cca90ea96a3e0a1648e81a49a3dad4c7ae"
] | [
"facial_expression.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri May 22 13:25:19 2020\r\n\r\n@author: Suman\r\n\"\"\"\r\n# Importing the libraries\r\nimport tensorflow as tf\r\nfrom tensorflow import keras\r\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator,load_img,img_to_array\r\nfrom tensorflow.keras.laye... | [
[
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.BatchNormal... |
thusser/boltwood | [
"08ef5acd6fdebf8046be159f70b6078d3b51dc26"
] | [
"boltwood/report.py"
] | [
"from __future__ import annotations\n\nfrom typing import List\n\nimport numpy as np\nfrom datetime import datetime\nimport logging\n\nfrom . import api\n\n\nclass Report:\n \"\"\"A report from the Boltwood II sensor.\"\"\"\n\n def __init__(self, raw_data: bytearray = None, content: str = None, columns: list ... | [
[
"numpy.mean"
]
] |
srinidhiPY/ICCV-CDPATH2021-ID-8 | [
"79ee3dfe3deed409a005513974df79b90ab1e0da"
] | [
"Slide_Level_Analysis/Plot_rocs.py"
] | [
"\"\"\" Generate ROC curve's for each % of training data \"\"\"\n\nimport os\nimport glob\nimport re\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import roc_curve, auc\n\n## Path to ROC dir\nROC_DIR = '/home/srinidhi/Research/Code/camelyon16/ROC/1.0/'\n\nroc_paths = []\nfor file_ext in... | [
[
"matplotlib.pyplot.legend",
"sklearn.metrics.auc",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.figure",
"numpy.load",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.... |
tapomay/libgenetic | [
"4045d1ac056251d95c101d34c9c7549d151a3e7e",
"4045d1ac056251d95c101d34c9c7549d151a3e7e"
] | [
"src_python/bio_ga/libgenetic/libgenetic.py",
"src_python/bio_ga/libgenetic/pwm.py"
] | [
"\n'''\nObject Oriented Class Design for generic Genetic Algorithm library\n\nEntity: String | Object\nEntityIndex: Map<String, int>\n\nstates: List<String>\ncardinality = len(states)\n\nT: Array<bool|int>\nSolution: <T>\nPopulation -> List<Solution>, M:int, N:int\nmatingPool: Population\n\nGeneration -> Population... | [
[
"numpy.argmax"
],
[
"numpy.log2"
]
] |
nlaanait/namsa | [
"55f82ecf1c82601fcb81815d5e60705506c01e1e"
] | [
"namsa/utils.py"
] | [
"import json\nimport os\nfrom .optics import *\nimport numpy as np\n\n\ndef make_label_sim_json(structure, space_group, unit_cell, supercell_size, output_name, direc, num_uc=2,\n probe_sampling=8):\n \"\"\"\n Make label with space and (fractional) chemical composition.\n \"\"\"\n\n ... | [
[
"numpy.fft.fft2",
"numpy.dot",
"numpy.pad",
"numpy.sqrt",
"numpy.unique",
"numpy.round",
"numpy.cross",
"numpy.array",
"numpy.where"
]
] |
longhuang318/Monocular-Obstacle-Avoidance | [
"9b38572de613820742e238f0bda16a0ce59c93aa"
] | [
"D3QN/GazeboWorld.py"
] | [
"import rospy\nimport math\nimport time\nimport numpy as np\nimport cv2\nimport copy\nimport tf\nimport random\n\nfrom geometry_msgs.msg import Twist\nfrom geometry_msgs.msg import Quaternion\nfrom gazebo_msgs.msg import ModelStates\nfrom gazebo_msgs.msg import ModelState\nfrom sensor_msgs.msg import Image\nfrom cv... | [
[
"numpy.sqrt",
"numpy.isnan",
"numpy.amin",
"numpy.cos",
"numpy.random.uniform",
"numpy.array"
]
] |
trngb/watools | [
"57b9074d59d856886675aa26014bfd6673d5da76",
"57b9074d59d856886675aa26014bfd6673d5da76",
"57b9074d59d856886675aa26014bfd6673d5da76"
] | [
"Sheets/sheet2.py",
"Sheets/sheet1.py",
"Generator/Sheet2/CSV.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nAuthors: Gonzalo Espinoza\n UNESCO-IHE 2016\nContact: g.espinoza@unesco-ihe.org\nRepository: https://github.com/wateraccounting/wa\nModule: Sheets/sheet2\n\"\"\"\n\nimport os\nimport pandas as pd\nimport subprocess\nimport time\nimport xml.etree.ElementTree as ET\n\n\ndef c... | [
[
"pandas.read_csv"
],
[
"pandas.read_csv"
],
[
"numpy.einsum",
"numpy.unique",
"numpy.logical_or.reduce",
"numpy.nansum",
"numpy.shape",
"numpy.any",
"pandas.date_range",
"numpy.sum"
]
] |
recski/semantic_parsing_szte_bme | [
"b775614ac33882a09c0cce94bb40bbd8744df336"
] | [
"machine_comprehension_baselines/Peter/feature_extractor.py"
] | [
"from sklearn.feature_extraction.text import CountVectorizer\nfrom nltk.tokenize import sent_tokenize\nfrom xml.etree import ElementTree\nimport numpy as np\nfrom nltk import word_tokenize\nimport math\nimport pickle\n\nimport warnings\n\nwarnings.filterwarnings(action='ignore', category=UserWarning, module='gensim... | [
[
"sklearn.feature_extraction.text.CountVectorizer",
"numpy.subtract"
]
] |
KelvinTao/pointSIFT_Age2 | [
"b0684ee989b5f6f3dca25e9bbf15b3c5fd8cf1cf",
"b0684ee989b5f6f3dca25e9bbf15b3c5fd8cf1cf"
] | [
"train_eval_early/train_eval_3D_age_one_GPU_ageRange_regress_batchBalance_dense.py",
"prepare/prepare_3D_RS_dense_NN_rgb_3.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport numpy as np\nimport random\nimport time\nimport tensorflow as tf\nimport argparse\nimport tf_utils.provider as provider\nimport models.pointSIFT_pointnet_age_dense as AGE_MODEL\n\nparser = argparse.ArgumentParser()\nparser.... | [
[
"tensorflow.device",
"tensorflow.concat",
"numpy.asarray",
"tensorflow.minimum",
"numpy.round",
"tensorflow.summary.scalar",
"numpy.where",
"tensorflow.summary.Summary.Value",
"tensorflow.Graph",
"tensorflow.Variable",
"numpy.arange",
"tensorflow.train.exponential_d... |
juanjo3ns/SalGAN2 | [
"ac52af743b94961cdb44c5d89774b72fc8acfd3e"
] | [
"src/dataloader/datasetDHF1K.py"
] | [
"import os\nimport sys\nimport cv2\n\nimport numpy as np\nfrom IPython import embed\n\nimport matplotlib.pylab as plt\nfrom random import randint\nfrom scipy import ndimage\nfrom utils.sendTelegram import send\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\n# from utils.load_flow import readFlow\nf... | [
[
"numpy.expand_dims",
"numpy.linspace",
"numpy.ascontiguousarray",
"numpy.dstack",
"torch.FloatTensor",
"numpy.empty"
]
] |
Vaaaas/Distant-Supervised-Chinese-Relation-Extraction | [
"560664925d5b5a90c236e1dbf246152c7ca650ec"
] | [
"nrekit/framework.py"
] | [
"import tensorflow as tf\nimport os\nimport sklearn.metrics\nimport numpy as np\nimport sys\nimport time\n\ndef average_gradients(tower_grads):\n \"\"\"Calculate the average gradient for each shared variable across all towers.\n\n Note that this function provides a synchronization point across all towers.\n\n... | [
[
"tensorflow.device",
"tensorflow.concat",
"tensorflow.summary.FileWriter",
"tensorflow.reduce_mean",
"tensorflow.get_collection",
"tensorflow.placeholder",
"tensorflow.expand_dims",
"numpy.concatenate",
"tensorflow.ConfigProto",
"tensorflow.global_variables_initializer",
... |
natke/tensorflow-onnx | [
"af083a2e070d67b7ca47e9babe7ff6938b169176"
] | [
"tf2onnx/custom_opsets/ms.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT license.\n\"\"\" tf2onnx mapping functions for ms domain. \"\"\"\n\nimport numpy as np\n\nfrom onnx import onnx_pb\nfrom onnx.onnx_pb import TensorProto\nfrom tf2onnx import constants, utils\nfrom tf2onnx.handler import tf_op\nfr... | [
[
"numpy.array"
]
] |
yacth/autogoal | [
"a55c1534161e850587e2ca3533aa2fd5ae28569e"
] | [
"autogoal/sampling/__init__.py"
] | [
"import math\nimport random\nimport statistics\nimport pickle\nimport numpy as np\n\nfrom typing import Dict, List, Sequence\nimport abc\n\nfrom autogoal.utils import nice_repr\n\n\nclass Sampler:\n \"\"\"\n Provides methods to obtain random samples with various distributions.\n\n Can receive a `random_sta... | [
[
"numpy.asarray",
"numpy.average"
]
] |
nicehuster/mmdetection-supervisely-person-datasets | [
"ff1b57e16a71378510571dbb9cebfdb712656927"
] | [
"mmdet/datasets/transforms.py"
] | [
"import mmcv\nimport numpy as np\nimport torch\n\n__all__ = ['ImageTransform', 'BboxTransform', 'MaskTransform', 'Numpy2Tensor']\n\n\nclass ImageTransform(object):\n \"\"\"Preprocess an image.\n\n 1. rescale the image to expected size\n 2. normalize the image\n 3. flip the image (if needed)\n 4. pad ... | [
[
"numpy.clip",
"torch.from_numpy",
"numpy.stack",
"numpy.array",
"numpy.zeros"
]
] |
albarji/neurowriter | [
"503c2db17c90adaa29fedfea745d1b4237ec7a74"
] | [
"tests/test_writer.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Aug 12 12:35:18 2017\n\nTests for the Writer module\n\n@author: Álvaro Barbero Jiménez\n\"\"\"\n\nimport numpy as np\n\nfrom neurowriter.writer import Writer\nfrom neurowriter.encoding import Encoder\nfrom neurowriter.tokenizer import CharToke... | [
[
"numpy.array"
]
] |
tversteeg/pygef | [
"fd984526ff5528a4730d69cebb62fb1cbf1b93a9"
] | [
"pygef/gef.py"
] | [
"import pygef.utils as utils\nimport pandas as pd\nimport io\nimport numpy as np\nimport pygef.plot_utils as plot\nfrom pygef import robertson, been_jefferies\nimport logging\nfrom pygef.grouping import GroupClassification\n\nlogger = logging.getLogger(__name__)\n\n\nMAP_QUANTITY_NUMBER_COLUMN_NAME_CPT = {\n 1: ... | [
[
"numpy.abs",
"numpy.subtract",
"numpy.cumsum",
"numpy.diff",
"numpy.array",
"numpy.zeros",
"numpy.isclose"
]
] |
dhicks6345789/data-tools | [
"fd664d4faf3639f306f280758a363aeee18c74bb",
"fd664d4faf3639f306f280758a363aeee18c74bb"
] | [
"generateEducationPerfectXLSX.py",
"generateCPOMSXLSX.py"
] | [
"#!/usr/bin/python\nimport os\nimport sys\nimport csv\nimport json\nimport pandas\nimport dataLib\n\nvalidYeargroups = [\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\"]\n\ndef formToYearGroup(theForm):\n\tfor validYeargroup in validYeargroups:\n\t\tif validYeargroup in theForm:\n\t\t\treturn validYeargroup.replace(\"Re... | [
[
"pandas.read_excel",
"pandas.read_csv",
"pandas.DataFrame"
],
[
"pandas.read_excel",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
jdtibochab/bacillusme | [
"d7eea04ca8a8a72731f35127142a6cb05ad05754"
] | [
"build/lib/ecolime/characterization/biomass_allocation.py"
] | [
"from collections import defaultdict\nimport pandas as pd\nfrom sympy import Basic, Symbol\nfrom os.path import dirname, join, abspath\n\nimport cobra.test\nfrom cobrame.util import dogma\n\necoli_data_files_dir = dirname(abspath(__file__))\n\ndel dirname, abspath\n\n\ndef fixpath(filename):\n return join(ecoli_... | [
[
"pandas.DataFrame.from_dict"
]
] |
IBM/sail | [
"bae3643051604974c9b4130f4ea332012ecf9093"
] | [
"sail/models/ensemble/distEWARegressor.py"
] | [
"import math\nimport typing\nfrom river import base\nfrom river import optim\nfrom .base import BaseAggregator\nfrom river.compat import convert_river_to_sklearn\nimport ray\nimport numpy as np\n\n\n@ray.remote\ndef _incremental_learn(estimator, X, length, y_pred_mean, weight, y, learning_rate):\n # X = ray.get(... | [
[
"numpy.average",
"numpy.sum"
]
] |
BoxFishLab/Pandora.Wiki | [
"d6bb80b740493a52e7e75729b36b487c91d173f6"
] | [
"Unuse/NeuralNetwork.py"
] | [
"#!usr/bin/env python\n#-*- coding:utf-8 -*-\n\n'''\n神经网络练习demo\n'''\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import animation\nimport json\n\n#激活函数类\nclass Activate(object):\n\t#Sigmoid函数\n\tdef Sigmoid(self,x):\n\t\treturn 1/(1+np.exp(-x))\n\t#Sigmoid求导函数\n\tdef DSigmoid(self,x):\n\t\... | [
[
"numpy.dot",
"numpy.log",
"numpy.abs",
"numpy.sqrt",
"matplotlib.pyplot.show",
"numpy.random.shuffle",
"numpy.linalg.norm",
"numpy.max",
"numpy.argmax",
"numpy.random.randn",
"numpy.exp",
"numpy.mat",
"numpy.where",
"numpy.zeros",
"matplotlib.pyplot.figu... |
NikIshmametev/dlcourse_ai | [
"9b2233bd2befc54b17f30fe048a9d87758956140"
] | [
"assignments/assignment2/metrics.py"
] | [
"import numpy as np\n\nclass ContigencyMatrix:\n def __init__(self, y_true, y_pred):\n \"\"\"\n Contigency matrix calculated as intersection of indices\n \n Matrix: \n rows: prediction labels\n cols: ground truth labels\n\n Example:\n ground truth labels: [0... | [
[
"numpy.unique",
"numpy.trace",
"numpy.concatenate",
"numpy.argsort",
"numpy.average",
"numpy.sum"
]
] |
Haomin-Yu/Smart-Bartender | [
"52e9ff7e7ab8ffc13e248f20cebf110ed9897a5d"
] | [
"ID Scanner/yolo/backend/utils/augment.py"
] | [
"# -*- coding: utf-8 -*-\nfrom imgaug import augmenters as iaa\nimport cv2\nimport numpy as np\nnp.random.seed(1337)\n\n\nclass ImgAugment(object):\n def __init__(self, w, h, jitter):\n \"\"\"\n # Args\n desired_w : int\n desired_h : int\n jitter : bool\n \"\... | [
[
"matplotlib.pyplot.imshow",
"numpy.random.seed",
"numpy.copy",
"numpy.random.uniform",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
stephehuang/MNN | [
"e8d9ee89aca3e8247745fb89b338eca2ad9b583d"
] | [
"pymnn/examples/MNNEngineDemo/mobilenet_demo.py"
] | [
"# Copyright @ 2019 Alibaba. All rights reserved.\n# Created by ruhuan on 2019.09.09\n\"\"\" python demo usage about MNN API \"\"\"\nfrom __future__ import print_function\nimport numpy as np\nimport MNN\nimport cv2\ndef inference():\n \"\"\" inference mobilenet_v1 using a specific picture \"\"\"\n interpreter... | [
[
"numpy.ones"
]
] |
running2/spark | [
"9e94af911d685f28239e0720b0900ac879d67982"
] | [
"python/pyspark/sql/tests/test_pandas_grouped_map.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"pandas.util.testing.assert_frame_equal",
"pandas.DataFrame"
]
] |
ruolinsss/InstantDL | [
"c8c9cce96baafb1bafc3fb021ab37418785c6d8f"
] | [
"instantdl/data_generator/data_generator.py"
] | [
"'''\nAuthor: Dominik Waibel\n\nThis file contains the functions with which the data is improted and exported before training and testing and after testing.\n'''\n\nfrom instantdl.data_generator.data import *\nimport numpy as np\nfrom skimage.io import imread\nfrom skimage.transform import resize\nfrom instantdl.da... | [
[
"numpy.abs",
"numpy.min",
"numpy.median",
"numpy.nan_to_num",
"numpy.stack",
"numpy.concatenate",
"numpy.max",
"numpy.random.permutation",
"numpy.shape",
"numpy.mean",
"numpy.argmax",
"numpy.load",
"numpy.zeros",
"numpy.empty"
]
] |
trachelr/mne-python | [
"6368a17993d47df61a704777ba8281c073bf0c68",
"6368a17993d47df61a704777ba8281c073bf0c68"
] | [
"mne/decoding/base.py",
"mne/io/fiff/tests/test_raw.py"
] | [
"\"\"\"Base class copy from sklearn.base\"\"\"\n# Authors: Gael Varoquaux <gael.varoquaux@normalesup.org>\n# Romain Trachel <trachelr@gmail.com>\n# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n#\n# License: BSD (3-clause)\n\nimport inspect\nimport warnings\nimport six\nimport nump... | [
[
"numpy.dot",
"numpy.set_printoptions",
"sklearn.linear_model.LogisticRegression",
"numpy.get_printoptions"
],
[
"numpy.testing.assert_equal",
"numpy.dot",
"numpy.abs",
"numpy.arange",
"numpy.sort",
"numpy.concatenate",
"numpy.testing.assert_array_equal",
"numpy.... |
mathbraga/imagenet_nn_eval | [
"39c5d2b240bdac67d34235562dc083f5f742b0c4"
] | [
"main/plot_top_1_acc_params.py"
] | [
"import numpy as np\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\n# file = '../results_extra_samples.txt'\n# labels = []\n# values = []\n# ordered_labels = []\n# ordered_values = []\n\n# file_variable = open(file)\n# all_lines_variable = file_variable.readlines()\n# print(type(all_li... | [
[
"matplotlib.pyplot.ylim",
"matplotlib.use",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
duynguyenhoang/pantab | [
"d6d44a1a03ab50adfb8f8d850fc6ba98195b6056"
] | [
"pantab/tests/test_roundtrip.py"
] | [
"from pathlib import Path\n\nimport numpy as np\nimport pandas as pd\nimport pandas.testing as tm\nimport pytest\nfrom tableauhyperapi import Connection, CreateMode, HyperProcess, TableName, Telemetry\n\nimport pantab\nimport pantab._compat as compat\n\n\ndef assert_roundtrip_equal(result, expected):\n \"\"\"Com... | [
[
"pandas.concat",
"pandas.testing.assert_frame_equal"
]
] |
rinkwitz/Thesis_Semantic_Image_Segmentation_on_Satellite_Imagery_using_UNets | [
"75d3a4a536f6ef81fe0efd4f5fbba32b627a7472"
] | [
"Models/DenseNet121_UNet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision.models import densenet121\nfrom Models.utils.Conv2dBlock import Conv2dBlock\nfrom Models.utils.DeepSuperVisionModule import DeepSupervisionModule\nfrom Models.utils.UpConcat2d import UpConcat2d\n\n\nclass DenseNet121_UNet(torch.... | [
[
"torch.nn.init.constant_",
"torch.randn",
"torch.nn.Conv2d",
"torch.nn.init.normal_"
]
] |
MasonDMitchell/Radar_Sim | [
"7c55ca62c11368da72e3bdf7c68a24d77a90d5fc"
] | [
"drone.py"
] | [
"import numpy as np\nfrom scipy import interpolate\n\nclass Drone:\n def __init__(self,waypointPositions,waypointSpeeds,numSteps):\n self.waypointPositions = waypointPositions #m\n self.waypointSpeeds = waypointSpeeds #m/s\n \n self.numSteps = numSteps #This is somewhat accurate. It's... | [
[
"numpy.subtract",
"numpy.linalg.norm",
"scipy.interpolate.interp1d",
"numpy.array",
"numpy.sum"
]
] |
jrhemstad/dask_gdf | [
"c49933d72ce39ca720662b5d5124072e63087a62"
] | [
"dask_gdf/tests/test_delayed_io.py"
] | [
"\"\"\"\nTest IO with dask.delayed API\n\"\"\"\nimport numpy as np\nfrom pandas.util.testing import assert_frame_equal\n\nimport pytest\n\nimport pygdf as gd\nimport dask_gdf as dgd\nfrom dask.delayed import delayed\n\n\n@delayed\ndef load_data(nelem, ident):\n df = gd.DataFrame()\n df['x'] = np.arange(nelem)... | [
[
"numpy.asarray",
"numpy.arange",
"numpy.testing.assert_array_equal",
"pandas.util.testing.assert_frame_equal",
"numpy.random.randint"
]
] |
qinliuliuqin/iSegFormer | [
"67b634588cc0a1e09fb3e092966eae997eb209fa",
"67b634588cc0a1e09fb3e092966eae997eb209fa"
] | [
"maskprop/MiVOS/model/losses.py",
"maskprop/MiVOS/util/logger.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom util.tensor_util import compute_tensor_iu\nfrom collections import defaultdict\n\n\ndef get_iou_hook(values):\n return 'iou/iou', (values['hide_iou/i']+1)/(values['hide_iou/u']+1)\n\ndef get_sec_iou_hook(values):\n return 'iou/sec_iou... | [
[
"torch.nn.functional.cross_entropy"
],
[
"torch.utils.tensorboard.SummaryWriter"
]
] |
jl2922/wide-resnet.pytorch | [
"093f718159080b61d87f6a69e71c698940161e45"
] | [
"networks/resnet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom torch.autograd import Variable\nimport sys\n\ndef conv3x3(in_planes, out_planes, stride=1):\n return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=True)\n\ndef conv_init(m):\n classname = m.__class__... | [
[
"torch.nn.Sequential",
"torch.randn",
"torch.nn.functional.avg_pool2d",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.functional.relu",
"torch.nn.BatchNorm2d"
]
] |
zestyoreo/ITSP-21 | [
"1f7cd88c62b585d04866db40beea811e23cdd732"
] | [
"OpenCV_Training/task5_tomasi_corner_detection.py"
] | [
"import numpy as np\nimport cv2\nfrom matplotlib import pyplot as plt\n\nimg = cv2.imread('rash.jpeg')\ngray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)\n\ncorners = cv2.goodFeaturesToTrack(gray,25,0.01,10)\ncorners = np.int0(corners)\n\nfor i in corners:\n x,y = i.ravel()\n cv2.circle(img,(x,y),3,255,-1)\n\nplt.i... | [
[
"numpy.int0",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show"
]
] |
wind91725/gpt2-ml-finetune- | [
"c1b53d6c78700c044b0a754e9e689306f10a47e8"
] | [
"train/train_wc.py"
] | [
"# Original work Copyright 2018 The Google AI Language Team Authors.\n# Modified work Copyright 2019 Rowan Zellers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://w... | [
[
"tensorflow.contrib.tpu.TPUEstimator",
"tensorflow.contrib.cluster_resolver.TPUClusterResolver",
"tensorflow.gfile.MakeDirs",
"tensorflow.logging.info",
"tensorflow.logging.set_verbosity",
"tensorflow.gfile.Glob",
"tensorflow.contrib.tpu.TPUConfig",
"tensorflow.app.run"
]
] |
kbefus/ca_gw_slr | [
"7a793351be5c135ea6b39a8f59d95508fcc00c7b",
"7a793351be5c135ea6b39a8f59d95508fcc00c7b"
] | [
"wtdepth_bins_distinland_allCAonly_22Nov19.py",
"rename_khdirs_30Dec19.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Nov 21 09:08:30 2019\n\n@author: kbefus\n\"\"\"\n\nimport sys,os\nimport numpy as np\nimport glob\nimport pandas as pd\nimport geopandas as gpd\n#import dask.array as da\nimport rasterio\nfrom rasterio import mask\nfrom rasterio.enums import R... | [
[
"numpy.nanmax",
"numpy.nanmedian",
"numpy.ones_like",
"numpy.isnan",
"numpy.arange",
"numpy.nanmin",
"pandas.DataFrame",
"numpy.nanmean",
"numpy.errstate",
"numpy.nanstd",
"numpy.array",
"scipy.spatial.cKDTree"
],
[
"numpy.arange"
]
] |
kristofbc/handwriting-synthesis | [
"16505e89fd7275d4cd3ed9c4388c9f3c153a0397"
] | [
"src/models/predict_model.py"
] | [
"#!/usr/bin/env python # -*- coding: utf-8 -*-\n\n# Generate a prediction based on a trained model\n# ==============================================\n\nimport numpy as np\nimport chainer\nimport chainer.functions as F\nfrom chainer import variable\n\ntry:\n import cupy\nexcept:\n cupy = np\n pass\n\nfrom t... | [
[
"numpy.expand_dims",
"matplotlib.pyplot.title",
"numpy.asarray",
"numpy.load",
"matplotlib.pyplot.show",
"numpy.zeros",
"numpy.where",
"matplotlib.pyplot.figure"
]
] |
jiayi-ma/GTP-PNet | [
"a9f449c23c879d2c1ecb4116053170612c4bd713"
] | [
"model_T.py"
] | [
"# -*- coding: utf-8 -*-\nfrom utils import (\n read_data, \n input_setup_MS, \n input_setup_PAN, \n imsave,\n merge,\n sobel_gradient,\n lrelu,\n l2_norm,\n linear_map,\n lpls_gradient,\n lpls_gradient_4,\n sobel_gradient_4\n)\n\nimport time\nimport os\nimport matplotlib.pyplot as plt\n\nimport numpy a... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.summary.FileWriter",
"tensorflow.concat",
"tensorflow.placeholder",
"tensorflow.trainable_variables",
"tensorflow.expand_dims",
"tensorflow.nn.tanh",
"tensorflow.truncated_normal_initializer",
"tensorflow.initialize_all_varia... |
spcl/stencilflow | [
"28bb88e7f4251f29aecc266663bc780023ed2549"
] | [
"stencilflow/kernel_chain_graph.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"\nThe KernelChainGraph class represents the whole pipelined data flow graph consisting of input nodes (real data input\narrays, kernel nodes and output nodes (storing the result of the computation).\n\"\"\"\n\n__author__ = \"Andreas Kuster (kustera@ethz.ch)\"\n__copyright__ = \"BSD ... | [
[
"matplotlib.pyplot.subplots",
"matplotlib.rc"
]
] |
StiphyJay/Pointnet2_Pytorch_annotation | [
"588a97ab210068292782eef695417a5c289ae091"
] | [
"pointnet2/models/pointnet2_msg_sem.py"
] | [
"from __future__ import (\n division,\n absolute_import,\n with_statement,\n print_function,\n unicode_literals,\n)\nimport torch\nimport torch.nn as nn\nimport etw_pytorch_utils as pt_utils\nfrom collections import namedtuple\n\nfrom pointnet2.utils.pointnet2_modules import PointnetFPModule, Pointne... | [
[
"torch.randn",
"torch.nn.ModuleList",
"torch.set_grad_enabled",
"torch.max"
]
] |
ehbussell/MixedStand | [
"541423b50bd8cbd5b51fe2cda95fc6af76e184af"
] | [
"scripts/scale_and_fit.py"
] | [
"\"\"\"Script for scaling corrected version of Cobb model, and fitting of approximate model.\"\"\"\n\nimport argparse\nimport copy\nimport csv\nimport json\nimport logging\nimport os\nimport numpy as np\nfrom scipy.optimize import minimize\n\nfrom mixed_stand_model import fitting\nfrom mixed_stand_model import para... | [
[
"numpy.square",
"numpy.product",
"numpy.linspace",
"numpy.arange",
"numpy.zeros_like",
"scipy.optimize.minimize",
"numpy.array",
"numpy.sum"
]
] |
tanish-g/BeatNet | [
"bfb3834922304341036e0f4fcebd3015e61fe008"
] | [
"src/BeatNet/BeatNet.py"
] | [
"# This is the BeatNet user script. First, it extracts the spectral features and then\r\n# feeds them to one of the pre-trained models to get beat/downbeat activations.\r\n# Therefore, it infers beats and downbeats based on one of the two offline and online inference models.\r\n\r\nimport os\r\nimport torch\r\nimpo... | [
[
"torch.from_numpy",
"numpy.frombuffer",
"numpy.append",
"torch.no_grad",
"numpy.transpose",
"numpy.zeros"
]
] |
franceme/staticmetrics | [
"ea3174808198070206045b9101eaca0101aa3b0d"
] | [
"src/staticmetrics.py"
] | [
"#!/bin/env python3\nimport sys\nimport logging\nimport os\nfrom pandas import DataFrame as df\nfrom pathlib import Path\nfrom radon.complexity import cc_visit\n\nglobal_columns = [\n 'File Qual Name',\n 'Program Lines',\n 'Total Lines',\n 'Count of Imports',\n 'CC Complexity'\n]\n\nVERSION = \"0.0.1... | [
[
"pandas.DataFrame"
]
] |
tooshort26/Py-MT-ML | [
"84330ebdfdbd7855c49854f9fb9af9ea3e90c234"
] | [
"translator_web/ceb_to_kamayo_word_translator_predict.py"
] | [
"from keras.models import Model, model_from_json\nfrom keras.layers import Input, LSTM, Dense, Embedding\nfrom keras.preprocessing.sequence import pad_sequences\nimport numpy as np\nimport nltk\nimport os\n\nHIDDEN_UNITS = 256\nROOT_DIR = os.path.abspath(os.curdir)\n\n\nclass CebToKamayoTranslator(object):\n mod... | [
[
"numpy.load",
"numpy.argmax",
"numpy.zeros"
]
] |
zcikojevic/toxic-language-detection | [
"32e0e83fbc5d341dbb77bfa677f78dce82960861",
"32e0e83fbc5d341dbb77bfa677f78dce82960861"
] | [
"joint_model/final_demo.py",
"multilabel_classifiers/subsets.py"
] | [
"import os\nimport pickle\n\nimport numpy as np\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.metrics import classification_report\n\nimport run_binary_classifier\nimport run_multilabel_classifier\n\ntrain_binary = os.path.join('../../../', 'data/train_binary.csv')\ntest_binary = os.path.join('... | [
[
"sklearn.linear_model.LogisticRegression",
"numpy.argwhere",
"numpy.full_like",
"numpy.array",
"sklearn.metrics.classification_report"
],
[
"numpy.array",
"pandas.read_csv",
"numpy.argwhere",
"numpy.unique"
]
] |
papercup-open-source/subscale-wavernn | [
"13eba2e97c9bc31c560a0b5c64cc5331899f7b80"
] | [
"tests.py"
] | [
"import torch\nimport random\n\nfrom hparams import create_hparams\nfrom models.wavernn import Subscaler, WaveRNN\nfrom utils.test_utils import run_overlay\nfrom utils.data_utils import get_loader\n\n\ndef test_subscale_vs_standard_inference_partity():\n hparams = create_hparams()\n model = WaveRNN(hparams, d... | [
[
"torch.eq",
"torch.rand",
"torch.arange"
]
] |
alexander-held/pyhf | [
"9018a3a16fff4940c7124c25b9d7a8ea70b32365"
] | [
"validation/run_toys.py"
] | [
"import json\nimport sys\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport ROOT\n\nimport pyhf\nimport pyhf.contrib.viz.brazil as brazil\n\n\ndef run_toys_ROOT(infile, ntoys):\n infile = ROOT.TFile.Open(infile)\n workspace = infile.Get(\"combined\")\n data = workspace.data(\"obsData\")\n\n ... | [
[
"matplotlib.pyplot.subplots",
"numpy.random.seed",
"numpy.linspace"
]
] |
lostmygithubaccount/MLOps | [
"e5bdb50005509710146d10a22a96002c5f8aaae0"
] | [
"examples/facereco/preprocess.py"
] | [
"\nimport argparse\nimport pandas as pd\nimport numpy as np\nimport os.path\n\n\ndef extract_metadata(input_path, output_path):\n '''\n Extract and write metadata from images dataset to dataframe\n\n parameters:\n input_path: directory path to Images directory\n output_path: d... | [
[
"pandas.Series",
"pandas.DataFrame"
]
] |
LordFritos/TC1002s-Team | [
"0f7b3d6dcb3d235de7fe2d8684067c4794cfda3c"
] | [
"K_means_patternIRIS.py"
] | [
"from numba import jit\nimport numpy as np\nfrom sklearn.cluster import KMeans\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\ncolour=['b','green','orange']\n\ndef main():\n\tdata = pd.read_csv('./data/iris.data')\n\tnpData = data.to_numpy()\n\tnpData = np.delete(npData,obj=4, axis=1)\n\n\t#KLEARN\n\tklear... | [
[
"pandas.read_csv",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"sklearn.cluster.KMeans",
"numpy.delete",
"matplotlib.pyplot.show"
]
] |
GanlongZhao/CST_DA_detection | [
"a13785b9b9905f9b343b2f9cf29b47a5e46cfac4"
] | [
"lib/model/faster_rcnn/vgg16.py"
] | [
"# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __fu... | [
[
"torch.nn.Linear",
"torch.nn.Sequential",
"torch.load"
]
] |
maosenGao/deepthought | [
"4bd7e06463368920e55048276af20488becabf6a"
] | [
"deepthought/datasets/eeg/EEGEpochsDataset.py"
] | [
"__author__ = 'sstober'\n\nimport logging\nlog = logging.getLogger(__name__)\n\nimport numpy as np\n\nimport functools\n\n# from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix\nfrom pylearn2.datasets import Dataset\nfrom pylearn2.format.target_format import OneHotFormatter\nfrom pylearn2.space impor... | [
[
"numpy.rollaxis",
"numpy.hstack",
"numpy.min",
"numpy.asarray",
"numpy.arange",
"numpy.asfarray",
"numpy.atleast_2d",
"numpy.max",
"numpy.prod",
"numpy.zeros",
"numpy.sum",
"numpy.vstack"
]
] |
fiveai/PaRoT | [
"be83313bc5e93ec6b3f1ea81c4b7eea6919adec2"
] | [
"examples/train_simple_example.py"
] | [
"# Copyright 2020 FiveAI Ltd.\n# All rights reserved.\n#\n# This file is part of the PaRoT toolbox, and is released under the\n# \"MIT License Agreement\". Please see the LICENSE file that should\n# have been included as part of this package.\n\"\"\"\nExample to showcase the ease of use of PaRoT\n\"\"\"\n\nimport w... | [
[
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.keras.layers.Dense",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.keras.losses.sparse_categorical_crossentropy",
"tensorflow.keras.datasets.mnist.load_data",
"tensorflow.compat.v1.data.make_initializable_iterator",
"t... |
prclibo/ice | [
"13a2689a1ed9503769ed969bb2dbe3fc352bd33c"
] | [
"ice/landmark_interpolation.py"
] | [
"import numpy as np\nimport scipy.spatial\nimport skimage.draw\nimport torch\nfrom torchvision import io\nimport face_alignment\n\nimport matplotlib.pyplot as plt\n\n\ndef interpolate_from_landmarks(image, landmarks, vertex_indices=None, weights=None, mask=None):\n H, W = image.shape[-2:]\n step = 4\n\n re... | [
[
"numpy.random.seed",
"torch.cat",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.margins",
"torch.stack",
"torch.from_numpy",
"numpy.full",
"matplotlib.pyplot.plot",
"torch.no_grad",
"torch.arange",
"torch.gather",
"matplotlib.pyplot.show",
"matplotlib.pyplot.N... |
gaowanlu/AI | [
"12f349b033ea52600c95b5e64c01d9a5ffe37870"
] | [
"project/cvPy/cvPy.py"
] | [
"import cv2\nimport numpy as np\nimport time\n\n#帧率计算器\nclass FPS:\n fps=0\n start_time=0\n end_time=0\n def start(self):\n self.start_time=time.time()\n def end(self):\n self.end_time=time.time()\n def get_fps(self):\n self.fps=0\n seconds=self.end_time-self.start_time... | [
[
"numpy.array",
"numpy.zeros",
"numpy.float32",
"numpy.ones"
]
] |
amirhosseindavoody/seaborn | [
"a1231a75c2e1a2e2360abf4f66a3f025193275ab"
] | [
"doc/sphinxext/gallery_generator.py"
] | [
"\"\"\"\nSphinx plugin to run example scripts and create a gallery page.\n\nLightly modified from the mpld3 project.\n\n\"\"\"\nimport os\nimport os.path as op\nimport re\nimport glob\nimport token\nimport tokenize\nimport shutil\nimport warnings\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot... | [
[
"matplotlib.use",
"matplotlib.pyplot.gcf",
"matplotlib.image.imread",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
]
] |
subhadarship/learning-to-unjumble | [
"58b13d8beb60c83e6346a0b6837f68f63bb66733"
] | [
"unjumble/data_utils.py"
] | [
"import logging\nimport os\nimport pickle\nimport random\nfrom itertools import groupby\nfrom operator import itemgetter\nfrom typing import Tuple\n\nimport nltk\nimport numpy as np\nimport torch\nfrom nltk.tokenize.treebank import TreebankWordDetokenizer\nfrom torch.utils.data import Dataset\nfrom tqdm import tqdm... | [
[
"torch.full",
"numpy.random.choice",
"torch.tensor",
"numpy.concatenate",
"numpy.random.permutation",
"torch.bernoulli",
"numpy.argsort",
"numpy.array"
]
] |
dredwardhyde/taming-transformers | [
"f169a39eb8f5f5e3ac1d75850276871d9f19bdf1"
] | [
"scripts/sample_fast.py"
] | [
"import argparse, os, sys, glob\nimport torch\nimport time\nimport numpy as np\nfrom omegaconf import OmegaConf\nfrom PIL import Image\nfrom tqdm import tqdm, trange\nfrom einops import repeat\n\nfrom main import instantiate_from_config\nfrom taming.modules.transformer.mingpt import sample_with_past\n\n\nrescale = ... | [
[
"torch.tensor",
"torch.no_grad",
"torch.load"
]
] |
Hartvi/detectron2 | [
"d8999c5d4e0b398de90821d42b57f9558151e275"
] | [
"tools/convert-torchvision-to-d2.py"
] | [
"#!/usr/bin/env python\n# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport pickle as pkl\nimport sys\nimport torch\n\n\"\"\"\nUsage:\n # download one of the ResNet{18,34,50,101,152} models from torchvision:\n wget https://download.pytorch.org/models/resnet50-19c8e357.pth -O r50.pth\n # run the conversi... | [
[
"torch.load"
]
] |
Maxtoq/off-policy | [
"ede05b950ad841e11e5dba0682c65ec1c1f5fc5f"
] | [
"offpolicy/runner/rnn/base_runner.py"
] | [
"import os\nimport numpy as np\nimport wandb\nimport torch\nfrom tensorboardX import SummaryWriter\n\nfrom offpolicy.utils.rec_buffer import RecReplayBuffer, PrioritizedRecReplayBuffer\nfrom offpolicy.utils.util import DecayThenFlatSchedule\n\nclass RecRunner(object):\n \"\"\"Base class for training recurrent po... | [
[
"numpy.mean",
"torch.load"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.