repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
pientaa/opening-black-box | [
"9fa3ecd5298a940893f289550d441a38b0bee71d"
] | [
"monitor-manager/monitor-manager.py"
] | [
"import json\r\nimport logging\r\nimport pandas as pd\r\nimport requests\r\nimport socket\r\nimport time\r\nfrom csv import reader\r\nfrom flask import Flask\r\n\r\napp = Flask(__name__)\r\n\r\n\r\n@app.route('/')\r\ndef health_check():\r\n return \"Monitor Manager working\"\r\n\r\n\r\n@app.route('/experiments',... | [
[
"pandas.read_csv"
]
] |
vhzy/pythia | [
"8fae4da2b7ad4d047a1a51651407ff1f91745d5f"
] | [
"get_npy.py"
] | [
"import numpy as np\ntest=np.load('/home/ubuntu/hzy/pythia/data/m4c_textvqa_ocr_en_frcn_features/train_images/f441f29812b385ad_info.npy',encoding = \"latin1\",allow_pickle=True) #加载文件\ndoc = open('contrast9.txt', 'a') #打开一个存储文件,并依次写入\nprint(test, file=doc) #将打印内容写入文件中"
] | [
[
"numpy.load"
]
] |
tohoaa/wetectron | [
"b2e406a71df31ee2a80e101c513fccc0b21b82cd"
] | [
"tools/test_net.py"
] | [
"# --------------------------------------------------------\n# Copyright (C) 2020 NVIDIA Corporation. All rights reserved.\n# Nvidia Source Code License-NC\n# --------------------------------------------------------\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\n# Set up custom environm... | [
[
"torch.distributed.init_process_group",
"torch.cuda.set_device"
]
] |
erfect2020/DecompositionForFusion | [
"73e65485b84a3802ecd80b8b926108d103be1a62"
] | [
"models/UCSharedModelProCommon.py"
] | [
"import torch.nn as nn\nimport torch\nimport torch.nn.init as init\nfrom .resnet import ResNestLayer, Bottleneck\nimport math\n\n\nclass UCSharedNetPro(nn.Module):\n def __init__(self):\n super(UCSharedNetPro, self).__init__()\n encoder_upper = [nn.Conv2d(3, 16, 3, 1, 1, bias=True),\n ... | [
[
"torch.nn.Sequential",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Upsample",
"torch.nn.ReLU"
]
] |
hckynumber9/nn-holdem | [
"ef49a91369733eb1453c5db71c77f644ca91fa23"
] | [
"holdem/playercontrol.py"
] | [
"import numpy as np\nimport uuid\nfrom threading import Thread\n\nimport xmlrpc.client\nfrom xmlrpc.server import SimpleXMLRPCServer\n\nfrom .holdemai import HoldemAI\nfrom deuces.deuces import Card\n\n# xmlrpc.client.Marshaller.dispatch[long] = lambda _, v, w: w(\"<value><i8>%d</i8></value>\" % v)\n# xmlrpc.client... | [
[
"numpy.random.randint"
]
] |
avagait/gaitcopy | [
"2fee760156b289ef12f19fb366fb62cf535c305e"
] | [
"nets/mj_gaitcopy_model.py"
] | [
"# Copies signatures\n# (c) MJMJ/2021\n\nimport tensorflow as tf\nimport tensorflow.keras.backend as K\nimport tensorflow_addons as tfa\nimport deepdish as dd\nimport os\nimport numpy as np\nfrom nets.triplet_loss_all import TripletBatchAllLoss\n\n# ===============================================================\n#... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.keras.Sequential",
"tensorflow.keras.layers.ConvLSTM2D",
"tensorflow.keras.layers.ZeroPadding2D",
"tensorflow.keras.initializers.GlorotUniform",
"tensorflow.keras.optimizers.SGD",
"tensorflow.keras.layers.Concatenate",
"numpy.random... |
FerdinandZhong/ML-Model-CI | [
"90fa2de056dca05031f0787b96c520dc57dc664d"
] | [
"modelci/app/experimental/endpoints/model_structure.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nAuthor: Li Yuanming\nEmail: yli056@e.ntu.edu.sg\nDate: 1/31/2021\n\nML model structure related API\n\"\"\"\nimport torch\nfrom fastapi import APIRouter\nfrom modelci.hub.manager import get_remote_model_weight\n\nfrom modelci.types.bo import Engine\n\nfrom mod... | [
[
"torch.load"
]
] |
simon2112/OCR | [
"506ec018dc67832b41979784bfc847e1c7d73480"
] | [
"Recursive/test.py"
] | [
"from parse_args import parse_args\nimport editdistance\nimport numpy as np\nimport tensorflow as tf\nfrom cnn import build_cnn\nfrom network import build_network\nfrom tools import load_img\nimport tools\nflags = parse_args()\n\nclass Dataset:\n\n def __init__(self,x):\n self._index_in_epoch = 0\n ... | [
[
"tensorflow.Graph",
"tensorflow.train.latest_checkpoint",
"numpy.arange",
"numpy.concatenate",
"tensorflow.reset_default_graph",
"tensorflow.Session",
"tensorflow.train.Saver",
"numpy.array",
"numpy.zeros"
]
] |
krishpop/leibnizgym | [
"21deb066af612b764c25a28d37bfa8f9cf6c124d"
] | [
"scripts/rlg_train.py"
] | [
"# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n# NVIDIA CORPORATION and its licensors retain all intellectual property\n# and proprietary rights in and to this software, related documentation\n# and any modifications thereto. Any use, reproduction, disclosure or\n# distribution of this software ... | [
[
"numpy.asarray"
]
] |
rjuppa/vmmr | [
"a968b869e00fe46ef862fe794b063318a66c894f"
] | [
"keras/util/augment.py"
] | [
"#!/usr/bin/env python3\n\n# create a dataset with same size of classes\n# use augmentation if necessary\n\nimport os, math\nfrom os.path import join\n\nimport cv2\nimport numpy as np\nimport random\nimport shutil\n\n\nTOTAL = 5000\nMIN_LIMIT = 50\nparent_path = os.path.abspath('.')\n# root = \"/Users/radekj/devroo... | [
[
"numpy.arange",
"numpy.where",
"numpy.float32"
]
] |
aaguasca/gammapy | [
"b1a4e9dbaeec23b3eaca1c874752e92432920a42"
] | [
"gammapy/modeling/models/spatial.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"Spatial models.\"\"\"\nimport logging\nimport os\nimport numpy as np\nimport scipy.integrate\nimport scipy.special\nimport astropy.units as u\nfrom astropy.coordinates import Angle, SkyCoord\nfrom astropy.coordinates.angle_utilities import angu... | [
[
"matplotlib.pyplot.gca",
"numpy.sqrt",
"numpy.abs",
"numpy.linalg.eig",
"numpy.cos",
"numpy.sort",
"numpy.sin",
"numpy.all",
"numpy.max",
"numpy.arctan2",
"numpy.ceil",
"numpy.errstate",
"numpy.exp",
"numpy.where",
"numpy.sum",
"numpy.zeros"
]
] |
MKegler/SpeechtACSmodel | [
"f7b747a1a286f2dd239f452184d790e096366de7"
] | [
"PyNSL/PyNSL.py"
] | [
"'''\nDirect Python port of a few functions from NSL toolbox implementing\nearly stage auditory processing. All credits go to the original authors.\nThe below implementation has been tested against the original \nMatlab code (http://nsl.isr.umd.edu/downloads.html) and yielded identical results.\nImplementation: Mik... | [
[
"numpy.arange",
"scipy.io.loadmat",
"numpy.round",
"numpy.ceil",
"numpy.max",
"scipy.signal.lfilter",
"numpy.exp",
"numpy.zeros"
]
] |
minghao92/LocalPer | [
"c940dce63ff2583f836d4718ce43023fad310c05"
] | [
"localper_clustering_random_graphs.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport networkx as nx\nimport numpy as np\nimport math\nimport snap\nimport random\nimport os\nimport argparse\n\n\nimport matplotlib.pyplot as plt\n\nimport scipy.spatial.distance as ssd\nfrom scipy.cluster.hierarchy import dendrogram, linkage\n\nfrom sklearn.clu... | [
[
"numpy.hstack",
"matplotlib.pyplot.title",
"numpy.asarray",
"scipy.cluster.hierarchy.dendrogram",
"numpy.linalg.norm",
"matplotlib.pyplot.savefig",
"scipy.cluster.hierarchy.linkage",
"scipy.spatial.distance.squareform",
"sklearn.cluster.MiniBatchKMeans",
"matplotlib.pyplot.... |
islamamirul/PermuteNet | [
"842591892d5b3af0e175a99b21c8e4e7cd7bd94b"
] | [
"channel-wise-position-encoding/models/vgg.py"
] | [
"'''VGG11/13/16/19 in Pytorch.'''\nimport torch\nimport torch.nn as nn\nfrom collections import OrderedDict\nimport torch.nn.functional as F\n\n\ncfg = {\n 'VGG5': [32, 'M', 64, 'M', 128, 'M', 256],\n 'VGG11': [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'],\n 'VGG13': [64, 64, 'M', 128, 1... | [
[
"torch.nn.functional.upsample",
"torch.nn.Sequential",
"torch.randperm",
"torch.nn.functional.avg_pool2d",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
Rijksmuseum-Voice-Inference/voice-to-voice-translation | [
"bbdeb3fd4dc49311a735b59a580a33996ea6bbd3"
] | [
"scripts/extract_features_for_merlin.py"
] | [
"import os\nimport sys\nimport shutil\nimport glob\nimport time\nimport multiprocessing as mp\nimport numpy as np\nimport wave\n\nif len(sys.argv)!=5:\n print(\"Usage: \")\n print(\"python extract_features_for_merlin.py <path_to_merlin_dir> <path_to_wav_dir> <path_to_feat_dir> <sampling rate>\")\n sys.exit... | [
[
"numpy.fromfile",
"numpy.squeeze",
"numpy.mod",
"numpy.array",
"numpy.zeros",
"numpy.loadtxt"
]
] |
ankitjain0101/Google-Store-Customer-Profiling | [
"627017c8dae8c3e7d643fdac79b0fba42ac5ffc2"
] | [
"GA_Revenue.py"
] | [
"import pandas as pd\r\nimport numpy as np\r\nimport seaborn as sns\r\nimport matplotlib.pyplot as plt\r\nimport json\r\nimport collections\r\nfrom sklearn.preprocessing import LabelEncoder\r\nfrom lightgbm.sklearn import LGBMRegressor\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.metrics ... | [
[
"matplotlib.pyplot.imshow",
"pandas.to_datetime",
"pandas.Series",
"sklearn.metrics.mean_absolute_error",
"sklearn.metrics.mean_squared_error",
"numpy.round",
"sklearn.preprocessing.LabelEncoder",
"pandas.read_csv",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.axis",
... |
CVPR2020/EnAET | [
"f490777980d20c68ca63764b7fc25537d7e72660"
] | [
"Model/Classifier.py"
] | [
"# /*******************************************************************************\n# * Author : CVPR2020_EnAET\n# *******************************************************************************/\nimport math\nimport torch.nn as nn\nimport numpy as np\nfrom Model.Basic_Block import Flatten,BasicBlock,GlobalAverag... | [
[
"torch.nn.Sequential",
"torch.nn.BatchNorm1d",
"numpy.sqrt",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
jeffhsu3/tf-bind-transformer | [
"18e95c51b654ea1876a303565532b20a0a386233"
] | [
"tf_bind_transformer/training_utils.py"
] | [
"import torch\nfrom torch import nn\nfrom tf_bind_transformer.optimizer import get_optimizer\nfrom tf_bind_transformer.data import read_bed, collate_dl_outputs, get_dataloader, remap_df_add_experiment_target_cell\nfrom tf_bind_transformer.data import RemapAllPeakDataset, NegativePeakDataset, ScopedNegativePeakDatas... | [
[
"torch.Tensor"
]
] |
Aaron506/caltech-ee148-spring2020-hw02 | [
"aefe6755b9210f70f2983ec5c046f60ff12c5535"
] | [
"run_predictions.py"
] | [
"import os\nimport numpy as np\nimport json\nfrom PIL import Image, ImageDraw, ImageFont\n\n# Aaron added\nimport matplotlib.pyplot as plt\nimport pdb\nfrom numba import jit\n# Only used to provide a standard data structure to speed up clustering\nfrom unionfind import unionfind\n\nif __name__ == '__main__':\n p... | [
[
"matplotlib.pyplot.imshow",
"numpy.abs",
"numpy.asarray",
"numpy.linalg.norm",
"numpy.ones",
"numpy.max",
"numpy.std",
"numpy.shape",
"numpy.mean",
"matplotlib.pyplot.close",
"numpy.where",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"matplotlib.pyplot.fi... |
aliayub7/CBCL | [
"23b92dc4323ccc97984905e616fc26a33e387e52"
] | [
"main_file.py"
] | [
"\"\"\"\nComplete CBCL code\n\"\"\"\n\nimport numpy as np\nfrom copy import deepcopy\nimport pickle\nfrom multiprocessing import Pool\nfrom sklearn.model_selection import train_test_split\nfrom Functions import get_centroids\nfrom Functions import check_reduce_centroids\nfrom Functions import get_test_accuracy\nfro... | [
[
"numpy.sum",
"sklearn.model_selection.train_test_split",
"numpy.random.seed"
]
] |
LaudateCorpus1/llvm-project-staging | [
"cc926dc3a87af7023aa9b6c392347a0a8ed6949b"
] | [
"mlir/test/python/dialects/sparse_tensor/test_SpMM.py"
] | [
"# RUN: SUPPORT_LIB=%mlir_runner_utils_dir/libmlir_c_runner_utils%shlibext %PYTHON %s | FileCheck %s\n\nimport ctypes\nimport numpy as np\nimport os\n\nimport mlir.all_passes_registration\n\nfrom mlir import ir\nfrom mlir import runtime as rt\nfrom mlir import execution_engine\nfrom mlir import passmanager\n\nfrom ... | [
[
"numpy.array",
"numpy.zeros",
"numpy.allclose",
"numpy.matmul"
]
] |
andrea-silvi/pointnet.pytorch | [
"6aa48c12f6b507dedb3af716c61310ac574aea91"
] | [
"gcnn/gcnn_model.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n@Author: Yue Wang\n@Contact: yuewangx@mit.edu\n@File: model.py\n@Time: 2018/10/13 6:35 PM\n\"\"\"\n\nimport argparse\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\ndef knn(x, k):\n inner = -2 * torch.matmul(x.transpose(2, 1), x)... | [
[
"torch.nn.BatchNorm1d",
"torch.cat",
"torch.nn.functional.adaptive_max_pool1d",
"torch.nn.Conv2d",
"torch.sum",
"torch.arange",
"torch.unsqueeze",
"torch.nn.Tanh",
"torch.nn.functional.adaptive_avg_pool1d",
"torch.nn.Linear",
"torch.nn.Conv1d",
"torch.rand",
"to... |
atypon/specter | [
"bc1ee723167cf1dbf599603e09539c1823f26c17"
] | [
"scripts/pytorch_lightning_training_script/train.py"
] | [
"# basic python packages\nimport json\nimport pickle\nfrom typing import Dict\nimport argparse\nfrom argparse import Namespace\nimport glob\nimport random\nimport numpy as np\nimport itertools\nimport logging\nlogger = logging.getLogger(__name__)\n\n# pytorch packages\nimport torch\nimport torch.nn as nn\nimport to... | [
[
"numpy.random.seed",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.utils.data.get_worker_info",
"torch.nn.functional.pairwise_distance",
"torch.nn.functional.relu",
"torch.nn.functional.cosine_similarity",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all",
... |
kanderso-nrel/pyopencl | [
"0ee2164ec65de9a4aa69e0c01e70aa66c3d989cb"
] | [
"examples/demo_mandelbrot.py"
] | [
"# I found this example for PyCuda here:\n# http://wiki.tiker.net/PyCuda/Examples/Mandelbrot\n#\n# An improved sequential/pure Python code was contributed\n# by CRVSADER//KY <crusaderky@gmail.com>.\n#\n# I adapted it for PyOpenCL. Hopefully it is useful to someone.\n# July 2010, HolgerRapp@gmx.net\n#\n# Original re... | [
[
"numpy.arange",
"numpy.uint16",
"numpy.ravel",
"numpy.array",
"numpy.zeros",
"numpy.where",
"numpy.empty"
]
] |
marblet/gat-pytorch | [
"ff9cfad34460ab505458477ac43cd5f03fc78a46"
] | [
"train.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom torch.optim import Adam\nfrom copy import deepcopy\nfrom numpy import mean, std\nfrom tqdm import tqdm\n\ndevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n\n\nclass EarlyStopping:\n def __init__(self, patience, verbose, use_loss, use_acc,... | [
[
"torch.cuda.synchronize",
"torch.nn.functional.nll_loss",
"numpy.std",
"torch.no_grad",
"numpy.mean",
"torch.cuda.is_available"
]
] |
otaviomguerra/airflow-presentation | [
"c83f37f9abe6cdf8c42d8050d393e18f80c91fee"
] | [
"dags/demo-dag.py"
] | [
"from airflow import DAG\r\nfrom airflow.providers.http.sensors.http import HttpSensor\r\n\r\nfrom datetime import datetime, timedelta\r\nfrom airflow.operators.python import PythonOperator\r\nfrom airflow.providers.telegram.operators.telegram import TelegramOperator\r\n\r\nimport requests\r\nimport pandas as pd\r\... | [
[
"pandas.DataFrame"
]
] |
konstantinos-p/PAC_Bayesian_Generalization | [
"c3ab6cdcfda4dcbdb9c5fb073f29490cde511b13"
] | [
"utils_spectral_norm.py"
] | [
"\"\"\"\nIn this script we have functions that calculate the spectral norm for different keras layers.\nSpecifically we can calculate the spectral norm of\n1) convolutional\n2) locally connected layers\n. This is a difficult problem as the full operators are huge sparse matrices.\n\"\"\"\n\nimport numpy as np\nfrom... | [
[
"numpy.fft.fft2",
"numpy.abs",
"numpy.power",
"numpy.reshape",
"numpy.linalg.norm",
"numpy.random.normal",
"numpy.random.permutation",
"numpy.transpose",
"numpy.zeros",
"numpy.empty",
"numpy.random.randint"
]
] |
SoftServeInc/yield-paper | [
"cbf9710e6866841e231e3f851786a4d7dc4a5c72"
] | [
"chemprop/features/featurization.py"
] | [
"from argparse import Namespace\nfrom typing import List, Tuple, Union\n\nfrom rdkit import Chem\nimport torch\n\nfrom chemprop.mol_utils import str_to_mol\n\n# Atom feature sizes\nMAX_ATOMIC_NUM = 100\nATOM_FEATURES = {\n 'atomic_num': list(range(MAX_ATOMIC_NUM)),\n 'degree': [0, 1, 2, 3, 4, 5],\n 'formal... | [
[
"torch.LongTensor",
"torch.FloatTensor"
]
] |
johnsonkee/mmocr_wxz | [
"867b91664ea373873557743c2a4be23fa014b14f"
] | [
"mmocr/datasets/icdar_dataset.py"
] | [
"import numpy as np\nfrom pycocotools.coco import COCO\n\nimport mmocr.utils as utils\nfrom mmdet.datasets.builder import DATASETS\nfrom mmdet.datasets.coco import CocoDataset\nfrom mmocr.core.evaluation.hmean import eval_hmean\nimport pdb\n\n\n@DATASETS.register_module()\nclass IcdarDataset(CocoDataset):\n CLAS... | [
[
"numpy.array",
"numpy.zeros"
]
] |
lhf-labs/finance-news-analysis-bert | [
"8e3d1b2eb2a2b7390d53506329775fe83656c498"
] | [
"src/bin/main_baseline_lstm_test.py"
] | [
"import os\nimport git\nimport time\nimport torch\nimport logging\nimport argparse\nimport numpy as np\nfrom controller.data import load_data_test\nfrom controller.model import prepare_device, prepare_preliminary, train_model, test_model\nfrom model.baseline_lstm_classifier import BaselineLSTMClassifier\n\n\"\"\"\n... | [
[
"torch.manual_seed",
"numpy.random.seed"
]
] |
radix-ai/agoro-field-boundary-detector | [
"9dd911df096ce865471ed0330174044f4172cc66"
] | [
"src/agoro_field_boundary_detector/field_detection/mask_rcnn/train.py"
] | [
"\"\"\"PyTorch Detection Training, code from https://github.com/pytorch/vision.\"\"\"\nimport datetime\nimport os\nimport time\nfrom typing import Any\n\nimport torch\nimport torch.utils.data\nimport torchvision\nimport torchvision.models.detection\nimport torchvision.models.detection.mask_rcnn\nfrom group_by_aspec... | [
[
"torch.optim.lr_scheduler.MultiStepLR",
"torch.utils.data.distributed.DistributedSampler",
"torch.load",
"torch.utils.data.SequentialSampler",
"torch.utils.data.DataLoader",
"torch.utils.data.RandomSampler",
"torch.nn.parallel.DistributedDataParallel",
"torch.optim.SGD",
"torch... |
berkgercek/iblscripts | [
"c11988ff5659bcdd7cb9bf14e6589f0f7f946938"
] | [
"ci/tests/test_ephys_pipeline.py"
] | [
"import logging\nimport shutil\nfrom pathlib import Path\nimport numpy as np\nimport tempfile\n\nimport alf.io\nfrom ibllib.pipes import local_server\nfrom oneibl.one import ONE\n\nfrom ci.tests import base\n\nCACHE_DIR = tempfile.TemporaryDirectory()\n_logger = logging.getLogger('ibllib')\n\n\nclass TestEphysPipel... | [
[
"numpy.nanmax",
"numpy.nanmedian",
"numpy.abs",
"numpy.unique",
"numpy.median",
"numpy.nanmin",
"numpy.squeeze",
"numpy.all",
"numpy.intersect1d",
"numpy.max",
"numpy.load",
"numpy.array"
]
] |
kemaleren/PaCMAP | [
"a171106bbafeff62cb27df898c8777ae2f67dbfe"
] | [
"source_code/pacmap/pacmap.py"
] | [
"import numpy as np\nfrom sklearn.base import BaseEstimator\nimport numba\nfrom annoy import AnnoyIndex\nfrom sklearn.decomposition import TruncatedSVD\nfrom sklearn.decomposition import PCA\nfrom sklearn import preprocessing\nimport time\nimport math\nimport datetime\nimport warnings\n\nglobal _RANDOM_STATE\n_RAND... | [
[
"sklearn.decomposition.TruncatedSVD",
"numpy.abs",
"numpy.sqrt",
"numpy.random.seed",
"numpy.min",
"numpy.max",
"numpy.delete",
"numpy.random.normal",
"numpy.zeros_like",
"numpy.mean",
"numpy.argmin",
"numpy.log10",
"numpy.argsort",
"sklearn.preprocessing.St... |
BenevolentAI/RELVM | [
"468da9eb78714932612e54454bb06c4beac1bd1d"
] | [
"run/unsup/__init__.py"
] | [
"import os\nimport time\nimport numpy as np\nimport tensorflow as tf\n\n\nclass Run(object):\n \"\"\"\n This Run class handles initialising the trainer, loading data, creating the Tensorflow dataset and model training\n for the unsupervised representation model.\n\n Parameters\n ----------\n data_... | [
[
"numpy.minimum",
"numpy.random.choice",
"tensorflow.train.Checkpoint",
"numpy.int32",
"numpy.tile",
"tensorflow.data.Dataset.from_generator",
"numpy.float32",
"numpy.zeros",
"tensorflow.distribute.MirroredStrategy"
]
] |
dyollb/MONAI | [
"9084c452c48095c82c71d4391b3684006e5a3c56",
"9084c452c48095c82c71d4391b3684006e5a3c56"
] | [
"monai/transforms/utils_create_transform_ims.py",
"tests/test_vote_ensembled.py"
] | [
"# Copyright 2020 - 2021 MONAI Consortium\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agre... | [
[
"numpy.asarray",
"numpy.squeeze",
"matplotlib.pyplot.colorbar",
"torch.as_tensor",
"matplotlib.pyplot.close",
"numpy.floor",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure"
],
[
"torch.device",
"torch.testing.assert_all... |
joseppinilla/embedding-methods | [
"a29fea829ec33d586ccbc5c9b6ec6586c2a2154f"
] | [
"embera/transform/embedding.py"
] | [
"import minorminer\n\nimport numpy as np\n\nfrom embera.utilities.decorators import nx_graph\nfrom embera.preprocess.tiling_parser import DWaveNetworkXTiling\n\n__all__ = ['translate','mirror','rotate','spread_out','open_seam',\n 'iter_sliding_window', 'greedy_fit','reconnect']\n\n\"\"\" #################... | [
[
"numpy.array",
"numpy.flip"
]
] |
mkaywong/NNSolver | [
"13e43584ec96004441a4877c5f24af270c579f20"
] | [
"NNSolver/Utilities.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\nimport numpy as np\nimport matplotlib.pyplot as pt\n\ndef ImageToArray(batchVol,kernalShape,stride,outArray):\n \"\"\"\n This procedure convert a 4D volume into a 2D array for convolution computation.\n Row major is assumed. That is, data contiquous along the ... | [
[
"numpy.argmax",
"matplotlib.pyplot.subplots"
]
] |
ysulsky/krazyworld | [
"70eed53462ed94a0d66610e32ef7581553e0bcb5"
] | [
"legacy/krazy_world_old.py"
] | [
"from pygame.constants import K_r, K_UP, K_DOWN, K_LEFT, K_RIGHT, K_t, K_a\nimport pygame\nimport numpy as np\nimport sys\nfrom collections import OrderedDict\nimport os\nimport random\nimport copy\nclock = pygame.time.Clock()\n\n\n\n\nEASY_GRID_KWARGS = dict(screen_height=256,\n grid_squares... | [
[
"numpy.array",
"numpy.random.RandomState",
"numpy.zeros",
"numpy.ones"
]
] |
Adn425/Correlation | [
"20a4beee97dabd2622731ae6faa20829d08c34f9"
] | [
"setup.py"
] | [
"import plotly.express as px\nimport csv\nimport numpy as np\n\ndef plotFigure(data_path):\n with open(data_path) as csv_file:\n df = csv.DictReader(csv_file)\n fig = px.scatter(df,x=\"Coffee in ml\", y=\"sleep in hours\")\n fig.show()\n\ndef getDataSource(data_path):\n marks_in_percentag... | [
[
"numpy.corrcoef"
]
] |
billhu0228/SmartRoadBridgePy | [
"4a5d34028a2612aef846b580733bf6f488110798"
] | [
"src/srbpy/model/core.py"
] | [
"# -*- coding : utf-8-*-\nimport copy\nimport json\nimport os\nimport zipfile\nimport numpy as np\nimport sqlalchemy\nfrom decimal import ROUND_HALF_UP, Decimal\nfrom PyAngle import Angle\nfrom numpy import loadtxt, pi\nfrom sqlalchemy import create_engine, event\nfrom sqlalchemy.orm import sessionmaker\nfrom xml.d... | [
[
"numpy.loadtxt"
]
] |
MosHumanoid/bitbots_thmos_meta | [
"f45ccc362dc689b69027be5b0d000d2a08580de4"
] | [
"bitbots_vision/bitbots_vision/src/bitbots_vision/vision_modules/yolo_handler.py"
] | [
"import cv2\nimport os\nimport abc\nimport rospy\nimport numpy as np\nfrom math import exp\nfrom collections import defaultdict\nfrom .candidate import CandidateFinder, Candidate\ntry:\n from pydarknet import Detector, Image\nexcept ImportError:\n rospy.logerr(\"Not able to run Darknet YOLO! Its only executab... | [
[
"numpy.argmax"
]
] |
mehtamohit013/ITU-Challenge | [
"2a60de6c9730f85c797c6c2d0eac1627932d41ac"
] | [
"model_cur.py"
] | [
"import torch.nn.functional as F\nimport torch.nn as nn\nimport torch\nimport torch.optim as optim\nimport numpy as np\nimport math\nfrom torch.nn import init\n\n\nclass NoisyLinear(nn.Module):\n \"\"\"Factorised Gaussian NoisyNet\"\"\"\n\n def __init__(self, in_features, out_features, sigma0=0.5):\n s... | [
[
"torch.nn.Softmax",
"numpy.sqrt",
"torch.Tensor",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.Flatten",
"torch.nn.init.kaiming_uniform_",
"torch.nn.Linear",
"torch.FloatTensor",
"torch.nn.LeakyReLU",
"numpy.prod",
"torch.nn.init.orthogonal_",
"torch.device",
"... |
gasparka/oniapy | [
"a58f68244c730041a034b91fd417bd3968d46cc7"
] | [
"oniapy/hello2.py"
] | [
"''' Present an interactive function explorer with slider widgets.\n\nScrub the sliders to change the properties of the ``sin`` curve, or\ntype into the title text box to update the title of the plot.\n\nUse the ``bokeh serve`` command to run the example by executing:\n\n bokeh serve sliders.py\n\nat your comman... | [
[
"numpy.linspace",
"numpy.sin"
]
] |
aravindrajamani/final-year-project | [
"e9159b4e9fe7eed11a7a245044106f574518bab1"
] | [
"Facemask_trainer.py"
] | [
"from 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 tensorflow.keras.layers import Dense\nfrom... | [
[
"matplotlib.pyplot.legend",
"tensorflow.keras.preprocessing.image.load_img",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"numpy.arange",
"tensorflow.keras.applications.mobilenet_v2.preprocess_input",
"numpy.argmax",
"sklearn.preprocessing.LabelBinarizer",
"tensorflow... |
phy-q/benchmark | [
"0a0fd31614039f3620369582017d9bd0a1c88b11"
] | [
"sciencebirdsagents/HeuristicAgents/PigShooter.py"
] | [
"import random\n\nimport numpy as np\n\nfrom SBAgent import SBAgent\nfrom SBEnvironment.SBEnvironmentWrapper import SBEnvironmentWrapper\nfrom StateReader.SymbolicStateDevReader import SymbolicStateDevReader\nfrom StateReader.game_object import GameObjectType\nfrom Utils.point2D import Point2D\nfrom Utils.trajector... | [
[
"numpy.loadtxt"
]
] |
vishalbelsare/cgpm | [
"56a481829448bddc9cdfebd42f65023287d5b7c7"
] | [
"tests/test_mvkde.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright (c) 2015-2016 MIT Probabilistic Computing Project\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/LICEN... | [
[
"scipy.stats.ks_2samp",
"numpy.allclose",
"numpy.linspace",
"numpy.isnan",
"matplotlib.pyplot.subplots",
"numpy.argmax",
"numpy.mean",
"numpy.bincount",
"matplotlib.pyplot.close",
"scipy.stats.chisquare",
"numpy.exp",
"numpy.zeros",
"numpy.column_stack"
]
] |
esalesky/xnmt-devel | [
"90598d7cc8d22a7167acf88e29df81e130fc64fc"
] | [
"xnmt/specialized_encoders/segmenting_encoder/priors.py"
] | [
"\"\"\"\nPriors classes that wraps us some probability distribution that can be used to\ndraw samples and calculate the probability of an event.\n\nSupports 2 methods:\n - log_ll: Returns the log likelihood of an event (occurence)\n - sample: Draw samples with a size (batch_size x size)\n\"\"\"\n\nimport math\nim... | [
[
"numpy.random.poisson",
"numpy.random.uniform",
"scipy.stats.poisson.pmf"
]
] |
bsmith39/CS595Project | [
"96f4930ea2974f219432ab8b3e7f585b5554b367"
] | [
"sirepo/template/warpvnd.py"
] | [
"# -*- coding: utf-8 -*-\nu\"\"\"Warp VND/WARP execution template.\n\n:copyright: Copyright (c) 2017 RadiaSoft LLC. All Rights Reserved.\n:license: http://www.apache.org/licenses/LICENSE-2.0.html\n\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\nfrom pykern import pkcollections\nfrom pyk... | [
[
"numpy.sqrt",
"numpy.linspace",
"numpy.min",
"numpy.round",
"numpy.full_like",
"numpy.max",
"numpy.zeros_like"
]
] |
Abhiseksah/Tic-tak-toe-3 | [
"cddeb5405f5629446711eb07c962ce6da9fafdc6"
] | [
"game.py"
] | [
"from tkinter import *\nfrom tkinter import messagebox\nimport os\nimport smtplib\nfrom email.mime.multipart import MIMEMultipart\nfrom email.mime.text import MIMEText\n#----------------\nimport mysql.connector\n#------------------\nimport matplotlib.pyplot as plt\nimport numpy as np\n#---------------------\n\nmydb... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.pie",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
modestyachts/CIFAR-10.1 | [
"d9982abb0bfc4846b8d13a11e66b887d946205d0"
] | [
"code/cifar10.py"
] | [
"# Derived from https://github.com/jaberg/skdata/blob/master/skdata/cifar10/dataset.py\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport pickle\n\nimport numpy as np\n\nclass CIFAR10Data(object):\n def __init__(self, path):\n tra... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.vstack"
]
] |
cancan101/Lasagne | [
"9f591a5f3a192028df9947ba1e4903b3b46e8fe0"
] | [
"lasagne/updates.py"
] | [
"\"\"\"\nFunctions to generate Theano update dictionaries for training.\n\nThe update functions implement different methods to control the learning\nrate for use with stochastic gradient descent.\n\nUpdate functions take a loss expression or a list of gradient expressions and\na list of parameters as input and retu... | [
[
"numpy.zeros",
"numpy.dtype"
]
] |
JStuckner/DnD-GUI-2 | [
"bf393c94e48df2e17113046b7f917ac2176ac8e8"
] | [
"dnd_gui/util/encounter.py"
] | [
"from random import randint, shuffle\nimport numpy as np\n\ndef order(NPCI):\n #print(NPCI)\n #PC initiative\n numPCs = 4\n SethI = 10\n AnastasiaI = 2\n CameronI = 5\n TravisI = 2\n\n try:\n numNPC = len(NPCI)\n except TypeError:\n numNPC = 1\n\n #Set up matrix\n orde... | [
[
"numpy.zeros",
"numpy.random.shuffle"
]
] |
guqin/xmas2020 | [
"04ec60b39fcf8df4f84e954c61f8562e8821a98b"
] | [
"xmas_lights.py"
] | [
"# some code adapted from DanStach/rpi-ws2811\r\nimport time\r\nimport board\r\nimport neopixel\r\nimport requests\r\nimport blynklib\r\nimport random\r\nimport multiprocessing as mp\r\nimport numpy as np\r\n\r\nBLYNK_AUTH = open('blynk_auth.txt').read().strip()\r\n\r\n# initialize blynk\r\nblynk = blynklib.Blynk(B... | [
[
"numpy.maximum",
"numpy.linspace",
"numpy.tile",
"numpy.random.rand",
"numpy.zeros",
"numpy.roll",
"numpy.random.randint"
]
] |
hypnaceae/FastSpeech2-Puppetry | [
"a7473998a6e0d455fbc7c77549294a79e9c29d5f"
] | [
"utils/model.py"
] | [
"import os\nimport json\n\nimport torch\nimport numpy as np\n\nimport hifigan\nfrom model import FastSpeech2, ScheduledOptim\n\n\ndef get_model(args, configs, device, train=False):\n (preprocess_config, model_config, train_config) = configs\n\n model = FastSpeech2(preprocess_config, model_config).to(device)\n... | [
[
"numpy.log",
"torch.load",
"torch.no_grad",
"torch.cuda.is_available",
"torch.hub.load"
]
] |
zhupengyang/Paddle | [
"c560a7d57aad990f374ebadd330351f18e2ca65f"
] | [
"python/paddle/fluid/tests/unittests/test_pool1d_api.py"
] | [
"# Copyright (c) 2020 PaddlePaddle 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 re... | [
[
"numpy.random.random",
"numpy.allclose",
"numpy.random.seed",
"numpy.min",
"numpy.ceil",
"numpy.max",
"numpy.floor",
"numpy.random.uniform",
"numpy.zeros",
"numpy.sum"
]
] |
Mustrumion/MastersDegreeProjects | [
"5d389dbcb80d91888b7d4d38034ec9d33e496fba"
] | [
"Visualisation/annealingColumnChartGrid.py"
] | [
"import glob\nimport json\nimport pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport math\nimport os\nfrom matplotlib import rcParams\n# rcParams.update({'figure.autolayout': True})\n\ndef get_hours(time_str : str) -> float:\n \"\"\"Get hours from time.\"\"\"\n h,... | [
[
"matplotlib.pyplot.show",
"pandas.DataFrame",
"matplotlib.pyplot.subplots_adjust"
]
] |
swagner648/rainbownums | [
"ec801b13565cdc92aa43b7ca03cdfd2a09b08ef9"
] | [
"rainbownum/RainbowCartesianSumsSim.py"
] | [
"from .RainbowSim import RainbowSim\nimport numpy as np\n\n\nclass RbCartesianSumsEq(RainbowSim):\n def __init__(self, m, n, a, b=[0, 0]):\n super(RbCartesianSumsEq, self).__init__(m * n, a, Point(b[0], b[1]), False)\n self.M = m # rows\n self.N = n # columns\n self.sums = self.sets... | [
[
"numpy.matrix"
]
] |
SCGTall/CS6375MachineLearning | [
"50ff7348eb583113b17084775a8679ce135c0487"
] | [
"Assignment/Assignment 1/Assignment1.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\n\n# The true function\ndef f_true(x: float) -> float:\n return 6.0 * (np.sin(x + 2) + np.sin(2 * x + 4))\n\n# Get data points\n#np.random.seed(1) ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"numpy.logspace",
"numpy.arange",
"sklearn.model_selection.train_test_split",
"numpy.sin",
"matplotlib.pyplot.plot",
"numpy.random.normal",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot... |
pbaiz/openrec | [
"a00de2345844858194ef43ab6845342114a5be93",
"a00de2345844858194ef43ab6845342114a5be93",
"a00de2345844858194ef43ab6845342114a5be93"
] | [
"openrec/tf1/utils/samplers/random_pointwise_sampler.py",
"openrec/tf2/recommenders/dlrm.py",
"openrec/tf1/utils/evaluators/precision.py"
] | [
"import numpy as np\nimport random\nfrom openrec.tf1.utils.samplers import Sampler\n\ndef RandomPointwiseSampler(dataset, batch_size, num_process=5, seed=100):\n \n random.seed(seed)\n def batch(dataset, batch_size=batch_size):\n \n while True:\n input_npy = np.zeros(batch_size, dt... | [
[
"numpy.zeros"
],
[
"tensorflow.clip_by_value",
"tensorflow.concat",
"tensorflow.unstack",
"tensorflow.keras.losses.MeanSquaredError",
"tensorflow.reshape",
"tensorflow.keras.losses.BinaryCrossentropy"
],
[
"numpy.array"
]
] |
PaulEmmanuelSotir/kedro | [
"0b0d095bfc11324dc5a0fcf6e8dec891426b3a01"
] | [
"tests/framework/context/test_context.py"
] | [
"# Copyright 2020 QuantumBlack Visual Analytics Limited\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# THE SOFTWARE IS PR... | [
[
"pandas.util.testing.assert_frame_equal",
"pandas.testing.assert_frame_equal",
"pandas.DataFrame"
]
] |
mahkons/RL-algorithms | [
"bc5da6734263184e6229d34cd68f092feb94e9a3"
] | [
"SAC/agent.py"
] | [
"import random\nimport numpy as np\nimport os\nimport torch\n\n\nclass Agent:\n def __init__(self):\n self.model = torch.load(__file__[:-8] + \"/agent.pkl\", map_location=\"cpu\")\n \n def act(self, state):\n with torch.no_grad():\n state = torch.tensor(np.array([state]), dtype... | [
[
"torch.tanh",
"numpy.array",
"torch.no_grad",
"torch.load"
]
] |
lizhaoliu-Lec/fcos | [
"6a5e25831c943f46286c3cff65500139886c921e"
] | [
"libs/iou_loss.py"
] | [
"import torch\n\n\ndef bbox_overlaps_aligned(bboxes1, bboxes2, is_aligned=False):\n '''\n Param:\n bboxes1: FloatTensor(n, 4) # 4: ymin, xmin, ymax, xmax\n bboxes2: FloatTensor(n, 4)\n\n Return: \n FloatTensor(n)\n '''\n tl = torch.max(bboxes1[:, :2], bboxes2[:, :2]) # [rows, 2]\n ... | [
[
"torch.min",
"torch.max"
]
] |
forrestjgq/Open3D | [
"dcf94bd21943d943b54b402aed4e868da2687180",
"dcf94bd21943d943b54b402aed4e868da2687180"
] | [
"examples/python/geometry/point_cloud_with_numpy.py",
"examples/python/geometry/ray_casting_to_image.py"
] | [
"# ----------------------------------------------------------------------------\n# - Open3D: www.open3d.org -\n# ----------------------------------------------------------------------------\n# The MIT License (MIT)\n#\n# Copyright (c) 2018-2021 www.open3d.org\n#\n# ... | [
[
"numpy.linspace",
"numpy.power",
"numpy.reshape",
"numpy.asarray",
"numpy.size",
"numpy.meshgrid"
],
[
"matplotlib.pyplot.show"
]
] |
mayankgolhar/self-supervised-da | [
"8402349f495887c97a5f91499d7c474830545530"
] | [
"data/data_manager.py"
] | [
"from torch.utils.data import Dataset\nfrom torchvision import transforms\nimport os\nimport numpy as np\nfrom PIL import Image\nimport torch\nimport random\nimport re\n\nIMG_EXTENSIONS = [\n '.jpg', '.JPG', '.jpeg', '.JPEG',\n '.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP', '.tiff'\n]\n\nclass Data_Manager(D... | [
[
"numpy.linspace",
"numpy.random.seed",
"torch.cat",
"numpy.around",
"torch.utils.data.DataLoader",
"numpy.random.shuffle",
"numpy.random.rand",
"numpy.random.randint"
]
] |
peterprescott/statsmodels | [
"7c4a71e8d16618315b7370c88212aa2a4f358270"
] | [
"statsmodels/tools/eval_measures.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"some measures for evaluation of prediction, tests and model selection\n\nCreated on Tue Nov 08 15:23:20 2011\nUpdated on Wed Jun 03 10:42:20 2020\n\nAuthors: Josef Perktold & Peter Prescott\nLicense: BSD-3\n\n\"\"\"\nimport numpy as np\n\nfrom statsmodels.tools.validation import arra... | [
[
"numpy.log",
"numpy.abs",
"numpy.asarray",
"numpy.median",
"numpy.squeeze",
"numpy.sort",
"numpy.full_like",
"numpy.std",
"numpy.asanyarray",
"numpy.mean",
"numpy.nanmean",
"numpy.var",
"numpy.array"
]
] |
bernardosabatinilab/face-rhythm | [
"ea4b5213827beecc174a0f510574d81346b2f07e"
] | [
"face_rhythm/util/setup.py"
] | [
"import cv2\nimport torch\nimport numpy as np\n\nimport yaml\nfrom pathlib import Path\n\nfrom datetime import datetime\nfrom dateutil.tz import tzlocal\nfrom pynwb import NWBFile, NWBHDF5IO\n\nfrom face_rhythm.util import helpers\n\n\ndef setup_project(project_path, sessions_path, run_name, overwrite_config, remot... | [
[
"numpy.load",
"numpy.array",
"numpy.ones"
]
] |
ROCmSoftwarePlatform/jax | [
"be34a14dc40384ac8876fad2b23b5e205ccfe22e"
] | [
"jax/experimental/jax2tf/tests/jax2tf_test.py"
] | [
"# Copyright 2020 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.cast",
"numpy.zeros_like",
"numpy.ones_like",
"tensorflow.Variable",
"numpy.arange",
"numpy.float16",
"numpy.int8",
"numpy.full",
"tensorflow.math.sin",
"numpy.float32",
"numpy.zeros",
"numpy.full_like",
"tensorflow.function",
"numpy.array",
... |
tmoer/a0c | [
"62c4aa793205294d5b3a99d192e9b6311f4d34a6"
] | [
"src/rl/atariwrapper.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nAtari wrapper, based on https://github.com/openai/baselines/blob/master/baselines/common/atari_wrappers.py\n@author: thomas\n\"\"\"\nimport gym\nfrom gym import spaces\nfrom collections import deque\nimport numpy as np\nfrom PIL import Image\n\nclass ClipRewardWrapper(gym.RewardWra... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.stack",
"numpy.sign"
]
] |
sjuvekar/neon | [
"abe5d30a68663c739a97a9e657516d530c66dbd9"
] | [
"tests/test_merge_layer.py"
] | [
"# ----------------------------------------------------------------------------\n# Copyright 2015 Nervana Systems Inc.\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:/... | [
[
"numpy.concatenate",
"numpy.random.random",
"numpy.allclose",
"numpy.finfo"
]
] |
LaudateCorpus1/audio | [
"a007e922d34028270197c0549bf452b79499d039"
] | [
"test/torchaudio_unittest/models/rnnt/rnnt_test_impl.py"
] | [
"import torch\nfrom torchaudio.models import emformer_rnnt_model\nfrom torchaudio_unittest.common_utils import TestBaseMixin, torch_script\n\n\nclass RNNTTestImpl(TestBaseMixin):\n def _get_input_config(self):\n model_config = self._get_model_config()\n return {\n \"batch_size\": 8,\n ... | [
[
"torch.random.manual_seed",
"torch.randint",
"torch.rand"
]
] |
gengchenmai/space2vec | [
"a29793336e6a1ebdb497289c286a0b4d5a83079f",
"a29793336e6a1ebdb497289c286a0b4d5a83079f"
] | [
"geo_prior/geo_prior/losses.py",
"geo_prior/gen_figs/plot_all_locations.py"
] | [
"import torch\nimport utils as ut\nimport math\n\n\ndef bce_loss(pred):\n return -torch.log(pred + 1e-5)\n\n\ndef rand_samples(batch_size, params, rand_type='uniform'):\n '''\n randomly sample background locations, generate (lon, lat, date) and put into pre loc encoder\n Note that the generated (lon, la... | [
[
"torch.sin",
"torch.cat",
"torch.unsqueeze",
"torch.log",
"torch.rand",
"torch.cos"
],
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.scatter",
"numpy.gradient",
"numpy.arange",
"matplotlib.pyplot.... |
mmuellerstoffels/GBSTools | [
"aebd8aa6667a2284aaa16424f9b9d22ca3a2a375"
] | [
"MiGRIDS/Analyzer/PerformanceAnalyzers/getGenConfigChanges.py"
] | [
"# Project: GBS Tool\n# Author: Dr. Marc Mueller-Stoffels, marc@denamics.com, denamics GmbH\n# Date: March 5, 2018\n# License: MIT License (see LICENSE file of this package for more information)\n\nimport numpy as np\n\n\ndef getGenConfigChanges(genAllP):\n \"\"\"\n Calculates the total number of configuratio... | [
[
"numpy.sign"
]
] |
killthekitten/kaggle-carvana-2017 | [
"90795b1587af0714e5499ae72a301be38014d8b9"
] | [
"ensemble_gpu.py"
] | [
"import os\nimport queue\nimport threading\nfrom _ast import Lambda\n\nimport keras.backend as K\nimport numpy as np\nimport tensorflow as tf\nfrom keras.engine.topology import Input\nfrom keras.engine.training import Model\nfrom keras.layers.core import Lambda\nfrom keras.preprocessing.image import array_to_img, l... | [
[
"tensorflow.device",
"tensorflow.python.client.device_lib.list_local_devices",
"numpy.squeeze",
"tensorflow.ConfigProto",
"tensorflow.Session",
"numpy.array"
]
] |
chris-ch/coins | [
"41e1976f0459b0d77a9e882f6e0e10777ae6685d"
] | [
"src/sbcireport.py"
] | [
"import pandas\nfrom collections import defaultdict\nimport logging\n\nfrom pnl import AverageCostProfitAndLoss\n\n\ndef _select_prices(reporting_currency, prices):\n \"\"\"\n\n :param reporting_currency:\n :param prices:\n :return:\n \"\"\"\n all_prices = prices.set_index('date')\n filter_colu... | [
[
"pandas.Series",
"pandas.DataFrame"
]
] |
oreilly-japan/building-ml-pipelines-ja | [
"a5044c63610cd116612cfafb66261611b4541ebb"
] | [
"utils/download_dataset.py"
] | [
"\"\"\"\nDownloads the csv data\n\"\"\"\n\nimport logging\nimport os\n\nimport pandas as pd\n\n# Initial dataset source\nDATASET_URL = \"http://bit.ly/building-ml-pipelines-dataset\"\n\n# Initial local dataset location\nLOCAL_FILE_NAME = \"data/consumer_complaints_with_narrative.csv\"\n\n\ndef download_dataset(url=... | [
[
"pandas.read_csv"
]
] |
ag-ds-bubble/panbox | [
"8fb9854fd3c9a931b818bd51781e6d4fb046d580"
] | [
"panbox/pansim/pansim_active/base.py"
] | [
"from ..pansim_view.pansim_view_handler import PanSimViewHandler\nimport pandas as pd\nimport numpy as np\nfrom ..._configs.pansim_configs import ROOT_PATH\n\nclass ActiveBase:\n\n def __init__(self):\n self.pansimData = {}\n density_data = pd.read_csv(ROOT_PATH+'/_animutils/population_density.csv'... | [
[
"numpy.round",
"pandas.read_csv"
]
] |
noaa-ocs-hydrography/bathycube | [
"917dcac9668377b58dde6a1fdab4d875cd5804af"
] | [
"bathycube/cube.py"
] | [
"\"\"\"\nPython implementation of the CUBE module, Combined Uncertainty and Bathymetry Estimator. Python implementation done\nby Eric Younkin, Feb 2022.\n\nCUBE was developed as a research project within the Center of for Coastal and Ocean Mapping and NOAA/UNH Joint Hydrographic\nCenter (CCOM/JHC) at the Universit... | [
[
"numpy.log",
"numpy.sqrt",
"numpy.isnan",
"numpy.full",
"numpy.float32",
"numpy.floor",
"numpy.random.uniform",
"numpy.array",
"numpy.exp"
]
] |
filesmuggler/cutter_node | [
"c46f6c6033661c80145dcb69a4fb78177f6ee30f"
] | [
"src/nowicki.py"
] | [
"#!/usr/bin/env python\n\nimport sys,time\n\nimport rospy\nimport roslib\nimport numpy as np\n\nfrom cv_bridge import CvBridge, CvBridgeError\n\nimport cv2\n\nimport message_filters\n\nfrom sensor_msgs.msg import Image, CameraInfo\nfrom std_msgs.msg import Header\n\nclass CutterNode:\n def __init__(self):\n ... | [
[
"numpy.dtype",
"numpy.zeros",
"numpy.float32"
]
] |
Aniket-Gujarathi/d2-net | [
"c716d37087390af04c8843452dadfa47a64cfbe2"
] | [
"SuperGlue-pytorch/load_data_D2net.py"
] | [
"import numpy as np\nimport torch\nimport os\nimport cv2\nimport math\nimport datetime\nimport random\nimport sys\nsys.path.append('../')\nfrom lib.save_features import extract\nfrom lib.model_test import D2Net\nfrom lib.model_test import D2Net\nfrom lib.pyramid import process_multiscale\n\nfrom scipy.spatial.dista... | [
[
"numpy.matrix",
"numpy.random.seed",
"numpy.min",
"torch.zeros",
"numpy.arange",
"numpy.cos",
"scipy.spatial.distance.cdist",
"numpy.sin",
"numpy.concatenate",
"numpy.intersect1d",
"numpy.delete",
"torch.from_numpy",
"numpy.argmin",
"torch.cuda.is_available"... |
goldblum/FeatureClustering | [
"55a1b233ccbdfad3e7f9be26006eccdfb76af28b"
] | [
"models/ResNet12_embedding.py"
] | [
"import torch.nn as nn\nimport torch\nimport torch.nn.functional as F\nfrom models.dropblock import DropBlock\n\n# This ResNet network was designed following the practice of the following papers:\n# TADAM: Task dependent adaptive metric for improved few-shot learning (Oreshkin et al., in NIPS 2018) and\n# A Simple ... | [
[
"torch.nn.Sequential",
"torch.nn.Dropout",
"torch.nn.functional.dropout",
"torch.nn.init.constant_",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.nn.init.kaiming_normal_"
]
] |
mathdugre/RUIS | [
"b2013e43b9178a3f990f609cdb2f021486e7f901"
] | [
"report.py"
] | [
"import datetime\nimport re\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\npd.set_option('display.float_format', lambda x: '%.3f' % x)\n\ndef timeTicks(x, pos): ... | [
[
"matplotlib.pyplot.legend",
"pandas.read_csv",
"matplotlib.pyplot.title",
"numpy.timedelta64",
"numpy.sign",
"matplotlib.pyplot.ylabel",
"numpy.deg2rad",
"matplotlib.ticker.FuncFormatter",
"matplotlib.pyplot.xlabel",
"pandas.set_option",
"matplotlib.pyplot.show",
"m... |
q1park/tempformer-xl | [
"05be261ba2221dd7fd7adc39df78941eaa4937c2"
] | [
"pytorch/eval.py"
] | [
"# coding: utf-8\nimport argparse\nimport time\nimport math\nimport os\n\nimport torch\n\nfrom pytorch.utils.data_utils import get_lm_corpus\nfrom pytorch.modules.xlmemories import XlMemories\nfrom utils.exp_utils import get_logger\n\nparser = argparse.ArgumentParser(description='PyTorch Transformer Language Model'... | [
[
"torch.device",
"torch.no_grad",
"torch.load"
]
] |
ernovoseller/DuelingPosteriorSampling | [
"0b34db67bd20d664f73611608638e1e0a32faf30"
] | [
"PSRL_in_RiverSwim.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nRun the posterior sampling RL algorithm (PSRL) in the RiverSwim environment.\n\nThe PSRL algorithm is described in \"(More) Efficient Reinforcement Learning via \nPosterior Sampling,\" by I. Osband, B. Van Roy, and D. Russo (2013). It learns \nfrom numerical rewards, rather than pr... | [
[
"scipy.io.savemat"
]
] |
liqibp/rogerrferi | [
"4478f71ff44a9f5b17a52becf41f20caf97afab7"
] | [
"Leitor_XML_v0.7 (GUI).py"
] | [
"# Ler e Importar XML, e exportar para base MSSQL \n#\n# Importando os pacotes\nimport pandas as pd\nimport sqlalchemy\nimport pyodbc\nimport xml.etree.ElementTree as et\nimport tkinter as tk\nfrom tkinter import ttk\nfrom tkinter.filedialog import askdirectory \nfrom tkinter import messagebox\nimport os\nimport ti... | [
[
"pandas.merge",
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.to_timedelta",
"pandas.to_numeric"
]
] |
The-Platypus/ESINet | [
"b9b4e8ed8c6a0fa6d082e303014859a054233fd4"
] | [
"build/lib/ESINet/simulations/simulations.py"
] | [
"import mne\nimport numpy as np\nimport random\nimport os\nfrom copy import deepcopy\nimport mne\nimport pickle as pkl\nfrom tqdm import tqdm\nimport colorednoise as cn\nimport pickle as pkl\nfrom joblib import Parallel, delayed\nfrom ..util import *\n\ndef run_simulations(pth_fwd, n_simulations=10000, n_sources=(1... | [
[
"numpy.expand_dims",
"numpy.squeeze",
"numpy.max",
"numpy.mean",
"numpy.where",
"numpy.square",
"numpy.swapaxes",
"numpy.unique",
"numpy.arange",
"numpy.matmul",
"numpy.stack",
"numpy.sin",
"numpy.ceil",
"numpy.zeros",
"numpy.power",
"numpy.floor",
... |
luiscarlosgph/semi-synthetic | [
"25780c1ed3b02cde96830befef74a898b1d16eab"
] | [
"src/common.py"
] | [
"\"\"\"\n@brief Common functions used for prototyping methods and handling data.\n@author Luis Carlos Garcia-Peraza Herrera (luiscarlos.gph@gmail.com).\n@date 17 March 2017.\n\"\"\"\n\nimport sys\nimport math\nimport os\nimport re\nimport random # choice\nimport string # ascii_lowercase\nimport ... | [
[
"numpy.random.random",
"numpy.abs",
"numpy.random.choice",
"numpy.asarray",
"numpy.argsort",
"numpy.array",
"numpy.where"
]
] |
GraffJosh/locomotion_simulation | [
"37f42d26555867e05f55178f50bdb9252e51fd51"
] | [
"locomotion/agents/whole_body_controller/com_velocity_estimator.py"
] | [
"\"\"\"State estimator.\"\"\"\n\nimport numpy as np\nfrom typing import Any, Sequence\n\nfrom locomotion.utilities.moving_window_filter import MovingWindowFilter\n\n_DEFAULT_WINDOW_SIZE = 20\n\nclass COMVelocityEstimator(object):\n \"\"\"Estimate the CoM velocity using on board sensors.\n\n\n Requires knowledge a... | [
[
"numpy.array"
]
] |
uakarsh/tensorflow | [
"af583ca24e7592e09ba4fbc65e25e32bea3311cc"
] | [
"tensorflow/python/distribute/cross_device_ops_test.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.distribute.test_util.assert_sequential_execution",
"tensorflow.python.distribute.multi_process_runner.MultiProcessPoolRunner",
"tensorflow.python.framework.ops.device",
"tensorflow.python.eager.context.context",
"tensorflow.python.ops.array_ops.identity",
"tensorflow.pyt... |
liangshi7/Ax | [
"f20d10f619aae504f2e4509b5a786842a6c72e89"
] | [
"ax/storage/json_store/decoder.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\nimport datetime\nfrom collections import OrderedDict\nfrom enum import Enum\nfrom inspect import isclass\nfrom typing import Any, Dict, List, Type\n\nimport pandas as pd\nfrom ax.core.base_trial import BaseTrial\nfro... | [
[
"pandas.read_json"
]
] |
BlaineWD/mmf | [
"9c98e2b196fae75df702b6adab3468017c909266"
] | [
"plotting_utils/generate_cross_entropy_plots.py"
] | [
"import argparse\nimport os\nimport sys\nimport json\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import figure\nfrom tqdm import tqdm\n\n\noutput_path = 'experiment_plots'\n\nif not os.path.exists(output_path):\n os.makedirs(output_path)\n\ncross_entropy_key = 'hateful_memes/cross_entropy'\ntrain_cr... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel"
]
] |
DanitYanowsky/IML.HUJI | [
"391b661ede3fdbb72ecdf900c32df69445b3868b"
] | [
"IMLearn/learners/classifiers/gaussian_naive_bayes.py"
] | [
"from typing import NoReturn\nfrom ...base import BaseEstimator\nimport numpy as np\nfrom IMLearn.learners import MultivariateGaussian\n\n\nclass GaussianNaiveBayes(BaseEstimator):\n \"\"\"\n Gaussian Naive-Bayes classifier\n \"\"\"\n def __init__(self):\n \"\"\"\n Instantiate a Gaussian N... | [
[
"numpy.log",
"numpy.unique",
"numpy.column_stack",
"numpy.var",
"numpy.zeros",
"numpy.sum"
]
] |
paper1517/sonifications-paper1517 | [
"f619ba306db8513e0a2f92970ddbec59e47cb27c",
"f619ba306db8513e0a2f92970ddbec59e47cb27c"
] | [
"src/models/cnn12_decoder.py",
"src/utilities/feature_evolution_helper.py"
] | [
"import torch\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom collections import OrderedDict\nfrom src.models.fp32_group_norm import Fp32GroupNorm\nfrom src.layers.scaled_std_conv import ScaledStdConv1d\nfrom src.layers.causal_utils import ScaledStdCausalConv1d\nfrom src.layers.scaled_std_conv import ... | [
[
"torch.nn.Parameter",
"torch.zeros_like",
"torch.nn.MaxUnpool1d"
],
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"torch.tensor",
"torch.from_numpy",
"matplotlib.pyplot.clf",
"torch.no_grad",
"matplotlib.pyplot.close"... |
nrandell/onnxruntime | [
"4d32050f784fc73d065bb030e937bd45ac86ff32"
] | [
"onnxruntime/test/python/onnx_backend_test_series.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nimport argparse\nimport sys\nimport os\nimport platform\nimport unittest\nimport onnx\nimport onnx.backend.test\n\nimport numpy as np\nimport onnxruntime.backend as c2\n\npytest_plugins = 'onnx.backend.test.report',\n... | [
[
"numpy.testing.assert_array_equal",
"numpy.testing.assert_equal",
"numpy.testing.assert_allclose"
]
] |
tcsvn/pyadlml | [
"9b87d223ba0ef9814ba830263dd35fc6432fae87"
] | [
"pyadlml/dataset/plot/image.py"
] | [
"from pyadlml.dataset.plot.util import heatmap, annotate_heatmap\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\nimport matplotlib.pyplot as plt\nimport matplotlib\nimport numpy as np\n\ndef forceAspect(ax,aspect):\n im = ax.get_images()\n extent = im[0].get_extent()\n ax.set_aspect(abs((extent[... | [
[
"numpy.unique",
"numpy.arange",
"matplotlib.pyplot.subplots",
"numpy.ceil",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.suptitle",
"numpy.where",
"matplotlib.pyplot.show"
]
] |
AlanLoh/nenupy | [
"5b9e6ae7cc28d0dc4ed450a408b124f71a1c9cc8"
] | [
"nenupy/observation/obs_config.py"
] | [
"#! /usr/bin/python3\n# -*- coding: utf-8 -*-\n\n\n\"\"\"\n *************************\n Observation configuration\n *************************\n\n `NenuFAR <https://nenufar.obs-nancay.fr/en/astronomer/>`_\n is a versatile low-frequency radio telescope. Several\n observing modes are available, as re... | [
[
"matplotlib.pylab.show",
"numpy.abs",
"matplotlib.pylab.grid",
"numpy.arange",
"numpy.union1d",
"numpy.cumsum",
"matplotlib.pylab.xlabel",
"matplotlib.pylab.ylabel",
"numpy.float32",
"matplotlib.pylab.legend",
"numpy.argsort",
"matplotlib.pylab.savefig",
"numpy.... |
LiyuanLucasLiu/FasterTransformer | [
"c28149096030286e87491c7648f5a020aed22cc9"
] | [
"sample/pytorch/encoder_sample.py"
] | [
"# Copyright (c) 2020-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# Unle... | [
[
"torch.jit.script",
"torch.nn.init.uniform_",
"torch.randint",
"torch.empty",
"torch.ones",
"torch.load",
"torch.no_grad",
"torch.arange"
]
] |
gschivley/ElectricityLCI | [
"1c1c1b69705d3ffab1e1e844aaf7379e4f51198e"
] | [
"example/combined_build.py"
] | [
"# -*- coding: utf-8 -*-\nimport electricitylci\nimport pandas as pd\nimport pickle as pkl\n\n\nuse_cache = False\nsubregion = \"FERC\"\n\nif use_cache is True:\n with open(\"upstream_dict.pickle\", \"rb\") as handle:\n upstream_dict = pkl.load(handle)\n upstream_df=pd.read_csv(f\"upstream_df.csv\")\n ... | [
[
"pandas.read_csv"
]
] |
parshakova/APIP2 | [
"011c78b97c86c6fc22535acb798c685d2736b7d7"
] | [
"apip/utils.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\nimport re\nimport... | [
[
"torch.LongTensor",
"torch.Tensor",
"torch.zeros",
"torch.eq",
"torch.FloatTensor",
"torch.cuda.is_available",
"numpy.array"
]
] |
emiliom/echopype | [
"3665faeb251d4db4bd8e1dfe05f41942c86f10ea"
] | [
"echopype/convert/utils/set_groups_base.py"
] | [
"from __future__ import absolute_import, division, print_function\nimport os\nimport numpy as np\nimport netCDF4\nimport xarray as xr\n\n\nclass SetGroupsBase:\n \"\"\"Base class for setting groups in netCDF file.\n \"\"\"\n\n def __init__(self, file_path='test.nc'):\n self.file_path = file_path\n\n... | [
[
"numpy.timedelta64",
"numpy.datetime64"
]
] |
yangdb/RD-IOD | [
"64beb2e1efe823185adc0feb338a900f1a7df7a7"
] | [
"lib/datasets/coco_14_40_base.py"
] | [
"from __future__ import print_function\nfrom __future__ import absolute_import\n# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# ----------------------------------------... | [
[
"scipy.io.loadmat",
"numpy.zeros",
"numpy.mean"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.