repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
Jintao-Huang/yolov5_PyTorch
[ "8339b45ad420ee632e435e9f34c9bbb80a29691e" ]
[ "utils/detection/trainer.py" ]
[ "# Author: Jintao Huang\n# Time: 2020-6-6\n\nfrom torch.utils.data import DataLoader\nimport torch\n\n\nclass RuntimeErrorHandler:\n def __init__(self, ignore_num):\n self.ignore_num_ori = self.ignore_num = ignore_num\n\n def error(self, e):\n if self.ignore_num > 0:\n print(e, flush=...
[ [ "torch.utils.data.DataLoader", "torch.cuda.empty_cache" ] ]
dnddnjs/feudal-montezuma
[ "c888198f173423575bbc1fec8ef7c86bb36bcb37" ]
[ "dlstm_a2c/env.py" ]
[ "import gym\nimport torch\nimport numpy as np\nfrom copy import deepcopy\nfrom utils import pre_process\nfrom torch.multiprocessing import Process\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\n\nclass EnvWorker(Process):\n def __init__(self, env_name, render, child_conn):\n ...
[ [ "torch.cuda.is_available", "numpy.moveaxis" ] ]
samsniderheld/SpriteGAN
[ "6a6f9f000d155dde6432e04da154e1063c65de74" ]
[ "Training/loss_functions.py" ]
[ "import tensorflow as tf\n\ndef sagan_discriminator_loss(real, fake):\n\n real_loss = tf.reduce_mean(tf.nn.relu(1.0 - real))\n fake_loss = tf.reduce_mean(tf.nn.relu(1.0 + fake))\n\n loss = real_loss + fake_loss\n\n return loss\n\ndef sagan_generator_loss(fake):\n\n fake_loss = -tf.reduce_mean(fake)\n...
[ [ "tensorflow.nn.relu", "tensorflow.reduce_mean" ] ]
NiftyPET/ninst
[ "ecf0ef6016e5a59a49fdfc5bf2a7b09408acd9d8" ]
[ "niftypet/ninst/raw/resources.py" ]
[ "\"\"\"Resources file for NiftyPET NIPET and NIMPA etc.\"\"\"\n__author__ = (\"Pawel J. Markiewicz\", \"Casper O. da Costa-Luis\")\n__copyright__ = \"Copyright 2018-20\"\n\nfrom math import ceil, pi\n\ntry:\n from numpy import array\nexcept ImportError:\n\n def array(x):\n return x\n\n\n# > logging rep...
[ [ "numpy.array" ] ]
k-cybulski/sigman-project
[ "1f51e04dddb375eb58182664296b7b3f1db71756", "1f51e04dddb375eb58182664296b7b3f1db71756" ]
[ "procedures/points_aritmetic.py", "sigman/file_manager.py" ]
[ "import numpy as np\n\nfrom sigman.analyzer import InvalidArgumentError\n\nprocedure_type = 'points'\ndescription = (\n\"\"\"Procedure perform basic math operation on given pare of the points (+-*/), as example:\n y[t] = a[t]+b[t]\n Time is taken from a.\n\"\"\")\nauthor = 'mzylinski'\narguments = {\n 'Oper...
[ [ "numpy.sqrt" ], [ "numpy.correlate", "numpy.argmin" ] ]
mikael-epigram/keras
[ "f9c7402548914120520a7939011c1b376a906e23" ]
[ "keras/layers/recurrent.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v2.nest.map_structure", "tensorflow.compat.v2.compat.v1.executing_eagerly_outside_functions", "tensorflow.compat.v2.executing_eagerly", "tensorflow.compat.v2.nest.is_nested", "tensorflow.python.platform.tf_logging.debug", "tensorflow.compat.v2.shape", "tensorflow.com...
ajgpitch/GPyOpt
[ "3f99f432198b54cf71bdbb350f3d623337c17696" ]
[ "GPyOpt/core/bo.py" ]
[ "# Copyright (c) 2016, the GPyOpt Authors\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\n\nimport GPyOpt\nimport collections\nimport numpy as np\nimport time\nimport csv\n\nfrom ..util.general import best_value, normalize\nfrom ..util.duplicate_manager import DuplicateManager\nfrom ..core.errors impo...
[ [ "numpy.hstack", "numpy.min", "numpy.argmin", "numpy.sum", "numpy.vstack" ] ]
kwilcox/codar_processing
[ "3a327f5378a6a9d78d263c8e7b317088823245c1" ]
[ "codar_processing/src/waves.py" ]
[ "import datetime as dt\nimport pandas as pd\nimport re\nimport xarray as xr\nfrom codar_processing.src.common import CTFParser\n\n\ndef concatenate_waves(wave_list):\n \"\"\"\n This function takes a list of radial files. Loads them all separately using the Wave object and then combines\n them along the tim...
[ [ "pandas.concat" ] ]
pwharned/lime
[ "3d320a0b2d84c230a7c0b7497bfc45a688e227d4" ]
[ "lime/lime_tabular.py" ]
[ "\"\"\"\nFunctions for explaining classifiers that use tabular data (matrices).\n\"\"\"\nimport collections\nimport copy\nfrom functools import partial\nimport json\nimport warnings\n\nimport numpy as np\nimport scipy as sp\nimport sklearn\nimport sklearn.preprocessing\nfrom sklearn.utils import check_random_state\...
[ [ "scipy.sparse.issparse", "numpy.sqrt", "scipy.sparse.isspmatrix_csr", "numpy.tile", "scipy.sparse.csr_matrix", "scipy.stats.distributions.norm", "numpy.transpose", "numpy.exp", "numpy.argsort", "sklearn.preprocessing.StandardScaler", "numpy.array", "numpy.zeros", ...
chuanli11/SynergyNet
[ "a8044d8dabbfb811d4299f59e64e0fb749027e86" ]
[ "artistic.py" ]
[ "import torch\nimport torchvision.transforms as transforms\nimport numpy as np\nimport cv2\nfrom utils.ddfa import ToTensor, Normalize\nfrom model_building import SynergyNet\nfrom utils.inference import crop_img, predict_denseVert\nimport argparse\nimport torch.backends.cudnn as cudnn\ncudnn.benchmark = True\nimpor...
[ [ "numpy.load", "torch.no_grad", "numpy.flip", "torch.load" ] ]
by2101/OpenLAS
[ "0acb30dae98ab89009a919ce86e064c943c51643" ]
[ "src/decoder.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom six.moves import range\nimport attention\nimport math\nfrom loss import cross_entropy, uniform_label_smooth_regulerizer\nimport utils\nfrom utils import get_seq_mask_by_shape, get_seq_mask\n\nimport pdb\n\n\n\nclass RNNDecoder(torch.nn.Modu...
[ [ "torch.nn.Dropout", "torch.nn.functional.log_softmax", "torch.cat", "torch.nn.LSTM", "torch.randn", "torch.nn.ModuleList", "torch.nn.Embedding", "torch.tensor", "torch.nn.Linear" ] ]
Aliang-CN/cogdl
[ "cf594cdb3a97f45333d08c937205d1a691828a33" ]
[ "cogdl/datasets/ogb.py" ]
[ "import os.path as osp\n\nimport torch\n\nfrom ogb.nodeproppred import NodePropPredDataset\nfrom ogb.graphproppred import GraphPropPredDataset\n\nfrom . import register_dataset\nfrom cogdl.data import Dataset, Data, DataLoader\nfrom cogdl.utils import cross_entropy_loss, accuracy, remove_self_loops\n\n\ndef coalesc...
[ [ "torch.full", "torch.zeros", "torch.cat", "torch.tensor", "torch.stack" ] ]
hobogalaxy/ISA
[ "aae4b9b4e30d07a4fe2ddc0900973bf134cc8fda" ]
[ "Python/PPO.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.utils.data import SubsetRandomSampler, BatchSampler\nfrom torch.optim import Adam\nimport wandb\nimport numpy as np\nfrom mlagents_envs.environment import UnityEnvironment\nfrom utils import EnvWrapper, Memory\nfrom models import Actor, Critic\nfrom collections impor...
[ [ "torch.cat", "torch.min", "torch.stack", "torch.tensor", "torch.exp", "torch.FloatTensor", "torch.device", "torch.clamp", "torch.utils.data.BatchSampler", "torch.as_tensor" ] ]
mdiephuis/Berkeley-cs294-112
[ "99559e046b635ca8d229f19ca4ad45c2c02a1c01" ]
[ "hw1/utils.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport torch.nn.functional as F\n\n\n# Model definition\nclass BehaviorClone(nn.Module):\n def __init__(self, input_shape, output_shape):\n super(BehaviorClone, self).__init__()\n self.input_shape = input_shape\n self.output_sh...
[ [ "torch.nn.Dropout", "torch.nn.init.constant_", "torch.nn.Linear", "torch.nn.init.xavier_uniform_", "torch.save" ] ]
natemcintosh/polars
[ "73e5a335d93c1ed85ba661fffeb48a479becb810" ]
[ "py-polars/polars/internals/frame.py" ]
[ "\"\"\"\nModule containing logic related to eager DataFrames\n\"\"\"\nimport os\nimport sys\nfrom datetime import datetime, timedelta\nfrom io import BytesIO, StringIO\nfrom pathlib import Path\nfrom typing import (\n Any,\n BinaryIO,\n Callable,\n Dict,\n Iterable,\n Iterator,\n List,\n Map...
[ [ "numpy.array" ] ]
SkafteNicki/Deep_LMNN
[ "e70b495befdc6f6f1b24029e470c42a3b3821a93" ]
[ "dlmnn/helper/layers.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jun 19 02:40:18 2018\n\n@author: nsde\n\"\"\"\n\n#%% easy access to keras layers\nfrom tensorflow.python.keras.layers import Conv2D\nfrom tensorflow.python.keras.layers import MaxPool2D\nfrom tensorflow.python.keras.layers import Dense \nfrom tensorflow.python.keras....
[ [ "tensorflow.python.keras.layers.Flatten", "tensorflow.python.keras.layers.Dense", "tensorflow.python.keras.layers.LeakyReLU", "tensorflow.python.keras.Sequential", "tensorflow.python.keras.layers.MaxPool2D", "tensorflow.python.keras.layers.Conv2D", "tensorflow.python.keras.backend.l2_n...
yardencsGitHub/tweetynet
[ "281f8876726359a298a2c387c7b4c2e40ac61c91", "281f8876726359a298a2c387c7b4c2e40ac61c91" ]
[ "article/src/scripts/Canaries/eval_without_and_with_output_transforms.py", "article/src/scripts/Bengalese_Finches/behavior/branch_point_stats_source_data.py" ]
[ "# This script is identical to the on for BFSongRepository but with canaries\nfrom collections import defaultdict\nimport json\nfrom pathlib import Path\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom tqdm import tqdm\n\nimport vak.device\nimport vak.files\nfrom vak.l...
[ [ "pandas.concat", "pandas.read_csv", "numpy.arange", "torch.argmax", "torch.utils.data.DataLoader", "numpy.concatenate", "matplotlib.pyplot.plot", "torch.flatten", "pandas.DataFrame.from_records", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ], [ "pandas....
shingkid/data-mining-suicide-sg
[ "fc7dc746d9a4115c9d782222eec92a7d1e5e4a04" ]
[ "scripts/crawl_reddit.py" ]
[ "#!/usr/bin/env python\n\nimport argparse\nimport os\n# import pprint\nimport random\nimport socket\nimport sys\nimport time\n\nimport numpy as np\nimport pandas as pd\nimport praw\nfrom tqdm import tqdm\n\nfrom utility import create_project_dir, file_to_set, get_date\n\n\ndef receive_connection():\n \"\"\"Wait ...
[ [ "pandas.concat", "pandas.read_csv", "pandas.DataFrame" ] ]
huiqun2001/caffe2
[ "97209961b675c8bea3831450ba46c9e8b7bad3de" ]
[ "caffe2/python/operator_test/conv_test.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport collections\nimport functools\n\nimport numpy as np\nfrom hypothesis import assume, given\nimport hypothesis.strategies as st\n\nfrom caffe2.proto import caffe2_pb2\nfrom caffe2.python import br...
[ [ "numpy.square", "numpy.random.seed", "numpy.testing.assert_array_equal", "numpy.random.randn", "numpy.random.rand", "numpy.random.randint" ] ]
shazz/tflearn-experiments
[ "9ed08dbc06c31cb3921b16f3732acad2341e8d0e" ]
[ "cdc/data_importer.py" ]
[ "#\n# CDC BRFSS Extract data importer\n# Load a TSV extract from the BRFSS 2015 Annual Survey\n# https://www.cdc.gov/brfss/annual_data/annual_2015.html\n#\n# Then convert to metric system and clean it\n# Good tutorial on pandas cleaning: https://github.com/jvns/pandas-cookbook/blob/v0.1/cookbook/Chapter%207%20-%20C...
[ [ "numpy.asarray", "numpy.array", "pandas.read_csv", "pandas.Series" ] ]
AodhanSweeney/TLS_diurnal_climatology
[ "c23dc2c49c91b37189077a0791f92bb09bd027d4" ]
[ "era5_tools.py" ]
[ "import numpy as np\nimport pandas as pd\nimport dask.dataframe as dd\n\ndef to_bin_hour(h):\n hour_step = 3\n binned_hour =int((np.floor(h / hour_step) * hour_step)/hour_step)\n return(binned_hour)\n\ndef daily_mean_remover(era_5_df):\n \"\"\"\n Description\n ===========\n Find the diurnal mea...
[ [ "numpy.arange", "pandas.concat", "numpy.floor" ] ]
pygeo/sense
[ "4610fe5247cfba04124a30a7d3db33ea1feb8c80", "4610fe5247cfba04124a30a7d3db33ea1feb8c80" ]
[ "sense/surface/i2em.py", "doc/fig10-11.py" ]
[ "\"\"\"\nimplements the I2EM model (see Ulaby (2014), Chapter 10\nbackscattering model for single scale random surfaces\n\n\nThe code originates from ideas obtained from the supplement\nof Ulaby et al (2014)\n\"\"\"\nfrom . scatter import SurfaceScatter\nimport numpy as np\n\nfrom .. util import f2lam\nfrom .. core...
[ [ "numpy.abs", "numpy.sqrt", "numpy.arange", "numpy.cos", "numpy.sin", "numpy.deg2rad", "numpy.exp", "numpy.zeros", "numpy.sum" ], [ "numpy.linspace", "numpy.deg2rad", "numpy.log10", "matplotlib.pyplot.close", "numpy.array", "matplotlib.pyplot.show", ...
TemugeB/bodypose3d
[ "63b74d4af73445be8e039bfef4fcb5b0c55eb3e2" ]
[ "show_3d_pose.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom utils import DLT\nplt.style.use('seaborn')\n\n\npose_keypoints = np.array([16, 14, 12, 11, 13, 15, 24, 23, 25, 26, 27, 28])\n\ndef read_keypoints(filename):\n fin = open(filename, 'r')\n\n kpts = []\n while(True):\n line = fin.readline()\n ...
[ [ "numpy.array", "matplotlib.pyplot.style.use", "matplotlib.pyplot.pause", "matplotlib.pyplot.figure" ] ]
workproduct/magenta
[ "ba43c3e1a2b3b6a5731fa10a5a6bddd0c821eb84" ]
[ "magenta/models/latent_transfer/sample_dataspace.py" ]
[ "# Copyright 2020 The Magenta Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "numpy.random.seed", "tensorflow.flags.DEFINE_string", "tensorflow.train.replica_device_setter", "tensorflow.global_variables_initializer", "tensorflow.gfile.MakeDirs", "tensorflow.logging.info", "tensorflow.reset_default_graph", "tensorflow.Session", "numpy.random.randn", ...
fredhatt/estimsoundsynth
[ "04ff6697cc0ce329c013382941b1f9839e910114" ]
[ "randtrend.py" ]
[ "import numpy as np\nfrom ssynth import *\n\n# 1. Establish the overall trend (volume)\n\nendtime = 120 # seconds\ndt = 1 # seconds\nt = np.linspace(0, endtime, float(endtime)/dt)\ntrend = np.sin(t*50) + t/15 + np.sin(t*250)\ntrend /= np.max(trend)\ntrend *= 32767\n\n# 2. Establish the frequencies\n\nminF = 15\nmax...
[ [ "numpy.sin", "numpy.max", "numpy.append", "numpy.random.randn", "numpy.random.rand", "numpy.zeros", "numpy.random.randint" ] ]
waitxxxx/TecoGAN-PyTorch
[ "15d87000ed35d2037317144f54fa0e3d64f34e2f", "15d87000ed35d2037317144f54fa0e3d64f34e2f" ]
[ "codes/data/paired_folder_dataset.py", "codes/metrics/model_summary.py" ]
[ "import os\nimport os.path as osp\n\nimport cv2\nimport numpy as np\nimport torch\n\nfrom .base_dataset import BaseDataset\nfrom utils.base_utils import retrieve_files\n\n\nclass PairedFolderDataset(BaseDataset):\n def __init__(self, data_opt, **kwargs):\n \"\"\" Folder dataset for paired data. It support...
[ [ "numpy.ascontiguousarray", "numpy.stack" ], [ "torch.no_grad" ] ]
arghdos/SPyJac-paper
[ "7f65253a3acd3a93141e673c2cdd5810ecc6a0ca" ]
[ "scripts/source_term_error.py" ]
[ "import os\nimport numpy as np\nfrom load_error_files import print_error\n\nrtol = 1e-6\natol = 1e-10\n\n\ndef updater(err_dict, err, filename=None, mech_info={}):\n def __get_size(name):\n if 'rop' in name:\n if 'net' in name or 'fwd' in name:\n return mech_info['n_reactions']\n...
[ [ "numpy.maximum", "numpy.abs", "numpy.isnan", "numpy.linalg.norm", "numpy.any", "numpy.where" ] ]
skadio/mabwiser
[ "1589b771d95e65540f0b42c7112e32e227adf7b2" ]
[ "tests/test_mab.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport pandas as pd\n\nfrom sklearn.preprocessing import StandardScaler\n\nfrom mabwiser.mab import MAB, LearningPolicy, NeighborhoodPolicy\nfrom tests.test_base import BaseTest\n\n\nclass MABTest(BaseTest):\n\n #################################################\n ...
[ [ "pandas.Series", "pandas.DataFrame", "numpy.ndim", "numpy.array", "numpy.random.RandomState" ] ]
mneeleman/xastropy
[ "790aebfbc5cd26d43281bb70dec6bc63007dbb87" ]
[ "xastropy/stats/basic.py" ]
[ "\"\"\"\n#;+ \n#; NAME:\n#; stats.basic\n#; Version 1.0\n#;\n#; PURPOSE:\n#; Module for basic stat calculations\n#; 04-Dec-2014 by JXP\n#;-\n#;------------------------------------------------------------------------------\n\"\"\"\nfrom __future__ import print_function, absolute_import, division, unicode_lit...
[ [ "scipy.stats.chi2.ppf", "numpy.log", "numpy.sqrt", "scipy.stats.norm.cdf", "numpy.min", "numpy.arange", "numpy.sort", "numpy.max", "scipy.interpolate.interp1d", "numpy.log10", "numpy.zeros" ] ]
lanSeFangZhou/tokenizer_tools
[ "edd931ae86a6e381b57e50f8b59ae19d3151d26b" ]
[ "tokenizer_tools/hooks.py" ]
[ "import pandas as pd\nimport tensorflow as tf\n\n\nclass TensorObserveHook(tf.train.SessionRunHook):\n def __init__(self, d1_mapping=None, d2_mapping=None, d2_mapper=None):\n self.d1_mapping = {} if not d1_mapping else d1_mapping\n self.d2_mapping = {} if not d2_mapping else d2_mapping\n sel...
[ [ "tensorflow.train.SessionRunArgs", "pandas.DataFrame" ] ]
david8862/yolact
[ "dbfb1006c9b658fc01b6afc79b06d095ff64e7d7" ]
[ "utils/functions.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport torch\nimport torch.nn as nn\nimport os\nimport math\nfrom collections import deque\nfrom pathlib import Path\nfrom layers.interpolate import InterpolateModule\n\nclass MovingAverage():\n \"\"\" Keeps an average window of the specified number of items. \"\...
[ [ "torch.nn.Sequential", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.ConvTranspose2d" ] ]
yatbear/cv
[ "abff7fd64f141eef7c222c16885c8200b7dd18d0" ]
[ "recognizer/p8.py" ]
[ "#!usr/bin/env python\n\n# EN.600.661 HW #1 \n#\n# Usage: python [files]\n#\n# Detect end-points of line segments\n#\n# Author: yatbear <sapphirejyt@gmail.com>\n# 2015-09-21\n\nfrom __future__ import division\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\n\ndef p8(image_in, hough_image_i...
[ [ "matplotlib.pyplot.imshow", "numpy.sqrt", "numpy.linspace", "numpy.arange", "numpy.cos", "numpy.sin", "matplotlib.pyplot.axis", "matplotlib.pyplot.show", "numpy.where" ] ]
diegotg2000/DiegoTorres_Ejercicio20
[ "9b95b23788740c7703267bc115297338e25a7962" ]
[ "complejo.py" ]
[ "import numpy as np\r\n\r\nclass Complejo:\r\n def __init__(self,x,y):\r\n self.real=x\r\n self.imaginario=y\r\n self.norma=np.sqrt(x**2+y**2)\r\n def conjugado(self):\r\n self.imaginario=-self.imaginario\r\n def calcula_norma(self):\r\n return self.norma\r\n def multi...
[ [ "numpy.sqrt" ] ]
TimothyChen225/AFC-X
[ "901a0019b7c153804570c480c3da4825776dbf02" ]
[ "feature.py" ]
[ "from collections import Counter\r\n\r\nfrom Bio import SeqIO\r\n\r\nimport numpy as np\r\n\r\nimport warnings\r\nimport math\r\n\r\nwarnings.filterwarnings(action='ignore', category=UserWarning, module='gensim')\r\nfrom gensim.models import Word2Vec\r\n\r\nMax_length = 100 # maximum length of used peptides\r\n\r\...
[ [ "numpy.std", "numpy.mean" ] ]
7enTropy7/Rummy_RL
[ "0b2123672f3979bb9de15d204d6d8cf52271958a" ]
[ "Rummy PPO/model.py" ]
[ "import os\nimport numpy as np\nimport torch as T\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.distributions.categorical import Categorical\n\nclass PPOMemory:\n def __init__(self, batch_size):\n self.states = []\n self.probs = []\n self.vals = []\n self.actions = [...
[ [ "torch.distributions.categorical.Categorical", "torch.nn.Softmax", "torch.clamp", "torch.load", "numpy.arange", "torch.min", "numpy.random.shuffle", "torch.tensor", "torch.nn.Linear", "torch.cuda.is_available", "torch.nn.ReLU", "numpy.array", "torch.squeeze" ]...
Willsparker/UniProjects
[ "5fffc656e78b45db0506e42f4ba5c4211d1b9399" ]
[ "Visual_Intelligence/Kinect_Object_Recognition/VI-2020-21-Python_Package/confusionMatrix.py" ]
[ "import matplotlib.pyplot as plt\nimport seaborn as sn\nimport pandas as pd\nfrom sklearn.metrics import confusion_matrix\n\ntruth = [\"Camera\",\"Dog\",\"Android\",\"Baby\",\"Keyboard\",\"Dinosaur\",\"Dragon\",\"Bunny\",\"Blackberry\",\"Diet Coke Bottle\",\"Coffee Tin\",\"Car\",\"Mug\",\"Koala\",\"Mug\"] \nlabels ...
[ [ "matplotlib.pyplot.show", "sklearn.metrics.confusion_matrix", "matplotlib.pyplot.figure" ] ]
Dongwon-Shin/2018-2nd-Algorithm
[ "b063f678bd723b82fab5797af479dee5f0f641ed" ]
[ "Python/nparray.py" ]
[ "import numpy as np\nstocks = np.array([140.49, 0.97, 40.68, 41.53, 55.7,57.21, 98.2, 99.19, 109.96, 111.47, 35.71, 36.27, 87.85, 89.11, 30.22, 30.91]) \nstocks\n\nstocks = stocks.reshape(8, 2).T\nstocks\n\nsap = np.array([\"MMM\", \"ABT\", \"ABBV\", \"ACN\", \"ACE\", \"ATVI\", \"ADBE\", \"ADT\"])\nsap" ]
[ [ "numpy.array" ] ]
aayushidwivedi01/spark-tk-old
[ "fcf25f86498ac416cce77de0db4cf0aa503d20ac" ]
[ "regression-tests/sparktkregtests/testcases/dicom/inspect_dicom_test.py" ]
[ "# vim: set encoding=utf-8\n\n# Copyright (c) 2016 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#       http://www.apache.org/licenses/LICENSE-2.0\n#\n...
[ [ "numpy.testing.assert_equal" ] ]
hadim/torchani
[ "29606ef95c046488752706c3caaddc66ce846dc2" ]
[ "torchani/aev.py" ]
[ "import torch\nfrom torch import Tensor\nimport math\nfrom typing import Tuple, Optional, NamedTuple\nimport sys\n\nif sys.version_info[:2] < (3, 7):\n class FakeFinal:\n def __getitem__(self, x):\n return x\n Final = FakeFinal()\nelse:\n from torch.jit import Final\n\n\nclass SpeciesAEV(...
[ [ "torch.ceil", "torch.zeros", "torch.cat", "torch.zeros_like", "torch.eye", "torch.exp", "torch.repeat_interleave", "torch.acos", "torch.tril_indices", "torch.unique_consecutive", "torch.triu_indices", "torch.arange", "torch.where", "torch.cartesian_prod", ...
Lowe-Institute/data-automation
[ "10d8ec7729eff6e7702a367ff5bae2a871069799" ]
[ "lowe/acs/ACSClient.py" ]
[ "import asyncio\nimport aiohttp\nimport backoff\nimport json\nimport os\nimport pandas as pd\nimport requests\n\nfrom dotenv import load_dotenv, find_dotenv\nfrom lowe.locations.lookup import name2fips, fips2name\nfrom typing import Union, List, Dict\n\ntry:\n import importlib.resources as pkg_resources\nexcept ...
[ [ "pandas.concat", "pandas.DataFrame" ] ]
FLY-CODE77/opencv
[ "5644e6c1ef43d81efb54ccde6c06f1adf000fb96" ]
[ "TIL/gradient_edge.py" ]
[ "# edge 검출 with gradient 크기를 사용 \n\nimport sys\nimport numpy as np\nimport cv2\n\nsrc = cv2.imread('HappyFish.jpg', cv2.IMREAD_GRAYSCALE)\n\nif src is None:\n print('error')\n sys.exit()\n\nkernel = np.array([[-1, 0 , 1], [-2,0,2], [-1,0,1]], dtype = np.float32)\n\n# sobel 안쓰고!\ndx = cv2.filter2D(src, cv2.CV_...
[ [ "numpy.array", "numpy.zeros", "numpy.clip" ] ]
Azure/LearnAI-CustomComputerVisionwithAML
[ "ce78cc0176ddc69b8857e603dd334e7732b2e1cc" ]
[ "lab02.4-deployment/resources/score_aml.py" ]
[ "import base64\nimport json\nimport numpy as np\nimport requests\nimport sys, traceback\nimport timeit\nfrom io import BytesIO\nfrom PIL import Image\n\"\"\"\nSample script to score a published AML webservice directly on test images.\n\"\"\"\n\ndef get_class(class_index):\n class_map = dict()\n class_map[0] =...
[ [ "numpy.array" ] ]
52North/MariDataHarvest
[ "e8bed1802ed19fb242d10d0e592cd6dde4c54544" ]
[ "EnvironmentalData/env_data_validator.py" ]
[ "import logging\nimport random\nimport sys\nimport pandas as pd\nfrom sklearn.metrics.pairwise import cosine_similarity\nfrom utilities import helper_functions\nfrom EnvironmentalData.weather import get_GFS, get_global_wave, get_global_phy_daily, get_global_wind, select_grid_point\n\nlogger = logging.getLogger(__na...
[ [ "pandas.read_csv", "sklearn.metrics.pairwise.cosine_similarity" ] ]
egorzakharov/pytorch3d
[ "ef21a6f6aaeae499f60af9eb3e57ba41040aac11" ]
[ "pytorch3d/io/obj_io.py" ]
[ "# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n#\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.\n\n\n\"\"\"This module implements utility functions for loading and saving meshes.\"\"\"\nimport os\nim...
[ [ "torch.any", "numpy.array", "torch.is_tensor", "torch.tensor" ] ]
fpsawicki/MLOps_Transformers
[ "988c73cd8d2d9b0f58c2a7d9ee03cdf12983c547" ]
[ "src/models/lightning/train_model_lit.py" ]
[ "import pytorch_lightning as pl\nimport torch\nfrom pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint\nfrom pytorch_lightning.loggers import WandbLogger\n\nfrom src.data.make_dataset_lit_wrapper import DBPediaDataModule\nfrom src.models.lightning.model_wrapper_lit import LightningTextNet\nfrom src.p...
[ [ "torch.cuda.is_available" ] ]
HuynhThanhQuan/graph-network
[ "e429a641e7baecad9765700cac580cfbdedbe1bd" ]
[ "core/graph_evaluation.py" ]
[ "import pandas as pd\nfrom graph import util\nfrom graph.core import constraint\n\n\nclass Evaluation:\n def __init__(self, graph_parser):\n self.graph_parser = graph_parser\n self.num_error_logs = 0\n self.num_unique_stacktrace = 0\n self.percent_unique_stacktrace = 0\n self.u...
[ [ "pandas.Series" ] ]
schottkey7/deep-reinforcement-learning
[ "92c97fadbb5b95caa3fd3813a0757debc2c2747a" ]
[ "p1_navigation/train.py" ]
[ "from unityagents import UnityEnvironment\nfrom collections import namedtuple, deque\nfrom time import time\n\nfrom model import QNetwork\nfrom agent import Agent\n\nimport numpy as np\nimport random\n\nimport matplotlib.pyplot as plt\n\nimport torch\n\n\ndef train(\n env,\n agent,\n brain_name,\n n_epi...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "numpy.mean", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
micahprice/codenames_ai
[ "97176d584b908ea44410fd29c62770703377c9d4" ]
[ "operative.py" ]
[ "import numpy as np\nimport pandas as pd\nimport tensorflow as tf\nfrom sklearn.neighbors import NearestNeighbors\nfrom itertools import permutations\n\nclass OperativeAI:\n\n def __init__(self, embed_module, game_words=None, metric='cosine',):\n self.embed_module = embed_module\n self.metric = met...
[ [ "pandas.DataFrame", "tensorflow.global_variables_initializer", "sklearn.neighbors.NearestNeighbors", "tensorflow.Session", "numpy.array", "tensorflow.tables_initializer" ] ]
FlyingQianMM/models
[ "1fac32c8062dfeaf8e2f69bcaed63bdadff69303" ]
[ "PaddleCV/PaddleDetection/tools/train.py" ]
[ "# Copyright (c) 2019 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.array", "numpy.mean", "numpy.random.seed" ] ]
j-scharrenbach/Trajectron-plus-plus
[ "37040ca6e3f386c80ab39fbb4aa9984915c94813" ]
[ "trajectron/visualization/visualization.py" ]
[ "from utils import prediction_output_to_trajectories\nfrom scipy import linalg\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\nimport matplotlib.patheffects as pe\nimport numpy as np\nimport seaborn as sns\n\n\ndef plot_trajectories(ax,\n prediction_dict,\n ...
[ [ "matplotlib.patheffects.Normal", "matplotlib.patches.Ellipse", "numpy.sqrt", "numpy.arctan", "numpy.random.choice", "numpy.isnan", "matplotlib.pyplot.Circle", "scipy.linalg.eigh", "scipy.linalg.norm", "matplotlib.patheffects.Stroke" ] ]
theowu23451/DRAM
[ "5e64e9527dc692ef31049a94fb9861f2038e219c" ]
[ "model/datasets.py" ]
[ "import os\nimport posixpath\nimport utils\nimport struct\n\nfrom PIL import Image\nimport numpy as np\nimport tensorflow as tf\n\nfrom config import Config\n\nclass MNIST(object):\n \"\"\"\n Object to download and unzip MNIST dataset\n to local destination. \n\n Call with get_dataset(), returning train...
[ [ "numpy.fromfile", "tensorflow.constant", "tensorflow.read_file", "tensorflow.image.resize_images", "tensorflow.data.Dataset.from_tensor_slices", "numpy.arange", "numpy.random.permutation", "numpy.zeros", "tensorflow.image.decode_jpeg" ] ]
Sharabesh/trading
[ "6b58fd675c539818bd89b4a311f6b4a8b7953ccf" ]
[ "backend/trading/dividends.py" ]
[ "from config import *\n\npolygon = api.polygon\n\nimport pandas as pd\nimport numpy as np\nfrom datetime import datetime, timedelta\nimport calendar\n\n\ndef fetch_dividends(sym):\n \"\"\"Given a symbol returns a dataframe of dividends\"\"\"\n symbol_dividends = polygon.dividends(sym)\n fields = ['amount',...
[ [ "pandas.merge", "pandas.read_csv", "pandas.to_datetime", "pandas.read_html", "pandas.DataFrame.from_dict" ] ]
raketenolli/scipy
[ "ecad19c6d82fc9a7fa53a9d63bd5e2c532763aae" ]
[ "scipy/stats/tests/test_distributions.py" ]
[ "\"\"\" Test functions for stats module\n\n\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\nimport warnings\nimport re\nimport sys\nimport pickle\nimport os\n\nfrom numpy.testing import (assert_equal, assert_array_equal,\n assert_almost_equal, assert_array_almost...
[ [ "scipy.stats.norm.ppf", "scipy.stats.bernoulli.logpmf", "numpy.sqrt", "scipy.stats.crystalball.cdf", "scipy.stats.hypergeom.logsf", "numpy.all", "scipy.stats.genpareto.ppf", "scipy.stats.gengamma.pdf", "scipy.stats.weibull_max.logsf", "scipy.stats.norm.expect", "scipy.s...
FlowAnalysis/RL_MemoryAllocation
[ "e1145b3ad1ba0db6f6ca5260ff9e0c687e4881f2" ]
[ "sim/a3c.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport tflearn\n\n\nGAMMA = 0.99\nA_DIM = 6\nENTROPY_WEIGHT = 0.5\nENTROPY_EPS = 1e-6\nS_INFO = 4\n\n\nclass ActorNetwork(object):\n \"\"\"\n Input to the network is the state, output is the distribution\n of all actions.\n \"\"\"\n def __init__(self, ses...
[ [ "numpy.log", "tensorflow.multiply", "tensorflow.summary.scalar", "tensorflow.Variable", "tensorflow.train.RMSPropOptimizer", "tensorflow.get_collection", "tensorflow.gradients", "tensorflow.placeholder", "tensorflow.subtract", "tensorflow.summary.merge_all", "tensorflow...
duhnoo/FinalProject
[ "b28a16ad44fa4541381daa8168c3b9adf09bc5dd" ]
[ "FinalProject.py" ]
[ "'''\nDate: 04/28/2021\nSection: 3\nFile: D'AnnolfoFinalProject.py\nDescription:\nThis program uses StreamlitUI and other tools to create a dynamic web application that\nillustrates a heat map and bar chart based on a CSV dataset. This is the final project.\nI pledge that I have completed this programming assignmen...
[ [ "pandas.read_csv", "pandas.to_datetime", "matplotlib.pyplot.title", "matplotlib.pyplot.bar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel" ] ]
rit-ai/ritai-bot
[ "cf80d06d6778a83336281c9fd9aa79ec9fc94daa" ]
[ "bot/skill/joke/deepjoke.py" ]
[ "# TODO\n# http://arno.uvt.nl/show.cgi?fid=144631\n# https://arxiv.org/abs/1806.04510\n#\n# Code based on:\n# machinelearningmastery.com/text-generation-lstm-recurrent-neural-networks-python-keras/\n\n\nimport os\nimport re\nimport sys\nimport keras\nimport pickle\nimport numpy as np\n\nSEQUENCE_LENGTH = 1 * 10**3\...
[ [ "numpy.reshape" ] ]
sgibson91/johnny-decimal
[ "07733e6b71ad0e2795d7a012c135db92112a2df1" ]
[ "03-move-files.py" ]
[ "import argparse\nimport glob\nimport os\nimport shutil\nimport sys\n\nimport pandas as pd\n\n\ndef parse_args(args: list):\n parser = argparse.ArgumentParser(\n description=\"Move files into a Johnny Decimal folder structure from a list of categorised files\"\n )\n\n parser.add_argument(\n \...
[ [ "pandas.read_csv" ] ]
lidingGK/AnyNet
[ "78a7e85ef482197b8668246d4f446f121f4c55ff" ]
[ "models/cspn.py" ]
[ "import torch.nn as nn\nimport torch\n\nimport torch.nn.functional as F\n\nclass Affinity_Propagate(nn.Module):\n\n def __init__(self,\n prop_time,\n prop_kernel=3,\n norm_type='8sum'):\n \"\"\"\n Inputs:\n prop_time: how many steps for CSP...
[ [ "torch.abs", "torch.div", "torch.nn.Parameter", "torch.ones", "torch.add", "torch.max", "torch.cat", "torch.zeros", "torch.from_numpy", "torch.nn.Conv3d", "torch.nn.ZeroPad2d" ] ]
Ji-Xinyou/DIP-proj-DepthEstimation
[ "5432c14ce1d0cdc9b8b6ab0a273678ffbe6086bd" ]
[ "model/Res_Unet/modules.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport torchvision.models as models\nimport torch.utils.model_zoo as model_zoo\nimport math\n\nclass Conv_Norm_ReLU(nn.Module):\n '''\n Conbination of Conv -> BN -> Leaky_ReLu\n Args:\n inp: inplane\n ...
[ [ "torch.nn.Sequential", "torch.nn.ConvTranspose2d", "torch.cat", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.Linear", "torch.nn.Upsample", "torch.nn.LeakyReLU", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.utils.model_zoo.load_url", ...
yangapku/models
[ "b50bc7b77288bcdaed676e70353310786c658d6e" ]
[ "PaddleCV/ocr_recognition/train.py" ]
[ "# Copyright (c) 2018 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 ...
[ [ "numpy.divide", "numpy.array", "numpy.average", "numpy.percentile" ] ]
raynalee4/models
[ "ae524736fe2c2786394c8e63b0f81f8edc5e4395" ]
[ "models/image_recognition/tensorflow/inception_resnet_v2/preprocessing.py" ]
[ "#\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2018 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unle...
[ [ "tensorflow.contrib.data.python.ops.batching.map_and_batch", "tensorflow.concat", "tensorflow.FixedLenFeature", "tensorflow.image.random_contrast", "tensorflow.cast", "tensorflow.equal", "tensorflow.image.random_saturation", "tensorflow.image.central_crop", "tensorflow.image.ra...
alfa-bravo/ekstrakto
[ "de2dc38815f9e8657b401fc71b9c54fa16b849c7" ]
[ "ekstrakto/helpers.py" ]
[ "\"\"\"\nAuthor: Vincent Brubaker-Gianakos\n\"\"\"\n\nimport numpy as np\nimport kdtree\n\n\ndef get_normalized_pixel_data(image, channel_bit_depth):\n return np.array(image.getdata()) / ((2 ** channel_bit_depth) - 1)\n\n\ndef progressive_peak_find(h, distinctness=1.0):\n array = sorted(np.ndenumerate(h), key...
[ [ "numpy.linspace", "numpy.clip", "numpy.arange", "numpy.histogramdd", "numpy.ndenumerate", "numpy.array" ] ]
BM-K/transformer_pytorch
[ "1ff84ae43a7134dc549312655c5058ec723ff44c" ]
[ "translate.py" ]
[ "''' Translate input text with trained model. '''\n\nimport torch\nimport argparse\nimport dill as pickle\nfrom tqdm import tqdm\n\nimport transformer.Constants as Constants\nfrom torchtext.data import Dataset\nfrom transformer.Models import Transformer\nfrom transformer.Translator import Translator\n\n# model 불러오기...
[ [ "torch.device", "torch.LongTensor", "torch.load" ] ]
mwusdv/CarND-Traffic-Sign-Classifier-Project
[ "6ce73639ebebad26bb8f6d10ea2478d03ec0a7b8" ]
[ "report_utils.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Mar 15 00:03:21 2019\n\n@author: mingrui\n\"\"\"\n\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\n\nfrom experiment_pipeline import ExperimentParam\nimport utils\n\ndef hist_eq(img):\n # histogram equalization\n n_rows...
[ [ "numpy.random.choice", "numpy.copy", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.show", "numpy.where", "matplotlib.pyplot.figure" ] ]
gchhablani/MLRC-2020-Towards-Interpreting-BERT-for-RCQA
[ "5ffc36f3b03ab0fe64fe5e6fffeddc9d3afe2baf" ]
[ "run_integrated_gradients.py" ]
[ "\"\"\"\nScript to run integrated gradients on SQuAD or DuoRC\n\nThis script uses datasets, captum, omegaconf and transformers libraries.\nPlease install them in order to run this script.\n\nUsage:\n $python run_integrated_gradients.py --config ./configs/integrated_gradients/squad.yaml\n\n\"\"\"\nimport os\nimpo...
[ [ "pandas.read_json" ] ]
clarkyu2016/machine-learning-nanodegree
[ "44d4afe83d57f6fabd1ec6db1db173eae94a8869" ]
[ "Reports/P6 Capstone/Rossmann Sales/data_processing.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom datetime import datetime, timedelta\n\ntrain = pd.read_csv('train.csv')\ntest = pd.read_csv('test.csv')\nstore = pd.read_csv('store.csv')\n\n#1、去除销量中的极值,由于无法估计极值对结果的影响,所以拟合模型的时候可以进行两次,去除极值和未去除极值\n#再试一下标准差标准误差\ndef rm_outliers(df): \n q1 = np.percentile(df['Sales'], ...
[ [ "pandas.read_csv", "pandas.to_datetime", "numpy.percentile" ] ]
Vishal-Bhatia/dsmp-pre-work
[ "48f23464fd7775008999735d38321aadb13a0676" ]
[ "Data-Science-Course-Prep---4/code.py" ]
[ "# --------------\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# code starts here\n##Using read.csv() to load the data onto a dataframe variable\ndf = pd.read_csv(path)\n\n##Computing the probability that the FICO score is above 700\ndf1 = df[df.fico > 700]\np_a = len(df1)/len(df)\n\...
[ [ "pandas.read_csv" ] ]
scaramagus/synthingie
[ "efbc11e199e9489f3c8d979b576ef9415cf70a1c" ]
[ "tests/test_core.py" ]
[ "import os\n\nimport numpy as np\nimport pytest\n\nfrom synthingie.core import Module, Audio\n\n\nSAMPLERATE = 48000\nFRAMESIZE = 1024\n\n\n@pytest.fixture\ndef module():\n return Module(SAMPLERATE, FRAMESIZE)\n\n\ndef test_render(module):\n zero = module.value(0)\n duration = 10.05\n audio = module.ren...
[ [ "numpy.all", "numpy.zeros" ] ]
mhyzy155/02456DeepLearningObjDet
[ "efd49590dad6c60654ceb532ee0b10d1d5093db2" ]
[ "ColaBeerDataset.py" ]
[ "import os\r\nimport numpy as np\r\nimport torch\r\nimport xml.etree.ElementTree as ET\r\nfrom PIL import Image\r\n\r\n\r\nclass ColaBeerDataset(torch.utils.data.Dataset):\r\n def __init__(self, root, transforms=None):\r\n self.root = root\r\n self.transforms = transforms\r\n # load all imag...
[ [ "torch.as_tensor", "torch.zeros", "torch.tensor" ] ]
zhu-edward/DGSQP
[ "b907d961f292695e4cddbc1266313e0e1030c4f0" ]
[ "DGSQP/solvers/ALGAMES.py" ]
[ "#!/usr/bin python3\n\nimport numpy as np\nimport scipy as sp\nimport casadi as ca\n\nimport pathlib\nimport os\nimport copy\nimport shutil\nimport pdb\nfrom datetime import datetime\n\nimport matplotlib\nimport matplotlib.pyplot as plt\n\nfrom typing import List, Dict\n\nfrom DGSQP.types import VehicleState, Vehic...
[ [ "numpy.sum", "matplotlib.use", "numpy.arange", "numpy.linalg.norm", "matplotlib.pyplot.ioff", "matplotlib.pyplot.ion", "numpy.zeros", "numpy.where", "numpy.vstack", "matplotlib.pyplot.figure" ] ]
Angus1996/HuaweiCloud_AI_Competition2019
[ "08f4a262a7563bc26561acae8bfe3b41aab9af6b" ]
[ "using_pretrainedmodels_package/SENet154/src/prepare_data.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n数据集准备脚本\n\"\"\"\nimport os\nimport codecs\nimport shutil\ntry:\n import moxing as mox\nexcept:\n print('not use moxing')\nfrom glob import glob\nfrom sklearn.model_selection import StratifiedShuffleSplit\n\n\ndef prepare_data_on_modelarts(args):\n \"\"\"\n 如果数据集存储在OBS,则...
[ [ "sklearn.model_selection.StratifiedShuffleSplit" ] ]
indigoLovee/TD3
[ "0e86a40c27ec376b52e9f8e0e70db28e7411276b" ]
[ "networks.py" ]
[ "import torch as T\nimport torch.nn as nn\nimport torch.optim as optim\n\ndevice = T.device(\"cuda:0\" if T.cuda.is_available() else \"cpu\")\n\n\nclass ActorNetwork(nn.Module):\n def __init__(self, alpha, state_dim, action_dim, fc1_dim, fc2_dim):\n super(ActorNetwork, self).__init__()\n self.fc1 =...
[ [ "torch.load", "torch.cat", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.cuda.is_available" ] ]
Charlottez112/ovito-scripts
[ "3c677ccd6edbf7602c802f8fa67524c15b0cea0c" ]
[ "freud/overlay_DiffractionPattern.py" ]
[ "# Copyright (c) 2021 The Regents of the University of Michigan\n# All rights reserved.\n# This software is licensed under the BSD 3-Clause License.\n\nimport numpy as np\nimport PySide2.QtGui\nimport rowan\n\nimport freud\n\nprint(\"Diffraction, freud version\", freud.__version__)\n\n\ndef render(\n args, grid_...
[ [ "numpy.max" ] ]
mengbingrock/trt-samples-for-hackathon-cn
[ "bf0e6379c358a72ea96093ec41fa1b1b9275feaf" ]
[ "python/app_onnx_resnet50.py" ]
[ "#\n# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "torch.onnx.export", "torch.cuda.synchronize", "numpy.abs", "torch.manual_seed", "torch.randn", "numpy.zeros" ] ]
shweta-29/Forbes_Companies_Sustainability
[ "3db3c2127b13c5e355a3c10b1ef3b8ba31fb64d5", "3db3c2127b13c5e355a3c10b1ef3b8ba31fb64d5" ]
[ "ESGmetrics/msci.py", "ESGmetrics/csrhub.py" ]
[ "\"\"\"\nMSCI website Scrape\n\nThis script allows the user to scrape the companies' ESG ratings from the MSCI\nwebsite. Website link:\n\"https://www.msci.com/our-solutions/esg-investing/esg-ratings/esg-ratings-corporate-search-tool/\"\n\nThis tool accepts Company's names list in comma separated value\nfile (.csv) ...
[ [ "pandas.read_csv" ], [ "pandas.read_csv" ] ]
ananyak100-dev/Transformer-Explainability
[ "75b5f34276f9a840f98df8a87c3387fa55147acf" ]
[ "philly_exp/ViT/perturbationMetricsNew.py" ]
[ "import os\n# os.chdir(f'./Transformer-Explainability')\n#\n# !pip install -r requirements.txt\n\nfrom PIL import Image\nimport torchvision\nimport torchvision.transforms as transforms\nimport matplotlib.pyplot as plt\nimport torch\nimport numpy as np\n\nmodels = ['DINO/DINO_Small Perturbations', 'DeiT/DeiT_Small P...
[ [ "sklearn.metrics.auc", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "numpy.std", "numpy.mean", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
Isaac-W/vision-measurement
[ "0133a135c0a40785975eb3b433ad570f31ed88e0" ]
[ "test.py" ]
[ "import peakutils\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n'''\ndata = [-0.15238721652,\n 0.226482259955,\n 0.526641892155,\n 0.590276999704,\n 0.391593530271,\n 0.149487519326,\n -0.0464324239059,\n -0.214412432486,\n -0.399365551117,\n ...
[ [ "matplotlib.pyplot.plot", "numpy.array", "matplotlib.pyplot.show" ] ]
kennethwdk/PINet
[ "3a0abbd653146c56e39612384891c94c3fb49b35" ]
[ "lib/core/trainer.py" ]
[ "import logging\nimport time\nimport torch\n\nfrom loss.heatmaploss import HeatmapLoss\nfrom loss.offsetloss import OffsetLoss\nfrom loss.refineloss import RefineLoss\n\nclass Trainer(object):\n def __init__(self, cfg, model, rank, output_dir):\n self.model = model\n self.output_dir = output_dir\n ...
[ [ "torch.max", "torch.arange", "torch.cat" ] ]
Kishan-07/Hexagonal-Flow-Patterns-in-RBC
[ "421fc2e9c42c779b6f918e41d4443cbb080a0a3c" ]
[ "hex.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nimport matplotlib.colors as colors\n\n# Function that returns the time derivative of all the seven modes. Input requires an array of the modes values in the following order: [U011, U111, U122, T011, T111, T122, T002].\ndef f(x):\n ...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.yticks", "matplotlib.pyplot.legend", "numpy.sqrt", "numpy.linspace", "numpy.meshgrid", "numpy.abs", "numpy.cos", "matplotlib.pyplot.savefig", "numpy.sin", "matplotlib.pyplot.plot", "matplotlib.pyplot.colorbar", "matplo...
CRitter93/beehyve
[ "8e21dda571cfecb8ec903b8db79e200d744806a2" ]
[ "beehyve/steps.py" ]
[ "from ast import literal_eval\nfrom typing import Any, Dict, Tuple\n\nimport pandas as pd\nfrom behave import given, register_type, then, when\nfrom behave.runner import Context\nfrom behave_pandas import table_to_dataframe\n\nfrom beehyve import types\nfrom beehyve.functions import add_var, get_var, raises_error, ...
[ [ "pandas.read_csv" ] ]
svip-lab/IVOS-W
[ "4b66f14e140d395107ba95a343b1d4fe25b6751d" ]
[ "utils/config_manet/config.py" ]
[ "import torch\nimport argparse\nimport os\nimport sys\nimport cv2\nimport time\n\ndef str2bool(v):\n if isinstance(v, bool):\n return v\n if v.lower() in ('yes', 'true', 't', 'y', '1'):\n return True\n elif v.lower() in ('no', 'false', 'f', 'n', '0'):\n return False\n else:\n ...
[ [ "torch.cuda.is_available" ] ]
Vrushank264/Averting-from-CNNs
[ "b04b65a09394849771c1943bbb9fe840767d296a" ]
[ "Involution/InvNet.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nfrom Involution import Involution2D\r\nfrom torchsummary import summary\r\nfrom typing import Union, Tuple, Optional\r\n\r\nclass Bottleneck(nn.Module):\r\n \r\n def __init__(self,\r\n in_channels: int,\r\n out_channels: int,\r\n ...
[ [ "torch.nn.Sequential", "torch.nn.Dropout2d", "torch.nn.init.constant_", "torch.randn", "torch.nn.Conv2d", "torch.flatten", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.AdaptiveAvgPool2d", "torch.nn.BatchNorm2d", "torch.device", "torch...
StructuralNeurobiologyLab/LightConvPoint
[ "3f353f45e9e910fa390a74520dfd478e3e88f104" ]
[ "lightconvpoint/networks/convpoint.py" ]
[ "import torch\nimport torch.nn as nn\nimport lightconvpoint.nn as lcp_nn\n\n# This mdoels for classification and segmentation\n# are inspired from ConvPoint\n# https://github.com/aboulch/ConvPoint\n\n\nclass ConvPointCls(nn.Module):\n \"\"\"ConvPoint classification network.\n\n Network inspired from the KPCon...
[ [ "torch.nn.BatchNorm1d", "torch.nn.Dropout", "torch.cat", "torch.nn.Linear", "torch.nn.Conv1d", "torch.nn.ReLU" ] ]
tnksh/pyqubo
[ "493841fd374ea31268e0fe9023043888ffa220d7" ]
[ "pyqubo/utils/solver.py" ]
[ "# Copyright 2018 Recruit Communications Co., Ltd.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "numpy.argmin" ] ]
gibiee/random_navigate_agent
[ "2b9abb76b3f0821b709310229c7f5159a080620e" ]
[ "demo.py" ]
[ "import argparse\nimport os\nimport random\nimport time\nimport numpy as np\nimport pandas as pd\n\ndef agent_move(agent, map_size) :\n available_move = []\n pos_y, pos_x = agent\n if pos_y > 0 : available_move.append('up')\n if pos_y < map_size-1 : available_move.append('down')\n if pos_x > 0 : avai...
[ [ "numpy.round", "numpy.zeros" ] ]
mero2online/LAS_Handler
[ "07cf4c010f292320327278a97ff25d0101744419" ]
[ "HandleLithoPercentLAS.py" ]
[ "import os\nimport shutil\nimport lasio\nimport openpyxl\nimport xlwt\nimport xlrd\nfrom copy2 import copy2\nfrom openpyxl import Workbook\nfrom openpyxl.styles import Alignment, Font, PatternFill\nfrom pandas import DataFrame\nfrom openpyxl.utils.dataframe import dataframe_to_rows\nfrom openpyxl.utils import get_c...
[ [ "pandas.DataFrame" ] ]
ReCAP-UTR/NLP
[ "792758a1e952c1b183644bf8d87c6eed2a048339" ]
[ "nlp_service/client.py" ]
[ "from __future__ import annotations\n\nimport typing as t\n\nimport numpy as np\nimport spacy\nfrom arg_services.base.v1 import base_pb2\nfrom arg_services.nlp.v1 import nlp_pb2\nfrom spacy.language import Language\nfrom spacy.tokens import Doc, DocBin, Span, Token # type: ignore\n\nfrom nlp_service import similar...
[ [ "numpy.array" ] ]
NajwaLaabid/kalman-jax
[ "7cd4d83f9c5a22008d2c565deefe3fa7ffd2005d" ]
[ "kalmanjax/experiments/timings/results.py" ]
[ "import pickle\nimport numpy as np\n\ntask_list = ['heteroscedastic', 'coal', 'banana', 'binary', 'audio', 'aircraft', 'rainforest']\n\nmethod_timings = np.zeros([10, 6])\nfor method in range(10):\n for task_num in range(6):\n task = task_list[task_num]\n if (task_num == 4) and method in [4, 5, 7, ...
[ [ "numpy.set_printoptions", "numpy.zeros" ] ]
mourisl/DeepCAT
[ "67881c0961dc4336494c4000fc8be1680548b99a" ]
[ "PrepareAdaptiveFile.py" ]
[ "#! usr/bin/python\r\n\r\nimport os\r\nfrom os.path import exists\r\nimport numpy as np\r\nimport csv\r\nfrom csv import reader\r\nimport sys\r\n\r\nindir=sys.argv[1]\r\noutdir=sys.argv[2]\r\nthr=10000\r\n\r\n#def PrepareAdaptiveFile(indir,outdir,thr=10000):\r\nffs=os.listdir(indir)\r\nfor ff in ffs:\r\n if('.ts...
[ [ "numpy.array" ] ]
Hugo-L3174/talos-torque-control
[ "14faafcc06c93b57c972e92c1684b006667ff32e" ]
[ "python/dynamic_graph/sot/torque_control/talos/motors_parameters_symmetric_id.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Feb 9 13:55:16 2015\n\n@author: adelpret\n\"\"\"\nfrom numpy import zeros as zeros\n\nNJ = 32;\nk_tau = zeros(NJ);\nk_v = zeros(NJ);\n\n# PARAMETERS OF R_hip_y JOINT 0\nk_v[0] = 0.017585\nk_tau[0] = 0.000355\n# PARAMETERS OF R_hip_r JOINT 1\nk_v[1] = 0.006573\nk_t...
[ [ "numpy.zeros" ] ]
JackFram/Neural-Flow
[ "83cea7aa933fa9650b42271ba4205208814d047b" ]
[ "run_translation_czy.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n# Copyright The HuggingFace Team and The HuggingFace Inc. team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ...
[ [ "numpy.savez", "numpy.arange", "numpy.mean", "numpy.count_nonzero", "matplotlib.pylab.plot", "matplotlib.pylab.legend", "matplotlib.pylab.savefig", "numpy.where" ] ]
TaroSunagawa/oculomotor
[ "99ea16b2fcc5e99c833b506421337b6c36fbc0cd" ]
[ "application/agent/__init__.py" ]
[ "import numpy as np\nimport brica\n\n# Limit of horizontal and vertical angles at one environment step.\nACTION_RATE = 0.02\n\n\nclass Environment:\n def __init__(self):\n self._image = None\n self._angle = (0.0, 0.0)\n # add phase\n #self._phase = 'True'\n self._reward = 0.0\n...
[ [ "numpy.array", "numpy.clip" ] ]
guidoAI/spiking_notebook
[ "58612097efa2184de3758e314b5cf38f155e4cac" ]
[ "spiking.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jun 7 14:36:53 2021\n\n@author: Jesse Hagenaars\nAdapted by Guido for the AE4350 course\n\"\"\"\n\n# https://pytorch.org/tutorials/beginner/deep_learning_60min_blitz.html\n\nfrom typing import Optional, NamedTuple, Tuple\n\nimport torch\nimport numpy as np\nimport m...
[ [ "matplotlib.pyplot.legend", "torch.randint", "torch.zeros_like", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "numpy.array", "matplotlib.pyplot.show", "torch.ones_like", "torch.as_tensor" ] ]
JiYuanFeng/mmclassification
[ "b337ef1f11b85148cca4b6fb0c4da3f8cc2eede6" ]
[ "tests/test_models/test_neck.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport pytest\nimport torch\n\nfrom mmcls.models.necks import GlobalAveragePooling, HRFuseScales\n\n\ndef test_gap_neck():\n\n # test 1d gap_neck\n neck = GlobalAveragePooling(dim=1)\n # batch_size, num_features, feature_size\n fake_input = torch.rand(1,...
[ [ "torch.rand" ] ]
vivid43/PRML-ZW
[ "be465e616785109f05290faf20fb4df93ee06092" ]
[ "SoftmaxRegression/softmax_regression.py" ]
[ "import numpy as np\nimport pandas as pd\n\nclass SoftMax():\n\tdef __init__(self,alpha = 1.0,maxIteration = 1000):\n\t\tself.maxIteration = int(maxIteration)\n\t\tself.alpha=float(alpha)\n\n\tdef fit(self,X_,y):\n\t\tX = np.hstack((np.ones((X_.shape[0],1)),X_))\n\t\tm,n = X.shape\n\t\tk=y.shape[1]\n\t\tself.theta ...
[ [ "numpy.allclose", "numpy.count_nounzero", "numpy.ones", "numpy.copy", "numpy.argmax", "numpy.sum" ] ]
aalto-ui/chi21adaptive
[ "83d75f0c9dee7002e1d38f21108fef52d7be1b85" ]
[ "value_network/train.py" ]
[ "#!/usr/bin/env python3\n# coding: utf-8\n\nimport sys\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\nimport numpy as np\nimport tensorflow as tf\n\n\n# Boost GPU usage.\nconf = tf.compat.v1.ConfigProto()\nconf.gpu_options.allow_growth = True\ntf.compat.v1.Session(config=conf)\n\n# Maximum number of items in...
[ [ "tensorflow.compat.v1.ConfigProto", "tensorflow.keras.layers.Activation", "numpy.array_equal", "tensorflow.keras.layers.Embedding", "tensorflow.keras.preprocessing.text.one_hot", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.concatenat...
IESSC/Machine-Learning
[ "0866f09ee7ee671b49f0c7340383f5051dcacb49" ]
[ "Ch 4/test_RegularizedLinearModels.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Nov 4 22:15:19 2017\n\n@author: ASUS\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.linear_model import SGDRegressor\n\n# In[]\nm = 100\nX = 6 * np.random.rand(m, 1) - 3\ny = 0.5 * X**2 + X + 2 + np.random.randn(m, 1)\n\nplt.plot(X, y, ...
[ [ "sklearn.linear_model.SGDRegressor", "sklearn.linear_model.ElasticNet", "sklearn.linear_model.Lasso", "matplotlib.pyplot.plot", "sklearn.linear_model.Ridge", "numpy.random.randn", "numpy.random.rand" ] ]
Erotemic/netharn
[ "bc4a6d75445c949e709e5ab903ba72813ec68b79", "bc4a6d75445c949e709e5ab903ba72813ec68b79" ]
[ "netharn/data/channel_spec.py", "netharn/initializers/functional.py" ]
[ "import ubelt as ub\nimport six\n\n\nclass ChannelSpec(ub.NiceRepr):\n \"\"\"\n Parse and extract information about network input channel specs for\n early or late fusion networks.\n\n Notes:\n The pipe ('|') character represents an early-fused input stream, and\n order matters (it is non-...
[ [ "torch.cat" ], [ "numpy.minimum" ] ]
pambot/HistModPaper
[ "c3fe01046523dd3bbb4fb66a345c4e94a43ee121" ]
[ "plot_regr_compare.py" ]
[ "# load modules\nimport sys\nimport glob\nimport numpy as np\nimport pandas as pd\nimport scipy.stats\nimport matplotlib.patches as mpatches\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport cPickle as pickle\n\n\nplt.style.use('ggplot')\n\ncells = ['Gm12878', 'H1hesc', 'Helas3', 'Hepg...
[ [ "matplotlib.pyplot.legend", "matplotlib.patches.Patch", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.setp", "matplotlib.pyplot.violinplot", "matplotlib.pyplot.xticks", "numpy.array", "scipy.stats....
gian1312/suchen
[ "df863140fd8df1ac2e195cbdfa4756f09f962270" ]
[ "tensorforce/models/q_naf_model.py" ]
[ "# Copyright 2017 reinforce.io. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ap...
[ [ "tensorflow.transpose", "tensorflow.concat", "tensorflow.stack", "tensorflow.reshape", "tensorflow.exp", "tensorflow.squeeze", "tensorflow.expand_dims", "tensorflow.map_fn", "tensorflow.square", "tensorflow.pad", "tensorflow.abs" ] ]