repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
user01/alpha-zero-general
[ "7edf122015e02a2e78168ac9f6eaa5c5e20600cc" ]
[ "tictactoe_3d/keras/NNet.py" ]
[ "import argparse\nimport os\nimport shutil\nimport time\nimport random\nimport numpy as np\nimport math\nimport sys\nsys.path.append('..')\nfrom utils import *\nfrom NeuralNet import NeuralNet\n\nimport argparse\nfrom .TicTacToeNNet import TicTacToeNNet as onnet\n\n\"\"\"\nNeuralNet wrapper class for the TicTacToeN...
[ [ "numpy.asarray" ] ]
cnliao/jax
[ "81e9c758abf3aac8a8787e4d0e5a5c58ffa901c7" ]
[ "jax/interpreters/sharded_jit.py" ]
[ "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.reshape", "numpy.array" ] ]
eugenesiow/super-image
[ "44099ee61cbed0d6f54e563ce55bc36cd2565868" ]
[ "src/test.py" ]
[ "import torch\nimport cv2\nimport numpy as np\nfrom PIL import Image\nfrom super_image.models import EdsrModel, EdsrConfig, MsrnModel, A2nConfig, A2nModel, PanModel, CarnModel, MdsrModel, \\\n AwsrnModel, HanModel, DrlnModel, RcanModel\nfrom torch.utils.data import Dataset\nfrom torch import nn\nfrom torch.utils...
[ [ "numpy.hstack", "torch.nn.DataParallel", "torch.no_grad", "torch.cuda.is_available", "torch.device", "torch.utils.data.dataloader.DataLoader" ] ]
EBGU/RodentTracker
[ "47533f64088435646707086dda2c9c0c465979f0" ]
[ "SuperTracker_OFT_Template.py" ]
[ "import os\nimport numpy as np\nimport time\nfrom multiprocessing import Pool\nimport psutil\nimport cv2\nimport matplotlib.pyplot as plt\nimport av #for better performance\n\n##############################################################################\n#For EPM, please select pionts from the OPEN arm to the CLOS...
[ [ "numpy.nonzero", "numpy.isnan", "numpy.median", "numpy.int32", "numpy.save", "numpy.ceil", "numpy.argmax", "numpy.mean", "numpy.float32", "numpy.array", "numpy.zeros", "numpy.where" ] ]
gautam-sharma1/money-analysis
[ "635f5ba99abae4753fd16542c27e3f081eb5fdc1" ]
[ "scripts/proj1_B.py" ]
[ "################################################################\n# @author Gautam Sharma #\n# Project 1 B #\n# Program to test put different ML algorithms #\n# Best parameters are printed out at the end ...
[ [ "sklearn.model_selection.GridSearchCV", "pandas.read_csv", "sklearn.linear_model.LogisticRegression", "sklearn.ensemble.RandomForestClassifier", "sklearn.model_selection.train_test_split", "sklearn.neighbors.KNeighborsClassifier", "sklearn.tree.DecisionTreeClassifier", "sklearn.svm...
mumashanren/DeepFaceLive
[ "ce866a3a6cf152ab15e35d068b9516db63a7fd6d" ]
[ "modelhub/DFLive/DFMModel.py" ]
[ "from pathlib import Path\nfrom typing import Iterator, List, Tuple, Union\n\nimport numpy as np\nfrom xlib import onnxruntime as lib_ort\nfrom xlib import path as lib_path\nfrom xlib.image import ImageProcessor\nfrom xlib.net import ThreadFileDownloader\nfrom xlib.onnxruntime.device import ORTDeviceInfo\n\n\nclass...
[ [ "numpy.float32" ] ]
stevenrick/greedy-face-features
[ "5551e1e2b1f04bb709f0e518bea2114ff014b11b" ]
[ "feature_extractor.py" ]
[ "import os\nimport numpy as np\nimport skimage.io\nimport skimage.draw\nimport dlib\n\n# collects the image paths and labels for fully neutral and fully expressive faces\ndef itemize_dataset():\n\tfolders_subjects = os.listdir('cohn-kanade-images')\n\tfolders_subjects.sort()\n\timage_paths = []\n\tlabels = []\n\n\t...
[ [ "numpy.zeros" ] ]
007gzs/oface
[ "9e4ca8ee572783cff4417c58217cdcb8c7af07f4" ]
[ "oface/face_analysis.py" ]
[ "# encoding: utf-8\nfrom __future__ import absolute_import, unicode_literals\n\nimport os\n\nimport numpy as np\n\nfrom oface.model import SCRFD, ArcFace\nfrom oface.core import face_align\n\n\nclass Face:\n def __init__(self, *, bbox, det_score, landmark, feature, sim_face_ids, extend=None):\n \"\"\"\n ...
[ [ "numpy.dot", "numpy.linalg.norm" ] ]
twankim/svdped
[ "afe67b5c4636bca03a6d68b7a9cf89485a4dabec", "afe67b5c4636bca03a6d68b7a9cf89485a4dabec" ]
[ "utils/ssd_inception_v2_feature_extractor_rtpdd.py", "train_rtpdd.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n# Modified by Taewan Kim, 2018, The University of Texas at Austin\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#\...
[ [ "tensorflow.variable_scope", "tensorflow.control_dependencies", "tensorflow.shape" ], [ "tensorflow.train.ClusterSpec", "tensorflow.gfile.MakeDirs", "tensorflow.logging.set_verbosity", "tensorflow.app.run" ] ]
ad349/fashionmnist
[ "ae3148b523c6978dcade6ae362f98cc9f1fbc284" ]
[ "train_softmax.py" ]
[ "#!/usr/bin env python\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport sys\nimport os\nimport numpy as np\nimport tensorflow as tf\nimport argparse\nfrom utils import splitter, normalize\nfrom model import graph\n\n# TO DO\n# Add saver\n# A...
[ [ "tensorflow.train.global_step", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.cast", "numpy.mean", "tensorflow.train.AdamOptimizer", "tensorflow.data.TextLineDataset", "tensorflow.summary.scalar", "tensorflow.py_func", "tensorflow.data.Iterator.from_string_hand...
ziyux/AFE
[ "af9cc706bec0bac27f0c1a9631a095484e2553e9", "af9cc706bec0bac27f0c1a9631a095484e2553e9" ]
[ "src/AFE_DAT.py", "src/AFE_Constraints.py" ]
[ "import csv\r\nimport os\r\nimport time\r\nimport pickle\r\nimport numpy as np\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.svm import SVC\r\nfrom sklearn.linear_model import LinearRegression\r\n\r\n\r\ndef read_csv_file(filename):\r\n try:\r\n with open(filename, mode='r') as c...
[ [ "sklearn.model_selection.train_test_split", "sklearn.linear_model.LinearRegression", "sklearn.svm.SVC", "numpy.argsort", "numpy.array" ], [ "numpy.errstate", "numpy.abs" ] ]
benkulbertis/GamestonkTerminal
[ "f1ebf7c3082b7d985e038fdb4021be317be001d2" ]
[ "prediction_techniques/pred_menu.py" ]
[ "import argparse\n\nfrom pandas.plotting import register_matplotlib_converters\n\nregister_matplotlib_converters()\n\n\n# -----------------------------------------------------------------------------------------------------------------------\ndef print_prediction(s_ticker, s_start, s_interval):\n \"\"\" Print he...
[ [ "pandas.plotting.register_matplotlib_converters" ] ]
juyingnan/vccf
[ "fd37b01a7e7880ac99c7a280126372cc4544fa24" ]
[ "visualization/GE_violin.py" ]
[ "import os\nimport plotly.graph_objects as go\nimport pandas as pd\nfrom plotly.subplots import make_subplots\n\ntarget_root_path = r\"G:\\GE\\skin_12_data\"\n\nfile_paths = []\n\nregions = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\n# ages = ['72', '53', '38', '48', '33', '42', '69', '57', '60', '53_', '22', '32']\na...
[ [ "pandas.concat", "pandas.read_csv" ] ]
Jimexist/ConvLSTM_pytorch
[ "d65978e64b67ab268ee1ee1af5c11d9d94a160c1" ]
[ "conv_lstm/conv_lstm.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass ConvLSTMCell(nn.Module):\n def __init__(\n self,\n input_dim: int,\n hidden_dim: int,\n kernel_size: int,\n bias: bool,\n ):\n \"\"\"\n Initialize ConvLSTM cell.\n Parameters\n ----------\n in...
[ [ "torch.sigmoid", "torch.cat", "torch.zeros", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.tanh", "torch.split", "torch.stack" ] ]
som-shahlab/trove
[ "8249def4d86d0da9e14db3f81918c3e0ac65bd89" ]
[ "trove/labelers/umls.py" ]
[ "import os\nimport re\nimport errno\nimport shutil\nimport logging\nimport msgpack\nimport sqlite3\nimport hashlib\nimport pandas as pd\nimport urllib.request\nfrom pathlib import Path\nfrom zipfile import ZipFile\nfrom collections import defaultdict\n\nlogger = logging.getLogger(__name__)\n\n######################...
[ [ "pandas.read_parquet", "pandas.read_csv" ] ]
sysnoble/PyMusicLooper
[ "67e0c1d9d6766c5ca390ec0b5824b0d683e5600e" ]
[ "pymusiclooper/core.py" ]
[ "#!/usr/bin/python3\n# coding=utf-8\n\nimport logging\nimport os\nimport time\n\nimport librosa\nimport numpy as np\nimport soundfile\n\nfrom .exceptions import LoopNotFoundError\n\n\nclass MusicLooper:\n def __init__(self, filepath, min_duration_multiplier=0.35, trim=True):\n # Load the file if it exists...
[ [ "numpy.abs", "numpy.einsum", "numpy.pad", "numpy.median", "numpy.union1d", "numpy.linalg.norm", "numpy.sort", "numpy.percentile", "numpy.geomspace", "numpy.max", "numpy.searchsorted", "numpy.average", "numpy.array" ] ]
tomaszmrugalski/poliastro
[ "463cade72eb26e4db09ef613fc5d7cc972581617" ]
[ "src/poliastro/core/elements.py" ]
[ "\"\"\"This module contains a set of functions that can be used\n to convert between different elements that define the orbit\n of a body.\n \"\"\"\n\nimport numpy as np\nfrom numpy import cross\nfrom numpy.core.umath import cos, sin, sqrt\nfrom numpy.linalg import norm\n\nfrom ._jit import jit\nfrom .angl...
[ [ "numpy.log", "numpy.sqrt", "numpy.core.umath.cos", "numpy.core.umath.sqrt", "numpy.cos", "numpy.linalg.norm", "numpy.sin", "numpy.arctan2", "numpy.tan", "numpy.core.umath.sin", "numpy.cross" ] ]
Pranavs05/espnet
[ "6830cb683b2c4dbb823b24ae865ac976dd0047fe" ]
[ "espnet/nets/chainer_backend/transformer/subsampling.py" ]
[ "# encoding: utf-8\n\nimport chainer\n\nimport chainer.functions as F\nimport chainer.links as L\n\nfrom espnet.nets.chainer_backend.transformer.embedding import PositionalEncoding\n\nimport logging\nimport numpy as np\n\n\nclass Conv2dSubsampling(chainer.Chain):\n def __init__(self, channels, idim, dims, dropou...
[ [ "numpy.array", "numpy.sqrt" ] ]
DerekGloudemans/3D-detector-trials
[ "480274567eaa84c5c883260ef62f150c7a23ffd3", "480274567eaa84c5c883260ef62f150c7a23ffd3" ]
[ "old/pytorch_retinanet_detector_multitask/retinanet/losses.py", "old/pytorch_retinanet_detector_multitask/retinanet/utils.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\n\ndef calc_iou(a, b):\n area = (b[:, 2] - b[:, 0]) * (b[:, 3] - b[:, 1])\n\n iw = torch.min(torch.unsqueeze(a[:, 2], dim=1), b[:, 2]) - torch.max(torch.unsqueeze(a[:, 0], 1), b[:, 0])\n ih = torch.min(torch.unsqueeze(a[:, 3], dim=1), b[:, 3]) - torc...
[ [ "torch.abs", "torch.ge", "torch.ones", "torch.max", "torch.cat", "torch.eq", "torch.zeros", "torch.min", "torch.lt", "torch.unsqueeze", "torch.tensor", "torch.le", "torch.log", "torch.cuda.is_available", "torch.stack", "torch.clamp", "torch.pow",...
utkarshayachit/tomviz
[ "02efc26a14965602cced2343fe6d058c4a0ff903" ]
[ "tomviz/python/RandomParticles.py" ]
[ "def generate_dataset(array):\n import numpy as np\n\n #------USER SPECIFIED VARIABLES-----#\n ###p_in### #internal structure factor.\n ###p_s### #shape factor.\n ###sparsity### #sparsity: percentage of non-zero pixels. Range:[0,1]\n #-----------------------------------#\n\n arrayShape = array...
[ [ "numpy.amax", "numpy.absolute", "numpy.sqrt", "numpy.meshgrid", "numpy.fft.ifftn", "numpy.round", "numpy.random.randn", "numpy.fft.fftfreq", "numpy.argsort", "numpy.exp" ] ]
MarcoMontez/pygame
[ "7f24845e42aa055f4143912d17aca4c34411d5e0" ]
[ "galo.py" ]
[ "import numpy as np\n\nboard = np.zeros((3,3))\nboard_p1_victory = np.array([[1,0,-1],[1,-1,0],[1,0,-1]]) \nboard_p2_victory = np.array([[-1,-1,-1],[0,0,1],[1,0,1]])\nboard_p1_trace_win = np.array([[1,0,-1],[0,-1,0],[-1,0,1]]) \nboard_full = np.array([[1,1,-1],[-1,-1,1],[-1,1,0]]) \n\nboard = board\n\nprint(board...
[ [ "numpy.sum", "numpy.abs", "numpy.fliplr", "numpy.array", "numpy.zeros", "numpy.trace" ] ]
Niteshnupur/nlp-dl-prework
[ "1a306888de544f9feda512a4ad9b518242e8f3f4" ]
[ "Nitesh-Bhosle-:---Insurance-claim-prediction/code.py" ]
[ "# --------------\n# Data loading and splitting\n#The first step - you know the drill by now - load the dataset and see how it looks like. Additionally, split it into train and test set.\n\n\n# import the libraries\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nfrom sklearn.model_selection impor...
[ [ "matplotlib.pyplot.boxplot", "sklearn.model_selection.GridSearchCV", "pandas.read_csv", "sklearn.metrics.roc_auc_score", "sklearn.linear_model.LogisticRegression", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "sklearn.model_selection.train_test_split", "sklearn.met...
uujei/ujutils
[ "1153b0ec2b7eb3f41edc190dd4fb5400417c62de" ]
[ "ujutils/common.py" ]
[ "import os\nfrom collections import Counter\nfrom typing import Union\n\nimport numpy as np\nimport pandas as pd\nfrom natsort import natsorted\nfrom pandas.core.arrays.categorical import Categorical\nfrom rich.console import Console\nfrom rich.filesize import decimal\n\nfrom .directory import Directory\nfrom .misc...
[ [ "numpy.array", "pandas.DataFrame" ] ]
HarryKane/machineLearning
[ "8a4f4dd0a2904a3f9edce7df38c3c113b2a47459" ]
[ "tensorflow-DBN/DBN.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport tensorlayer as tl\nfrom ReconLayer import ReconLayer\n\nclass DBN(object):\n\n def __init__(\n self,\n n_units = [],\n learning_rate_rbm = [],\n batch_size_rbm = [],\n n_epoch_rbm = [],\n visible_unit_type_rbm = [],\n ...
[ [ "tensorflow.Graph", "tensorflow.matmul", "tensorflow.truncated_normal", "tensorflow.constant", "tensorflow.cast", "tensorflow.placeholder", "tensorflow.losses.softmax_cross_entropy", "tensorflow.global_variables_initializer", "tensorflow.train.GradientDescentOptimizer", "te...
yalickj/keras
[ "d368dc870bfd8fdd4ca0ff82bd5b61aa549291c5" ]
[ "keras/utils/training_utils.py" ]
[ "from ..layers.merge import concatenate\nfrom .. import backend as K\nfrom ..layers.core import Lambda\nfrom ..engine.training import Model\n\n\ndef _get_available_devices():\n from tensorflow.python.client import device_lib\n local_device_protos = device_lib.list_local_devices()\n return [x.name for x in ...
[ [ "tensorflow.device", "tensorflow.concat", "tensorflow.python.client.device_lib.list_local_devices", "tensorflow.shape", "tensorflow.slice", "tensorflow.name_scope" ] ]
mrmohaghegh/scvi-tools
[ "9c3085b6b12f9d504741a2f7843e218d9172b1e7" ]
[ "scvi/dataloaders/_anntorchdataset.py" ]
[ "import logging\nfrom typing import Dict, List, Union\n\nimport anndata\nimport h5py\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom anndata._core.sparse_dataset import SparseDataset\nfrom torch.utils.data import Dataset\nfrom PIL import Image\nfrom scvi.data._anndata import get_from_registry\n\nlogger...
[ [ "numpy.argsort", "numpy.empty_like", "numpy.arange" ] ]
toreal/BlurDetection
[ "9d59034813ba6c8933750e8e3395b6936cb4d6e9" ]
[ "main.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n__author__ = 'Will Brennan'\n\n# built-in modules\nimport logging\nimport argparse\n# Standard modules\nimport cv2\nimport numpy\n# Custom modules\nimport scripts\nimport FocusMask\nfrom PIL import Image\n\nlogger = logging.getLogger('main')\n\n\ndef evaluate(img_col...
[ [ "numpy.fft.fft2", "numpy.fft.ifft2", "numpy.abs", "matplotlib.pyplot.scatter", "numpy.amin", "numpy.fft.fftshift", "numpy.seterr", "numpy.fft.ifftshift", "numpy.zeros_like", "numpy.mean", "numpy.count_nonzero", "matplotlib.pyplot.grid", "matplotlib.pyplot.show" ...
michaelneuder/image_quality_analysis
[ "4b4c934454ced945bdec165e1da99b17688e1608" ]
[ "bin/nets/old/convolutional_nn.py" ]
[ "#!/usr/bin/env python3\n\n# -----------------------------\n# convolution to compare images\n# -----------------------------\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL']='2'\nimport tensorflow as tf\nimport numpy as np\nnp.set_printoptions(threshold=np.nan)\nfrom scipy import signal as sig\nfrom PIL import Image ...
[ [ "tensorflow.matmul", "tensorflow.concat", "tensorflow.truncated_normal", "tensorflow.constant", "tensorflow.zeros", "numpy.asarray", "numpy.set_printoptions", "tensorflow.reshape", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.train.Gr...
ben-bay/merlin-spellbook
[ "da56aae43477d677a454c86c24f3406604620272" ]
[ "tests/ml/test_learn.py" ]
[ "import os\n\nimport numpy as np\n\nfrom spellbook.ml.learn import stack_arrays\n\n\ndef test_stack_arrays():\n data1 = np.random.random((3, 2))\n data2 = np.zeros((3, 2))\n data3 = np.ones((3, 2))\n np.savez(\"temp.npz\", F1=data1, F2=data2, F3=data3)\n loaded = np.load(\"temp.npz\")\n os.remove(...
[ [ "numpy.savez", "numpy.random.random", "numpy.ones", "numpy.load", "numpy.zeros" ] ]
HypoChloremic/calculus
[ "eec514793ce1c5f7ee6966233b1182e24bf00f6a" ]
[ "calculus/limits/ex1pt2_79.py.py" ]
[ "import math\nimport matplotlib.pyplot as plt \nimport numpy as np\n\nplt.style.use('dark_background')\n\ndef f(x):\n\t#return x * math.sin(1/x)\n\t#return x**3\n\treturn -x**2\n\t#return math.sin(x)\n\ndef g(x):\n\t#return -math.sqrt((x**3)**2)\n\treturn 2 * x**2\ndef result(x_values, q):\n\tresult = []\n\tfor x i...
[ [ "numpy.arange", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.style.use" ] ]
dfsbbl/pytorch-deeplabv3
[ "66877e98bcfa1caf8e3074418221ed83df921bb2" ]
[ "dataloaders/datasets/combine_dbs.py" ]
[ "import torch.utils.data as data\n\n\nclass CombineDBs(data.Dataset):\n NUM_CLASSES = 21\n\n def __init__(self, dataloaders, excluded=None):\n self.dataloaders = dataloaders\n self.excluded = excluded\n self.im_ids = []\n\n # Combine object lists\n for dl in dataloaders:\n ...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.title", "torch.utils.data.DataLoader", "matplotlib.pyplot.subplot", "numpy.transpose", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
EntilZha/irt-leaderboard
[ "3c69c05056f663e0e5c2a61a322d79a37f695ff9" ]
[ "leaderboard/squad_eval_v2.py" ]
[ "\"\"\"Official evaluation script for SQuAD version 2.0.\n\nIn addition to basic functionality, we also compute additional statistics and\nplot precision-recall curves if an additional na_prob.json file is provided.\nThis file is expected to map question ID's to the model's predicted probability\nthat a question is...
[ [ "numpy.ones_like", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "matplotlib.use", "matplotlib.pyplot.step", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlim", "matplotlib.pyplot.clf", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.xlabel", "matplotlib....
g00387856/Iris-Data-set-analysis-project
[ "41dc5e9ebe2c7c48ae6ae24d67e3b8b5d42a80d9" ]
[ "analysis.py" ]
[ "\n\n#Using Pandas module for data importing of CSV file and data manipulation\n#Reference **: https://gist.github.com/curran/a08a1080b88344b0c8a7\n # https://realpython.com/python-csv/\n #https://stackoverflow.com/questions/36571560/directing-print-output-to-a-txt-file-in-python-3/3657160...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlim", "matplotlib.pyplot.clf", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel" ] ]
agarwal-peeush/MachineLearning
[ "ea55ff30a2bfb1223fd14f8fc38fda8eb152866e" ]
[ "Python/AndrewNgMLCourse/Ex1/Ex1.py" ]
[ "# Machine Learning course by AndrewNg on Coursera\n\n# import all libraries required here\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.linear_model import LinearRegression\nfrom mpl_toolkits.mplot3d import axes3d\n\n# 1. Print 5 by 5 Identity matrix\nid5 = np.identity(5)...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.scatter", "numpy.power", "numpy.arange", "numpy.ones", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "numpy.identity", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", ...
DanqingZ/social-DCM
[ "3c2541a7ed0e7f4519d97783b5b673fa6c06ae94" ]
[ "src/models/GibbsSampler_networkx.py" ]
[ "from __future__ import division\nimport random\n# from snap import *\nimport numpy as np\nimport numpy.linalg as alg\nimport scipy as spy\nimport networkx as nx\n\nimport time\nfrom itertools import *\nimport sys\n\nfrom scipy.special import expit\n\n\nclass GibbsSampler:\n '''\n class for GibbsSampler, call...
[ [ "numpy.array", "numpy.zeros", "numpy.sum", "scipy.special.expit" ] ]
bangquanxie/ASM3D
[ "09a6a6b51599e80dd7ef5226f326d58cf7b5de8e" ]
[ "ammf/datasets/kitti/kitti_dataset.py" ]
[ "\"\"\"Dataset utils for preparing data for the network.\"\"\"\n\nimport itertools\nimport fnmatch\nimport os\n\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\n\nfrom ammf.utils.wavedata.tools.core import calib_utils\nfrom ammf.utils.wavedata.tools.obj_detection import obj_utils\n\nfrom ammf.core ...
[ [ "numpy.asarray", "numpy.arange", "numpy.dstack", "numpy.random.shuffle", "numpy.array", "numpy.zeros" ] ]
rcffc/SparseConvNet
[ "4f70f13a10d768fe8ffd1414dee9192dcc0ca803" ]
[ "examples/ScanNet/eval/figures.py" ]
[ "import matplotlib.pyplot as plt\n\ndef train_loss(path):\n with open(path) as file:\n lines = [s.strip().split(' ') for s in file.readlines() if 'Train loss' in s]\n X = [int(line[0]) for line in lines]\n Y = [float(line[3]) for line in lines]\n plt.plot(X, Y)\n plt.xlabel('Ep...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel" ] ]
guoyang-xie/gangealing
[ "353e059d322105dbc0389409b3579772c0673839" ]
[ "applications/flow_scores.py" ]
[ "\"\"\"\nThis script runs a pre-trained Spatial Transformer on an input dataset and records the smoothness of the flow field\nproduced by the STN for every image. These smoothness values are treated as scores which can be used to filter the\ndataset. An image with low (highly negative) smoothness corresponds to an ...
[ [ "torch.load", "torch.cat", "torch.inference_mode", "torch.quantile", "torch.where", "torch.utils.data.Subset" ] ]
Caephler/noisy-article-generator
[ "b17ec58984d3cd8baac09c2ab40629281fde9e06" ]
[ "generator/Stainer.py" ]
[ "import numpy\nfrom PIL import Image\nfrom pathlib import Path\n\nclass Stainer:\n def __init__(self):\n self.gen = StainGenerator()\n\n def stain(self, canvas, num_stains=1):\n for j in range(num_stains):\n self.gen.load_random_stain()\n opacity = (50 + numpy.random.randint(51)) / 100 \n can...
[ [ "numpy.floor", "numpy.random.randint" ] ]
eshcherb/tensorflow-upstream
[ "52b3cda6d12a7591b4a394a99903b1a778746c24", "52b3cda6d12a7591b4a394a99903b1a778746c24" ]
[ "tensorflow/python/kernel_tests/qr_op_test.py", "tensorflow/python/ops/init_ops_test.py" ]
[ "# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.linalg_ops.qr", "numpy.ndarray", "tensorflow.python.ops.array_ops.placeholder", "tensorflow.python.ops.variables.Variable", "tensorflow.python.platform.test.is_built_with_rocm", "tensorflow.python.framework.ops.device", "numpy.linalg.qr", "numpy.divide", ...
matiasllo/nbdevtest
[ "e62a5a96f2d06f464c2fb72f08f3a6fa4a321013" ]
[ "web_app/app.py" ]
[ "### Data\nimport pandas as pd\nimport pickle\n### Graphing\nimport plotly.graph_objects as go\n### Dash\nimport dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport dash_bootstrap_components as dbc\nfrom dash.dependencies import Output, Input\n## Navbar\nfrom navbar import Navbar\n...
[ [ "pandas.read_csv" ] ]
ygjwd12345/CAF
[ "3eea5573a3fb414b9ddc5da0120f37c98f74544a" ]
[ "test.py" ]
[ "import utils\nimport argparser\nimport os\nfrom utils.logger import Logger\n\nfrom apex.parallel import DistributedDataParallel\nfrom apex import amp\nfrom torch.utils.data.distributed import DistributedSampler\n\nimport numpy as np\nimport random\nimport torch\nfrom torch.utils import data\nfrom torch import dist...
[ [ "torch.distributed.init_process_group", "numpy.random.seed", "torch.cuda.manual_seed", "torch.cuda.set_device", "torch.manual_seed", "torch.load", "torch.utils.data.distributed.DistributedSampler", "torch.utils.data.random_split", "torch.optim.SGD", "torch.device", "tor...
Yepman0620/Music
[ "b5f43e9137755a3db65752a7c4922dce615870ca" ]
[ "magenta/models/music_vae/data_test.py" ]
[ "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "numpy.split", "tensorflow.test.main", "tensorflow.placeholder", "numpy.stack", "numpy.concatenate", "numpy.testing.assert_array_equal", "numpy.append", "numpy.argmax", "numpy.any", "numpy.array" ] ]
siwill22/GPlatesReconstructionModel
[ "4306b8aa00eac35cd35a9f67e11f5bdf5106bb81" ]
[ "gprm/utils/sphere.py" ]
[ "import numpy as np\nimport pygplates\nfrom scipy import spatial\nimport pandas as pd\n\n\ndef marsaglias_method(N=10000):\n\n ## Marsaglia's method\n dim = 3\n\n norm = np.random.normal\n normal_deviates = norm(size=(dim, N))\n\n radius = np.sqrt((normal_deviates**2).sum(axis=0))\n points = norma...
[ [ "numpy.radians", "numpy.sqrt", "numpy.unique", "numpy.isnan", "numpy.arange", "numpy.degrees", "numpy.arccos", "numpy.cos", "numpy.sin", "numpy.shape", "numpy.array", "numpy.zeros", "scipy.spatial.cKDTree", "numpy.vstack" ] ]
zerothi/scipy
[ "396a3592767c7477d14083053ac7b772951f125e" ]
[ "scipy/sparse/csc.py" ]
[ "\"\"\"Compressed Sparse Column matrix format\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\n__docformat__ = \"restructuredtext en\"\n\n__all__ = ['csc_matrix', 'isspmatrix_csc']\n\n\nimport numpy as np\nfrom scipy._lib.six import xrange\n\nfrom .base import spmatrix\nfrom ._sparsetools ...
[ [ "numpy.argsort", "scipy._lib.six.xrange", "numpy.empty" ] ]
deeplearnerJHB/PlaNet-1
[ "81112c19e6c34f5bb9c637f57c7a89816d564976" ]
[ "env.py" ]
[ "import cv2\nimport numpy as np\nimport torch\n\n\nGYM_ENVS = ['Pendulum-v0', 'MountainCarContinuous-v0', 'Ant-v2', 'HalfCheetah-v2', 'Hopper-v2', 'Humanoid-v2', 'HumanoidStandup-v2', 'InvertedDoublePendulum-v2', 'InvertedPendulum-v2', 'Reacher-v2', 'Swimmer-v2', 'Walker2d-v2']\nCONTROL_SUITE_ENVS = ['cartpole-bala...
[ [ "torch.rand_like", "torch.cat", "torch.tensor", "numpy.floor", "numpy.random.uniform", "numpy.array" ] ]
lovaulonze/2D_dielectric
[ "2c702a7304ce3161bf2a10ed093d87b66d5b3d5f" ]
[ "sub_doping.py" ]
[ "import sys\nimport os, os.path\nimport subprocess\nimport numpy\n\nif __name__ == \"__main__\":\n formula = sys.argv[1]\n kind = sys.argv[2]\n program = \"bsub\"\n params = [\"-n\", \"4\", \"-W\", \"04:00\", \"-R\", \"\\\"rusage[mem=4096]\\\"\"]\n run_string = \"\\\"mpirun -n 4 gpaw-python run_dopin...
[ [ "numpy.linspace" ] ]
Renata1995/Topic-Distance-and-Coherence
[ "d567d5b3ef71ea5654f214aa3736add7f3ac94bc", "d567d5b3ef71ea5654f214aa3736add7f3ac94bc" ]
[ "coh_plot_log_notfidf.py", "count_zeroavg.py" ]
[ "import numpy as np\nimport numpy\nimport matplotlib.pyplot as plt\nimport sys\n\nif len(sys.argv) <= 1:\n topics_count = 3\nelse:\n topics_count = sys.argv[1]\n\nstart_wc = 10\nstop_wc = 150\nstep_wc = 5\n# get tc values based on randomly generated numbers\nrandlist = []\nfor num in range(10,150,10):\n if...
[ [ "matplotlib.pyplot.legend", "numpy.polyfit", "numpy.log", "matplotlib.pyplot.figure", "matplotlib.pyplot.gcf", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.average", "matplotlib.pyplot.ylabel" ], [ "numpy.average" ] ]
DavidSzmul/CoinbaseBot
[ "171192a3d2b276af5885002f38d7edad105657f1" ]
[ "Python_Bot/displayer/displayer_rl_train.py" ]
[ "import matplotlib.pyplot as plt\nimport tkinter as tk\n\nfrom rl_lib.manager.manager import RL_Train_Perfs, RL_Train_Perfs_Historic\nfrom displayer.displayer import Matplotlib_Displayer, MatplotlibPlot\n\nclass Displayer_RL_Train(Matplotlib_Displayer):\n '''Dipslayer specific to RL training'''\n \n def __...
[ [ "matplotlib.pyplot.subplots", "matplotlib.pyplot.close" ] ]
PanJason/ML_Proj
[ "663be12e8eb6e30e3c902a4984ac0db33bfce605", "663be12e8eb6e30e3c902a4984ac0db33bfce605" ]
[ "view.py", "vertebraLandmark/cobb_evaluate.py" ]
[ "import numpy as np\nimport cv2 as cv\nimport json\nimport random\nimport os\nimport os.path as path\n\nimport data\nimport option\n\nparams = option.read()\n\n\ndef scaling(img):\n height, width = img.shape[:2]\n targeth, targetw = 600, 600\n img = cv.resize(img, (targeth, targetw), interpolation=cv.INTER...
[ [ "numpy.array", "numpy.full" ], [ "numpy.amax", "numpy.clip", "numpy.asarray", "numpy.arccos", "numpy.max", "numpy.argmax", "numpy.transpose", "numpy.sum" ] ]
obastani/verifair
[ "1d5efea041330fa9fe8d59d976bdd3ef97aff417" ]
[ "python/verifair/benchmarks/fairsquare_causal/helper.py" ]
[ "import numpy as np\n\nclass SampleException(Exception):\n pass\n\ndef qualified(b):\n if not b:\n raise SampleException()\n\ndef fairnessTarget(b):\n pass\n\ndef gaussian(mu, sigma):\n return np.random.normal(mu, np.sqrt(sigma))\n\ndef _check(vals):\n for i, val in enumerate(vals):\n i...
[ [ "numpy.array", "numpy.zeros", "numpy.sqrt" ] ]
AudreyBeard/netdev
[ "156d49af5e911b454596bad590de1825d4415753" ]
[ "netdev/networks/lunet.py" ]
[ "from ..netskel import NetworkSkeleton\n\nimport torch\nfrom torch import nn\nfrom torchvision.models import resnet\n\n# TODO:\n# [ ] Get rid of the 'dvecs' construction\n# [x] Get rid of the MNISTEmbeddingNet\n\n\nclass Downsample(nn.Sequential):\n def __init__(self, in_channels, out_channels, stride=1, expansi...
[ [ "torch.nn.BatchNorm1d", "torch.reshape", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.nn.LeakyReLU", "torch.nn.BatchNorm2d" ] ]
stefanches7/gin-train
[ "745f2dea67b6639e5425b980fc4eda09bcdb66c7" ]
[ "gin_train/cli/gin_train.py" ]
[ "\"\"\"Train models using gin configuration\n\"\"\"\nimport gin\nimport json\nimport sys\nimport os\nimport yaml\nfrom uuid import uuid4\nfrom fs.osfs import OSFS\nimport numpy as np\nfrom tqdm import tqdm\nfrom gin_train.remote import upload_dir\nfrom gin_train.config import create_tf_session\nfrom gin_train.utils...
[ [ "tensorflow.set_random_seed", "numpy.random.seed" ] ]
MichaelAllen1966/2105_london_acute_stroke_unit
[ "56b710c58b5b6bdf5c03e3fb9ec65c53cd5336ff" ]
[ "experiments/centralisation/centralisation.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\ndata = pd.read_csv('results.csv')\nlabels = [1,2,3,4]\nwidth = 0.75\n\n\nx = np.arange(len(labels)) # the label locations\n\nfig = plt.figure(figsize=(9,6))\n\n# Number people waiting \nax1 = fig.add_subplot(121)\n\ny1 = data['av_waiting'...
[ [ "matplotlib.pyplot.tight_layout", "pandas.read_csv", "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
ThomasCaud/python
[ "369405f37201a460057ec01c4f7ba4aa32d7e040" ]
[ "RegressionLogistic/explore.py" ]
[ "import numpy as np\nfrom numpy import exp, log\n# import scipy as scipy\n# from scipy import optimize\n\ndata = np.loadtxt('data.txt')\nhasSucceeded = data[:,0]\nisNotGI = data[:,1]\nsemesterNumber = data[:,2]\nn, = hasSucceeded.shape\n\n# Question 3 - Calcul de la vraisemblance\ndef probX(alpha):\n\treturn (exp(a...
[ [ "numpy.exp", "numpy.loadtxt" ] ]
Fafa87/keras_yolo2
[ "2516415fddd28eef28c9503a1fe9ef280d17be85", "2516415fddd28eef28c9503a1fe9ef280d17be85", "2516415fddd28eef28c9503a1fe9ef280d17be85" ]
[ "predict.py", "keras_yolov2/utils.py", "extract_all_rois.py" ]
[ "#! /usr/bin/env python3\nfrom keras_yolov2.utils import draw_boxes, get_session\nfrom keras_yolov2.frontend import YOLO\nfrom keras_yolov2.utils import list_images\nfrom tqdm import tqdm\nimport numpy as np\nimport argparse\nimport keras\nimport json\nimport cv2\nimport os\n\nos.environ[\"CUDA_DEVICE_ORDER\"] = \"...
[ [ "numpy.uint8" ], [ "numpy.fromfile", "numpy.maximum", "numpy.expand_dims", "numpy.min", "numpy.finfo", "numpy.concatenate", "tensorflow.ConfigProto", "numpy.max", "numpy.argmax", "tensorflow.Session", "numpy.argsort", "numpy.exp", "numpy.where", "num...
snooplsm/models
[ "c1798bb447282b23164978bad41686f997110924" ]
[ "research/deeplab/vis.py" ]
[ "# Lint as: python2, python3\n# 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/L...
[ [ "tensorflow.Graph", "tensorflow.shape", "tensorflow.slice", "tensorflow.train.MonitoredSession", "numpy.squeeze", "tensorflow.squeeze", "tensorflow.train.get_or_create_global_step", "tensorflow.expand_dims", "tensorflow.global_variables_initializer", "tensorflow.train.Chief...
florisvb/gps_wind_station
[ "a1141d6ff4b237287ab2c7fbdb4188de3947655e" ]
[ "load_windgps_data_to_pandas.py" ]
[ "import numpy as np \nimport pandas\nimport os\n\n\ndef get_filenames(path, contains, does_not_contain=['~', '.pyc']):\n cmd = 'ls ' + '\"' + path + '\"'\n ls = os.popen(cmd).read()\n all_filelist = ls.split('\\n')\n try:\n all_filelist.remove('')\n except:\n pass\n filelist = []\n ...
[ [ "numpy.hstack", "numpy.fromfile", "numpy.dtype", "pandas.DataFrame", "numpy.std" ] ]
Edwardhk/pgdrive
[ "649d32309ab2cec2a2d00283ce400af28ca85199" ]
[ "pgdrive/envs/marl_envs/marl_inout_roundabout.py" ]
[ "import gym\nimport numpy as np\nfrom pgdrive.envs.multi_agent_pgdrive import MultiAgentPGDrive\nfrom pgdrive.obs import ObservationType\nfrom pgdrive.obs.state_obs import StateObservation\nfrom pgdrive.scene_creator.blocks.first_block import FirstBlock\nfrom pgdrive.scene_creator.blocks.roundabout import Roundabou...
[ [ "numpy.asarray", "numpy.random.uniform", "numpy.random.normal", "matplotlib.pyplot.show" ] ]
rjw57/ul-globe
[ "23c869f7001b14bd942a97585822e25c46ad6474" ]
[ "gdal2tile/gdal2tilesp.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#******************************************************************************\n# $Id$\n#\n# Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/)\n# Support: BRGM (http://www.brgm.fr)\n# Purpose: Convert a raster into TMS (Tile Map Service) ti...
[ [ "numpy.zeros" ] ]
Ali-Parandeh/Udacity_AI_Programming_Nanodegree
[ "638fa8571cdaf1f11db0744e3a84278bbd290a89" ]
[ "2. Numpy, Pandas, Matplotlib/Lesson 5. Matplotlib and Seaborn - Part 2/solutions_biv.py" ]
[ "\"\"\"\nScript with solutions for all workspace assignments in the Bivariate\nExploration of Data lesson.\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sb\n\n\ndef scatterplot_solution_1():\n \"\"\"\n Solution for Question 1 in scatterplot practice: cr...
[ [ "pandas.read_csv", "pandas.api.types.CategoricalDtype", "matplotlib.pyplot.scatter", "matplotlib.pyplot.hist2d", "matplotlib.pyplot.colorbar", "pandas.__version__.split", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "numpy.sum", "matplotlib.pyplot.ylabel" ] ]
carrtesy/Autoformer
[ "8b6ff1eb77d72cbaa45c6819435782d2c0c89009" ]
[ "exp/exp_main.py" ]
[ "from data_provider.data_factory import data_provider\nfrom exp.exp_basic import Exp_Basic\nfrom models import Informer, Autoformer, Transformer, Nbeats\nfrom utils.tools import EarlyStopping, adjust_learning_rate, visual\nfrom utils.metrics import metric\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\n...
[ [ "torch.ones_like", "torch.load", "torch.cat", "torch.zeros_like", "numpy.save", "torch.cuda.amp.autocast", "numpy.concatenate", "torch.cuda.amp.GradScaler", "torch.no_grad", "numpy.average", "torch.nn.DataParallel", "numpy.array", "torch.nn.MSELoss" ] ]
garbagetrash/orbital
[ "92a81391bd4a97dc45caaaf7ae2600efecb345fd", "92a81391bd4a97dc45caaaf7ae2600efecb345fd" ]
[ "orbital/tests/test_orbital.py", "orbital/utilities.py" ]
[ "import math\nimport unittest\n\nfrom numpy import radians\nfrom orbital import earth, KeplerianElements, venus\nfrom orbital.utilities import mod\nfrom scipy.constants import kilo\n\n\nclass TestOrbitalElements(unittest.TestCase):\n\n def test_anomaly_at_time(self):\n orbit = KeplerianElements.with_perio...
[ [ "numpy.radians" ], [ "numpy.dot", "numpy.hstack", "numpy.sqrt", "numpy.linalg.norm", "numpy.cos", "numpy.sin", "numpy.cross", "numpy.array" ] ]
mitcgs/pylinac
[ "e36a531b2db72f7d2bd0a754125c6c92ae60e8e8" ]
[ "pylinac/log_analyzer.py" ]
[ "\"\"\"\nThe log analyzer module reads and parses Varian linear accelerator machine logs, both Dynalogs and Trajectory logs. The module also\ncalculates actual and expected fluences as well as performing gamma evaluations. Data is structured to be easily accessible and\neasily plottable.\n\nUnlike most other module...
[ [ "matplotlib.pyplot.autoscale", "numpy.nan_to_num", "numpy.cumsum", "numpy.round", "numpy.max", "numpy.mean", "numpy.nanmean", "numpy.histogram", "numpy.where", "numpy.intersect1d", "numpy.size", "matplotlib.pyplot.subplot", "numpy.diff", "numpy.std", "ma...
AkshayHebbar/ChainReactionAI
[ "0ee27bfe032a1a5cda1acaa09b596507c70265ab" ]
[ "ChainReaction/PlayGame/play_game.py" ]
[ "import numpy as np\nfrom Util.utilities import *\n#from Display.print_board import print_board\nimport time\n\ndef insert_atom(board,pos:tuple,player:int):\n #x,y = val\n #plr = 1 if player>0 else -1\n #insert_success = False\n #check if pos is valid in grid\n if(board[pos]==0):\n #board[pos]+= plr\n bo...
[ [ "numpy.sign" ] ]
neonerd0/TensorFly
[ "5e022f537ed7a7b8aa60357f118d5743b82040cb" ]
[ "scripts/label_image.py" ]
[ "\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport sys\nimport time\n\nimport numpy as np\nimport tensorflow as tf\n\n\ndef load_graph(model_file):\n graph = tf.Graph()\n graph_def = tf.GraphDef()\n\n with open(model_...
[ [ "tensorflow.Graph", "tensorflow.image.resize_bilinear", "tensorflow.import_graph_def", "tensorflow.read_file", "tensorflow.gfile.GFile", "numpy.squeeze", "tensorflow.cast", "tensorflow.image.decode_png", "tensorflow.expand_dims", "tensorflow.image.decode_bmp", "tensorfl...
Geosyntec/nereid
[ "3399b616ae19dfc75f5b6ba83d598495db9b09fb" ]
[ "nereid/nereid/tests/test_src/test_land_surface/test_loading.py" ]
[ "import numpy\nimport pandas\nimport pytest\n\nfrom nereid.core.io import parse_configuration_logic\nfrom nereid.src.land_surface.loading import (\n clean_land_surface_dataframe,\n detailed_loading_results,\n detailed_pollutant_loading_results,\n detailed_volume_loading_results,\n)\nfrom nereid.src.wq_p...
[ [ "numpy.random.random", "numpy.random.seed", "pandas.DataFrame", "numpy.testing.assert_array_equal", "numpy.testing.assert_allclose", "numpy.random.randint" ] ]
reservoirgenomics/peax
[ "3eb3f00806cf7f1be896cea9ae5f71ae95b7df85" ]
[ "server/classifier.py" ]
[ "\"\"\"\nCopyright 2018 Novartis Institutes for BioMedical Research Inc.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\nhttp://www.apache.org/licenses/LICENSE-2.0\nUnless required by appli...
[ [ "sklearn.utils.all_estimators" ] ]
dendisuhubdy/tvm
[ "7cb85d81968cd69576d923852d812590b93cc26d" ]
[ "topi/tests/python/test_topi_clip.py" ]
[ "\"\"\"Test code for clip operator\"\"\"\nimport numpy as np\nimport tvm\nimport topi\nfrom topi.util import get_const_tuple\nfrom tvm.contrib.pickle_memoize import memoize\n\n\ndef verify_clip(N, a_min, a_max, dtype):\n A = tvm.placeholder((N, N), dtype=dtype, name='A')\n B = topi.clip(A, a_min, a_max)\n ...
[ [ "numpy.random.uniform", "numpy.clip" ] ]
NSLS-II-ISS/profile_collection
[ "77e5567fa8c5b3dfb249174ce951279899b2c917" ]
[ "startup/71-prepare-beamline.py" ]
[ "\nimport time as ttime\nimport sys\nimport numpy as np\nfrom xas.xray import energy2angle\nfrom xas.energy_calibration import get_energy_offset\n# from xas.image_analysis import determine_beam_position_from_fb_image\n\n\ndef _compute_hhmy_value(energy):\n # tabulation is done using data collected on 2021-09-12 ...
[ [ "numpy.abs", "numpy.ones", "numpy.sign", "numpy.linalg.lstsq", "numpy.deg2rad", "numpy.array" ] ]
guberti/keras
[ "255b3f645d42464d4f8c80e97200d4dacc513616" ]
[ "keras/metrics/metrics.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.executing_eagerly", "tensorflow.compat.v2.minimum", "tensorflow.compat.v2.debugging.assert_shapes", "tensorflow.compat.v2.shape", "tensorflow.compat.v2.convert_to_tensor", "tensorflow.compat.v2.squeeze", "tensorflow.compat.v2.reduce_sum", "tensorflow.compat.v2...
cunningham-lab/epi
[ "38febae7035ca921334a616b0f396b3767bf18d4" ]
[ "scripts/RNN/.backup/APT.py" ]
[ "import numpy as np\nimport theano\nimport time\nimport delfi.distribution as dd\nfrom delfi.inference.BaseInference import BaseInference\nfrom delfi.neuralnet.Trainer import Trainer, ActiveTrainer\nfrom delfi.neuralnet.loss.regularizer import svi_kl_init, svi_kl_zero\nfrom delfi.neuralnet.loss.lossfunc import \\\n...
[ [ "numpy.log", "numpy.expand_dims", "numpy.minimum", "numpy.min", "numpy.asarray", "numpy.isnan", "numpy.eye", "numpy.stack", "numpy.finfo", "numpy.all", "numpy.ones", "numpy.concatenate", "numpy.mean", "numpy.diff", "numpy.zeros", "numpy.sum" ] ]
minhtannguyen/ffjord
[ "f3418249eaa4647f4339aea8d814cf2ce33be141", "f3418249eaa4647f4339aea8d814cf2ce33be141" ]
[ "temp_codes/train_cnf_sup.py", "vae_lib/models/flows.py" ]
[ "import argparse\nimport os\nimport time\nimport numpy as np\n\nimport torch\nimport torch.optim as optim\nimport torchvision.datasets as dset\nimport torchvision.transforms as tforms\nfrom torchvision.utils import save_image\n\nimport lib.layers as layers\nimport lib.utils as utils\nimport lib.odenvp_conditional a...
[ [ "numpy.log", "torch.load", "torch.zeros", "torch.randn", "numpy.arange", "torch.sum", "torch.utils.data.DataLoader", "torch.is_tensor", "torch.no_grad", "numpy.mean", "torch.cuda.is_available", "torch.nn.DataParallel", "numpy.array" ], [ "torch.nn.Sequen...
VukanJ/lwtnn
[ "7519b20994a1b8263612e9fb52f6e23f826412a7" ]
[ "converters/keras_v2_layer_converters.py" ]
[ "# __________________________________________________________________________\n# Layer converters\n#\n# Each of these converters takes three arguments:\n# - The H5 Group with the layer parameters\n# - The layer configuration\n# - The number of inputs (for error checking)\n#\n# Each returns two outputs:\n# - A d...
[ [ "numpy.asarray", "numpy.sqrt" ] ]
thehapax/TradzQAI
[ "e2847a1fa625181649407066134838145bb814e1" ]
[ "TradzQAI/core/environnement/base/wallet.py" ]
[ "from collections import deque\nfrom decimal import *\nimport numpy as np\nfrom tqdm import tqdm\n\nclass Wallet(object):\n\n def __init__(self):\n\n self.pnl = dict(\n current = 0,\n daily = 0,\n total = 0,\n percent = 0\n )\n\n self.unrealized_pn...
[ [ "numpy.sqrt", "numpy.argmax", "numpy.mean", "numpy.argmin", "numpy.maximum.accumulate", "numpy.array" ] ]
mt-upc/SHAS
[ "4e9a84fabb851db7c682271b779264d1e7192439" ]
[ "src/supervised_hybrid/models.py" ]
[ "import torch\nfrom transformers import Wav2Vec2Model\n\n\nclass SegmentationFrameClassifer(torch.nn.Module):\n def __init__(\n self,\n d_model: int,\n nhead: int = 8,\n n_transformer_layers: int = 0,\n init_dropout: float = 0.1,\n ) -> None:\n super().__init__()\n\n ...
[ [ "torch.nn.Dropout", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.nn.Identity", "torch.nn.TransformerEncoderLayer" ] ]
CamelKing1997/AICVTools
[ "8b72967f72839e9cc32bfa7e2e6ad5e6b70ead96" ]
[ "DrawLabels/drawYoloLabel.py" ]
[ "import os\nfrom tqdm import tqdm\nimport cv2\nimport numpy as np\n\nfrom utils.TextTools import removeCRLF\n\nROOT = 'E:/00_Project/2022/Tools/PythonCVTools'\nDATAPATH = '../DrawLabels/data/20220316'\nOutputPath = os.path.join(DATAPATH, 'Drawed')\n# classestxt = ['scratch']\n\n\ndef drawLabel():\n for folderroo...
[ [ "numpy.random.uniform" ] ]
ka10ryu1/excrement_search
[ "06020e90a1cbdb630d9f3fcb06e04015ab1630c0", "06020e90a1cbdb630d9f3fcb06e04015ab1630c0" ]
[ "Tools/Tests/test_imgfunc.py", "cv_demo.py" ]
[ "#!/usr/bin/env python3\n# -*-coding: utf-8 -*-\n#\nhelp = 'imgfuncのテスト用コード'\n#\n\nimport logging\n# basicConfig()は、 debug()やinfo()を最初に呼び出す\"前\"に呼び出すこと\nlogging.basicConfig(format='%(message)s')\nlevel = logging.INFO\nlogging.getLogger('Tools').setLevel(level=level)\n\nimport cv2\nimport unittest\nimport numpy as n...
[ [ "numpy.sum" ], [ "numpy.hstack", "numpy.ones", "numpy.mean", "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.vstack" ] ]
luke18/CVXR
[ "fc9a5d1146d234a7f59b6365a5df8fbe1b5e8447" ]
[ "inst/python/mosekglue.py" ]
[ "\"\"\"\nCopyright 2015 Enzo Busseti\n [ Modified by Balasubramanian Narasimhan ]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnle...
[ [ "scipy.sparse.find", "scipy.sparse.eye", "numpy.arange", "numpy.concatenate", "scipy.sparse.bmat", "numpy.zeros" ] ]
tincher/Monk_Object_Detection
[ "4d33b100a642eabdfb70aacd22d591cddfe04f98" ]
[ "4_efficientdet/lib/train_detector.py" ]
[ "import os\nimport argparse\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader\nfrom torchvision import transforms\nfrom dataset import CocoDataset, Resizer, Normalizer, Augmenter, collater\nfrom model import EfficientDet\nfrom tensorboardX import SummaryWriter\nimport shutil\nimport nump...
[ [ "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.cuda.manual_seed", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.nn.DataParallel", "numpy.mean", "torch.rand", "torch.cuda.is_available", "torch.no_grad", "torch.cuda.device_count" ] ]
joyce-fang/deep-reinforcement-learning
[ "62cedab584465bd1c3ef112eb149e8fc611546e3" ]
[ "p3_collab-compet/buffer.py" ]
[ "from collections import namedtuple, deque\nimport random\nimport torch\nimport numpy as np\n\nclass ReplayBuffer:\n \"\"\"Fixed-size buffer to store experience tuples.\"\"\"\n\n def __init__(self, action_size, buffer_size, batch_size, device, seed):\n \"\"\"Initialize a ReplayBuffer object.\n P...
[ [ "numpy.vstack" ] ]
jparklev/jesse
[ "db324129ba80a89e7a580d17ed17bb72bdb96836" ]
[ "tests/test_state_trades.py" ]
[ "import numpy as np\n\nimport jesse.helpers as jh\nfrom jesse.config import config, reset_config\nfrom jesse.store import store\n\n\ndef set_up():\n \"\"\"\n\n \"\"\"\n reset_config()\n config['app']['considering_candles'] = [('Sandbox', 'BTCUSD')]\n store.reset()\n store.trades.init_storage()\n\n...
[ [ "numpy.zeros" ] ]
Code-Cornelius/pytorch-lightning
[ "ce95891f6ab21a6cb1e5e6bc46cebafe9aab6057", "ce95891f6ab21a6cb1e5e6bc46cebafe9aab6057" ]
[ "tests/callbacks/test_early_stopping.py", "pytorch_lightning/callbacks/gpu_stats_monitor.py" ]
[ "# Copyright The PyTorch Lightning team.\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...
[ [ "torch.tensor", "numpy.mean", "numpy.diff", "torch.load" ], [ "torch.cuda.device_count" ] ]
buswinka/MitoInstance
[ "ca6d3fead62fa91bd243e039f44b07c7f07f366b", "ca6d3fead62fa91bd243e039f44b07c7f07f366b" ]
[ "src/functional.py", "src/explore_lif.py" ]
[ "from sklearn.cluster import DBSCAN, OPTICS\nfrom hdbscan import HDBSCAN\nimport torch\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom typing import Iterable\nimport skimage\nimport skimage.exposure\nimport skimage.filters\nimport skimage.morphology\nimport skimage.feature\nimport skimage.segmentation\ni...
[ [ "torch.mean", "torch.linspace", "torch.ones", "torch.empty", "torch.max", "torch.load", "numpy.unique", "torch.zeros", "torch.min", "matplotlib.pyplot.hist2d", "numpy.stack", "sklearn.cluster.DBSCAN", "torch.tensor", "torch.nonzero", "torch.logical_and",...
sebimarkgraf/heat
[ "9638e384f52c9bade75590963b9d57e080692da4" ]
[ "heat/spatial/distance.py" ]
[ "import torch\nimport numpy as np\nfrom mpi4py import MPI\n\nfrom ..core import factories\nfrom ..core import types\n\n__all__ = [\"cdist\", \"manhattan\", \"rbf\"]\n\n\ndef _euclidian(x, y):\n \"\"\"\n Helper function to calculate euclidian distance between torch.tensors x and y: sqrt(|x-y|**2)\n Based on...
[ [ "torch.mm", "torch.transpose", "torch.zeros", "torch.exp", "torch.cdist", "torch.clamp" ] ]
viswavi/lime
[ "d3e3ae04f9771b5f627f82740ff77b94977e4911" ]
[ "contrastlime/tests/test_discretize.py" ]
[ "import unittest\nfrom unittest import TestCase\n\nimport numpy as np\n\nfrom sklearn.datasets import load_iris\n\nfrom comparelime.discretize import QuartileDiscretizer, DecileDiscretizer, EntropyDiscretizer\n\n\nclass TestDiscretize(TestCase):\n\n def setUp(self):\n iris = load_iris()\n\n self.fe...
[ [ "numpy.random.RandomState", "sklearn.datasets.load_iris" ] ]
yueatsprograms/UDA_Self_Supervision
[ "b256316283e74b5d1f16777f029c384ee9b6e2e7" ]
[ "utils/plot_all_epoch_stats.py" ]
[ "import numpy as np\n\ndef prune_ticks_labels(ticks, labels):\n\tticks = np.asarray(ticks)\n\tlabels = np.asarray(labels)\n\n\tif len(labels) > 15 and len(labels) <= 50:\n\t\tidx = np.where(labels % 5 == 0)\n\t\tlabels = labels[idx]\n\t\tticks = ticks[idx]\n\telif len(labels) > 50 and len(labels) <= 100:\n\t\tidx =...
[ [ "matplotlib.pyplot.legend", "numpy.asarray", "matplotlib.pyplot.savefig", "numpy.max", "matplotlib.pyplot.close", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "numpy.where", "matplotlib.pyplot.ylabel" ] ]
mkirchmeyer/ostar
[ "8ae20714bc4d928805a90f8f3588e1936a153527", "8ae20714bc4d928805a90f8f3588e1936a153527" ]
[ "data_shift/usps_shift.py", "compare_visda_setting.py" ]
[ "\"\"\"\nDataset setting and data loader for USPS.\nModified from https://github.com/corenel/pytorch-adda/\n\"\"\"\n\nimport gzip\nimport os\nimport pickle\nimport urllib\nimport numpy as np\nimport torch\nimport torch.utils.data as data\nfrom torchvision import transforms\n\n\nclass USPS(data.Dataset):\n \"\"\"...
[ [ "torch.cat", "torch.randperm", "numpy.arange", "torch.zeros", "torch.utils.data.DataLoader", "numpy.random.shuffle", "torch.unique", "numpy.array", "numpy.sum" ], [ "numpy.array" ] ]
tuanle618/image-segmentation
[ "d1c14516b41da4d4128d7ae758a386a95baab72d" ]
[ "preprocess_data.py" ]
[ "# taken from https://github.com/kamalkraj/DATA-SCIENCE-BOWL-2018/blob/master/data_util.py\n# slighty modified with argparse and other os.savings\nimport os\nimport random\nimport sys\nimport warnings\nimport numpy as np\nfrom itertools import chain\nfrom skimage.io import imread\nfrom skimage.transform import resi...
[ [ "numpy.maximum", "numpy.zeros" ] ]
brbzjl/my_faster_rcnn
[ "5121fdc8ec1d4e7ea7479f80856096dd5a323df7" ]
[ "trainval_net.py" ]
[ "# --------------------------------------------------------\n# Pytorch multi-GPU Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick\n# --------------------------------------------------------\nfrom __future__ import absolu...
[ [ "torch.optim.Adam", "torch.LongTensor", "numpy.random.seed", "torch.load", "torch.cat", "torch.randperm", "torch.utils.data.DataLoader", "torch.arange", "torch.FloatTensor", "torch.cuda.is_available", "torch.optim.SGD", "torch.nn.DataParallel", "torch.autograd.V...
ishine/Parallel-Tacotron-2
[ "138c29e6211d417464cb3386eb6740b1afe7f3b8" ]
[ "pt2/trainer.py" ]
[ "\"\"\"main training script.\"\"\"\nimport importlib.util\nimport logging\nfrom pathlib import Path\n\nimport einops\nimport matplotlib.pyplot as plt\nimport torch\nfrom torch.functional import einsum\nfrom torch.nn.utils.rnn import pack_sequence, pad_packed_sequence, pad_sequence\n\nfrom pt2.dataloader import crea...
[ [ "matplotlib.pyplot.legend", "torch.LongTensor", "torch.abs", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.Tensor", "torch.load", "torch.zeros", "torch.nn.utils.rnn.pad_sequence", "torch.sum", "torch.from_numpy", "torch.zeros_like", "matplotlib.pyplot.savefig...
Jokererer/VIT-ResNet-CIFAR10
[ "a6cc2f1c6bc720e1d899020da6573f56686db109" ]
[ "da.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @File : da.py\n# @Author: Kong Hui\n# @Date : 2021/11/7\n# @Desc :\n\nimport numpy as np\nimport torch\n\n\nclass RandomCropPaste(object):\n def __init__(self, size, alpha=1.0, flip_p=0.5):\n \"\"\"Randomly flip and paste a cropped image on the same im...
[ [ "numpy.random.beta", "numpy.sqrt", "numpy.clip", "torch.randperm", "numpy.int", "numpy.random.rand", "numpy.random.uniform", "numpy.random.randint" ] ]
rdaems/dm_control
[ "c682e626fde95a98b53f67f07b0c1021e4200bb8" ]
[ "dm_control/mujoco/index_test.py" ]
[ "# Copyright 2017 The dm_control 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...
[ [ "numpy.testing.assert_array_equal", "numpy.arange", "numpy.issubdtype", "numpy.array" ] ]
OferMon/Covid19-DeepLearning-XAI
[ "34c390755aafcc376c2a27a283af8e96ea7ce318" ]
[ "Src/models/model2_2L.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom keras.layers import Dense\nfrom keras.models import Sequential\nfrom keras.optimizers import Adam\nimport pickle\nimport matplotlib.pyplot as plt\nimport lime\nimport lime.lime_tabular\nfrom lime.lime_tabular import LimeTabularExplainer\n\n\n# fix random seed for repro...
[ [ "matplotlib.pyplot.legend", "pandas.concat", "pandas.read_csv", "numpy.random.seed", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
Iamlegend-Imani/AirBnB
[ "e63581f673619c5c47f3bce924eec84ec9eb7e30" ]
[ "pages/predictions.py" ]
[ "# Imports from 3rd party libraries\r\nimport dash\r\nimport dash_bootstrap_components as dbc\r\nimport dash_core_components as dcc\r\nimport dash_html_components as html\r\nfrom dash.dependencies import Input, Output, State\r\nimport dash_daq as daq\r\nimport pandas as pd\r\nfrom datetime import date\r\nfrom tenso...
[ [ "tensorflow.keras.models.load_model", "numpy.array", "numpy.arange", "pandas.DataFrame" ] ]
jplewa/qdk-python
[ "e4ce0c433cc986bc1c746e9a58f3f05733c657e2" ]
[ "azure-quantum/azure/quantum/optimization/problem.py" ]
[ "##\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n##\n\nfrom __future__ import annotations\nimport logging\nimport io\nimport gzip\nimport json\nimport numpy\nimport os\nimport tarfile\n\n\nfrom typing import List, Tuple, Union, Dict, Optional, TYPE_CHECKING\nfrom ...
[ [ "numpy.load" ] ]
liborutgers12/audiospeech
[ "0f6c0b0f3a19269446f14dc61df4e0fc4799a83d" ]
[ "utils.py" ]
[ "from __future__ import division\nimport numpy as np\n\nimport matplotlib.pyplot as plt\n\nimport pyaudio\nfrom scipy.io import wavfile\n\nimport preprocessing\n\ndef plotWaveform(audio, samplingFreq, ax=plt.figure().add_subplot(111)):\n '''Plot the audio waveform in time domain.'''\n x_values = np.arange(0, audi...
[ [ "numpy.abs", "numpy.arange", "matplotlib.pyplot.draw", "matplotlib.pyplot.show", "scipy.io.wavfile.read", "matplotlib.pyplot.figure" ] ]
tapiwam/dataSciProjects
[ "55d6fb348bc63acacfa0510ffd9787ecf49e0495", "55d6fb348bc63acacfa0510ffd9787ecf49e0495" ]
[ "machine-learning-az/Part 2 - Regression/Section 5 - Multiple Linear Regression/t_multi_linear_reg.py", "machine-learning-az/Part 1 - Data Preprocessing/Section 2 -------------------- Part 1 - Data Preprocessing --------------------/categorical_data.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the dataset\ndataset = pd.read_csv('50_Startups.csv')\nX = dataset.iloc[:, :-1].values\ny = dataset.iloc[:, 4].values\n\n# Handle categorical variables\n# Encoding categoric...
[ [ "sklearn.linear_model.LinearRegression", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.OneHotEncoder" ], [ "pandas.read_csv", "sklearn.preprocessing.Imputer" ] ]
larioandr/thesis-rfidsim
[ "6a5b3ef02964ff2d49bf5dae55af270801af28a5" ]
[ "pyons/models/rfid/phy.py" ]
[ "from enum import Enum\nimport numpy as np\n\nimport pyons\nfrom pyons import Entity\n\nfrom pyons.models.rfid import protocol as gen2, vectors, journal, pyradise\n\n\nSPEED_OF_LIGHT = 299792458.0 # meters per second\nTHERMAL_NOISE = -114.0\n\nINIT_TRANSCEIVERS_STAGE = (3, 'Transceiver Created')\nINIT_SIGNAL_STA...
[ [ "numpy.random.uniform", "numpy.dot", "numpy.array", "numpy.cross" ] ]
MAliElakhrass/DeepYed
[ "79878857f9f2fe07f3228aa5334383f5889c3c1b" ]
[ "NeuralNetKeras/DeepYedDataGenerator.py" ]
[ "from tensorflow.keras.utils import Sequence\nimport numpy as np\n\n\nclass DeepYedDataGenerator(Sequence):\n \"\"\"\n This class will be used for real-time data feeding to our Keras model\n \"\"\"\n def __init__(self, batch_size, whites, blacks, train=1):\n self.batch_size = batch_size\n ...
[ [ "numpy.split", "numpy.squeeze", "numpy.stack", "numpy.ones", "numpy.random.shuffle", "numpy.floor", "numpy.flip", "numpy.zeros", "numpy.random.randint" ] ]