repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
biorobotics/PRD_environments
[ "ddb06f118da9bafe04e549a348a5f722443bb57f" ]
[ "multiagent/scenarios/crossing_greedy.py" ]
[ "import numpy as np\nfrom multiagent.core import World, Agent, Landmark\nfrom multiagent.scenario import BaseScenario\nimport webcolors\nimport math\nimport random\n\n\nclass Scenario(BaseScenario):\n\tdef make_world(self):\n\t\tworld = World()\n\t\t# set any world properties first\n\t\t# world.dim_c = 2\n\t\tself....
[ [ "numpy.square", "numpy.concatenate", "numpy.random.uniform", "numpy.array", "numpy.zeros" ] ]
artificiallyintelligent-ai/hackathon-base
[ "da61a65d20afcb804fee4e45c3504ba9b72ee9ac" ]
[ "hackathon/game/noisemap.py" ]
[ "import noise\nimport numpy as np\n\n\nclass NoiseMap2:\n def __init__(self, seed=None, shape=(1024, 1024), octaves=6, persistence=0.5,\n lacunarity=2, scale=100):\n assert len(shape) == 2\n\n if seed is None:\n seed = np.random.randint(0, scale)\n\n self.noise_map...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "numpy.zeros", "numpy.random.randint" ] ]
AnonymousAuthor2013/KnowAlpha
[ "7332231bbb34d7dcdab796aa20fc561dbca1fb76" ]
[ "programmingalpha/retrievers/retriever_input_process.py" ]
[ "import json\nimport os\nimport torch\nimport random\nimport tqdm\nfrom torch.utils.data import (DataLoader, RandomSampler, SequentialSampler,\n TensorDataset)\nfrom programmingalpha.Utility.processCorpus import CorpusProcessor\nfrom programmingalpha import AlphaPathLookUp\nfrom program...
[ [ "torch.utils.data.TensorDataset", "torch.utils.data.SequentialSampler", "torch.utils.data.RandomSampler", "torch.utils.data.DataLoader", "torch.tensor" ] ]
Sam-Armstrong/Pulsar-Deep-Learning-Framework
[ "3a7aeebbcd7076c0e360ec524f57acfe8c6817d9" ]
[ "Tests/InitializationTests.py" ]
[ "from context import Initialization\nimport unittest\nimport numpy as np\n\nclass TestInitializations(unittest.TestCase):\n \n def testXavierInit(self):\n i = Initialization()\n W = i.Xavier_init(10, 10)\n self.assertAlmostEqual(np.sum(W), 1.0, 3) # Checks that they sum to one\n\n def ...
[ [ "numpy.sum" ] ]
mbarnig/glow-tts-train
[ "895160517409c4012776ea9ecf64e39ab251964b" ]
[ "glow_tts_train/layers.py" ]
[ "import typing\n\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\nfrom .utils import fused_add_tanh_sigmoid_multiply\n\n\nclass LayerNorm(nn.Module):\n def __init__(self, channels, eps=1e-4):\n super().__init__()\n self.channels = channels\n self.eps = eps\n\n ...
[ [ "torch.mean", "torch.zeros", "torch.sum", "torch.rsqrt", "torch.no_grad", "torch.FloatTensor", "torch.nn.Dropout", "torch.ones", "torch.nn.utils.remove_weight_norm", "torch.logdet", "torch.nn.Parameter", "torch.nn.ModuleList", "torch.nn.functional.conv2d", "...
alcinos/SPR
[ "dec8df83eeaa25a1d75ecff0cf4ce4bfae9cab4c" ]
[ "scripts/run.py" ]
[ "\n\"\"\"\nParallel sampler version of Atari DQN. Increasing the number of parallel\nenvironmnets (sampler batch_B) should improve the efficiency of the forward\npass for action sampling on the GPU. Using a larger batch size in the algorithm\nshould improve the efficiency of the forward/backward passes during tra...
[ [ "torch.manual_seed", "numpy.random.seed" ] ]
julienguy/desimeter
[ "9dd40251b0c483b525a952051a73587ac9180e8a" ]
[ "py/desimeter/match_positioners.py" ]
[ "import numpy as np\nimport desimeter.log\n\nlog = desimeter.log.get_logger()\n\n\ndef match2d(x1, y1, x2, y2, rad):\n \"\"\"Find all matches between x1, y1 and x2, y2 within radius rad.\"\"\"\n from scipy.spatial import cKDTree\n xx1 = np.stack([x1, y1], axis=1)\n xx2 = np.stack([x2, y2], axis=1)\n ...
[ [ "matplotlib.pyplot.legend", "numpy.sqrt", "matplotlib.pyplot.plot", "numpy.max", "numpy.arctan2", "numpy.searchsorted", "scipy.optimize.linear_sum_assignment", "scipy.spatial.cKDTree", "matplotlib.pyplot.gca", "numpy.unique", "numpy.stack", "numpy.flatnonzero", ...
c-koster/cs451-practicals
[ "3c183f78a2325dcbc6ba400c143807116186ee01" ]
[ "p12-logistic-regression.py" ]
[ "#%%\nfrom dataclasses import dataclass, field\nimport numpy as np\nfrom sklearn import metrics\nimport numpy as np\nfrom tqdm import tqdm\nimport random\nfrom typing import List, Dict\nfrom sklearn.utils import resample\nfrom scipy.special import expit\nfrom shared import bootstrap_auc\nfrom sklearn.model_selectio...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.tight_layout", "sklearn.linear_model.LogisticRegression", "numpy.random.seed", "matplotlib.pyplot.title", "numpy.asarray", "scipy.special.expit", "matplotlib.pyplot.savefig", "numpy.random.randn", "sklearn.utils.resample", ...
imjuanleonard/feast
[ "442ca5a1a448032d7096747160ea05f94aaaa7f5" ]
[ "sdk/python/feast/job.py" ]
[ "from typing import List\nfrom urllib.parse import urlparse\n\nimport fastavro\nimport grpc\nimport pandas as pd\n\nfrom feast.constants import CONFIG_TIMEOUT_KEY\nfrom feast.constants import FEAST_DEFAULT_OPTIONS as defaults\nfrom feast.serving.ServingService_pb2 import (\n DATA_FORMAT_AVRO,\n JOB_STATUS_DON...
[ [ "pandas.DataFrame.from_records" ] ]
DannyGsGit/Q_Pong
[ "6306f990b57efb60b91ad57cb58a9eac68f34172" ]
[ "Reference/database.py" ]
[ "import numpy as np\nimport gc\nimport time\nimport cv2\n\nclass database:\n\tdef __init__(self, params):\n\t\tself.size = params['db_size']\n\t\tself.img_scale = params['img_scale']\n\t\tself.states = np.zeros([self.size,84,84],dtype='uint8') #image dimensions\n\t\tself.actions = np.zeros(self.size,dtype='float32'...
[ [ "numpy.zeros", "numpy.transpose" ] ]
AQing-527/circle-deepSDF
[ "82a571353425f0e124fc067f729840ab94d785a5" ]
[ "code/circle_sampler.py" ]
[ "import numpy as np\nimport cv2\nfrom renderer import plot_sdf\n\nSHAPE_PATH = '../shapes/shape/'\nSHAPE_IMAGE_PATH = '../shapes/shape_images/'\nTRAIN_DATA_PATH = '../datasets/train/'\nVAL_DATA_PATH = '../datasets/val/'\nSAMPLED_IMAGE_PATH = '../datasets/sampled_images/'\nHEATMAP_PATH = '../results/true_heatmaps/'\...
[ [ "numpy.sqrt", "numpy.around", "numpy.linalg.norm", "numpy.cos", "numpy.sin", "numpy.concatenate", "numpy.apply_along_axis", "numpy.random.uniform", "numpy.array", "numpy.zeros", "numpy.double" ] ]
yyajima21/nn_tutorial
[ "83a2909587dec4d93afb786ba57e36b193b8b3cb" ]
[ "transfer-learning-for-computer-vision-tutorial/train.py" ]
[ "# License: BSD\n# Original Author: Sasank Chilamkurthy\n# This code is originally developed by Sasank Chilamkurthy \n# from the following website: \n# https://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html\n# I modified and refactoed the original code for my learning purpose.\n\nfrom __future__ imp...
[ [ "matplotlib.pyplot.imshow", "torch.max", "torch.utils.data.DataLoader", "torch.sum", "torch.set_grad_enabled", "torch.no_grad", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss", "numpy.clip", "matplotlib.pyplot.subplot", "torch.optim.lr_scheduler.StepLR", "mat...
maurygreen/PAD-C1-Code
[ "db183224b7e4eb45540c25ba5c579e78449a6d6a" ]
[ "src/preprocess.py" ]
[ "import argparse\nimport numpy as np\nimport os\nimport pandas as pd\nimport progressbar\nimport re\nimport spacy\n\nfrom config import Config\nfrom console import log_info\nfrom pathlib import Path\n\n\ndef read_csv(datafile):\n dtypes = {\"session_id\": np.int32, \"created_at\": object, \"sent_from\": str, \"s...
[ [ "pandas.read_csv", "pandas.to_datetime" ] ]
xzackli/isocurvature_2017
[ "6156ffa9a1aebe0318508c28bee921f65eb6c91e", "6156ffa9a1aebe0318508c28bee921f65eb6c91e" ]
[ "analysis/plot_triangle/compare_S4_noise.py", "analysis/plot_triangle/make_only_nonzero_forecasts.py" ]
[ "\n\nimport matplotlib\nfrom getdist import plots, MCSamples\n\nimport getdist\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport astropy\nfrom loadMontePython import load as loadMCMC\nimport glob\n\nbasedir = '../chains/nonzero_model/'\n#\"/home/zequnl/Projects/isocurvature_2017/analysis/plot_triangle/...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.savefig" ], [ "matplotlib.pyplot.show", "matplotlib.pyplot.savefig" ] ]
CustosVitae28/Stanford_CS_131
[ "ec4971da6805a76e42e1bca7f8fd7693fd414ff1" ]
[ "hw0/linalg.py" ]
[ "import numpy as np\n\n\ndef dot_product(a, b):\n \"\"\"Implement dot product between the two vectors: a and b.\n\n (optional): While you can solve this using for loops, we recommend\n that you look up `np.dot()` online and use that instead.\n\n Args:\n a: numpy array of shape (x, n)\n b: ...
[ [ "numpy.array", "numpy.dot", "numpy.linalg.svd", "numpy.linalg.eig" ] ]
tobyriddell/self-driving-car
[ "48d2ef0590fed9201a6c59fb44db6b7e913d7130" ]
[ "building_block_drive_car.py" ]
[ "#!/usr/bin/python\n\nfrom picamera.array import PiRGBArray\nfrom picamera import PiCamera\nimport time\nimport cv2\nimport explorerhat\nimport datetime\nimport sys, tty, termios\nfrom sklearn.externals import joblib\nimport numpy as np\n\nimport image_operations\n\n# Load the model\nclf = joblib.load('model.pkl')\...
[ [ "numpy.array", "sklearn.externals.joblib.load" ] ]
Feng37/tfsnippet
[ "70c7dc5c8c8f6314f9d9e44697f90068417db5cd" ]
[ "tests/modules/container/test_lambda.py" ]
[ "import tensorflow as tf\n\nfrom tfsnippet.modules import Lambda\n\n\nclass LambdaTestCase(tf.test.TestCase):\n\n def test_scopes(self):\n def f(inputs):\n var_name, op_name = inputs\n return (\n tf.get_variable(var_name, shape=(), dtype=tf.int32),\n tf....
[ [ "tensorflow.get_variable", "tensorflow.add" ] ]
xgarrido/PSpipe
[ "0b4a2c0d94243a47a1eaa2ab8a6a10050ea254ea" ]
[ "project/data_analysis/python/get_spectra.py" ]
[ "\"\"\"\nThis script compute all power spectra and write them to disk.\nIt uses the window function provided in the dictionnary file.\nOptionally, it applies a calibration to the maps, a kspace filter and deconvolve the pixel window function.\nThe spectra are then combined in mean auto, cross and noise power spectr...
[ [ "numpy.mean", "numpy.loadtxt", "numpy.ones" ] ]
EmoryMLIP/OT-Flow
[ "c1851a4da3aa131df1df6132b83d5186c154087e" ]
[ "datasets/gas.py" ]
[ "import pandas as pd\nimport numpy as np\n\nimport datasets\n\n\nclass GAS:\n\n class Data:\n\n def __init__(self, data):\n\n self.x = data.astype(np.float32)\n self.N = self.x.shape[0]\n\n def __init__(self):\n\n file = datasets.root + 'gas/ethylene_CO.pickle'\n trn...
[ [ "pandas.read_pickle", "numpy.where", "numpy.any" ] ]
truher/water
[ "b821ee42de4f7f978aa50071e4b5029f2265b4c8" ]
[ "test/test_search.py" ]
[ "\"\"\"tests for search package\"\"\"\nimport unittest\nimport pandas as pd\nfrom search.search import RangeSearch\n\n#pylint: disable=no-self-use, unused-argument, missing-function-docstring, missing-class-docstring, too-few-public-methods\n\n\nclass TestSearch(unittest.TestCase):\n\n def test_dataframe(self) -...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
Trayan7/FixMatch-with-Soft-Labels
[ "e167093632b6d01db1140824d7fff7526a6382fe" ]
[ "libml/data.py" ]
[ "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.compat.v1.data.TFRecordDataset", "numpy.sqrt", "tensorflow.compat.v1.reshape", "tensorflow.compat.v1.zeros", "numpy.stack", "tensorflow.compat.v1.py_func", "tensorflow.compat.v1.data.Dataset.range", "tensorflow.compat.v1.FixedLenFeature", "numpy.max", "tensorflo...
koflera/ConvSparsityNNs
[ "11b8aad5392441a0b48a8743a4c8436e3066c6ba" ]
[ "networks/encoding_object.py" ]
[ "import torch\nfrom torchkbnufft import (MriSenseNufft, \n\t\t\t\t\t\t AdjMriSenseNufft, \n\t\t\t\t\t\t KbNufft, \n\t\t\t\t\t\t AdjKbNufft,\n\t\t\t\t\t\t ToepNufft,\n\t\t\t\t\t\t ToepSenseNufft)\n\nfrom torchkbnufft.nufft.toep_functions import calc_toep_kernel\n\t\t\t\t\t\t \n\nimport torch.nn as nn\n\nclass ...
[ [ "torch.sqrt", "torch.zeros" ] ]
johnnychants/fastpose
[ "76f47007d222e1ce77440a4de0b754081cad7292" ]
[ "src/system/pose_2d/interface.py" ]
[ "import time\n\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\nimport os\nimport cv2\nimport numpy as np\n\nfrom src.utils.body_cover import BodyCover\nfrom src.utils.drawer import Drawer\nfrom src.utils.pose import Pose2D, PoseConfig\nimport matplotlib.image as mpimg\n\n\nclass Pose2DInterface:\n\n\n...
[ [ "numpy.hstack", "tensorflow.compat.v1.get_default_graph", "tensorflow.compat.v1.import_graph_def", "tensorflow.compat.v1.disable_v2_behavior", "numpy.argmax", "numpy.remainder", "tensorflow.compat.v1.GraphDef", "tensorflow.compat.v1.gfile.GFile", "numpy.zeros", "numpy.divid...
pgronkievitz/optymalizacja-dyskretna
[ "bb526954fb1ed9e126baab2c2670fc902177a1a5" ]
[ "examples/examples.py" ]
[ "import numpy as np\nfrom src.lomnicki import lomnicki\n\n# Zadanie przykładowe\ndane = np.array([\n [4, 8, 1],\n [2, 3, 7],\n [6, 2, 5]\n])\nprint(dane)\nprint(lomnicki(dane))\n\n# Zadanie duże\ndane = np.random.randint(1, 15, size=(10, 5))\nprint(dane)\nprint(lomnicki(dane))\n" ]
[ [ "numpy.array", "numpy.random.randint" ] ]
ChristophBleyer/Technician-Vehicle-Routing-Optimization
[ "5d425e6127f7d671f073162350357e2bffc05a01" ]
[ "technician_planning/Problem.py" ]
[ "import numpy as np\nimport pandas\nimport networkx as nx\nimport matplotlib.pyplot as plt\nimport json\nfrom .Vehicle import Vehicle\nfrom .TimeInterval import TimeInterval\nfrom .Depot import Depot\nfrom .PlaningHorizon import PlanningHorizon\nfrom .ServiceStop import ServiceStop\nfrom .Route import Route\nfrom o...
[ [ "numpy.matrix", "pandas.read_csv" ] ]
siddsax/PocketFlow
[ "909808b8344f03cd9d41cb1bba6daa3b0201184a" ]
[ "nets/resnet_at_cifar10.py" ]
[ "# Tencent is pleased to support the open source community by making PocketFlow available.\n#\n# Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.\n#\n# Licensed under the BSD 3-Clause License (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may...
[ [ "tensorflow.app.flags.DEFINE_integer", "tensorflow.losses.softmax_cross_entropy", "tensorflow.nn.l2_loss", "tensorflow.app.flags.DEFINE_float", "tensorflow.argmax" ] ]
xieshuaix/rllab
[ "740363ae037bd332b67563b0f4f7b936cb37c655" ]
[ "sandbox/rocky/tf/optimizers/conjugate_gradient_optimizer.py" ]
[ "from rllab.misc import ext\nfrom rllab.misc import krylov\nfrom rllab.misc import logger\nfrom rllab.core.serializable import Serializable\n# from rllab.utils.ext import flatten_tensor_variables\nimport itertools\nimport numpy as np\nimport tensorflow as tf\nfrom sandbox.rocky.tf.misc import tensor_utils\nfrom rll...
[ [ "numpy.isnan", "numpy.arange", "numpy.reshape", "tensorflow.reduce_sum", "tensorflow.gradients", "numpy.linalg.norm", "tensorflow.zeros_like" ] ]
ngoiz/sharpy-analysis-tools
[ "ac5f4114acc36d71ebbc7353fb2812b5fff97f98" ]
[ "linear/stability.py" ]
[ "import glob\nimport numpy as np\n\n\nclass Stability:\n def __init__(self, path):\n\n try:\n file = glob.glob(path + '/velocity*.dat')[-1]\n res = np.loadtxt(file)\n except IndexError:\n print('No velocity data in path {:s}'.format(path))\n raise FileNot...
[ [ "numpy.sqrt", "numpy.unique", "numpy.max", "numpy.interp", "numpy.column_stack", "numpy.argsort", "numpy.array", "numpy.loadtxt" ] ]
balbinot/ssptools
[ "caa12582d6cc4efbdbec0abd64655c2d50388171", "caa12582d6cc4efbdbec0abd64655c2d50388171" ]
[ "ssptools/df/fit_example.py", "ssptools/Kroupa.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nimport numpy as np\n\nfrom scipy.stats import multivariate_normal as mvn\nfrom matplotlib import pyplot as plt\nfrom sys import argv\nimport emcee\nfrom...
[ [ "numpy.sqrt", "numpy.linspace", "numpy.max", "numpy.mean", "numpy.random.randn", "scipy.interpolate.griddata", "numpy.ma.array", "matplotlib.pyplot.gca", "numpy.save", "numpy.std", "numpy.load", "matplotlib.pyplot.figure", "numpy.min", "numpy.isnan", "ma...
junhyung9985/PyTorch-tutorials-kr
[ "07c50e5ddfc2f118f01ecbc071a24763f9891171" ]
[ "docs/_downloads/79b656218bea45f97468ffa42f191880/optimization_tutorial.py" ]
[ "\"\"\"\n`파이토치(PyTorch) 기본 익히기 <intro.html>`_ ||\n`빠른 시작 <quickstart_tutorial.html>`_ ||\n`텐서(Tensor) <tensorqs_tutorial.html>`_ ||\n`Dataset과 Dataloader <data_tutorial.html>`_ ||\n`변형(Transform) <transforms_tutorial.html>`_ ||\n`신경망 모델 구성하기 <buildmodel_tutorial.html>`_ ||\n`Autograd <autogradqs_tutorial.html>`_ ||...
[ [ "torch.nn.CrossEntropyLoss", "torch.utils.data.DataLoader", "torch.nn.Flatten", "torch.nn.Linear", "torch.no_grad", "torch.nn.ReLU" ] ]
Askannz/GANdam
[ "019258c8fc3aef46cd869761a08a2ca0c838b697" ]
[ "Code/visualization/plot_input_dataset_grid.py" ]
[ "import os\nimport shutil\nfrom pathlib import Path\nimport random\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\n\nGRID_H = 2\nGRID_W = 5\n\ndef main():\n\n dataset_folder_path = Path(\"../../Generated/preprocessing/flattened_images/\")\n output_filepath = Path(\"../../Generated/visualizat...
[ [ "numpy.max", "numpy.zeros", "numpy.pad" ] ]
parisa-zahedi/automated-systematic-review
[ "cf04172b5681f3863ca9dce496003158192ce422" ]
[ "asr/models/sklearn_models.py" ]
[ "\nfrom sklearn.naive_bayes import MultinomialNB\nfrom sklearn.svm import SVC\n\n\ndef create_nb_model(verbose=1):\n \"\"\"Return callable NaiveBayes model.\n\n Arguments\n ---------\n\n Returns\n -------\n callable:\n A function that return the Sklearn model when\n called.\n\n \"...
[ [ "sklearn.naive_bayes.MultinomialNB", "sklearn.svm.SVC" ] ]
Booomshaker/UWSOD
[ "b129b11f8100018b831c40f011a5a481ffe2703a" ]
[ "projects/WSL/wsl/modeling/roi_heads/roi_heads_dsoicr.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport inspect\nimport logging\nimport numpy as np\nimport os\nfrom pathlib import Path\nfrom typing import Dict, List, Optional, Tuple, Union\nimport cv2\nimport torch\nfrom torch import nn\n\nfrom detectron2.config import configurable\nfrom ...
[ [ "torch.max", "torch.cat", "torch.zeros_like", "torch.cuda.empty_cache", "torch.gather", "torch.unsqueeze", "torch.full_like", "torch.no_grad", "torch.topk", "torch.masked_select", "torch.index_select" ] ]
niklasj-h/crtomo_tools
[ "57a577ff2925c137fcc387ad49e3c9fe30025831", "57a577ff2925c137fcc387ad49e3c9fe30025831", "57a577ff2925c137fcc387ad49e3c9fe30025831" ]
[ "lib/crtomo/tests/parManager/01/test.py", "examples/05_correction_factors/plot_calculate_correction_factors.py", "src/grid_translate.py" ]
[ "import numpy as np\n\nimport crtomo.parManager as pM\nimport crtomo.grid as CRGrid\n\n\nclass test_parManager():\n def setup(self):\n grid = CRGrid.crt_grid()\n grid.load_elem_file('tomodir/grid/elem.dat')\n\n self.parman = pM.ParMan(grid)\n\n def test_adding_potentials(self):\n p...
[ [ "numpy.loadtxt" ], [ "numpy.savetxt", "pandas.merge", "pandas.DataFrame" ], [ "numpy.array" ] ]
s-lunowa/OpenPNM
[ "f176ea2cd76f7879edc7eabe13115a6ba9a8b18e" ]
[ "openpnm/models/physics/diffusive_conductance.py" ]
[ "r\"\"\"\nPore-scale models for calculating the diffusive conductance of conduits.\n\"\"\"\nimport numpy as _np\nimport scipy.constants as _const\nfrom openpnm.models.physics.utils import _poisson_conductance\n\n__all__ = [\n \"generic_diffusive\",\n \"ordinary_diffusion\",\n \"mixed_diffusion\",\n \"ta...
[ [ "numpy.diff", "numpy.vstack" ] ]
hengxyz/MIDV_2020_det
[ "3e4074bcb2766da2be122876365e4826c6b32fb9" ]
[ "Evaluation/plot_ROC.py" ]
[ "import os\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom read_bb_files import read_box\nfrom box_iou import box_iou\nfrom box_iou import label_pre_bboxes\nfrom shutil import copyfile\n\nfolder = '/data/zming/datasets/MIDV2020/Evluation_face_detection'\niou = 0.5\nfile1_path = '%s/clips_evaluation/iou...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
kaulshiv/CarND-Capstone
[ "68aec730597f56e365b04cd6a0c729a8be84ff69" ]
[ "ros/src/tl_detector/test_inference.py" ]
[ "import numpy as np\nimport os\nimport os.path\nimport glob\nimport six.moves.urllib as urllib\nimport sys\nimport tarfile\nimport tensorflow as tf\nimport zipfile\nimport cv2\n\nfrom collections import defaultdict\nfrom io import StringIO\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n...
[ [ "tensorflow.convert_to_tensor", "numpy.asarray", "matplotlib.use", "tensorflow.cast", "tensorflow.keras.utils.get_file", "numpy.sum" ] ]
TurkuNLP/SRNNMT
[ "c972dc868f461de06a8fe1abd48303c2282f8ee6" ]
[ "test.py" ]
[ "from keras.models import Sequential, Model, model_from_json\nfrom keras.layers import Dense, Dropout, Activation, Merge, Input, merge, Flatten\nfrom keras.layers.recurrent import GRU\nfrom keras.callbacks import Callback,ModelCheckpoint\nfrom keras.layers.embeddings import Embedding\nimport numpy as np\nimport sys...
[ [ "numpy.dot", "numpy.linalg.norm" ] ]
ericput/transformers
[ "72728be3dbca26c70dddc8b724eb2c8d901e97dc" ]
[ "src/transformers/models/albert/modeling_albert.py" ]
[ "# coding=utf-8\n# Copyright 2018 Google AI, Google Brain and the HuggingFace Inc. team.\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/LIC...
[ [ "torch.nn.Dropout", "torch.nn.functional.softmax", "torch.ones", "torch.nn.CrossEntropyLoss", "torch.zeros", "torch.einsum", "torch.from_numpy", "torch.nn.Embedding", "torch.nn.LayerNorm", "tensorflow.train.load_variable", "torch.nn.Linear", "torch.matmul", "tor...
HPI-Information-Systems/AdvancedDataProfilingSeminar
[ "088da367d2ccbeffbedb304a316b27d5a04a957b" ]
[ "adp-algorithms/evaluation/unary-distinct-values/generate_distinct.py" ]
[ "import sys\nimport random\nimport numpy as np\n\n\"\"\"\nObtain distinct count and total count from program arguments and\noutput a CSV with two integer columns of same distinctness.\n\"\"\"\n\ncount_distinct = int(sys.argv[1])\ncount_total = int(sys.argv[2])\n\nf = open(\"distinct_%d_%d\" % (count_distinct, count...
[ [ "numpy.random.randint" ] ]
btaba/yarlp
[ "e6bc70afe32f8617f56180d60d6a100c83868119" ]
[ "yarlp/experiment/job.py" ]
[ "import os\nimport json\nimport click\nimport traceback\nimport tensorflow as tf\nfrom yarlp.utils import experiment_utils\nfrom yarlp.utils.env_utils import NormalizedGymEnv, ParallelEnvs\n\n\nclass Job(object):\n def __init__(self, spec_dict, log_dir, video, load_agent=False):\n self._spec_dict = spec_d...
[ [ "tensorflow.reset_default_graph" ] ]
mvp18/gAL-MELEX
[ "58fd26b41d40acac3ab98f37c34e4de2d757ac01" ]
[ "AWA2/code/utils.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable, Function\nfrom sklearn.metrics import f1_score, average_precision_score, confusion_matrix\nfrom sklearn.cluster.bicluster import SpectralCoclustering\nimport numpy as np\nimport csv\n\nfrom loss_func import e...
[ [ "torch.max", "numpy.squeeze", "torch.sum", "sklearn.metrics.confusion_matrix", "numpy.max", "torch.set_grad_enabled", "torch.no_grad", "numpy.exp", "numpy.hstack", "torch.mm", "numpy.matmul", "numpy.argmax", "numpy.log", "torch.sigmoid", "numpy.isnan", ...
jbvaningen/feast
[ "70d4a1335312747521fc57e7742abf7eb85c12a6" ]
[ "sdk/python/tests/integration/registration/test_universal_types.py" ]
[ "import logging\nfrom dataclasses import dataclass\nfrom datetime import datetime, timedelta\nfrom typing import Any, Dict, List, Tuple, Union\n\nimport numpy as np\nimport pandas as pd\nimport pyarrow as pa\nimport pytest\n\nfrom feast.infra.offline_stores.offline_store import RetrievalJob\nfrom feast.value_type i...
[ [ "pandas.api.types.is_object_dtype", "pandas.DataFrame", "pandas.Timestamp" ] ]
flowersteam/automated_discovery_of_lenia_patterns
[ "97cc7cde2120fa95225d1e470e00b8aa8c034e97", "97cc7cde2120fa95225d1e470e00b8aa8c034e97", "97cc7cde2120fa95225d1e470e00b8aa8c034e97" ]
[ "autodisc/autodisc/representations/static/pytorchnnrepresentation/pytorchnnrepresentation.py", "experiments/explorations/experiments/experiment_000105/calc_statistics_over_repetitions.py", "autodisc/autodisc/representations/static/pytorchnnrepresentation/pytorchnnarchitectures.py" ]
[ "import autodisc as ad\nimport os\nimport torch\nfrom torch.autograd import Variable\nimport numpy as np\nfrom torchvision.utils import save_image\nimport matplotlib.pyplot as plt\nplt.ioff()\n\n\nclass PytorchNNRepresentation(ad.core.Representation):\n\n @staticmethod\n def default_config():\n default...
[ [ "torch.LongTensor", "torch.sigmoid", "numpy.linspace", "torch.load", "torch.zeros_like", "matplotlib.pyplot.subplots", "torch.from_numpy", "matplotlib.pyplot.ioff", "torch.no_grad", "numpy.mean", "torch.save", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyp...
ryry013/-Rai-
[ "d3b03133e85ffa42505ed98377cda424964f4d46", "9b359cf2356b4e575c34190fa79145252340bfc1" ]
[ "cogs/math.py", "cogs/utils/helper_functions.py" ]
[ "import discord\nfrom discord.ext import commands\nimport matplotlib\n\nmatplotlib.use('agg')\nimport matplotlib.pyplot as plt\nimport random\nimport math\nimport asyncio\nimport io\nimport os\nfrom .utils import helper_functions as hf\n\ndir_path = os.path.dirname(os.path.realpath(__file__))\n\n\nclass Math(comman...
[ [ "matplotlib.pyplot.title", "matplotlib.use", "matplotlib.pyplot.cla", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.axes", "matplotlib.pyplot.clf", "matplotlib.pyplot.close", "matplotlib.pyplot.figure" ], [ "sklearn.feature_extraction.text.Co...
prayas-energy/Rumi
[ "fd7f0cf4eba08b4efa1a643217caff7f876fb394" ]
[ "rumi/io/demand.py" ]
[ "# Copyright 2021 Prayas Energy Group(https://www.prayaspune.org/peg/)\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...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
qian-liu/snn_toolbox
[ "9693647f9b2421a4f1ab789a97cc19fd17781e87" ]
[ "snntoolbox/simulation/backends/inisim/temporal_mean_rate_tensorflow.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"INI temporal mean rate simulator with Tensorflow backend.\n\nThis module defines the layer objects used to create a spiking neural network\nfor our built-in INI simulator\n:py:mod:`~snntoolbox.simulation.target_simulators.INI_temporal_mean_rate_target_sim`.\n\nThe coding scheme under...
[ [ "numpy.true_divide", "numpy.float32" ] ]
wrzadkow/flax
[ "45937af8379b1f653a7e1e187cc923d0a94585eb" ]
[ "linen_examples/imagenet/imagenet_benchmark.py" ]
[ "# Copyright 2020 The Flax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or a...
[ [ "numpy.array", "numpy.mean" ] ]
rishidevc/stkovrflw
[ "c33dffbce887f32f609a10dd717d594390ceac8b" ]
[ "2019/scrap/csv_to_fixtures.py" ]
[ "import glob\nimport pandas as pd\nimport re\nimport json\nimport copy\n\n\ndef csv_to_fixtures(idx, csv_path):\n\t# Processing => 232 ./csvs/IFCB2009_197.csv\n\t# Index(['Unnamed: 0', 'BANK NAME', 'IFSC', 'OFFICE', 'ADDRESS', 'DISTRICT',\n\t# 'CITY', 'STATE', 'PHONE'],\n\t# dtype='object')\n\t# Proces...
[ [ "pandas.read_csv" ] ]
SumaDodo/turingadvice
[ "d38b9ca9d614309dae04cc050e71e856125f2cf8" ]
[ "reward/comparative/predict.py" ]
[ "import os\nimport sys\nfrom absl import flags\n\nimport tensorflow.compat.v1 as tf\n\nfrom reward.comparative.model import ComparativeRewardModel\nfrom reward.comparative.data import SEQUENCE_LENGTH, MODEL_DIR\n\ndef _define_flags():\n flags.DEFINE_string(\n name=\"input_path\",\n default=None,\n ...
[ [ "tensorflow.compat.v1.io.gfile.GFile", "tensorflow.compat.v1.app.run" ] ]
vijay092/WindSE
[ "d11bc205b25ee21f83dab6b2f2747743f52bcbe6" ]
[ "windse/OptimizationManager.py" ]
[ "\"\"\"\nThe OptimizationManager submodule contains all the required function for\noptimizing via dolfin-adjoint. To use dolfin-adjoin set::\n\n general: \n dolfin_adjoint: True\n\nin the param.yaml file.\n\nTodo:\n * Read through an update the docstrings for these functions.\n * Create specific opt...
[ [ "numpy.minimum", "matplotlib.use", "numpy.linalg.norm", "numpy.concatenate", "numpy.mean", "numpy.savetxt", "numpy.array", "numpy.zeros" ] ]
hashtagSELFIE/That-s-a-Wrap-
[ "31c8b824742fee01c384eefa49f9f82d85518651" ]
[ "Picture/exbar2.py" ]
[ "\"\"\"Project\"\"\"\n\nimport pygal\nimport pandas as pd\nfrom ast import literal_eval\n\ndef open(dir_name):\n \"\"\"openfile,last_data\"\"\"\n movie_type = {}\n filedata = pd.read_csv('completed_movie_database_for_PSIT.csv')\n top1 = filedata.loc[filedata['director'] == dir_name, [\"title\", \"vote_a...
[ [ "pandas.read_csv" ] ]
ZachT1711/fairness-indicators
[ "b943dc2d6505cc4cc6da193b68275150c4c17d8f" ]
[ "tensorboard_plugin/tensorboard_plugin_fairness_indicators/plugin_test.py" ]
[ "# Copyright 2019 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.compat.v1.io.TFRecordWriter", "tensorflow.compat.v1.test.main", "tensorflow.compat.v1.train.Example", "tensorflow.compat.v1.compat.v1.enable_eager_execution", "tensorflow.compat.v1.summary.create_file_writer" ] ]
iChenning/face_project
[ "8d70858817da4d15c7b513ae492034784f57f35f", "8d70858817da4d15c7b513ae492034784f57f35f" ]
[ "p2_alignment/models/retinaface.py", "p2_alignment/step1_landmark.py" ]
[ "import torch\nimport torch.nn as nn\nimport torchvision.models.detection.backbone_utils as backbone_utils\nimport torchvision.models._utils as _utils\nimport torch.nn.functional as F\n\nfrom models.net import MobileNetV1 as MobileNetV1\nfrom models.net import FPN as FPN\nfrom models.net import SSH as SSH\n\n\nclas...
[ [ "torch.device", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.functional.softmax" ], [ "numpy.hstack", "torch.Tensor", "torch.from_numpy", "numpy.concatenate", "numpy.float32", "numpy.where" ] ]
undeadyequ/ser_model
[ "e1a95d8529d151f0c36b7169a3e3abdc5d319505" ]
[ "src/build_audio_vectors.py" ]
[ "\"\"\"\nThis script should be run AFTER extract_emotion_labels.py. It basically uses\nthe csv file created in the previous step to split the original wav files into\nmultiple smaller frames, each piece containing an emotion.\n\nRun this script from root as python src/build_audio_vectors.py\n\"\"\"\n\nimport os\nim...
[ [ "pandas.read_csv" ] ]
BlackWhiteHead/FolkClassification-GrainSizeParameters
[ "95712d7ff67e20d01a32e56facf2131172aba27d" ]
[ "code/plot_evaluation.py" ]
[ "import numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib as mpl\r\nimport random\r\nfrom scipy.stats import gaussian_kde\r\nimport ternary\r\n\r\n\r\ndef plot_confusion_matrix(cm, labels, ax):\r\n fontsize = 7\r\n plt.rc('font', family='Arial', size=fontsize)\r\n plt.tick_params(labelsiz...
[ [ "numpy.arange", "matplotlib.pyplot.rc", "matplotlib.pyplot.colorbar", "scipy.stats.gaussian_kde", "numpy.meshgrid", "matplotlib.pyplot.tick_params", "numpy.vstack" ] ]
EthanCarragher/anesthetic
[ "b577d4ca415292e8875e2afc3a9a97d6b1a4b931", "b577d4ca415292e8875e2afc3a9a97d6b1a4b931" ]
[ "anesthetic/samples.py", "anesthetic/gui/widgets.py" ]
[ "\"\"\"Main classes for the anesthetic module.\n\n- ``MCMCSamples``\n- ``NestedSamples``\n\"\"\"\nimport os\nimport numpy as np\nimport pandas\nimport copy\nfrom anesthetic.plot import (make_1d_axes, make_2d_axes, fastkde_plot_1d,\n kde_plot_1d, hist_plot_1d, scatter_plot_2d,\n ...
[ [ "pandas.concat", "numpy.log", "numpy.ones_like", "numpy.arange", "numpy.squeeze", "pandas.DataFrame", "numpy.ndim", "numpy.where" ], [ "matplotlib.widgets.Button", "matplotlib.widgets.Slider", "matplotlib.widgets.CheckButtons", "matplotlib.widgets.RadioButtons" ...
mickelliu/ray
[ "9cec28d439aca3458d9207379447251aa7b97e4f" ]
[ "rllib/agents/qmix/tests/test_qmix.py" ]
[ "from gym.spaces import Box, Dict, Discrete, MultiDiscrete, Tuple\nimport numpy as np\nimport unittest\n\nimport ray\nfrom ray.tune import register_env\nfrom ray.rllib.agents.qmix import QMixTrainer\nfrom ray.rllib.env.multi_agent_env import MultiAgentEnv\n\n\nclass AvailActionsTestEnv(MultiAgentEnv):\n num_acti...
[ [ "numpy.array" ] ]
Chris19920210/nmt
[ "a1f59a351639d658c94f9dfb8c110d87027770e1" ]
[ "nmt_idx/model_helper.py" ]
[ "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.device", "tensorflow.get_variable", "tensorflow.concat", "tensorflow.contrib.rnn.GRUCell", "tensorflow.keras.initializers.glorot_normal", "tensorflow.gfile.Exists", "tensorflow.gfile.MakeDirs", "tensorflow.summary.scalar", "tensorflow.contrib.framework.list_variable...
mourga/alps
[ "ab05aa5cef1e94eb8d5453cb11526aee9cd043cc" ]
[ "src/train.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.distributed.DistributedSampler", "torch.load", "torch.utils.data.TensorDataset", "torch.utils.data.SequentialSampler", "torch.utils.data.RandomSampler", "torch.utils.data.DataLoader", "torch.distributed.barrier", "torch.tensor", "numpy.squeeze", "numpy.set...
Iceman3/ml-agents
[ "608fdcf4ff39aa94675ff6fc27f4941f96b53f6a" ]
[ "ml-agents/mlagents/trainers/ghost/trainer.py" ]
[ "# # Unity ML-Agents Toolkit\n# ## ML-Agent Learning (Ghost Trainer)\n\n# import logging\nfrom typing import Deque, Dict, List, Any, cast\n\nimport numpy as np\nimport logging\n\nfrom mlagents.trainers.brain import BrainParameters\nfrom mlagents.trainers.policy import Policy\nfrom mlagents.trainers.tf_policy import...
[ [ "numpy.random.uniform", "numpy.array" ] ]
initmaks/BiSeNet
[ "43f1134dee17cfebd4f33f4efdf09c6b9cad78d8" ]
[ "tools/train.py" ]
[ "#!/usr/bin/python\n# -*- encoding: utf-8 -*-\n\nimport sys\nsys.path.insert(0, '.')\nimport os\nimport os.path as osp\nimport random\nimport logging\nimport time\nimport argparse\nimport numpy as np\nfrom tabulate import tabulate\n\nimport torch\nimport torch.nn as nn\nimport torch.distributed as dist\nfrom torch....
[ [ "torch.cuda.synchronize", "numpy.random.seed", "torch.cuda.manual_seed", "torch.cuda.set_device", "torch.manual_seed", "torch.squeeze", "torch.load", "torch.distributed.is_initialized", "torch.nn.SyncBatchNorm.convert_sync_batchnorm", "torch.optim.SGD", "torch.distribut...
davidphun/Secure-Recommender-System
[ "af6dddc09c3c3901361f8810d1b4b55060757390", "af6dddc09c3c3901361f8810d1b4b55060757390" ]
[ "model.py", "criterions.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport const\n\nclass SVD_MF(nn.Module):\n def __init__(self, n_latent_dims):\n super(SVD_MF, self).__init__()\n self.n_latent_dims = n_latent_dims\n self.u_embeddings = nn.Embedding(num_embeddings=const.N_USERS, embeddin...
[ [ "torch.nn.ModuleList", "torch.nn.Embedding", "torch.mul", "torch.nn.init.normal_", "torch.bmm", "torch.nn.init.xavier_uniform_" ], [ "torch.sigmoid", "torch.nn.BCELoss" ] ]
Isaac-Li-cn/certify_robustness
[ "f904dc923afc6354e406c57a1c923d13fc39d315" ]
[ "util/model_asys.py" ]
[ "import sys\nimport torch\nimport torch.nn as nn\n\nimport numpy as np\n\nfrom abc import ABCMeta, abstractmethod\nfrom .modules_asym import FCLayer, ReLULayer, SigdLayer, TanhLayer, ArctanLayer\nfrom .utility import reduced_bv_bm, reduced_bm_bv\n\nstr2func = {'relu': ReLULayer, 'tanh': TanhLayer, 'sigd': SigdLayer...
[ [ "torch.nn.Sequential", "torch.ones_like" ] ]
matgille/boudams
[ "d253ff2ee124e13186b5782ebb3c2d9b4bedd942", "d253ff2ee124e13186b5782ebb3c2d9b4bedd942" ]
[ "boudams/utils.py", "boudams/cli.py" ]
[ "import math\nimport gzip\nimport time\nimport uuid\nfrom contextlib import contextmanager\nimport os\nimport shutil\nimport unidecode\nimport warnings\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.utils.multiclass import unique_labels\n\nCache ...
[ [ "matplotlib.pyplot.subplots", "numpy.arange", "sklearn.metrics.confusion_matrix" ], [ "torch.ones", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "torch.zeros" ] ]
Bo396543018/mmdetection
[ "eb337336d3c239dc1d20534496f69df41ae9a300" ]
[ "mmdet/models/dense_heads/picodet_head.py" ]
[ "# Copyright 2021.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writi...
[ [ "torch.sigmoid", "torch.cat", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.zeros_like", "torch.no_grad", "torch.nonzero", "torch.split", "torch.onnx.is_in_onnx_export" ] ]
carlgogo/vip_exoplanets
[ "52bd0d7b1503a2b317b1187c429b8fe7fca545b6", "52bd0d7b1503a2b317b1187c429b8fe7fca545b6" ]
[ "vip_hci/psfsub/llsg.py", "vip_hci/preproc/derotation.py" ]
[ "#! /usr/bin/env python\n\n\"\"\"\nModule containing the Local Low-rank plus Sparse plus Gaussian-noise\ndecomposition algorithm (Gomez Gonzalez et al. 2016) for ADI data.\n\"\"\"\n\n__author__ = 'Carlos Alberto Gomez Gonzalez'\n__all__ = ['llsg',\n 'thresholding']\n\n\nimport numpy as np\nfrom scipy.lina...
[ [ "numpy.hstack", "numpy.dot", "scipy.linalg.qr", "numpy.abs", "numpy.arctan", "numpy.sign", "numpy.ceil", "numpy.tan", "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.random.RandomState" ], [ "numpy.nanmax", "numpy.amax", "numpy.arctan", ...
carolinesadlerr/wiggum
[ "e9b80fcdb8d50c6dd8ee3f75b9054e07b15a6163" ]
[ "wiggum_app/models.py" ]
[ "import wiggum as wg\nfrom itertools import combinations\nimport pandas as pd\nimport sys\nimport logging\nfrom sklearn import mixture\nimport numpy as np\nimport json\n\ndef updateMetaData(labeled_df, meta):\n \"\"\"\n Update Meta Data\n Parameters\n -----------\n labeled_df : DataFrame\n Lab...
[ [ "pandas.DataFrame" ] ]
vitaka/AEVNMT.pt
[ "5f2bfac992c893941026637837b3cc14d57b770c" ]
[ "aevnmt/components/encoders.py" ]
[ "import torch\nimport torch.nn as nn\nimport math\n\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\nfrom .utils import rnn_creation_fn\nfrom .nli import DecomposableAttentionEncoder as NLIEncoder\n\nclass RNNEncoder(nn.Module):\n\n def __init__(self, emb_size, hidden_size, bidirectiona...
[ [ "torch.nn.utils.rnn.pack_padded_sequence", "torch.cat" ] ]
KanghyuLee/Deep-human-action-recognition
[ "48190534c3691ba38eff25375083644bc6b7309d" ]
[ "datasets/NTU/extract-resize-videos.py" ]
[ "#!/usr/bin/env python2\n\nimport os\nimport sys\nimport glob\nimport threading\n\nimport numpy as np\nfrom PIL import Image\n\nimport cv2\n\nresize_ratio = 1/2.\nopdir = \"/home/ispl-ex39/hdd_ext/hdd2000/\"\n\n\ndef mkdir(path):\n if os.path.isdir(path) is False:\n os.mkdir(path)\n\n\ndef extract_video(v...
[ [ "numpy.load" ] ]
Lambda-School-Labs/sound-drip-ds-x
[ "35963e6ab26e6c35cd1ace48f4cfeafb5f55e915" ]
[ "_archive_Flask_AWS/SOUNDDRIP/models/predict.py" ]
[ "import spotipy\nfrom sklearn.neighbors import NearestNeighbors\nfrom sklearn.preprocessing import MinMaxScaler, Normalizer\nimport pandas as pd\nfrom pandas.io.json import json_normalize\nfrom joblib import load, dump\nimport pickle\nimport numpy as np\nimport psycopg2 as ps\nfrom misc.env_vars import *\nimport sy...
[ [ "sklearn.preprocessing.Normalizer", "pandas.io.json.json_normalize" ] ]
aurora95/RGBD_Semantic_Segmentation_PyTorch
[ "b25ec3b398d7199386abd043a667c347df80884c" ]
[ "furnace/apex/apex/parallel/optimized_sync_batchnorm_kernel.py" ]
[ "import torch\nfrom torch.autograd.function import Function\n\nimport syncbn\nfrom apex.parallel import ReduceOp\n\nclass SyncBatchnormFunction(Function):\n\n @staticmethod\n def forward(ctx, input, weight, bias, running_mean, running_variance, eps, track_running_stats = True, momentum = 1.0, process_group = ...
[ [ "torch.cuda.nvtx.range_pop", "torch.sqrt", "torch.distributed.all_gather", "torch.distributed.is_initialized", "torch.cuda.nvtx.range_push", "torch.distributed.get_world_size", "torch.distributed.all_reduce" ] ]
gisjedi/Shapely
[ "2555c8ba80cf275783df8a927a19bef2c8283206" ]
[ "docs/code/linestring.py" ]
[ "from matplotlib import pyplot\nfrom shapely.geometry import LineString\n\nfrom figures import SIZE\n\nCOLOR = {\n True: '#6699cc',\n False: '#ffcc33'\n }\n\ndef v_color(ob):\n return COLOR[ob.is_simple]\n\ndef plot_coords(ax, ob):\n x, y = ob.xy\n ax.plot(x, y, 'o', color='#999999', zorder=1)\n\...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
whiplashf/magenta
[ "149136fb2766e0dbce1d23593cba53111c8dabc3" ]
[ "magenta/models/shared/events_rnn_graph.py" ]
[ "# Copyright 2021 The Magenta Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "tensorflow.compat.v1.not_equal", "tensorflow.compat.v1.metrics.mean", "tensorflow.compat.v1.equal", "numpy.cumsum", "tensorflow.compat.v1.py_func", "tensorflow.compat.v1.logging.warning", "tensorflow.compat.v1.nn.sparse_softmax_cross_entropy_with_logits", "tensorflow.compat.v1.met...
scope-lab-vu/Resonate-Dynamic-Risk
[ "46972bdb0a2b6b08cc188a9f1f6567971c9d263d" ]
[ "resonate-carla/carla_project/src/scripts/cluster.py" ]
[ "import sys\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.cluster import KMeans\nfrom ..dataset import get_dataset\n\n\ndata = get_dataset(sys.argv[1])\nbank = list()\n\nfor rgb, topdown, points, target, actions, meta in data:\n bank.extend(target.numpy())\n\n if len(bank) > 4096:\n ...
[ [ "matplotlib.pyplot.legend", "sklearn.cluster.KMeans", "numpy.stack", "matplotlib.pyplot.plot", "matplotlib.pyplot.show" ] ]
Nick17t/UD-Net
[ "fd162f1e495bee3edc43f34b3d892ac007d9f819" ]
[ "seg/src/code/process.py" ]
[ "'''\nCreated on 2019年3月18日\n\n@author: vcc\n'''\n\nimport numpy as np\nimport cv2\nfrom keras.preprocessing import image\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.utils import to_categorical\nimport random\nfrom reader import Reader\n\n\nclass Process:\n '''\n 图像数据加工\n '''\n ...
[ [ "numpy.unique", "numpy.min", "numpy.max", "numpy.array", "numpy.zeros" ] ]
corbettht/healpix-alchemy
[ "f0c7091a266a4f73bc36b490d8593dbbb736279a" ]
[ ".github/workflows/runtime_plots.py" ]
[ "import json\n\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\nwith open('benchmark_results.json') as f:\n data = json.load(f)\n\ndf = pd.json_normalize(data['benchmarks'])\ndf['func'] = df['name'].str.split('[', expand=True)[0]\ndf['fullfunc'] = df['fullname'].str.split('[', expand=True)[0]\ndf['param'...
[ [ "pandas.json_normalize", "pandas.to_numeric", "matplotlib.pyplot.subplots" ] ]
aarondewindt/cw
[ "6be9770da0f0fc34ea47d7ab83e6929c4823e98a" ]
[ "cw/xsens/parser.py" ]
[ "import numpy as np\nfrom io import BytesIO\nfrom enum import Enum\nfrom typing import Union, DefaultDict, Dict, Sequence\nimport struct\nfrom collections import namedtuple, deque, defaultdict\nfrom functools import partial\nimport tqdm\n\nstate_idle = 0\nstate_reading_header = 1\nstate_reading_data = 2\nstate_skip...
[ [ "numpy.diag", "numpy.array" ] ]
XlightwolfX/COMSOC2020_project
[ "2028cfdd915b178d08e6270a479491e84901cf5f" ]
[ "socialnetwork.py" ]
[ "from partialorders import PartialOrder\nfrom voter import Voter\nfrom networks import generate_graphs\nimport random\nfrom collections import Counter\nimport networkx as nx\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\nclass SocialNetwork:\n \"\"\"Class representing the social network\"\"\"\n\n @...
[ [ "matplotlib.pyplot.show", "numpy.random.choice" ] ]
Tomev-CTP/BoSS
[ "2df9664d831a4171ac874d028ba07321be9b8eac" ]
[ "src/boson_sampling_utilities/permanent_calculators/glynn_gray_permanent_calculator.py" ]
[ "__author__ = \"Tomasz Rybotycki\"\n\n\"\"\"\n This files contains the implementation of Glynn's formula for permanent calculation,\n that uses Gray codes to during the iterations. This method has the same complexity\n as the Ryser formula (O(n2^n), but has been proven to be numerically more stable\n (d...
[ [ "numpy.complex128" ] ]
ThomasJFR/PyEEA
[ "7927ee5ff1de8d3cf9e9654899ea4c2c0284519c", "7927ee5ff1de8d3cf9e9654899ea4c2c0284519c" ]
[ "PyEEA/valuation/Valuators.py", "PyEEA/analysis/SimulationAnalysisEngine.py" ]
[ "from ..cashflow import NullCashflow, Present, Future, Annuity, Perpetuity\nfrom ..utilities import get_final_period\nfrom math import isinf\n\n\ndef npw(cashflows, i, title=None) -> Present:\n \"\"\" Computes the Net Present Worth of a sequence of cashflows\n\n Converts each Cashflow in a sequence of cashflo...
[ [ "scipy.optimize.fsolve" ], [ "numpy.random.standard_normal" ] ]
macastelblancog/cositas-de-git
[ "21003f34fca60e3e6f0ef75730bd2e96630ca16d" ]
[ "hw09/grafica.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\n#import data into array \"data\"\ndata = np.loadtxt(\"datos.txt\")\n\n#Save data in columns\nt = data[:,0]\ny = data[:,1]\nv = data[:,2]\n\n#figure construction\nfig1 = plt.figure( figsize=(5,10))\n\n#t vs y\nax1 = fig1.add_subplot(211)\nax1.scatter(t, y, s = ...
[ [ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.savefig", "numpy.loadtxt", "matplotlib.pyplot.figure" ] ]
giakou4/carotid_stenosis_simclr
[ "f206ac1f20ddf413673850a4931c76e2227189cd" ]
[ "mrmr.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\n@author: Nikolaos Giakoumoglou\r\n@date: Tue May 25 12:36:25 2021\r\n\"\"\"\r\nimport os\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom tqdm import tqdm\r\nimport argparse\r\nimport pymrmr\r\nfrom sklearn.preprocessing import StandardScaler\r\nfrom utils import path2excel...
[ [ "sklearn.preprocessing.StandardScaler", "pandas.read_excel" ] ]
Qin-Folks/Random-Erasing
[ "5993e65ca8e28d9363aa6bb87cfb1f7662cce99f" ]
[ "utils/misc.py" ]
[ "'''Some helper functions for PyTorch, including:\n - get_mean_and_std: calculate the mean and std value of dataset.\n - msr_init: net parameter initialization.\n - progress_bar: progress bar mimic xlua.progress.\n'''\nimport errno\nimport os\nimport sys\nimport time\nimport math\n\nimport torch.nn as nn\n...
[ [ "torch.nn.init.kaiming_normal", "torch.nn.init.constant", "torch.nn.init.normal" ] ]
gkdb/omas
[ "a4946641890b6132b9dafd89f37963b30f363821" ]
[ "omas/examples/omas_resample.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nInterpolate whole ODS\n=====================\nSeamless handling of coordinates within OMAS makes it easy to reinterpolate a whole ODS on a new grid\n\"\"\"\n\nfrom __future__ import print_function, division, unicode_literals\n\nimport numpy\nfrom omas import ...
[ [ "numpy.linspace" ] ]
WesleyLeeNTU/EDC
[ "f28be5ff586f15b21a3cb53814da1039b118f321", "f28be5ff586f15b21a3cb53814da1039b118f321", "f28be5ff586f15b21a3cb53814da1039b118f321" ]
[ "FPC/ML/HyperOpt/0524/hyper.py", "FPC/ML/ML_model_V6.py", "Coke/ML/ML_model_cokingV5.py" ]
[ "\n\nfrom hyperopt import fmin, tpe, hp, STATUS_OK, space_eval, Trials, anneal\nfrom hyperopt.fmin import generate_trials_to_calculate\nfrom numpy.lib.function_base import median\nimport pandas as pd\nimport numpy as np\nimport random as random\nfrom random import choice\nimport pickle as pk\nfrom pickle import loa...
[ [ "numpy.hstack", "tensorflow.keras.layers.Activation", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "sklearn.metrics.mean_absolute_error", "numpy.arange", "tensorflow.keras.layers.concatenate", "tensorflow.keras.optimizers.Adam", "scipy.interpolate.CubicSpli...
stefano-marano/WaveDec
[ "2fab2273801c88a1ab92a01915e8f5c12a917cae" ]
[ "bin/WaveDec.py" ]
[ "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n##################################################\n# © 2017 ETH Zurich, Swiss Seismological Service #\n# Stefano Marano' - wavedec at gmail dot com #\n##################################################\n\"\"\"\nWaveDec a tool for the analysis of seismic waves.\nSee...
[ [ "numpy.linspace", "matplotlib.pyplot.plot", "numpy.max", "numpy.any", "numpy.unique", "numpy.fft.rfftfreq", "numpy.ceil", "matplotlib.pyplot.subplot", "matplotlib.gridspec.GridSpec", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.min", "numpy.log10", "num...
ThomasWink/AML_project
[ "4f1a036b7ec3e7b22eee6c94525986a7655e8298" ]
[ "predict_cifar_10.py" ]
[ "#Original file by Titu1994, changed for this project\n\nimport json\nimport numpy as np\nimport argparse\nimport sklearn.metrics as metrics\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.decomposition import PCA\nfrom scipy.optimize import minimize\nfrom sklearn.metrics import log_loss\nfrom m...
[ [ "numpy.unique", "sklearn.model_selection.train_test_split", "numpy.argmax", "numpy.mean", "scipy.stats.multivariate_normal", "numpy.transpose", "numpy.array", "numpy.zeros", "sklearn.decomposition.PCA", "sklearn.metrics.accuracy_score" ] ]
adrdrew/viroconcom
[ "3eb748ba8e3e076eddd174a0fcdfee3917aa4045" ]
[ "examples/draw_sample_calculate_contour.py" ]
[ "from viroconcom.params import ConstantParam, FunctionParam\nfrom viroconcom.distributions import WeibullDistribution, LognormalDistribution, MultivariateDistribution\nfrom viroconcom.contours import DirectSamplingContour\nimport matplotlib.pyplot as plt\n\n# Define a Weibull distribution representing significant w...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.scatter", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
z8674558/keras-yolo3
[ "3016df53cabe5be340fd5125c62395297de0ed0d" ]
[ "scripts/train_bottleneck.py" ]
[ "\"\"\"\nRetrain the YOLO model for your own dataset.\n\n>> python train_bottleneck.py \\\n --path_dataset ./model_data/VOC_2007_train.txt \\\n --path_weights ./model_data/tiny-yolo.h5 \\\n --path_anchors ./model_data/tiny-yolo_anchors.csv \\\n --path_classes ./model_data/coco_classes.txt \\...
[ [ "numpy.savez", "tensorflow.keras.callbacks.ReduceLROnPlateau", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.callbacks.TensorBoard", "numpy.load", "tensorflow.keras.callbacks.EarlyStopping" ] ]
OllieBroadhurst/transformers
[ "12428f0ef15bb3631e7a5f04672ddb05f363de97" ]
[ "src/transformers/models/detr/feature_extraction_detr.py" ]
[ "# coding=utf-8\n# Copyright 2021 The HuggingFace Inc. team. 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....
[ [ "torch.nn.functional.softmax", "numpy.expand_dims", "torch.ones", "torch.zeros", "numpy.asarray", "numpy.arange", "torch.from_numpy", "numpy.stack", "numpy.copy", "numpy.any", "torch.nn.functional.interpolate", "torch.stack", "numpy.array", "numpy.meshgrid",...
AhmedRaja1/Python-Snippets
[ "c97332d0881f0cbe87d41ed3645b52eb55d97c6e" ]
[ "12 NumPy.py" ]
[ "# 12 NumPy\n\n# We are going to take a look ate NumPy package. Which is heavily use in scientific computation.\n# It is a package to work with Data Science and Machine Learning.\n# To work with large array and multi dimension arrays, numpy is the best package\n\nimport numpy as np # We are importing \"numpy\" as a...
[ [ "numpy.random.random", "numpy.full", "numpy.ones", "numpy.ceil", "numpy.round", "numpy.floor", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
mjheid/dca
[ "8da5aa241c4dac60acbabc0138cdf40bd3327c84", "8da5aa241c4dac60acbabc0138cdf40bd3327c84" ]
[ "scripts/gen_data.py", "dca/network.py" ]
[ "from dca.api import dca\n\ndca_zinb = dca('/home/kaies/csb/dca/data/test.csv', ae_type='zinb-conddisp', normalize_per_cell=False,\n scale=False, log1p=False, batchnorm=False, epochs=1, learning_rate=0.001, transpose=True,\n name='test0', batch_size=1)\n\nfrom dca.loss import Z...
[ [ "tensorflow.constant" ], [ "tensorflow.nn.softplus" ] ]
ewquon/SSRS
[ "b36c960e6d788e1ae2d3b0e78199367e25d21834" ]
[ "ssrs/terrain/wms.py" ]
[ "\"\"\" Module for using Web Map Service (WMS) tool to download GIS data \"\"\"\n\nimport os\nimport errno\nfrom typing import Tuple, List\nimport numpy as np\nfrom owslib.wms import WebMapService\nfrom rasterio.merge import merge\nimport rasterio as rs\n\n\nclass WMS:\n \"\"\" Class for accessing data through W...
[ [ "numpy.linspace" ] ]
Gimba/AmberUtils
[ "f10ccc474a4fa4ea3aa2d93f85b99e2bb8b5d3b0" ]
[ "CheckSummaries.py" ]
[ "#! /usr/bin/env python\n\nimport sys\nimport os\nimport numpy as np\n\ndef main(argv):\n files = []\n summaries = [\"summary.TEMP\", \"summary.ETOT\", \"summary.EKTOT\", \"summary.EPTOT\"]\n for file in os.listdir('.'):\n if any(file in s for s in summaries):\n files.append(file)\n\n ...
[ [ "numpy.average" ] ]
mirecta/nncase
[ "d2efa59677a26f4259b3b6a5b6ec05ea16d4e40c" ]
[ "tests/onnx_importer/test_matmul.py" ]
[ "import pytest\nimport os\nimport subprocess\nimport numpy as np\nimport sys\n[sys.path.append(i) for i in ['.', '..']]\nimport ncc\nimport onnx_importer.utils\nimport torch\n\nclass MatmulModule(torch.nn.Module):\n def __init__(self):\n super(MatmulModule, self).__init__()\n self.v = torch.tensor(...
[ [ "numpy.asarray", "torch.matmul", "torch.from_numpy", "torch.tensor" ] ]
anuj-rawat/tensorflow
[ "c52c5293b01875cbe439f24eb4047603812593de" ]
[ "tensorflow/lite/python/tflite_convert.py" ]
[ "# Lint as: python2, python3\n# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/...
[ [ "tensorflow.python.platform.app.run", "tensorflow.lite.python.lite.TFLiteConverterV2.from_saved_model", "tensorflow.lite.python.lite.OpsSet.get_options", "tensorflow.lite.toco.toco_flags_pb2.FileFormat.Value", "tensorflow.python.keras.models.load_model", "tensorflow.python.tf2.enabled", ...
kuangtu/pandas_exec
[ "659dec5eef488bec11daec33333ff8366a0d1a91" ]
[ "dataframe/copywarning.py" ]
[ "# -*- coding: UTF-8 -*-\n\nimport pandas as pd\nimport numpy as np\npd.set_option('display.max_rows', 500)\npd.set_option('display.max_columns', 500)\npd.set_option('display.width', 1000)\n\ndef copywarning_fix():\n movies = pd.read_csv(\"..\\\\data\\\\movies.csv\", index_col=0)\n # movies = pd.read_csv(\"http...
[ [ "pandas.set_option", "pandas.read_csv" ] ]
dyylaan/corona
[ "73e834ecdbcc167542bd169a9b19eae759218ab9" ]
[ "src/app.py" ]
[ "\nimport datetime\nimport os\nimport yaml\n\nimport pandas as pd\n\nimport dash \nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output \n\n# Répertoire du fichier des données \nPROCESSED_DIR = '../data/processed/'\n\n# Table principale\nALL_DATA_FILE=...
[ [ "pandas.read_csv" ] ]
codefromnow/OpenNRE
[ "b67f291103d9102ffae40c3661748ee36c8747df", "b67f291103d9102ffae40c3661748ee36c8747df" ]
[ "model/cnn_att_adv.py", "model/rnn_ave_adv.py" ]
[ "from framework import Framework\nimport tensorflow as tf\n\nFLAGS = tf.app.flags.FLAGS\n\ndef cnn_att_adv(is_training):\n if is_training:\n with tf.variable_scope('cnn_att_adv', reuse=False): \n framework = Framework(is_training=True)\n word_embedding = framework.embedding.word_embe...
[ [ "tensorflow.variable_scope", "tensorflow.nn.softmax" ], [ "tensorflow.variable_scope", "tensorflow.nn.softmax" ] ]