repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
node21challenge/rank1_node21_detection | [
"5c20bb650ed30c4a5f86cfa738018c456af7bfe9",
"5c20bb650ed30c4a5f86cfa738018c456af7bfe9"
] | [
"src/models/modules/DETR/segmentation.py",
"src/models/modules/RetinaNet.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\"\"\"\nThis file provides the definition of the convolutional heads used to predict masks, as well as the losses\n\"\"\"\nimport io\nfrom collections import defaultdict\nfrom typing import List, Optional\n\nimport torch\nimport torch.nn as nn... | [
[
"torch.nn.Dropout",
"torch.ones",
"torch.zeros",
"torch.nn.init.constant_",
"torch.einsum",
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.nn.Conv2d",
"torch.nn.init.kaiming_uniform_",
"torch.nn.Linear",
"torch.nn.functional.relu",
"torch.no_grad",
"... |
GAN-Challenger/pytorch-CycleGAN-and-pix2pix | [
"fc5597e7cdef2f5566d6fd2131386fff647080cb"
] | [
"models/base_model.py"
] | [
"import os\nimport torch\n\n\nclass BaseModel():\n def name(self):\n return 'BaseModel'\n\n def initialize(self, opt):\n self.opt = opt\n self.gpu_ids = opt.gpu_ids\n self.isTrain = opt.isTrain\n self.Tensor = torch.cuda.FloatTensor if self.gpu_ids else torch.Tensor\n ... | [
[
"torch.cuda.is_available",
"torch.load"
]
] |
AstroHiro/CS155 | [
"c0fbb0fdecb48c4764a56e4fe841468c154eec6e"
] | [
"project1/trial3.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Feb 11 22:37:48 2020\n\n@author: hiroyasu\n\"\"\"\n\nimport pandas as pd\nimport torch\nfrom torch import nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_t... | [
[
"torch.nn.BatchNorm1d",
"numpy.amax",
"pandas.read_csv",
"torch.nn.LSTM",
"torch.nn.Flatten",
"torch.from_numpy",
"torch.nn.Linear",
"torch.nn.BCEWithLogitsLoss",
"numpy.random.permutation",
"numpy.size",
"torch.nn.MaxPool1d",
"numpy.floor",
"torch.nn.Conv1d",
... |
losedavidpb/kata_ialib | [
"8c7677be0fb6394d4a77402d65fb3485900f336f"
] | [
"nnetwork/backpropagation/layer.py"
] | [
"from abc import ABC, abstractmethod\nimport numpy as np\n\nclass Layer(ABC):\n\n def __init__(self, activation, derivative_activation, num_neurons=1, num_inputs_each_neuron=1):\n self.num_neurons, self.num_inputs_each_neuron = num_neurons, num_inputs_each_neuron\n self.activation_f = {'activation'... | [
[
"numpy.where",
"numpy.matmul"
]
] |
angnuoli/data-preprocess | [
"7b09f17c031daeccd8feddfac3625149f60fc629"
] | [
"src/clusters/DBSCAN.py"
] | [
"from random import choice\n\nimport numpy as np\n\nfrom src.data_structure.data_structure import StaticData\n\n\nclass DBSCAN:\n \"\"\"This is DBSCAN cluster\"\"\"\n\n def __init__(self, epsilon=5, min_pts=5):\n self.epsilon = epsilon\n self.min_pts = min_pts\n self.edges = {}\n s... | [
[
"numpy.linalg.norm"
]
] |
CheRuisiBesares/vocal-remover | [
"cf00718b0073083bd0ebd8ec6e2b1541f286ee14"
] | [
"train.py"
] | [
"import argparse\nfrom datetime import datetime\nimport json\nimport logging\nimport os\nimport random\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.utils.data\n\nfrom lib import dataset\nfrom lib import nets\nfrom lib import spec_utils\n\n\ndef setup_logger(name, logfile='LOGFILENAME.log... | [
[
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"numpy.random.seed",
"torch.load",
"numpy.linspace",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.cuda.is_available",
"torch.device",
"numpy.zeros",
"torch.nn.L1Loss"
]
] |
reinforcementdriving/fiftyone | [
"3db489a1440990858247afd52a8c005415d42d82"
] | [
"fiftyone/core/eta_utils.py"
] | [
"\"\"\"\nUtilities for interfacing with the\n`ETA library <https://github.com/voxel51/eta>`_.\n\n| Copyright 2017-2021, Voxel51, Inc.\n| `voxel51.com <https://voxel51.com/>`_\n|\n\"\"\"\nfrom collections import defaultdict\nimport itertools\nimport warnings\n\nimport numpy as np\n\nimport eta.core.data as etad\nimp... | [
[
"numpy.squeeze"
]
] |
jnsebgosselin/help | [
"f0194a96ba7e1474fe1864d79447ee20cee949ec"
] | [
"pyhelp/scripts/produce_meteo_maps.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Feb 27 10:54:25 2018\n@author: jsgosselin\n\"\"\"\n\n# ---- Standard Library Imports\n\nfrom itertools import product\nimport os.path as osp\nimport os\n\n# ---- Third Party Imports\n\nimport netCDF4\nfrom geopandas import GeoDataFrame\nimport pandas as pd\nfrom shap... | [
[
"pandas.DataFrame",
"numpy.average",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.vstack"
]
] |
Vishal-Bhatia/ga-learner-dsmp-repo | [
"95cc328174db230d050ef5a3bbd786f6d0ec1461"
] | [
"SVM-Practice/code.py"
] | [
"# --------------\nimport pandas as pd\nfrom collections import Counter\n\n# Load dataset\n##Loading the CSV data onto a Pandas dataframe\ndata = pd.read_csv(path)\n\n##Checking for null values\nprint(data.isnull().sum())\n\n##Providing a statistical description of the above data\nprint(data.describe())\n\n\n# ----... | [
[
"pandas.read_csv",
"matplotlib.pyplot.title",
"sklearn.metrics.accuracy_score",
"sklearn.model_selection.train_test_split",
"pandas.DataFrame",
"sklearn.preprocessing.LabelEncoder",
"sklearn.metrics.precision_recall_fscore_support",
"sklearn.svm.SVC",
"sklearn.svm.LinearSVC",
... |
StefanKDS/Birds | [
"bb0c8e8fd9b1a8658b4f7073b1d18fb7a2c5bdb2"
] | [
"Models.py"
] | [
"import numpy as np\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Activation\nfrom keras.layers import Conv1D, MaxPooling1D, GlobalAveragePooling1D\n\n\ndef create_and_fit_dense_model(batch_size, epochs, callbacks, X_train, X_test, y_train, y_test):\n # BUILD THE MODEL\n model... | [
[
"numpy.save"
]
] |
simonoso/EasyRL | [
"3d8eb2bf138dd2a0b95f8b3743d15f34cfff0740"
] | [
"easy_rl/models/evolution_strategy.py"
] | [
"# Copyright (c) 2019 Alibaba 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... | [
[
"tensorflow.invert_permutation",
"tensorflow.control_dependencies",
"tensorflow.cast",
"tensorflow.map_fn",
"tensorflow.train.AdamOptimizer",
"tensorflow.group",
"tensorflow.summary.scalar",
"tensorflow.get_collection",
"tensorflow.squeeze",
"tensorflow.train.get_or_create_... |
vinayya/training-data-analyst | [
"cc26e004863dbaa5490912c361774a880427686e"
] | [
"courses/machine_learning/deepdive2/building_production_ml_systems/solutions/taxifare/trainer/model.py"
] | [
"import datetime\nimport hypertune\nimport logging\nimport os\nimport shutil\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom tensorflow.keras import activations\nfrom tensorflow.keras import callbacks\nfrom tensorflow.keras import layers\nfrom tensorflow.keras import models\n\nfrom tensorflow import feature_... | [
[
"tensorflow.feature_column.bucketized_column",
"numpy.linspace",
"tensorflow.feature_column.categorical_column_with_identity",
"tensorflow.keras.callbacks.TensorBoard",
"tensorflow.feature_column.embedding_column",
"tensorflow.keras.layers.Lambda",
"tensorflow.strings.substr",
"ten... |
QingyuanWang/tianshou | [
"c5efc41c448ac1b111f93e467828583e6f5d6f10"
] | [
"examples/halfcheetahBullet_v0_sac.py"
] | [
"import os\nimport gym\nimport torch\nimport pprint\nimport argparse\nimport numpy as np\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom tianshou.env import SubprocVectorEnv\nfrom tianshou.policy import SACPolicy\nfrom tianshou.trainer import offpolicy_trainer\nfrom tianshou.data import Collector, Replay... | [
[
"numpy.random.seed",
"torch.manual_seed",
"torch.set_num_threads",
"torch.utils.tensorboard.SummaryWriter",
"torch.cuda.is_available"
]
] |
HudsonHuang/g2pM | [
"2c63945291d2740288f94088c5203933e3f1adbb"
] | [
"g2pM/g2pM.py"
] | [
"import pickle\nimport torch\nfrom torch import nn\n\nimport numpy as np\nimport os\n\nUNK_TOKEN = \"<UNK>\"\nPAD_TOKEN = \"<PAD>\"\nBOS_TOKEN = \"시\"\nEOS_TOKEN = \"끝\"\nSPLIT_TOKEN = \"▁\"\n\nclass G2pMT(nn.Module):\n def __init__(self):\n super().__init__()\n\n self.cedict = pickle.load(open(os.... | [
[
"numpy.expand_dims",
"numpy.take",
"torch.sign",
"numpy.squeeze",
"torch.nn.Embedding",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.exp",
"numpy.matmul",
"numpy.stack",
"torch.tensor",
"numpy.argmax",
"numpy.zeros",
"torch.nn.Linear",
"numpy.array",
... |
monofo/adversarial-robustness-toolbox-1 | [
"841ce32169c383bc4b35ee33976f56c08ad7df2e"
] | [
"utils/resources/create_inverse_gan_models.py"
] | [
"# MIT License\n#\n# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limita... | [
[
"tensorflow.zeros",
"tensorflow.GPUOptions",
"tensorflow.layers.conv2d_transpose",
"tensorflow.train.AdamOptimizer",
"numpy.mean",
"tensorflow.get_default_graph",
"tensorflow.layers.batch_normalization",
"tensorflow.Session",
"tensorflow.square",
"tensorflow.trainable_varia... |
FPSG-UIUC/synthCT | [
"9debc66a5097280f57b4c6b7d88a4cd95eb9494c"
] | [
"synthesis/synthcomp.py"
] | [
"# Implements strategies for choosing components for synthesis based on the\n# specification to synthesize\n\nfrom collections import defaultdict\nimport random\n\nimport networkx as nx\n\nfrom loguru import logger\nfrom sklearn.neighbors import NearestNeighbors\n\nfrom learning.embedding import Embedding\nfrom sem... | [
[
"sklearn.neighbors.NearestNeighbors"
]
] |
pbielak/graph-barlow-twins | [
"f8e20134afed4f17ffcecf8f48764df362ffdcad"
] | [
"gssl/transductive_model_arxiv.py"
] | [
"from pl_bolts.optimizers.lr_scheduler import LinearWarmupCosineAnnealingLR\nimport torch\nfrom torch import nn\nfrom torch_geometric import nn as tgnn\n\nfrom gssl.loss import get_loss\nfrom gssl.transductive_model import Model\n\n\nclass ArxivModel(Model):\n\n def __init__(\n self,\n feature_dim:... | [
[
"torch.nn.BatchNorm1d",
"torch.nn.PReLU",
"torch.cuda.is_available"
]
] |
prajjwal1/fluence2 | [
"f7353f4947ac4712ecd1df34e97df27d83060f13"
] | [
"tests/test_optim.py"
] | [
"import unittest\n\nimport torch\nfrom torch import nn\n\nfrom fluence.optim import Lamb, Lookahead\n\nclass Test_Optim(unittest.TestCase):\n def test_lookahead(self):\n model = nn.Linear(8, 8)\n base_optim = torch.optim.Adam(model.parameters())\n optim = Lookahead(base_optim, k=5, alpha=0.8... | [
[
"torch.nn.Linear",
"torch.rand"
]
] |
damiankarol7/python101 | [
"1978a9402a8fb0f20c4ca7bd542cb8d7d4501b9b"
] | [
"docs/pylab/rbrowna01.py"
] | [
"#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport random\n\nn = int(input(\"Ile ruchów? \"))\nx = y = 0\n\nfor i in range(0, n):\n # wylosuj kąt i zamień go na radiany\n rad = float(random.randint(0, 360)) * np.pi / 180\n x = x + np.cos(rad) # wylicz współrzędną x\n y = y ... | [
[
"numpy.cos",
"numpy.sqrt",
"numpy.sin"
]
] |
souvikg10/rasa-nlu-examples | [
"553a6461949f57232601e778fccdff74a488e0cd"
] | [
"rasa_nlu_examples/scikit/classifier.py"
] | [
"import pathlib\nimport numpy as np\n\nfrom sklearn.base import BaseEstimator, ClassifierMixin\nfrom rasa.cli.utils import get_validated_path\nfrom rasa.model import get_model, get_model_subdirectories\nfrom rasa.core.interpreter import RasaNLUInterpreter\n\n\ndef load_interpreter(model_dir, model):\n path_str =... | [
[
"numpy.array"
]
] |
rdadolf/fathom | [
"1dc013d055e59fb09c886ae3a667084119deac5c"
] | [
"fathom/speech/speech.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\nimport tensorflow as tf\n\n#from tensorflow.models.rnn import rnn, rnn_cell\nfrom tensorflow.python.ops import functional_ops\nfrom tensorflow.python.ops import variable_scope as vs\nfrom tensorflow.contrib.rnn.python.ops.rnn_cell import _linear\n\nfrom fathom.nn import... | [
[
"tensorflow.concat",
"tensorflow.zeros",
"tensorflow.stack",
"numpy.random.randint",
"tensorflow.boolean_mask",
"tensorflow.to_int64",
"tensorflow.sparse_to_dense",
"tensorflow.nn.ctc_greedy_decoder",
"tensorflow.reverse",
"tensorflow.matmul",
"tensorflow.fill",
"te... |
voschezang/pattern-recognition | [
"1d6a801deba729fc99a6960e2180d0ee204d0c35"
] | [
"src/test_midi2.py"
] | [
"import os, numpy as np\nif __name__ == \"__main__\":\n np.random.seed(333)\n print(os.getcwd())\n\nimport mido # , rtmidi, rtmidi_\nimport matplotlib.pyplot as plt\n\nimport config\nimport setup\nimport midi\nimport midi.decode\nfrom midi import generators as g\nfrom utils import utils, io, plot\n\nif __nam... | [
[
"numpy.random.seed"
]
] |
SKKSaikia/bokeh | [
"f9a4013a3640da3c73fc49ed906f6d202a30a489"
] | [
"bokeh/core/properties.py"
] | [
"''' Properties are objects that can be assigned as class attributes on Bokeh\nmodels, to provide automatic serialization, validation, and documentation.\n\nThis documentation is broken down into the following sections:\n\n.. contents::\n :local:\n\nOverview\n--------\n\nThere are many property types defined in ... | [
[
"numpy.array"
]
] |
Jerry2990/sklearn_keras_wrap | [
"5d4a5f8df114bcb6e2cd23e00ed655d16ab6bc9a"
] | [
"tests/test_wrappers.py"
] | [
"\"\"\"Tests for Scikit-learn API wrapper.\"\"\"\n\n\nimport pickle\n\nimport numpy as np\nimport pytest\nfrom sklearn.calibration import CalibratedClassifierCV\nfrom sklearn.datasets import load_boston, load_digits, load_iris\nfrom sklearn.ensemble import (\n AdaBoostClassifier,\n AdaBoostRegressor,\n Bag... | [
[
"sklearn.neural_network.MLPClassifier",
"sklearn.ensemble.RandomForestRegressor",
"tensorflow.python.keras.layers.Flatten",
"tensorflow.python.keras.layers.Dense",
"numpy.random.random_sample",
"numpy.all",
"numpy.random.randn",
"tensorflow.python.keras.layers.Conv2D",
"sklearn... |
atmyers/WarpX | [
"d9d9721d80ff2f6ceda3c1a6e32e9ab31b7f81c6"
] | [
"Examples/Modules/space_charge_initialization/analysis.py"
] | [
"#!/usr/bin/env python\n\n# Copyright 2019-2020 Axel Huebl, Remi Lehe\n#\n# This file is part of WarpX.\n#\n# License: BSD-3-Clause-LBNL\n\n\"\"\"\nThis script checks the space-charge initialization routine, by\nverifying that the space-charge field of a Gaussian beam corresponds to\nthe expected theoretical field.... | [
[
"matplotlib.pyplot.title",
"scipy.special.gammainc",
"matplotlib.use",
"numpy.arange",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.subplot",
"numpy.exp",
"numpy.meshgrid",
"matplotlib.pyplot.figure"
]
] |
spencerimp/mri_segmentation | [
"4b1195c4520b09f0759c11c890ebc6331e3ecb06"
] | [
"cnn_segmentation/utils/voxel_sampling.py"
] | [
"from __future__ import print_function\nimport numpy as np\nfrom skimage.morphology import cube, dilation\n\n\ndef create_boundary(lab, regions, width):\n \"\"\"Create boundary of each region.\n\n For each non-zeros regions, create a\n boundary of dilation. Take the union\n of these boundary areas to ha... | [
[
"numpy.unique",
"numpy.asarray",
"numpy.ones",
"numpy.prod",
"numpy.zeros",
"numpy.where",
"numpy.vstack",
"numpy.random.randint"
]
] |
AnTuo1998/seq2seq-dialogue | [
"61af5099332b749f4026a20d4ea3380f42deb006"
] | [
"seq2seq/trainer/supervised_trainer.py"
] | [
"from __future__ import division\nimport logging\nimport os\nimport random\nimport time\n\nimport torch\nimport torchtext\nfrom torch import optim\n\nimport seq2seq\nfrom seq2seq.evaluator import Evaluator\nfrom seq2seq.loss import NLLLoss\nfrom seq2seq.optim import Optimizer\nfrom seq2seq.util.checkpoint import Ch... | [
[
"torch.manual_seed"
]
] |
gramaziokohler/compas_fab | [
"85ec40887004c33ac9764ba73c1b66c6de154457"
] | [
"src/compas_fab/robots/wrench.py"
] | [
"from __future__ import print_function\n\nimport math\n\nimport compas\nfrom compas.geometry import Vector\nfrom compas.geometry import cross_vectors\n\nif not compas.IPY:\n from scipy import stats\nelse:\n stats = None\n\n# TODO: move to some constants file? g is also defined in scipy.constants\n# standard a... | [
[
"scipy.stats.trim_mean"
]
] |
78-t0b1/ga-learner-dsmp-repo | [
"78a3d5eb86d2b9e95b1e249bca434162a1157d83"
] | [
"Housing-Problem/code.py"
] | [
"# --------------\nimport numpy as np\r\nimport pandas as pd\r\nfrom sklearn.model_selection import train_test_split\r\n\r\n# path- variable storing file path\r\ndf = pd.read_csv(path)\r\ndf.head()\r\n\r\nX = df.drop(columns=['Price'])\r\ny = df['Price']\r\n\r\nX_train,X_test,y_train,y_test = train_test_split(X,y,t... | [
[
"pandas.read_csv",
"sklearn.metrics.r2_score",
"sklearn.model_selection.cross_val_score",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.PolynomialFeatures",
"sklearn.linear_model.Lasso",
"sklearn.linear_model.Ridge",
"sklearn.linear_model.LinearRegression"
]
... |
chris-tng/transformers | [
"dc9f24544291b25b44c9e87239a0ef4355396a4c"
] | [
"tests/test_modeling_tf_lxmert.py"
] | [
"# coding=utf-8\n# Copyright 2020 The HuggingFace Team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.keras.Input",
"numpy.abs",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"numpy.isnan",
"tensorflow.keras.layers.Dense",
"tensorflow.random.uniform",
"tensorflow.keras.Model",
"tensorflow.saved_model.save",
"tenso... |
Limmen/gym-yagw | [
"da7e5eba5bd1c4ad316fb60cc5096ca8bc7c29ae"
] | [
"gym_yagw/algorithms/q_learning.py"
] | [
"from gym_yagw.envs.yagw_env import YagwEnv\nimport numpy as np\nimport random\nimport time\nimport tqdm\nfrom gym import wrappers\n\nclass QAgent:\n \"\"\"\n A simple implementation of the Q(0)-learning algorithm (Sutton & Barto).\n Q-learning is a one-step off-policy algorithm\n \"\"\"\n def __init... | [
[
"numpy.max",
"numpy.argmax",
"numpy.random.rand"
]
] |
ChloeSarah13/wavespectra | [
"ae3413ba68fd19703c6a3e1b831b9b5131f84a08"
] | [
"setup.py"
] | [
"# from setuptools import setup\r\nimport os\r\nfrom codecs import open\r\n\r\nimport setuptools\r\nfrom numpy.distutils.core import setup\r\nfrom numpy.distutils.misc_util import Configuration\r\n\r\nimport wavespectra\r\n\r\nNAME = \"wavespectra\"\r\n\r\nCLASSIFIERS = [\r\n \"Development Status :: 4 - Beta\",\... | [
[
"numpy.distutils.misc_util.Configuration"
]
] |
antonmeskildsen/FeatureNet | [
"f194949762d0627801e7096fb396d8b607699066"
] | [
"featurenet/visdom_fun.py"
] | [
"# Copyright 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __fut... | [
[
"numpy.expand_dims",
"numpy.random.random",
"numpy.sqrt",
"numpy.linspace",
"torch.Tensor",
"numpy.asarray",
"numpy.arange",
"numpy.cos",
"numpy.sin",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"numpy.random.randn",
"numpy.random.rand",
"numpy.col... |
sagarjounkani/NCRFpp | [
"7bbca8eb6c99aa27a5ba641283cf53e6905cc114"
] | [
"utils/alphabet.py"
] | [
"# -*- coding: utf-8 -*-\n# @Author: Max\n# @Date: 2018-01-19 11:33:37\n# @Last Modified by: Jie Yang, Contact: jieynlp@gmail.com\n# @Last Modified time: 2018-04-26 13:56:03\n\n\n\"\"\"\nAlphabet maps objects to integer ids. It provides two way mapping from the index to the objects.\n\"\"\"\nfrom __future__... | [
[
"torch.jit.annotate"
]
] |
Neklaustares-tPtwP/torchflare | [
"7af6b01ef7c26f0277a041619081f6df4eb1e42c"
] | [
"torchflare/datasets/tabular_dataloader.py"
] | [
"\"\"\"Wrapper for dataloaders.\"\"\"\nfrom __future__ import annotations\n\nfrom typing import List, Union\n\nimport pandas as pd\nfrom torch.utils.data import DataLoader\n\nfrom torchflare.datasets.tabular import TabularDataset\n\n\nclass TabularDataloader:\n \"\"\"Class to create easy to use dataloaders.\"\"\... | [
[
"torch.utils.data.DataLoader"
]
] |
RParini/abelfunctions | [
"9263cd865e33cbd3ff4ffc1d59c14d77ff27f155"
] | [
"abelfunctions/riemann_surface_path.py"
] | [
"r\"\"\"Riemann Surface Paths :mod:`abelfunctions.riemann_surface_path`\n\nModule for defining paths on Riemann surfaces. A basic Riemann surface path\nconsists of the Riemann surface on which it's defined, a\n:class:`ComplexPathPrimitive` defining the x-projection of the path, and a\nstarting y-fibre. The first el... | [
[
"scipy.integrate.romberg",
"numpy.abs",
"numpy.linspace",
"numpy.linalg.norm",
"numpy.int",
"numpy.complex",
"numpy.vectorize",
"numpy.array",
"numpy.zeros",
"numpy.double"
]
] |
bjj9/EVE_SCPT | [
"c91b13f8bbfe8ea29a0e9f1df0dc016a258c904f"
] | [
"src/models/common.py"
] | [
"\"\"\"Copyright 2021 Hangzhou Dianzi University, Jun Bao\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modi... | [
[
"torch.nn.functional.softmax",
"torch.transpose",
"numpy.linspace",
"torch.sin",
"torch.cat",
"torch.zeros",
"torch.sum",
"torch.tanh",
"torch.cuda.is_available",
"torch.device",
"torch.pow",
"torch.norm",
"numpy.reshape",
"numpy.arange",
"torch.tensor",... |
patchett2002/pyDNMFk | [
"ba73d72eb4f46d8a79a83350db89e568f9ec9351"
] | [
"pyDNMFk/pyDNMFk.py"
] | [
"#@author: Manish Bhattarai\nfrom scipy.stats import wilcoxon\nfrom . import config\nfrom .dist_clustering import *\nfrom .pyDNMF import *\nfrom .plot_results import *\n\nclass sample():\n \"\"\"\n Generates perturbed version of data based on sampling distribution.\n\n Parameters\n ----------\n d... | [
[
"scipy.stats.wilcoxon"
]
] |
bueler/mg-glaciers | [
"649c323f18f31a332c0845bf3955d201cd4c3cf8"
] | [
"paper/genfigs/sia/convergence.py"
] | [
"#!/usr/bin/env python3\n\n# see py/1D/study/siaconv.sh to generate input data siaconv.txt\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom writeout import writeout\n\nINFILE = 'convergence.txt'\nMARKER = ['o','s','D']\nMARKERSIZE = [10.0,9.0,8.0]\nMARKERFACE = ['w','w','k']\nNAME = ['$|s-s_{exact}|_1... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yticks",
"numpy.log",
"matplotlib.pyplot.minorticks_off",
"matplotlib.pyplot.loglog",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.xticks",
"... |
ziimiin14/rpg_dvs_ros_modifed | [
"da63b163e5d7ee7ccb8335050d3a3303193d9d3a"
] | [
"dvxplorer_ros_driver/scripts/image_reconstructor_trt.py"
] | [
"import torch\nimport cv2\nimport numpy as np\nfrom model.model import *\nfrom utils.inference_utils import CropParameters, EventPreprocessor, IntensityRescaler, ImageFilter, ImageDisplay, ImageWriter, UnsharpMaskFilter\nfrom utils.inference_utils import upsample_color_image, merge_channels_into_color_image # for ... | [
[
"torch.device",
"torch.no_grad",
"torch.zeros"
]
] |
mrogez-yseop/cpp-taskflow | [
"e40c633784cb1712b04c88719dd53fc62f57e806"
] | [
"image/plot/Fig/micro_benchmark/plot.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport matplotlib.mlab as mlab\nimport matplotlib.gridspec as gridspec\n\nplt.subplots_adjust(hspace=0.23)\n\n# dev cost for wavefront\ncosts = [1507, 872, 680, 306]\n\nplt.subplot(221)\nx = np.arange(4)\n#plt.plot(costs, label='v1 (OpenMP)', color='black')\nplt... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show",
... |
mwittgen/ndarray | [
"3ae5a4dcac545100296399fbe0019894f8356a89"
] | [
"tests/pybind11_test.py"
] | [
"# -*- python -*-\n#\n# Copyright (c) 2010-2012, Jim Bosch\n# All rights reserved.\n#\n# ndarray is distributed under a simple BSD-like license;\n# see the LICENSE file that should be present in the root\n# of the source distribution, or alternately available at:\n# https://github.com/ndarray/ndarray\n#\nimpo... | [
[
"numpy.arange",
"numpy.zeros",
"numpy.dtype"
]
] |
Ceachi/Project-Self-Driving-Car-Advanced-Lane-Lines | [
"ab9b101b211fde7f2eb714d0ae6b47961d63f056"
] | [
"computer_vision_concepts/Curs Gradients and Color Spaces/direction_of_the_gradient.py"
] | [
"import numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\nimport pickle\n\n\n# Read in an image\nimage = mpimg.imread('signs_vehicles_xygrad.png')\n\n# Define a function that applies Sobel x and y, \n# then computes the direction of the gradient\n# and applies a threshold.\... | [
[
"matplotlib.pyplot.subplots",
"numpy.arctan2",
"matplotlib.image.imread",
"numpy.zeros_like",
"matplotlib.pyplot.subplots_adjust"
]
] |
ytfksw/blueoil | [
"a85516b7a64b8f49f25388d8f13349f8af72ea6d"
] | [
"blueoil/networks/classification/quantize_example.py"
] | [
"from functools import partial\n\nimport tensorflow as tf\n\nfrom blueoil.networks.classification.base import Base\nfrom blueoil.layers import batch_norm, conv2d\n\n\nclass SampleNetwork(Base):\n \"\"\"Sample network with simple layer.\"\"\"\n\n def __init__(self, *args, **kwargs):\n super().__init__(*... | [
[
"tensorflow.contrib.layers.variance_scaling_initializer",
"tensorflow.reshape",
"tensorflow.layers.average_pooling2d",
"tensorflow.compat.v1.summary.histogram",
"tensorflow.random_normal_initializer",
"tensorflow.compat.v1.variable_scope",
"tensorflow.nn.leaky_relu"
]
] |
nttcs-ds/fastseq | [
"f1338f1125612df318c9d1f030a8457397ed05a6"
] | [
"examples/EL-attention/summarize.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport os\n\nimport torch\nimport argparse\n\n\nXSUM_KWARGS = dict(beam=6, lenpen=1.0, max_len_b=60, min_len=10, no_repeat_ngram_siz... | [
[
"torch.hub.load",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
mi-erasmusmc/Sard | [
"d8228a7c49e2e6f98fbd16d4531cb3fc4b505590"
] | [
"catboost_analysis.py"
] | [
"\"\"\"\nTrain a catboost model with grid search\n\"\"\"\nimport json\nimport pathlib\n\nimport catboost\nimport numpy as np\nfrom sklearn.compose import ColumnTransformer\nfrom sklearn.metrics import roc_auc_score, precision_recall_curve, auc\nfrom sklearn.model_selection import RandomizedSearchCV\nfrom sklearn.pi... | [
[
"sklearn.metrics.roc_auc_score",
"sklearn.model_selection.RandomizedSearchCV",
"numpy.clip",
"numpy.arange",
"sklearn.preprocessing.MaxAbsScaler",
"sklearn.pipeline.Pipeline",
"sklearn.metrics.precision_recall_curve",
"numpy.save",
"numpy.argwhere",
"sklearn.metrics.auc"
... |
alessiamarcolini/digital-pathology-classification | [
"ea1f3f06994b8ae6b1aeae4552d3784e97cb6913"
] | [
"preprocessing/labels.py"
] | [
"import pandas as pd\n\n\ndef reverse_dict(dictionary):\n \"\"\"Reverse a dictionary.\n\n Keys become values and vice versa.\n\n Parameters\n ----------\n dictionary : dict\n Dictionary to reverse\n\n Returns\n -------\n dict\n Reversed dictionary\n\n Raises\n ------\n ... | [
[
"pandas.DataFrame"
]
] |
zutn/Simple-Catchments-Hesse | [
"da9a8ba5b535369843e33b24e9cad7afb65449a9"
] | [
"preprocessing/cleaned_data/create_cleaned_data_table.py"
] | [
"import pandas as pd\nimport os\nhome = os.path.dirname(__file__) \n\ndef get_table_dict(calc_water_year=True, et_corrected=True):\n \"\"\"\n Loads the csv data and return a dict with catchment id as key and a dataframe as value\n \"\"\"\n \n matQ = pd.read_csv(home + os.sep + 'dis_mm_1991_2018.csv',... | [
[
"pandas.read_csv",
"pandas.DateOffset",
"pandas.DataFrame"
]
] |
ZwwWayne/mmclassification | [
"2ccc55ce4f783ca34892fe7d91f247d18906a994"
] | [
"mmcls/core/utils/dist_utils.py"
] | [
"from collections import OrderedDict\n\nimport torch.distributed as dist\nfrom mmcv.runner import OptimizerHook\nfrom torch._utils import (_flatten_dense_tensors, _take_tensors,\n _unflatten_dense_tensors)\n\n\ndef _allreduce_coalesced(tensors, world_size, bucket_size_mb=-1):\n if bucket... | [
[
"torch._utils._flatten_dense_tensors",
"torch._utils._unflatten_dense_tensors",
"torch.distributed.get_world_size",
"torch.distributed.all_reduce",
"torch._utils._take_tensors"
]
] |
adamoses/slab_fitter | [
"b60f69ddb0abffa489ebf13c16dd6b4b00beed97"
] | [
"helpers.py"
] | [
"import numpy as np\nfrom astroquery.hitran import Hitran\nfrom astropy import units as un\nfrom astropy.constants import c, k_B, h, u\nfrom molmass import Formula\nimport pdb as pdb\nimport pickle as pickle\n\ndef line_ids_from_flux_calculator(flux_calculator_output, line_id_dict):\n line_id_list=[]\n for i,... | [
[
"numpy.log",
"numpy.abs",
"numpy.sqrt",
"numpy.size",
"numpy.array",
"numpy.exp"
]
] |
shuo0108/attention-guided-sparsity | [
"be715ff6cbf1d8248a1fc86e5fd10b93db5e3b59"
] | [
"python/train.py"
] | [
"import functools\nimport argparse\nimport os\nimport sys\nimport tensorflow as tf\nfrom tensorflow.examples.tutorials.mnist import input_data\nimport losses\nimport sparsity_ops\nFLAGS = None\n\ndef train(FLAGS):\n\n # Import MNIST data\n mnist = input_data.read_data_sets(FLAGS.data_dir,\n ... | [
[
"tensorflow.nn.max_pool",
"tensorflow.cast",
"tensorflow.train.AdamOptimizer",
"tensorflow.summary.scalar",
"tensorflow.nn.conv2d",
"tensorflow.losses.get_total_loss",
"tensorflow.Variable",
"tensorflow.summary.image",
"tensorflow.losses.get_losses",
"tensorflow.name_scope"... |
andersonfreitas/mahotas | [
"8ba2a0f14beac059cd5b53d40e39d56247e3d8d7"
] | [
"mahotas/tests/test_stretch.py"
] | [
"from mahotas.stretch import stretch\nimport mahotas\nimport mahotas as mh\nfrom nose.tools import raises\nimport numpy as np\n\ndef test_stretch():\n np.random.seed(2323)\n A = np.random.random_integers(12, 120, size=(100,100))\n A = stretch(A, 255)\n assert A.max() > 250\n assert A.min() == 0\n ... | [
[
"numpy.random.seed",
"numpy.arange",
"numpy.dstack",
"numpy.all",
"numpy.random.random_integers",
"numpy.zeros"
]
] |
stnamjef/object_detection | [
"55b8330f5b4197b9405208db2e6b8154a00469ba"
] | [
"train.py"
] | [
"import os\r\nimport shutil\r\nimport argparse\r\nimport torch as t\r\nfrom tqdm import tqdm\r\nfrom torch.utils.data import DataLoader\r\nfrom torchnet.meter import AverageValueMeter\r\nfrom data.coco_dataset import COCODataset\r\nfrom data.voc_dataset import VOCDataset\r\nfrom models.faster_rcnn_base import LossT... | [
[
"torch.load",
"torch.utils.data.DataLoader",
"torch.multiprocessing.set_sharing_strategy",
"torch.optim.SGD"
]
] |
albaltas/learning_to_rank | [
"d9e0a2410a9183dfbdb7e077d9ba17a668d44e55"
] | [
"src/models/adaboost/adaboostdt_final.py"
] | [
"# ====================================================\n# import\n# ====================================================\nimport util\nimport random\nimport numpy as np\nimport pandas as pd\nfrom sklearn.cross_validation import train_test_split\nfrom sklearn.metrics import f1_score\nfrom sklearn... | [
[
"pandas.read_csv",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.preprocessing.StandardScaler",
"numpy.array",
"sklearn.metrics.accuracy_score"
]
] |
Abhishek-Aditya-bs/Anime-Face-Generation-Pytorch | [
"1766259212141b9b04c2fcdc2aef501efb802e3e"
] | [
"MNIST-Image-Generation-Reference/main.py"
] | [
"import torch\nimport torchvision\nimport torch.nn as nn\nfrom IPython.display import Image\nfrom torchvision.utils import save_image\nimport matplotlib.pyplot as plt\nimport os\nfrom dataLoader import data_loader, denorm\nfrom parameters import *\nfrom training import save_fake_images, train_generator, train_discr... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel"
]
] |
ekrell/wardisland | [
"a9e503c9f73e34674613f59e3fdeadc64157a204"
] | [
"draw-wardisland.py"
] | [
"\n# References used\n# Python & OpenGL for Scientific Visualization, Nicolas P. Rougier\n# - https://www.labri.fr/perso/nrougier/python-opengl/\n\nfrom random import randint\nimport numpy as np\nfrom glumpy import app, gloo, gl, glm, transforms\nfrom glumpy.ext import png\nfrom scipy import interpolate\n\ndef draw... | [
[
"numpy.meshgrid",
"numpy.linspace",
"numpy.min",
"numpy.eye",
"numpy.flipud",
"numpy.cos",
"numpy.ptp",
"numpy.sin",
"numpy.ones",
"numpy.ceil",
"numpy.floor",
"numpy.column_stack",
"scipy.interpolate.interp2d",
"numpy.array",
"numpy.zeros"
]
] |
xiejx5/GeoSpace | [
"935ebb0593e367c008cc3cc42b2e20ed921b95b1"
] | [
"geospace/gdal_calc.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# ******************************************************************************\n#\n# Project: GDAL\n# Purpose: Command line raster calculator with numpy syntax\n# Author: Chris Yesson, chris.yesson@ioz.ac.uk\n#\n# ********************************************... | [
[
"numpy.logical_or",
"numpy.zeros",
"numpy.ones"
]
] |
nishathussain/ssd.pytorch | [
"6547e7522b4f0fdc9b6d12a58045023a95195cb0"
] | [
"ssd.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom functions import Detect, PriorBox\nfrom modules import L2Norm\nfrom data import v2, v1\nimport torchvision.transforms as transforms\nimport torchvision.models as models\nimport torch.backends.cudnn as cu... | [
[
"torch.nn.Softmax",
"torch.load",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
ntruongv/squad | [
"47d25ae3631ce09894b6ddaa47a2c758d9e285c9"
] | [
"train_tar_sru.py"
] | [
"\"\"\"Train a model on SQuAD.\n\nAuthor:\n Chris Chute (chute@stanford.edu)\n\"\"\"\n\nimport numpy as np\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as sched\nimport torch.utils.data as data\nimport util\n\nf... | [
[
"torch.optim.lr_scheduler.LambdaLR",
"torch.norm",
"torch.enable_grad",
"numpy.random.seed",
"torch.nn.functional.dropout",
"torch.nn.functional.nll_loss",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.cuda.manual_seed_all",
"torch.nn.DataP... |
eric-tomasi/fuzzyexact | [
"2b419b74c6aec9613a7c040e46e6580607e9412f"
] | [
"tests/test_remove_punctuation.py"
] | [
"import fuzzyexact\nimport pandas as pd\nimport string\nimport unittest\n\n\nclass TestRemovePunctuation(unittest.TestCase):\n\t'''test the remove_punctuation function'''\n\n\tdef setUp(self):\n\t\t'''set up test data frames'''\n\t\tself.my_dict1 = {'fname': ['eric', 'bob', 'john', 'phil', 'sarah', 'jen', 'jill', '... | [
[
"pandas.DataFrame"
]
] |
shirgur/UnsupervisedDepthFromFocus | [
"33c474c636bdce45cd004873a1391cf25dae4ad1"
] | [
"Utils/Losses.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom math import exp\n\n\ndef gaussian(window_size, sigma):\n gauss = torch.Tensor([exp(-(x - window_size // 2) ** 2 / float(2 * sigma ** 2)) for x in range(window_size)])\n return gauss / gauss.sum()\n\n\ndef create_window(window_size, ch... | [
[
"torch.abs",
"torch.ones",
"torch.nn.functional.l1_loss",
"torch.nn.functional.conv2d",
"torch.nn.functional.avg_pool2d",
"torch.pow",
"torch.nn.functional.pad"
]
] |
yifan-you-37/ScaffoldLearning | [
"555b1896a2f00731d2880cadec434c63d0a9af4c"
] | [
"simulation/robot_Wrench.py"
] | [
"import time\nimport math\nfrom datetime import datetime\nfrom time import sleep\nimport numpy as np\nimport random\nimport pybullet_data\nimport cv2\nimport os\nimport argparse\nimport torch\n\nimport sys\nsys.path.append('./Eval')\nsys.path.append('./')\n\nclass Robot:\n def __init__(self,pybullet_api,start_po... | [
[
"numpy.array"
]
] |
dnddnjs/pytorch-vision | [
"d432b467774f838bef37372d6cff3576c6559803"
] | [
"shake_shake/train.py"
] | [
"import os\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\n\nimport torchvision\nimport torchvision.transforms as transforms\n\nfrom model import shake_shake\nfrom cosine_optim import cosine_annealing_scheduler\nimport argparse\nfrom tensorboardX import Summa... | [
[
"torch.nn.CrossEntropyLoss",
"torch.load",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.cuda.is_available",
"torch.save"
]
] |
djhoese/lmatools | [
"67930612e71c74fdd0eed655b5f8cfdd01933b07"
] | [
"lmatools/lasso/cell_lasso_timeseries.py"
] | [
"from __future__ import absolute_import\nimport numpy as np\nfrom datetime import datetime\n\nfrom lmatools.io.LMA_h5_file import LMAh5Collection\nfrom lmatools.grid.make_grids import time_edges, seconds_since_start_of_day\nfrom lmatools.grid.density_to_files import ArrayChopper, stack_chopped_arrays\n\nclass TimeS... | [
[
"numpy.asarray"
]
] |
txg11/t5-pegasus-chinese | [
"ef8de37ff2e2911ae308f5de937547a71945cdeb"
] | [
"bert4torch/atest.py"
] | [
"from transformers.modeling_bert import BertForPreTraining\nfrom xtools import *\nfrom bert4torch.loss import CrossEntropyLoss\nimport random\nfrom transformers import AdamW, get_linear_schedule_with_warmup\nfrom torch.cuda import amp\nfrom pytorch_lightning import seed_everything\nimport pkbar\n\n# seed_everything... | [
[
"torch.cuda.amp.GradScaler"
]
] |
katzkawai/stylecloud | [
"fd97e728e0bb2d9b0a791fb8d386ef34898da43e"
] | [
"stylecloud/stylecloud.py"
] | [
"from icon_font_to_png.icon_font import IconFont\nfrom wordcloud import WordCloud, STOPWORDS, ImageColorGenerator\nimport csv\nimport os\nfrom PIL import Image\nfrom matplotlib.colors import to_rgb\nimport numpy as np\nimport fire\nfrom shutil import rmtree\nfrom pkg_resources import resource_filename\nfrom typing ... | [
[
"matplotlib.colors.to_rgb",
"numpy.invert",
"numpy.linspace",
"numpy.uint8",
"numpy.tile",
"numpy.float32",
"numpy.transpose",
"numpy.array"
]
] |
pacargile/MINESweeper_V2.0 | [
"db01e92e797e7f07f32931bec42396a1d470bfa8"
] | [
"minesweeper/MISTmod.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nContains class to generate all predicted model parameters from sample of \nstellar parameters.\n\"\"\"\n\nimport os\nimport numpy as np\nimport warnings\nwith warnings.catch_warnings():\n warnings.simplefilter('ignore')\n import h5py\nfrom scipy.spati... | [
[
"numpy.sqrt",
"numpy.unique",
"numpy.nan_to_num",
"numpy.stack",
"numpy.concatenate",
"scipy.spatial.KDTree",
"numpy.diff",
"numpy.digitize",
"numpy.array"
]
] |
alistairjwilson/nrmpInterviews_SimData | [
"8c99ff0d9a4e9db70dec5f7ef92b98054bf42a83"
] | [
"500SIGS/Code to Run SIGS only/Sim500_5_25_25.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"faster_simulations_sigs_revised.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1_-oQDQXJCYRE3JnPBMlYaLIdoBOpX25f\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\n\nclass Worker(object):\n name = \"\"... | [
[
"numpy.random.normal",
"numpy.datetime64"
]
] |
abisee/transfer-learning-conv-ai | [
"7cef27a684f1a6a4020c573e39caa1f04d40fbca"
] | [
"csv_response.py"
] | [
"\"\"\"\nLoads utterances from csv file, generates responses under different settings, and writes to another csv file\n\"\"\"\nimport logging\nimport random\nimport csv\nimport torch\nimport json\n\nfrom interact import sample_sequence, load_model, batch_decode, DecodeConfig\n\n\nINFILE = '/workspace/abi/transfer-l... | [
[
"torch.random.manual_seed",
"torch.cuda.manual_seed",
"torch.cuda.is_available"
]
] |
samiri98/TimeGAN | [
"fd29f30bc6cbcf056f84cb158eaa586eb91ddd7f"
] | [
"metrics/predictive_metrics.py"
] | [
"\"\"\"Time-series Generative Adversarial Networks (TimeGAN) Codebase.\n\nReference: Jinsung Yoon, Daniel Jarrett, Mihaela van der Schaar, \n\"Time-series Generative Adversarial Networks,\" \nNeural Information Processing Systems (NeurIPS), 2019.\n\nPaper link: https://papers.nips.cc/paper/8789-time-series-generati... | [
[
"tensorflow.compat.v1.nn.sigmoid",
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.compat.v1.disable_v2_behavior",
"numpy.asarray",
"sklearn.metrics.mean_absolute_error",
"tensorflow.compat.v1.all_variables",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.... |
FOXOBioScience/methylprep | [
"53865b309ca1e2345c46b02baa8617839ccb5560"
] | [
"tests/processing/test_pipeline.py"
] | [
"import os\nimport sys\nimport numpy as np\nimport pandas as pd\nfrom pathlib import Path\n# App\nfrom methylprep.processing import pipeline\n#patching\nimport unittest\ntry:\n # python 3.4+ should use builtin unittest.mock not mock package\n from unittest.mock import patch\nexcept ImportError:\n from mock... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"numpy.isclose"
]
] |
linyc74/lstm_dna | [
"b6db773100a4e408b5acf2c03470926d9934e625"
] | [
"experiments/experiment_001/experiment_001.py"
] | [
"import os\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.utils.tensorboard import SummaryWriter\nfrom typing import Tuple\nfrom ngslite import get_files\nfrom lstm_dna.model import LSTMModel\nfrom lstm_dna.loader import load_genbank, divide_sequence\nfrom lstm_dna.trainer import Trai... | [
[
"torch.randperm",
"torch.nn.BCEWithLogitsLoss",
"torch.utils.tensorboard.SummaryWriter",
"torch.split",
"torch.save"
]
] |
picbeats/QuOCS | [
"dea114c2d0e7d5f1f09447bdcaffb2ded24b8e78"
] | [
"src/quocslib/pulses/BasePulse.py"
] | [
"# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n# Copyright 2021- QuOCS 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# ... | [
[
"numpy.minimum",
"numpy.linspace",
"numpy.min",
"numpy.asarray",
"numpy.max",
"numpy.zeros"
]
] |
Chawin-S/TutorialISVC2019 | [
"dfa09aa55ad1e3c8612beb8b0e1437d588de474e"
] | [
"tutorial_notebooks/supplementary_code.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\nfrom ipywidgets import interact\nfrom mpl_toolkits.mplot3d.art3d import Poly3DCollection\nfrom scipy import stats\nfrom skimage import exposure, io\n\n\ndef show_plane(axis, plane, cmap=\"gray\", title=None):\n \"\"\"Shows a specific plane within 3D data.\n... | [
[
"numpy.meshgrid",
"numpy.min",
"matplotlib.pyplot.subplots",
"numpy.max",
"scipy.stats.scoreatpercentile",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
tsm55555/ares | [
"1773f82676d92499b196e9ec70a480f6f9e53db2"
] | [
"test/test_bim.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport os\nimport time\n\nfrom keras.datasets.cifar10 import load_data\n\nfrom ares import BIM, CrossEntropyLoss\nfrom ares.model.loader import load_model_from_path\nimport matplotlib.pyplot as plt\n\ndef plot_image(image,path): \n plt.figure(figsize=(40, 40))\n\n ... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.tight_layout",
"tensorflow.reshape",
"tensorflow.placeholder",
"matplotlib.pyplot.savefig",
"numpy.ones",
"tensorflow.ConfigProto",
"matplotlib.pyplot.subplot",
"numpy.equal",
"tensorflow.Session",
"matplotlib.pyplot.axis",... |
mc-nya/darts_on_train | [
"1b184429a972b0ed5ea6fb421bfb5d56ca943b41"
] | [
"pycls/core/meters.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"Meters.\"\"\"\n\nfrom collections import deque\n\nimport numpy as np\nimport pycls.core.logging as l... | [
[
"torch.max",
"numpy.median",
"torch.cuda.max_memory_allocated",
"numpy.ceil",
"numpy.mean",
"numpy.zeros"
]
] |
RedHawk989/EyeTrackVR | [
"789879f3df60dc1e000124fdeb09b105c058656e"
] | [
"InceptionNet/inferno.py"
] | [
"import os\n\n\nimport cv2\nimport numpy as np\nfrom sympy import N\nimport tensorflow.compat.v1 as tf\n\nfrom config import config\nfrom models import Inception\nfrom utils import change_channel, gray_normalizer\n\nimport time\nfrom pythonosc import udp_client\nfrom scipy import ndimage\nimport sys\n\n\nimport pyt... | [
[
"tensorflow.compat.v1.train.get_checkpoint_state",
"numpy.asarray",
"tensorflow.compat.v1.disable_v2_behavior",
"numpy.ones",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.train.checkpoint_exists"
]
] |
transformerzhou/NLP | [
"d3a50c7df735e97aeba70d40d1988ec4adb8f0af",
"7432595342b2f2139a788187d3b46fd2097bb10a"
] | [
"tests/CLS/BERT/bert_classification_train.py",
"fennlp/models/albert.py"
] | [
"import tensorflow as tf\n\nfrom fennlp.datas.checkpoint import LoadCheckpoint\nfrom fennlp.datas.dataloader import TFWriter, TFLoader\nfrom fennlp.metrics import Metric\nfrom fennlp.models import bert\nfrom fennlp.optimizers import optim\nfrom fennlp.tools import bert_init_weights_from_checkpoint\n\n# 载入参数\n# Load... | [
[
"tensorflow.train.CheckpointManager",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.train.Checkpoint",
"tensorflow.keras.layers.Dense",
"tensorflow.GradientTape",
"tensorflow.math.softmax",
"tensorflow.summary.scalar",
"tensorflow.summary.create_file_writer"
... |
elcharles1/Datathon | [
"4871b351428c5ae177c43f570540c63a1872aac6"
] | [
"cleaning.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Final\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1mE5FnyUrUhJIQx-DieJJqfy_sazRreay\n\"\"\"\n\nfrom google.colab import files\nimport pandas as pd\nimport numpy as np\nfrom sklearn import datasets, linear_mod... | [
[
"pandas.read_excel",
"pandas.ExcelWriter"
]
] |
MartinPdeS/SuPyMode | [
"8a0a77ccbdae781d878f3d92a2b476774d666fa5"
] | [
"SuPyMode/BaseClass.py"
] | [
"import os\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nfrom numpy import min, max\nfrom itertools import combinations\nfrom cycler import cycler\nplt.rc('lines', linewidth=2)\nplt.rc('axes', prop... | [
[
"matplotlib.pyplot.tight_layout",
"numpy.min",
"numpy.arange",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.plot",
"numpy.max",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
abrupt-climate/hypercc | [
"f5c47e4a9056286d318b5f1002f1aa5e10716238"
] | [
"hypercc/data/file.py"
] | [
"\"\"\"\nFunctionality for reading and interpreting single NetCDF files.\n\"\"\"\n\nfrom datetime import date\n\nimport netCDF4\nfrom pyparsing import Word, Suppress, Group, tokenMap, alphas, nums\nimport numpy as np\n\n\ndef parse_time_units(units):\n \"\"\"Parse time unit string from a NetCDF file. Such a stri... | [
[
"numpy.ma.masked_equal"
]
] |
alan-toledo/Machine-Learning-Algorithms | [
"5cbf389b28142deab7eb892b981524699571e848"
] | [
"Gaussian Discriminant Analysis/util.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef load_dataset(csv_path, label_col='y'):\n \"\"\"Load dataset from a CSV file.\n\n Args:\n csv_path: Path to CSV file containing dataset.\n label_col: Name of column to use as labels (should be 'y' or 't').\n add_intercept: Ad... | [
[
"numpy.expand_dims",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"numpy.loadtxt",
"matplotlib.pyplot.ylabel"
]
] |
ch6845/attributionpriors | [
"815a7892a8d4c42fb429856746212a44f67d2547"
] | [
"attributionpriors/pytorch_ops_cpu.py"
] | [
"#!/usr/bin/env python\nimport functools\nimport operator\nimport torch\nfrom torch.autograd import grad\nfrom torch.utils.data import DataLoader\n\ndef gather_nd(params, indices):\n \"\"\"\n Args:\n params: Tensor to index\n indices: k-dimension tensor of integers. \n Returns:\n outpu... | [
[
"torch.take",
"torch.zeros",
"torch.zeros_like",
"torch.utils.data.DataLoader",
"torch.FloatTensor",
"torch.ones_like"
]
] |
amanchhaparia/cupy | [
"a47ad3105f0fe817a4957de87d98ddccb8c7491f"
] | [
"cupyx/jit/_compile.py"
] | [
"import ast\nimport collections\nimport inspect\nimport math\nimport numbers\nimport re\nimport sys\nimport warnings\n\nimport numpy\n\nfrom cupy._core._codeblock import CodeBlock\nfrom cupy._core import _kernel\nfrom cupyx import jit\nfrom cupyx.jit import _cuda_types\nfrom cupyx.jit import _cuda_typerules\nfrom c... | [
[
"numpy.can_cast",
"numpy.dtype"
]
] |
dlordtemplar/keras-base-rest | [
"f225d6496ed2e876570eb29d0ba155a0d7b548ac"
] | [
"neuron.py"
] | [
"import random\nimport json\nimport pickle\n\nimport notebook_util\n\nnotebook_util.setup_one_gpu()\n\nimport tensorflow as tf\nfrom flask import (\n Blueprint, request, jsonify\n)\nfrom keras import backend as K\nfrom keras.models import model_from_json\nfrom keras.preprocessing.sequence import pad_sequences\nf... | [
[
"sklearn.manifold.TSNE",
"tensorflow.get_default_graph"
]
] |
g147/streamlit | [
"d54fab097caa3e6dc101eb930cddc0832e05dea9"
] | [
"lib/tests/streamlit/delta_generator_test.py"
] | [
"# Copyright 2018-2021 Streamlit 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 ... | [
[
"pandas.DataFrame"
]
] |
SHZ66/westpa | [
"c91711bf8f1f75359c0d4d28765a6d587dfd6adc"
] | [
"src/westpa/westext/weed/UncertMath.py"
] | [
"import numpy as np\nimport numpy.ma as ma\nimport itertools\n\n\nTOL = 1.0e-6\n\n\nclass UncertContainer:\n \"\"\" Container to hold uncertainty measurements. Data is convert to np masked arrays\n to avoid possible numerical problems\n \"\"\"\n\n def __init__(self, vals, vals_dmin, vals_dmax, mask=... | [
[
"numpy.expand_dims",
"numpy.sqrt",
"numpy.all",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.ma.array",
"numpy.ma.max",
"numpy.ma.masked_where",
"numpy.where",
"numpy.ma.sum",
"numpy.ma.expand_dims",
"numpy.ma.getmaskarray",
"numpy.empty_like",
"numpy.ma.... |
digitalsimboja/pymc3 | [
"e6749ef7f74359e4ef5f9fb21c3b81cdfab77590"
] | [
"pymc3/step_methods/elliptical_slice.py"
] | [
"# Copyright 2020 The PyMC Developers\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.cos",
"numpy.sin",
"numpy.random.standard_exponential",
"numpy.random.randn",
"numpy.random.uniform"
]
] |
Kate-Willett/HadISDH_Build | [
"2af5bcda562b97ae2133f7c977a3b312da517320"
] | [
"F12_CreateHomogNCDFStUnc.py"
] | [
"# PYTHON 3\n# \n# Author: Kate Willett\n# Created: 1 February 2013, IDL, Converted to Python 3 December 2020\n# Last update: 20 August 2021\n# Location:/home/h04/hadkw/HadISDH_Code/HADISDH_BUILD/\t\n# GitHub: https://github.com/Kate-Willett/HadISDH_Build\t\t\t\t\t\n# -----------------------\n# CODE PURPOSE AND OUT... | [
[
"numpy.sqrt",
"numpy.ma.std",
"numpy.ma.count",
"numpy.max",
"numpy.ma.array",
"numpy.reshape",
"numpy.arange",
"matplotlib.pyplot.close",
"numpy.float",
"numpy.ma.repeat",
"numpy.ma.sqrt",
"matplotlib.pyplot.savefig",
"numpy.genfromtxt",
"numpy.ma.masked_eq... |
Zacchaeus14/PyTorch-Encoding | [
"1a3a94851e05c56df7a23532e41e9ad587b9d35e"
] | [
"encoding/datasets/vizwiz.py"
] | [
"###########################################################################\n# Created by: Yuchen Wang\n# Email: yw3642@nyu.edu\n# Copyright (c) 2022\n###########################################################################\n\nimport json\nimport os\nfrom glob import glob\n\nimport torch\nfrom PIL import Image\... | [
[
"torch.unique",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show"
]
] |
Electronicshelf/Few-shot-regularization | [
"3fd0fef52684af77a5e574b5d61cfd8dd557b14b"
] | [
"models/resnet.py"
] | [
"import torch.nn as nn\nimport torch\nimport torch.nn.functional as F\nfrom torch.distributions import Bernoulli\n\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"\"\"3x3 convolution with padding\"\"\"\n return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,\n padding=1... | [
[
"torch.mean",
"torch.max",
"torch.nn.functional.dropout",
"torch.zeros",
"torch.nn.Dropout",
"torch.randn",
"torch.distributions.Bernoulli",
"torch.nn.Sigmoid",
"torch.nn.functional.sigmoid",
"torch.arange",
"torch.nn.functional.pad",
"torch.nn.Sequential",
"tor... |
isabella232/ml-capsules-inverted-attention-routing | [
"53899ae5b75b576a693a1bd79a2173ac3f1cdf1d"
] | [
"main_capsule.py"
] | [
"#\n# For licensing see accompanying LICENSE file.\n# Copyright (C) 2020 Apple Inc. All rights reserved.\n#\n'''Train CIFAR10 with PyTorch.'''\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.backends.cudnn as cudnn\n\nimport torchvision\nimport torchv... | [
[
"torch.optim.lr_scheduler.MultiStepLR",
"torch.nn.CrossEntropyLoss",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.DataParallel"
]
] |
mayura1996/CO3302---Automatic-Traffic-Sign-Recognition-System | [
"04463e3113c25ada68b500947bb891527e7234da"
] | [
"Source Codes/YOLOv3-OpenCV dNN.py"
] | [
"\"\"\"\nName: Mayura Manawadu - 17/ENG/072\nDetector with OpenCV dnn\n\"\"\"\n\n# Importing necessary libraries\nimport numpy as np\nimport cv2\nimport time\n\n\"\"\"\nInput video -> please rename the video file according to the input\n\"\"\"\n\nvideo = cv2.VideoCapture('videos/traffic-cars.mp4')\n\nwriter = None... | [
[
"numpy.array",
"numpy.argmax"
]
] |
davewhipps/speechbrain | [
"3ea4d4878be74465bfbfc8c5e560bbc6417e8812"
] | [
"speechbrain/nnet/containers.py"
] | [
"\"\"\"Library for implementing cascade (sequences) of different neural modules.\n\nAuthors\n * Peter Plantinga 2020\n\"\"\"\n\nimport torch\nimport inspect\nimport logging\nimport operator\nimport functools\nfrom speechbrain.nnet.linear import Linear\nfrom speechbrain.utils.callchains import lengths_arg_exists\n\n... | [
[
"torch.nn.ModuleList",
"torch.no_grad",
"torch.zeros"
]
] |
rainwoodman/h5py | [
"f9e536b4a9d96322d7e971073602c8969dbd9369"
] | [
"h5py/tests/old/test_attrs_data.py"
] | [
"# This file is part of h5py, a Python interface to the HDF5 library.\n#\n# http://www.h5py.org\n#\n# Copyright 2008-2013 Andrew Collette and contributors\n#\n# License: Standard 3-clause BSD; see \"license.txt\" for full license terms\n# and contributor agreement.\n\n\"\"\"\n Attribute data transfer ... | [
[
"numpy.array",
"numpy.ndarray",
"numpy.dtype"
]
] |
rdadolf/torch-mlir | [
"86eb493a443ffceada475e33dcd648628b16a808"
] | [
"examples/torchscript_resnet18_all_output_types.py"
] | [
"# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.\n# See https://llvm.org/LICENSE.txt for license information.\n# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n# Also available under a BSD-style license. See LICENSE.\n\nimport torch\nimport torchvision\n\nimport torch_mlir\... | [
[
"torch.ones"
]
] |
PhotonSpheres/manim | [
"7399c24b33095e29633fd75460d13eae5703cba9"
] | [
"manim/animation/transform.py"
] | [
"\"\"\"Animations transforming one mobject into another.\"\"\"\n\n__all__ = [\n \"Transform\",\n \"ReplacementTransform\",\n \"TransformFromCopy\",\n \"ClockwiseTransform\",\n \"CounterclockwiseTransform\",\n \"MoveToTarget\",\n \"ApplyMethod\",\n \"ApplyPointwiseFunction\",\n \"ApplyPoin... | [
[
"numpy.dot",
"numpy.log",
"numpy.array",
"numpy.identity"
]
] |
CityOfLosAngeles/planning-entitlements | [
"cf83b57063b4e55722cc640172b529611b263b3a"
] | [
"src/A4_toc_work.py"
] | [
"\"\"\"\r\nUpload TOC Tiers and TOC-eligible parcels\r\nIncluded: TOC Tiers\r\n TOC-eligible parcels for 2017 and 2019\r\n\"\"\"\r\nimport boto3\r\nimport geopandas as gpd\r\nimport intake\r\nimport numpy as np\r\nimport pandas as pd\r\nimport utils\r\n\r\nfrom datetime import datetime\r\n\r\ns3 = boto3.clie... | [
[
"pandas.merge"
]
] |
nkolot/smplx | [
"c0c796feec25b7febbb826bf7819227783cf21fc"
] | [
"smplx/lbs.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is\n# holder of all proprietary rights on this computer program.\n# You can only use this computer program if you have closed\n# a license agreement with MPG or you get the right to use the computer\n# program from som... | [
[
"torch.cos",
"torch.norm",
"torch.ones",
"torch.cat",
"torch.zeros",
"torch.einsum",
"torch.sin",
"torch.eye",
"torch.arange",
"torch.unsqueeze",
"torch.matmul",
"torch.bmm",
"torch.split",
"torch.stack",
"torch.index_select",
"torch.nn.functional.pa... |
ezequieljsosa/goatools | [
"3aaf4ccaa44ed254674540d73817efb0466a5cf6"
] | [
"goatools/multiple_testing.py"
] | [
"#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n\n\"\"\"\nA list of commonly used multiple correction routines\n\"\"\"\nfrom __future__ import print_function\nfrom __future__ import absolute_import\nimport sys\nimport random\nimport numpy as np\nimport collections as cx\n\n__copyright__ = \"Copyright (C) 2010-2016... | [
[
"numpy.array"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.