repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
loveprolife/srcnn-tensorflow2 | [
"163c90b33af22b460173376d27a1714025056de7"
] | [
"train.py"
] | [
"\r\nfrom utils import (\r\n read_data,\r\n input_setup,\r\n imsave,\r\n merge,\r\n get_last_weights\r\n)\r\nimport numpy as np\r\nimport datetime\r\nimport tensorflow as tf\r\nimport time\r\nimport pprint\r\nimport os\r\nimport argparse\r\nfrom tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint\r\... | [
[
"matplotlib.pyplot.legend",
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.config.experimental.list_logical_devices",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.summary.create_file_writer",
"tensorf... |
obrienam/BeeFanningDetector | [
"51a8d7d036d58398d997dcebb7fb495040a0539d"
] | [
"Files/fanning_counter.py"
] | [
"import cv2\nimport numpy as np\nfrom collections import defaultdict\n\n'''\nVariables that are important for\nthis program.\n'''\n\ntimes=0\nnumfan=0\n#Video stream used for processing\nvs=cv2.VideoCapture(\"/Users/aidanobrien/Documents/GitHub.nosync/BeeFanningDetector/Assets/test_img&videos/test_vid4.mp4\")\n#Bac... | [
[
"numpy.array",
"numpy.ones"
]
] |
nicktheway/Pagerank | [
"ff57072deabca020548cd7fcc9f3c5a857f438ed"
] | [
"scripts/visualize_pr.py"
] | [
"import numpy as np \nimport os\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as mtick\n\n#import helper functions\nimport helpers as hp\n\ndataset = \"web-Google-diades\"\n\npagerankFilePath = \"./results/pageranks/\" + dataset + \".data\"\nserialPagerankFilePath = \"./results/seria... | [
[
"numpy.fromfile",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.ylim",
"numpy.cumsum",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.show"... |
privateos/xigmoid | [
"3d01c65a7f82ce0d851a42d7e38f084eae2b1622"
] | [
"mnist/get_mnist.py"
] | [
"import os\nimport numpy as np\n\ndef get():\n current_file_name = os.path.realpath(__file__)\n current_file_path = os.path.split(current_file_name)[0]\n mnist_file_name = os.path.join(current_file_path, 'mnist.npz')\n mnist_npz = np.load(mnist_file_name)\n x = mnist_npz['x']\n y = mnist_npz['y']... | [
[
"numpy.load",
"numpy.argmax",
"numpy.transpose"
]
] |
PTRRupprecht/Spikefinder-Elephant | [
"be2330a4cc523bc415ba14ef45c20e078eda1cc6"
] | [
"elephant/utils.py"
] | [
"\nimport numpy as np\n\n\ndef norm(x):\n return (x - np.mean(x)) / (np.std(x) + 1e-7)\n\ndef smooth(x,window_len=11,window='hanning'):\n \"\"\"smooth the data using a window with requested size.\n \n This method is based on the convolution of a scaled window with the signal.\n The signal is prepared... | [
[
"numpy.std",
"numpy.mean",
"numpy.ones"
]
] |
jafluri/pygsp | [
"ff8c0023c25df4cbcfd88a7ef63c6223f3030a51",
"ff8c0023c25df4cbcfd88a7ef63c6223f3030a51"
] | [
"pygsp/graphs/graph.py",
"pygsp/graphs/randomring.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom __future__ import division\n\nimport os\nfrom collections import Counter\n\nimport numpy as np\nfrom scipy import sparse\n\nfrom pygsp import utils\nfrom .fourier import FourierMixIn\nfrom .difference import DifferenceMixIn\nfrom ._io import IOMixIn\nfrom ._layout import LayoutMixIn... | [
[
"scipy.sparse.isspmatrix",
"numpy.nonzero",
"numpy.power",
"scipy.sparse.diags",
"scipy.sparse.csr_matrix",
"numpy.all",
"numpy.max",
"numpy.asanyarray",
"scipy.sparse.identity",
"scipy.sparse.triu",
"numpy.zeros"
],
[
"scipy.sparse.coo_matrix",
"numpy.cos",... |
idc9/andersoncd | [
"af2123b241e5f82f7c51b2bbf5196fb02723b582"
] | [
"examples/expe_eigvals/expe_rayleigh.py"
] | [
"import pandas\nimport matplotlib.pyplot as plt\n\nfrom andersoncd.plot_utils import configure_plt\n\n\nconfigure_plt()\n\ndatasets = [\n \"gina_agnostic\", \"rcv1.binary\", \"real-sim\", \"news20.binary\"]\n\n\ndataset_title = {}\ndataset_title[\"leukemia\"] = \"leukemia\"\ndataset_title[\"gina_agnostic\"] = \"... | [
[
"pandas.read_pickle",
"matplotlib.pyplot.subplots"
]
] |
PlanetG3/ArtificialIntelligenceEngines | [
"77667d499ffd57a745e8eb58877c557d807c95c3"
] | [
"DeepLearningEnginesCode/Python/Ch02_LinearNetwork/main.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nLinear associative net.\n\"\"\"\n\nimport numpy as np\n# use pylab for ploting.\nimport pylab as pl\n\n########## Define class MLP ##########\nclass LinearNetwork():\n \n ########## Define Methods for LinearNetwork class ##########\n # Initialize ne... | [
[
"numpy.dot",
"numpy.random.seed",
"numpy.append",
"numpy.random.rand",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
msnitish/posthog | [
"cb86113f568e72eedcb64b5fd00c313d21e72f90"
] | [
"ee/clickhouse/queries/experiments/funnel_experiment_result.py"
] | [
"from dataclasses import asdict, dataclass\nfrom datetime import datetime\nfrom typing import List, Optional, Tuple, Type\n\nfrom numpy.random import default_rng\nfrom rest_framework.exceptions import ValidationError\n\nfrom ee.clickhouse.queries.experiments import (\n CONTROL_VARIANT_KEY,\n FF_DISTRIBUTION_T... | [
[
"numpy.random.default_rng"
]
] |
robertbindar/TileDB-Py | [
"cc2d92c45fc12d72a0259301561e3649b38e726c"
] | [
"tiledb/tests/test_core.py"
] | [
"import copy\nimport random\n\nimport numpy as np\nfrom numpy.testing import assert_array_equal\n\nimport tiledb\nfrom tiledb import TileDBError\nimport tiledb.main as core\nfrom tiledb.tests.common import DiskTestCase, rand_ascii\n\n\nclass CoreCCTest(DiskTestCase):\n def test_pyquery_basic(self):\n ctx ... | [
[
"numpy.int32",
"numpy.cumsum",
"numpy.testing.assert_array_equal",
"numpy.identity",
"numpy.random.rand",
"numpy.iinfo",
"numpy.array"
]
] |
pvgladkov/tweet-sentiment-extraction | [
"4950be56de062fe55b5810c92e655c5c52c9fbcb"
] | [
"tse/models.py"
] | [
"import torch\nimport transformers\nfrom torch import nn as nn\nimport numpy as np\n\n\ndef load_model(train_config, device):\n model_config = transformers.RobertaConfig.from_pretrained(train_config.BERT_PATH)\n model_config.output_hidden_states = True\n model = TweetModel(train_config, conf=model_config)\... | [
[
"torch.nn.CrossEntropyLoss",
"torch.nn.Dropout",
"torch.sigmoid",
"torch.softmax",
"torch.cat",
"torch.nn.init.xavier_normal_",
"torch.nn.Linear",
"numpy.argmax"
]
] |
profefonso/MachineLearnigClasification | [
"12d309a3cb088a3b1597fb899066f8d1541e05c8"
] | [
"models/main.py"
] | [
"# Cargo las librerías necesarias\r\nfrom sklearn.svm import SVC\r\nfrom sklearn.linear_model import LogisticRegression\r\nfrom sklearn.model_selection import cross_val_score, train_test_split\r\nfrom sklearn import metrics\r\nfrom sklearn import model_selection\r\nimport matplotlib\r\nimport matplotlib.pyplot as p... | [
[
"sklearn.model_selection.cross_val_score",
"sklearn.linear_model.LogisticRegression",
"matplotlib.pyplot.title",
"sklearn.model_selection.learning_curve",
"sklearn.metrics.confusion_matrix",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.ylabel",
"sklearn.svm.SVC",
... |
sjurug/SVDB | [
"1427e964f88815f9b1fd180af6cdeb1ff29b2eaa"
] | [
"svdb/query_module.py"
] | [
"from __future__ import absolute_import\nimport sys, os, glob\nfrom . import readVCF\nfrom . import overlap_module\nfrom operator import itemgetter\nfrom . import merge_vcf_module_cython\nimport sqlite3\nimport gzip\n\nimport numpy as np\n\ndef main(args):\n #start by loading the variations\n queries = []\n ... | [
[
"numpy.array"
]
] |
foamliu/3D-Object-Detection | [
"1c5ae0b470f08abe652f38817393ebd0a8cf3ea9"
] | [
"data_generator_depth.py"
] | [
"import os\nimport random\nfrom random import shuffle\n\nimport cv2 as cv\nimport numpy as np\n\nfrom config import img_cols\nfrom config import img_rows\n\ntrain_folder = 'data/rgb'\ndepth_folder = 'data/depth'\nsemantic_folder = 'data/semantic'\n\n\ndef get_depth(name):\n tokens = name.split('_')\n tokens[-... | [
[
"numpy.fliplr",
"numpy.random.random_sample",
"numpy.random.shuffle",
"numpy.zeros",
"numpy.empty"
]
] |
ZhouSky/tianshou | [
"253c5805def07355e10345222613a815c7eea823"
] | [
"mytest/testutil.py"
] | [
"import numpy as np\nimport torch\n\n\ndef generate_task_index(task_interval):\n task_ind = np.zeros((task_interval[-1]), dtype=np.int32)\n for i in range(task_interval.size - 1):\n task_ind[task_interval[i]: task_interval[i + 1]] = i\n return task_ind\n\n\ndef compute_errors(output, task_ind, label... | [
[
"torch.tensor",
"numpy.argmax",
"torch.no_grad",
"numpy.mean",
"torch.device",
"numpy.zeros",
"torch.stack"
]
] |
gohyojun15/CSRNet-pytorch | [
"f52777657dd0136f056550465ce9b3b5c8ec416f"
] | [
"test.py"
] | [
"import argparse\n\nimport torch\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as CM\nfrom tqdm import tqdm\n\nfrom config import Config\nfrom model import CSRNet\nfrom dataset import create_train_dataloader, create_test_dataloader, CrowdDataset\nfrom utils import denormalize\n\nparser = argparse.ArgumentP... | [
[
"matplotlib.pyplot.imshow",
"torch.load",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.device"
]
] |
voxel-scape/voxel-scape-api | [
"d04fd9bd530ec3be7a3372562aea824fb2dcacc9"
] | [
"tasks/semantic/modules/user.py"
] | [
"#!/usr/bin/env python3\n# This file is covered by the LICENSE file in the root of this project.\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\nimport torchvision.transforms as transforms\nimport imp\nimport yaml\nimport time\nfrom PIL import Image\nimport... | [
[
"torch.cuda.synchronize",
"torch.cuda.empty_cache",
"torch.no_grad",
"torch.cuda.is_available",
"torch.cuda.device_count"
]
] |
hiyouga/SAGAN-PyTorch | [
"e469cfa47e4317dce910c54687e9d24f571d6f2b"
] | [
"data_utils.py"
] | [
"from torch.utils.data import DataLoader\nfrom torchvision import datasets, transforms\n\n\ndef load_data(im_size, batch_size, workers, dataset, data_path):\n transform = transforms.Compose([\n transforms.Resize((im_size, im_size)),\n transforms.ToTensor(),\n transforms.Normalize((0.5, 0.5, ... | [
[
"torch.utils.data.DataLoader"
]
] |
AdrKacz/IA-Negotiation | [
"d5f9544d2212919b9f5feb5429db4aeacb06add3"
] | [
"rl-python/environment.py"
] | [
"from agent import Buyer, Seller\nfrom copy import deepcopy\nfrom math import exp\nimport matplotlib.pyplot as plt\n\nclass Environment():\n def __init__(self):\n # Training Information\n self.num_cycles = int(5e1)\n self.num_episodes = int(1e2)\n self.num_episodes_testing = int(1e3)\... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
sasha-scale/vision | [
"2ab08289cfaca8c006ade977deeefa53cc231890"
] | [
"torchvision/transforms/transforms.py"
] | [
"import math\nimport numbers\nimport random\nimport warnings\nfrom collections.abc import Sequence\nfrom typing import Tuple, List, Optional\n\nimport torch\nfrom PIL import Image\nfrom torch import Tensor\n\ntry:\n import accimage\nexcept ImportError:\n accimage = None\n\nfrom . import functional as F\n\n\n_... | [
[
"torch.mm",
"torch.randint",
"torch.empty",
"torch.randperm",
"torch.tensor",
"torch.rand"
]
] |
Luger-Lab/Q-FADD | [
"5407178513837fd1804397bba0708e6300c21626"
] | [
"src/qfadd_distribution.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\nimport argparse\nimport matplotlib\nmatplotlib.use('PDF')\nimport matplotlib.pyplot as plt\nfrom scipy.stats import t\n\n#define p-value function\ndef ttest(avg1,sem1,n1,avg2,sem2,n2):\n sed = np.sqrt(np.power(sem1,2) + np.power(sem2,2))\n t_stat = np.divide(np.su... | [
[
"matplotlib.pyplot.tight_layout",
"numpy.sqrt",
"numpy.abs",
"numpy.power",
"matplotlib.use",
"numpy.around",
"numpy.subtract",
"matplotlib.pyplot.savefig",
"numpy.genfromtxt",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.subplot",
"numpy.std",
"numpy.append",... |
dj-khandelwal/lux | [
"9ade6dde756e55a1f281a82f8091b71ee051f8af"
] | [
"tests/test_config.py"
] | [
"# Copyright 2019-2020 The Lux Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl... | [
[
"pandas.read_csv"
]
] |
philippjfr/datashader | [
"eb9218cb810297aea2ae1030349cef6a6f3ab3cb"
] | [
"datashader/tests/benchmarks/test_extend_line.py"
] | [
"import pytest\n\nimport numpy as np\n\nfrom datashader.glyphs import _build_draw_line, _build_extend_line, _build_map_onto_pixel\nfrom datashader.utils import ngjit\n\n\n@pytest.fixture\ndef extend_line():\n @ngjit\n def append(i, x, y, agg):\n agg[y, x] += 1\n\n mapper = ngjit(lambda x: x)\n ma... | [
[
"numpy.random.random",
"numpy.linspace",
"numpy.random.normal",
"numpy.random.uniform",
"numpy.zeros"
]
] |
diegoinacio/computer-vision-notebooks | [
"89040e9aaa5a3382173d10efcce11068d5a82d71"
] | [
"Computer-Vision-Fundamentals/color_model_plot.py"
] | [
"import numpy as np\n\nfrom plotly import __version__, tools\nfrom plotly.offline import init_notebook_mode, iplot\n\nfrom plotly.graph_objs import *\ninit_notebook_mode(connected=True)\n\n# ! Identity Base\niBASE = np.array([\n [0, 1, 0, 1, 0, 1, 0, 1],\n [0, 0, 1, 1, 0, 0, 1, 1],\n [0, 0, 0, 0, 1, 1, 1, ... | [
[
"numpy.dot",
"numpy.cos",
"numpy.sin",
"numpy.array",
"numpy.where"
]
] |
ruijieren98/SfmLearner-Pytorch | [
"893743f33c31a687a6bb4a447af01f9abf47b85f"
] | [
"train_flexible_shifts.py"
] | [
"import time\nimport csv\n\nimport numpy as np\nimport torch\nfrom torch.autograd import Variable\nimport torch.backends.cudnn as cudnn\nimport torch.optim\nimport torch.utils.data\nimport custom_transforms\nimport models\nfrom utils import save_checkpoint,save_path_formatter\nfrom logger import TermLogger, Average... | [
[
"torch.optim.Adam",
"torch.load",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.cuda.is_available",
"torch.device",
"torch.nn.DataParallel"
]
] |
johntzwei/wilds | [
"cb373f729826fbdd737664f06bb91b92c6bf5395"
] | [
"examples/models/initializer.py"
] | [
"import torch.nn as nn\nimport torchvision\nfrom models.bert.bert import BertClassifier, BertFeaturizer\nfrom models.bert.roberta import RobertaClassifier, RobertaFeaturizer\nfrom models.bert.distilbert import DistilBertClassifier, DistilBertFeaturizer\nfrom models.resnet_multispectral import ResNet18\nfrom models.... | [
[
"torch.nn.Linear"
]
] |
sudhu26/data-science-portfolio | [
"88f7a350cbd9245e4f92ff1829e49c5d378c609d"
] | [
"academics/SparkML/Assignment03.py"
] | [
"# imports and tools\nfrom pyspark.sql import SparkSession\nfrom pyspark.sql.types import IntegerType\nimport pyspark.sql.functions as f\n\nfrom pyspark.ml.feature import CountVectorizer\n\nimport re\nimport os\nimport numpy as np\nimport operator\n\nimport matplotlib.pyplot as plt\n\n# create SparkContext object\n... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel"
]
] |
sai-krishna-ghanta/Lane_detection_CV | [
"0b02afe2a484c98568aca1b7cdc29d2b7e90dc0f"
] | [
"threshold.py"
] | [
"import numpy as np\nimport cv2\n\ndef abs_sobel_thresh(img, orient='x', thresh=(20, 100)):\n \"\"\"\n #--------------------- \n # This function applies Sobel x or y, and then \n # takes an absolute value and applies a threshold.\n #\n \"\"\"\n # Take the derivative in x or y given orient = 'x'... | [
[
"numpy.absolute",
"numpy.sqrt",
"numpy.max",
"numpy.copy",
"numpy.zeros_like"
]
] |
yangzhaonan18/trafficSignDetect | [
"a84bfe4d0b74593b1671361d2aef547785ea4958"
] | [
"expand_rect.py"
] | [
"# -*- coding=utf-8 -*-\n# py37\n\n\nimport numpy as np\n\n\ndef expand_yellow(list):\n list = np.array(list)\n print(list.shape)\n unite_list = []\n for i in range(len(list)):\n if list[i][2] > 10 and list[i][3] > 10:\n if list[i][2] < list[i][3]: # 黄色区域的宽度 小于 高度的时候,将不变看成是 黄色施工标志进行尺寸... | [
[
"numpy.array"
]
] |
opensourceai/yolov3-tensorflow-cn | [
"2e41fb40cd2a2c8f60152cf51be6b657b9aadb1a"
] | [
"core/utils.py"
] | [
"import colorsys\nimport numpy as np\nimport tensorflow as tf\nfrom collections import Counter\nfrom PIL import ImageFont, ImageDraw\n\n\n# Discard all boxes with low scores and high IOU 丢弃所有低分和高IOU的盒子,和自身iou高的boxe\ndef gpu_nms(boxes, scores, num_classes, max_boxes=50, score_thresh=0.3, iou_thresh=0.5):\n \"\"\"... | [
[
"tensorflow.concat",
"numpy.minimum",
"tensorflow.stack",
"tensorflow.image.non_max_suppression",
"tensorflow.gfile.GFile",
"numpy.concatenate",
"numpy.where",
"tensorflow.boolean_mask",
"tensorflow.import_graph_def",
"tensorflow.gather",
"numpy.argmax",
"tensorflow... |
rishabh1694/dspn-mod | [
"94794bc64785a63d5a957214ae29b830c2a4bc3a"
] | [
"dspn/Object-Detection-Metrics-State/lib/Evaluator.py"
] | [
"###########################################################################################\n# #\n# Evaluator class: Implements the most popular metrics for object detection #\n# ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.pause",
"numpy.linspace",
"numpy.cumsum",
"numpy.linalg.norm",
"numpy.argwhere",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"nump... |
cmpute/pytorch-lightning | [
"695e0514f8e60a88f49786c33311f223be2e7357"
] | [
"tests/models/test_amp.py"
] | [
"import os\n\nimport pytest\nimport torch\n\nimport tests.base.develop_pipelines as tpipes\nimport tests.base.develop_utils as tutils\nfrom pytorch_lightning import Trainer\nfrom pytorch_lightning.utilities.exceptions import MisconfigurationException\nfrom tests.base import EvalModelTemplate\n\n\n@pytest.mark.spawn... | [
[
"torch.cuda.device_count",
"torch.cuda.is_available"
]
] |
siposcsaba89/tensorrtx | [
"aad17004e0f2420babf3ea245ee2bab03e05baad"
] | [
"tsm/gen_wts.py"
] | [
"import argparse\nimport struct\n\nimport torch\nimport numpy as np\n\n\ndef write_one_weight(writer, name, weight):\n assert isinstance(weight, np.ndarray)\n values = weight.reshape(-1)\n writer.write('{} {}'.format(name, len(values)))\n for value in values:\n writer.write(' ')\n # float ... | [
[
"torch.load"
]
] |
robintwhite/scholar-scrape | [
"c5862c2233e0564d83e142f475b0cb6466b7eb5e"
] | [
"main.py"
] | [
"# %% Imports\nimport numpy as np \nimport pandas as pd \nfrom scholarly import scholarly\nfrom utils import scholar\nimport os\nimport time\nimport random\nimport requests, bs4\nfrom tqdm import tqdm\n\n# %% Get search terms from file\nsearch_terms = []\nwith open(\"search_terms.txt\") as f:\n lines = f.readlin... | [
[
"pandas.DataFrame"
]
] |
dibyanshushekhardey/Machine-Learning | [
"42047bc418096086a0c133dcd04c94f88342472b"
] | [
"Machine Learning Fundamentals with Python Datacamp/Unsupervised Learning in Python/Visualization with hierarchical clustering and t-SNE/hierarchies of stocks.py"
] | [
"# Import normalize\nfrom sklearn.preprocessing import normalize\n\n# Normalize the movements: normalized_movements\nnormalized_movements = normalize(movements)\n\n# Calculate the linkage: mergings\nmergings = linkage(normalized_movements, method='complete')\n\n# Plot the dendrogram\ndendrogram(mergings,\n label... | [
[
"sklearn.preprocessing.normalize"
]
] |
lukebfunk/OpticalPooledScreens | [
"0f6a46c0f66d038d737e92f22adafb54a175005e"
] | [
"ops/in_situ.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom ops.constants import *\nimport ops.utils\n\n\ndef extract_base_intensity(maxed, peaks, cells, threshold_peaks):\n\n # reads outside of cells get label 0\n read_mask = (peaks > threshold_peaks)\n values = maxed[:, :, read_mask].transpose([2, 0, 1])\n labels ... | [
[
"numpy.log",
"pandas.merge",
"pandas.notnull",
"pandas.Series",
"numpy.linalg.inv",
"numpy.median",
"numpy.quantile",
"pandas.DataFrame",
"numpy.sort",
"numpy.array",
"numpy.zeros",
"numpy.where"
]
] |
fciannel/tensor2tensor | [
"44f669058390bec03024baa04c1a33e91cc0909d"
] | [
"tensor2tensor/models/video/nfg_conv3d_test.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"tensorflow.test.main"
]
] |
alessandrocuda/ISANet | [
"e33a5a408554c900a7d282baa500bd8023a2cd2f"
] | [
"isanet/optimizer/utils.py"
] | [
"import numpy as np\n\ndef l_norm(l_v):\n \"\"\"Computes the norm of a list of numpy array.\n\n Parameters\n ----------\n l_v : array-like\n\n Returns\n -------\n float\n The norm of l_v.\n \"\"\"\n return np.sqrt(np.sum([np.sum(np.square(l_v[i])) for i in range(0, len(l_v))]))\n\n... | [
[
"numpy.concatenate",
"numpy.square",
"numpy.multiply"
]
] |
noahchalifour/memn2n | [
"0eb341c45c1259b5dbb041cfa264251dc7b9383c",
"0eb341c45c1259b5dbb041cfa264251dc7b9383c"
] | [
"utils/preprocessing.py",
"utils/data/babi_dialog.py"
] | [
"import tensorflow as tf\n# import tensorflow_text as tf_text\n\nfrom .hparams import *\n\n\ndef get_tokenizer_fn(hparams):\n\n # tf_word_tokenizer = tf_text.WhitespaceTokenizer()\n\n def word_tokenize(text):\n # return tf_word_tokenizer.tokenize(text)\n return tf.strings.split(text, sep=' ')\n\... | [
[
"tensorflow.fill",
"tensorflow.shape",
"tensorflow.strings.split",
"tensorflow.lookup.KeyValueTensorInitializer",
"tensorflow.strings.bytes_split",
"tensorflow.lookup.StaticHashTable"
],
[
"tensorflow.data.Dataset.from_tensor_slices"
]
] |
VemburajYadav/PhiFlow | [
"842c113d1850569b97e30ab0632866bb5bc4b300"
] | [
"phi/physics/pressuresolver/multiscale.py"
] | [
"import logging\nimport numpy as np\n\nfrom phi import math\nfrom .solver_api import PressureSolver, FluidDomain\n\n\nclass MultiscaleSolver(PressureSolver):\n\n def __init__(self, solvers, autodiff=False):\n \"\"\"\n A multigrid solver first solves the pressure on a lower-resolution grid and succe... | [
[
"numpy.all"
]
] |
HuthLab/multi-timescale-LSTM-LMs | [
"d27de333b11f29d898069e852eaf45ca39d903a8"
] | [
"splitcross.py"
] | [
"from collections import defaultdict\n\nimport torch\nimport torch.nn as nn\n\nimport numpy as np\n\n\nclass SplitCrossEntropyLoss(nn.Module):\n r'''SplitCrossEntropyLoss calculates an approximate softmax'''\n def __init__(self, hidden_size, splits, verbose=False):\n # We assume splits is [0, split1, s... | [
[
"torch.ones",
"numpy.random.seed",
"torch.nn.functional.log_softmax",
"torch.cuda.manual_seed",
"torch.manual_seed",
"torch.cat",
"torch.zeros",
"torch.nn.Embedding",
"numpy.mean",
"torch.rand",
"torch.cuda.is_available",
"torch.masked_select",
"torch.nn.functio... |
stephenroller/naacl2016 | [
"486ded494fe5d115a426efea66897632d3e33253"
] | [
"ctxpredict/ioutil.py"
] | [
"#!/usr/bin/env python\nimport os\nimport os.path\nimport logging\nimport itertools\nimport numpy as np\n\n# before anything else, configure the logger\nlogger = logging.getLogger()\nhandler = logging.StreamHandler()\nformatter = logging.Formatter(\"%(asctime)s %(levelname)-8s %(message)s\", datefmt=\"%Y-%m-%d %H... | [
[
"numpy.array"
]
] |
DenisDiachkov/AttnGAN | [
"f8800539de20e77a08ec3ae371a29ce94769be40"
] | [
"code/miscc/losses.py"
] | [
"import torch\nimport torch.nn as nn\n\nimport numpy as np\nfrom miscc.config import cfg\n\nfrom GlobalAttention import func_attention\n\n\n# ##################Loss for matching text-image###################\ndef cosine_similarity(x1, x2, dim=1, eps=1e-8):\n \"\"\"Returns cosine similarity between x1 and x2, com... | [
[
"torch.ByteTensor",
"torch.nn.CrossEntropyLoss",
"torch.norm",
"torch.mean",
"torch.cat",
"torch.sum",
"torch.nn.BCELoss",
"numpy.concatenate",
"torch.log"
]
] |
quamernasim/PETAI-master | [
"d76f37bea1e313246a556871c6304370e9a5616b"
] | [
"core/models/Redundant/SeismicNet6LayerEncoder.py"
] | [
"\"\"\"\n This is our proposed Seismic Net for semantic segmentation of facies from seismic images. This Network has\n residual connections in both Encoder and Decoder. It has also long residual skip connections to retain the\n spatial locations. Primary investigations shows promising results. Need to play... | [
[
"torch.nn.PReLU",
"torch.nn.Conv2d",
"torch.nn.ConvTranspose2d",
"torch.nn.BatchNorm2d"
]
] |
Tarpelite/title_generation | [
"8b9a9878e42ef1217b346daf492450c3d004dd21"
] | [
"examples/language-modeling/run_language_modeling_gen.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may... | [
[
"torch.utils.data.dataloader.DataLoader",
"torch.utils.data.sampler.RandomSampler",
"torch.utils.data.distributed.DistributedSampler"
]
] |
smoorjani/LA-Crime-Analysis | [
"26dfeae3a1b7e885a9bd1f78af2c5c5df5b7d071"
] | [
"geographic_mapping.py"
] | [
"import plotly\r\nimport plotly.plotly as py\r\nimport plotly.graph_objs as go\r\nimport pandas as pd\r\n\r\n# Plots each crime on a map of Los Angeles\r\n\r\nplotly.tools.set_credentials_file(username='smoorjani', api_key='ZNLECT9fuPKYvIqUfd1M')\r\n\r\nmapbox_access_token = 'pk.eyJ1Ijoic2FtcmFqbSIsImEiOiJjanFsNnpn... | [
[
"pandas.read_csv"
]
] |
khalillakhdhar/recommander_python | [
"1a29131dd91dc68b271882124abf271177921641"
] | [
"caserec/recommenders/item_recommendation/item_attribute_knn.py"
] | [
"# coding=utf-8\n\"\"\"\"\n Item Based Collaborative Filtering Recommender with Attributes (Item Attribute KNN)\n [Item Recommendation (Ranking)]\n\n Its philosophy is as follows: in order to determine the rating of User u on item m, we can find other movies that\n are similar to item m, and based on Us... | [
[
"numpy.isnan"
]
] |
bartongroup/Simpson_Barton_Nanopore_1 | [
"1b509454a9e25a8c81be5092f8e525ca00e7b5a5"
] | [
"pipeline/chimera_pipeline/scripts/chimerID/chimerID/logodds.py"
] | [
"import itertools as it\nimport numpy as np\nimport pandas as pd\nfrom scipy import stats\nfrom statsmodels.stats.multitest import multipletests\n\n\ndef read_all_chimeric_counts(h5_fns, sample_names, normalise=True):\n chimeric_counts = {}\n all_gene_non_chimeric_counts = {}\n for sample, h5_fn in zip(sam... | [
[
"pandas.read_hdf",
"pandas.concat",
"scipy.stats.ks_2samp",
"pandas.Series",
"numpy.log2",
"pandas.DataFrame.from_dict",
"numpy.array"
]
] |
10imaging/Open3D | [
"057c1e1c74f58042e6c0da3368eddc6701c53613"
] | [
"examples/Python/Basic/transformation.py"
] | [
"# Open3D: www.open3d.org\n# The MIT License (MIT)\n# See license file or visit www.open3d.org for details\n\n# examples/Python/Utility/transformation.py\n\nimport numpy as np\nimport open3d as o3d\nimport time\n\n\ndef geometry_generator():\n mesh = o3d.geometry.TriangleMesh.create_sphere()\n verts = np.asar... | [
[
"numpy.asarray",
"numpy.random.uniform",
"numpy.sqrt"
]
] |
jorgesantos/Detectron2 | [
"3bdf3ab4a4626985b3581da0a5b9e8c534b56980"
] | [
"detectron2/utils/visualizer.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport colorsys\nimport logging\nimport math\nimport numpy as np\nfrom enum import Enum, unique\nimport cv2\nimport matplotlib as mpl\nimport matplotlib.colors as mplc\nimport matplotlib.figure as mplfigure\nimport pycocotools.mask as mask_uti... | [
[
"numpy.split",
"numpy.sqrt",
"numpy.asarray",
"numpy.max",
"torch.unique",
"torch.device",
"matplotlib.colors.to_rgb",
"numpy.unique",
"matplotlib.backends.backend_agg.FigureCanvasAgg",
"numpy.clip",
"numpy.stack",
"numpy.frombuffer",
"numpy.argmax",
"numpy.... |
Musyue/mobile_robot | [
"ed8a75c41e8ccaf1b48639239e4119bf2d1d5f65"
] | [
"src/archtive_code/mobile_4wd_driver_hoffman_test5.py"
] | [
"#! /usr/bin/env python\n# coding=utf-8\nimport rospy\nimport sys\nfrom std_msgs.msg import String,Float64,Bool,Int64MultiArray\nfrom nav_msgs.msg import Path\nfrom geometry_msgs.msg import Quaternion,Point,Pose\nfrom sensor_msgs.msg import Imu\nimport time \nfrom math import *\nimport numpy as np\nfrom mobile_cont... | [
[
"matplotlib.pyplot.ion",
"scipy.io.loadmat",
"matplotlib.pyplot.figure"
]
] |
mollerhoj/pyro | [
"20b476442c8f7a415407ef1770e9abda9df4420d"
] | [
"pyro/distributions/transforms/__init__.py"
] | [
"# Copyright (c) 2017-2019 Uber Technologies, Inc.\n# SPDX-License-Identifier: Apache-2.0\n\nfrom torch.distributions import biject_to, transform_to\nfrom torch.distributions.transforms import * # noqa F403\nfrom torch.distributions.transforms import __all__ as torch_transforms\n\nfrom pyro.distributions.torch_tra... | [
[
"torch.distributions.biject_to",
"torch.distributions.transform_to",
"torch.distributions.biject_to.register",
"torch.distributions.transform_to.register"
]
] |
mathieu-sibue/preparing-interviews-with-nlp-audio | [
"aac0115d8fd476f7c0a7d9ca500706e839f6382c"
] | [
"back/src/features/topic_rank/topicrank.py"
] | [
"\n\"\"\"TopicRank keyphrase extraction model.\n\nGraph-based ranking approach to keyphrase extraction described in:\nhttps://aclanthology.org/I13-1062.pdf\n\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport string\nfrom itertools impor... | [
[
"scipy.cluster.hierarchy.linkage",
"scipy.spatial.distance.pdist",
"scipy.cluster.hierarchy.fcluster"
]
] |
chengfenggui/attention-is-all-you-need-pytorch | [
"368b7c1a48b3c0a495f97de185e336d546aef2cc"
] | [
"conv_transformer/UNet/Model.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom .Parts import DoubleConv, Down, Up, OutConv\r\n\r\n\r\nclass UNet(nn.Module):\r\n def __init__(self, in_channels, out_channels, depth=2, bilinear=True):\r\n super(UNet, self).__init__()\r\n\r\n self.in_channels = in_c... | [
[
"torch.nn.ModuleList"
]
] |
JINJINT/MABtest | [
"e20764baeddf0f32d058c17852eb6981145c15b9"
] | [
"MABtest/generatemu.py"
] | [
"# scrip fot generate the true mean of the arms according to reward type and time variation\nfrom numpy import sqrt, log, exp, mean, cumsum, zeros, argsort, argmin, argmax, array, random, argwhere, sin, mod, power\nfrom numpy.random import rand\nfrom .toimport import *\nfrom .plotting import *\nimport dill\nimport ... | [
[
"numpy.random.rand",
"numpy.sin"
]
] |
jkwang1992/sbp-env | [
"929a88c30e0056cce55ef22f74bfa218c1e78cc8"
] | [
"samplers/randomPolicySampler.py"
] | [
"import random\n\nimport numpy as np\nfrom overrides import overrides\n\nfrom randomness import SUPPORTED_RANDOM_METHODS, RandomnessManager\nfrom samplers.baseSampler import Sampler\nfrom utils import planner_registry\n\n\nclass RandomPolicySampler(Sampler):\n r\"\"\"Uniformly and randomly samples configurations... | [
[
"numpy.random.uniform"
]
] |
swt2c/pandas | [
"70773d952bf52229d7214707ce6d66cee70607cb"
] | [
"pandas/tests/groupby/test_categorical.py"
] | [
"# -*- coding: utf-8 -*-\nfrom datetime import datetime\n\nimport numpy as np\nimport pytest\n\nfrom pandas.compat import PY37\n\nimport pandas as pd\nfrom pandas import (\n Categorical, CategoricalIndex, DataFrame, Index, MultiIndex, Series, qcut)\nimport pandas.util.testing as tm\nfrom pandas.util.testing impo... | [
[
"pandas.Series",
"numpy.linspace",
"numpy.asarray",
"pandas.DataFrame",
"pandas.util.testing.assert_frame_equal",
"numpy.max",
"pandas.util.testing.assert_index_equal",
"numpy.random.randn",
"numpy.mean",
"numpy.random.randint",
"pandas.util.testing.assert_numpy_array_e... |
wolfd/jpeg-svg | [
"42370757ec98642b57486c7d2fd3fae7df9bc271"
] | [
"jpeg_parser.py"
] | [
"import typing as T\nimport struct\nimport enum\nimport numpy as np\n\nfrom zigzag import fill_zigzag\nfrom huffman import Huffman\n\nBLOCK_SIDE_PX = 8\nBLOCK_SIZE_BYTE = BLOCK_SIDE_PX * BLOCK_SIDE_PX\n\nSOI_EXPECTED = (0xFF, 0xD8)\nJFIF_APP0_EXPECTED = (0xFF, 0xE0)\n\n\ndef unpack_from_file(format: str, file_: T.B... | [
[
"numpy.zeros"
]
] |
girving/lucid | [
"19f171cd73f763f3143b74f7d886bcb499d0e058"
] | [
"lucid/optvis/param/images.py"
] | [
"\n# Copyright 2018 The Lucid 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 require... | [
[
"tensorflow.concat",
"tensorflow.nn.sigmoid"
]
] |
Wanjpeng/nvrjevnkbklremvklmkekrbemk | [
"ab0ef61a04a7a46021fd546a6112b11780849d82"
] | [
"main.py"
] | [
"import time\r\n#from multiprocessing import Pool\r\n#from multiprocessing import freeze_support\r\nfrom threading import Thread\r\nimport numpy as np\r\nimport random\r\nimport win32gui, win32con\r\n\r\nCONFIGFILE = '.\\lwp.conf'\r\nclass DriftWords:\r\n def __init__(self):\r\n self.Words = []\r\n ... | [
[
"numpy.random.randn",
"numpy.random.randint"
]
] |
dlgeorge/geoclaw | [
"3fa4dcea359e6439d1fbb79f0d478e65ff2ea38f"
] | [
"examples/multi-layer/plane_wave/setplot.py"
] | [
"\n\"\"\"\nSet up the plot figures, axes, and items to be done for each frame.\n\nThis module is imported by the plotting routines and then the\nfunction setplot is called to set the plot parameters.\n\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\nimport os\n\nimport nu... | [
[
"matplotlib.pyplot.gca",
"numpy.cos",
"numpy.sin"
]
] |
astro-projects/astro | [
"7fa0404fc690569ff85e379ecca54778f09a9333"
] | [
"src/astro/files/types/csv.py"
] | [
"import io\n\nimport pandas as pd\n\nfrom astro.constants import FileType as FileTypeConstants\nfrom astro.files.types.base import FileType\n\n\nclass CSVFileType(FileType):\n \"\"\"Concrete implementation to handle CSV file type\"\"\"\n\n def export_to_dataframe(self, stream, **kwargs) -> pd.DataFrame:\n ... | [
[
"pandas.read_csv"
]
] |
jenish-cj/botnlufoodrest | [
"b41aa2c7a1f6e492e10f07e67562b612b5b13a53"
] | [
"rasa_core/policies/trainer.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport logging\n\nimport numpy as np\nfrom builtins import object\n\nfrom rasa_core.domain import check_domain_sanity\nfrom rasa_core.interpreter import RegexIn... | [
[
"numpy.zeros"
]
] |
erikvdp/boruta_py | [
"e04d1a17de142679eabebebd8cedde202587fbf1"
] | [
"boruta/boruta_py.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nAuthor: Daniel Homola <dani.homola@gmail.com>\n\nOriginal code and method by: Miron B Kursa, https://m2.icm.edu.pl/boruta/\n\nLicense: BSD 3 clause\n\"\"\"\n\nfrom __future__ import print_function, division\nimport numpy as np\nimport scipy as sp\nfrom sklear... | [
[
"numpy.nanmedian",
"numpy.take",
"numpy.sqrt",
"numpy.asarray",
"numpy.minimum.accumulate",
"numpy.any",
"numpy.where",
"numpy.hstack",
"sklearn.utils.check_X_y",
"numpy.empty_like",
"numpy.arange",
"numpy.copy",
"numpy.apply_along_axis",
"scipy.stats.mstats... |
AdityaMate/collapsing_bandits | [
"2aecccc6fd986f869088438ea5eba7bbfd5c1e91"
] | [
"code/compute_exact_yundi_infinite.py"
] | [
"from __future__ import print_function\nimport numpy as np \nimport argparse\nfrom itertools import product, combinations\nfrom functools import reduce\nfrom tqdm import tqdm\nimport subprocess\nimport os\nimport multiprocessing\nimport platform\n# import special_pomdp\n\nimport traceback, functools, multiprocessin... | [
[
"numpy.arange",
"numpy.array",
"numpy.zeros"
]
] |
stonebig/holoviews | [
"d5270c30dd1af38a785452aeac2fbabbe528e892"
] | [
"holoviews/plotting/mpl/__init__.py"
] | [
"import os\nfrom distutils.version import LooseVersion\n\nfrom matplotlib import rc_params_from_file\nfrom matplotlib.colors import ListedColormap\n\nfrom ...core import Layout, Collator, GridMatrix, config\nfrom ...core.options import Cycle, Palette, Options\nfrom ...core.overlay import NdOverlay, Overlay\nfrom ..... | [
[
"matplotlib.rc_params_from_file"
]
] |
TheFloe1995/correct-pose | [
"90c3c46ca50b07526a4df36645fa71572255a950"
] | [
"unit_tests/helpers.py"
] | [
"import torch.nn as nn\n\n\nclass DummyLoss(nn.Module):\n def forward(self, predictions, labels):\n return predictions.sum()\n\n\nclass DummyModel(nn.Module):\n def __init__(self):\n super(DummyModel, self).__init__()\n self.net = nn.Linear(63, 63)\n\n def forward(self, pose_batch):\n ... | [
[
"torch.nn.Linear"
]
] |
boldyshev/sutton | [
"6155f13491a859283ebb2154c978b2727a4c27af"
] | [
"chapter6/exercise6_9.py"
] | [
"#!/usr/bin/env python3\n\"\"\"Exercise 6.9, page 130\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom example6_5 import WindyGridworld, sarsa_windy\n\n\ndef plot_time_episodes(world_type, actions):\n dim = 10, 7\n start = 0, 3\n goal = 7, 3\n state_action_dim = *dim, len(actions)\n\... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.ylabel"
]
] |
MarShin/pymarl2 | [
"b6598cbd3ca044564270b6cdb1bb495173af7f4c"
] | [
"src/main.py"
] | [
"import numpy as np\nimport os\nimport collections\nfrom os.path import dirname, abspath, join\nfrom copy import deepcopy\nfrom sacred import Experiment, SETTINGS\nfrom sacred.observers import FileStorageObserver\nfrom sacred.utils import apply_backspaces_and_linefeeds\nimport sys\nimport torch as th\nfrom utils.lo... | [
[
"torch.manual_seed",
"numpy.random.seed"
]
] |
baranshad/models | [
"aaf008855e9764f32d974e86f8e1f9cfddfafd9a"
] | [
"research/object_detection/core/freezable_batch_norm_test.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.test.main",
"tensorflow.keras.backend.eval",
"numpy.random.normal",
"tensorflow.keras.backend.set_learning_phase",
"tensorflow.keras.models.Sequential"
]
] |
nikoladze/pyhf | [
"03b227373b3f893eb501178c3613e0919d5198d8"
] | [
"tests/test_scripts.py"
] | [
"import json\nimport shlex\nimport pyhf\nimport time\nimport pytest\n\n\ndef test_version(script_runner):\n command = 'pyhf --version'\n start = time.time()\n ret = script_runner.run(*shlex.split(command))\n end = time.time()\n elapsed = end - start\n assert ret.success\n assert pyhf.__version_... | [
[
"numpy.array_equal"
]
] |
vohoaiviet/tensor2tensor | [
"c2bd023ab7fc8ca0f4c4138e955845537d10ca55"
] | [
"tensor2tensor/data_generators/audio_test.py"
] | [
"# Copyright 2017 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable... | [
[
"tensorflow.test.main"
]
] |
aiporre/uBAM | [
"547b842b8dbaa221a2dcb93bf040f5decaacb517"
] | [
"behaviorAnalysis/magnification/run_magnification/compute_magnification_flow.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nPython 2.7\n@author: Biagio Brattoli \nbiagio.brattoli@iwr.uni-heidelberg.de\nLast Update: 23.8.2018\n\nUse Generative Model for posture extrapolation\n\"\"\"\nfrom datetime import datetime\nimport os, sys, numpy as np, argparse\nfrom time import time\nfrom... | [
[
"numpy.savez",
"scipy.misc.imread",
"numpy.stack"
]
] |
PURE-melo/GRS-Det | [
"fcc16a48ba628e7bca83795120108ae8a4fa3027"
] | [
"gaussian_mask.py"
] | [
"import numpy as np\r\nimport cv2\r\nimport matplotlib.pyplot as plt\r\n\r\n\r\ndef gaussian(kernel, w):\r\n sigma = ((kernel-1) * 0.5 - 1) * 0.3 + 0.8\r\n s = 2*(sigma**2)\r\n dx = np.exp(-1*w*np.square(np.arange(kernel) - int(kernel / 2)) / s)\r\n return np.reshape(dx,(-1,1))\r\n\r\ndef gaussian_mask(... | [
[
"numpy.array",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.imshow",
"numpy.maximum",
"numpy.min",
"numpy.reshape",
"numpy.arange",
"numpy.transpose",
"numpy.max",
"matplotlib.pyplot.axis",
"numpy.exp",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show",
... |
varunagrawal/GTDynamics | [
"1f48112a5ffd273c74c5ce2ddda4166e2fae7dff"
] | [
"scripts/nithya00_constrained_opt_benchmark.py"
] | [
"\"\"\"\n * GTDynamics Copyright 2020, Georgia Tech Research Corporation,\n * Atlanta, Georgia 30332-0415\n * All Rights Reserved\n * See LICENSE for the license information\n *\n * @file nithya_yetong00_constrainedopt_benchmark.py\n * @brief Plot intermediate results for penalty method optimizer vs augmented lagr... | [
[
"matplotlib.pyplot.subplots",
"numpy.array",
"matplotlib.pyplot.show",
"numpy.cumsum"
]
] |
diddytpq/Predict-Tennisball-LandingPoint | [
"0ae4a9ff45fd4dd82b4b4e3cc2533e7fd5d1506a"
] | [
"src/predict_ball_pos/src/kalman_utils/utils.py"
] | [
"import cv2\nimport numpy as np\nimport os\nimport math\nfrom scipy.spatial import distance as dist\nfrom collections import OrderedDict\n\nlower_green = np.array([89, 250, 250])\nupper_green = np.array([90, 255, 255])\n\nlower_rgb = np.array([10,180,120])\nupper_rgb = np.array([40,255,250])\n\n\nclass Bouncing_poi... | [
[
"numpy.isnan",
"numpy.array",
"numpy.argmax"
]
] |
APrioriInvestments/typed_python | [
"a3191e5d30333eba156c2a910abc78f7813dcaa3"
] | [
"typed_python/compiler/tests/compiler_typed_python_comparison_test.py"
] | [
"# Copyright 2017-2019 typed_python Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by... | [
[
"numpy.isnan",
"numpy.isneginf",
"numpy.isinf",
"numpy.isfinite"
]
] |
epfl-lasa/rds | [
"574b3881dbaf4fdcd785dd96ba4c451928454b40"
] | [
"rds/script/trajectory_plot.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nfrom matplotlib.colors import LinearSegmentedColormap\n\nimport capsule_distance\n\ncapsule = capsule_distance.Capsule(0.18, -0.5, 0.45)\ncapsule_larger = capsule_distance.Capsule(0.18, -0.5, 0.5)\n\ndef cmap_map(function, cmap):\n ... | [
[
"matplotlib.pyplot.gca",
"numpy.logical_not",
"numpy.linspace",
"matplotlib.pyplot.scatter",
"numpy.min",
"numpy.arange",
"matplotlib.colors.LinearSegmentedColormap",
"numpy.logical_and",
"matplotlib.pyplot.subplots",
"numpy.genfromtxt",
"matplotlib.pyplot.Circle",
... |
SamBoutin/majorana-rgf-grape | [
"3233627125519a3cc36b1d167c00d39b54abc48d",
"3233627125519a3cc36b1d167c00d39b54abc48d"
] | [
"setup.py",
"rgf_grape/optimization/wireOptimizer.py"
] | [
"\"\"\"\nThis file is part of the rgf_grape python package.\nCopyright (C) 2017-2018 S. Boutin\nFor details of the rgf_grape algorithm and applications see:\nS. Boutin, J. Camirand Lemyre, and I. Garate, Majorana bound state engineering \nvia efficient real-space parameter optimization, ArXiv 1804.03170 (2018).\n\"... | [
[
"numpy.get_include"
],
[
"numpy.sign",
"numpy.random.uniform",
"numpy.array",
"numpy.ones"
]
] |
AlexWang1996/classfication_utilities | [
"9b8fb19c99a1ba8503b6117401f1dce7840ce4a5"
] | [
"vgg16.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\nimport numpy as np\n\ndef vgg16(images, classes):\n\n # conv1_1\n with tf.name_scope('conv1_1') as scope:\n kernel = tf.Variable(tf.truncated_normal([3, 3, 3, 64], dtype=tf.float32,stddev=1e-1), name='weights')\n conv = tf.n... | [
[
"tensorflow.nn.bias_add",
"tensorflow.nn.relu",
"tensorflow.matmul",
"tensorflow.truncated_normal",
"tensorflow.constant",
"tensorflow.nn.max_pool",
"tensorflow.reshape",
"tensorflow.name_scope",
"tensorflow.nn.conv2d"
]
] |
phycept/relation-autoencoder | [
"7a43d4f1ea3a4155181712394b08a82c31c54db3",
"7a43d4f1ea3a4155181712394b08a82c31c54db3"
] | [
"learning/models/decoders/SelectionalPreferences.py",
"learning/NegativeExampleGenerator.py"
] | [
"__author__ = 'enfry'\n\nimport math\nimport theano\nfrom definitions import settings\nimport numpy as np\nimport theano.tensor as T\nimport cPickle as pickle\n\nclass SelectionalPreferences(object):\n\n def __init__(self, rng, embedSize, relationNum, argVocSize, data, ex_emb):\n\n self.k = embedSize\n ... | [
[
"numpy.zeros"
],
[
"numpy.zeros"
]
] |
kochanczyk/PyBNF | [
"d691d1a043b11b454f1317158067b65a47c6714b"
] | [
"tests/test_simplex.py"
] | [
"from .context import data, algorithms, pset, objective, config\nimport numpy as np\nfrom copy import deepcopy\n\nfrom shutil import rmtree\n\n\nclass TestSimplex:\n\n @classmethod\n def setup_class(cls):\n cls.data1s = [\n '# time v1_result v2_result v3_result\\n',\n ' 1... | [
[
"numpy.testing.assert_almost_equal"
]
] |
guoyii/ECG | [
"ef96d5e3291fd6abd0d2c6a2f3d433d2d7336d2e"
] | [
"Frequency/main_mit.py"
] | [
"from sklearn.decomposition import PCA\nfrom sklearn.externals import joblib\nfrom sklearn.svm import LinearSVC\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler\n\nfrom utils import read_dataPath\nfrom utils import read_data\nfrom utils import myfft\nfrom utils... | [
[
"numpy.hstack",
"sklearn.model_selection.train_test_split",
"sklearn.svm.LinearSVC",
"sklearn.preprocessing.StandardScaler",
"numpy.array",
"sklearn.decomposition.PCA"
]
] |
sankalpdayal/ProgrammingCarla | [
"4cbb1ba2a9f861f544fa71f9d0db2beff5cdd3a0"
] | [
"ros/src/tl_detector/light_classification/tl_classifier.py"
] | [
"from styx_msgs.msg import TrafficLight\nfrom sklearn.linear_model import LogisticRegression\nimport pickle\nimport tensorflow as tf\nfrom keras.models import load_model\nimport numpy as np\nimport cv2\n\nclass TLClassifier(object):\n def __init__(self):\n #TODO load classifier\n detect_model_name ... | [
[
"tensorflow.Graph",
"tensorflow.import_graph_def",
"tensorflow.gfile.GFile",
"numpy.squeeze",
"tensorflow.ConfigProto",
"numpy.mean",
"tensorflow.Session",
"numpy.ravel",
"tensorflow.GraphDef",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
Jin-Tao-208/web_science_coursework | [
"bb4ab2226b70e7b0f7bbef40ceb002900e757a31"
] | [
"LSH.py"
] | [
"from pymongo import MongoClient\r\nfrom nltk.tokenize import RegexpTokenizer\r\nfrom stop_words import get_stop_words\r\nimport sys\r\nimport random\r\nimport time\r\nimport binascii\r\nimport numpy as np\r\nimport re\r\nimport json\r\n\r\n# client = MongoClient('127.0.0.1', 27017) # is assigned local port\r\n# d... | [
[
"numpy.array"
]
] |
HighDeFing/thesis_v4 | [
"2dc9288af75a8b51fe54ed66f520e8aa8a0ab3c7"
] | [
"scripts/haystack_files/haystack_upload_files.py"
] | [
"from haystack.nodes import PDFToTextConverter\nfrom haystack.document_stores import ElasticsearchDocumentStore\nfrom haystack.nodes import DensePassageRetriever\nfrom haystack.nodes import FARMReader, ElasticsearchRetriever\nfrom haystack.pipelines import ExtractiveQAPipeline, DocumentSearchPipeline\nfrom haystack... | [
[
"pandas.read_csv",
"numpy.vectorize"
]
] |
harmonic-minimization/harmoni_manuscript_codes | [
"6cecd98208b3955d0a20b1d258cc06477e615edf"
] | [
"simulations_toys_sc1_grad_grid.py"
] | [
"\"\"\"\n-----------------------------------------------------------------------\nHarmoni: a Novel Method for Eliminating Spurious Neuronal Interactions due to the Harmonic Components in Neuronal Data\nMina Jamshidi Idaji, Juanli Zhang, Tilman Stephani, Guido Nolte, Klaus-Robert Mueller, Arno Villringer, Vadim V. N... | [
[
"scipy.signal.filtfilt",
"numpy.random.random",
"numpy.arange",
"numpy.real",
"numpy.array",
"numpy.empty",
"numpy.random.randint"
]
] |
uditgupta002/RegularizationMethodsForNN | [
"2554e088bafa9932e6e4d7f5ba033a2b79afe29d"
] | [
"src/regularization_utils.py"
] | [
"'''\nCreated on Nov 7, 2017\n\n@author: udit.gupta\n'''\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport h5py\nimport sklearn\nimport sklearn.datasets\nimport sklearn.linear_model\nimport scipy.io\n\ndef sigmoid(x):\n \"\"\"\n Compute the sigmoid of x\n\n Arguments:\n x -- A scalar or numpy... | [
[
"numpy.dot",
"matplotlib.pyplot.contourf",
"numpy.sqrt",
"numpy.linspace",
"numpy.random.randn",
"numpy.mean",
"numpy.exp",
"numpy.square",
"numpy.arange",
"numpy.sin",
"numpy.nansum",
"numpy.zeros",
"numpy.log",
"numpy.int64",
"numpy.array",
"matplo... |
g6ling/Pytorch-Cartpole | [
"ecb7b622cfefe825ac95388cceb6752413d90a2a",
"ecb7b622cfefe825ac95388cceb6752413d90a2a"
] | [
"parallel/3-ACER/worker.py",
"POMDP/3-DRQN-Store-State/model.py"
] | [
"import gym\nimport torch\nimport torch.multiprocessing as mp\nimport numpy as np\nfrom model import LocalModel\nfrom memory import Memory, Trajectory\nfrom config import env_name, max_episode, log_interval, replay_memory_capacity, replay_ratio\n\nclass Worker(mp.Process):\n def __init__(self, global_model, glob... | [
[
"numpy.random.poisson",
"torch.Tensor"
],
[
"torch.max",
"torch.nn.LSTM",
"torch.nn.Linear",
"torch.stack",
"torch.nn.init.xavier_uniform"
]
] |
simonjantsch/switss | [
"53865f218ac581b51e203becf6f26fedd0bc1326"
] | [
"switss/model/reachability_form.py"
] | [
"from . import AbstractMDP,MDP\nfrom ..utils import InvertibleDict, cast_dok_matrix, DTMCVisualizationConfig, VisualizationConfig\nfrom ..solver.milp import LP\n\nfrom collections import defaultdict\nfrom bidict import bidict\nimport copy as copy\nimport numpy as np\nfrom scipy.sparse import dok_matrix,hstack,vstac... | [
[
"scipy.sparse.dok_matrix",
"numpy.ones",
"scipy.sparse.vstack",
"scipy.sparse.hstack",
"numpy.zeros"
]
] |
ruivieira/workshop-recommendation-engines | [
"3efe678856dde1862cf6262ad1117aaa7b506265"
] | [
"utils.py"
] | [
"import csv\nfrom scipy import sparse\nimport numpy as np\n\ndef load_data(path):\n max_movie = 0\n max_user = 0\n data = []\n pairs = []\n with open(path, 'rt') as csvfile:\n reader = csv.reader(csvfile, delimiter=',', quotechar='\"')\n next(reader, None)\n for row in reader:\n ... | [
[
"numpy.array",
"scipy.sparse.lil_matrix"
]
] |
nguyentthai96/Mem2Seq | [
"7ad9fb8c2e70b39ebfcbea659d755d0ee9c2bbf5"
] | [
"models/enc_vanilla.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torch import optim\nimport torch.nn.functional as F\nfrom utils.masked_cross_entropy import *\nfrom utils.config import *\nimport random\nimport numpy as np\nimport datetime\nfrom utils.measures import wer,moses_multi_bleu\nimport nltk\... | [
[
"torch.nn.Dropout",
"torch.LongTensor",
"torch.nn.LSTM",
"torch.load",
"torch.zeros",
"torch.nn.Embedding",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.Linear",
"torch.nn.utils.rnn.pad_packed_sequence",
"numpy.transpose",
"numpy.array",
"torch.save"
]
] |
ecreager/models | [
"dafed92d823dee3ee8f176ee52288554df30220d"
] | [
"research/object_detection/dataset_tools/oid_geotagged_tfrecord_creation.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.train.Features"
]
] |
juiyuliao/GSEA | [
"edf0e7ace73791d425a1d5934834ac7bb8306c05"
] | [
"gseapy/algorithm.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport sys, logging\nimport numpy as np\n#from functools import reduce\n#from multiprocessing import Pool\nfrom math import ceil\nfrom gseapy.stats import multiple_testing_correction\nfrom joblib import delayed, Parallel\n\n\ndef enrichment_score(gene_list, correl_vector, gene_set, weigh... | [
[
"numpy.sqrt",
"numpy.in1d",
"numpy.cumsum",
"numpy.seterr",
"numpy.iinfo",
"numpy.select",
"numpy.searchsorted",
"numpy.where",
"numpy.hstack",
"numpy.flatnonzero",
"numpy.apply_along_axis",
"numpy.repeat",
"numpy.zeros",
"numpy.array",
"numpy.random.Ran... |
flyliu2017/bert | [
"cc6e676ff8693a6cc31ade9d7a6cbb0789d7877c"
] | [
"run_token_level_classifier_multigpus.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | [
[
"tensorflow.contrib.cluster_resolver.TPUClusterResolver",
"tensorflow.train.LoggingTensorHook",
"tensorflow.metrics.accuracy",
"tensorflow.FixedLenFeature",
"tensorflow.gfile.Exists",
"tensorflow.reduce_sum",
"tensorflow.gfile.GFile",
"tensorflow.cast",
"tensorflow.train.init_f... |
SergioSV96/fastML | [
"e9311f3e51cfd06a898d254b0456b2b31e191746"
] | [
"fastML.py"
] | [
"\r\ndef fastML(X, Y, size):\r\n from sklearn.metrics import accuracy_score, confusion_matrix, classification_report\r\n from sklearn.model_selection import train_test_split\r\n from sklearn.ensemble import RandomForestClassifier\r\n from sklearn.tree import DecisionTreeClassifier\r\n from sklearn.ne... | [
[
"sklearn.ensemble.RandomForestClassifier",
"sklearn.model_selection.train_test_split",
"pandas.DataFrame",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.metrics.confusion_matrix",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.metrics.classification_report",
"sklearn.metrics.... |
jinPrelude/eye_tracking | [
"2d9e14df274e4de5d26de4589e47756522662506"
] | [
"eye_tracking/eye_track_cnn.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport cv2\nimport os\n\nimg_width = 640\nimg_height = 480\n\nos.chdir('/home/leejin/git/image_processing/eye-tracking')\n\n\n\ndef next_batch(i, batch_size):\n os.chdir('/home/leejin/git/image_processing/eye-tracking')\n list = np.loadtxt('dataset/3/eyesPos.csv',... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.nn.relu",
"tensorflow.matmul",
"tensorflow.nn.max_pool",
"numpy.vstack",
"tensorflow.reshape",
"tensorflow.global_variables",
"tensorflow.placeholder",
"tensorflow.train.AdadeltaOptimizer",
"numpy.concatenate",
"tenso... |
jjkotni/faas-profiler | [
"3a7565981d7b6f7a03b1d7595e458ef1ff20e8b9"
] | [
"workload-analyzer/ContextSwitches.py"
] | [
"import pdb\nfrom PerfMonAnalyzer import ReadPerfMon\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport pdb\n\nfrom WorkloadChecker import CheckWorkloadValidity\n\ndef main():\n axes =[]\n plt.figure()\n# for i in [20, 45, 60, 120]: #gap between expts\n# for j in [3,6, 9, 12, 15, 18, 21, ... | [
[
"matplotlib.pyplot.legend",
"pandas.concat",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel"
]
] |
Lucas-SEB/Sewer-Pipes-Measurement | [
"b449a8b5110cedcd93b9e7f3a63d044bd299ba9f"
] | [
"src/realsense-ransac/Python_scripts/point_cloud_848-480_resolution.py"
] | [
"import numpy as np # Fundamental package for scientific computing\nimport matplotlib.pyplot as plt # 2D plotting library producing publication quality figures\nimport pyrealsense2.pyrealsense2 as rs # Intel RealSense cross-platform open-source API\nimport open3d as o3d\nimport i... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.title",
"numpy.asarray",
"numpy.concatenate",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
]
] |
EelcovdW/dists.pt | [
"994c698c846226ccf1905302f2bab860a2b24ca4"
] | [
"probabll/distributions/concrete.py"
] | [
"import torch\nfrom torch.distributions.uniform import Uniform\nfrom torch.distributions.kl import register_kl\n\nEPS = 1e-5\n\nclass BinaryConcrete(torch.distributions.relaxed_bernoulli.RelaxedBernoulli):\n \n def __init__(self, temperature, probs=None, logits=None, validate_args=None):\n super(Binary... | [
[
"torch.sigmoid",
"torch.Size",
"torch.distributions.kl.register_kl",
"torch.log",
"torch.full_like"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.