repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
ewanlee/mackrl | [
"6dd505aa09830f16c35a022f67e255db935c807e"
] | [
"src/envs/starcraft2/starcraft2_2pairs.py"
] | [
"from ..multiagentenv import MultiAgentEnv\nfrom .map_params import get_map_params, map_present\nfrom utils.dict2namedtuple import convert\nfrom operator import attrgetter\nfrom copy import deepcopy\nfrom absl import flags\nimport numpy as np\nimport pygame\nimport sys\nimport os\nimport math\n\nfrom pysc2 import m... | [
[
"numpy.max",
"numpy.random.normal",
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"numpy.mean",
"numpy.eye"
]
] |
DeLaVlag/tvb-hpc | [
"6559707dfee8ec712d9624aaf441f9901919fe63"
] | [
"examples/hcp100.py"
] | [
"\n\"\"\"\nParallel simulation of HCP 100 subjects.\n\n\"\"\"\n\nimport numpy as np\nimport loopy as lp\nfrom scipy import sparse\nlp.set_caching_enabled(False)\nfrom tvb_hpc import model, coupling, network, utils, compiler, scheme\n\nLOG = utils.getLogger('hcp100')\n\n# load data\nnpz = np.load('data/hcp-100.npz')... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.zeros",
"numpy.load",
"scipy.sparse.csr_matrix"
]
] |
urasakikeisuke/rigidmask | [
"4bb781102218dfd11efa767e2d0ba987d9949fd1"
] | [
"submission.py"
] | [
"from __future__ import print_function\nimport os\nimport sys\nimport cv2\nimport pdb\nimport argparse\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torch.utils.data\nfrom torch.autograd import Variable\n... | [
[
"torch.cat",
"numpy.median",
"numpy.tile",
"numpy.exp",
"numpy.mean",
"torch.squeeze",
"torch.load",
"torch.nn.DataParallel",
"numpy.concatenate",
"numpy.linalg.norm",
"numpy.log",
"torch.FloatTensor",
"numpy.logical_and",
"numpy.eye",
"numpy.nonzero",
... |
qermezkon/TextBaseEmotionDetectionWithEnsembleMethod | [
"8de1119a306c980f0b83948dd3858ad702986241"
] | [
"TfIdfFeatureExtraction.py"
] | [
"import numpy as np\nfrom sklearn.preprocessing import LabelEncoder\nfrom nltk.corpus import stopwords\nfrom nltk.stem.porter import *\nfrom nltk.tokenize import RegexpTokenizer\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nimport pandas as pd\n\n\ndef encode_label(label):\n le = LabelEncoder()\n... | [
[
"pandas.DataFrame",
"sklearn.preprocessing.LabelEncoder",
"numpy.array",
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
MrBoriska/PathPlanning | [
"8b10dd1262ba82d9906dd96978ec5fe71427dbe4"
] | [
"Sampling_based_Planning/rrt_2D/batch_informed_trees.py"
] | [
"\"\"\"\nBatch Informed Trees (BIT*)\n@author: huiming zhou\n\"\"\"\n\nimport os\nimport sys\nimport math\nimport random\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\nfrom scipy.spatial.transform import Rotation as Rot\n\nsys.path.append(os.path.dirname(os.path.abspath(... | [
[
"numpy.array",
"numpy.dot",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"numpy.linalg.det",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.cla",
"scipy.spatial.transform.Rotation.from_euler",
"numpy.arange",
"matplotlib.pyplot.pause",
"numpy.linalg.svd",
... |
botev/kernel-gof | [
"56efe2db76d0c2398d896f2c7c7ebde301698b92"
] | [
"kgof/plot.py"
] | [
"\"\"\"Module containing convenient functions for plotting\"\"\"\n\n__author__ = 'wittawat'\n\nimport kgof.glo as glo\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport autograd.numpy as np\n\n\ndef get_func_tuples():\n \"\"\"\n Return a list of tuples where each tuple is of the form\n (func_n... | [
[
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.figure",
"matplotlib.rc",
"matplotlib.pyplot.ylabel",
"matplot... |
EMK-Lab/rec_to_nwb | [
"d3550b4c1df9629a3687fa5a9208d142c9c7c7fb"
] | [
"rec_to_nwb/processing/nwb/components/position/pos_timestamp_manager.py"
] | [
"import logging.config\nimport os\n\nimport pandas as pd\nfrom rec_to_binaries.read_binaries import readTrodesExtractedDataFile\n\nfrom rec_to_nwb.processing.nwb.common.timestamps_manager import TimestampManager\n\npath = os.path.dirname(os.path.abspath(__file__))\n\nlogging.config.fileConfig(fname=str(path) + '/..... | [
[
"pandas.DataFrame"
]
] |
ndaidong/tf-ssd-mobilenet | [
"3d6082178b018d9e02c6044d562ef05ca2021899"
] | [
"make_tfrecord.py"
] | [
"#!/usr/bin/env python3\n\nimport glob\nimport argparse\nimport sys\nimport hashlib\nimport io\n\nfrom os import path, mkdir, remove\nfrom shutil import rmtree\nfrom random import shuffle\nfrom lxml import etree\n\nfrom funcy import compose\nfrom tqdm import tqdm\nfrom PIL import Image\n\nimport tensorflow as tf\n\... | [
[
"tensorflow.gfile.GFile"
]
] |
Pratyay360/Mask-Detector | [
"81027c6e8735e9154f4f53b41110e08c45e1c3dc"
] | [
"train_mask_detector.py"
] | [
"# import the necessary packages\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\nfrom tensorflow.keras.applications import MobileNetV2\nfrom tensorflow.keras.layers import AveragePooling2D\nfrom tensorflow.keras.layers import Dropout\nfrom tensorflow.keras.layers import Flatten\nfrom tensorflo... | [
[
"tensorflow.keras.utils.to_categorical",
"tensorflow.keras.preprocessing.image.load_img",
"tensorflow.keras.applications.mobilenet_v2.preprocess_input",
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"matplotlib.pyplot.save... |
DeepRank/DeepRank_VariantPred | [
"42cd85c7a521463ab2b644ef8da87c107a2b5bce"
] | [
"deeprank/features/PSSM/reformat_pssm.py"
] | [
"import sys\n\nimport numpy as np\n\n\ndef write_newfile(names_oldfile, name_newfile):\n\n chainID = {0: 'A', 1: 'B'}\n resconv = {\n 'A': 'ALA',\n 'R': 'ARG',\n 'N'\t: 'ASN',\n 'D': 'ASP',\n 'C': 'CYS',\n 'E': 'GLU',\n 'Q': 'GLN',\n 'G': 'GLY',\n ... | [
[
"numpy.array"
]
] |
rombl4/BioPAL | [
"1a990cff76f718463078eae05c5b5279e794d8d3"
] | [
"lib_tdx.py"
] | [
"import sys\nsys.path.append('./dep_gedi_tdx/demgen')\n\nimport gdal\nimport numpy as np\nimport logging\nimport xml.etree.ElementTree as ElementTree\nimport matplotlib.pyplot as plt\nfrom scipy import constants,interpolate,ndimage,special,stats,signal,optimize\nfrom lib import demgen\nfrom pathlib import Path\nfro... | [
[
"numpy.double",
"numpy.median",
"numpy.sign",
"numpy.nanmean",
"numpy.empty",
"numpy.conj",
"scipy.signal.windows.gaussian",
"numpy.cross",
"numpy.nansum",
"matplotlib.pyplot.imsave",
"numpy.polynomial.chebyshev.chebfit",
"numpy.polynomial.chebyshev.chebval",
"n... |
fkluger/cuboids_revisited | [
"bf3f27849c7c703245642f110497f271ec659451"
] | [
"util/initialisation.py"
] | [
"from networks.res_net import Network\nfrom bts.pytorch.bts import BtsModel\nfrom util.tee import Tee\nfrom tensorboardX import SummaryWriter\nfrom torch import nn\nimport torch.optim as optim\nfrom collections import namedtuple\nimport torch\nimport os\nimport glob\nimport json\nimport csv\n\n\ndef load_opts_for_e... | [
[
"torch.device",
"torch.cuda.is_available",
"torch.load",
"torch.nn.DataParallel"
]
] |
DarthLazar/lenstronomy | [
"5973f9b45761bab434bb273a1882ca3b45f5264b"
] | [
"lenstronomy/LensModel/Profiles/gaussian_ellipse_potential.py"
] | [
"__author__ = 'sibirrer'\n#this file contains a class to make a gaussian\n\nimport numpy as np\nfrom lenstronomy.LensModel.Profiles.gaussian_kappa import GaussianKappa\nimport lenstronomy.Util.param_util as param_util\nfrom lenstronomy.LensModel.Profiles.base_profile import LensProfileBase\n\n__all__ = ['GaussianEl... | [
[
"numpy.sin",
"numpy.sqrt",
"numpy.cos"
]
] |
Mostafa3zazi/Face_off | [
"04b69ffad46ded5a6fdd4f0cfed07e1ebc704c5b"
] | [
"faceRecognizer.py"
] | [
"from cloudant.client import Cloudant\r\nfrom cloudant.error import CloudantException\r\nfrom cloudant.result import Result, ResultByKey\r\n\r\n#OpenCV module\r\nimport cv2\r\n#os module for reading training data directories and paths\r\nimport os\r\n#numpy to convert python lists to numpy arrays as it is needed by... | [
[
"numpy.array"
]
] |
vonHousen/lime | [
"72b2f2c0875c653179b420cd557e04888f5d78cb"
] | [
"lime/lime_base_singleclassifier.py"
] | [
"\"\"\"\nCustom modification of lime_base - that uses decision tree as single local surrogate.\n\"\"\"\nimport numpy as np\n\nfrom lime.lime_base_mod import LimeBaseMod\nfrom sklearn.tree import DecisionTreeClassifier\nfrom collections import defaultdict\nfrom lime.tools import convert_binary_output_to_decimal\n\n\... | [
[
"numpy.zeros_like",
"numpy.argmax",
"numpy.arange",
"numpy.abs",
"sklearn.tree.DecisionTreeClassifier"
]
] |
ZhehengJiang/Leicester-Fox2 | [
"2a8958b836bee38fc55ccd2bcd5361732e491b8c"
] | [
"load.py"
] | [
"from __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\n\nimport json\nimport keras\nimport numpy as np\nimport os\nimport random\nimport scipy.io as sio\nSTEP = 256\n# MAX_LEN =71936\nMAX_LEN = 16384\n\ndef data_generator(batch_size, preproc, x, y):\n num... | [
[
"numpy.array",
"scipy.io.loadmat",
"numpy.load",
"numpy.mean",
"numpy.std",
"numpy.fromfile",
"numpy.dtype",
"numpy.vstack"
]
] |
ChristophRaab/prototorch | [
"c4913ecb33e14252fddb87317eab01a03c3c4e3a"
] | [
"tests/test_components.py"
] | [
"\"\"\"ProtoTorch components test suite.\"\"\"\n\nimport prototorch as pt\nimport torch\n\n\ndef test_labcomps_zeros_init():\n protos = torch.zeros(3, 2)\n c = pt.components.LabeledComponents(\n distribution=[1, 1, 1],\n initializer=pt.components.Zeros(2),\n )\n assert (c.components == pro... | [
[
"torch.zeros",
"torch.tensor",
"torch.randn"
]
] |
WillieMaddox/MLND | [
"2276f281ad93a6d1427f10154faffa12f8deed49"
] | [
"src/nuswide.py"
] | [
"import os\nfrom time import time\nimport random\nimport threading\nimport numpy as np\n\nfrom glob import glob\nfrom sklearn.model_selection import train_test_split\n\nfrom keras import backend as K\nfrom keras.preprocessing.image import img_to_array, load_img\nfrom keras.preprocessing.image import ImageDataGenera... | [
[
"numpy.array",
"numpy.zeros",
"numpy.random.seed",
"numpy.sum",
"numpy.load",
"numpy.split",
"numpy.random.shuffle",
"numpy.save",
"numpy.finfo",
"numpy.where",
"numpy.loadtxt",
"numpy.arange",
"numpy.intersect1d",
"sklearn.model_selection.train_test_split",... |
volpatto/chemicals | [
"721904ee17604f5e8685b0e5fff12e0bac567f73"
] | [
"tests/test_temperature.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Chemical Engineering Design Library (ChEDL). Utilities for process modeling.\nCopyright (C) 2016, Caleb Bell <Caleb.Andrew.Bell@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Softw... | [
[
"numpy.array"
]
] |
Willtor/deepsparse | [
"5a5557f4bf9026545116b22b36dcb7d506e8a070"
] | [
"src/deepsparse/benchmark.py"
] | [
"# Copyright (c) 2021 - present / Neuralmagic, 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# Un... | [
[
"numpy.median",
"numpy.std",
"numpy.mean"
]
] |
TDMoses/corridor-of-time-auto-map-gen | [
"717413678a16333bb2aa074d11863c4f32a1bc1c"
] | [
"main.py"
] | [
"import warnings\r\nimport math\r\nimport csv\r\nimport numpy as np\r\nfrom hexagon import Hexagon\r\nfrom PIL import Image\r\nfrom matplotlib import pyplot as plt\r\n\r\n_link_connections = dict(\r\n [(1, 4), (2, 5), (3, 6), (4, 1), (5, 2), (6, 3)]\r\n)\r\n\r\n\r\ndef convert_num_to_link_name(link_num):\r\n ... | [
[
"numpy.isnan"
]
] |
sandcobainer/MUSI6202Synth | [
"6c5d5c53c016ff93019fca87c75b97e7a934eeb2"
] | [
"postprocessing.py"
] | [
"# Post processing scripts: interpolation, dithering, resampling and output\n\nfrom scipy import signal\nimport numpy as np\nfrom scipy.interpolate import interp1d\nimport wavio\nfrom dataclasses import dataclass\n\n\n@dataclass\nclass Downsampler:\n output_fs: int = 48000\n output_br: int = 32\n\n def wri... | [
[
"scipy.interpolate.interp1d",
"scipy.signal.butter",
"numpy.random.triangular",
"scipy.signal.filtfilt",
"numpy.linspace"
]
] |
spacejake/face-alignment | [
"5c3acb5ff649de0ee9820bb595856cf2229c5db4"
] | [
"face_alignment/datasets/AFLW2000.py"
] | [
"from __future__ import print_function\n\nimport os\nimport numpy as np\nimport random\nimport math\nfrom skimage import io\nfrom scipy import io as sio\n\nimport torch\nimport torch.utils.data as data\n\nfrom face_alignment.datasets.common import Split, Target, compute_laplacian\nfrom face_alignment.utils import s... | [
[
"torch.zeros",
"torch.min",
"torch.max",
"torch.FloatTensor",
"scipy.io.loadmat",
"torch.from_numpy",
"torch.randn"
]
] |
karalleyna/pyprobml | [
"72195e46fdffc4418910e76d02e3d6469f4ce272"
] | [
"scripts/linreg_sgd_pt.py"
] | [
"#https://github.com/fastai/course-v3/blob/master/nbs/dl1/lesson2-sgd.ipynb\n#https://pytorch.org/tutorials/beginner/nn_tutorial.html\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\nimport pyprobml_utils as pml\n\n#figdir = os.path.join(os.environ[\"PYPROBML\"], \"figures\")\n#def save_fig(fname)... | [
[
"torch.rand",
"numpy.array",
"numpy.random.seed",
"torch.no_grad",
"torch.ones",
"matplotlib.pyplot.scatter",
"torch.randn"
]
] |
pylbm/pylbm_gallery | [
"c0e6f3c69b6938769efb5f62cc1e1a550bf160b2"
] | [
"1D/shallow_water.py"
] | [
"\"\"\"\n Solver D1Q2Q2 for the shallow water system on [0, 1]\n\n d_t(h) + d_x(q) = 0, t > 0, 0 < x < 1,\n d_t(q) + d_x(q^2/h+gh^2/2) = 0, t > 0, 0 < x < 1,\n h(t=0,x) = h0(x), q(t=0,x) = q0(x),\n d_t(h)(t,x=0) = d_t(h)(t,x=1) = 0\n d_t(q)(t,x=0) = d_t(q)(t,x=1) = 0\n\n the initial condition is a picewise const... | [
[
"numpy.empty"
]
] |
leeong05/zipline | [
"f41c37a606e40b1c966b7de2ea28b1c3bf049d76"
] | [
"zipline/history/history_container.py"
] | [
"#\n# Copyright 2014 Quantopian, Inc.\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... | [
[
"pandas.to_datetime",
"pandas.Panel",
"numpy.isnan",
"pandas.DataFrame"
]
] |
danlx/JointBERT | [
"5d6d4cd2bfe83b6953898ddc18bb1192418a6a90"
] | [
"data_loader.py"
] | [
"import os\nimport copy\nimport json\nimport logging\n\nimport torch\nfrom torch.utils.data import TensorDataset\n\nfrom utils import get_intent_labels, get_slot_labels\n\nlogger = logging.getLogger(__name__)\n\n\nclass InputExample(object):\n \"\"\"\n A single training/test example for simple sequence classi... | [
[
"torch.save",
"torch.tensor",
"torch.utils.data.TensorDataset",
"torch.load"
]
] |
tristandeleu/rlpyt | [
"22eccb4e2b33d3c52947a27b6d300b575e36a3ea"
] | [
"rlpyt/samplers/async_/gpu_sampler.py"
] | [
"\nimport torch\nimport multiprocessing as mp\nimport ctypes\nimport psutil\nfrom collections import namedtuple\n\nfrom rlpyt.agents.base import AgentInputs\nfrom rlpyt.samplers.async_.base import AsyncParallelSamplerMixin\nfrom rlpyt.samplers.parallel.base import ParallelSamplerBase\nfrom rlpyt.samplers.parallel.g... | [
[
"torch.set_num_threads"
]
] |
Linxius/HPCnet | [
"689057cd3ec206e187fd3ac01fb3ae8ae41110ed"
] | [
"data_utils/dataset.py"
] | [
"import os\nimport numpy as np\nimport torch.utils.data as torch_data\nfrom data_utils import kitti_utils\nimport cv2\nfrom PIL import Image\n\n\nUSE_INTENSITY = False\n\n\nclass KittiDataset(torch_data.Dataset):\n def __init__(self, root_dir, split='train', mode='TRAIN'):\n self.split = split\n se... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.logical_xor",
"numpy.zeros",
"numpy.random.shuffle",
"numpy.logical_and",
"numpy.where",
"numpy.fromfile"
]
] |
srnn/sRNN | [
"00618c719553bf54f693b51bef6bec8eb233e51a"
] | [
"utils.py"
] | [
"import numpy as np\nimport torch.nn as nn\nimport torch\nimport torch.optim as optim\nfrom RNN_Cell import OrthoRNNCell, RNNCell, OrthoRNNCell2\nfrom cells import RNNCell1, RNNCell2, RNNCellLT, EURNNCell\nfrom LSTM import LSTM\nfrom expRNN.exprnn import ExpRNN, ExpRNN2\nimport argparse\nfrom expRNN.initialization ... | [
[
"numpy.dot",
"torch.optim.RMSprop",
"numpy.roots",
"numpy.ones",
"torch.optim.Adam",
"numpy.eye",
"torch.mm",
"numpy.sign",
"torch.load",
"numpy.outer"
]
] |
egrahl/iolite | [
"064e30d9d7ec8c08f60c486cf9d6c48cca6562b5"
] | [
"src/iolite/classification/classify_sigma.py"
] | [
"import os\nimport os.path\nfrom src.iolite.sigma.sigma_values import read_sigma_from_txt\nimport scipy\nimport scipy.stats\nfrom scipy.stats import percentileofscore\n\n\nclass SigmaClassifier:\n \"\"\"\n This class reads out sigma values from dials.integrate.log files, classifies\n and ranks these values... | [
[
"scipy.stats.percentileofscore"
]
] |
kkothari2001/Gesture-Mouse-using-OpenCV | [
"a43e67e48ccdaf644ecfc9be1aa937d5e44ff537"
] | [
"final.py"
] | [
"\nimport cv2\nimport numpy as np\nfrom pynput.mouse import Button, Controller\nimport wx\nmouse = Controller()\n\n\n# To get the screen size\napp = wx.App(False)\n(sx, sy) = wx.GetDisplaySize()\n\n\n# To set the HSV values of ranges\nlower_blue = np.array([110, 100, 100])\nupper_blue = np.array([130, 255, 255])\nl... | [
[
"numpy.array"
]
] |
abalone1/Image-Slicer | [
"c3f03d432f240f550f5a6b23f465ee44c66ada34"
] | [
"ImageSlicer.py"
] | [
"import numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport os\r\n \r\nclass ImageSlicer(object):\r\n \r\n def __init__(self, source, size, strides=[None, None], BATCH = False, PADDING=False):\r\n self.source = source\r\n self.size = size\r\n self.strides = strides\r\n self.BA... | [
[
"numpy.array",
"matplotlib.pyplot.imread",
"numpy.zeros"
]
] |
hieuhoang/FasterTransformer | [
"440695ccac874574b1d2e1121788e8fa674b4381"
] | [
"examples/pytorch/swin/Swin-Transformer-Quantization/data.py"
] | [
"# --------------------------------------------------------\n# Swin Transformer\n# Copyright (c) 2021 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ze Liu\n# --------------------------------------------------------\n# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights res... | [
[
"torch.utils.data.DistributedSampler",
"torch.distributed.get_world_size",
"torch.distributed.get_rank",
"torch.utils.data.DataLoader"
]
] |
nadheesh/probability | [
"5f576230f1e261a823e20a49c442ff38c8f381d3"
] | [
"tensorflow_probability/python/glm/fisher_scoring_test.py"
] | [
"# Copyright 2018 The TensorFlow Probability 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 a... | [
[
"tensorflow.convert_to_tensor",
"numpy.array",
"tensorflow.tensordot",
"numpy.mean",
"tensorflow.linalg.norm",
"numpy.sqrt",
"tensorflow.test.main",
"tensorflow.python.framework.test_util.run_in_graph_and_eager_modes",
"tensorflow.placeholder_with_default"
]
] |
rouseguy/DL_from_scratch | [
"5f6db821732f3766a686f07733879396ea2791ac"
] | [
"ann1.py"
] | [
"# Building neural network from scratch.\n# This version is based on the following blog:\n# https://enlight.nyc/projects/neural-network/\n\n# import the required libraries\nimport numpy as np\n\n\n\n# Create the training dataset - input features and labels\nX = np.array(([2, 9], [1, 5], [3, 6]), dtype=float)\ny = n... | [
[
"numpy.array",
"numpy.dot",
"numpy.random.randn",
"numpy.exp",
"numpy.amax"
]
] |
thorstenwagner/keras | [
"670349607fb0dd708ec8598ccea9e6689a3ea46c"
] | [
"keras/engine/saving.py"
] | [
"\"\"\"Model saving utilities.\n\"\"\"\nfrom __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import division\n\nimport numpy as np\nimport os\nimport json\nimport yaml\nimport warnings\nfrom six.moves import zip\n\nfrom .. import backend as K\nfrom .. import optimizers\nfro... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.reshape",
"numpy.asarray",
"numpy.hsplit",
"numpy.tile",
"numpy.split",
"numpy.prod",
"numpy.transpose",
"numpy.array_split"
]
] |
hitfee01/3DDeepBoxRetina2D | [
"40e81a014657ba995d8043fac8feef2cdeb285c2"
] | [
"Archs_2D/build_model.py"
] | [
"import torch\nfrom Archs_2D.configs import config\nfrom nets.Backbone import build_backbone\n\nfrom Archs_2D.RetinaNet import RetinaNet\nimport numpy as np\n\ntest_config = 'MOBIL-V2-RETINA-FPN'\ntest_backbone = 'MOBI-V2'\n\ndef build_model(name):\n backbone = None\n cfg = None\n if name == 'MOBI-V2-RETIN... | [
[
"numpy.ones"
]
] |
kepolol/craftassist | [
"f60a7edd0b4ea72b774cca45ba468d2e275445c2"
] | [
"python/craftassist/craftassist_agent.py"
] | [
"\"\"\"\nCopyright (c) Facebook, Inc. and its affiliates.\n\"\"\"\n\nimport os\nimport sys\n\n# python/ dir, for agent.so\nsys.path.append(os.path.join(os.path.dirname(__file__), \"..\"))\n\nimport faulthandler\nimport itertools\nimport logging\nimport numpy as np\nimport random\nimport re\nimport sentry_sdk\nimpor... | [
[
"numpy.random.choice"
]
] |
GauravJain28/ML-Assignments | [
"0de464fe6564a0bad43f7962c92563fe0a988285"
] | [
"A5-Yoga-Pose-Classification/Week 4/train_2019CS10407_2019CS10349.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torchvision\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms, utils, models\n\nfrom skimage import io, transform\n\nimport matplotlib.pyplot as plt # for plotting\nimport n... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.autograd.Variable",
"torch.nn.BatchNorm2d",
"torch.manual_seed",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"pandas.read_csv",
"torch.nn.CrossEntro... |
Rakeshpatil01/ReProj | [
"446c9b1876fc014389cb87e68cf221850cd294d2"
] | [
"simple_inventory_mrp.py"
] | [
"from dataclasses import dataclass\nfrom typing import Tuple, Dict, Mapping\nfrom modules.markov_process import MarkovRewardProcess\nfrom modules.markov_process import FiniteMarkovRewardProcess\nfrom modules.markov_process import State, NonTerminal\nfrom scipy.stats import poisson\nfrom modules.distribution import ... | [
[
"scipy.stats.poisson",
"numpy.random.poisson"
]
] |
iory/chainercv | [
"ecb1953f78c526dfd38308d68a4094c9f4df3a8d"
] | [
"examples/faster_rcnn/train.py"
] | [
"from __future__ import division\n\nimport argparse\nimport numpy as np\n\nimport chainer\nfrom chainer.datasets import ConcatenatedDataset\nfrom chainer.datasets import TransformDataset\nfrom chainer import training\nfrom chainer.training import extensions\nfrom chainer.training.triggers import ManualScheduleTrigg... | [
[
"numpy.random.seed"
]
] |
jobovy/flexce | [
"92808d9f93109e698f035359f9a0bb7efa8524dd"
] | [
"flexCE/calc_yields/karakas10_yields.py"
] | [
"\"\"\"Generate finely spaced grid of AGB yields using the Karakas (2010) yields.\n\nKarakas & Lattanzio (2010): M = 1.0, 1.25, 1.5, 1.75, 1.9, 2.0, 2.1, 2.25,\n2.5, 3.0, 3.5, 4.0, 5.0, 6.0, 6.5 (Zsolar only); Z = 0.0001, 0.004, 0.008,\n0.02\n\"\"\"\n\nfrom __future__ import print_function, division, absolute_impor... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.delete",
"scipy.interpolate.InterpolatedUnivariateSpline",
"numpy.zeros",
"numpy.ones",
"numpy.where",
"numpy.arange",
"numpy.append",
"numpy.log10"
]
] |
SimlaBurcu/Megatron-LM | [
"6b7ae136dc48d99a1e2defd4041ba0db67c99b1b"
] | [
"megatron/model/utils.py"
] | [
"# coding=utf-8\n# Copyright (c) 2020, 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 obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0... | [
[
"torch.no_grad",
"torch.erf",
"torch.nn.init.normal_",
"torch.ones_like",
"torch.tanh"
]
] |
FrieAT/MD_CompressedWavelet | [
"82bd10edd611485cd5f0b81da744e07a3b7c98eb"
] | [
"BIQAA.py"
] | [
"\n# Source: https://notebooks.azure.com/salva/projects/Digital-Image-Processing/html/001%20Anisotropic%20Quality%20Index%20(AQI).ipynb\n# Author: Salvador Gabarda\n\nfrom IProcess import IProcess, EDataType\n\nimport numpy as np\n#import matplotlib.pyplot as plt\n#import matplotlib.image as mpimg\nfrom scipy.fftpa... | [
[
"numpy.mean",
"numpy.multiply",
"numpy.finfo",
"scipy.signal.convolve2d",
"numpy.divide",
"numpy.uint8",
"numpy.nan_to_num",
"scipy.fftpack.fft",
"numpy.append",
"numpy.mod",
"numpy.array",
"numpy.zeros",
"numpy.real",
"numpy.amax",
"numpy.power",
"n... |
dendisuhubdy/kaggle-rsna | [
"4b690b2ce0e5d4b324d757e8a808accd15c951aa"
] | [
"src/utils/logger.py"
] | [
"# Code referenced from https://gist.github.com/gyglim/1f8dfb1b5c82627ae3efcfbbadb9f514.\nfrom io import BytesIO # Python 3.x\nfrom io import StringIO\n\nimport numpy as np\nimport scipy.misc\nimport tensorflow as tf\n\n\nclass Logger(object):\n def __init__(self, log_dir: str):\n \"\"\"Create a summary ... | [
[
"tensorflow.Summary",
"numpy.histogram",
"tensorflow.compat.v1.summary.FileWriter",
"numpy.max",
"tensorflow.HistogramProto",
"numpy.sum",
"numpy.min",
"numpy.prod",
"tensorflow.Summary.Value"
]
] |
hareshkm999/greenr | [
"24c03ac532e41731a3c78161542cb4f44ae08d43"
] | [
"app.py"
] | [
"#deep learning libraries\nfrom fastai.vision import *\nimport torch\ndefaults.device = torch.device('cpu')\n\n#web frameworks\nfrom starlette.applications import Starlette\nfrom starlette.responses import JSONResponse, HTMLResponse, RedirectResponse\nimport uvicorn\nimport aiohttp\nimport asyncio\n\nimport os\nimp... | [
[
"torch.device",
"torch.nn.functional.softmax"
]
] |
huyvohcmc/tensorflow | [
"ae244e6dabeb6b879c5adb9ca4c2a85cb4722dc5"
] | [
"tensorflow/python/training/moving_averages_test.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.variables.Variable",
"tensorflow.python.ops.variable_scope.variable_scope",
"tensorflow.python.ops.variable_scope.get_variable",
"tensorflow.python.ops.variables.moving_average_variables",
"tensorflow.python.pywrap_tensorflow.TF_bfloat16_type",
"tensorflow.python.eag... |
chicm/clouds | [
"66baff6527a55767ba39a531edec6f230d5e58e8"
] | [
"5fold/ensemble.py"
] | [
"import os\nimport argparse\nimport numpy as np\nimport pandas as pd\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import TensorDataset, DataLoader,Dataset\nfrom loader import CloudDataset, get_train_val_loaders, get_test_loader\nfrom catalyst.dl.runner import SupervisedRunner\nfrom catalyst.dl.callba... | [
[
"torch.cat",
"torch.stack",
"numpy.zeros",
"pandas.DataFrame",
"torch.no_grad",
"numpy.mean",
"torch.cuda.device_count",
"torch.nn.DataParallel"
]
] |
EvanBianco/bruges | [
"344238775961369740d36ee9aea368be006ba7fe"
] | [
"bruges/attribute/complex.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nComplex trace attributes.\n\n:copyright: 2021 Agile Geoscience\n:license: Apache 2.0\n\"\"\"\nimport numpy as np\nfrom scipy.signal import hilbert\n\n\ndef instantaneous_amplitude(traces):\n \"\"\"\n Compute instantaneous amplitude, also known as the envelope or\n reflecti... | [
[
"numpy.log",
"numpy.arctan",
"scipy.signal.hilbert",
"numpy.abs",
"numpy.clip",
"numpy.imag"
]
] |
morriso1/analysing_imaging_data | [
"3bb79c2b328cd6df8f1f244cf799659756de57cf"
] | [
"ratioimage/ratioimage_old.py"
] | [
"import pandas as pd\nimport dask.dataframe as dd\nimport numpy as np\nimport glob\nimport os\nimport re\n\n\"\"\"Module contains functions: read_csv_folder_into_tidy_df, grouped_tidy_data_summary_stats, exp_analysis_name, \ncompile_DF_from_CSVdirectory, extract_gut_names, combining_gut_DFs, analyse_imagej_CSVs, df... | [
[
"pandas.concat",
"pandas.DataFrame",
"pandas.Categorical",
"pandas.read_csv"
]
] |
monokrome/tensorflow | [
"2533ada7dd45b84d60677b8735e013d21044651a"
] | [
"tensorflow/python/estimator/canned/dnn_linear_combined.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.framework.ops.get_collection",
"tensorflow.python.ops.variable_scope.variable_scope",
"tensorflow.python.ops.state_ops.assign_add",
"tensorflow.python.layers.core.dropout",
"tensorflow.python.ops.control_flow_ops.group",
"tensorflow.python.framework.ops.colocate_with",
... |
btrspg/temp-scripts | [
"7898b751acb0074340802432447124317582b865"
] | [
"test_merge.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# @Time : 2018/6/12 上午11:25\n# @Author : Chen Yuelong\n# @Mail : yuelong_chen@yahoo.com\n# @File : test_merge.py\n# @Software: PyCharm\n\nfrom __future__ import absolute_import, unicode_literals\n\n__author__ = 'Chen Yuelong'\nimport os, sys\nimport pandas... | [
[
"matplotlib.use",
"pandas.merge",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"pandas.read_csv"
]
] |
VincentKaras/end2you | [
"2e49bc825ddf98dd49215ec2317247985de9070e"
] | [
"end2you/models/audio/zhao19.py"
] | [
"import torch\nimport torch.nn as nn\nimport numpy as np\n\nfrom .base import Base\n\n\nclass Zhao19(nn.Module):\n \n def __init__(self, input_size:int):\n \"\"\" Speech emotion recognition model proposed in:\n \n `Zhao, J., Mao, X. and Chen, L.. \"Speech emotion recognition using \n ... | [
[
"numpy.array",
"torch.nn.ELU"
]
] |
XL2248/MSCTD | [
"0bcba846855274c56e0c6b1321641ec624644bdf"
] | [
"src_code/thumt-dialog-wo-sp-decoder-w-mask-all-mlp-four/thumt/data/dataset.py"
] | [
"# coding=utf-8\n# Copyright 2017-2019 The THUMT Authors\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport math, code,os\nimport operator\nimport random\nimport numpy as np\nimport tensorflow as tf\nimport thumt.utils.distribute as distribute... | [
[
"tensorflow.shape",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.contrib.training.bucket_by_sequence_length",
"tensorflow.gfile.Open",
"tensorflow.gfile.GFile",
"tensorflow.Dimension",
"tensorflow.constant",
"tensorflow.data.TextLineDataset",
"tensorflow.squeeze",
... |
H1d3r/getaltname | [
"0aa63c648e0b8613c0a04af4af5aa87349e77394"
] | [
"gsan/output.py"
] | [
"import json\nimport click\nimport pandas as pd\n\n\ndef dump_filename(filename, subdomain_df):\n \"\"\"Output to CSV, JSON or Clipboard.\"\"\"\n filename = filename.lower()\n if filename.endswith(\".json\"):\n click.secho(f\"\\n[+] Contents dumped into JSON file: {filename}\", bold=True)\n w... | [
[
"pandas.melt"
]
] |
ksg14/DHIC | [
"dd1b226496e5f0a448740cf40f4438269c25f8e4"
] | [
"utils/dataset.py"
] | [
"from pathlib import Path\nfrom typing import Callable, Tuple\n\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nimport torch.nn.functional as F\n\nfrom PIL import Image\n# import cv2\n\nimport os\nimport numpy as np\nimport json\n\nclass HVGDataset (Dataset):\n\tdef __init__ (self, captions_file : ... | [
[
"torch.nn.functional.pad"
]
] |
ines-chami/KnowledgeGraphEmbedding | [
"584ee29a14b82f7c64947f2f6b2c3547213b6d29"
] | [
"codes/run.py"
] | [
"#!/usr/bin/python3\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport datetime\nimport json\nimport logging\nimport os\nimport random\n\nimport numpy as np\nimport torch\n\nfrom torch.utils.tensorboard import SummaryWriter\nf... | [
[
"torch.utils.tensorboard.SummaryWriter"
]
] |
CAPSTONE-Interpreter/dev_app-data | [
"e95a4550dfaeaa4370b6337253f6b9a1cd37a2d0"
] | [
"tensorflow_examples/lite/model_maker/third_party/efficientdet/hparams_config.py"
] | [
"# Copyright 2020 Google Research. 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... | [
[
"tensorflow.io.gfile.GFile"
]
] |
andykee/loupe | [
"8b10781598973aac7c129e190209acad7e5a9559"
] | [
"tests/test_zernike.py"
] | [
"import pytest\nimport numpy as np\nimport loupe\n\n\ndef test_zernike_rho_theta():\n with pytest.raises(ValueError):\n loupe.zernike(mask=1, index=1, normalize=True, rho=1, theta=None)\n\n\ndef test_zernike_positive():\n with pytest.raises(ValueError):\n loupe.zernike(mask=1, index=-1)\n\n\ndef... | [
[
"numpy.zeros_like",
"numpy.isclose",
"numpy.random.rand",
"numpy.ones",
"numpy.arange"
]
] |
OzFlux/data_analysis | [
"d3c3316fbee865a5ecf7dc23c15a223ec5b1fe80"
] | [
"eddy_pro_files/(co)spectras/plot_(co)spectras.py"
] | [
"'''\nThis script identifies all timestamps with a Foken flag 0 and plots the\ncorresponding (co)spectras including lowess fits.\nDaniel Metzen, 23/07/2019\n'''\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom glob import glob\nfrom tqdm import tqdm\nfrom statsmodels.nonparametric.s... | [
[
"matplotlib.pyplot.xscale",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"numpy.linspace",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"ma... |
Hesse73/Database-Explore | [
"3d79c0a5c8a15f5a6169231525e064c45f74473e"
] | [
"interact/car_database/extract.py"
] | [
"import pandas\nimport numpy as np\nimport json\n\nmax_part = 5\ndf = pandas.read_csv('car_database.csv')\n\nintro = {\"item_num\": len(df),\n \"attrs\": {\"discrete\": [],\n \"continuous\": []\n }}\nfor attr in df.columns:\n if 'Unnamed' in attr:\n continue\n ... | [
[
"numpy.min",
"pandas.read_csv",
"numpy.max",
"numpy.asarray"
]
] |
ntraut/baracus | [
"84e3c72ab088b869d0664fd9bc07b1d34db2affb"
] | [
"scripts/run_brain_age_bids.py"
] | [
"#! /usr/bin/env python\n\nimport argparse\nimport os\n\nimport pandas as pd\nfrom bids.grabbids import BIDSLayout\nfrom pkg_resources import resource_filename, Requirement\n\nfrom baracus import models_list, __version__\nfrom baracus.predict import predict_brain_age_single_subject\nfrom baracus.prepare import run_... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
ran404/bbgbridge | [
"7f84788e47bf3d34465b02a04168591583683b96"
] | [
"tests/test_bloomberg_result.py"
] | [
"import datetime\nimport unittest\n\nimport numpy as np\nimport numpy.testing as npt\nimport pandas as pd\nfrom collections import OrderedDict\n\nfrom bbgbridge.converters import price_to_frame\nfrom bbgbridge.result import BloombergRequestResult\nfrom bbgbridge.util import to_timestamp\n\n\ndef assert_dict_in_seri... | [
[
"numpy.testing.assert_almost_equal",
"numpy.isnan"
]
] |
anurendra/Web_IE | [
"4ba95320fd46d3c6fc090f3f095c7c7de78453bb"
] | [
"train.py"
] | [
"import numpy as np\nimport time\nimport torch\n\nfrom utils import print_and_log, print_confusion_matrix\n\n\ndef train_model(model, train_loader, optimizer, criterion, n_epochs, device, eval_loader, eval_interval=3, log_file='log.txt', ckpt_path='ckpt.pth'):\n \"\"\"\n Train the `model` (nn.Module) on data ... | [
[
"torch.no_grad",
"numpy.zeros",
"torch.load"
]
] |
burstable-ai/modin | [
"ee2440c53a1e3bd47736776e7c643f05c4a0db70"
] | [
"modin/pandas/test/test_series.py"
] | [
"# Licensed to Modin Development Team under one or more contributor license agreements.\n# See the NOTICE file distributed with this work for additional information regarding\n# copyright ownership. The Modin Development Team licenses this file to you under the\n# Apache License, Version 2.0 (the \"License\"); you... | [
[
"matplotlib.use",
"numpy.array",
"pandas.Index",
"numpy.random.choice",
"numpy.random.rand",
"numpy.random.RandomState",
"numpy.testing.assert_equal",
"pandas.DataFrame",
"numpy.testing.assert_array_equal",
"pandas.date_range",
"pandas.MultiIndex.from_tuples",
"pand... |
jcapriot/simpeg | [
"e88e653673c6b818592b6c075f76ee9215fe82b7"
] | [
"SimPEG/electromagnetics/viscous_remanent_magnetization/waveforms.py"
] | [
"import numpy as np\nimport scipy.special as spec\nimport properties\n\n###################################################\n# STEP OFF WAVEFORM\n###################################################\n\n\nclass StepOff(properties.HasProperties):\n\n \"\"\"\n\n \"\"\"\n\n t0 = properties.Float(\"Sta... | [
[
"numpy.max",
"scipy.special.expi",
"numpy.reshape",
"numpy.log",
"numpy.ones",
"numpy.min",
"numpy.interp",
"numpy.exp",
"numpy.float64",
"numpy.where",
"numpy.sign",
"numpy.abs"
]
] |
Apidwalin/tensorflow1-models-master | [
"30717bc3358f26da8be89c96e641f95604402b7d"
] | [
"official/core/actions.py"
] | [
"# Copyright 2021 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.CheckpointManager"
]
] |
LuoXukun/HanTokenization | [
"7041547d0a9c1772abcdbd490e4b74ef91806f88"
] | [
"notebooks/view-data.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n# In[1]:\n\n\nimport numpy as np\nimport torch\nimport os\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport json\nfrom collections import Counter\n\n\n# In[2]:\n\n\nDATAROOT = '../datasets'\nVOCAB_FILE = os.path.join(DATAROOT, 'training_vocab.txt'... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
lukeshingles/atlasserver | [
"87c8e437891a1516ac1fadb84d1d9b796dc5a367"
] | [
"taskrunner/atlas_gettaskfirstimage.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nThis script is to be run on sc01. A job datafile is used to get the first images in JPEG\n\"\"\"\n\nimport os\nimport pandas as pd\nfrom pathlib import Path\nimport sys\n\n\ndef main():\n if len(sys.argv) != 3:\n print(\"ERROR: exactly two argument must be specified: [DATA... | [
[
"pandas.read_csv"
]
] |
teffland/ner-expected-entity-ratio | [
"557bbba8fac9ea6f34f1394356fd98a17474b4e9"
] | [
"ml/dataset_readers/partial_jsonl_reader.py"
] | [
"from typing import Iterator, List, Dict, Any, Union, Tuple\nimport torch\nimport torch.optim as optim\nimport numpy as np\nfrom allennlp.data import Instance\nfrom allennlp.data.fields import (\n TextField,\n SequenceLabelField,\n ListField,\n LabelField,\n MetadataField,\n ArrayField,\n)\nfrom a... | [
[
"numpy.ceil"
]
] |
max-lutz/articles_code | [
"b53f182b249a703c3d51acbef29cd2a023b6dacb"
] | [
"data visualization streamlit/app.py"
] | [
"import streamlit as st \nimport pandas as pd\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport os\nfrom matplotlib.backends.backend_agg import RendererAgg\n\n#Loading the data\n@st.cache\ndef get_data_deputies():\n return pd.read_csv(os.path.join(os.getcwd(),'df_dep.csv'))\n@st... | [
[
"matplotlib.use",
"pandas.merge",
"pandas.DataFrame",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.Circle",
"pandas.get_dummies"
]
] |
shinya7y/gangealing | [
"6e6897640145544496c3115bf3f5b6209c89c7a0"
] | [
"applications/flow_scores.py"
] | [
"\"\"\"\nThis script runs a pre-trained Spatial Transformer on an input dataset and records the smoothness of the flow field\nproduced by the STN for every image. These smoothness values are treated as scores which can be used to filter the\ndataset. An image with low (highly negative) smoothness corresponds to an ... | [
[
"torch.cat",
"torch.quantile",
"torch.inference_mode",
"torch.load",
"torch.utils.data.Subset",
"torch.where"
]
] |
tangshixiang/HCD | [
"a843208bf749622d0fb118b9898c8103dd7208c5"
] | [
"spcl/models/hm_final.py"
] | [
"import numpy as np\nimport random\nimport torch\nimport torch.nn.functional as F\nfrom torch.nn import init\nfrom torch import nn, autograd\nfrom spcl.utils.faiss_rerank import compute_jaccard_distance_inital_rank,compute_jaccard_distance_inital_rank_index,compute_knn\nfrom collections import defaultdict\n\n\nclas... | [
[
"torch.zeros",
"torch.Tensor",
"torch.ones",
"torch.log",
"torch.exp"
]
] |
yqiuu/swing | [
"56c7ebf432976a9e8ccebc3d48640e48ff782f42"
] | [
"swing/tests/test_consistency.py"
] | [
"import pytest\nimport numpy as np\nfrom swing import ArtificialBeeColony, ParticleSwarm\n\n\ndef cost_func(x):\n x = np.asarray(x)\n return np.sum(x*x)\n\n\ndef compare_memo(memo_a, memo_b):\n np.testing.assert_array_equal(memo_a['iter'], memo_b['iter'])\n np.testing.assert_array_equal(memo_a['ncall'],... | [
[
"numpy.testing.assert_allclose",
"numpy.asarray",
"numpy.random.RandomState",
"numpy.sum",
"numpy.testing.assert_array_equal",
"numpy.all"
]
] |
Chang-Chia-Chi/Parallel-Music-Generator | [
"a500e3cd75b40c0a1413f20cdbce42fdb91167a1"
] | [
"musicGen/musicGen.py"
] | [
"import os\nimport glob\nimport json\nimport time\nimport numpy as np\nimport multiprocessing as mp\nfrom const_gen import *\n\nmusic_id = 0\n\nMajorHigh = 1\nMajorLow = 2\nMinorHigh = 3\nMinorLow = 4\nMajorChord = 5\nMinorChord = 6\n\nmajor_types = np.array([MajorChord, MajorChord, MajorLow, MajorLow, MajorHigh, \... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.random.choice",
"numpy.random.seed",
"numpy.load",
"numpy.random.randint"
]
] |
uiuc-covid19-modeling/pydemic | [
"3c0af60c2ac7e0dbf722584f61c45f9a2f993521"
] | [
"pydemic/mitigation.py"
] | [
"__copyright__ = \"\"\"\nCopyright (C) 2020 George N Wong\nCopyright (C) 2020 Zachary J Weiner\n\"\"\"\n\n__license__ = \"\"\"\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restr... | [
[
"numpy.array",
"numpy.insert",
"numpy.append"
]
] |
nicolalandro/nnsvs | [
"45da00218dd0a445c8483f11ac891c6ef00d3925"
] | [
"nnsvs/bin/train_resf0.py"
] | [
"from pathlib import Path\n\nimport hydra\nimport numpy as np\nimport torch\nfrom hydra.utils import to_absolute_path\nfrom nnsvs.base import PredictionType\nfrom nnsvs.mdn import mdn_loss\nfrom nnsvs.pitch import nonzero_segments\nfrom nnsvs.train_util import save_checkpoint, setup\nfrom nnsvs.util import make_non... | [
[
"torch.zeros",
"torch.nn.MSELoss",
"torch.diff",
"torch.arange",
"torch.finfo",
"numpy.allclose",
"torch.cuda.is_available",
"torch.zeros_like",
"torch.sort",
"torch.where"
]
] |
lsdras/NeMo | [
"498f21a1c695afc5ed5f2f6fb173dc612c9551a7"
] | [
"nemo/collections/nlp/models/duplex_text_normalization/duplex_decoder.py"
] | [
"# Copyright (c) 2021, 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 obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"torch.stack",
"torch.no_grad",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.nn.functional.softmax"
]
] |
inoue0406/radarJMA | [
"f8996c3fe201f97d414fc96c4abfc6f930738d47"
] | [
"src/mnist_pytorch_dataset.py"
] | [
"import torch \nimport torchvision\nimport numpy as np\nimport torch.utils.data as data\nimport torchvision.transforms as transforms\n\nimport pandas as pd\nimport hickle as hkl\nimport os\n\n# Pytorch custom dataset for Moving MNIST data\n# The class assumes the data to be in hkl format\n\nclass MNISTDataset(data.... | [
[
"numpy.transpose"
]
] |
ZhangMengxia/R2plus1D_TSN_combine | [
"028a51fc15690afc32c3b6c8ac1d22b7902b21ed"
] | [
"network_tsn.py"
] | [
"import torch.nn as nn\nimport torchvision\n\nclass TSNClassifier(nn.Module):\n \"\"\"A reimplementation of TSN model\n Args:\n num_classes: Number of classes\n num_segments: Number of segments\n base_model: backbone model for feature extraction\n dropout: dropo... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.init.constant_",
"torch.nn.init.normal_",
"torch.nn.Conv2d"
]
] |
SyedSaifAliAlvi/Image-Data-Augmentation | [
"8c8dca3ef8542cf8ab4d618172de4a8a9ce064cb"
] | [
"image_data_augmentation.py"
] | [
"from skimage import transform\nfrom skimage.util import random_noise\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nimport cv2\nimport glob\nimport random\n\ndef data_augment(X_data,y):\n x = X_data.copy()\n y_new = y.copy()\n for i in X_data:\n k1 = np.flip... | [
[
"numpy.zeros_like",
"numpy.asarray",
"numpy.flipud",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"numpy.fliplr"
]
] |
TuxStory/Python3 | [
"4c1b2291d1613b32aa36b62b0b881ea40b423cce"
] | [
"matplotPIE2.py"
] | [
"import matplotlib.pyplot as plt\n\n# Pie chart, where the slices will be ordered and plotted counter-clockwise:\nlabels = 'Windows', 'Linux', 'Apple'\nsizes = [83, 5, 10]\nexplode = (0, 0.1, 0) # only \"explode\" the 3rd slice (i.e. 'Hogs')\n\nfig1, ax1 = plt.subplots()\nax1.pie(sizes, explode=explode, labels=lab... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
lucapericlp/kohonen | [
"c6e84cc95b0468e49d258d3e40843b8090dcd3a0"
] | [
"backup.py"
] | [
"import math\nimport random\nimport pandas as pd\nfrom Neuron import Neuron\nfrom Neuron import getNormalised\nfrom Visualiser import Visualiser\n\nclass Network():\n\n\tdef __init__(self,numNeurons):\n\t\tself.neurons = []\n\t\tfor i in range(numNeurons):\n\t\t\tself.neurons.append(Neuron(weights=[random.uniform(0... | [
[
"pandas.read_csv"
]
] |
yanxi0830/IIC | [
"77641baebca36d5e5f7c9ec25c0755d14524dd4e"
] | [
"code/archs/segmentation/baselines/net10a_isola.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom code.archs.cluster.vgg import VGGNet\nfrom code.archs.segmentation.net10a import SegmentationNet10aTrunk, \\\n SegmentationNet10a\nfrom code.utils.segmentation.baselines.general import get_patches\n\n__all__ = [\"SegmentationNet10aIsol... | [
[
"torch.nn.Linear",
"torch.sigmoid",
"torch.cat",
"torch.nn.Dropout",
"torch.nn.BatchNorm2d",
"torch.nn.functional.interpolate",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
ykrasnikov/web-scraping-challenge | [
"c8ede84d68b102a68625b091345765823dbb1c56"
] | [
"mission_to_mars/functions_scrape_mars.py"
] | [
"######################################################################\n########## import libraries\nfrom bs4 import BeautifulSoup as bs\nimport pandas as pd\nimport re\nfrom pymongo.mongo_client import MongoClient\nfrom splinter import Browser\n# as a playground - we will try selenium as well\nfrom selenium impor... | [
[
"pandas.read_html"
]
] |
husheng876/pytorch_nested-unet | [
"c5bf662a4fd7980182c20197d7dbedfd5aa332bc"
] | [
"archs_backup.py"
] | [
"#################################\n#本文件用于存储archs中调试好的结构代码,用于简化archs代码长度\n#当需要使用相关结构模型时\n#################################\nimport torch\nfrom torch import nn\n\n######the header file from CRDN.py\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math\nimport numpy as np\nfrom torch.nn i... | [
[
"torch.cat",
"torch.nn.BatchNorm2d",
"torch.bmm",
"torch.where",
"torch.sigmoid",
"torch.nn.Softmax",
"torch.nn.MaxPool2d",
"torch.zeros_like",
"torch.zeros",
"torch.nn.functional.relu6",
"torch.nn.AdaptiveAvgPool2d",
"torch.max",
"torch.nn.Sequential",
"tor... |
fratim/pfrl | [
"ddcdfbebf7aa55753beb5195edf8d571be7b862c"
] | [
"pfrl/experiments/train_agent_async.py"
] | [
"import logging\nimport os\nimport signal\nimport subprocess\nimport sys\n\nimport numpy as np\nimport torch\nimport torch.multiprocessing as mp\nfrom torch import nn\n\nfrom pfrl.experiments.evaluator import AsyncEvaluator\nfrom pfrl.utils import async_, random_seed\n\n\ndef kill_all():\n if os.name == \"nt\":\... | [
[
"torch.multiprocessing.Event",
"numpy.arange",
"torch.multiprocessing.Value"
]
] |
SirCraftinator/Stock-Trading-Bot | [
"66156a3bac719d94bf9e917ebca9c127fed04994"
] | [
"Version-1/DataGathering/Open_Close/Trainers/KNN/knn_trainer.py"
] | [
"#this file includes info on converting irregular data\nimport sklearn\nfrom sklearn.utils import shuffle\nfrom sklearn.neighbors import KNeighborsRegressor\nimport pandas as pd\nimport numpy as np\nfrom sklearn import linear_model, preprocessing\nimport pickle\n\npath = '/Users/oceanhawk/Documents/Python/Stock-Tra... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.LabelEncoder",
"pandas.read_csv",
"sklearn.neighbors.KNeighborsRegressor"
]
] |
dpukhkaiev/BRISE2 | [
"647ad6d7cc5f91c188aa45e403d9c1a33a7fe947"
] | [
"main_node/model/predictor.py"
] | [
"import copy\nimport logging\nfrom collections import OrderedDict\nfrom typing import List, Mapping\n\nimport pandas as pd\nfrom core_entities.configuration import Configuration\nfrom core_entities.search_space import Hyperparameter\nfrom model.model_selection import get_model\n\n\nclass Predictor:\n \"\"\"\n ... | [
[
"pandas.DataFrame"
]
] |
tianjiansmile/Chinese-Text-Classification-Pytorch | [
"05cc211b161f61e6bb32ab185dadcffec2f5b5de"
] | [
"run.py"
] | [
"# coding: UTF-8\nimport time\nimport torch\nimport numpy as np\nfrom train_eval import train, init_network\nfrom importlib import import_module\nimport argparse\n\nparser = argparse.ArgumentParser(description='Chinese Text Classification')\nparser.add_argument('--model', type=str, required=True, help='choose a mod... | [
[
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.manual_seed_all"
]
] |
danbailo/LogisticRegression | [
"6c22f3c0c28f353527ee6ac0af6ec0d9087f90fd"
] | [
"src/utils.py"
] | [
"import numpy as np\nfrom PIL import Image\nfrom PIL import ImageDraw \nimport glob\n\ndef get_data(directory, class_):\n\tX = []\n\tY = []\n\tfor image_data in glob.glob(directory):\n\t\timg = np.asarray(Image.open(image_data))\n\t\timg = np.reshape(img, -1)\n\t\tX.append(img)\n\t\tif class_ == \"cat\":\n\t\t\tY.a... | [
[
"numpy.reshape"
]
] |
VIEW2020/varianz2012 | [
"3d055ffd2b259275d93b0f862d319fc23035226f"
] | [
"code/lib/utils.py"
] | [
"'''\r\nMay 2020 by Sebastiano Barbieri\r\ns.barbieri@unsw.edu.au\r\nhttps://www.github.com/sebbarb/\r\n'''\r\n\r\nimport numpy as np\r\nimport math\r\nimport pandas as pd\r\nimport pickle as pkl\r\nfrom scipy.stats import f\r\n\r\nfrom pdb import set_trace as bp\r\n\r\n\r\ndef save_obj(obj, name):\r\n with open... | [
[
"pandas.DataFrame",
"scipy.stats.f.tell",
"scipy.stats.f.sf"
]
] |
bergkvist/pandapower | [
"630e3278ca012535f78282ae73f1b86f3fe932fc"
] | [
"pandapower/pypower/pfsoln.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright 1996-2015 PSERC. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n# Copyright (c) 2016-2020 by University of Kassel and Fraunhofer Institute for Energy Economics\n# and Energy System Technology (IE... | [
[
"numpy.angle",
"numpy.setdiff1d",
"numpy.zeros",
"numpy.asarray",
"numpy.ones",
"numpy.real",
"numpy.ix_",
"numpy.finfo",
"numpy.conj",
"numpy.intersect1d",
"numpy.flatnonzero"
]
] |
mastafaMicrosoft/scattertext | [
"6a9b6b85525bc25dec75c4767668881224dd5612"
] | [
"scattertext/termcompaction/AssociationCompactor.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom scipy.stats import rankdata\n\nfrom scattertext.termranking.AbsoluteFrequencyRanker import AbsoluteFrequencyRanker\nfrom scattertext.termscoring.ScaledFScore import ScaledFScorePresetsNeg1To1\n\n\nclass TermCategoryRanker(object):\n def __init__(self,\n ... | [
[
"pandas.DataFrame",
"scipy.stats.rankdata",
"numpy.isnan",
"numpy.log"
]
] |
IIT-PAVIS/Acoustic-Image-Generation | [
"a31c32ed6c3fe96d82b715833b7d32c87575e62b"
] | [
"decodeimagesacresnet.py"
] | [
"from datetime import datetime\nfrom dataloader.outdoor_data_mfcc import ActionsDataLoader as SoundDataLoader\nfrom dataloader.actions_data_old import ActionsDataLoader\nfrom models.unet_acresnet import UNetAc\nfrom models.vision import ResNet50Model\nimport numpy as np\nimport tensorflow as tf\nimport os\nimport m... | [
[
"tensorflow.data.Iterator.from_string_handle",
"matplotlib.pyplot.savefig",
"tensorflow.train.Saver",
"tensorflow.reshape",
"matplotlib.pyplot.subplots",
"numpy.shape",
"tensorflow.device",
"tensorflow.placeholder",
"matplotlib.pyplot.tight_layout",
"numpy.stack",
"tens... |
PrinceVictor/PMHT | [
"00ced4148e356a78bc86c835195d0030cd3e6890"
] | [
"utils/preprocess.py"
] | [
"import pandas as pd\nimport numpy as np\nimport glob\nimport os\nimport sys\nimport time\nimport argparse\nimport json\n\ndef cvtDP_Txt2CSV(source_dir, output_dir, save_csv = False, save_json=True):\n raw_data = pd.read_csv(os.path.join(source_dir, \"raw.txt\"), header=None, index_col=None)\n raw_csv = forma... | [
[
"numpy.deg2rad",
"pandas.DataFrame",
"pandas.read_csv"
]
] |
ellequelle/pandas | [
"cea27b47b2b1ac804463e70d98443be3450688b0"
] | [
"pandas/tests/indexes/test_numpy_compat.py"
] | [
"import numpy as np\nimport pytest\n\nfrom pandas import (\n CategoricalIndex,\n DatetimeIndex,\n Index,\n NumericIndex,\n PeriodIndex,\n TimedeltaIndex,\n isna,\n)\nimport pandas._testing as tm\nfrom pandas.core.api import Float64Index\nfrom pandas.core.arrays import BooleanArray\nfrom pandas.... | [
[
"pandas._testing.external_error_raised",
"pandas.isna",
"numpy.errstate",
"pandas._testing.assert_index_equal"
]
] |
Ramzesovich66/CarND-Advanced-Lane-Lines-P2 | [
"30d445cbf5ed2b07b1fdf004a45d3624bf54c0ee"
] | [
"source_code/binary_image.py"
] | [
"import numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\n# Import configuration parameters\nimport config as cfg\n\n# Defines a function that applies Sobel x or y, then takes an absolute value and applies a threshold.\n# 1) Take the derivative in x or y given orient = 'x' or 'y'\n# 2) Take the absolute val... | [
[
"numpy.max",
"numpy.array",
"numpy.zeros_like",
"numpy.copy",
"numpy.ones"
]
] |
Ziems/OBST | [
"e31f460616d8bc29931f069843e4f94b7f38e260"
] | [
"tests/backend.py"
] | [
"import typing\n\nimport mesh_tensorflow as mtf\nimport numpy as np\nimport tensorflow as tf\n\nfrom src.dataclass import BlockArgs, ModelParameter\n\ntf1 = tf.compat.v1\n\ntf1.disable_v2_behavior()\n\nRELU_STD = 1 / 1.42\n\n\nclass BaseTest:\n def __init__(self,\n *args,\n mesh_s... | [
[
"tensorflow.Graph",
"numpy.isclose"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.