repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
Jul13/wepy
[ "3f6acc7ecb4c9bcadf366d7ed1752660838d9dd7" ]
[ "wepy/io/yahoo.py" ]
[ "# Author: Gheorghe Postelnicu\nfrom datetime import date\nimport pandas as pd\nfrom io import BytesIO\nfrom urllib.request import urlopen\n\n\nclass Yahoo(object):\n # Taken from http://www.jarloo.com/yahoo_finance/\n yahoo_query_params = {\n 'ticker': 's',\n 'average_daily_volume': 'a2',\n ...
[ [ "pandas.to_datetime", "pandas.concat" ] ]
HamletWantToCode/machine_learning_kinetic_energy
[ "a8ebd46ec0442a1fcbfa7e0571f43550e1faaa70" ]
[ "tools/CV_pca_tool.py" ]
[ "import pickle\nimport numpy as np \nimport matplotlib.pyplot as plt \nfrom sklearn.model_selection import train_test_split\n\nfrom statslib.main.pca import PrincipalComponentAnalysis\nfrom statslib.main.kernel_ridge import KernelRidge\nfrom statslib.main.pipeline import MyPipe\nfrom statslib.main.utils import rbf_...
[ [ "numpy.random.RandomState", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "numpy.arange", "matplotlib.pyplot.ylabel", "sklearn.model_selection.train_test_split" ] ]
uncharted-recourse/NK-email-classifier
[ "991530b5a1ba4ff81bac16ac08c58ad13570088b" ]
[ "spam_clf_server.py" ]
[ "#\n# GRPC Server for NK Email Classifier\n# \n# Uses GRPC service config in protos/grapevine.proto\n# \n\nimport nltk.data\nfrom random import shuffle\nfrom json import JSONEncoder\nfrom flask import Flask, request\n\nimport time\nimport pandas\nimport pickle\nimport numpy as np\nimport configparser\nimport os.pat...
[ [ "pandas.DataFrame", "numpy.transpose", "numpy.asarray" ] ]
catalyst-cooperative/pudl
[ "17b3b676c3888e51ac36810751eefa43090c7a66" ]
[ "src/pudl/constants.py" ]
[ "\"\"\"\nA warehouse for constant values required to initilize the PUDL Database.\n\nThis constants module stores and organizes a bunch of constant values which are\nused throughout PUDL to populate static lists within the data packages or for\ndata cleaning purposes.\n\"\"\"\n\nimport pandas as pd\nimport sqlalche...
[ [ "pandas.BooleanDtype", "pandas.DataFrame.from_records", "pandas.StringDtype", "pandas.CategoricalDtype", "pandas.Int64Dtype", "pandas.Int32Dtype" ] ]
Hayashi-Yudai/ML_models
[ "732e1caeee9933e43b47aebdb7a22b013ad990d3" ]
[ "ACoL/model.py" ]
[ "import tensorflow as tf\n\n\nclass subbranch:\n def __init__(self, sign):\n self.sign = sign\n\n def __call__(self, inputs):\n return self.sub_block(inputs)\n\n def sub_block(self, x):\n x = tf.keras.layers.Conv2D(\n filters=1024,\n kernel_size=3,\n pa...
[ [ "tensorflow.keras.layers.Add", "tensorflow.where", "tensorflow.tile", "tensorflow.argmax", "tensorflow.subtract", "tensorflow.keras.layers.Softmax", "tensorflow.reshape", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.Model", "tensorflow.keras.layers.GlobalAveragePooli...
mikepsinn/Horizon
[ "4ce123062320c0297b80135e0b63759c02bf5699" ]
[ "ml/rl/test/workflow/test_oss_workflows.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nimport os\nimport tempfile\nimport unittest\n\nimport torch\nfrom ml.rl.training.dqn_predictor import DQNPredictor\nfrom ml.rl.workflow import ddpg_workflow, dqn_workflow, parametric_dqn_workflow\n\n\ncurr_dir = os.p...
[ [ "torch.cuda.is_available" ] ]
zhudd-hub/SSD.pruning
[ "4060c2be645b7f09cbd49dd2b7de467d91ecfa4d" ]
[ "model/modeling/backbone/mobilenetv3.py" ]
[ "\"\"\"\nCreates a MobileNetV3 Model as defined in:\nAndrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, Quoc V. Le, Hartwig Adam. (2019).\nSearching for MobileNetV3\narXiv preprint arXiv:1905.02244.\n\n\n@ Credit from https://githu...
[ [ "torch.nn.Identity", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.ReLU6", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ] ]
minhtannguyen/MomentumRNN
[ "f185c5432a52533bb1625e2162ec044651e07d9a" ]
[ "mnist-timit/.ipynb_checkpoints/mnist-checkpoint.py" ]
[ "import torch\nimport torch.nn as nn\nimport numpy as np\nimport argparse\nimport sys\nimport os\nimport random\nfrom torchvision import datasets, transforms\n\nfrom parametrization import get_parameters\nfrom orthogonal import OrthogonalRNN, OrthogonalMomentumRNN, OrthogonalAdamRNN, OrthogonalNesterovRNN\nfrom tri...
[ [ "torch.nn.Linear", "torch.device", "torch.cuda.manual_seed_all", "torch.argmax", "torch.optim.RMSprop", "numpy.random.RandomState", "numpy.random.seed", "torch.unbind", "torch.no_grad", "torch.manual_seed", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss" ] ...
OpenBMB/ModelCenter
[ "28073f24a67f6c0beb4fd5e2cd13284f9de2284a" ]
[ "tests/test_gpt2.py" ]
[ "#coding:utf-8\n\nimport torch\nimport bmtrain as bmt\n\nfrom model_center.tokenizer import GPT2Tokenizer\nfrom model_center.model import GPT2Config, GPT2\n\nfrom transformers import GPT2LMHeadModel as hugGPT2\n\ndef main():\n bmt.init_distributed()\n\n path = \"gpt2-base\"\n tokenizer = GPT2Tokenizer.from...
[ [ "torch.randint", "torch.nn.CrossEntropyLoss", "torch.arange" ] ]
rachellevanger/tda-image-analysis
[ "5560e6ec9e2b7b74f91cad25a9cdefa1df172711" ]
[ "imgtda/core/image.py" ]
[ "# TDA Image Analysis Project : core.image\n#\n# Copyright (C) 2016-2017 TDA Image Analysis Project\n# Author: Rachel Levanger <rachel.levanger@gmail.com>\n\n\n\"\"\"\nThe TDA Image Analysis Project is an open source Python library for performing\n2D image analysis via topological methods. It is meant to be used\ni...
[ [ "numpy.zeros", "pandas.DataFrame", "scipy.misc.imread", "pandas.read_csv", "numpy.vstack" ] ]
JKrse/LUKE_thesis
[ "00dcae049f6ef1fe92f1a77fdc13d373fdbca100" ]
[ "visual_attention/bertviz/util.py" ]
[ "import torch\nimport ipywidgets as widgets\nimport numpy as np\nimport matplotlib.pyplot as plt\nplt.rcParams.update({'font.size': 30, 'legend.fontsize': 20})\nplt.rc('font', size=25)\nplt.rc('axes', titlesize=25)\n\n\ndef format_attention(attention):\n squeezed = []\n for layer_attention in attention:\n ...
[ [ "matplotlib.pyplot.rcParams.update", "torch.stack", "matplotlib.pyplot.grid", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "matplotlib.pyplot.rc", "matplotlib.pyplot.tick_params", "numpy.mean", "numpy.arange", "matplotlib.pyplot.tight_layout" ] ]
rdimaio/aptbps-code
[ "7aeee442e05d6a121f62b358bc9dedb29a8ba664" ]
[ "training/mlp_train.py" ]
[ "# Adapted from: https://github.com/sergeyprokudin/bps/blob/master/bps_demos/train_modelnet_mlp.py\n\nimport numpy as np\nimport os\nimport sys\nimport multiprocessing\nimport time\n\n# PyTorch dependencies\nimport torch as pt\nimport torch.utils.data\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n# loc...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.no_grad", "numpy.load", "torch.nn.functional.cross_entropy", "torch.nn.BatchNorm1d", "numpy.savez", "torch.utils.data.DataLoader", "torch.nn.functional.nll_loss", "torch.Tensor", "torch.nn.DataParallel" ] ]
NotAyushXD/Video-Editor-
[ "57e2a197c9522e8f063a8d7fe76013c798445f40" ]
[ "videoeditorDemo.py" ]
[ "import cv2\r\nimport tkinter as tk\r\nfrom tkinter import *\r\nfrom tkinter import ttk\r\nfrom PIL import Image, ImageTk\r\nfrom moviepy.editor import *\r\nfrom tqdm import tqdm\r\nimport threading\r\nimport time\r\nimport datetime\r\nfrom tkinter import filedialog\r\nimport os\r\nfrom datetime import datetime\r\n...
[ [ "numpy.zeros" ] ]
akamboj2/EasyOCR
[ "42eb8591f9f5d2a319e6a08446c384871090a1bd" ]
[ "easyocr/model/model.py" ]
[ "import torch.nn as nn\nfrom .modules import ResNet_FeatureExtractor, BidirectionalLSTM\n\nclass Model(nn.Module):\n\n def __init__(self, input_channel, output_channel, hidden_size, num_class):\n super(Model, self).__init__()\n \"\"\" FeatureExtraction \"\"\"\n self.FeatureExtraction = ResNe...
[ [ "torch.nn.Linear", "torch.nn.AdaptiveAvgPool2d" ] ]
nizhf/STTran
[ "b719abaaeb51789b141ced009d9e57b95c02b42c" ]
[ "lib/sttran.py" ]
[ "\"\"\"\nLet's get the relationships yo\n\"\"\"\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom lib.word_vectors import obj_edge_vectors\nfrom lib.transformer import transformer\nfrom lib.fpn.box_utils import center_size\nfrom fasterRCNN.lib.model.roi_layers import ROIAlign, nms\nfrom lib.draw_re...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.BatchNorm2d", "torch.mode", "torch.sum", "torch.sigmoid", "torch.nn.MaxPool2d", "torch.argsort", "torch.tensor", "torch.zeros", "torch.min", "torch.max", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.argmax", "t...
pratixashah/Global-Entrepreneurship-Monitor
[ "3f5b23647806523c58baea8a5e485fcbe15577f6" ]
[ "Code_backup/BEHAVIOUR_AND_ATTITUDES/API/app.py" ]
[ "#dependencies\nfrom flask import Flask,jsonify\nimport pandas as pd\nfrom sqlalchemy import create_engine\nfrom db_config import password\nfrom flask_cors import CORS\n\napp = Flask(__name__)\nCORS(app)\n\n#engine and creating connection\nengine = create_engine(f\"postgresql://postgres:{password}@localhost:5432/ge...
[ [ "pandas.read_sql" ] ]
rendchevi/BVAE-TTS
[ "235753c13bc528430c19a34e1ca0fa1c1a631993" ]
[ "modules/.ipynb_checkpoints/model-checkpoint.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .module import *\nfrom .conv import *\nfrom utils.utils import *\n\n\nclass Model(nn.Module):\n def __init__(self, hp):\n super(Model, self).__init__()\n self.hp=hp\n self.ratio=hp.downsample_ratio\n self.text...
[ [ "torch.round", "torch.nn.MSELoss", "torch.nn.ModuleList", "torch.max", "torch.arange", "torch.nn.L1Loss", "torch.log", "torch.pow" ] ]
scaratozzolo/FinNews
[ "4166fd196b9b7fe52ae80bbb7fd0287d327f211c" ]
[ "FinNews/source_object.py" ]
[ "import feedparser\nimport time\nimport sqlite3\nimport pkg_resources\nimport pandas as pd\nimport json\nfrom .feed import Feed\n\nclass Source(object):\n\n def __init__(self, source, save_feeds=True):\n \"\"\"\n Base class for cources like CNBC, SeekingAlpha...\n save_feeds: Feed objects ca...
[ [ "pandas.DataFrame" ] ]
ajitjohnson/mipy
[ "69a904390558036cca5c1948ecc9db947f0fd5d5" ]
[ "pl/pca_het.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed May 6 09:28:00 2020\n@author: Ajit Johnson Nirmal\nPCA heterogenity plot\n\"\"\"\n\nfrom sklearn.decomposition import PCA\nfrom sklearn.preprocessing import MinMaxScaler\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as n...
[ [ "pandas.DataFrame", "numpy.percentile", "matplotlib.pyplot.savefig", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "numpy.log1p", "sklearn.preprocessing.MinMaxScaler", "matplotlib.pyplot.show", "sklearn.decomposition.PCA", "matplotlib.gridspec.GridSpec" ] ]
luweishuang/anomalib
[ "6829739f29a0289671fa1d028fc4f8a61a9f010f", "6829739f29a0289671fa1d028fc4f8a61a9f010f" ]
[ "anomalib/post_processing/post_process.py", "anomalib/models/ganomaly/torch_model.py" ]
[ "\"\"\"Post Process This module contains utils function to apply post-processing to the output predictions.\"\"\"\n\n# Copyright (C) 2020 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a ...
[ [ "numpy.zeros_like", "numpy.ptp" ], [ "torch.zeros", "torch.nn.MSELoss", "torch.nn.Sigmoid", "torch.nn.Sequential", "torch.nn.Tanh", "torch.nn.LeakyReLU", "torch.nn.ConvTranspose2d", "torch.nn.BatchNorm2d", "torch.nn.init.constant_", "torch.nn.L1Loss", "torch...
Yu-Chuan/Survival-and-death-model
[ "aa045b01bb271790b070ab79ebdcacf08a020f7a" ]
[ "survial_death_model_molecule.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Nov 27 15:32:42 2020\r\n\r\n@author: b308 Yu-Chuan Chen\r\n\"\"\"\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport os\r\n\r\n#variable name\r\nsi = ['TNF', 'TNFR1', 'TNFR1a' , 'TRADD', 'TNFR1a_TRADD', 'TRAF2', 'early_complex', \...
[ [ "numpy.array", "numpy.matmul", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "numpy.save", "matplotlib.pyplot.figure", "matplotlib.pyplot.yticks", "matplotlib.pyplot.ylabel", "numpy.linspace", "matplotlib.pyplot.xt...
zhao-david/CDE-diagnostics
[ "a3472c7c8d6d6ae831b1a78468fb7be6e3a361a1" ]
[ "src/cde_diagnostics/classifiers.py" ]
[ "from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom xgboost import XGBClassifier\nfrom sklearn.neural_network import MLPClassifier\nfrom sklearn.gaussian_process import GaussianProcess...
[ [ "sklearn.neighbors.KNeighborsClassifier", "sklearn.neural_network.MLPClassifier", "sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis", "sklearn.linear_model.LogisticRegression", "sklearn.gaussian_process.kernels.RBF" ] ]
t-mertz/slurm_utils
[ "6fc9709f62e2bca1387ea9c7a5975f0f0be5d0dd" ]
[ "sutils/utils/test_util.py" ]
[ "import unittest\n\nimport numpy as np\n\nfrom . import util\n\n\nclass TestStringify(unittest.TestCase):\n def test_empty_list(self):\n lst = []\n self.assertEqual(util.stringify_list(lst), [])\n\n def test_list_of_ints(self):\n lst = [1, 2, 3]\n self.assertEqual(util.stringify_li...
[ [ "numpy.array" ] ]
jgomezc1/WAVES
[ "17c399d9e0ff533d47705b272bc0ee9933a65307" ]
[ "MODELS/MESHER/mesh_waves.py" ]
[ "\"\"\"\nUsing meshio:\n Mesh writing subroutines to create\n input files for the finite element\n code WAVES.\n@autor Juan Gomez\n\"\"\"\nfrom __future__ import division\nimport numpy as np\n\ndef face_recognition(cells , cell_data , phy_sur , phy_lin , nini):\n \"\"\"\n For the incoming elements re...
[ [ "numpy.where", "numpy.zeros" ] ]
remorgan123/poppy
[ "2010aaac2e738ac347186e28b2258e489a22deec" ]
[ "poppy/tests/test_optics.py" ]
[ "# Tests for individual Optic classes\n\nimport matplotlib.pyplot as pl\nimport numpy as np\nimport astropy.io.fits as fits\nimport astropy.units as u\n\nfrom .. import poppy_core\nfrom .. import optics\nfrom .. import zernike\nfrom .test_core import check_wavefront\n\nwavelength=1e-6\n\n\n\n#def test_OpticalElemen...
[ [ "numpy.testing.assert_allclose", "numpy.exp", "numpy.where", "numpy.log", "numpy.arange", "numpy.sqrt", "matplotlib.pyplot.subplot", "numpy.testing.assert_almost_equal", "numpy.round", "matplotlib.pyplot.title", "numpy.roll", "matplotlib.pyplot.figure", "numpy.a...
dingyiming0427/dm_control
[ "4e9c3a0c91002ac49308faf6c61aa3ddad2ef548" ]
[ "dm_control/composer/observation/updater.py" ]
[ "# Copyright 2018 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.zeros" ] ]
Shun14/detectron2-ResNeSt
[ "cda53a237199da3bbe7526d41c41b9d8df4c4814" ]
[ "detectron2/modeling/roi_heads/cascade_rcnn.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport torch\nfrom torch import nn\nfrom torch.autograd.function import Function\n\nfrom detectron2.layers import ShapeSpec\nfrom detectron2.structures import Boxes, Instances, pairwise_iou\nfrom detectron2.utils.events import get_event_storag...
[ [ "torch.zeros_like", "torch.no_grad", "torch.nn.ModuleList" ] ]
noisysky/imaris_ims_file_reader
[ "0703ca2ef4891705ed8dcd4e408a0693dec33dd1" ]
[ "imaris_ims_file_reader/ims.py" ]
[ "import itertools\nimport os\nimport h5py\nimport numpy as np\n\nfrom skimage import io, img_as_float32, img_as_uint, img_as_ubyte\nfrom skimage.transform import rescale\n\n\nclass ims:\n def __init__(self, file, ResolutionLevelLock=0, cache_location=None, mem_size=None, disk_size=2000):\n \n ## m...
[ [ "numpy.minimum", "numpy.maximum", "numpy.squeeze", "numpy.clip" ] ]
bennames/AeroComBAT-Project
[ "ddc7194d5ccc0b8bf09b73cc0c2c3d64adf4a472" ]
[ "Tutorials/Validations/V8_BEAM_DISPLACEMENT_ROTATIONS_AL_BOX_BEAM.py" ]
[ "# =============================================================================\n# HEPHAESTUS VALIDATION 8 - BEAM DISPLACEMENTS AND ROTATIONS SIMPLE AL BOX BEAM\n# =============================================================================\n\n# IMPORTS:\n\nimport sys\nimport os\n\nsys.path.append(os.path.abspath...
[ [ "numpy.array", "numpy.linalg.norm", "matplotlib.pyplot.gca", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "numpy.genfromtxt", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel"...
AshBT/mesh-transformer-jax
[ "77019cf31baf287d1f87211a38be07d4831a4a47" ]
[ "resharding_example.py" ]
[ "# This was tested with an A100, and peak memory usage is approximately 30GB when loading the model\n\nimport time\n\nimport jax\nfrom jax.experimental import maps\nimport numpy as np\nimport optax\nimport transformers\n\nfrom mesh_transformer.checkpoint import read_ckpt\nfrom mesh_transformer.sampling import nucle...
[ [ "numpy.pad", "numpy.array", "numpy.ones" ] ]
motional/nuplan-devkit
[ "e39029e788b17f47f2fcadb774098ef8fbdd0d67" ]
[ "nuplan/planning/training/data_augmentation/simple_agent_augmentation.py" ]
[ "from typing import List, Tuple\n\nimport numpy as np\n\nfrom nuplan.planning.training.data_augmentation.abstract_data_augmentation import AbstractAugmentor\nfrom nuplan.planning.training.data_augmentation.data_augmentation_util import GaussianNoise\nfrom nuplan.planning.training.modeling.types import FeaturesType,...
[ [ "numpy.random.rand" ] ]
xiongliyu/practice_python
[ "3c430b20a6c1828b169e095b3f68af01f95b5fae" ]
[ "pandas/assignment.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport pandas as pd\nimport numpy as np\n\ndf = pd.DataFrame(np.random.randn(6, 4), index=pd.date_range('20190101', periods=6), columns=list('ABCD'))\ns = pd.Series([1, 2, 3, 4, 5, 6, 7], index=pd.date_range('20190101', periods=7))\n\n# 通过创建一个Series, 可以将Series 添加到Da...
[ [ "pandas.date_range", "numpy.random.randn" ] ]
nirzaa/particles_nir_repo
[ "5bf574241e9ac1322c63dec2cceda3d4e53f5284" ]
[ "data_loader/data_loaders.py" ]
[ "from torchvision import datasets, transforms\nfrom base import BaseDataLoader\n\nimport random\nfrom collections import Counter\nfrom pathlib import Path\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\n\nfrom base import BaseDataLoader\nfrom data_loader import EcalDataIO\nimport h5py\nim...
[ [ "torch.zeros", "numpy.array", "torch.is_tensor", "numpy.digitize", "numpy.linspace", "torch.Tensor" ] ]
Transkribus/TranskribusDU
[ "61028ee5f5f39f435bf9c461f8073e75bca344ac" ]
[ "TranskribusDU/contentProcessing/taggerIEmerge.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\n taggerIEmerge.py\n\n task: recognition of multi ouptuts classes\n \n H. Déjean\n \n copyright Naver labs Europe 2018\n READ project \n\n Developed for the EU project READ. The READ project has received funding \n from the European Union's Horizon ...
[ [ "numpy.array", "numpy.zeros", "sklearn.feature_extraction.text.CountVectorizer", "numpy.argmax", "sklearn.base.TransformerMixin.__init__", "sklearn.base.BaseEstimator.__init__" ] ]
awf/ELL
[ "cb897e3aec148a1e9bd648012b5f53ab9d0dd20c" ]
[ "interfaces/python/test/dataset_test.py" ]
[ "import os\nimport numpy as np\nfrom testing import Testing\nimport ell_helper\nimport find_ell\nimport ell\n\ndef exampleTest(example):\n # Now test the IDataVector of the example\n av = example.GetData()\n l = example.GetLabel()\n\n # test we can copy AutoDataVector to DoubleVector\n v = ell.math.D...
[ [ "numpy.asarray", "numpy.testing.assert_equal" ] ]
louareg/nncase
[ "0125654eb57b7ff753fe9c396c84b264c01f34d3" ]
[ "tests/importer/onnx/basic/test_slice.py" ]
[ "# Copyright 2019-2021 Canaan Inc.\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 or ag...
[ [ "torch.nn.Conv2d", "torch.narrow" ] ]
Lornatang/tf-dcgan
[ "eedeb8d3ca8d038a89324773e2ab9f57f3977d59" ]
[ "train.py" ]
[ "# Copyright 2019 ChangyuLiu Authors. All Rights Reserved.\n#\n# Licensed under the MIT 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# https://opensource.org/licenses/MIT\n# ================================================...
[ [ "tensorflow.random.normal", "tensorflow.GradientTape" ] ]
cshjin/POT
[ "8385b6db7a394ed48a0eff630f852a6d3952db65" ]
[ "examples/unbalanced-partial/plot_unbalanced_OT.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n==============================================================\n2D examples of exact and entropic unbalanced optimal transport\n==============================================================\nThis example is designed to show how to compute unbalanced and\npartial OT in POT.\n\nUOT ...
[ [ "numpy.array", "numpy.random.rand", "matplotlib.pylab.ylabel", "numpy.random.seed", "numpy.ones", "matplotlib.pylab.plot", "matplotlib.pylab.show", "matplotlib.pylab.figure", "matplotlib.pylab.subplot", "matplotlib.pylab.yticks", "matplotlib.pylab.title", "matplotli...
gavinsyw/BanditAlgorithm
[ "7e4e89447ba147d9918b75d97d9731799c18f500" ]
[ "compare_subsample.py" ]
[ "from subsample_ts import subsample_ts\nfrom subsample_greedy import subsample_greedy\nfrom subsample_ucb import subsample_ucb\nfrom matplotlib import pyplot\nimport numpy as np\n\nif __name__ == '__main__':\n iter_num = 40\n total_time_slot = 1000\n arm_num = 100\n reward_ucb = []\n reward_greedy = ...
[ [ "numpy.array", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.mean", "matplotlib.pyplot.show" ] ]
KorkinLab/COMP-AS
[ "8033c2222a298791d90877b907ea7defc1c4d0c3" ]
[ "IF/compute_impact.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom scipy.special import expit\n\n\ndef sigmoid(x):\n return expit(x)\n\n\nclass ImpactFactor:\n strategy = None\n implementations = None\n _scale = None\n _mid = None\n _prodsigm_scale = None\n _prodsigm_mid = None\n _bs_scale = None\n available...
[ [ "numpy.array", "numpy.zeros", "numpy.ones", "scipy.special.expit", "numpy.power", "pandas.concat", "pandas.read_csv" ] ]
ontocord/create_pii_dataset
[ "bfd246a8f8b443e238f260f307bd41d86adc3136" ]
[ "create_examples.py" ]
[ "# coding=utf-8\n# Copyright, 2021 Ontocord, LLC, 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# Unl...
[ [ "torch.quantization.quantize_dynamic" ] ]
JulienPeloton/bigviz
[ "205f5ef29d60b25e11db2e3c76fe248b56952bd8" ]
[ "create_point.py" ]
[ "#\n# Copyright 2018 Julien Peloton\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 or a...
[ [ "numpy.meshgrid", "numpy.arange" ] ]
14zwyan/RFBNet
[ "3058c0c40cec11b1bef4310ebfd721b7fae9291b" ]
[ "train_ssd_0904_v2.py" ]
[ "from __future__ import print_function\nimport sys\nimport os\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\nimport torchvision.transforms as transforms\nimport torch.nn.init as init\nimport argparse\nimport numpy as np\nfrom torch.autograd import Variable\n...
[ [ "torch.nn.init.xavier_uniform", "torch.autograd.Variable", "torch.cuda.set_device", "torch.utils.data.DataLoader", "torch.load", "torch.nn.DataParallel" ] ]
just4jc/h2o4gpu
[ "76700083643ec227818c5fd29659bd426a9d06c0", "76700083643ec227818c5fd29659bd426a9d06c0" ]
[ "tests_big/test_glm_hyatt.py", "src/interface_py/h2o4gpu/solvers/daal_solver/regression.py" ]
[ "\"\"\"\n:copyright: 2017 H2O.ai, Inc.\n:license: Apache License Version 2.0 (see LICENSE for details)\n\"\"\"\nimport time\nimport copy\nimport sys\nimport os\nimport numpy as np\nimport pandas as pd\nimport logging\n\nprint(sys.path)\n\nfrom h2o4gpu.util.testing_utils import find_file, run_glm\n\n\nlogging.basi...
[ [ "pandas.notnull", "numpy.loadtxt", "numpy.ones" ], [ "numpy.array" ] ]
tklebanoff/audio
[ "48707255575cb2175517aa86f77a87598d6ca5ea" ]
[ "test/test.py" ]
[ "import unittest\nimport test.common_utils\nimport torch\nimport torchaudio\nimport math\nimport os\n\n\nclass Test_LoadSave(unittest.TestCase):\n test_dirpath, test_dir = test.common_utils.create_temp_assets_dir()\n test_filepath = os.path.join(test_dirpath, \"assets\",\n \"st...
[ [ "torch.LongTensor", "torch.arange" ] ]
bluthen/isadore_server
[ "3f03f3daf00eb712ee705280e513dba6fd60f0cb" ]
[ "server/src/mc_prediction2017a.py" ]
[ "# Copyright 2010-2019 Dan Elliott, Russell Valentine\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 r...
[ [ "torch.nn.Linear", "torch.stack", "torch.autograd.Variable", "torch.load", "torch.div", "torch.Tensor" ] ]
sephiroce/srf
[ "24e64510c26cb26bc90f3fbc725fc1a888ffc81a" ]
[ "tfsr/helper/model_helper.py" ]
[ "#-*- coding:utf-8 -*-\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 or agreed to in w...
[ [ "tensorflow.ones", "tensorflow.reshape", "tensorflow.math.ceil", "tensorflow.math.equal", "tensorflow.cast", "tensorflow.einsum", "tensorflow.keras.initializers.VarianceScaling", "tensorflow.shape", "tensorflow.range", "tensorflow.zeros", "tensorflow.expand_dims", "...
pzelasko/data
[ "9a9426ffb0507a8338a46f3caed1434eb1631304" ]
[ "examples/vision/caltech256.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\nimport os.path\n\nfrom torchdata.datapipes.iter import (\n FileLoader,\n TarArchiveReader,\n Mapper,\n RoutedDecoder,\n IterableWrapper,\n)\nfrom torch.utils.data.datapipes.utils.decoder import imagehandler\n\n\n# Download size is ~1.2 GB so fake d...
[ [ "torch.utils.data.datapipes.utils.decoder.imagehandler" ] ]
zetechmoy/recsys
[ "2569f91dabe783a5e4a7fd1063a05d9123a847ae" ]
[ "recsys_odds.py" ]
[ "\n\n#This prgram predict wether a list of film categorized by its genres has more chance to be viewed by users\nimport sys, os\nimport numpy as np\nimport pandas as pd\nimport pickle, json, random\n\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.preprocessing import OneHotEncoder\n\nfrom keras.model...
[ [ "numpy.concatenate", "sklearn.preprocessing.LabelEncoder", "numpy.array", "pandas.merge", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "numpy.hstack", "pandas.read_csv" ] ]
Hyun5/CarND-Behavioral-Cloning-P3
[ "71b9c1146746c82b931f678eac7d9deb88f2ab9b" ]
[ "model.py" ]
[ "import csv\nimport os\nimport cv2\nimport numpy as np\nimport sklearn\nimport PIL.Image as pimg\n\n# Setup Keras\nfrom keras.models import Sequential\nfrom keras.layers import Lambda, Cropping2D\nfrom keras.layers.core import Dense, Activation, Flatten, Dropout\nfrom keras.layers.convolutional import Conv2D\nfrom ...
[ [ "numpy.array", "numpy.asarray", "numpy.fliplr", "sklearn.model_selection.train_test_split", "sklearn.utils.shuffle" ] ]
ltw18/action_recognition
[ "fa6fe963fe3697b43af3e7cb31fa8150d8ecbf07" ]
[ "server/actions_from_video.py" ]
[ "import os\nimport sys\nimport numpy as np\nimport cv2\nimport time\nsys.path.append('../')\nfrom object_track.track import Sort\nfrom action_recognition.recognition import TGN\nfrom op_python.openpose import pyopenpose as op\n\nclass Action(object):\n def __init__(self, max_age=8, min_hits=1, reg_frame=10):\n ...
[ [ "numpy.where", "numpy.array", "numpy.zeros" ] ]
lpq29743/text_classification
[ "3b830fb6a136d8aa397ef12739dd166aaf39d970" ]
[ "models/ml_models/bagging.py" ]
[ "from sklearn.ensemble import BaggingClassifier\r\nfrom utils import data_utils, vectorize\r\n\r\n\r\nclass Bagging:\r\n def __init__(self, vectorizer, data_fname='../../data/imdb.csv', base_estimator=None, n_estimators=10):\r\n self.data_fname = data_fname\r\n self.base_estimator = base_estimator\...
[ [ "sklearn.ensemble.BaggingClassifier" ] ]
bgeorge0/pyradiomics
[ "f0e18c19163923a3c1d5aa5eb197553f52df582d" ]
[ "radiomics/ngtdm.py" ]
[ "import numpy\n\nfrom radiomics import base, cMatrices\n\n\nclass RadiomicsNGTDM(base.RadiomicsFeaturesBase):\n r\"\"\"\n A Neighbouring Gray Tone Difference Matrix quantifies the difference between a gray value and the average gray value\n of its neighbours within distance :math:`\\delta`. The sum of absolute d...
[ [ "numpy.sum", "numpy.abs", "numpy.where" ] ]
zhujiagang/realtime-lstm
[ "9ba823aae2bfd29571953806c085ad39e4242b4a" ]
[ "train_ssd_conv_lstm_step_lr.py" ]
[ "\"\"\" Adapted from:\n @longcw faster_rcnn_pytorch: https://github.com/longcw/faster_rcnn_pytorch\n @rbgirshick py-faster-rcnn https://github.com/rbgirshick/py-faster-rcnn\n Which was adopated by: Ellis Brown, Max deGroot\n https://github.com/amdegroot/ssd.pytorch\n\n Further:\n Updated by Gurkir...
[ [ "numpy.array", "torch.cuda.manual_seed_all", "torch.cuda.synchronize", "numpy.asarray", "numpy.random.seed", "torch.nn.init.xavier_uniform", "torch.save", "torch.optim.SGD", "torch.set_default_tensor_type", "torch.autograd.Variable", "numpy.random.shuffle", "torch.m...
ravinkohli/Auto-PyTorch
[ "06e67de5017b4cccad9398e24a3d9f0bd8176da3" ]
[ "autoPyTorch/pipeline/components/setup/network_head/fully_convolutional.py" ]
[ "from typing import Dict, List, Optional, Tuple, Union\n\nimport ConfigSpace as CS\nfrom ConfigSpace.configuration_space import ConfigurationSpace\nfrom ConfigSpace.hyperparameters import CategoricalHyperparameter, UniformIntegerHyperparameter\n\nimport torch\nfrom torch import nn\n\nfrom autoPyTorch.datasets.base_...
[ [ "torch.nn.Sequential", "torch.nn.AdaptiveAvgPool2d", "torch.nn.Conv2d", "torch.nn.AdaptiveMaxPool2d" ] ]
lose4578/nnUNet_plusplus
[ "c301837bcfaf364fcf4683f3bdcf0dcbe2e22f81" ]
[ "nnunet/network_architecture/octconv.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass OctaveConv(nn.Module):\n def __init__(self, in_channels, out_channels, kernel_size, alpha_in=0.5, alpha_out=0.5, stride=1, padding=0,\n dilation=1,\n groups=1, bias=False):\n super(OctaveConv, self).__init__()\n self.do...
[ [ "torch.nn.Upsample", "torch.nn.AvgPool2d" ] ]
rossihwang/AlignmentForCKPLUS
[ "6b80775b9bf7760b0bf70f32cc7914c0021a1f2e" ]
[ "ck_plus_alignment.py" ]
[ "import numpy as np\nimport os\nimport cv2\n\n'''\nTODO\n1. Classify the images into different directories according to emotion label. Done\n2. Alignment the image according to eye centers. Done\n3. Rotation. Done\n4. Intensity quatization(CLAHE). Done \n5. Scaling according to the mean of eye center distance. \n\n...
[ [ "numpy.abs", "numpy.mean", "numpy.zeros", "numpy.diff" ] ]
Kiana-VA/mycroft-precise
[ "c534351ce0992ce0e691c135b77d2bc560ac78b5" ]
[ "precise/scripts/train.py" ]
[ "#!/usr/bin/env python3\n# Copyright 2019 Mycroft AI Inc.\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 b...
[ [ "tensorflow.keras.callbacks.TensorBoard", "tensorflow.keras.callbacks.LambdaCallback", "tensorflow.keras.callbacks.ModelCheckpoint" ] ]
jazzminewang/ParlAI
[ "fdaba0610e17cdc7eb7a766bc9f81734c012d4cc" ]
[ "parlai/core/utils.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"File for miscellaneous utility functions and constants.\"\"\"\n\nfrom collections import deque\nfrom func...
[ [ "torch.Tensor", "torch.full", "torch.LongTensor" ] ]
gheyret/pytorch_optimizer
[ "34e6fd04c76332c2611ad65180b976a2ec7da8eb" ]
[ "pytorch_optimizer/adamp.py" ]
[ "import math\n\nimport torch\nfrom torch.optim.optimizer import Optimizer\n\nfrom pytorch_optimizer.base_optimizer import BaseOptimizer\nfrom pytorch_optimizer.gc import centralize_gradient\nfrom pytorch_optimizer.types import BETAS, CLOSURE, DEFAULTS, LOSS, PARAMETERS\nfrom pytorch_optimizer.utils import projectio...
[ [ "torch.zeros_like", "torch.no_grad", "torch.enable_grad" ] ]
zthang/code2vec_treelstm
[ "0c5f98d280b506317738ba603b719cac6036896f" ]
[ "common.py" ]
[ "import re\nimport numpy as np\nimport tensorflow as tf\nfrom itertools import takewhile, repeat\nfrom typing import List, Optional, Tuple, Iterable\nfrom datetime import datetime\nfrom collections import OrderedDict\n\n\nclass common:\n\n @staticmethod\n def normalize_word(word):\n stripped = re.sub(r...
[ [ "tensorflow.equal", "numpy.squeeze", "tensorflow.cumsum", "tensorflow.cast" ] ]
supri-a/RockFlow
[ "bb325dbd8cfcfe6a431fe669a33fd0796683c307" ]
[ "cov_graph.py" ]
[ "# Based on notebooks Covariance Graphs Berea.ipynb and utilities.py \n# from: https://github.com/LukasMosser/PorousMediaGan/tree/master/code/notebooks/covariance\n\n# Create covariance graphs\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\nfrom matplot...
[ [ "numpy.array", "numpy.zeros", "matplotlib.pyplot.subplots", "numpy.mean", "numpy.std" ] ]
Uzornd/ParlAI
[ "321bc857f2765cd76d5134531a802442ac4c9f5c" ]
[ "parlai/crowdsourcing/utils/tests.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"\nUtilities for running tests.\n\"\"\"\n\nimport os\nimport random\nimport tempfile\nimport time\nimport ...
[ [ "numpy.random.seed", "torch.manual_seed" ] ]
SamuelaAnastasi/Day_Night_Image_Classifier
[ "c782e558fc2f6de58606af20304ad41587b14b32" ]
[ "helpers.py" ]
[ "# Helper functions\n\nimport os\nimport glob # library for loading images from a directory\nimport matplotlib.image as mpimg\n\nimport cv2\n\n\n\n# This function loads in images and their labels and places them in a list\n# The list contains all images and their associated labels\n# For example, after data is load...
[ [ "matplotlib.image.imread" ] ]
georgehc/dksa
[ "bcd9eab6c9ded47f5b166cf1351b06e26e0c8f90", "bcd9eab6c9ded47f5b166cf1351b06e26e0c8f90" ]
[ "visualization/plot_n_durations_vs_hyperparam_sweep_train_times.py", "prediction_intervals/intervals_nks_mlp_init_rsf.py" ]
[ "#!/usr/bin/env python\nimport ast\nimport configparser\nimport os\nimport pickle\nimport sys\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nmatplotlib.rcParams['pdf.fonttype'] = 42\nmatplotlib.rcParams['ps.fonttype'] = 42\nsns.set_style('whitegrid')\n\n\nif not (len(sys.argv) == 3 an...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.gca", "matplotlib.pyplot.violinplot", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.subplot" ], [ ...
richardk53/gluon-ts
[ "5bde492198c0348b550ac6f7269f1740a699ec30" ]
[ "src/gluonts/nursery/torch_arsgls_rbpf/models/kvae.py" ]
[ "from typing import Sequence, Optional, Union, Tuple\nfrom dataclasses import dataclass\nfrom box import Box\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom torch.distributions import MultivariateNormal\nfrom utils.utils import (\n make_inv_tril_parametrization,\n make_inv_tril_parametrization_f...
[ [ "torch.zeros", "torch.cat", "torch.stack", "torch.ones", "torch.distributions.MultivariateNormal", "torch.where" ] ]
andreiliphd/speech-recognition-one-two-three-deep-learning
[ "d7c8fd0c7aa06fd9d824061542bca35df59cce76" ]
[ "TensorFlow_speech_recognition_model.py" ]
[ "import librosa\nfrom os import listdir\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nimport tensorflow as tf\n\n\ndef loadSound(path):\n soundList = listdir(path)\n loadedSound = []\n for sound in soundList:\n Y, sr = librosa.load(path + sound)\n loadedSound.appe...
[ [ "numpy.concatenate", "numpy.array", "tensorflow.train.AdamOptimizer", "numpy.zeros", "tensorflow.argmax", "tensorflow.Session", "tensorflow.Variable", "numpy.ones", "tensorflow.nn.rnn_cell.LSTMCell", "tensorflow.placeholder", "tensorflow.layers.dense", "sklearn.mode...
Daijunxu/transformers
[ "ffadcf8b0bf39a3df273a794d64669a3d3a208dc" ]
[ "transformers/modeling_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...
[ [ "torch.nn.Linear", "torch.cat", "torch.einsum", "torch.nn.Parameter", "torch.load", "torch.nn.BCEWithLogitsLoss", "torch.nn.functional.pad", "torch.nn.CrossEntropyLoss", "torch.topk", "torch.nn.LayerNorm", "torch.gather", "torch.nn.init.normal_", "torch.empty", ...
xhappy/selfMachineLearning
[ "1be0ee596868ea195ddba36a6297fb5ec1c52a51" ]
[ "cs231n-assignment/assigment1/neural_net.py" ]
[ "\r\nimport numpy as np\r\n\r\ndef ReLU(x):\r\n ''''ReLU non-linearity function'''\r\n return np.maximum(0, x)\r\n\r\nclass TwoLayerNet(object):\r\n '''\r\n A two-layer fully connected neural network. \r\n The net has an input dimension of D, a hidden layer dimension of H, and perfomrs classification...
[ [ "numpy.max", "numpy.dot", "numpy.random.choice", "numpy.zeros", "numpy.sum", "numpy.random.randn", "numpy.exp", "numpy.argmax", "numpy.arange", "numpy.maximum" ] ]
drawdy/CompreFace
[ "143b7955536f406a622248fad2d2108dfb5dd4f6" ]
[ "embedding-calculator/srcext/insightface/PRNet.mxnet/metric.py" ]
[ "# Version: 2020.02.21\n#\n# MIT License\n#\n# Copyright (c) 2018 Jiankang Deng and Jia Guo\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including wi...
[ [ "numpy.square", "numpy.array", "numpy.count_nonzero", "numpy.minimum", "numpy.mean", "numpy.argmax", "numpy.maximum" ] ]
Klebert-Engineering/deep-spell-9
[ "cabfcbf8238085b139e6b4b0e43f459230ead963" ]
[ "modules/deepspell_optimization/models/encoder.py" ]
[ "# (C) 2018-present Klebert Engineering\n\n# ===============================[ Imports ]=============================\n\nimport numpy as np\nimport tensorflow as tf\n\n# ============================[ Local Imports ]==========================\n\nfrom deepspell.models import encoder\nfrom deepspell_optimization.models...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.contrib.rnn.BasicLSTMCell", "tensorflow.matmul", "tensorflow.shape", "tensorflow.concat", "tensorflow.random_uniform", "tensorflow.contrib.rnn.LSTMStateTuple", "tensorflow.constant", "tensorflow.variable_scope", ...
CONTINUE12/DeepLung
[ "c6dc4debc55677a48be762b4c36d0725e7f93af1" ]
[ "Visualize/1.py" ]
[ "# -- coding:utf-8 --\r\n# import numpy as np\r\n# import matplotlib.pyplot as plt\r\n# import os\r\n\r\n# data_dir = '/public/share/jiezhao/Minerva/Lung/data/luna16/LUNA16PROPOCESSPATH/test/'\r\n# filenames = os.path.join(data_dir, '1.3.6.1.4.1.14519.5.2.1.6279.6001.109002525524522225658609808059_clean.npy')\r\n# ...
[ [ "matplotlib.pyplot.show", "numpy.array", "matplotlib.pyplot.imshow", "matplotlib.pyplot.figure" ] ]
microsoft/RationaleST
[ "760c10a44aa89bd0022db34afd0ffa4fb41ac1e3" ]
[ "run_st_rationale.py" ]
[ "\"\"\"\r\nAuthor: Meghana Bhat (bhat.89@osu.edu)\r\nCode for Self-training for Rationale using few-shot learning.\r\nThis code base is adapted from UST (https://github.com/microsoft/UST)\r\n\"\"\"\r\n\r\nfrom huggingface_utils import MODELS\r\nfrom preprocessing import generate_rationale_data\r\nfrom sklearn.utils...
[ [ "numpy.where", "numpy.array", "sklearn.utils.shuffle" ] ]
langzippkk/msds621
[ "21d58a1c8e2f71c26d1a6540a695e8e9200359a1" ]
[ "projects/linreg/linreg.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom pandas.api.types import is_numeric_dtype\n\ndef normalize(X): # creating standard variables here (u-x)/sigma\n if isinstance(X, pd.DataFrame):\n for c in X.columns:\n if is_numeric_dtype(X[c]):\n u = np.mean(X[c])\n s ...
[ [ "numpy.dot", "numpy.ones", "numpy.mean", "pandas.api.types.is_numeric_dtype", "numpy.random.random_sample", "numpy.std", "numpy.hstack" ] ]
rs2/numba
[ "ee78bfe3e66439197905551a451ea264704a3cdd", "ee78bfe3e66439197905551a451ea264704a3cdd" ]
[ "examples/cudajit/matmul_smem.py", "examples/cudajit/sum.py" ]
[ "#! /usr/bin/env python\n\nfrom numba import *\nimport numpy as np\nimport math\nfrom timeit import default_timer as time\n\nbpg = 50\ntpb = 32\nn = bpg * tpb\n\n@cuda.jit(argtypes=[f4[:,:], f4[:,:], f4[:,:]])\ndef cu_square_matrix_mul(A, B, C):\n sA = cuda.shared.array(shape=(tpb, tpb), dtype=f4)\n sB = cuda...
[ [ "numpy.allclose", "numpy.matrix", "numpy.empty_like", "numpy.random.random" ], [ "numpy.random.random", "numpy.empty_like" ] ]
akapne01/gym_tower_of_london
[ "4c4597c8dba0e23ef649713997bc5a2f99d53175" ]
[ "training/model_simulations/save_last_moves_for_tasks.py" ]
[ "from os import listdir\nfrom os.path import isfile, join\nfrom typing import Dict, List, Tuple\n\nimport pandas as pd\n\nepisodes = 1000\nletters = ['A', 'B', 'C', 'D', 'E']\n\nget_min = {\n 'A': 4,\n 'B': 5,\n 'C': 5,\n 'D': 6,\n 'E': 6,\n}\n\n\ndef sort_files_by_depth(files: List) -> Tuple[List, L...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
simonrus/aff3ct-bfe
[ "c84ddc11ec75140632471e13f3f55dae3ce7950e" ]
[ "aff3ct-client/tests/test_proto.py" ]
[ "import unittest\n\n\nimport zmq\nimport pdb\nimport numpy as np\nfrom Aff3ctProtocol import Aff3ctProtocol\n\nclass test_proto(unittest.TestCase):\n zmq_context = None\n zmq_socket = None\n server_address = 'tcp://localhost:5555'\n\n def __init__(self, *args, **kwargs):\n super(test_proto, self)...
[ [ "numpy.allclose", "numpy.array" ] ]
HTRPOCODES/HTRPO-v2
[ "10ab418fcb4807747ebe162920f3df1e80b80a2a" ]
[ "envs/Pacman.py" ]
[ "import os\r\nimport shutil\r\nimport uuid\r\nimport cv2\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom collections import deque\r\n\r\nimport gym\r\nfrom gym import spaces\r\n\r\ntry:\r\n from atari_py import ALEInterface\r\nexcept Exception as e:\r\n print(\"Could not load ale_python_inter...
[ [ "numpy.random.choice", "matplotlib.pyplot.switch_backend", "numpy.concatenate", "numpy.uint8", "matplotlib.pyplot.savefig", "numpy.nonzero", "numpy.logical_and", "numpy.transpose", "matplotlib.pyplot.tight_layout", "numpy.random.randint", "numpy.array", "numpy.zeros...
check-spelling/drizzlepac
[ "19baaf5a416c72f272889800b13d251f33f76d2c" ]
[ "drizzlepac/devutils/alignment_viewer.py" ]
[ "\"\"\"Viewer for aligned datasets\n\nThis code can be used to summarize a set of results after running runastrodriz.\nThe results will be a multi-page PDF document with a title page that summarizes\nthe number of tests found along with stats on the number of various types of\nWCS solutions in the final drizzle pro...
[ [ "matplotlib.pyplot.ion", "numpy.nan_to_num", "matplotlib.backends.backend_pdf.PdfPages", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.markers.MarkerStyle", "numpy.clip", "matplotlib.pyplot.ioff" ] ]
rafaelugolini/rasa
[ "6e7ced4d56165a0c6f018afe9d08700331b731b1" ]
[ "rasa/core/processor.py" ]
[ "import json\nimport warnings\nimport logging\nimport os\nfrom types import LambdaType\nfrom typing import Any, Dict, List, Optional, Text, Tuple\n\nimport numpy as np\nimport time\n\nfrom rasa.core import jobs\nfrom rasa.core.actions.action import Action\nfrom rasa.core.actions.action import ACTION_LISTEN_NAME, Ac...
[ [ "numpy.max", "numpy.argmax" ] ]
sweatybridge/credit-risk
[ "4c8f9c1269429bc62189bd1a66ff3cd5be1ffaef" ]
[ "xai_fairness/toolkit_fai.py" ]
[ "\"\"\"\nToolkit for fairness.\n\"\"\"\nimport numpy as np\nimport pandas as pd\nfrom aif360.datasets import BinaryLabelDataset\nfrom aif360.metrics.classification_metric import ClassificationMetric\n\n\ndef prepare_dataset(\n features,\n labels,\n protected_attribute,\n privileged_attri...
[ [ "pandas.DataFrame", "numpy.array" ] ]
mohneesh9797-puresoftware/Response
[ "6cd73478492213f115620cfc56ff3cfe430f9644" ]
[ "response.py" ]
[ "\"\"\"Representing responses in a domain agnostic manner.\"\"\"\n\nimport warnings\nfrom fractions import Fraction\nfrom pathlib import Path\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy.io import wavfile\nfrom scipy.signal import (get_window, lfilter, resample, resample_poly, tukey,\n ...
[ [ "numpy.rollaxis", "numpy.fft.fft", "numpy.iscomplexobj", "scipy.signal.lfilter", "numpy.fft.irfft", "numpy.imag", "numpy.fft.fftfreq", "numpy.concatenate", "numpy.linalg.norm", "numpy.angle", "matplotlib.pyplot.subplots", "numpy.logical_and", "scipy.signal.resam...
ArturSvidrytski/Physisorption-Simulation
[ "821a8624125f480d2da6143ea7b39c488f4c40ca" ]
[ "physisorption/helpers.py" ]
[ "from os import listdir, path, unlink\nimport os\nimport numpy as np\nfrom skimage import io\nimport matplotlib.pyplot as plt\nfrom matplotlib import cm as colmap\nfrom matplotlib import colors\nimport gc\nimport subprocess\nimport time\nimport pandas as pd\nimport string\nimport csv\nimport glob\nimport skimage.m...
[ [ "numpy.copy", "numpy.tile", "numpy.exp", "numpy.trunc", "pandas.concat", "pandas.read_csv", "numpy.concatenate", "numpy.full", "numpy.uint8", "numpy.log", "pandas.DataFrame", "numpy.logical_and", "numpy.arange", "numpy.int32", "numpy.array", "matplot...
Rosster/MLFinalProject
[ "521a739d4c5371db08179a54e22c76a9827136bb" ]
[ "src/model_generators/svc_plotter.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn import svm\n\n## adapted from https://scikit-learn.org/stable/auto_examples/svm/plot_iris.html#sphx-glr-auto-examples-svm-plot-iris-py\n\n\ndef svc_plot(model, X0, X1, y, xlabel, ylabel, title, dest_fqp):\n xx, yy = __make_meshgrid(X0, X1)\n figur...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.subplots_adjust" ] ]
klezm/segmentator
[ "b1c8f986aa2404806223e5034ae43b14b90cd5ed" ]
[ "segmentator/ncut_prepare.py" ]
[ "#!/usr/bin/env python\n\"\"\"Normalized graph cuts for segmentator (experimental).\n\nTODO: Replacing the functionality using scikit-learn?\n\"\"\"\n\nimport os\nimport numpy as np\nfrom matplotlib import animation\nfrom matplotlib import pyplot as plt\nfrom skimage.future import graph\nfrom skimage.segmentation i...
[ [ "matplotlib.animation.FuncAnimation", "numpy.zeros", "numpy.copy", "numpy.load", "numpy.tile", "numpy.save", "matplotlib.pyplot.figure", "numpy.transpose", "matplotlib.pyplot.show", "numpy.log10", "numpy.unique", "matplotlib.pyplot.imshow" ] ]
dunkyp/scipy
[ "dd2fa4dfbd3c931a2b2ff176ee4dba6b853f86d8" ]
[ "scipy/linalg/tests/test_lapack.py" ]
[ "#!/usr/bin/env python\n#\n# Created by: Pearu Peterson, September 2002\n#\n\nfrom __future__ import division, print_function, absolute_import\n\nfrom numpy.testing import TestCase, run_module_suite, assert_equal, \\\n assert_array_almost_equal, assert_, assert_raises, assert_allclose\n\nimport numpy as np\n\nfr...
[ [ "numpy.dot", "scipy.linalg.svd", "numpy.finfo", "numpy.concatenate", "numpy.random.normal", "numpy.triu", "numpy.testing.assert_array_almost_equal", "numpy.testing.assert_raises", "numpy.array", "numpy.testing.run_module_suite", "numpy.zeros", "numpy.testing.assert_...
texpomru13/ParallelWaveGAN
[ "a78134d6a34709e4570f14d72513739016a3ca92" ]
[ "test/test_melgan.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# Copyright 2019 Tomoki Hayashi\n# MIT License (https://opensource.org/licenses/MIT)\n\nimport logging\n\nimport numpy as np\nimport pytest\nimport torch\nimport torch.nn.functional as F\n\nfrom parallel_wavegan.losses import MultiResolutionSTFTLoss\nfrom paralle...
[ [ "torch.no_grad", "numpy.prod", "torch.randn" ] ]
JortRoelofs/PlaneProject
[ "8eaff762d5c407c56f9266b39d9662b9624c0ef8" ]
[ "parse.py" ]
[ "import structure\nimport util\n\n\nmaterials = []\nstringer_types = []\n\n\ndef load_wing(file):\n f = open(\"wings/%s.wing\" % file, 'r')\n lines = f.readlines()\n f.close()\n return parse_wing(lines)\n\n\ndef parse_wing(lines):\n wing = structure.Wing()\n engine_lines = []\n engine_active = ...
[ [ "numpy.arange" ] ]
sunny-panchal/sense
[ "a7e3557da8e2cbbc0a60e99db13804e5613189c2" ]
[ "sense/loading.py" ]
[ "import json\nimport os\nimport torch\nimport yaml\n\nfrom typing import List\nfrom typing import Optional\nfrom typing import Tuple\n\nfrom sense import RESOURCES_DIR\nfrom sense import SOURCE_DIR\nfrom sense import backbone_networks\n\nwith open(os.path.join(SOURCE_DIR, 'models.yml')) as f:\n MODELS = yaml.loa...
[ [ "torch.load" ] ]
AxelBohm/Variational-Inequality-GAN
[ "03bd197ac6225ef908b87626a21daef9a15d65c3" ]
[ "models/discriminator.py" ]
[ "# MIT License\n\n# Copyright (c) 2017 Ishaan Gulrajani\n# Copyright (c) 2017 Marvin Cao\n# Copyright (c) Facebook, Inc. and its affiliates.\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the...
[ [ "torch.autograd.Variable", "torch.norm", "torch.ones_like" ] ]
sidneyp/skulltrimmer
[ "35e6bb5cfbc2336e9d11dfa8e97d5e366daf976f" ]
[ "elastic_transform.py" ]
[ "import numpy as np\nimport cv2 as cv\nfrom scipy.ndimage.interpolation import map_coordinates\nfrom scipy.ndimage.filters import gaussian_filter\nimport matplotlib.pyplot as plt\n\n\ndef elastic_transform(image, alpha, sigma, alpha_affine, random_state=None):\n \"\"\" Function to perform elastic transformation ...
[ [ "numpy.concatenate", "numpy.reshape", "numpy.random.RandomState", "scipy.ndimage.interpolation.map_coordinates", "matplotlib.pyplot.figure", "numpy.float32", "numpy.arange", "matplotlib.pyplot.imshow" ] ]
KerinPithawala/Customer-Experience-Dashboard
[ "9d96a753224fb6d25c513f6930bfca64ee3382bd" ]
[ "app.py" ]
[ "import streamlit as st\nimport pandas as pd\nimport numpy as np\nimport plotly.express as px\n\nimport matplotlib.pyplot as plt\n\nst.title(\"Customer Experience Analysis\")\nst.sidebar.title(\"Customer Experience Analysis\")\n\nst.markdown(\"US Airline Tweets \")\nst.sidebar.markdown(\" Tweets for US Airlines \")...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.read_csv" ] ]
awsaf49/deep-chimpact-1st-place-solution
[ "91336396aa46885dabdcdc6f9cc7c142de5f2b03" ]
[ "utils/optimizers.py" ]
[ "import tensorflow as tf\nimport tensorflow_addons as tfa\n\ndef get_optimizer(CFG):\n opt_name = CFG.optimizer\n lr = CFG.lr\n if opt_name=='Adam':\n opt = tf.keras.optimizers.Adam(learning_rate=lr)\n elif opt_name=='AdamW':\n opt = tfa.optimizers.AdamW(learning_rate=lr, weight_deca...
[ [ "tensorflow.keras.optimizers.Adam" ] ]
aletuf93/logproj
[ "ca80637dab7237123899d6972fba96e53916760a" ]
[ "logproj/P8_performanceAssessment/wh_indexes.py" ]
[ "# -*- coding: utf-8 -*-\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport logproj.stat_time_series as ts\nfrom logproj.information_framework import movementfunctionfromInventory\nfrom logproj.ml_explore import paretoDataframe\n\n# %% POPULARITY INDEX\ndef calculatePopularity(movements):\n '''\n\n\n...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "numpy.sum", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.nanmean", "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel" ] ]
Shenaieianv/ZhengZerong
[ "188a3a2dfbd6bee76e9ceeda9e42e16ec30ca5f0" ]
[ "vposer/model_loader.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG),\n# acting on behalf of its Max Planck Institute for Intelligent Systems and the\n# Max Planck Institute for Biological Cybernetics. All rights reserved.\n#\n# Max-Planck-Gesellschaft zur Förderung ...
[ [ "torch.load" ] ]
MobileAir/stocksera
[ "b0764770a476905d3112b8c62f689685d8760ab8" ]
[ "scheduled_tasks/get_latest_insider_trading.py" ]
[ "import os\nimport sys\nimport sqlite3\nimport pandas as pd\nfrom datetime import datetime, timedelta\nfrom finvizfinance.insider import Insider\n\nsys.path.append(os.path.join(os.path.dirname(__file__), \"../\"))\nfrom scheduled_tasks.reddit.stocks.fast_yahoo import download_quick_stats\n\nconn = sqlite3.connect(r...
[ [ "pandas.to_datetime", "pandas.read_sql_query" ] ]
gururajrkatti/wand
[ "cabc2b207f5930f6c2dacdf793e9ff4c1e491fb6" ]
[ "tests/image_test.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# These tests cover the basic I/O & pythonic interfaces of the Image class.\n#\nimport codecs\nimport io\nimport os\nimport os.path\nimport shutil\nimport struct\nimport sys\nimport tempfile\n\nfrom pytest import mark, raises\n\nfrom wand.image import ClosedImageError, Image\nfrom wand....
[ [ "numpy.array", "numpy.random.rand", "numpy.zeros" ] ]
Chngzz/Dynamic-Gesture-Recognition-Based-on-FMCW
[ "11b97e65b6f552972660b0d191eff7ec42965a2f" ]
[ "TS-FNN/src/tools.py" ]
[ "import tensorflow as tf\r\n\r\ndef conv3d(layer_name, x, out_channels, kernel_size=[1,3,3], strides=[1,1,1,1,1], data_format='NDHWC', is_pretrain=True):\r\n '''\r\n Convolution 3D op wrapper, use RELU activation after convolution\r\n '''\r\n in_channels = x.get_shape()[-1].value\r\n with tf.variable...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.constant_initializer", "tensorflow.nn.conv2d", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.nn.max_pool3d", "tensorflow.nn.avg_pool", "tensorflow.cast", ...
yifan-fanyi/jpeg-python
[ "5ce9732294116bddfd25880802e4ffc9b18325d7" ]
[ "jpeg_python.py" ]
[ "# 2021.03.20\n# @yifan\n#\nimport numpy as np\n\nfrom jpeg_utli import Shrink, invShrink, DCT, ZigZag\nfrom jpeg_huffman import JPEG_Huffman_Luma\nfrom jpeg_header import JPEG_Header\n\nclass eJPEG_oneChannel(JPEG_Header, JPEG_Huffman_Luma):\n def __init__(self, H, W, Qf=50, N=8, verbose=0):\n JPEG_Heade...
[ [ "numpy.round", "numpy.array", "numpy.zeros_like", "numpy.zeros" ] ]
Tim-orius/aidem
[ "965a71888db72f42223777e890f4bcf88cde7fd3" ]
[ "app_qingyuan/Difference/lib/idct.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom math import cos, pi, sqrt\nimport numpy as np\n\ndef idct_2d(image):\n \n height = image.shape[0]\n width = image.shape[1]\n imageRow = np.zeros_like(image).astype(float)\n imageCol = np.zeros_like(image).astype(float)\n\n \n for h in range(height):\n imag...
[ [ "numpy.zeros_like" ] ]