repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
SpM-lab/irbasis3 | [
"f4e5e7a96ed886cb0f44c4d0c7413ec4696cd364"
] | [
"test/test_scipost_sample_code.py"
] | [
"# Copyright (C) 2020-2022 Markus Wallerberger, Hiroshi Shinaoka, and others\n# SPDX-License-Identifier: MIT\n\n\n# Sample codes in the SciPost review paper\n\ndef test_sample1():\n # Compute IR basis for fermions and \\Lambda = \\beta * \\omega_max = 1000\n import sparse_ir\n import numpy as np\n\n lam... | [
[
"numpy.meshgrid",
"numpy.arange",
"numpy.cos",
"numpy.fft.ifftn",
"numpy.prod",
"numpy.array"
]
] |
glypher/matmih | [
"387477c9743fe6162c91b979d4909a0330c36943"
] | [
"data.py"
] | [
"\"\"\"data.py: Helper classes to hold dataset information\n\"\"\"\n__author__ = \"Mihai Matei\"\n__license__ = \"BSD\"\n__email__ = \"mihai.matei@my.fmi.unibuc.ro\"\n\nimport numpy as np\nimport pandas as pd\nimport dill\nimport random\nimport time\nfrom sklearn.model_selection import train_test_split\n\n\nclass D... | [
[
"pandas.Categorical"
]
] |
BILLXZY1215/CycleGAN-Music-Style-Transfer | [
"ddd76b0be163b86caac003ae30f255466441e3c6"
] | [
"main.py"
] | [
"import argparse\nimport os\nimport tensorflow as tf\nfrom model import cyclegan\nfrom style_classifier import Classifer\ntf.compat.v1.set_random_seed(19)\n# os.environ[\"CUDA_VISIBLE_DEVICES\"] = os.environ['SGE_GPU']\n\nparser = argparse.ArgumentParser(description='')\nparser.add_argument('--dataset_dir', dest='d... | [
[
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.set_random_seed",
"tensorflow.compat.v1.ConfigProto",
"tensorflow.compat.v1.app.run"
]
] |
zumaia/salud-app | [
"3a8333b3fe5474c479b407c0f45f888ec949c330"
] | [
"model_codes/heart.py"
] | [
"import numpy as np\r\nimport pandas as pd\r\nfrom sklearn import ensemble\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.metrics import accuracy_score, classification_report, confusion_matrix\r\nimport joblib\r\n\r\ndf = pd.read_csv(\"../data/heart.csv\")\r\n\r\ncategorical_val = []\r\ncon... | [
[
"pandas.read_csv",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.accuracy_score",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.classification_report",
"pandas.get_dummies"
]
] |
TadaSanar/GPyOpt_DFT | [
"36124c2faf718c97a7d613e1729bfa519404c0f5"
] | [
"GPyOpt/acquisitions/EI.py"
] | [
"# Copyright (c) 2016, the GPyOpt Authors\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\n\nfrom .base import AcquisitionBase\nfrom ..util.general import get_quantiles\n\nimport numpy as np\n\nclass AcquisitionEI(AcquisitionBase):\n \"\"\"\n Expected improvement acquisition function\n\n :para... | [
[
"numpy.isnan"
]
] |
carapas/delta-interpolator | [
"f4078ceebb0a46759949722e0f169e682e64c1be"
] | [
"src/geometry/vector.py"
] | [
"import torch\n\n\n# batch*n\ndef normalize_vector(v, return_mag=False, eps: float = 1e-8):\n batch = v.shape[0]\n v_mag = torch.sqrt(v.pow(2).sum(1))\n v_mag = torch.max(v_mag, torch.autograd.Variable(torch.FloatTensor([eps]).type_as(v)))\n v_mag = v_mag.view(batch, 1).expand(batch, v.shape[1])\n v ... | [
[
"torch.FloatTensor"
]
] |
NeilDG/NeuralNets-Experiment3 | [
"f0d2f788eeca49f803f65810c155491ce687cf9e"
] | [
"trainers/shading_trainer.py"
] | [
"# -*- coding: utf-8 -*-\n# Shading trainer used for training.\nimport kornia\n\nfrom model import ffa_gan as ffa\nfrom model import vanilla_cycle_gan as cycle_gan\nfrom model import unet_gan\nimport constants\nimport torch\nimport torch.cuda.amp as amp\nimport itertools\nimport numpy as np\nimport torch.nn as nn\n... | [
[
"torch.mean",
"torch.ones_like",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.cat",
"torch.zeros_like",
"torch.cuda.amp.autocast",
"torch.cuda.amp.GradScaler",
"torch.nn.BCEWithLogitsLoss",
"torch.no_grad",
"torch.full_like",
"torch.nn.L1Loss",
"torch.save"
... |
Eric030577/dissertation-master | [
"99e96a60f97259c6d8589f58073cf4fa0a7da4bc"
] | [
"yolov4-keras-master/nets/loss.py"
] | [
"import numpy as np\r\nimport tensorflow as tf\r\nfrom keras import backend as K\r\nfrom nets.ious import box_ciou\r\n\r\n\r\n# ---------------------------------------------------#\r\n# smooth_labels\r\n# ---------------------------------------------------#\r\ndef _smooth_labels(y_true, label_smoothing):\r\n n... | [
[
"tensorflow.boolean_mask"
]
] |
TomMonks/meta-py | [
"a28e6cc434692fefff8b81e3b12a40a66e71a20c"
] | [
"metapy/tsp/bruteforce.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nFunctions and classes to enable bruteforce solution of the TSP.\r\nNote Bruteforce is inefficient after tours exceed 5 cities\r\n\"\"\"\r\n\r\n\r\nimport itertools as ite\r\nimport numpy as np\r\nfrom sympy.utilities.iterables import multiset_permutations\r\n\r\nfrom metapy.tsp... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.random.permutation"
]
] |
zafir-stojanovski/laser-hockey | [
"c0b21b5c9704554638e9f45c42b751d156bdc260"
] | [
"utils/utils.py"
] | [
"import numpy as np\nfrom matplotlib import pyplot as plt\nfrom pathlib import Path\nimport pickle\nimport shutil\nfrom tabulate import tabulate\nimport random\nfrom copy import deepcopy\nfrom laserhockey.hockey_env import CENTER_X, CENTER_Y, SCALE\n\n\ndef running_mean(x, N):\n cumsum = np.cumsum(np.insert(x, 0... | [
[
"matplotlib.pyplot.legend",
"numpy.asarray",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.mean",
"numpy.arange",
"numpy.insert",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"numpy.min",
"matplotlib.pyplot.ylim",
"numpy.save... |
ksterx/kxnet | [
"a638c072005549b86f73a734a62d78aeca697df2"
] | [
"utils/analyzer.py"
] | [
"# ---\n# jupyter:\n# jupytext:\n# text_representation:\n# extension: .py\n# format_name: light\n# format_version: '1.5'\n# jupytext_version: 1.6.0\n# kernelspec:\n# display_name: Python 3\n# language: python\n# name: python3\n# ---\n\n# +\nimport pandas as pd\nimport mat... | [
[
"pandas.read_csv",
"torch.norm",
"torch.tensor"
]
] |
wszenic/rl-collaborative-agents | [
"a89e8f3abb19313fe6666551f5985c0a3ed0523c"
] | [
"main.py"
] | [
"import logging\nimport os\n\nimport click\nimport neptune.new as neptune\nimport numpy as np\nimport optuna\nfrom unityagents import UnityEnvironment\n\nfrom src.agents.maddpg import MADDPGAgent\nfrom src.config.config import settings\nfrom src.structs import EnvFeedback\n\n\n@click.group(chain=True, invoke_withou... | [
[
"numpy.max",
"numpy.array",
"numpy.mean"
]
] |
eslavich/MiriTE | [
"05e25e1222e854fef5a72011f6618fa8fb5eaaff"
] | [
"miri/datamodels/miri_flatfield_model.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\n\"\"\"\n\nAn extension to the standard STScI data model for MIRI pixel flat-field \ndata. Essentially the same as the MIRI measured data model.\n\n:Reference:\n\nThe STScI jwst.datamodels documentation. See\nhttps://jwst-pipeline.readthedocs.io/en/latest/jwst/datamo... | [
[
"numpy.array"
]
] |
kaharjan/xalpha | [
"66f0fe574c6dfc1eef836e4d13e9eced0b995a30"
] | [
"xalpha/realtime.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nmodule for realtime watch and notfication\n\"\"\"\n# deprecated\n# 该模块与现在的主线进展关系不大,可用性不强,\n# xalpha 不应过度干涉通知或可能的自动交易部分\n# 因此该模块可能随时不再支持\n\nimport datetime as dt\nimport smtplib\nfrom email.header import Header\nfrom email.mime.text import MIMEText\nfrom email.utils import formatadd... | [
[
"pandas.DataFrame"
]
] |
sethvargo/vaex | [
"c610324316b2c0a14b8ceac2a30e202adc9da28b",
"c610324316b2c0a14b8ceac2a30e202adc9da28b"
] | [
"tests/arrow/conversion_test.py",
"tests/encoding_test.py"
] | [
"import numpy as np\nimport pyarrow as pa\nimport pytest\nfrom vaex import array_types \nimport vaex.arrow.convert\n\n\nbools = [False, True, True]\n\n\ndef test_bool():\n b = np.array(bools)\n b_arrow = array_types.to_arrow(b)\n assert b_arrow.to_pylist() == bools\n b = array_types.to_numpy(b_arrow)\n ... | [
[
"numpy.ma.array",
"numpy.arange",
"numpy.array",
"numpy.frombuffer"
],
[
"numpy.arange",
"numpy.dtype",
"numpy.all",
"numpy.ma.array",
"numpy.array"
]
] |
eschnett/kotekan | [
"81918288147435cef8ad52db05da0988c999a7dd"
] | [
"tests/test_vissharedmemreaderwriter.py"
] | [
"# === Start Python 2/3 compatibility\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nfrom future.builtins import * # noqa pylint: disable=W0401, W0614\nfrom future.builtins.disabled import * # noqa pylint: disable=W0401, W0614\n\n# == End Python 2/3 compatibility\n\nimport lo... | [
[
"numpy.arange"
]
] |
hpides/zeus | [
"a8143ae2a7dea6b9ede36a87c32f1be91804113f"
] | [
"python/benchmark.py"
] | [
"# To use this script look at the bottom\n\nimport sys, threading, subprocess, os\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\npath = os.path.join(os.getcwd(), \"output\")\n# Threading\n\nclass Engine (threading.Thread):\n def __init__(self, kind, time, fixed, buffer, serializer, ba... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.boxplot",
"numpy.min",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.percentile",
"numpy.mean",
"matplotlib.pyplot.ylabel"
]
] |
dharwath/DAVEnet-pytorch | [
"23a6482859dd2221350307c9bfb5627a5902f6f0"
] | [
"dataloaders/image_caption_dataset.py"
] | [
"# Author: David Harwath\n# with some functions borrowed from https://github.com/SeanNaren/deepspeech.pytorch\nimport json\nimport librosa\nimport numpy as np\nimport os\nfrom PIL import Image\nimport scipy.signal\nimport torch\nimport torch.nn.functional\nfrom torch.utils.data import Dataset\nimport torchvision.tr... | [
[
"numpy.dot",
"numpy.abs",
"numpy.pad",
"numpy.append",
"torch.FloatTensor",
"numpy.zeros"
]
] |
mareksimunek/spark | [
"12b1e91e6b5135f6ed3e59a49abfc2e5a855263a"
] | [
"python/pyspark/sql/tests.py"
] | [
"# -*- encoding: utf-8 -*-\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2... | [
[
"pandas.DataFrame.from_items",
"pandas.Series",
"numpy.int32",
"pandas.DataFrame",
"pandas.Timestamp.now",
"numpy.random.rand",
"numpy.float32",
"numpy.average",
"pandas.Timestamp"
]
] |
kshulgina/codetta | [
"4f5f31a33beed19bc3e10745154705ad002273df"
] | [
"helper_functions.py"
] | [
"import os\nimport sys\nfrom subprocess import call, Popen, PIPE\nimport re\nimport numpy as np\nfrom ftplib import FTP\nimport datetime\n\ndef translate(sequence, gct):\n \"\"\"\n For a DNA sequence, translate it into a sequence of one symbol per codon, following \n a specific translation table. For examp... | [
[
"numpy.cumsum",
"numpy.empty"
]
] |
cyzhao2013/detext | [
"23874fd3ae26c581bbd1806b7885f4c93f4b4d33"
] | [
"test/train/test_data_fn.py"
] | [
"import numpy as np\nimport os\nimport tensorflow as tf\n\nfrom detext.train import data_fn\nfrom detext.utils import vocab_utils\n\n\nclass TestData(tf.test.TestCase):\n \"\"\"Unit test for data_fn.\"\"\"\n PAD_ID = 3\n CLS_ID = 101\n\n def testInputFnBuilderTfrecord(self):\n \"\"\"Test function... | [
[
"tensorflow.test.main",
"numpy.all",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"tensorflow.tables_initializer"
]
] |
DOsinga/art_critic | [
"90a8b100c391d4ed28c7208d481f85522323362f"
] | [
"art_server.py"
] | [
"#!/usr/bin/env python\nimport argparse\nimport pickle\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.platform import gfile\nimport os\nfrom flask import Flask, request, redirect, flash, jsonify\n\n\nBOTTLENECK_TENSOR_NAME = 'pool_3/_reshape:0'\nJPEG_DATA_TENSOR_NAME = 'DecodeJpeg/contents:0'\... | [
[
"tensorflow.import_graph_def",
"numpy.squeeze",
"tensorflow.Session",
"tensorflow.python.platform.gfile.FastGFile",
"tensorflow.GraphDef"
]
] |
Maelstrom6/MachineLearning3 | [
"cb9a327f998ed2d76d1b9cbcb96e970435a0f17d",
"cb9a327f998ed2d76d1b9cbcb96e970435a0f17d"
] | [
"DeepLearning/ArtificialNeuralNetwork/Tst.py",
"Classification/Naive Bayes/Naive Bayes.py"
] | [
"import pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport time\nimport math\nimport keras\n\nfrom tensorflow.python.client import device_lib\nprint(device_lib.list_local_devices())\n",
"import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom sklearn.impute import Sim... | [
[
"tensorflow.python.client.device_lib.list_local_devices"
],
[
"matplotlib.pyplot.legend",
"pandas.read_csv",
"sklearn.naive_bayes.GaussianNB",
"matplotlib.pyplot.title",
"numpy.unique",
"sklearn.metrics.confusion_matrix",
"sklearn.model_selection.train_test_split",
"matplot... |
paulhfu/unsup_pix_embed | [
"fcfc319f81942ba73ef54bd96e26225d52e8c054"
] | [
"unet3d/model.py"
] | [
"import importlib\n\nimport torch.nn as nn\nimport torch\n\nfrom unet3d.buildingblocks import Encoder, Decoder, DoubleConv, ExtResNetBlock\nfrom unet3d.utils import number_of_features_per_level\n\n\nclass Abstract3DUNet(nn.Module):\n \"\"\"\n Base class for standard and residual UNet.\n\n Args:\n in... | [
[
"torch.nn.Softmax",
"torch.nn.ModuleList",
"torch.nn.Conv3d",
"torch.nn.Sigmoid"
]
] |
MarcMeinhardt/2DTerrainGeneration | [
"396e035ee13f96da09eeb299cde6884ea3faabcd"
] | [
"Python/transform.py"
] | [
"\"\"\"\nPython Image Manipulation by Kylie Ying (modified from MIT 6.865)\n\nYouTube Kylie Ying: https://www.youtube.com/ycubed \nTwitch KylieYing: https://www.twitch.tv/kylieying \nTwitter @kylieyying: https://twitter.com/kylieyying \nInstagram @kylieyying: https://www.instagram.com/kylieyying/ \nWebsite: https:/... | [
[
"numpy.array"
]
] |
Arjung27/SFM-Learner | [
"8da43b4266dfeb23465d3caad0d23b0c8f457257"
] | [
"data_loader.py"
] | [
"from __future__ import division\nimport os\nimport random\nimport tensorflow as tf\nimport numpy as np\n\nclass DataLoader(object):\n def __init__(self, \n dataset_dir=None, \n batch_size=None, \n img_height=None, \n img_width=None, \n ... | [
[
"tensorflow.TextLineReader",
"tensorflow.concat",
"tensorflow.zeros",
"tensorflow.stack",
"tensorflow.cast",
"tensorflow.minimum",
"tensorflow.train.batch",
"tensorflow.image.resize_area",
"tensorflow.decode_csv",
"tensorflow.WholeFileReader",
"tensorflow.stop_gradient"... |
guisoares9/opencv_studies | [
"4bccb0b7fa436e589a23529e52fcd14660639589"
] | [
"calibration/calibration.py"
] | [
"import numpy as np\nimport cv2 as cv\nimport time\n\ncriteria = (cv.TERM_CRITERIA_EPS + cv.TERM_CRITERIA_MAX_ITER, 30, 0.001)\n\nsquare_size = 28\n# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)\nobjp = np.zeros((6*9,3), np.float32)\n#print(objp)\nobjp[:,:2] = np.mgrid[0:9,0:6].T.reshape(-1,2)... | [
[
"numpy.zeros"
]
] |
akterskii/rlkit | [
"dd5d753e0fb3fa9e94b0eb5e78a2101d95657e9f"
] | [
"rlkit/data_management/shared_obs_dict_replay_buffer.py"
] | [
"import numpy as np\n\nfrom rlkit.data_management.obs_dict_replay_buffer import ObsDictRelabelingBuffer\n\nimport torch.multiprocessing as mp\nimport ctypes\n\n\nclass SharedObsDictRelabelingBuffer(ObsDictRelabelingBuffer):\n \"\"\"\n Same as an ObsDictRelabelingBuffer but the obs and next_obs are backed\n ... | [
[
"torch.multiprocessing.Array",
"torch.multiprocessing.Value"
]
] |
Crivella/pymatgen | [
"dd3737011e76520da1347d5db75db3a3f87e520f"
] | [
"pymatgen/io/vasp/tests/test_outputs.py"
] | [
"# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\n\nimport gzip\nimport json\nimport os\nimport unittest\nimport warnings\nimport xml.etree.ElementTree as ET\nfrom pathlib import Path\nfrom shutil import copyfile, copyfileobj\n\nimport numpy as np\nimport pytest\nfrom... | [
[
"numpy.sqrt",
"numpy.all",
"numpy.max",
"numpy.mean",
"numpy.cross",
"numpy.allclose",
"numpy.fft.ifftn",
"numpy.unravel_index",
"numpy.zeros",
"numpy.min",
"numpy.isnan",
"numpy.median",
"numpy.array",
"numpy.sum",
"numpy.abs",
"numpy.linalg.norm",
... |
P2333/Reverse-Cross-Entropy | [
"2514af4a7fbd52423e4cac0da3ea58ac92b841c0"
] | [
"test_adv.py"
] | [
"from __future__ import division\r\nfrom __future__ import absolute_import\r\n\r\nimport six\r\nimport cifar_input\r\nimport mnist_input\r\nimport resnet_model_cifar\r\nimport resnet_model_mnist\r\nimport t_sne\r\nimport numpy as np\r\nimport tensorflow as tf\r\nimport attacks\r\nimport sys\r\nsys.path.append('..')... | [
[
"tensorflow.reduce_sum",
"tensorflow.cast",
"numpy.concatenate",
"tensorflow.app.flags.DEFINE_string",
"numpy.mean",
"tensorflow.argmin",
"numpy.square",
"scipy.io.loadmat",
"tensorflow.app.flags.DEFINE_integer",
"numpy.save",
"tensorflow.ConfigProto",
"numpy.argmax... |
kthyng/cmocean-paraview | [
"6251fc9b0fba9004caa4a4f23d6fecad519322e4"
] | [
"make_xml.py"
] | [
"'''\nConversion from rgb files to Paraview colormap files.\n\nThis reads in the colormap rgb from github directly, and it is stored\nlocally by np.genfromtxt.\n\nAdapted code from Phillip Wolfram (https://gist.github.com/1c042b2a1382eca5415d3139cf591379).\n'''\n\nimport os\nimport numpy as np\nimport cmocean\n\n\n... | [
[
"numpy.linspace",
"numpy.genfromtxt"
]
] |
gabrielsluz/DCL-Release | [
"80d6b97371322fc560e04a365febacd6c7c34406"
] | [
"scripts/script_gen_tube_proposals.py"
] | [
"from opt import parse_opt\nimport pdb\nimport os\nimport json\nimport sys\nsys.path.append('/home/gabrielsluz/Jacinle/jaclearn/vision/coco')\nfrom pycocotools.coco import COCO\nimport pycocotools.mask as mask\nimport numpy as np\nimport copy\nimport cv2\nimport shutil\nimport subprocess\nimport math\nimport pickle... | [
[
"numpy.expand_dims",
"numpy.minimum",
"numpy.sqrt",
"numpy.maximum",
"numpy.clip",
"numpy.stack",
"numpy.max",
"numpy.delete",
"numpy.argmax",
"scipy.optimize.linear_sum_assignment",
"numpy.array",
"numpy.zeros"
]
] |
redNixon/eland | [
"1b9cb1db6d30f0662fe3679c7bb31e2c0865f0c3"
] | [
"eland/tests/dataframe/test_nunique_pytest.py"
] | [
"# Copyright 2019 Elasticsearch BV\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"pandas.util.testing.assert_series_equal"
]
] |
nrichards17/diabetes-pytorch | [
"80ba7e366e5850657cdd29dd8f81adf81408c56f"
] | [
"model/net.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass FCUnit(nn.Module):\n def __init__(self, input_size, output_size, dropout_rate):\n super(FCUnit, self).__init__()\n\n self.linear = nn.Linear(input_size, output_size)\n self.batchnorm = nn.BatchNorm1d(output_size... | [
[
"torch.nn.BatchNorm1d",
"torch.nn.Dropout",
"torch.cat",
"torch.nn.Embedding",
"torch.nn.Sigmoid",
"torch.nn.Linear",
"torch.nn.functional.leaky_relu"
]
] |
ZachT1711/tensor2robot | [
"7a58c5f6b6f2857d7ee730013da512f42b70cb58",
"3ab8aa56ebe86464c8074a3a2f7282ebea74c1aa",
"7a58c5f6b6f2857d7ee730013da512f42b70cb58"
] | [
"utils/subsample.py",
"utils/cross_entropy.py",
"hooks/async_export_hook_builder_tpu_test.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Tensor2Robot 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 require... | [
[
"tensorflow.compat.v1.random.uniform",
"tensorflow.compat.v1.concat",
"tensorflow.compat.v1.equal",
"numpy.arange",
"tensorflow.compat.v1.reshape",
"tensorflow.compat.v1.map_fn",
"numpy.random.shuffle",
"tensorflow.compat.v1.math.floor",
"numpy.concatenate",
"tensorflow.com... |
mandaltanmoy1938/VisualGPT | [
"9ba78948282fdca502d5030f4eccc3df562982c3"
] | [
"evaluation/cider/cider_scorer.py"
] | [
"\n\nimport copy\nfrom collections import defaultdict\nimport numpy as np\nimport math\n\ndef precook(s, n=4):\n \"\"\"\n Takes a string as input and returns an object that can be given to\n either cook_refs or cook_test. This is optional: cook_refs and cook_test\n can take string arguments as well.\n ... | [
[
"numpy.array",
"numpy.mean",
"numpy.sqrt"
]
] |
shahidul56/computer-vision-resource | [
"fd9f2a328e015bc0bf083578496e980681204614"
] | [
"CSE-6239-assignment-1/code/average_gray.py"
] | [
"\r\n\r\nimport numpy as np\r\nimport cv2\r\nimport sys\r\nimport getopt\r\nimport matplotlib.pyplot as plt\r\n\r\n\r\ndef readImage(filename):\r\n \"\"\"\r\n Read in an image file, errors out if we can't find the file\r\n :param filename: The image filename.\r\n :return: The img object in matrix form.\... | [
[
"matplotlib.pyplot.imshow",
"numpy.zeros",
"numpy.ones"
]
] |
mdecourse/lightDRL | [
"4eff160f3797f88d20a059104c75e49d5295d932"
] | [
"worker.py"
] | [
"\nimport tensorflow as tf\nimport numpy as np\nimport yaml\nimport threading\nimport time\n\n# for connect to server\nfrom flask_socketio import Namespace, emit\n# DRL import \nfrom DRL.Base import RL, DRL\nfrom DRL.DDPG import DDPG\nfrom DRL.DQN import DQN\nfrom DRL.A3C import A3C\nfrom DRL.Qlearning import Qlear... | [
[
"tensorflow.summary.FileWriter",
"numpy.asscalar",
"numpy.random.seed",
"tensorflow.SummaryMetadata",
"numpy.isscalar",
"tensorflow.make_tensor_proto",
"numpy.random.rand",
"tensorflow.Summary",
"numpy.array",
"numpy.zeros",
"numpy.random.randint"
]
] |
hehichens/BCI | [
"b5802d61b6f7dbef937233a2b90836def08b9797"
] | [
"utils/utils.py"
] | [
"\"\"\"\nsome useful tools\nedit by hichens\n\"\"\"\n\nfrom scipy import signal\nimport pywt\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport time\nimport warnings; warnings.filterwarnings(\"ignore\")\n\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics im... | [
[
"sklearn.neural_network.MLPClassifier",
"numpy.square",
"sklearn.naive_bayes.GaussianNB",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis",
"sklearn.naive_bayes.MultinomialNB",
"sklearn.model_selection.train_test_split",
"pand... |
jspaaks/vak | [
"581ec4869d342e5d52bc057de54c10901f06d343"
] | [
"tests/test_nn/test_functional.py"
] | [
"import pytest\n\nimport torch\n\nimport vak.nn.functional as F\n\n\n# adapted from kornia, https://github.com/kornia/kornia/blob/master/test/utils/test_one_hot.py\ndef test_onehot():\n num_classes = 4\n labels = torch.zeros(2, 2, 1, dtype=torch.int64)\n labels[0, 0, 0] = 0\n labels[0, 1, 0] = 1\n la... | [
[
"torch.zeros"
]
] |
granttremblay/MUSEmovie | [
"979f61bb90aa6de7f553c715a9da11d27329538f"
] | [
"make_cars_movies.py"
] | [
"import os\nimport glob\n\nimport warnings\n\nfrom astropy.io import fits\nfrom astropy.wcs import WCS\n\nfrom astroquery.ned import Ned\n\nimport numpy as np\n\n# import seaborn as sns\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import LogNorm\nfrom matplotlib import cm\n\nimport imageio\n\n# Some thi... | [
[
"matplotlib.colors.LogNorm",
"numpy.abs",
"numpy.arange",
"matplotlib.pyplot.Axes",
"numpy.shape",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
]
] |
ContentSide/rezojdm-sds | [
"ee1203afdcbabc9a3c8abace6723cfeaa077808c"
] | [
"src/modules/ConvKB.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .Model import Model\n\nclass ConvKB(Model):\n\n def __init__(self, ent_tot, rel_tot, convkb_drop_prob, out_channels, kernel_size, hidden_size = 100):\n super(ConvKB, self).__init__(ent_tot, rel_tot)\n \n self.hidden_... | [
[
"torch.mean",
"torch.nn.Dropout",
"torch.nn.Softplus",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.Embedding",
"torch.nn.Linear",
"torch.nn.init.xavier_uniform_",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
aditya10/vilbert-multi-task | [
"dda8c16187ac6cc4f6266a823fbde528f65af720"
] | [
"vilbert/datasets/visual_genome_dataset.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport os\nimport json\nimport _pickle as cPickle\nimport logging\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import D... | [
[
"torch.zeros",
"torch.from_numpy",
"torch.tensor",
"numpy.array",
"numpy.zeros"
]
] |
olonok69/TIME_SERIES_MODELING_KERAS | [
"c0e5a6f274d707551e3bcad2d2ccf75b18c39464"
] | [
"raw_data/library.py"
] | [
"import pandas\nimport numpy as np\n#from sklearn import preprocessing\n#from sklearn import svm\n#from sklearn import cross_validation\n#import pandas_datareader.data as web\n#import quandl\n\ndaysAhead = 270\n\ndef get_web_data(symbols, dates):\n #\"\"\"Read stock data (adjusted close) for given symbols from C... | [
[
"numpy.mean"
]
] |
jiviteshjain/cast-away | [
"1b244fe0df24cb570739ae82626df35fccbe3a22"
] | [
"utils.py"
] | [
"import os\nimport numpy as np\nfrom colorama import init as cinit\nfrom colorama import Fore, Back, Style\nimport random\nfrom time import monotonic as clock\nimport random\nimport math\n\nimport config as conf\nimport obstacle\n\ndef intersect(rec_a, rec_b):\n '''\n checks if two rectangles intersect and re... | [
[
"numpy.array"
]
] |
johnjasa/CADRE | [
"a4ffd61582b8474953fc309aa540838a14f29dcf"
] | [
"CADRE/rw_dymos/rw_dynamics.py"
] | [
"\"\"\"\nReaction Wheel discipline for CADRE: Reaction Wheel Dynamics component.\n\"\"\"\nfrom __future__ import print_function, division, absolute_import\nfrom six.moves import range\n\nimport numpy as np\n\nfrom openmdao.api import ExplicitComponent\n\n\nclass ReactionWheelDynamics(ExplicitComponent):\n \"\"\"... | [
[
"numpy.einsum",
"numpy.arange",
"numpy.tile",
"numpy.concatenate",
"numpy.array",
"numpy.zeros"
]
] |
robotenique/advancedProgramming | [
"d5472ffe5bc8f99be55b873a3637266d373d76dc"
] | [
"numeric-methods/splines.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nimport matplotlib as mpl\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\nimport functools\n\n###############################################################################\n#\n# spline = a cubic b spline with equally spaced nodes\n#\n########... | [
[
"matplotlib.pyplot.legend",
"numpy.linalg.solve",
"numpy.linspace",
"matplotlib.pyplot.title",
"numpy.sin",
"matplotlib.pyplot.plot",
"numpy.ones",
"numpy.random.normal",
"matplotlib.pyplot.ylabel",
"numpy.std",
"numpy.random.rand",
"numpy.floor",
"matplotlib.py... |
jaentrouble/reinforcement | [
"3557b37d83e380e1a711876320ad5247157957f3"
] | [
"grid_1d.py"
] | [
"from constants import *\nimport numpy as np\nimport tool\nimport math\nimport random\n\nclass Grid() :\n def __init__ (self, width, height, snakelength : int, rand = True, trap = 0) :\n \"\"\"\n Grid\n snakelength : initial snake length\n \"\"\"\n self.width = width\n s... | [
[
"numpy.concatenate",
"numpy.dot",
"numpy.stack",
"numpy.full"
]
] |
tuanlm173/TensorflowProjects | [
"80d8990fd769958211701495cd6169644f37045f"
] | [
"data_loader/data_generator.py"
] | [
"import numpy as np\n\n\nclass DataGenerator:\n def __init__(self):\n self.config = config\n # load data here\n self.input = np.ones((500, 784))\n self.y = np.ones((500, 10))\n\n def next_batch(self, batch_size):\n idx = np.random.choice(500, batch_size)\n yield self.... | [
[
"numpy.random.choice",
"numpy.ones"
]
] |
dulude/drizzlepac | [
"e0e05faea7ea7be3009e131d43189beb187c542c"
] | [
"drizzlepac/align.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"This script is a modernized implementation of tweakreg.\n\n\"\"\"\nimport copy\nimport datetime\nimport sys\nimport glob\nimport math\nimport os\nimport pickle\nfrom collections import OrderedDict\nimport traceback\n\nimport numpy as np\nfrom astropy.table import Table\nfrom astropy.... | [
[
"numpy.asarray",
"numpy.where"
]
] |
lastcoolnameleft/whisky-training | [
"1a8eb24942f65ab3055357bfbfca9eca6d2a93be"
] | [
"whiskme_ml.py"
] | [
"\n# coding: utf-8\n\n# In[106]:\n\nfrom flask import Flask\nfrom flask import request\nfrom flask import jsonify\nimport pprint\nimport os\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.neighbors import NearestNeighbors\n\napp... | [
[
"pandas.concat",
"pandas.read_csv",
"numpy.log",
"sklearn.preprocessing.MinMaxScaler"
]
] |
plkmo/Tacotron2-adapted | [
"4b57f35b2400ebd0b2a40f1671655522bd7289c2"
] | [
"train.py"
] | [
"# *****************************************************************************\r\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\r\n#\r\n# Redistribution and use in source and binary forms, with or without\r\n# modification, are permitted provided that the following conditions are met:\r\n# ... | [
[
"scipy.io.wavfile.write",
"torch.distributed.init_process_group",
"torch.utils.data.distributed.DistributedSampler",
"torch.load",
"numpy.isnan",
"torch.utils.data.DataLoader",
"torch.distributed.is_available",
"torch.no_grad",
"torch.cuda.is_available",
"torch.cuda.device_... |
abhigenbdn/Capsule-Networks-on-MNIST | [
"dde980ba0de3602df1c95c08cb1113e0cecdd389"
] | [
"capsulenet.py"
] | [
"\"\"\"\nKeras implementation of CapsNet in Hinton's paper Dynamic Routing Between Capsules.\n\n\n ... ...\n\"\"\"\n\nimport numpy as np\nfrom keras import layers, models, optimizers\nfrom keras import backend as K\nfrom keras.utils import to_categorical\nimport matplotlib.pyplot as plt\nfrom utils import com... | [
[
"numpy.expand_dims",
"matplotlib.pyplot.imread",
"numpy.concatenate",
"numpy.copy",
"numpy.argmax",
"numpy.prod",
"matplotlib.pyplot.show",
"numpy.zeros"
]
] |
javerbukh/specutils | [
"b5720f6d1dc1a184b882a71e9058785c350a74c8",
"b5720f6d1dc1a184b882a71e9058785c350a74c8"
] | [
"specutils/spectra/spectrum1d.py",
"specutils/tests/test_fitting.py"
] | [
"import logging\n\nimport numpy as np\nfrom astropy import units as u\nfrom astropy.nddata import NDDataRef\nfrom astropy.utils.decorators import lazyproperty\nfrom astropy.nddata import NDUncertainty\nfrom ..wcs import WCSWrapper, WCSAdapter\nfrom .spectrum_mixin import OneDSpectrumMixin\n\n__all__ = ['Spectrum1D'... | [
[
"numpy.mean",
"numpy.diff"
],
[
"numpy.allclose",
"numpy.random.seed",
"numpy.linspace",
"numpy.random.normal",
"numpy.exp",
"numpy.array",
"numpy.isclose"
]
] |
HighCWu/neural-renderer-paddle | [
"c5c8375b0400a0b7722ab893e46ca706153b5a43"
] | [
"tests/test_look_at.py"
] | [
"import unittest\n\nimport paddle\nimport numpy as np\n\nimport neural_renderer_paddle as nr\n\nclass TestLookAt(unittest.TestCase):\n def test_case1(self):\n eyes = [\n [1, 0, 1],\n [0, 0, -10],\n [-1, 1, 0],\n ]\n answers = [\n [-np.sqrt(2) / 2, ... | [
[
"numpy.array",
"numpy.sqrt"
]
] |
fangwudi/mmcv | [
"7655fa1a92bad1504511fd11bd34371b9dbd0c37"
] | [
"tests/test_runner/test_eval_hook.py"
] | [
"import os.path as osp\nimport tempfile\nimport unittest.mock as mock\nfrom collections import OrderedDict\nfrom unittest.mock import MagicMock, patch\n\nimport pytest\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader, Dataset\n\nfrom mmcv.runner import DistEvalHook as BaseDistEvalHook\n... | [
[
"torch.nn.Linear",
"torch.utils.data.DataLoader",
"torch.ones",
"torch.tensor"
]
] |
felipenunezb/qa_project | [
"a233c7991c3c24a0e8ee489baeac41b831a93f72"
] | [
"examples/question-answering/run_squad_trainer_vqa_steroids_v2.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may... | [
[
"torch.no_grad"
]
] |
DarwinSenior/moderngl | [
"632146f4da03b8cb9f14a0642938fbc819161be5"
] | [
"examples/next/julia_set.py"
] | [
"import os\n\nimport moderngl.next as mgl\nimport numpy as np\nfrom PIL import Image\n\nimport data\nfrom example_window import Example, run_example\n\n\nclass Fractal(Example):\n def __init__(self):\n self.ctx = mgl.create_context()\n\n self.prog = self.ctx.program(\n vertex_shader='''\... | [
[
"numpy.array"
]
] |
MelDur22/manim | [
"cfba888ad69a7ccd4a8c4a1c80662078171b73ed"
] | [
"manimlib/mobject/geometry.py"
] | [
"import itertools as it\n\nimport numpy as np\n\nfrom manimlib.constants import *\nfrom manimlib.mobject.mobject import Mobject\nfrom manimlib.mobject.types.vectorized_mobject import VGroup\nfrom manimlib.mobject.types.vectorized_mobject import VMobject\nfrom manimlib.utils.bezier import interpolate\nfrom manimlib.... | [
[
"numpy.dot",
"numpy.abs",
"numpy.linspace",
"numpy.arange",
"numpy.cos",
"numpy.sin",
"numpy.arctan2",
"numpy.append",
"numpy.cross",
"numpy.array",
"numpy.zeros"
]
] |
zhaonan68/QUANTAXIS | [
"b7d0108124b05168c82a53f00a11ba40a39a3964"
] | [
"QUANTAXIS/QASU/save_tdx.py"
] | [
"# coding:utf-8\n#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016-2018 yutiansut/QUANTAXIS\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including withou... | [
[
"pandas.DataFrame.from_items"
]
] |
oikosohn/lightweight-waste-classifier | [
"b3b332e8389e8a00e1d853c689226743bba00213"
] | [
"src/trainer.py"
] | [
"\"\"\"PyTorch trainer module.\n\n- Author: Jongkuk Lim, Junghoon Kim\n- Contact: lim.jeikei@gmail.com, placidus36@gmail.com\n\"\"\"\n\nimport os\nimport shutil\nfrom typing import Optional, Tuple, Union\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torchvision\nfro... | [
[
"torch.max",
"torch.cuda.amp.autocast",
"torch.no_grad",
"sklearn.metrics.f1_score",
"torch.squeeze"
]
] |
RegularizedML/pytorch-deepdream | [
"82f181fe43f15e75bfcbb111432e7006e9123c33"
] | [
"utils/constants.py"
] | [
"import enum\nimport os\n\n\nimport numpy as np\nimport torch\n\n\nIMAGENET_MEAN_1 = np.array([0.485, 0.456, 0.406], dtype=np.float32)\nIMAGENET_STD_1 = np.array([0.229, 0.224, 0.225], dtype=np.float32)\n\n\nDEVICE = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\") # checking whether you have a GPU... | [
[
"numpy.array",
"torch.cuda.is_available"
]
] |
Vooblin/model-optimization | [
"b1ab38824466dc008614e414bc854582c705eb1f"
] | [
"tensorflow_model_optimization/python/core/quantization/keras/quantize_aware_activation.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.keras.activations.serialize",
"tensorflow.python.keras.activations.deserialize"
]
] |
chenxinye/ABBA | [
"d25cae182ae3e04776d6618103a3bf53f88c00b2"
] | [
"paper/mydefaults.py"
] | [
"import matplotlib as mpl\nimport matplotlib.font_manager\n\ndef mydefaults(fig, ax, r=0.71, s=1):\n \"\"\"\n Parameters\n ----------\n fig, ax : figure and axes handle from matplotlib\n r : height/width ratio\n s : scaling of font size\n\n Example\n -------\n from mydefaults import mydef... | [
[
"matplotlib.cycler",
"matplotlib.pyplot.tight_layout"
]
] |
Prism2/LSTM-flare-prediction | [
"9d6e2bb2c40c35a1defa0ce357140b5304124017"
] | [
"DEMONSTRATION/LSTM_M_sample_run/LSTMflare.py"
] | [
"# =========================================================================\n# (c) Copyright 2019\n# All rights reserved\n# Programs written by Hao Liu\n# Department of Computer Science\n# New Jersey Institute of Technology\n# University Heights, Newark, NJ 07102, USA\n#\n# Permission to use, copy, m... | [
[
"sklearn.preprocessing.LabelEncoder",
"numpy.array",
"pandas.read_csv",
"numpy.unique"
]
] |
FilomenoSanchez/ample | [
"f38c8e5ce646d66638f1a88ff5cf34bd3b9e1490"
] | [
"ample/ensembler/single_model.py"
] | [
"\"\"\"Ensembler module for single model structures\"\"\"\n\n__author__ = \"Felix Simkovic, and Jens Thomas\"\n__date__ = \"16 Feb 2016\"\n__version__ = \"1.0\"\n\nimport logging\nimport os\nimport pandas as pd\n\nfrom ample.ensembler import _ensembler, truncation_util\nfrom ample.ensembler.constants import SIDE_CH... | [
[
"pandas.read_csv"
]
] |
Sideboard/QUIP | [
"f41372609e4a92fcda9f33b695a666de3886822b"
] | [
"tests/test_filepot.py"
] | [
"# HQ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n# HQ X\n# HQ X quippy: Python interface to QUIP atomistic simulation library\n# HQ X\n# HQ X Copyright James Kermode 2019\n# HQ X\n# HQ X These portions of the source code are released under the GNU General\n# HQ X Public Li... | [
[
"numpy.array",
"numpy.zeros"
]
] |
robots-helpinghandslab/or_ompl | [
"1e02092cfbff6e21c8050eb807017124a43deae9"
] | [
"tests/test_Planner.py"
] | [
"#!//bin/env python\nfrom __future__ import print_function\nimport numpy\nimport unittest\nimport openravepy\nimport os\nimport subprocess\nimport sys\n\n\n# Add the models included with OpenRAVE to the OPENRAVE_DATA path. These may\n# not be available if the user manually set the OPENRAVE_DATA environmental\n# var... | [
[
"numpy.array"
]
] |
ankushagarwal/tensor2tensor | [
"42a788355a209f21bbf5fd52d56d514405e193a3"
] | [
"tensor2tensor/bin/t2t_decoder.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.gfile.Exists",
"tensorflow.reshape",
"tensorflow.placeholder",
"tensorflow.logging.set_verbosity",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.app.run"
]
] |
fscottfoti/activitysim | [
"cc18cce84b2e4b5f380f58c7919953d2cd03ee73"
] | [
"activitysim/core/test/test_los.py"
] | [
"# ActivitySim\n# See full license in LICENSE.txt.\n\nimport os\n\nimport numpy as np\nimport pandas as pd\nimport numpy.testing as npt\nimport pandas.testing as pdt\nimport pytest\n\nfrom activitysim.core import orca\n\nfrom .. import inject\nfrom .. import los\n\n\ndef teardown_function(func):\n inject.clear_c... | [
[
"numpy.testing.assert_almost_equal",
"pandas.testing.assert_series_equal",
"pandas.Series",
"pandas.DataFrame"
]
] |
perillaroc/reki-data-tool | [
"047424a2f8a1f0e16684bffaeded4044366f63c0"
] | [
"reki_data_tool/ml/moml/validate/index.py"
] | [
"import numpy as np\nimport xarray as xr\nimport pandas as pd\n\n\ndef rmse(forecast, analysis):\n return np.sqrt(\n np.sum(\n np.power(forecast - analysis, 2)\n /\n np.product(analysis.shape)\n )\n )\n"
] | [
[
"numpy.product",
"numpy.power"
]
] |
ranapratapdas/aipnd-project | [
"5108b3c2f12d4fa5a4b1e0a5131344f2c39c3a74"
] | [
"predict.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom torch import tensor\nfrom torch import optim\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom torchvision import datasets, transforms\nimport torchvision.models as models\nfrom collections impor... | [
[
"numpy.array"
]
] |
TanUkkii007/wavenet | [
"0df8ddb17b14d1f6a0ad5530977b6591f0feb642"
] | [
"datasets/dataset.py"
] | [
"import tensorflow as tf\nfrom collections import namedtuple\nfrom abc import abstractmethod\nfrom utils.tfrecord import decode_preprocessed_data, parse_preprocessed_data, PreprocessedData\n\n\nclass SourceData(namedtuple(\"SourceData\",\n [\"id\", \"key\", \"mel\", \"mel_length\", \"mel_... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.to_int64",
"tensorflow.TensorShape",
"tensorflow.shape",
"tensorflow.data.TFRecordDataset",
"tensorflow.reshape",
"tensorflow.less_equal",
"tensorflow.expand_dims",
"tensorflow.minimum",
"tensorflow.contrib.data.shuffle_and_repeat... |
effigies/PySurfer | [
"4edbe61e55b13f3e8af9ff26597a1311b49bf8de"
] | [
"examples/plot_probabilistic_label.py"
] | [
"\"\"\"\n============================\nDisplay Probabilistic Labels\n============================\n\nFreesurfer ships with some probabilistic labels of cytoarchitectonic\nand visual areas. Here we show several ways to visualize these labels\nto help characterize the location of your data.\n\n\"\"\"\nfrom os import ... | [
[
"numpy.zeros_like"
]
] |
The-Jyotiram-Koratkar/MyRegJK_V2.0 | [
"0cf9bd42a77970af087a8fe8b7905a69ac307603"
] | [
"regression_model/train_pipeline.py"
] | [
"import numpy as np\nfrom sklearn.model_selection import train_test_split\n\nfrom regression_model.config import config\nfrom regression_model import pipeline\nfrom regression_model.processing.data_management import (\n load_dataset, save_pipeline)\n\n\n\ndef run_training() -> None:\n \"\"\"Train the model.\"... | [
[
"numpy.log",
"sklearn.model_selection.train_test_split"
]
] |
HalmonLui/copystrike | [
"80c7cbfcd4cff777d5a16472550b2306fd046e5a"
] | [
"poseDetection/driver 3-26-2019.py"
] | [
"import tkinter as tk, threading\r\nfrom tkinter import *\r\nimport tkinter.font\r\nfrom tkinter import filedialog\r\nfrom tkinter.font import *\r\nimport imageio\r\nfrom imageio import *\r\nfrom PIL import *\r\nimport cv2\r\nfrom cv2 import *\r\nimport PIL\r\nfrom PIL import Image, ImageTk\r\nfrom PIL import *\r\n... | [
[
"matplotlib.pyplot.subplots"
]
] |
neuronflow/torchio | [
"1d0a5ad069c59d74ec56ed6f340c87e9636a1488"
] | [
"torchio/data/sampler/sampler.py"
] | [
"import copy\nfrom typing import Tuple, Optional, Generator\n\nimport numpy as np\n\nfrom ... import TypePatchSize, TypeTripletInt\nfrom ...data.subject import Subject\nfrom ...utils import to_tuple\n\n\nclass PatchSampler:\n r\"\"\"Base class for TorchIO samplers.\n\n Args:\n patch_size: Tuple of inte... | [
[
"numpy.array"
]
] |
hongliangduan/Reproducing-the-invention-of-a-named-reaction-Zero-shot-prediction-of-unseen-chemical-reactions | [
"2d688bff2202e37321dedba7cdac67cd3c1e1fad"
] | [
"data_generators/translate.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir... | [
[
"tensorflow.gfile.Open",
"tensorflow.gfile.Exists",
"tensorflow.gfile.GFile",
"tensorflow.Summary.Value",
"tensorflow.logging.info",
"tensorflow.contrib.slim.tfexample_decoder.Tensor",
"tensorflow.VarLenFeature"
]
] |
yee2542/CPE393-Coding-AI-Project | [
"b86203488eb72f6305ca9f58ebca68cd7d092428"
] | [
"model.summary.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... | [
[
"tensorflow.keras.layers.AveragePooling2D",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Input"
]
] |
aditya5252/Asynccode | [
"c52e36fc05e5eb2d8720e1f1674b956b69a94958"
] | [
"source/step_AT2_.py"
] | [
"import numpy as np\nimport probability_initial\nimport delay_file\n \ndef at2u0(pe,l,L, p_arr): \n a = l+1 \n b = -l \n temp = a*p_arr[int(L-1-l)][int(pe)]+b*p_arr[int(L-2-l)][int(pe)]\n return temp\n\n\ndef cd2u1(u,cx,dx,nx,Eqflag,Syncflag,L=None,PE=None,perPE=None,pstart=None,pend=None,ATolFLAG=... | [
[
"numpy.zeros_like"
]
] |
pandamax/current-lane-drivable | [
"0727b101cec3d5663aa953209abf1f323b062a4f"
] | [
"mask-rcnn/libraries/mrcnn/visualize.py"
] | [
"\"\"\"\nMask R-CNN\nDisplay and Visualization Functions.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport sys\nimport logging\nimport random\nimport itertools\nimport colorsys\n\nimport numpy as np\nfrom skimage... | [
[
"matplotlib.pyplot.imshow",
"numpy.concatenate",
"numpy.any",
"numpy.where",
"matplotlib.patches.Polygon",
"matplotlib.pyplot.tight_layout",
"numpy.unique",
"numpy.fliplr",
"numpy.arange",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.axis",
"numpy.zeros",
"ma... |
nicwulab/UK_strain_in_vitro_fitness | [
"743115c37d60877ca520ba0a4d53e4dc3c1734c7"
] | [
"codes/coverage_plot.py"
] | [
"#!/usr/bin/env python\n\nimport sys\nimport glob\nimport os\nimport pandas as pd\nimport seaborn as sns\nfrom matplotlib import use as mpl_use\n\nmpl_use(\"agg\")\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport logging\n\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(\"SARS-CoV2 ... | [
[
"matplotlib.use",
"pandas.read_csv",
"matplotlib.pyplot.rc"
]
] |
NagisaZj/varibad | [
"df7cda81588c62a2a3bee69e4173228701bd7000",
"df7cda81588c62a2a3bee69e4173228701bd7000"
] | [
"config/mujoco/args_metaworld_varibad.py",
"config/mujoco/args_mujoco_cheetah_dir_varibad.py"
] | [
"import argparse\n\nimport torch\n\nfrom utils.cli import boolean_argument\n\n\ndef get_args(rest_args):\n parser = argparse.ArgumentParser()\n\n # --- GENERAL ---\n\n # training parameters\n parser.add_argument('--num_frames', type=int, default=1e8, help='number of frames to train')\n parser.add_arg... | [
[
"torch.cuda.is_available"
],
[
"torch.cuda.is_available"
]
] |
dsosnoski/irvideo-classification | [
"894e0bf00039fb35e870e682eb62f68e7ec00334"
] | [
"model/trainer_kfold.py"
] | [
"\nimport datetime\nimport json\nimport os\nimport pickle\nimport sys\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom model.frame_sequence import FrameSequence\nfrom model.model_builder import ModelBuilder\nfrom model.training_utils import load_raw_tracks, tracks_by_tag, first_time_model, build_callback, \\\... | [
[
"tensorflow.config.experimental.set_memory_growth",
"numpy.random.shuffle",
"tensorflow.keras.backend.clear_session",
"tensorflow.config.list_physical_devices",
"numpy.zeros"
]
] |
likesum/deepFnF | [
"461d93de15a642bda75c7ef15937a01e1c5575e5"
] | [
"test.py"
] | [
"#!/usr/bin/env python3\n\nimport os\nimport argparse\n\nimport utils.np_utils as npu\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow.contrib.eager as tfe\n\nimport net\nimport utils.utils as ut\nimport utils.tf_utils as tfu\n\ntf.enable_eager_execution()\n\nparser = argparse.ArgumentParser()\nparse... | [
[
"tensorflow.enable_eager_execution",
"tensorflow.concat",
"numpy.clip",
"tensorflow.contrib.eager.Variable",
"numpy.mean",
"numpy.load"
]
] |
Templarrr/pandas | [
"e91a840869aa023ac52802145df8c916e6ef907d"
] | [
"pandas/core/generic.py"
] | [
"# pylint: disable=W0231,E1101\nimport collections\nimport functools\nimport warnings\nimport operator\nimport weakref\nimport gc\nimport json\n\nimport numpy as np\nimport pandas as pd\n\nfrom pandas._libs import tslib, properties\nfrom pandas.core.dtypes.common import (\n ensure_int64,\n ensure_object,\n ... | [
[
"pandas.tseries.frequencies.to_offset",
"pandas.util._validators.validate_bool_kwarg",
"pandas.core.common.AbstractMethodError",
"pandas.core.dtypes.inference.is_hashable",
"pandas.core.missing.clean_reindex_fill_method",
"pandas.core.nanops.nanmin",
"pandas.compat.lzip",
"numpy.wh... |
ajaykumaar/Food-therapy | [
"cbba734ed9eca32caceae5ac937cac487459f38a"
] | [
"app.py"
] | [
"from flask import *\nimport pymongo \nfrom pymongo import MongoClient\nimport joblib\nimport tensorflow as tf\nfrom tensorflow.keras.preprocessing.text import Tokenizer\nfrom tensorflow.keras.preprocessing.sequence import pad_sequences\n\nconnection_url = 'mongodb+srv://ajaykumaar:ajay@cluster0.07d2o.mongodb.net/f... | [
[
"tensorflow.keras.preprocessing.sequence.pad_sequences"
]
] |
jcalcant/Programming-a-self-driving-car | [
"cb11d65d7b67298c93d6640edae71a06aa91da7c"
] | [
"ros/src/waypoint_updater/waypoint_updater.py"
] | [
"#!/usr/bin/env python\n\nimport rospy\nfrom geometry_msgs.msg import PoseStamped\nfrom styx_msgs.msg import Lane, Waypoint\nfrom scipy.spatial import KDTree\nfrom std_msgs.msg import Int32\n\nimport math\nimport numpy as np\n\n'''\nThis node will publish waypoints from the car's current position to some `x` distan... | [
[
"numpy.dot",
"numpy.array",
"scipy.spatial.KDTree"
]
] |
fermi-lat/extendedArchive | [
"d68b2e6e6699d68d157eb4d25cf64d935055445f"
] | [
"build_archive.py"
] | [
"from __future__ import absolute_import, division, print_function\nimport os\nimport re\nimport yaml\nimport argparse\nimport xml.etree.cElementTree as ElementTree\nimport numpy as np\nfrom astropy.table import Table, Column\nfrom astropy.coordinates import SkyCoord\n\n\ndef path_to_xmlpath(path):\n if path is N... | [
[
"numpy.sqrt",
"numpy.isfinite"
]
] |
jjerry-k/BentoML | [
"1efd77c609b3fc2e153436c57db9b3707608c894"
] | [
"bentoml/_internal/frameworks/tensorflow.py"
] | [
"import os\nimport re\nimport uuid\nimport typing as t\nimport logging\nimport pathlib\nimport functools\nfrom typing import TYPE_CHECKING\nfrom distutils.dir_util import copy_tree\n\nfrom simple_di import inject\nfrom simple_di import Provide\n\nfrom bentoml import Tag\nfrom bentoml import Model\nfrom bentoml impo... | [
[
"tensorflow.compat.v1.saved_model.load_v2",
"tensorflow.convert_to_tensor",
"tensorflow.device",
"tensorflow.compat.v1.ConfigProto",
"tensorflow.compat.v1.get_default_graph",
"tensorflow.saved_model.load",
"tensorflow.python.client.device_lib.list_local_devices",
"tensorflow.compat... |
seawavve/OAC | [
"66bfed8a1585c252e6b00c9fee36db7f3a4ba30a"
] | [
"result/covid_confimation_trend_data.py"
] | [
"#코로나 확진자 추이 크롤링\n# Run Time: 0 min\n\nimport pandas as pd\nfrom bs4 import BeautifulSoup\nimport requests\n\n'''\n기준일:stateDt (index)\n누적확진자수:decideCnt\n누적격리해제수:clearCnt\n누적사망자수:deathCnt\n검사진행수:examCnt\n치료중환자수:careCnt\n누적결과음성수:resultNegCnt\n누적확진률:accDefRate\n\n당일확진자수:decCnt\n당일격리해제수:clCnt\n당일사망자수:dthCnt\n당일결과음성수:r... | [
[
"pandas.DataFrame"
]
] |
sha256burim/Implementation-of-TensorFlow-Fast-GAN-Neural-Style-Transfer | [
"ef6c1705b37d0e6c18aa001173f9be90ca83a8bc"
] | [
"fast_stylize.py"
] | [
"import functools\r\nimport os\r\n\r\nfrom matplotlib import gridspec\r\nimport matplotlib.pylab as plt\r\nimport numpy as np\r\nimport tensorflow as tf\r\nimport tensorflow_hub as hub\r\n\r\nprint(\"TF Version: \", tf.__version__)\r\nprint(\"TF-Hub version: \", hub.__version__)\r\nprint(\"Eager mode enabled: \", t... | [
[
"matplotlib.pylab.show",
"tensorflow.executing_eagerly",
"tensorflow.constant",
"tensorflow.image.crop_to_bounding_box",
"matplotlib.pylab.axis",
"tensorflow.stack",
"matplotlib.pylab.imread",
"matplotlib.pylab.subplot",
"tensorflow.image.resize",
"matplotlib.pylab.figure",... |
SIME-LAB/albumentations | [
"7f3f5a3535780a66460b6e19cbdabbf0a294f267"
] | [
"tests/test_serialization.py"
] | [
"import json\nimport os\nimport random\nfrom unittest.mock import patch\n\nimport cv2\nimport numpy as np\nimport pytest\n\nimport albumentations as A\nimport albumentations.augmentations.functional as F\nfrom albumentations.core.serialization import SERIALIZABLE_REGISTRY, shorten_class_name\nfrom albumentations.co... | [
[
"numpy.random.seed",
"numpy.array_equal",
"numpy.random.randint"
]
] |
martius-lab/beta-nll | [
"669c9f251eb41464c1ec8b43751c7c742dd75cf9"
] | [
"src/models/variational_variance.py"
] | [
"\"\"\"Implements algorithms from\n\nStirn & Knowles, 2020: \"Variational Variance: Simple, Reliable, Calibrated\nHeteroscedastic Noise Variance Parameterization\".\n\"\"\"\nimport itertools\nimport math\n\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom torch.distributions import gamma\nfrom torch.nn ... | [
[
"torch.mean",
"torch.nn.Parameter",
"torch.nn.functional.log_softmax",
"torch.digamma",
"torch.distributions.gamma.Gamma",
"torch.from_numpy",
"torch.nn.Linear",
"torch.rand",
"torch.logsumexp",
"torch.nn.functional.softplus"
]
] |
jcantlord/PET-SinoGAN | [
"c83662ca2742955e4dbdfa5524ea814aad18a2dd"
] | [
"src/models/dcgan/train.py"
] | [
"\"\"\"\nTraining of DCGAN network\n\nBased on https://github.com/aladdinpersson\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torchvision\nimport torchvision.datasets as datasets\nimport torchvision.transforms as transforms\n\nfrom torch.utils.data import DataLoader\nfrom torc... | [
[
"torch.randn",
"torch.utils.data.DataLoader",
"torch.zeros_like",
"torch.nn.BCELoss",
"torch.no_grad",
"torch.utils.tensorboard.SummaryWriter",
"torch.cuda.is_available",
"torch.ones_like"
]
] |
sandialabs/BioCompoundDB | [
"8220e90544f43159843fa26758dc5a1333562fa7",
"8220e90544f43159843fa26758dc5a1333562fa7"
] | [
"bcml/Parser/build_training.py",
"bcml/KNNImpute/knnimpute/common.py"
] | [
"\"\"\"\nThis process takes in the training dataset and outputs\na data structure that includes the name of the molecule,\nthe predictor, and the CAS number\nAttributes:\n input_file (str): This is the training file that\n is read by the output\n Instance (class): This is a private class which\n structu... | [
[
"sklearn.ensemble.RandomForestClassifier",
"numpy.isnan",
"numpy.median",
"sklearn.preprocessing.Imputer",
"numpy.ndenumerate",
"numpy.array",
"numpy.zeros"
],
[
"numpy.isnan",
"numpy.fill_diagonal"
]
] |
rzhangpku/MFAE | [
"5ced6bcde44645fe52a38b80266fd66f5c41ee2c"
] | [
"elmo_snli.py"
] | [
"\"\"\"\nTrain the ESIM model on the preprocessed SNLI dataset.\n\"\"\"\n# Aurelien Coet, 2018.\n\nfrom utils_elmo import train, validate\nfrom mfae.model_elmo2 import ESIM\nfrom mfae.data import ElmoDataset\nimport torch.nn as nn\nimport matplotlib.pyplot as plt\nimport os\nimport sys\nimport argparse\nimport json... | [
[
"matplotlib.pyplot.legend",
"torch.nn.CrossEntropyLoss",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"matplotlib.pyplot.title",
"torch.load",
"matplotlib.use",
"numpy.random.shuffle",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"torch.cuda.is_available",
"ma... |
indie/ngraph-bridge | [
"a702ee8294d0f24593ad0e9f63fe270a82d9c8b2"
] | [
"test/python/test_ngraph_serialize_flag.py"
] | [
"# ==============================================================================\n# Copyright 2019 Intel Corporation\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# ... | [
[
"tensorflow.placeholder",
"tensorflow.ConfigProto",
"numpy.random.rand",
"tensorflow.Session",
"tensorflow.abs"
]
] |
huzecong/forte | [
"beae4e923c9a6873b582588972e6ec9919079271"
] | [
"forte/models/srl/data.py"
] | [
"import json\nfrom typing import List, NamedTuple, Tuple\n\nimport numpy as np\nimport torch\nfrom mypy_extensions import TypedDict\nimport texar.torch as tx\n\n\nclass SRLSpan(NamedTuple):\n predicate: int\n start: int\n end: int\n label: str\n\n\nclass Span(NamedTuple):\n start: int\n end: int\n... | [
[
"torch.from_numpy",
"torch.tensor"
]
] |
XuchanBao/pytorch-trpo | [
"5e87877ff22c8a1272381f84e37344604a522a1e"
] | [
"logger.py"
] | [
"import os\nimport sys\nimport shutil\nimport os.path as osp\nimport json\nimport time\nimport datetime\nimport tempfile\n\nLOG_OUTPUT_FORMATS = ['stdout', 'log', 'csv']\n# Also valid: json, tensorboard\n\nDEBUG = 10\nINFO = 20\nWARN = 30\nERROR = 40\n\nDISABLED = 50\n\nclass KVWriter(object):\n def writekvs(sel... | [
[
"tensorflow.python.util.compat.as_bytes",
"pandas.read_csv",
"tensorflow.train.summary_iterator",
"pandas.DataFrame"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.