repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
AntonyMoes/cyberhelper
[ "125805b19190250968bf6deef836a600e8b25af6" ]
[ "generator/generator.py" ]
[ "from generator.model import get_model\nfrom ast import literal_eval\nimport numpy as np\n\n\nclass Generator:\n def __init__(self, file: str = 'trained_data/cyber_weights'):\n with open('trained_data/char_indices') as f:\n char_indices = f.read()\n self._char_indices = literal_eval(char...
[ [ "numpy.asarray", "numpy.log", "numpy.sum", "numpy.exp", "numpy.argmax", "numpy.random.multinomial" ] ]
salazarna/Solar_Code
[ "68372cd087c1a3eac0733f5f8594eac78dce8844" ]
[ "pipeline.py" ]
[ "import pvlib\nimport numpy as np\nimport pandas as pd\nimport cnosolar as cno\nfrom tqdm.auto import tqdm\nfrom functools import reduce\n\ndef run(system_configuration, data, irrad_instrument, availability, energy_units):\n '''\n Wrapper that executes the production stages of the PV system, \n including s...
[ [ "numpy.repeat", "pandas.DataFrame", "numpy.cos" ] ]
Abhishek-Aditya-bs/Machine-Learning-Projects
[ "2c9eeeaf64777b8ab8309a36c40bda788b775d58" ]
[ "CNN-Classifier/CNN-Binary classifier.py" ]
[ "# Convolutional Neural Network\n\n# Importing the libraries\nimport tensorflow as tf\nfrom tensorflow.python.keras.preprocessing.image import ImageDataGenerator\n\n\n# Data Preprocessing\n\n# Preprocessing the Training set\ntrain_datagen = ImageDataGenerator(rescale = 1./255,\n sh...
[ [ "tensorflow.python.keras.preprocessing.image.image.load_img", "tensorflow.python.keras.preprocessing.image.image.img_to_array", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.MaxPool2D", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.m...
viekie/basic_deeplearning
[ "6c9e55cd621504da3d7ea1627e6783c9819a1916" ]
[ "chap05/Filter.py" ]
[ "#!/usr/bin/env python\n# -*- coding:utf8 -*-\n# Power by viekie. 2017-05-27 09:23:04\nimport numpy as np\n\n\nclass Filter(object):\n def __init__(self, width, height, depth):\n '''\n 构造初始化\n '''\n self.width = width\n self.height = height\n self.depth = depth\n ...
[ [ "numpy.random.uniform", "numpy.zeros" ] ]
boazmohar/VisExp
[ "5e9f22a8f1735016755f6d4c8fa844e47daac6af" ]
[ "Grating_lastrun.py" ]
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nThis experiment was created using PsychoPy2 Experiment Builder (v1.85.1),\n on September 08, 2017, at 18:43\nIf you publish work using this script please cite the PsychoPy publications:\n Peirce, JW (2007) PsychoPy - Psychophysics software in Python.\n...
[ [ "numpy.ones" ] ]
jeya-maria-jose/Overcomplete-Deep-Subspace-Clustering
[ "31b2e993efdefa75944ed04c0bd652d15d49c7df" ]
[ "COIL20/ODSC-COIL20.py" ]
[ "\nfrom __future__ import division, print_function, absolute_import\n\nimport tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom tensorflow.contrib import layers\nfrom sklearn import cluster\nfrom munkres import Munkres\nimport scipy.io as sio\nfrom scipy.sparse.linalg import svds\nfrom skl...
[ [ "tensorflow.nn.conv2d", "tensorflow.matmul", "tensorflow.ones", "tensorflow.reshape", "sklearn.preprocessing.normalize", "tensorflow.global_variables_initializer", "tensorflow.InteractiveSession", "tensorflow.trainable_variables", "tensorflow.shape", "sklearn.cluster.Spectr...
matkrak/enlargeme
[ "e19c3dcfa47869f9a810eb23bc4cac7544b3d3ce" ]
[ "DataHandler.py" ]
[ "import numpy as np\nfrom PIL import Image\nimport matplotlib.pyplot as plt\n# import struct\nimport scipy.io as sio\n\nimport logging\nlogger = logging.getLogger('root.' + __name__)\nlogger.addHandler(logging.NullHandler())\n\n\nMNIST_TRAIN_LABELS = 'data/train-labels-idx1-ubyte/data'\nMNIST_TRAIN_IMAGES = 'data/t...
[ [ "numpy.copy", "scipy.io.loadmat", "numpy.load", "matplotlib.pyplot.figure", "numpy.ndarray", "matplotlib.pyplot.subplot" ] ]
shigh/pyro
[ "a95e654ce7588e41e1d26706f60c25cf646ed164" ]
[ "pyro/distributions/multivariate_normal.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport numpy as np\nimport torch\nfrom torch.autograd import Variable\n\nfrom pyro.distributions.util import copy_docs_from\nfrom pyro.distributions.distribution import Distribution\nfrom torch.autograd import Function\n\n\ndef potri_compat(var):\...
[ [ "torch.zeros", "torch.potrf", "torch.potrs", "numpy.log", "torch.inverse", "torch.potri", "torch.mm", "torch.diag", "torch.gesv" ] ]
jgwill/nst-sampling
[ "802bf887500e5df345bf9e91a7af5d27f2610d26" ]
[ "deepdream.py" ]
[ "# To add a new cell, type '# %%'\n# To add a new markdown cell, type '# %% [markdown]'\n# %%\nfrom IPython import get_ipython\n\n# %% [markdown]\n# ##### Copyright 2019 The TensorFlow Authors.\n\n# %%\n#@title Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in ...
[ [ "tensorflow.keras.utils.get_file", "tensorflow.keras.Model", "tensorflow.zeros_like", "tensorflow.clip_by_value", "tensorflow.cast", "tensorflow.shape", "tensorflow.GradientTape", "tensorflow.math.reduce_mean", "tensorflow.constant", "numpy.array", "tensorflow.range", ...
cmurray-astro/beast
[ "cbbf6a663126367632c065ae63b341bea325e2ea", "cbbf6a663126367632c065ae63b341bea325e2ea" ]
[ "beast/plotting/plot_param_recovery.py", "beast/physicsmodel/tests/test_grid.py" ]
[ "import numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom astropy.io import fits\n\n\ndef plot_param_recovery(\n sim_data_list,\n stats_file_list,\n output_plot_filename,\n file_label_list=None,\n max_nbins=20,\n):\n \"\"\"\n Make plots comparing the physical parameters from...
[ [ "matplotlib.colors.LogNorm", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.atleast_1d", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "numpy.log10", "numpy.unique", "matplotlib.pyplot.subplot" ], [ "numpy.f...
LeAlex27/nnUNet
[ "9b6912f80904af9eaa4db41cd7e5c7f20058cdde" ]
[ "nnunet/training/dataloading/dataset_loading.py" ]
[ "# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\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.concatenate", "numpy.array", "numpy.random.choice", "numpy.random.random_integers", "numpy.zeros", "numpy.copy", "numpy.load", "numpy.save", "numpy.savez_compressed", "numpy.random.randint", "numpy.unique" ] ]
liangyy/ukb_idp_genetic_arch
[ "562612af6c82684f13e0cf2cbe2adc9a8f31b29d" ]
[ "submission/simulation/format_oy_gwas/format_oy_gwas.py" ]
[ "if __name__ == '__main__':\n import argparse\n parser = argparse.ArgumentParser(prog='format_oy_gwas.py', \n description='''\n Format GWAS output from `gw_qtl` to txt.gz files\n ''')\n parser.add_argument('--pheno_list', help='''\n The list of phenotype file tag name to ext...
[ [ "pandas.read_csv", "pandas.read_parquet", "pandas.merge", "pandas.concat" ] ]
Parag0506/SIH-TheSentinels
[ "b12032abbc0a358be4739c799fe22d910bf19f5e" ]
[ "predict_folder.py" ]
[ "import argparse\nimport os\nimport re\nimport time\n\nimport torch\nimport pandas as pd\nfrom kernel_utils import VideoReader, FaceExtractor, confident_strategy, predict_on_video_set\nfrom training.zoo.classifiers import DeepFakeClassifier\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(\"Predi...
[ [ "pandas.DataFrame", "torch.load" ] ]
parkinkon1/KI-lane-detection
[ "4aec7d087d649f102bb60c98d1b3137907b3f2aa" ]
[ "focal_loss.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nclass FocalLoss(nn.Module):\n def __init__(self, gamma=0, alpha=None, size_average=True):\n super(FocalLoss, self).__init__()\n self.gamma = gamma\n self.alpha = alpha\n # if ...
[ [ "torch.autograd.Variable", "torch.Tensor", "torch.nn.functional.log_softmax" ] ]
jamill/onnxruntime
[ "0565fecf46c4dd711c01a4106641946963bf7ff0" ]
[ "onnxruntime/python/tools/quantization/calibrate.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n# -------------------------------------------------------------------------\n# Copyright (c) Microsoft, Intel Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n# -----------------------------...
[ [ "numpy.max", "numpy.histogram", "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.argmin", "scipy.stats.entropy", "numpy.hstack", "numpy.min", "numpy.mean", "numpy.arange", "numpy.absolute", "numpy.cumsum", "numpy.searchsorted" ] ]
riverliuc/transformers
[ "3f51e6a35871fefbdfb705902355d7530a72d1b8" ]
[ "src/transformers/modeling_tf_utils.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...
[ [ "tensorflow.matmul", "tensorflow.reshape", "tensorflow.executing_eagerly", "tensorflow.python.keras.backend.int_shape", "tensorflow.keras.utils.register_keras_serializable", "tensorflow.rank", "tensorflow.shape", "tensorflow.TensorShape", "tensorflow.keras.losses.SparseCategori...
jyf588/pytorch-rl-bullet
[ "3ac1835d01e658b2078126895ffa0eb11304abb4" ]
[ "main_sim_clean_test.py" ]
[ "import argparse\nimport copy\nimport json\nimport pickle\nimport pprint\nimport os\nimport sys\nfrom tqdm import tqdm\nfrom typing import *\nfrom my_pybullet_envs import utils\nfrom state_saver import StateSaver\n\nimport numpy as np\nimport torch\n\nimport math\n\nimport my_pybullet_envs\nfrom system import polic...
[ [ "numpy.array", "numpy.random.seed", "torch.no_grad", "numpy.random.uniform", "numpy.random.randint", "numpy.clip" ] ]
gitferry/bamboo-stratus
[ "e066dbdfe690478dd8fa94105eea7b4a1c9f4d58", "e066dbdfe690478dd8fa94105eea7b4a1c9f4d58" ]
[ "stratus-plot/workload/unbalance_workload copy.py", "stratus-plot/workload/unbalance_workload.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\nSMALL_SIZE = 8\nMEDIUM_SIZE = 13\nBIGGER_SIZE = 16\n\nplt.rc('font', size=BIGGER_SIZE) # controls default text sizes\nplt.rc('axes', titlesize=BIGGER_SIZE) # fontsize of the axes title\nplt.rc('axes', labelsize=BIGGER_SIZE) # fontsize of the x ...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.rc", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.bar", "matplotlib.pyplot.xticks" ], [ "mat...
WayneWan413/JAQS
[ "e7362fc261f49dd7a4353c9a9a3f98d6ef9a78b4" ]
[ "example/eventdriven/DoubleMA.py" ]
[ "# encoding: utf-8\n\nfrom __future__ import print_function, division, unicode_literals, absolute_import\n\nimport time\n\nimport numpy as np\n\nfrom jaqs.data import RemoteDataService\nfrom jaqs.data.basic import Bar, Quote\nfrom jaqs.trade import (model, EventLiveTradeInstance, EventBacktestInstance, RealTimeTrad...
[ [ "numpy.mean", "numpy.zeros" ] ]
simplexsigil/DPC
[ "bf06939e302d9393b22f9b424abd281c535d8dbd" ]
[ "dpc/main.py" ]
[ "import argparse\nimport sys\nimport os\n\nimport matplotlib.pyplot as plt\nfrom tensorboardX import SummaryWriter\n\nplt.switch_backend('agg')\n\nsys.path.insert(0, '../utils') # If that is the way to include paths for this project, then why not also for 'backbone'?\nsys.path.insert(0, '../eval')\nsys.path.insert...
[ [ "matplotlib.pyplot.switch_backend", "torch.device", "torch.utils.data.RandomSampler", "torch.no_grad", "torch.optim.Adam", "torch.cuda.get_device_name", "torch.cuda.device_count", "torch.manual_seed", "torch.cuda.is_available", "torch.utils.data.DataLoader" ] ]
iceseismic/NoisePy
[ "edb7a65f4c49cb339e06eebbb13264438612bf0b" ]
[ "src/noise_module.py" ]
[ "import os\nimport glob\nimport copy\nimport obspy\nimport scipy\nimport time\nimport pycwt\nimport pyasdf\nimport datetime\nimport numpy as np\nimport pandas as pd\nfrom numba import jit\nfrom scipy.signal import hilbert\nfrom obspy.signal.util import _npts2nfft\nfrom obspy.signal.invsim import cosine_taper\nfrom ...
[ [ "numpy.dot", "numpy.argmin", "numpy.median", "numpy.load", "numpy.min", "numpy.mean", "numpy.exp", "numpy.multiply", "numpy.where", "numpy.linalg.qr", "numpy.sign", "numpy.ma.abs", "numpy.cos", "numpy.conjugate", "numpy.fft.irfft", "numpy.imag", ...
HKV-products-services/hkvfewspy
[ "918b3ff0c913d5b8334b531be4ba7076ec76d727" ]
[ "hkvfewspy/io/soap_fewspi.py" ]
[ "# coding: utf-8\n\n################################\n#### Author: Mattijn van Hoek ##\n#### While working for HKV ##\n################################\nfrom __future__ import print_function\n\nimport gzip\nimport io\nfrom datetime import datetime\nimport collections\n\n# import geopandas as gpd\nimport pandas a...
[ [ "pandas.DataFrame.from_dict", "pandas.DataFrame" ] ]
higorsmonteiro/vaccine-eff-fortaleza
[ "ee4465a4b767dab15773b973a19ff900f9f96a66" ]
[ "lib/db_utils.py" ]
[ "import os\nimport numpy as np\nimport pandas as pd\nimport datetime as dt\nimport lib.utils as utils\n\ndef data_hash(vacinas_foldername=\"vacinado_obito\", \n testes_foldername=\"testes_covid19\",\n hospital_foldername=\"hospitalizacao_covid19\",\n obitos_foldername=\"obitos...
[ [ "pandas.to_datetime", "pandas.read_csv", "pandas.isna", "pandas.concat" ] ]
harunlakodla/Webots-Dersleri-Tutorial
[ "41ecb83f25f48db4167544718c2ce0c107adc66f", "41ecb83f25f48db4167544718c2ce0c107adc66f" ]
[ "Webots-dersleri-3/controllers/main/main.py", "Webots-dersleri-2/controllers/controllers/main/main.py" ]
[ "\"\"\"main controller.\"\"\"\n\n# You may need to import some classes of the controller module. Ex:\n# from controller import Robot, Motor, DistanceSensor\nfrom controller import Robot,Motor,DistanceSensor,Lidar\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport math\nimport time\n\n\nhizi=6...
[ [ "matplotlib.pyplot.polar", "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "matplotlib.pyplot.pause", "numpy.size", "matplotlib.pyplot.clf" ], [ "numpy.array" ] ]
mutouretu/Dense-CoAttention-Network
[ "959d62a71589b31da53670dc0de83b26cf60463c" ]
[ "dense_coattn/data/dataset.py" ]
[ "\nimport collections\nimport os\nimport random\n\nimport h5py\nimport PIL.Image as Image\nimport torch\nimport torchvision.transforms as transforms\nfrom torch.utils.data import Dataset\n\n\nclass VisionLanguageDataset(Dataset):\n\n\tdef __init__(self, **kwargs):\n\t\tself.__dict__.update(kwargs)\n\t\tdata_path = ...
[ [ "torch.zeros", "torch.load", "torch.from_numpy" ] ]
WHOIGit/nes-lter-ims
[ "d4cc96c10da56ca33286af84d669625b67170522" ]
[ "neslter/parsing/ctd/common.py" ]
[ "import re\nimport os\nimport glob as glob\n\nimport pandas as pd\n\ndef parse_lat_lon(ll):\n \"\"\"convert deg/dec minutes into dec\"\"\"\n REGEX = r'(\\d+)[^\\d]+([\\d.]+)[^NSEW]*([NSEW])'\n deg, mnts, hemi = re.match(REGEX, ll).groups()\n mult = 1 if hemi in ['N', 'E'] else -1\n deg, mnts = int(de...
[ [ "pandas.to_datetime" ] ]
mortezaro/tr-disfluency
[ "674495ec25e63f26864b383d1e851da2f27f38e5" ]
[ "bert-crf4disf/bert_crf.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n#from __future__ import unicode_literals, print_function, division\nfrom io import open\nimport unicodedata\nimport string\nimport re\nimport random\nimport pickle \nimport torch\nimport torch.nn as nn\nfrom torch import optim\nimport torch.nn.functional as F\nfrom torch.u...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cuda.manual_seed", "torch.cuda.manual_seed_all", "torch.torch.no_grad", "numpy.array", "numpy.random.seed", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", ...
sharique1006/SVM
[ "ca2fe338e376ac6334abf7283a0239f33e64a361" ]
[ "MultiScikit.py" ]
[ "import numpy as np\nfrom sklearn import svm\nfrom svmutil import *\nimport sys\n\ntrain_file = sys.argv[1]\ntest_file = sys.argv[2]\n\ndef scikitSVM(x_train, y_train, x_test, y_test, C):\n\tx = x_train\n\ty = y_train[:,0]\n\tclf = svm.SVC(C=C, kernel='rbf', gamma=0.05)\n\tclf.fit(x, y)\n\n\ttrain_acc = clf.score(x...
[ [ "sklearn.svm.SVC" ] ]
prabhum456/determined
[ "7e8017df0f62d80d21f5483578e2d5abd0e30935" ]
[ "harness/tests/experiment/pytorch/test_reducer.py" ]
[ "import itertools\nimport logging\nimport threading\nimport traceback\nfrom collections import namedtuple\nfrom typing import Any, Callable, List\n\nimport numpy as np\nimport pytest\n\nfrom determined import _core\nfrom determined.pytorch import Reducer, _PyTorchReducerContext, _simple_reduce_metrics\n\nlogger = l...
[ [ "numpy.array" ] ]
StrudelTAU/AutoGAN
[ "b7be77dd8ed51c2d0405f8abce556c7b9984027b" ]
[ "AutoGAN/schemes/CycleGAN_TrainingScheme.py" ]
[ "# =========================================================================================================\n# File: CycleGAN_TrainingScheme.py\n# Author: Elad Dvash\n#\n# Description:\n# This file contains an implementation of a CycleGAN (https://arxiv.org/abs/1703.10593) and a CycleWGAN -\n# a CycleGAN with an I...
[ [ "numpy.ones", "numpy.zeros" ] ]
ashkanalinejad/Supervised-Simultaneous-MT
[ "12c3a53887c985ae24199ecef2f7b2335fe214c6" ]
[ "SimulEval/simuleval/metrics/latency.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport torch\nimport numbers\n\n\ndef latency_metric(func):\n def prepare_latency_metric(\n delays,\n ...
[ [ "torch.arange", "torch.FloatTensor", "torch.ones_like", "torch.zeros_like", "torch.nn.functional.pad", "torch.sum" ] ]
one-for-all/RoboND-Perception-Exercises
[ "be8913f03823defe9876720ef331010b8c789d34" ]
[ "Exercise-3/sensor_stick/scripts/capture_features.py" ]
[ "#!/usr/bin/env python\nimport numpy as np\nimport pickle\nimport rospy\n\nfrom sensor_stick.pcl_helper import *\nfrom sensor_stick.training_helper import spawn_model\nfrom sensor_stick.training_helper import delete_model\nfrom sensor_stick.training_helper import initial_setup\nfrom sensor_stick.training_helper imp...
[ [ "numpy.concatenate" ] ]
a6802739/Paddle
[ "c0bda9109f11872432f7d60580b5b6a3367f2577" ]
[ "python/paddle/fluid/tests/custom_op/test_multi_out_jit.py" ]
[ "# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.random.uniform", "numpy.zeros", "numpy.ones" ] ]
berkanlafci/pyoat
[ "b0cee99adde3c14c5d94f26f6e893a0b2e1fcae2" ]
[ "pyoat/_examples/exampleModel.py" ]
[ "#-----\n# Description : Example script to create model matrix\n# Date : March 2022\n# Author : Berkan Lafci\n# E-mail : lafciberkan@gmail.com\n#-----\n\n#%% Start logging\nimport logging\nlogging.basicConfig(filename='exampleModel.log', filemode='w', level=logging.INFO)\nlogging.info(' Sc...
[ [ "scipy.sparse.save_npz" ] ]
yingshaoxo/MovingDetector
[ "b288dac2282d033559dc69e71d7e5f1d516c2e7b" ]
[ "main.py" ]
[ "# coding:utf8\nimport cv2\nimport sys\nimport numpy as np\n\ntry:\n import pyscreenshot as ImageGrab\n import pyautogui\n import time\nexcept Exception as e:\n print(e)\n\n\nclass MovingDetector():\n def __init__(self):\n pass\n\n def camera_detect(self, device=0, func=None):\n self...
[ [ "numpy.int0" ] ]
habout632/spinningup
[ "0a2d540f61230a266a86666900570cebe7d5bc79" ]
[ "spinup/algos/td3/core.py" ]
[ "import numpy as np\nimport tensorflow as tf\n\n\ndef placeholder(dim=None):\n return tf.placeholder(dtype=tf.float32, shape=(None, dim) if dim else (None,))\n\n\ndef placeholders(*args):\n return [placeholder(dim) for dim in args]\n\n\ndef mlp(x, hidden_sizes=(32,), activation=tf.tanh, output_activation=None...
[ [ "tensorflow.concat", "tensorflow.global_variables", "tensorflow.variable_scope", "tensorflow.placeholder", "tensorflow.layers.dense" ] ]
alastairflynn/daepy
[ "d59b8bf0748894dc0ecbb5a11d7fa4988a206ebe", "d59b8bf0748894dc0ecbb5a11d7fa4988a206ebe" ]
[ "daepy/nonlinear.py", "test/test_continuation.py" ]
[ "import numpy as np\nfrom scipy.linalg import norm, solve, qr, solve_triangular\nfrom scipy.sparse import csc_matrix, diags\nfrom scipy.sparse.linalg import spsolve\nimport dill\nfrom multiprocessing import Pool\nfrom .derivatives import approx_jac\n\ndef fsolve(fun, x0, jac=None, method='nleqres', tol=1e-8, maxite...
[ [ "scipy.sparse.linalg.spsolve", "numpy.isnan", "numpy.isclose", "numpy.zeros", "scipy.sparse.csc_matrix", "numpy.copy", "numpy.ones", "numpy.greater_equal", "scipy.linalg.solve_triangular", "scipy.linalg.qr", "numpy.argsort", "scipy.linalg.norm", "numpy.diag" ]...
CxJasonT/PandasPython
[ "48d515958d5805f0e62e34b7424097e5575089a8" ]
[ "pandas/core/generic.py" ]
[ "# pyright: reportPropertyTypeMismatch=false\nfrom __future__ import annotations\n\nimport collections\nfrom datetime import timedelta\nimport functools\nimport gc\nimport json\nimport operator\nimport pickle\nimport re\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Hashable,\n Literal,\...
[ [ "pandas.io.pickle.to_pickle", "pandas.util._exceptions.find_stack_level", "pandas.core.describe.describe_ndframe", "numpy.asanyarray", "pandas.core.construction.extract_array", "pandas.io.formats.format.DataFrameRenderer", "pandas.core.nanops.na_accum_func", "pandas.io.formats.exce...
Xin-Ye-1/HRL-GRG
[ "b36c0c3f9f7ec3a1b59925df0be514f7540ee122" ]
[ "grid_world/DQN_full/network.py" ]
[ "import tensorflow as tf\nimport tensorflow.contrib.slim as slim\n\nclass DQN_Network():\n def __init__(self,\n window_size,\n channel_size,\n num_goals,\n num_actions,\n history_steps,\n scope='global'):\n wit...
[ [ "tensorflow.contrib.slim.max_pool2d", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.reshape", "tensorflow.gradients", "tensorflow.one_hot", "tensorflow.concat", "tensorflow.variable_scope", "tensorflow.nn.bias_add", "tensorflow.get_collection", "tensorflow.nn....
mbd334/Gender_Rec
[ "e76bb9969226cc3fa68005d717ca9040f00f7789" ]
[ "s3fd.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\n\nclass L2Norm(nn.Module):\n def __init__(self,n_channels, scale=1.0):\n super(L2Norm,self).__init__()\n self.n_channels = n_channels\n self.scale = scale\n self.eps = 1e-10\n ...
[ [ "torch.cat", "torch.max", "torch.nn.Conv2d", "torch.nn.functional.max_pool2d", "torch.Tensor", "torch.chunk" ] ]
ArthurCamara/beir
[ "2739990b719f2d4814d88473cf9965d92d4f4c18" ]
[ "examples/benchmarking/benchmark_sbert.py" ]
[ "from beir import util, LoggingHandler\nfrom beir.retrieval import models\nfrom beir.datasets.data_loader import GenericDataLoader\nfrom beir.retrieval.search.dense import util as utils\n\nimport pathlib, os, sys\nimport numpy as np\nimport torch\nimport logging\nimport datetime\n\n#### Just some code to print debu...
[ [ "torch.topk" ] ]
IBM/sau-explore
[ "dfeff8192292afeca7c17927684a3ed9fe65b97f" ]
[ "datasets/financial_bandit.py" ]
[ "from pathlib import Path\nfrom typing import Tuple\n\nimport numpy as np\nimport pandas as pd\nimport torch\n\nfrom .bandits import DataBasedBandit\nfrom .utils import download_data\n\nURL = \"https://storage.googleapis.com/bandits_datasets/raw_stock_contexts\"\n\n\nclass FinancialDataBandit(DataBasedBandit):\n ...
[ [ "numpy.max", "numpy.random.normal", "numpy.dot", "numpy.linalg.norm", "numpy.random.uniform", "torch.tensor", "pandas.read_csv" ] ]
prithv1/allenact
[ "f29dd6f0ec62425b02ca07fee815b1a82627a28e" ]
[ "projects/tutorials/object_nav_ithor_ppo_one_object.py" ]
[ "from math import ceil\nfrom typing import Dict, Any, List, Optional\n\nimport gym\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.optim.lr_scheduler import LambdaLR\n\nfrom core.algorithms.onpolicy_sync.losses import PPO\nfrom core.algorithms.onpolicy_sync.losses.p...
[ [ "numpy.linspace", "torch.cuda.is_available", "torch.cuda.device_count" ] ]
raviqqe/qnd.tf
[ "fab2bd93b1b2b2a15fd6eac8d30ede382522c368" ]
[ "qnd/experiment.py" ]
[ "import tensorflow as tf\n\nfrom .flag import FlagAdder\nfrom .estimator import def_estimator\nfrom .inputs import def_def_train_input_fn, def_def_eval_input_fn\n\n\ndef def_def_experiment_fn(batch_inputs=True,\n prepare_filename_queues=True,\n distributed=False):\n...
[ [ "tensorflow.contrib.learn.make_export_strategy" ] ]
guanjue/S3V2_IDEAS_ESMP
[ "c0b1720344aefbdc257c02ceb70b9fc06e52b4b0" ]
[ "bin/get_macs2pk.pipemultithreads.py" ]
[ "import os\nimport numpy as np\nimport subprocess\nfrom subprocess import call\nfrom multiprocessing import Pool\n\n################################################################################################\n### read 2d array\ndef read2d_array(filename,dtype_used):\n\timport numpy as np\n\tdata=open(filename,...
[ [ "numpy.repeat", "numpy.array" ] ]
yash1802/TensorBot
[ "3b4820f5a1e937bbea60905fd4c125da7abfecd4" ]
[ "training.py" ]
[ "import pickle\n\nimport tensorflow as tf\nimport tflearn\n\nimport data\n\ntrain_x, train_y, words, classes = data.get_training_data()\n\n# Reset underlying graph data\ntf.reset_default_graph()\n\n\ndef build_model():\n # Init model\n net = tflearn.input_data(shape=[None, len(train_x[0])])\n net = tflearn...
[ [ "tensorflow.reset_default_graph" ] ]
SANCHES-Pedro/Diff-SCM
[ "a7e7e6ed3a2cd1c21e3bf7a3ed8ed8b29a22cb69" ]
[ "utils/logger.py" ]
[ "\"\"\"\nLogger copied from OpenAI baselines to avoid extra RL-based dependencies:\nhttps://github.com/openai/baselines/blob/ea25b9e8b234e6ee1bca43083f8f3cf974143998/baselines/logger.py\n\"\"\"\n\nimport os\nimport sys\nimport shutil\nimport os.path as osp\nimport json\nimport time\nimport datetime\nimport tempfile...
[ [ "torch.utils.tensorboard.SummaryWriter" ] ]
baojianzhou/sparse-learn
[ "ed01f2c3d518c0c48652bc4fe4dc552ba3d5a427" ]
[ "sparse_learn/examples/example_test_proj.py" ]
[ "# -*- coding: utf-8 -*-\nimport numpy as np\nfrom sparse_learning.proj_algo import head_proj\nfrom sparse_learning.proj_algo import tail_proj\nfrom sparse_learning.fast_pcst import fast_pcst\nfrom sparse_learning.graph_utils import simu_graph\n\ndef test_proj_head():\n print('-' * 100)\n edges, weights = sim...
[ [ "numpy.random.normal", "numpy.zeros" ] ]
SandrineP/pandas
[ "9444dce96954c546333d5aecc92a06c3bfd19aa5" ]
[ "pandas/tests/test_compat.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nTesting that functions from compat work as expected\n\"\"\"\n\nimport pytest\nimport re\nfrom pandas.compat import (range, zip, map, filter, lrange, lzip, lmap,\n lfilter, builtins, iterkeys, itervalues, iteritems,\n next, get_ran...
[ [ "pandas.compat.builtins.zip", "pandas.compat.itervalues", "pandas.compat.lmap", "pandas.compat.zip", "pandas.compat.iteritems", "pandas.compat.iterkeys", "pandas.compat.builtins.map", "pandas.compat.lrange", "pandas.compat.builtins.filter", "pandas.compat.map", "pandas....
ccarocean/python-contours
[ "d154a679a2ea6a324c3308c1d087d88d0eb79622" ]
[ "contours/core.py" ]
[ "# -* coding: utf-8 -*-\n\"\"\"Common enums, functions, and classes for the `contours` package.\"\"\"\n\n# Python 2 support\n# pylint: disable=redefined-builtin,unused-wildcard-import,wildcard-import\nfrom __future__ import (absolute_import, division,\n print_function, unicode_literals)\nfrom...
[ [ "numpy.all", "numpy.finfo", "numpy.nonzero", "numpy.any" ] ]
lissrbay/bugml
[ "6a3823e32c176de9d3a47416a220e7d83d38763d" ]
[ "new/training/torch_training.py" ]
[ "from typing import List, Any\n\nimport pytorch_lightning as pl\nimport torch\nfrom pytorch_lightning import Trainer\nfrom torch.optim import Adam\nfrom torchmetrics import MetricCollection\n\nfrom new.data.report import Report\nfrom new.model.lstm_tagger import LstmTagger\nfrom new.training.data import ReportsData...
[ [ "torch.cat", "torch.no_grad", "torch.nn.Softmax" ] ]
phongsathorn1/pretty-confusion-matrix
[ "6fd5b2057e3669b680e90ca568504e7acf271202" ]
[ "pretty_cm.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nplot a pretty confusion matrix with seaborn\n\nCreated on Mon Jun 25 14:17:37 2018\n@author: Wagner Cipriano - wagnerbhbr - gmail - CEFETMG / MMC\nREFerences:\n https://www.mathworks.com/help/nnet/ref/plotconfusion.html\n https://stackoverflow.com/questions/28200786/how-to-plot-s...
[ [ "sklearn.metrics.confusion_matrix", "numpy.array", "matplotlib.font_manager.FontProperties", "pandas.DataFrame", "numpy.sum", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "numpy.unique", "matplotlib.colors.LinearSegmentedColormap.f...
open-mmlab/MMGEN-FaceStylor
[ "67e7b17a323ac5a3eae28b88e0b2c921876b50ca" ]
[ "agilegan/architectures/generator_discriminator.py" ]
[ "import random\n\nimport mmcv\nimport torch\nfrom mmgen.models.architectures.common import get_module_device\nfrom mmgen.models.architectures.stylegan.generator_discriminator_v2 import \\\n StyleGANv2Generator\nfrom mmgen.models.builder import MODULES\n\n\n@MODULES.register_module()\nclass SwapStyleGANv2Generato...
[ [ "torch.cat", "torch.randn" ] ]
NetherlandsForensicInstitute/lr-benchmark
[ "67aaafdb466efbbe6171992279dceac5de064584" ]
[ "tests/test_dataset.py" ]
[ "import numpy as np\nimport pytest\n\nfrom lrbenchmark.dataset import InMemoryCommonSourceKFoldDataset\n\n\n@pytest.fixture\ndef X() -> np.ndarray:\n return np.reshape(np.array(list(range(25))), (5, 5))\n\n\n@pytest.fixture\ndef y() -> np.ndarray:\n return np.array(['a', 'b', 'c', 'd', 'e'])\n\n\ndef test_get...
[ [ "numpy.array", "numpy.intersect1d" ] ]
GeoStat-Framework/ogs5py
[ "2bc4428c4c485d094e02c129ba5051745df58391" ]
[ "ogs5py/fileclasses/pct/core.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Class for the ogs PARTICLE DEFINITION file for RANDOM_WALK.\"\"\"\nimport numpy as np\nfrom ogs5py.fileclasses.base import File\n\n\nclass PCT(File):\n \"\"\"\n Class for the ogs Particle file, if the PCS TYPE is RANDOM_WALK.\n\n Parameters\n ----------\n data : np.arr...
[ [ "numpy.array", "numpy.loadtxt", "numpy.savetxt", "numpy.zeros" ] ]
marrov/UQpy
[ "b04a267b3080e3d4d38e876547ba0d3b979734f3" ]
[ "src/UQpy/Reliability/TaylorSeries/TaylorSeries.py" ]
[ "import numpy as np\nfrom UQpy.Distributions import *\nfrom UQpy.RunModel import RunModel\nfrom UQpy.Transformations import *\n\n########################################################################################################################\n#################################################################...
[ [ "numpy.array", "numpy.diag", "numpy.zeros" ] ]
adarob/jax
[ "d75becbf676e392bcf08e91594e8495bbc39317d" ]
[ "tests/lax_test.py" ]
[ "# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.full", "numpy.array", "numpy.pad", "numpy.asarray", "numpy.zeros", "numpy.lexsort", "numpy.ones", "numpy.take", "numpy.swapaxes", "numpy.arange", "numpy.prod", "numpy.int32", "numpy.issubdtype", "numpy.dtype", "numpy.flip", "numpy.int16" ] ]
Dee-Why/lite-bo
[ "011791aba4e44b20a6544020c73601638886d143", "011791aba4e44b20a6544020c73601638886d143" ]
[ "openbox/optimizer/base.py", "openbox/utils/multi_objective/pareto.py" ]
[ "# License: MIT\n\nimport os\nimport abc\nimport time\nimport numpy as np\nfrom typing import List\nfrom collections import OrderedDict\nfrom openbox.utils.logging_utils import setup_logger, get_logger\n\n\nclass BOBase(object, metaclass=abc.ABCMeta):\n def __init__(self, objective_function, config_space, task_i...
[ [ "numpy.random.RandomState" ], [ "numpy.any", "numpy.arange", "numpy.sum", "numpy.expand_dims" ] ]
TomLouisKeller/tensorlayer
[ "690766535a591367ad86907835b39730f4aa1dea" ]
[ "tests/test_mnist_simple.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport unittest\n\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n\nimport tensorflow as tf\nimport tensorlayer as tl\n\nfrom tests.utils import CustomTestCase\n\n\nclass Simple_MNIST_Test(CustomTestCase):\n\n @classmethod\n def setUpClass(cls):\n\n ...
[ [ "tensorflow.logging.set_verbosity", "tensorflow.train.AdamOptimizer", "tensorflow.argmax", "tensorflow.reset_default_graph", "tensorflow.Session", "tensorflow.placeholder", "tensorflow.cast" ] ]
dfridman1/ml_lib
[ "50104b3e1f59dc1fd70cee376f62e3c355dceb4d" ]
[ "ml_lib/tree/decision_tree.py" ]
[ "import numpy as np\nfrom abc import ABC, abstractmethod\nfrom ml_lib.base.estimator import Estimator\n\n\nclass DecisionTree(Estimator):\n def __init__(self, max_depth=-1):\n self.max_depth = max_depth\n self._node = None\n\n def fit(self, X, y):\n self._node = self._build_tree(X, y, dep...
[ [ "numpy.arange" ] ]
jie311/yolox_keypoint_segment
[ "1abd649424ecf66d6691b25a836cbb3261f33ee7" ]
[ "datasets/plate_kp/voctococo.py" ]
[ "#coding:utf-8\n \n# pip install lxml\n \nimport os\nimport glob\nimport json\nimport shutil\nimport numpy as np\nimport xml.etree.ElementTree as ET\n \n \n \npath2 = \".\"\n \n \nSTART_BOUNDING_BOX_ID = 1\n \n \ndef get(root, name):\n return root.findall(name)\n \n \ndef get_and_check(root, name, length):\n ...
[ [ "numpy.random.seed", "numpy.sort", "numpy.random.shuffle" ] ]
smoothScorpion/Angle
[ "86bc4d1c2bb6a8a4351ffd2db9b69ac1b95f0d71" ]
[ "rotate.py" ]
[ "import cv2\nimport numpy as np\nimport imutils\nimport matplotlib.pyplot as plt\n\nmatrix_test = None\nperimeters=[]\nimg=cv2.imread(\"Images/LinkRotated.jpg\",1)\nimg_height,img_width=img.shape[:2]\nblur_img = cv2.bilateralFilter(img,1,75,75)\ngrey_img=cv2.cvtColor(blur_img,cv2.COLOR_BGR2GRAY)\n_,thresh_img=cv2.t...
[ [ "numpy.array", "numpy.sin", "numpy.cov", "numpy.zeros", "matplotlib.pyplot.plot", "numpy.nonzero", "numpy.mean", "numpy.tanh", "numpy.vstack", "numpy.linalg.eig", "numpy.argsort", "numpy.cos", "matplotlib.pyplot.axis", "matplotlib.pyplot.show", "matplotl...
swapnilgarg7/Face-X
[ "fab21bf667fa7387b8e73e5a1d72fcba4fba2818", "fab21bf667fa7387b8e73e5a1d72fcba4fba2818", "fab21bf667fa7387b8e73e5a1d72fcba4fba2818" ]
[ "Face-Detection/Deep Dense Face Detection/face/test_processing.py", "Face-Detection/Face detection using probabilistic-modelling/Adaboost/ada_boost.py", "Face-Mask-Detection/Face Mask Detection using FaceNet/contributed/align/detect_face.py" ]
[ "\"\"\"\nTests for face.processing module\n\"\"\"\n\nimport numpy as np\n\nimport face.processing\n\n\ndef test_scale_image_keeping_aspect_ratio_vertial_image():\n\n image = np.zeros(shape=[10, 20])\n target_size = 30\n\n # Vertical dimension smaller\n rescaled_image = face.processing.scale_image_keepin...
[ [ "numpy.zeros" ], [ "numpy.full", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.exp", "numpy.unique", "numpy.expand_dims" ], [ "numpy.minimum", "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.nn.bias_add", "numpy.tile", "numpy.load", ...
amarburg/libdraw_sonar
[ "b7203d7a9aedee0a01779b5269ddcfe503f7971f" ]
[ "scripts/sonar_pointcloud.py" ]
[ "#! /usr/bin/env python3\n\nimport rospy\nimport struct\nimport time\n\nfrom matplotlib import cm\nimport numpy as np\n\nfrom acoustic_msgs.msg import SonarImage\nfrom sensor_msgs.msg import PointCloud2, PointField\nfrom std_msgs.msg import Header\n\nfrom sensor_msgs import point_cloud2\n\n\nclass SonarTranslator(o...
[ [ "numpy.sin", "matplotlib.cm.inferno", "numpy.radians", "numpy.arange", "numpy.cos" ] ]
DrNeilSmith/cog
[ "7fc6ee4790ab68f22828dd5550a616ac8a3c3423" ]
[ "test/bench.py" ]
[ "from cog.core import Table, Record\nfrom cog.core import Table\nfrom cog import config\nimport logging\nimport os\nimport shutil\nfrom logging.config import dictConfig\nimport string\nimport random\nimport timeit\nimport unittest\nimport matplotlib.pyplot as plt\nimport subprocess\nfrom pathlib import Path\n\n#!!!...
[ [ "matplotlib.pyplot.annotate", "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel" ] ]
dangminh3107/models
[ "9f7aaaff71256ad10f26490ec5d59dd731c0f164" ]
[ "research/deeplab/convert_to_tflite.py" ]
[ "# Copyright 2018 The TensorFlow Authors All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi...
[ [ "tensorflow.graph_util.import_graph_def", "tensorflow.io.gfile.GFile", "tensorflow.Graph", "tensorflow.lite.Interpreter", "tensorflow.compat.v1.lite.TFLiteConverter.from_session", "numpy.mean", "tensorflow.compat.v1.Session", "numpy.expand_dims" ] ]
Kwonil-Kim/kkpy
[ "ba035930e811b5caf081673e4c8a81b98bb1a904" ]
[ "examples/plot_cmap.py" ]
[ "\"\"\"\nPlotting Colormaps\n======================\n\nShow all colormaps in kkpy\n\"\"\"\n\nimport kkpy\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport inspect\n\n# Get all available cmaps\ndef available_functions(module):\n func_list_with_underscore = [x.__name__ for x in module.__dict__.val...
[ [ "matplotlib.pyplot.show", "matplotlib.colorbar.ColorbarBase", "matplotlib.pyplot.subplot" ] ]
upb-lea/gym-electric-motor
[ "f906b1c98205154c7e4ca53c5b372d4be7d1b5f8" ]
[ "gym_electric_motor/reference_generators/wiener_process_reference_generator.py" ]
[ "import numpy as np\r\n\r\nfrom .subepisoded_reference_generator import SubepisodedReferenceGenerator\r\n\r\n\r\nclass WienerProcessReferenceGenerator(SubepisodedReferenceGenerator):\r\n \"\"\"Reference Generator that generates a reference for one state by a Wiener Process with the changing parameter\r\n sigm...
[ [ "numpy.log10", "numpy.zeros_like" ] ]
ourobouros/cortex
[ "1b3aaf909816b93f6a6e3edd0da8c10891e05be9" ]
[ "test/tensorflow/license-plate-reader/utils/bbox.py" ]
[ "# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.24.*, run `git checkout -b 0.24` or switch to the `0.24` branch on GitHub)\n\nimport numpy as np\nimport cv2\nfrom .colors import get_color\n\n\nclass BoundBox:\n def __init...
[ [ "numpy.array", "numpy.argmax" ] ]
WuLabMDA/HelloDL
[ "96ede3a83d1c88091dacf49ddcecbe1e30d84f04" ]
[ "main.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport os, sys\nimport argparse\nimport numpy as np\nimport torch\nfrom torchvision import datasets, transforms\nfrom torch import optim\nfrom torch.optim import lr_scheduler\n\nfrom model import Net\nfrom train_eng import net_train\nfrom test_eng import net_test\n\n\ndef parse_args():\n...
[ [ "torch.optim.lr_scheduler.StepLR", "numpy.random.seed", "torch.manual_seed", "torch.cuda.is_available", "torch.utils.data.DataLoader" ] ]
tevnpowers/thesis
[ "af55bb47db34d90fcef1de073d16a6a0dff43161" ]
[ "tests/sklearn_svm.py" ]
[ "import pickle\n\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.linear_model import SGDClassifier\nfrom sklearn.feature_extraction.text import TfidfVectorizer\n\nfrom text_studio.model import Model\n\n\nclass Sklearn_SVM(Model):\n def setup(self, tokenizer=No...
[ [ "sklearn.preprocessing.LabelEncoder", "sklearn.linear_model.SGDClassifier", "sklearn.feature_extraction.text.TfidfVectorizer" ] ]
steuwe/deephar
[ "85efc43b7c166339f9655cf322a40dde242bad27" ]
[ "deephar/models/spnet.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"SPNet v1 model for Keras.\n\"\"\"\nimport numpy as np\nimport sys\n\nfrom keras.models import Model\n\nfrom ..config import ModelConfig\nfrom ..losses import pose_regression_loss\nfrom ..layers import *\nfrom ..utils import *\nfrom .blocks import *\n\nfrom .common import residual\nfr...
[ [ "numpy.ceil", "numpy.random.rand" ] ]
volpepe/DisNet
[ "c6fe25d9640ac69380f21bd193cbfebd6643905b" ]
[ "Train_DisNet_RNN.py" ]
[ "import os\nimport numpy as np\nimport json\nimport tensorflow as tf\n\nimport keras.backend as k\nfrom keras.layers import *\nfrom keras.layers import InputLayer, Input\nfrom keras.models import Sequential, Model, load_model\nfrom keras.layers import concatenate\nfrom keras.optimizers import Adam\nfrom keras.callb...
[ [ "numpy.square", "numpy.array", "sklearn.preprocessing.StandardScaler", "sklearn.externals.joblib.dump", "numpy.load", "numpy.save", "sklearn.model_selection.StratifiedShuffleSplit" ] ]
nemonameless/mmkp
[ "3758c48c7a6568e04d5a01b79f12baf12abcc420" ]
[ "mmdet/models/detectors/two_stage_keypoint.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler\nfrom .. import builder\nfrom ..registry import DETECTORS\nfrom .base import BaseDetector\nfrom .test_mixins import BBoxTestMixin, MaskTestMixin, RPNTestMixin\n\n\n@DETECTORS.register_module\nclass Tw...
[ [ "torch.zeros", "torch.cat", "torch.randn", "torch.ones" ] ]
asreview/paper-guidelines-KIFMS
[ "e056573791bfbdd339fa5ffd628a6443fdf220fb" ]
[ "scripts/split_data_with_multiple_labels.py" ]
[ "\"\"\"Split data with multiple labels\r\n\r\nSplit data into multiple datasets\r\n\r\nExample\r\n-------\r\n\r\n2 label columns:\r\n\r\n>>> python split_data_with_multiple_labels.py ptsd.csv output --split label_included label_abstract_screening --suffix final tiab\r\n\r\n3 label columns:\r\n\r\n>>> python split_d...
[ [ "pandas.read_csv" ] ]
ed-ortizm/autoencoders
[ "f1f6e9d1001b9de595907a17238c2eada6b57c16" ]
[ "latent/pair_plots.py" ]
[ "\"\"\"Pair plot between variables of latent space\"\"\"\nfrom configparser import ConfigParser, ExtendedInterpolation\nimport glob\nimport time\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport seaborn as sns\n\nfrom sdss.utils.managefiles import FileDirectory\nfrom sdss.utils.con...
[ [ "pandas.read_csv", "numpy.load", "matplotlib.pyplot.subplots" ] ]
dmitryshendryk/tantum
[ "afd07e7a52d65338297a4f46d26e5241d3e756dc" ]
[ "tantum/libs/fmix/models/resnet.py" ]
[ "# Code modified from https://github.com/kuangliu/pytorch-cifar\n\n'''ResNet in PyTorch.\n\nBasicBlock and Bottleneck module is from the original ResNet paper:\n[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun\n Deep Residual Learning for Image Recognition. arXiv:1512.03385\n\nPreActBlock and PreActBottlene...
[ [ "torch.nn.Linear", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.functional.adaptive_avg_pool2d", "torch.nn.Conv2d", "torch.nn.functional.relu", "torch.randn" ] ]
sm047/detectron2
[ "1036cce320ce0f2adbce7f143566462d3222bd5a" ]
[ "projects/Alleria/alleria/data/augmentation.py" ]
[ "#!/usr/bin/env python3\n# @Time : 31/5/20 7:49 PM\n# @Author : fangcheng.ji\n# @FileName: augmentation.py\n\nimport numpy as np\nimport random\nimport cv2\nimport math\n\nimport albumentations as A\nimport albumentations.augmentations.functional as AF\n\n\ndef get_albumentations_train_transforms():\n return...
[ [ "numpy.array", "numpy.minimum", "numpy.ones", "numpy.eye", "numpy.random.uniform", "numpy.arange", "numpy.clip", "numpy.maximum" ] ]
StoneT2000/WALL-E-RL
[ "9d22ba941291e4d3536c44b28e08b98dbfe0d442" ]
[ "paper_rl/modelfree/ppo/ppo.py" ]
[ "import math\nimport time\nimport warnings\nfrom typing import Any, Dict, Optional, Type, Union\n\nimport gym\nimport numpy as np\nimport torch\nfrom gym import spaces\nfrom torch import optim\nfrom torch.nn import functional as F\n\nfrom paper_rl.architecture.ac.core import ActorCritic, count_vars\nfrom paper_rl.c...
[ [ "torch.device", "torch.min", "torch.no_grad", "torch.clamp", "torch.as_tensor", "torch.exp" ] ]
MarcinStachowiak/CIFAR-10_challange
[ "3fd114eddf2577c3b1f718ccba0aacbefc7d26f1" ]
[ "dim_reduction_service.py" ]
[ "import random\n\nimport matplotlib.pyplot as plt\nfrom sklearn.decomposition import PCA\nfrom sklearn.manifold import TSNE\n\n__author__ = \"Marcin Stachowiak\"\n__version__ = \"1.0\"\n__email__ = \"marcin.stachowiak.ms@gmail.com\"\n\ndef reduce_dim_PCA(X, Y, class_names, n_components=2, visualise=False):\n if ...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "sklearn.manifold.TSNE", "matplotlib.pyplot.figure", "matplotlib.pyplot.scatter", "matplotlib.pyplot.show", "sklearn.decomposition.PCA" ] ]
florian6973/smartglove-pi
[ "f3f5881ac718772852421165b9903f2b9140b8f1" ]
[ "cam_show.py" ]
[ "import cv2\nimport numpy as np\nimport random as rd\n\nk = 2\n\n\n\n\n\nwhile True :\n img = np.zeros([768//k,1024//k])\n\n img[rd.randint(0, 768)//k:, rd.randint(0, 1024)//k:] = 1\n\n\n cv2.imshow(\"image\", img)\n cv2.waitKey(10)" ]
[ [ "numpy.zeros" ] ]
khoauit99/open-NMT-test
[ "ece4d485b04e79d4f2679b7d96720195bb1b292f" ]
[ "tokenize/tokenize_nhap.py" ]
[ "import sentencepiece as spm \nfrom sklearn.model_selection import ShuffleSplit\nfrom traceback import format_exc as _format_exc\n\ns = spm.SentencePieceProcessor('data/jpa_wiki_100000.model')\n\n#file1 = open('jyp_train.txt', 'r')\n#Lines = file1.readlines()\n\n# for i in Lines:\n# print(i)\n\npath_input_eng =...
[ [ "sklearn.model_selection.ShuffleSplit" ] ]
ibrsam/pyiron
[ "14ffbc2bba6e13738e2d995cbe3f900df3946b1f" ]
[ "pyiron/atomistics/job/atomistic.py" ]
[ "# coding: utf-8\n# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department\n# Distributed under the terms of \"New BSD License\", see the LICENSE file.\n\nfrom ase.io import write as ase_write\nimport copy\n\nimport numpy as np\nimport warnings\n\nfrom pyiron.atom...
[ [ "numpy.max", "numpy.array", "numpy.linalg.norm", "numpy.place", "numpy.copy", "numpy.rint", "numpy.mean", "numpy.eye", "numpy.einsum", "numpy.abs", "numpy.cumsum", "numpy.linalg.inv", "numpy.argwhere" ] ]
enriqueescobar-askida/Kinito.Finance
[ "5308748b64829ac798a858161f9b4a9e5829db44" ]
[ "AlgorithmicTradingAndQuantitativeAnalysis/Examples/73_fx_macd_renk.py" ]
[ "# =============================================================================\n# Automated trading script I - MACD\n# Author : Mayank Rasu\n\n# Please report bug/issues in the Q&A section\n# =============================================================================\n\nimport fxcmpy\nimport numpy as np\nfrom s...
[ [ "numpy.where", "numpy.array" ] ]
thayerAlshaabi/radiomics
[ "306c411163674fc84bf79784e2ffb2be15dd40bf" ]
[ "src/utils.py" ]
[ "# coding: utf-8\n\n\"\"\" MIT License \"\"\"\n'''\n Axel Masquelin & Sami Connolly \n Andrea Elhajj & Thayer Alshaabi\n ---\n Description:\n Misceleanous functions to assist in the evaluation of individuals, creating visuals,\n and csv file save. \n ---\n Copyright (c) 2018\n'''\n\n# libr...
[ [ "matplotlib.pyplot.xlim", "numpy.minimum", "numpy.mean", "pandas.concat", "matplotlib.pyplot.xticks", "pandas.DataFrame", "numpy.interp", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.title", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "numpy.std"...
quantumsoul/j_component_iot_obj_detection
[ "d6c6f51971c581d7385335f04d5a9268d81527db" ]
[ "yolo_utils.py" ]
[ "import colorsys\r\nimport imghdr\r\nimport os\r\nimport random\r\nfrom keras import backend as K\r\n\r\nimport numpy as np\r\nfrom PIL import Image, ImageDraw, ImageFont\r\n\r\n\r\ndef read_classes(classes_path):\r\n with open(classes_path) as f:\r\n class_names = f.readlines()\r\n class_names = [c.st...
[ [ "numpy.array", "numpy.expand_dims", "numpy.floor" ] ]
HKH515/EEG_classification
[ "732b66eca08e434672c74dcd93212542a7042e18" ]
[ "code/eda.py" ]
[ "import os\nimport h5py\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport datetime as dt\nimport collections\nimport librosa\nimport sys\n\npath = sys.argv[1]\n\ndata = np.load(path, allow_pickle=True)\n\nx = data['x']\ny = data['y']\n\nfig_1 = plt.figure(figsize=(12, 6))\nplt.plot(x[100, ...].ravel())\n...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "numpy.load", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
TashinAhmed/Computer-Vision-Research
[ "bc26136c12f5954b8540f566792ef60a945effb8" ]
[ "ThirdShield/Parking_Slot_YOLO.py" ]
[ "from utilities import assign_next_frame ,get_data\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom PIL import Image as PILImage\nfrom PIL import ImageFont, ImageDraw\nfrom tqdm import tqdm_notebook as tqdm\nimport cv2\nfrom datetime import datetime\n\nfrom yolo import YOLO \nfrom r...
[ [ "numpy.array", "numpy.fill_diagonal", "pandas.DataFrame", "matplotlib.pyplot.title", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "numpy.argmax", "numpy.sort", "numpy.sqrt", "numpy.floor", "matplotlib.pyplot.show", "numpy.tril", "matplotlib.pyplot.imsh...
QinXingli/Vehicle-Car-detection-and-multilabel-classification
[ "0b0ab3ad8478c5a0ac29819b4fce3ae110d44d82" ]
[ "train_vehicle_multilabel.py" ]
[ "# coding: utf-8\r\n\r\nimport os\r\nimport re\r\nimport shutil\r\nimport time\r\nimport pickle\r\nimport torch\r\nimport torchvision\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport dataset\r\nfrom dataset import color_attrs, direction_attrs, type_attrs\r\n\r\nfrom copy import deepcopy\r\nfrom PI...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.init.kaiming_normal_", "torch.cuda.is_available", "torch.load", "torch.transpose", "torch.nn.CrossEntropyLoss", "torch.sqrt", "torch.nn.init.constant_", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.equal", ...
iKernels/reasoning-baselines
[ "7b62145c01c3802382a880f6efa699c39f3d3c88" ]
[ "ikernels_core/readers/fever/fever_local_kgat_fmt_json_reader.py" ]
[ "from typing import Iterator\nfrom allennlp.data import Instance\nfrom allennlp.data.dataset_readers import DatasetReader\nimport pandas as pd\nfrom ikernels_core.readers.base.instance_generator import InstanceGenerator\nimport logging\n\nlogger = logging.getLogger(__name__)\nfrom ikernels_core.readers.fever.kgat_r...
[ [ "pandas.read_json" ] ]
matthewstidham/VideosSampleCode
[ "9eec145ac6fffb11d2a51356fb65d74ecd721d50" ]
[ "videos/081_cache_and_branch_prediction/src/plots.py" ]
[ "import json\nimport pandas as pd\n\nimport plotly.express as px\n\n\ndef load_json(filename):\n with open(filename, encoding='utf-8') as f:\n return json.load(f)\n\n\ndef load_json_df(filename):\n j = load_json(filename)[\"benchmarks\"]\n df = pd.DataFrame(j)\n df['real_time_micros'] = df['real_...
[ [ "pandas.DataFrame" ] ]
tommorse/nrn
[ "73236b12977118ae0a98d7dbbed60973994cdaee" ]
[ "share/lib/python/neuron/rxdtests/tests/pure_diffusion.py" ]
[ "\"\"\"test of pure diffusion\n\nRobert A McDougal\nMarch 2013 - June 2014\n\"\"\"\n\nfrom neuron import h, crxd as rxd\nfrom matplotlib import pyplot\nimport numpy\nimport __main__\n\nname = __main__.__file__\nif name[-3 :] == '.py':\n name = name[: -3]\n\nh.load_file('stdrun.hoc')\n\ndend = h.Section()\ndend.d...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.tight_layout" ] ]
AiHaibara/Trans
[ "e37cc946ab3ecbc8e016b3cdfebff1be1cf93f01" ]
[ "transweb/processimg.py" ]
[ "import glob\nimport os\nimport random\nimport sys\nimport random\nimport math\nimport json\nfrom collections import defaultdict\n\nfrom cv2 import cv2\nfrom PIL import Image, ImageDraw\nimport numpy as np\nfrom scipy.ndimage.filters import rank_filter\n\n\ndef dilate(ary, N, iterations): \n \"\"\"Dilate using a...
[ [ "numpy.uint8", "numpy.asarray", "numpy.zeros", "numpy.minimum", "numpy.sum", "numpy.mean", "scipy.ndimage.filters.rank_filter", "numpy.int0" ] ]
HatsuneMiku4/transformers
[ "ee5a5b6be825a9e3ac539485e7dea7601ad57653", "ee5a5b6be825a9e3ac539485e7dea7601ad57653" ]
[ "tests/test_modeling_roberta.py", "src/transformers/models/longformer/modeling_tf_longformer.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl...
[ [ "torch.Size", "torch.eq", "torch.tensor", "torch.as_tensor", "torch.allclose", "torch.Tensor" ], [ "tensorflow.matmul", "tensorflow.ones_like", "tensorflow.ones", "tensorflow.reshape", "tensorflow.scatter_nd", "tensorflow.reverse", "tensorflow.math.not_equal...
isn-dev/exoplanet-ml
[ "54a5865e86f54c974af0a8e59234248b45d874f2" ]
[ "exoplanet-ml/astronet/evaluate.py" ]
[ "# Copyright 2018 The Exoplanet ML 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 ...
[ [ "tensorflow.app.run", "tensorflow.logging.set_verbosity" ] ]
tanishq1g/visual-grounding-NMTree
[ "827c063f86078d60131fed610759e8c9b1385976" ]
[ "yolov3/cfg.py" ]
[ "import torch\nfrom yolov3.utils import convert2cpu\n\ndef parse_cfg(cfgfile):\n blocks = []\n fp = open(cfgfile, 'r')\n block = None\n line = fp.readline()\n while line != '':\n line = line.rstrip()\n if line == '' or line[0] == '#':\n line = fp.readline()\n cont...
[ [ "torch.from_numpy" ] ]
johnaparker/MiePy
[ "5c5bb5a07c8ab79e9e2a9fc79fb9779e690147be" ]
[ "miepy/interface.py" ]
[ "import miepy\nimport numpy as np\n\nclass interface:\n def __init__(self, material, z=0):\n self.material = material\n self.z = z\n\n def get_relative_index(self, wavelength, medium):\n eps_m = medium.eps(wavelength)\n eps = self.material.eps(wavelength)\n return np.sqrt(co...
[ [ "numpy.zeros_like", "numpy.ones_like", "numpy.sin", "numpy.zeros", "matplotlib.pyplot.subplots", "numpy.abs", "numpy.cos", "matplotlib.pyplot.show", "numpy.linspace", "numpy.meshgrid" ] ]
LBJ-Wade/GPy
[ "29b8f702f20011674c4454e90a1e5eec16d8683d" ]
[ "GPy/kern/src/stationary.py" ]
[ "# Copyright (c) 2012, GPy authors (see AUTHORS.txt).\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\n\n\nimport numpy as np\nfrom scipy import integrate\nfrom .kern import Kern\nfrom ...core.parameterization import Param\nfrom ...util.linalg import tdot\nfrom ... import util\nfrom ...util.config impo...
[ [ "numpy.square", "numpy.array", "numpy.sin", "numpy.empty", "numpy.asarray", "numpy.zeros", "numpy.dot", "numpy.ascontiguousarray", "numpy.sum", "numpy.log", "numpy.ones", "numpy.exp", "numpy.eye", "numpy.log1p", "numpy.where", "numpy.sqrt", "nump...
VKCOM/TopicsDataset
[ "149919321ba61a8f17b22f62f60f4aedec43d72b" ]
[ "experiments/entropy_batch_exp.py" ]
[ "from functools import partial\nfrom keras.callbacks import EarlyStopping\nfrom modAL.uncertainty import entropy_sampling\n\nfrom experiments.datasets import get_categorical_mnist\nfrom modAL import KerasActiveLearner\nimport numpy as np\nimport experiments.al_experiment as exp\n\nfrom examples.models.mnist_models ...
[ [ "numpy.delete", "numpy.random.randint" ] ]
jasonrute/puzzle_cube_code
[ "cf0238bc333d55e3637a4a6a4f408d16d4e14418" ]
[ "models.py" ]
[ "\"\"\"\nThe various models. These all have a common API (except for __init__ which may have extra\nparameters) and are basically wrappers around the Keras models.\n\"\"\"\nfrom collections import OrderedDict\nimport numpy as np\nimport time\nfrom batch_cube import BatchCube, position_permutations, color_permutati...
[ [ "numpy.concatenate", "numpy.array", "numpy.random.choice", "numpy.array_equal", "numpy.zeros", "numpy.rollaxis", "numpy.tile", "numpy.arange", "numpy.argmax", "tensorflow.gather" ] ]