repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
tylerwmarrs/seglearn | [
"01fa65b3e326091671043f30c0310eead0e78bc2"
] | [
"seglearn/tests/test_pipe.py"
] | [
"# Author: David Burns\n# License: BSD\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.linear_model import Ridge\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.model_selection import cross_validate\n\nfrom seglearn.pipe import Pype\nfrom... | [
[
"sklearn.ensemble.RandomForestClassifier",
"numpy.unique",
"pandas.DataFrame",
"numpy.all",
"numpy.atleast_1d",
"numpy.concatenate",
"sklearn.linear_model.Ridge",
"numpy.random.rand",
"sklearn.model_selection.cross_validate",
"sklearn.preprocessing.StandardScaler"
]
] |
csalt-research/OpenASR-py | [
"9aea6753689d87d321260d7eb0ea0544e1b3403a"
] | [
"data/dataloaders.py"
] | [
"import torch\nimport glob\nimport os\nfrom utils.logging import logger\nimport numpy as np\nimport random\nfrom itertools import islice\n\ndef chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i+n]\n\n\"\"\"\nSimple dataloader to cycle through a list of shard paths.\n\"\"\"\nclass ShardedDataLoad... | [
[
"torch.LongTensor",
"torch.load",
"numpy.asarray",
"numpy.arange",
"numpy.full",
"torch.FloatTensor",
"numpy.argsort"
]
] |
MashmallowWoR/ADef-master | [
"1b0bd40cb3b0d555669f2c728bfb0c0b61b5dc04"
] | [
"demo_imagenet.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport os\nimport PIL.Image as Image\n\nimport torch\nfrom torch.autograd import Variable\nimport torchvision.models as models\nimport torchvision.transforms as transforms\n\nfrom deformation import ADef\nfrom vector_fields import draw_vector_field\n\npath_to_re... | [
[
"torch.max",
"numpy.sqrt",
"matplotlib.pyplot.subplots",
"torch.unsqueeze",
"numpy.array",
"matplotlib.pyplot.show"
]
] |
AnglewoodJack/data_science_champ_rtsoft_case | [
"e3951115765254df5e04543abbb4edb0749d6fe0"
] | [
"predict.py"
] | [
"def predict(file_list, lock_period=None):\n\t'''\n\n\t'''\n\t# ---------------------------------------------IMPORT-PACKAGES------------------------------------------------------\n\timport pickle\n\timport pandas as pd\n\timport numpy as np\n\tfrom preparation import data_preparation\n\tfrom datetime import timedel... | [
[
"numpy.array",
"pandas.to_datetime",
"pandas.date_range"
]
] |
wwymak/sagemaker-deployment | [
"e2c81ab5044fc3653e133ffabb5478fb4eddc7fe"
] | [
"Project/train/train.py"
] | [
"import argparse\nimport json\nimport os\nimport pickle\nimport sys\nimport sagemaker_containers\nimport pandas as pd\nimport torch\nimport torch.optim as optim\nimport torch.utils.data\n\nfrom model import LSTMClassifier\n\ndef model_fn(model_dir):\n \"\"\"Load the PyTorch model from the `model_dir` directory.\... | [
[
"torch.load",
"torch.manual_seed",
"torch.utils.data.TensorDataset",
"torch.utils.data.DataLoader",
"torch.from_numpy",
"torch.nn.BCELoss",
"torch.cuda.is_available",
"torch.save"
]
] |
dbash/umi2i_correctness | [
"34d794c95a1226db80aa07634b1cfae442b7abc8"
] | [
"synaction/detect_pose_folder.py"
] | [
"import sys\nimport glob\n\nimport tqdm\nimport imageio\nimport matplotlib.pyplot as plt\n\nimport numpy as np\nimport tensorflow as tf\n\ntfl_url = 'https://storage.googleapis.com/download.tensorflow.org/models/tflite/posenet_mobilenet_v1_100_257x257_multi_kpt_stripped.tflite'\n\ndef run_posenet(*inputs):\n tfl_p... | [
[
"tensorflow.lite.Interpreter",
"numpy.arange",
"tensorflow.cast",
"numpy.max",
"tensorflow.image.resize",
"tensorflow.keras.utils.get_file",
"numpy.argmax",
"numpy.ravel",
"tensorflow.image.resize_with_pad",
"numpy.array",
"numpy.vstack"
]
] |
cl886699/frcnn_multigpu | [
"eed28bd3eafdf43957ea66b4ab6198d7dca57385"
] | [
"detection/core/anchor/anchor_target.py"
] | [
"import tensorflow as tf\n\nfrom detection.core.bbox import geometry, transforms\nfrom detection.utils.misc import trim_zeros\n\nclass AnchorTarget(object):\n def __init__(self,\n target_means=(0., 0., 0., 0.), \n target_stds=(0.1, 0.1, 0.2, 0.2),\n num_rpn_deltas=... | [
[
"tensorflow.reduce_max",
"tensorflow.zeros",
"tensorflow.stack",
"tensorflow.reshape",
"tensorflow.equal",
"tensorflow.ones",
"tensorflow.gather",
"tensorflow.random.shuffle",
"tensorflow.argmax",
"tensorflow.greater_equal"
]
] |
Koushik0901/Swift-SRGAN | [
"cd2414f097853bd500e4aec050379b5d37b29ac6"
] | [
"swift-srgan/metric.py"
] | [
"import math\nimport torch\nimport torch.nn.functional as F\n\n\n\ndef gaussian(window_size, sigma):\n gauss = torch.Tensor([math.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, channel):\n _1D_window =... | [
[
"torch.nn.functional.conv2d"
]
] |
avuku06/G | [
"8b505691f305783d66a1976ad51748073d2e76f6"
] | [
"face_anti-spoof_challenge@CVPR_zpeng/models/fishnet.py"
] | [
"'''\nFishNet\nAuthor: Shuyang Sun\n'''\nfrom __future__ import division\nimport torch\nimport math\nfrom .fish_block import *\n\n\n__all__ = ['fish']\n\n\n\n\nclass Fish(nn.Module):\n def __init__(self, block, num_cls=2, num_down_sample=5, num_up_sample=3, trans_map=(2, 1, 0, 6, 5, 4),\n network... | [
[
"torch.cat"
]
] |
OneDirection9/LASER | [
"00daa5e32fa302e82118186f95a51743fdefa55e"
] | [
"laser/laser_lstm.py"
] | [
"from collections import OrderedDict\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom fairseq import utils\nfrom fairseq.models import (\n FairseqEncoder,\n FairseqIncrementalDecoder,\n FairseqEncoderDecoderModel,\n register_model,\n register_model_architecture,\n)\nfro... | [
[
"torch.LongTensor",
"torch.load",
"torch.nn.functional.dropout",
"torch.nn.LSTM",
"torch.cat",
"torch.nn.Embedding",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.functional.linear"
]
] |
dkoes/tensorflow | [
"89c0134fd811a12d8100da385cb9a218247f0933",
"b3492ab89abbb7892ad7d4bfc82ee1d7ddafca7e"
] | [
"tensorflow/contrib/tpu/python/tpu/keras_support.py",
"tensorflow/contrib/tpu/python/tpu/async_checkpoint.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.contrib.cluster_resolver.python.training.tpu_cluster_resolver.TPUClusterResolver",
"tensorflow.contrib.tpu.python.tpu.tpu.rewrite",
"tensorflow.contrib.tpu.python.ops.tpu_ops.infeed_dequeue_tuple",
"tensorflow.python.ops.array_ops.placeholder",
"tensorflow.python.keras.backend.dtyp... |
z-vasconcelos/udacity_facial_keypoints | [
"96ef3b08714e224a3aed60154b133fdc595ff5ca"
] | [
"models.py"
] | [
"## TODO: define the convolutional neural network architecture\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n# can use the below import should you choose to initialize the weights of your Net\nimport torch.nn.init as I\n\n\nclass Net(nn.Module):\n\n def __init__(self):\n super(N... | [
[
"torch.nn.Dropout",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d"
]
] |
wolaituodiban/toad | [
"9aa755273c8fc055c8a244f244e5437c189aa884"
] | [
"toad/nn/loss.py"
] | [
"from typing import Dict, List\n\nimport torch\nfrom torch.nn import Module\n\nfrom .functional import focal_loss\n\n\nclass FocalLoss(Module):\n def __init__(self, alpha = 1., gamma = 2., reduction = 'mean'):\n super(FocalLoss, self).__init__()\n \n self.alpha = alpha\n self.gamma = ... | [
[
"torch.isnan"
]
] |
vic9527/ViClassifier | [
"fd6c4730e880f35a9429277a6025219315e067cc"
] | [
"converters/pt2wts.py"
] | [
"def convert(pth_path, wts_path, device_type='cuda'):\n import struct\n import torch\n from viclassifier.utils import dev_opt\n\n device = dev_opt.usingDevice(device_type)\n model = torch.load(pth_path, map_location=device)\n model.to(device)\n # 测试时不启用 BatchNormalization 和 Dropout\n model.e... | [
[
"torch.load"
]
] |
mattwachter/extract-diode-parameters | [
"4def6deef7c4937d7e1706809e68d7466ee97d7f"
] | [
"diode_equations.py"
] | [
"\"\"\" Physics equations describing diode behavior\n\"\"\"\nimport numpy as np\nfrom scipy.optimize import curve_fit\nimport scipy.constants as const\nfrom scipy.special import lambertw\n\nfrom diode_utils import *\n\n\ndef ideal_diode_eq(v_ca, i_s, m, T):\n \"\"\"Shockley Diode equation\n\n Args:\n v... | [
[
"numpy.log",
"numpy.gradient",
"numpy.real",
"numpy.vectorize",
"numpy.exp",
"scipy.optimize.curve_fit"
]
] |
Harshit4199/3D-imaging-Hippocampal-segmentation | [
"3ba8c0cf354395e4514fc84756b824be18e32eed"
] | [
"section_2/src/data_prep/SlicesDataset.py"
] | [
"\"\"\"\nModule for Pytorch dataset representations\n\"\"\"\n\nimport torch\nfrom torch.utils.data import Dataset\n\nclass SlicesDataset(Dataset):\n \"\"\"\n This class represents an indexable Torch dataset\n which could be consumed by the PyTorch DataLoader class\n \"\"\"\n def __init__(self, data):... | [
[
"torch.from_numpy"
]
] |
sathishksankarpandi/ktrain | [
"bc9169661592ee14b95d9e56622dbb20e66b3568"
] | [
"ktrain/tests/test_textclassification.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nTests of ktrain text classification flows\n\"\"\"\nimport sys\nimport os\nos.environ[\"CUDA_DEVICE_ORDER\"]=\"PCI_BUS_ID\";\nos.environ[\"CUDA_VISIBLE_DEVICES\"]=\"0\"\nsys.path.insert(0,'../..')\nimport IPython\nfrom unittest import TestCase, main, skip\nimport numpy as np\nimport ... | [
[
"numpy.argmax",
"sklearn.datasets.fetch_20newsgroups"
]
] |
kellirestivo/neuralpredictors | [
"8e60c9ce91f83e3dcaa1b3dbe4422e1509ccbd5f"
] | [
"neuralpredictors/layers/readouts/factorized.py"
] | [
"import torch\nfrom torch import nn as nn\nimport numpy as np\n\nfrom .base import Readout\n\n\nclass FullFactorized2d(Readout):\n \"\"\"\n Factorized fully connected layer. Weights are a sum of outer products between a spatial filter and a feature vector.\n \"\"\"\n\n def __init__(\n self,\n ... | [
[
"torch.einsum",
"torch.from_numpy",
"torch.Tensor",
"numpy.unique"
]
] |
AsimKhan2019/OpenAI-Lab | [
"d0669d89268f2dc01c1cf878e4879775c7b6eb3c"
] | [
"rl/hyperoptimizer/random_search.py"
] | [
"import json\nimport numpy as np\nfrom rl.analytics import ideal_fitness_score\nfrom rl.hyperoptimizer.base_hyperoptimizer import HyperOptimizer\nfrom rl.util import PROBLEMS, to_json, logger\n\n\nclass RandomSearch(HyperOptimizer):\n\n '''\n Random Search by sampling on hysphere around a search path\n alg... | [
[
"numpy.clip",
"numpy.amin",
"numpy.around",
"numpy.arange",
"numpy.linalg.norm",
"numpy.random.randn",
"numpy.random.rand",
"numpy.digitize"
]
] |
DanieleGammelli/graph-meta-rl-for-amod | [
"bd6fe8cd561ab70e85d360966715a53a0a56386c"
] | [
"src/algos/gnn.py"
] | [
"\"\"\"\nA2C-GNN\n-------\nThis file contains the A2C-GNN specifications. In particular, we implement:\n(1) GNNParser\n Converts raw environment observations to agent inputs (s_t).\n(2) GNNActor:\n Policy represented by a Temporal Graph Network (Section 4.3 in the paper)\n(3) GNNCritic:\n Critic represente... | [
[
"torch.optim.Adam",
"torch.cat",
"torch.load",
"torch.sum",
"torch.stack",
"torch.tensor",
"numpy.finfo",
"torch.nn.Linear",
"numpy.std",
"numpy.mean",
"torch.arange",
"torch.device",
"torch.nn.GRUCell",
"torch.save"
]
] |
mittelmax/sptrans_Data | [
"a1ccb0d9566c9c9f9b30951bdc8430c930007311"
] | [
"downloader.py"
] | [
"from bs4 import BeautifulSoup\nimport lxml\nimport requests\nimport pandas as pd\nimport urllib\nimport ssl\nfrom os import listdir\n\n# data url's\nurl_2020 = requests.get(\"https://www.prefeitura.sp.gov.br/cidade/secretarias/transportes/institucional/sptrans/acesso_a_informacao/index.php?p=292723\").text\nurl_20... | [
[
"pandas.read_excel",
"pandas.to_datetime"
]
] |
Teagum/chainsaddiction | [
"b57995e60361134cfd4f6f748a92457e8ef14c81"
] | [
"tests/utils.py"
] | [
"\"\"\"\nChaisAddiction testing utilities\n\"\"\"\nfrom pathlib import Path\nfrom typing import Union\n\nimport numpy as np\n\n\ndef gen_init_params(m_states: int, data: np.ndarray) -> tuple:\n \"\"\"\n Generate initila parameters for HMM training.\n \"\"\"\n init_lambda = gen_sdm(data, m_states)\n i... | [
[
"numpy.random.rand"
]
] |
bwspenc/neml | [
"2fe283cb14ab309d95627590408670dab877c5a5"
] | [
"test/test_elasticity.py"
] | [
"import sys\nsys.path.append('..')\n\nfrom neml import elasticity, interpolate\nimport unittest\n\nfrom common import *\n\nimport numpy as np\nimport numpy.linalg as la\n\nclass CommonElasticity(object):\n \"\"\"\n Tests that could apply to any elastic model.\n \"\"\"\n def test_C2S(self):\n C = self.model... | [
[
"numpy.linalg.inv",
"numpy.allclose",
"numpy.isclose"
]
] |
NasserMo/ulmo | [
"46c835100bb76f44f46c752f8cadb3cbe84652b1"
] | [
"ulmo/usgs/nwis/hdf5.py"
] | [
"import contextlib\nimport copy\nimport os\nimport shutil\nimport sys\nimport tempfile\nimport warnings\n\nimport numpy as np\nimport pandas\nimport tables\nfrom tables.scripts import ptrepack\n\nfrom ulmo import util\nfrom ulmo.usgs.nwis import core\n\n\n# default hdf5 file path\nDEFAULT_HDF5_FILE_PATH = util.get_... | [
[
"pandas.notnull",
"pandas.to_datetime",
"pandas.isnull",
"pandas.io.pytables.get_store",
"pandas.DataFrame"
]
] |
wjj19950101/Magrank_v1 | [
"73ab296f4269ccc9a943b22088c8ca3e1c88af5e"
] | [
"Mag2021-main-code/Proactive caching/FCNN/FCNN.py"
] | [
"# #################################################################\r\n# Codes have been tested successfully on Python 3.6.0 with TensorFlow 1.14.0.\r\n# #################################################################\r\nimport numpy as np\r\nimport sklearn.preprocessing as prep\r\nimport tensorflow as tf\r\n... | [
[
"tensorflow.get_variable",
"numpy.sqrt",
"tensorflow.zeros",
"tensorflow.nn.l2_loss",
"tensorflow.train.AdamOptimizer",
"tensorflow.summary.scalar",
"tensorflow.get_collection",
"tensorflow.subtract",
"tensorflow.name_scope",
"tensorflow.nn.dropout",
"tensorflow.matmul"... |
raspstephan/nwp-downscale | [
"dbb6d560126a8d13a2748bc088f382e68fa7c0b3"
] | [
"notebooks/visualise_predictions.py"
] | [
"import torch\nfrom torch.nn import functional as F\nfrom torch import nn\nfrom pytorch_lightning.core.lightning import LightningModule\nimport pytorch_lightning as pl\nfrom pytorch_lightning import loggers as pl_loggers\n\nimport torch.optim as optim\nimport torchvision\nimport torchvision.datasets as datasets\nim... | [
[
"torch.utils.data.Subset",
"matplotlib.pyplot.tight_layout",
"numpy.random.choice",
"numpy.min",
"torch.manual_seed",
"torch.zeros",
"torch.randn",
"matplotlib.pyplot.savefig",
"torch.tensor",
"numpy.max",
"torch.cuda.is_available",
"torch.device"
]
] |
nessessence/ReID_Transitve_Label | [
"e6bb8b51ddc628ebfa2d20d46e39ba224063a3da"
] | [
"main.py"
] | [
"import torch\nfrom modeling import build_model\nfrom dataset import ImageDataset\nfrom torch.utils.data import DataLoader\n\nfrom distance import Mahalanobis_distance\nfrom uploader import upload_multiple_files,upload_to_db\n\ndef dataloader_collate_fn(batch):\n imgs, img_paths = zip(*batch)\n return torch.s... | [
[
"torch.load",
"torch.utils.data.DataLoader",
"numpy.save",
"torch.no_grad",
"torch.stack",
"numpy.load",
"torch.cuda.device_count",
"torch.save"
]
] |
StefanosChaliasos/types-bug-study-artifact | [
"eafcb89bf2b383b3fb110177ad404568c9ee0420"
] | [
"scripts/rq4.py"
] | [
"#! /usr/bin/env python3\nimport argparse\nimport json\nimport statistics\nimport os\n\nfrom collections import defaultdict\n\nimport matplotlib.pylab as plt\nimport matplotlib.offsetbox as offsetbox\nimport seaborn as sns\nimport pandas as pd\n\n\ndef get_args():\n parser = argparse.ArgumentParser(\n des... | [
[
"matplotlib.pylab.style.use",
"matplotlib.pylab.savefig",
"matplotlib.pylab.subplots",
"pandas.DataFrame"
]
] |
zhaomh1998/TubularRobotics | [
"226e8711061a3fc53bfaee12b02a12e78388c036"
] | [
"wirelessMain.py"
] | [
"import WirelessTool, socket, traceback, colorama, time\nimport numpy as np\ncolorama.init()\n\nTCPServer = WirelessTool.TCPEchoServer(3000,0.1)\nUltrasonic = WirelessTool.TCPClient('127.0.0.1',3001,0.1)\nEncoder = WirelessTool.TCPClient('127.0.0.1',3002,0.1)\nMainController = WirelessTool.TCPClient('127.0.0.1',300... | [
[
"numpy.array_str",
"numpy.zeros",
"numpy.delete",
"numpy.median"
]
] |
alessandrobalata/pyrlmc | [
"493d1ad5378823a9bbb032077bea2838db76602c"
] | [
"objects/control.py"
] | [
"from objects.cont_value import ContValue\nfrom objects.controlled_process import ControlledProcess\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom problems.problem import Problem\n\n\nclass Control:\n '''\n Control object to be used both backward and forward\n '''\n\n def __init__(self, pr... | [
[
"numpy.abs",
"matplotlib.pyplot.title",
"numpy.linspace",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"numpy.zeros",
"matplotlib.pyplot.ylabel"
]
] |
ferrocactus/CellarV | [
"069044b742a1ae5dcc494606ee5d975987e620f1"
] | [
"controller/data_loader.py"
] | [
"import os\nimport gc\n\nimport numpy as np\nimport dash\nfrom dash.dependencies import Input, Output, State\nfrom dash.exceptions import PreventUpdate\nimport dash_html_components as html\nimport dash_bootstrap_components as dbc\n\nfrom app import app, logger, dbroot\nfrom controller.cellar.utils.exceptions import... | [
[
"numpy.round",
"numpy.array",
"numpy.concatenate",
"numpy.char.add"
]
] |
jthorton/geomeTRIC | [
"1cee4490c367f4b6e92c661808659231b377c727"
] | [
"geometric/tests/test_openmm.py"
] | [
"\"\"\"\nA set of tests for using the OpenMM engine\n\"\"\"\n\nimport copy\nimport numpy as np\nimport json, os, shutil\nfrom . import addons\nimport geometric\nimport pytest\nimport itertools\n\nlocalizer = addons.in_folder\ndatad = addons.datad\n\n@addons.using_openmm\ndef test_dlc_openmm_water3(localizer):\n ... | [
[
"numpy.array",
"numpy.allclose"
]
] |
dishen12/whale | [
"2d5bc3aaccab87ecebe31663d2d6c99d52563cc8"
] | [
"data_aug.py"
] | [
"from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img\nimport numpy as np\nimport os\n\ndatagen = ImageDataGenerator(\n rotation_range=30,\n width_shift_range=0.2,\n height_shift_range=0.2,\n shear_range=0.2,\n zoom_range=0.2,\n hor... | [
[
"numpy.random.shuffle"
]
] |
etpr/sequential-manifold-planning | [
"a5f05d04c9ab954f39f0e8eecb3e90781564ffaa"
] | [
"psm/algorithms/psm.py"
] | [
"import numpy as np\nfrom scipy.linalg import null_space\nfrom math import ceil\nimport tqdm\nfrom psm.tasks import Task\nfrom psm.tree import Tree\nfrom psm.util import unit_ball_measure, is_on_manifold, get_volume, Projection\nfrom psm.manifolds import ManifoldStack, Manifold\n\n\nclass PSM:\n def __init__(sel... | [
[
"numpy.log",
"numpy.linalg.norm",
"numpy.ones",
"numpy.random.rand",
"numpy.isinf"
]
] |
GrayXu/SpectralNormalization-TF-Keras | [
"ed2c23ac5b6a98eb0f5eec9cec51dfe3f9128793"
] | [
"SNorm_tf_keras.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom tensorflow.keras import backend as K\nfrom tensorflow.keras.engine import *\n# from tensorflow.keras.legacy import interfaces\nfrom tensorflow.keras import activations\nfrom tensorflow.keras impor... | [
[
"numpy.asarray",
"tensorflow.keras.constraints.serialize",
"tensorflow.keras.regularizers.serialize",
"tensorflow.keras.backend.dtype",
"tensorflow.keras.backend.gather",
"tensorflow.keras.backend.reshape",
"numpy.copy",
"numpy.zeros",
"tensorflow.keras.initializers.get",
"... |
satvikmashkaria/CS748_project | [
"57185b6a467e638d6db96cf1c7d3dbe8d6bf5032"
] | [
"cswor/runner.py"
] | [
"from mod_copeland import sample_complexity\n\n\nargs = {}\n# args['heuristic'] = 'random'\nargs['heuristic'] = 'greedy'\nargs['n_voters'] = 1000\nargs['alpha'] = 0.05\n# args['probs'] = [0.4, 0.45, 0.5, 0.7, 0.8]\n# args['probs'] = [0.1, 0.2, 0.3, 0.4, 0.5]\nargs['probs'] = [0.1 + 0.05*i for i in range(10)]\nprint... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
cmshobe/grass-scripts | [
"5d593f301fd708252e5a69b7304ce28ea8490506"
] | [
"delineate_watersheds.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Nov 19 14:57:29 2018\n\n@author: charlie\n\ncreate watersheds from pour point shapefile 'cleaned_pour_points'\n\"\"\"\nimport numpy as np\nimport grass.script as grass\nfrom grass.pygrass.modules.shortcuts import general as g\nfrom grass.pygra... | [
[
"numpy.genfromtxt"
]
] |
eilon123/CROSR-main | [
"c94b117008d41c39751d2c6cfc4e043e4d8167c6"
] | [
"libMR/setup.py"
] | [
"from distutils.core import setup\nfrom distutils.extension import Extension\nfrom Cython.Distutils import build_ext\nfrom Cython.Build import cythonize\nimport sys\nimport numpy\n#ext_modules = [Extension(\"libmr\", [\"libmr.pyx\", \"MetaRecognition.cpp\"])]\n\nsetup(\n ext_modules = cythonize(Extension('libm... | [
[
"numpy.get_include"
]
] |
fgulan/machine-learning-fer | [
"d37142a1f00fd04f1454b43c1b4bb02b0dcf179b"
] | [
"LAB2/mlutils.py"
] | [
"import numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\ndef plot_2d_clf_problem(X, y, h=None):\r\n '''\r\n Plots a two-dimensional labeled dataset (X,y) and, if function h(x) is given, \r\n the decision surfaces.\r\n '''\r\n assert X.shape[1] == 2, \"Dataset is not two-dimensional\"\r\n if h... | [
[
"numpy.arange",
"matplotlib.pyplot.contourf",
"matplotlib.pyplot.scatter"
]
] |
kowaalczyk/image-cluster | [
"2d034dd154491da8b22ee6662c9dcf9500283186"
] | [
"image_cluster/pipeline/pipeline.py"
] | [
"from sklearn.base import BaseEstimator, ClusterMixin, TransformerMixin\nfrom sklearn.metrics import silhouette_score, calinski_harabaz_score\nimport numpy as np\n\nfrom image_cluster.pipeline.utils import VerboseMixin\nfrom image_cluster.pipeline.model_factory import ModelFactory\nfrom image_cluster.types import S... | [
[
"numpy.min",
"sklearn.metrics.silhouette_score",
"sklearn.metrics.calinski_harabaz_score",
"numpy.max",
"numpy.mean",
"numpy.bincount",
"numpy.var"
]
] |
oguzserbetci/EffiCare | [
"4a81b6ddcff6b3b7d37dd8a6a8cd0419d742709e"
] | [
"models/encoders.py"
] | [
"import torch\nimport torch.nn\n\nfrom models.modules import *\nfrom utils import load_class\n\n\nclass EventEncoder(nn.Module):\n def __init__(self, vocab, freeze_emb, emb_dim, include_time, n_bins):\n super().__init__()\n input_size = emb_dim\n input_size += n_bins\n if include_time... | [
[
"torch.zeros",
"torch.cat",
"torch.eye",
"torch.exp",
"torch.log",
"torch.arange"
]
] |
gmg-utn/elementos_finitos | [
"5f8b11886d94d926fb358ad6344b079c5cb63e4e"
] | [
"ejemplos/ejemplo3.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nEjemplo 3: aproximación de una función\n\nJupyter notebook\n \nautor: Ramiro Irastorza\n\"\"\"\n\n\nfrom __future__ import print_function\nimport numpy as np #importo numpy y lo denomino np\nimport matplotlib.pyplot as plt\n\n#Definimos la función sombrer... | [
[
"numpy.linspace",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.subplots",
"numpy.sin",
"numpy.zeros_like",
"matplotlib.pyplot.show"
]
] |
haoyudong-97/tg2019task | [
"4f31968cc49105d13bc95487136dc3ae986bf4d1"
] | [
"knn.py"
] | [
"#!/usr/bin/env python3\n\nimport os\nimport warnings\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.feature_extraction.text import HashingVectorizer\nfrom sklearn.metrics.pairwise imp... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"sklearn.metrics.pairwise.cosine_distances",
"numpy.argsort",
"pandas.isna",
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
sinaure/server | [
"e214447ae534a472bf8aaeff0e8024a3dc936ad2"
] | [
"qa/L0_sequence_stress/sequence_stress.py"
] | [
"# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n# notice, this list... | [
[
"numpy.random.seed",
"numpy.dtype",
"numpy.full",
"numpy.random.RandomState",
"numpy.random.randint"
]
] |
lstorchi/mrkvtheilcont | [
"d4215073a57b78d2b1ff424615e481ced4d3e7d5"
] | [
"markovc.py"
] | [
"import numpy.linalg\nimport numpy.random\nimport scipy.stats\nimport scipy.io\nimport argparse\nimport numpy\nimport math\nimport sys\nimport os\n\nimport os.path\n\nimport matplotlib.mlab as mlab\nimport matplotlib.pyplot as plt\n\n\nsys.path.append(\"./module\")\nimport mainmkvcmp\nimport basicutils\n\nparser = ... | [
[
"numpy.max",
"numpy.zeros"
]
] |
Alan-Du/Commodity_Tracker | [
"fc7d4c92535424be7dc82f47dd513332b4b772c9"
] | [
"Spread_Strat/HC_Spread.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Apr 23 07:34:38 2020\r\n\r\n@author: shaolun du\r\n@contact: shaolun.du@gmail.com\r\n\"\"\"\r\n\r\nimport DB.dbFetch as dbFetch\r\nimport pandas as pd\r\nimport datetime as dt\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.dates as mdates\r\n\r\ndef gen_... | [
[
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.subplots"
]
] |
dkp-1024/my_machine_learning | [
"11ace64c7ae5c709f20cb6691529768b42d08d22"
] | [
"numpy_practice/a5_arrayConcatination.py"
] | [
"import numpy as np \n\n#You can concatenate two or more arrays at once.\nx = np.array([1, 2, 3])\ny = np.array([3, 2, 1])\nz = [21,21,21]\nprint(np.concatenate([x, y,z]))\n# array([ 1, 2, 3, 3, 2, 1, 21, 21, 21])\n\n#You can also use this function to create 2-dimensional arrays.\ngrid = np.array([[1,2,3],[4,5... | [
[
"numpy.hstack",
"numpy.split",
"numpy.arange",
"numpy.vsplit",
"numpy.concatenate",
"numpy.array",
"numpy.vstack"
]
] |
Panesher/Machine-Learning | [
"dcc46c7816af209c5f031feb84a0eb3b2b5d9515"
] | [
"ML/HW-5/hw5code.py"
] | [
"import numpy as np\nfrom collections import Counter\nfrom sklearn.base import BaseEstimator, ClassifierMixin\n\ndef find_best_split(feature_vector, target_vector):\n \"\"\"\n Под критерием Джини здесь подразумевается следующая функция:\n $$Q(R) = -\\frac {|R_l|}{|R|}H(R_l) -\\frac {|R_r|}{|R|}H(R_r)$$,\n ... | [
[
"numpy.logical_not",
"numpy.unique",
"numpy.arange",
"numpy.cumsum",
"numpy.all",
"numpy.argsort",
"numpy.array",
"numpy.zeros"
]
] |
gauravsdeshmukh/PlugFlowCrystallizer | [
"684e80438ef2912fab60201f305f7c288d4b5274"
] | [
"PlugFlowCrystallizer_Input.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Jul 27 17:33:26 2018\r\n\r\n@author: Gaurav\r\n\"\"\"\r\n\r\nimport scipy as sci\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.cm as cm\r\nfrom PlugFlowCrystallizer import *\r\n\r\n########################################################################... | [
[
"scipy.linspace",
"matplotlib.pyplot.contourf",
"matplotlib.pyplot.title",
"scipy.sum",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.quiver",
"scipy.meshgrid",
"matplotlib.pyplot.figure"
]
] |
res-life/cudf | [
"94a5d4180b1281d4250e9f915e547789d8da3ce0"
] | [
"python/cudf/cudf/tests/test_stats.py"
] | [
"# Copyright (c) 2018-2022, NVIDIA CORPORATION.\n\nfrom concurrent.futures import ThreadPoolExecutor\n\nimport cupy as cp\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nimport cudf\nfrom cudf.datasets import randomdata\nfrom cudf.testing._utils import assert_eq, assert_exceptions_equal\n\nparams_dtypes ... | [
[
"numpy.random.random",
"numpy.testing.assert_approx_equal",
"numpy.random.seed",
"numpy.abs",
"numpy.asarray",
"numpy.arange",
"numpy.issubdtype",
"numpy.random.normal",
"numpy.random.randint",
"numpy.isscalar",
"numpy.repeat",
"numpy.array",
"numpy.zeros",
... |
arjun921/image-classification-for-dummies | [
"acefcd557699500d44902d17009da17820f289fc"
] | [
"retrain_serving.py"
] | [
"from __future__ import absolute_import\r\nfrom __future__ import division\r\nfrom __future__ import print_function\r\n\r\nimport argparse\r\nfrom datetime import datetime\r\nimport hashlib\r\nimport os.path\r\nimport random\r\nimport re\r\nimport struct\r\nimport sys\r\nimport tarfile\r\n\r\nimport numpy as np\r\n... | [
[
"tensorflow.python.framework.tensor_shape.scalar",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.python.platform.gfile.Walk",
"tensorflow.gfile.DeleteRecursively",
"tensorflow.zeros",
"tensorflow.gfile.Exists",
"tensorflow.stack",
"numpy.squeeze",
"tensorflow.c... |
Pandinosaurus/mne-python | [
"6ae3b22033c745cce5cd5de9b92da54c13c36484"
] | [
"mne/source_estimate.py"
] | [
"# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Matti Hämäläinen <msh@nmr.mgh.harvard.edu>\n# Martin Luessi <mluessi@nmr.mgh.harvard.edu>\n# Mads Jensen <mje.mads@gmail.com>\n#\n# License: BSD (3-clause)\n\nimport contextlib\nimport copy\nimport os.path as op\nfrom types i... | [
[
"numpy.diag",
"numpy.dot",
"scipy.linalg.svd",
"numpy.asarray",
"sklearn.feature_extraction.grid_to_graph",
"numpy.in1d",
"scipy.sparse.block_diag",
"numpy.vstack",
"numpy.concatenate",
"numpy.round",
"numpy.max",
"numpy.mean",
"numpy.any",
"numpy.searchsort... |
TMmichi/stable-baselines | [
"b55d2de60c90925bdf109e372f86789ad21b5a36"
] | [
"stable_baselines/common/base_class.py"
] | [
"import os\nimport glob\nimport json\nimport zipfile\nimport warnings\nfrom abc import ABC, abstractmethod\nfrom collections import OrderedDict, deque\nfrom typing import Union, List, Callable, Optional\n\nimport gym\nimport cloudpickle\nimport numpy as np\nimport tensorflow as tf\n\nfrom stable_baselines.common.mi... | [
[
"numpy.max",
"tensorflow.train.AdamOptimizer",
"numpy.exp",
"numpy.square",
"numpy.swapaxes",
"numpy.arange",
"tensorflow.stop_gradient",
"tensorflow.square",
"numpy.zeros",
"numpy.log",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tenso... |
tsaikenyoo/BERT_SQuAD_pytorch | [
"411d9aa286081b398a0f60878ae751654a9cb53f"
] | [
"model/transformer/__main__.py"
] | [
"\nimport torch\nfrom . import *\nfrom .encoder import TransformerEncoder\n\ndef main():\n encoder = TransformerEncoder()\n input = torch.rand(2, 768)\n print(input)\n\n\n\n\nif __name__ == '__main__':\n main()"
] | [
[
"torch.rand"
]
] |
ronaldluc/muzero-general | [
"fa84fc0ddc43013e1b67a7ffc741e3433c90b696"
] | [
"models.py"
] | [
"import math\nfrom abc import ABC, abstractmethod\n\nimport torch\n\n\nclass MuZeroNetwork:\n def __new__(cls, config):\n if config.network == \"fullyconnected\":\n return MuZeroFullyConnectedNetwork(\n config.observation_shape,\n config.stacked_observations,\n ... | [
[
"torch.nn.Sequential",
"torch.softmax",
"torch.abs",
"torch.ones",
"torch.cat",
"torch.sign",
"torch.zeros",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.sum",
"torch.tensor",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.functional.relu",
"torch.n... |
mmmorks/panda | [
"d020b099fdf1a8e5ecd4d8b5289644e74264b9d7"
] | [
"tests/safety/test_tesla.py"
] | [
"#!/usr/bin/env python3\nimport unittest\nimport numpy as np\nfrom panda import Panda\nimport panda.tests.safety.common as common\nfrom panda.tests.safety import libpandasafety_py\nfrom panda.tests.safety.common import CANPackerPanda\n\nANGLE_DELTA_BP = [0., 5., 15.]\nANGLE_DELTA_V = [5., .8, .15] # windup limi... | [
[
"numpy.arange",
"numpy.interp",
"numpy.isclose"
]
] |
zidingz/datasets | [
"02edd9ebc79f715adb1c718d1439fda83dc356f1"
] | [
"src/datasets/search.py"
] | [
"import importlib.util\nimport os\nimport tempfile\nfrom pathlib import PurePath\nfrom typing import TYPE_CHECKING, Dict, List, NamedTuple, Optional, Union\n\nimport numpy as np\n\nfrom . import utils\nfrom .utils import logging\n\n\nif TYPE_CHECKING:\n from .arrow_dataset import Dataset # noqa: F401\n\n try... | [
[
"numpy.asarray"
]
] |
xandaschofield/bptf | [
"de8ac77a89fadb01aceb26d14b4366c8afab2b87"
] | [
"code/utils.py"
] | [
"import numpy as np\nimport numpy.random as rn\nimport sktensor as skt\n\nimport pickle\nfrom pathlib import Path as path\nfrom time import sleep\n\n\ndef is_binary(X):\n \"\"\"Checks whether input is a binary integer tensor.\"\"\"\n if np.issubdtype(X.dtype, int):\n if isinstance(X, skt.sptensor):\n ... | [
[
"numpy.rollaxis",
"numpy.dot",
"numpy.savez",
"numpy.random.random",
"numpy.einsum",
"numpy.issubdtype",
"numpy.zeros_like",
"numpy.bincount"
]
] |
saifrahmed/tfx-local | [
"3b0374706dc5189d712e5120218f66ab44bea821"
] | [
"tfx/components/trainer/executor.py"
] | [
"# Copyright 2019 Google 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# Unless required by appl... | [
[
"tensorflow.estimator.train_and_evaluate",
"tensorflow.logging.info",
"tensorflow.contrib.training.HParams"
]
] |
TheShadow29/btp-cv | [
"e468a1baf36364096fb7cb4ff854a745298cec12"
] | [
"code/cnn_ecg/lib/grid_graph.py"
] | [
"import sklearn\nimport sklearn.metrics\nimport scipy.sparse, scipy.sparse.linalg # scipy.spatial.distance\nimport numpy as np\n\n\ndef grid_graph(grid_side,number_edges,metric):\n \"\"\"Generate graph of a grid\"\"\"\n z = grid(grid_side)\n dist, idx = distance_sklearn_metrics(z, k=number_edges, metric=m... | [
[
"numpy.abs",
"numpy.meshgrid",
"numpy.linspace",
"numpy.arange",
"numpy.mean",
"numpy.argsort",
"numpy.exp",
"sklearn.metrics.pairwise.pairwise_distances",
"numpy.empty"
]
] |
zaza0209/abess | [
"42e5b7180383c450a3355219f3dd8cc8567d4a00"
] | [
"python/abess/bess_base.py"
] | [
"import numbers\nimport numpy as np\nfrom scipy.sparse import coo_matrix\nfrom sklearn.utils.validation import check_X_y, check_array, check_is_fitted\nfrom sklearn.base import BaseEstimator\nfrom .cabess import *\n\n\nclass bess_base(BaseEstimator):\n \"\"\"\n Parameters\n ----------\n max_iter : int, ... | [
[
"scipy.sparse.coo_matrix",
"numpy.log",
"sklearn.utils.validation.check_is_fitted",
"sklearn.utils.validation.check_array",
"numpy.lexsort",
"numpy.ones",
"sklearn.utils.validation.check_X_y",
"numpy.array",
"numpy.zeros",
"numpy.empty"
]
] |
poshan0126/TensorFlow-Machine-Learning-Projects | [
"5b8d7988b86e39ffdd8babec2b8e3c791b5e853e"
] | [
"Chapter09/utils.py"
] | [
"'''\nThis file consists of the helper functions for processing\n'''\n\n## Package Imports\nfrom PIL import Image\nimport os\nfrom parameters import *\nimport tensorflow as tf\nimport numpy as np\nimport glob\ntry:\n import wget\nexcept:\n print (\"Can't import wget as you are probably on windows laptop\")\n\... | [
[
"tensorflow.variable_scope",
"tensorflow.contrib.layers.conv2d",
"tensorflow.shape",
"tensorflow.contrib.layers.fully_connected"
]
] |
JakobStruye/maml_rl | [
"ec92a5138127a86a4c15925c70e61dbdf038cd18"
] | [
"sandbox/rocky/tf/algos/batch_polopt.py"
] | [
"import time\nfrom rllab.algos.base import RLAlgorithm\nimport rllab.misc.logger as logger\nimport rllab.plotter as plotter\nfrom sandbox.rocky.tf.policies.base import Policy\nimport tensorflow as tf\nfrom sandbox.rocky.tf.samplers.batch_sampler import BatchSampler\nfrom sandbox.rocky.tf.samplers.vectorized_sampler... | [
[
"tensorflow.all_variables",
"tensorflow.initialize_variables",
"tensorflow.Session"
]
] |
ITAINNOVA/SAME | [
"d46dda98753fcb3606e04c3db2d20c9e700140e8"
] | [
"semantic_aware_models/models/classification/brnn_classifier.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.parallel\nfrom semantic_aware_models.utils.gpu import GPU\n\ngpu = GPU()\n\n\nclass BiRNN(nn.Module):\n def __init__(self, input_size, hidden_size, num_layers, num_classes):\n super(BiRNN, self).__init__()\n self.hidden_size = hidden_size\n ... | [
[
"torch.nn.Linear",
"torch.nn.LSTM",
"torch.nn.Embedding",
"torch.cat"
]
] |
Debapriya-Tula/Face-Verification | [
"939bc1adc171f67be375d4b98b0ef3520a82afbf"
] | [
"detect_and_verify.py"
] | [
"import os\nfrom os.path import join as j\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\n\ndef detect_face(img):\n # The file containing the pretrained classifier \n haar_file = 'haarcascade_frontalface_default.xml'\n \n # Image to be resized to this shape\n (width, height) = (224, 224) ... | [
[
"numpy.reshape",
"numpy.max",
"numpy.random.randint"
]
] |
s4ayub/torchrec | [
"eaa0915c9c1563d47df3a4a075c2e51b3b7ca27f"
] | [
"torchrec/distributed/tests/test_model.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom dataclasses import dataclass\nfrom typing import List, cast, Optional, Tu... | [
[
"torch.mean",
"torch.randint",
"torch.cat",
"torch.randn",
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.sum",
"torch.nn.Linear",
"torch.rand",
"torch.device"
]
] |
shofer16450/MetPy | [
"82fcb11ead3f777047d2d2a25decb11949b81b4b",
"82fcb11ead3f777047d2d2a25decb11949b81b4b"
] | [
"metpy/io/tests/test_nexrad.py",
"examples/gridding/Wind_SLP_Interpolation.py"
] | [
"# Copyright (c) 2015,2016,2017 MetPy Developers.\n# Distributed under the terms of the BSD 3-Clause License.\n# SPDX-License-Identifier: BSD-3-Clause\n\"\"\"Test the `nexrad` module.\"\"\"\n\nfrom datetime import datetime\nimport glob\nfrom io import BytesIO\nimport logging\nimport os.path\n\nimport numpy as np\ni... | [
[
"numpy.array"
],
[
"matplotlib.colors.BoundaryNorm",
"matplotlib.pyplot.clabel",
"pandas.read_csv",
"matplotlib.pyplot.title",
"numpy.isnan",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.colorbar",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figu... |
Xinrihui/Statistical-Learning-Method | [
"2e1c107bed8a21307596fbe0f8f1daed638657c5"
] | [
"CRF/crf_xrh.py"
] | [
"#!/usr/bin/python\n# -*- coding: UTF-8 -*-\n\nimport time\n\nimport pickle\nimport codecs\nimport numpy as np\nfrom scipy import optimize\n\n# 将 warnings 也当做错误抛出\n# import warnings\n# warnings.filterwarnings('error')\n\n# 定义负无穷大\ninfinite = float('-inf')\n\nclass LinearCRF(object):\n \"\"\"\n\n 线性链条件随机场\n\n ... | [
[
"numpy.dot",
"numpy.random.seed",
"scipy.optimize.fmin_l_bfgs_b",
"numpy.ones",
"numpy.max",
"numpy.argmax",
"numpy.random.randn",
"numpy.exp",
"numpy.zeros",
"numpy.sum"
]
] |
mariogeiger/gradientflow | [
"16749d538ca1caf3052ca50bfbdbabb61bd8e3a1"
] | [
"gradientflow/_backprop.py"
] | [
"# pylint: disable=no-member, invalid-name, line-too-long\n\"\"\"\nGradient flow for any model using pytorch backprop\n\"\"\"\nimport copy\nimport math\n\nimport torch\n\nfrom ._flow import flow\nfrom ._gradient import gradient\n\n\nclass _ContinuousMomentum(torch.optim.Optimizer):\n r\"\"\"Implements a continuo... | [
[
"torch.zeros_like",
"torch.no_grad",
"torch.cat"
]
] |
tund/TensorFlowASR | [
"a9b085095b2335ebbdaa2e78601b57073224f804",
"a9b085095b2335ebbdaa2e78601b57073224f804"
] | [
"tensorflow_asr/models/ctc.py",
"tensorflow_asr/utils/__init__.py"
] | [
"# Copyright 2020 Huy Le Nguyen (@usimarit)\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.nn.softmax",
"tensorflow.keras.Input",
"tensorflow.cast",
"tensorflow.expand_dims",
"tensorflow.map_fn",
"tensorflow.keras.backend.ctc_decode",
"tensorflow.numpy_function",
"tensorflow.TensorSpec"
],
[
"tensorflow.distribute.M... |
bentrevett/recurrent-attention-model | [
"c07ec97b105c785f6e170a2ba1b3bc7c96e9a920"
] | [
"test_glimpse_sensor.py"
] | [
"import torch\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\n\nimport data_loader\nfrom modules.glimpse_sensor import GlimpseSensor\n\ndef save_images(images, labels, name):\n\n assert len(images) == len(labels) == 5\n\n # get rid of channel dimension of 1, if exists\n images = images.squ... | [
[
"matplotlib.pyplot.subplots_adjust",
"torch.zeros",
"matplotlib.pyplot.subplots",
"numpy.transpose"
]
] |
paarthbir77/face-detection | [
"5797f996783abda936bb4756657b4adc86f8d1cc"
] | [
"face_project_test.py"
] | [
"# Import packages\nimport os\nimport cv2\nimport numpy as np\nimport tensorflow as tf\nimport sys\n\n# This is needed since the notebook is stored in the object_detection folder.\nsys.path.append(\"..\")\n\n# Import utilites\nfrom utils import label_map_util\nfrom utils import visualization_utils as vis_util\n\n# ... | [
[
"tensorflow.Graph",
"numpy.expand_dims",
"tensorflow.import_graph_def",
"tensorflow.gfile.GFile",
"numpy.squeeze",
"tensorflow.Session",
"tensorflow.GraphDef"
]
] |
erinzm/NEXT-chemistry | [
"d6ca0a80640937b36f9cafb5ead371e7a8677734"
] | [
"apps/PoolBasedTripletMDS/algs/UncertaintySampling/myAlg.py"
] | [
"\"\"\"\nUncertaintySampling app of the Online Learning Library for Next.Discovery\nauthor: Kevin Jamieson, kevin.g.jamieson@gmail.com\nlast updated: 1/17/2015\n\"\"\"\nimport numpy\nimport numpy as np\nimport numpy.random\nimport random\nimport next.utils as utils\nfrom apps.PoolBasedTripletMDS.algs.UncertaintySam... | [
[
"numpy.arange",
"numpy.log",
"numpy.random.randn",
"numpy.random.randint"
]
] |
KimDaeUng/few-shot-learning | [
"7068e088a8ae558fe050e8ee46c0c18953a147fd"
] | [
"data.py"
] | [
"import configparser\r\nimport os\r\nimport re\r\nimport string\r\nimport pickle\r\nimport copy\r\nimport random\r\nimport numpy as np\r\nimport torch\r\nfrom torch.utils.data import DataLoader\r\nfrom fastNLP import Vocabulary\r\nfrom dataset import Dataset\r\nfrom dataloader import TrainDataLoader\r\nfrom utils i... | [
[
"numpy.random.seed",
"torch.cat",
"torch.manual_seed",
"torch.tensor",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all"
]
] |
jaeglee0416/pydatalab | [
"ef1842571127708d494a05ee247b17bc28e33b63"
] | [
"solutionbox/structured_data/mltoolbox/_structured_data/prediction/predict.py"
] | [
"# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app... | [
[
"tensorflow.contrib.session_bundle.bundle_shim.load_session_bundle_or_saved_model_bundle_from_path"
]
] |
a625687551/jieba_faster | [
"6376b4f0602d9d15367111e4d31e1087c91d31fc"
] | [
"test/extract_topic.py"
] | [
"import sys\n\nsys.path.append(\"../\")\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.feature_extraction.text import TfidfTransformer\nfrom sklearn import decomposition\n\nimport jieba\nimport time\nimport glob\nimport sys\nimport os\nimport random\n\nif len(sys.argv) < 2:\n print(\"... | [
[
"sklearn.decomposition.NMF",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.feature_extraction.text.TfidfTransformer"
]
] |
szha/onnxmltools | [
"b04d05bda625cbc006955ce0a220277739a95825",
"b04d05bda625cbc006955ce0a220277739a95825"
] | [
"tests/sparkml/test_decision_tree_regressor.py",
"onnxmltools/convert/xgboost/_parse.py"
] | [
"import sys\r\nimport inspect\r\nimport unittest\r\nfrom distutils.version import StrictVersion\r\n\r\nimport onnx\r\nimport pandas\r\nimport numpy\r\nfrom pyspark.ml.linalg import Vectors, SparseVector, VectorUDT\r\nfrom pyspark.ml.regression import DecisionTreeRegressor\r\nfrom pyspark.ml import Pipeline\r\n\r\nf... | [
[
"numpy.array"
],
[
"numpy.asarray",
"numpy.arange"
]
] |
sidmohite/kNe-inference | [
"5642d7f4dc954cb36d76c3729d1f719ff04db0d9"
] | [
"scripts/bayesian_LC_gpapprox.py"
] | [
"import numpy as np\nimport astropy as ap\nfrom astropy import units as u\nfrom astropy import constants as c\nimport matplotlib.pyplot as plt\nimport bayesian_LC as blc\nfrom approxposterior import approx, gpUtils, likelihood as lh, utility as ut\nimport emcee\nimport corner\n\ndef prior_sample(n):\n return np.... | [
[
"numpy.ones_like",
"numpy.linspace",
"numpy.nan_to_num",
"matplotlib.pyplot.savefig",
"numpy.savetxt",
"numpy.random.uniform",
"numpy.array"
]
] |
jenna-h/dominion-data | [
"c55ca165e5bff899443dfb3f73379775beadf53e"
] | [
"dom_average.py"
] | [
"from PIL import Image\nimport numpy\nimport os\nimport requests\nimport shutil\n\nIM_WIDTH, IM_HEIGHT = 309, 496\nHORIZ_IM_WIDTH, HORIZ_IM_HEIGHT = 473, 290\nALL_CARDS_STRING = '''Black Market\tPromo\t10\nChurch\tPromo\t10\nDismantle\tPromo\t10\nEnvoy\tPromo\t10\nSauna\tPromo\t5\nAvanto\tPromo\t5\nWalled Village\t... | [
[
"numpy.round",
"numpy.array",
"numpy.zeros"
]
] |
SunnyxBd/feature_engine | [
"e40457ce8b4baa1e146976bf1af1bbdf6eae1305"
] | [
"tests/test_transformation/test_log_transformer.py"
] | [
"import pandas as pd\nimport pytest\n\nfrom sklearn.exceptions import NotFittedError\n\nfrom feature_engine.transformation import LogTransformer\n\n\ndef test_log_base_e_plus_automatically_find_variables(df_vartypes):\n # test case 1: log base e, automatically select variables\n transformer = LogTransformer(b... | [
[
"pandas.testing.assert_frame_equal"
]
] |
pasta41/decameron | [
"9b9607077d5a36d231187fc421f8f1474f61b9fa"
] | [
"scripts/plot.py"
] | [
"from collections import defaultdict\nfrom datetime import datetime\nimport math\nfrom operator import itemgetter\nimport os\nimport random\nimport re\n\nimport numpy as np\nimport pandas as pd\nimport little_mallet_wrapper as lmw\nimport pdb\nimport seaborn as sns\n\nimport matplotlib.pyplot as plt\n\nimport const... | [
[
"matplotlib.pyplot.tight_layout",
"pandas.read_csv",
"numpy.arange",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"pandas.DataFrame"
]
] |
pdales/FTeikPy | [
"cc187d3beb658d02a7dfc1a78c7c54f507d525a2"
] | [
"fteikpy/bspline_model.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\nAuthor: Keurfon Luu <keurfon.luu@mines-paristech.fr>\nLicense: MIT\n\"\"\"\n\nimport numpy as np\nfrom scipy.interpolate import RegularGridInterpolator\nfrom ._bspline import bspline as bspl\n\n__all__ = [ \"bspline1\", \"bspline2\", \"vel2spl\", \"spl2vel\" ]\n\n\ndef bspline1(x... | [
[
"numpy.linspace",
"numpy.min",
"numpy.asarray",
"numpy.arange",
"scipy.interpolate.RegularGridInterpolator",
"numpy.array",
"numpy.meshgrid"
]
] |
iamalex5156/Vehicle-Indicator-Toolset | [
"cfc46f408cf3cc04a4f0c0f8841189b9dc8ffc2c"
] | [
"integrateyolo.py"
] | [
"import numpy as np\nimport cv2\nimport imutils\nimport time\nfrom sklearn.metrics import pairwise\nfrom imutils.video import FPS\nimport copy\nimport os\nimport sys\nimport tensorflow as tf\nimport pathlib\nfrom collections import defaultdict\n\nfrom utils import tracking_utils \nfrom utils import signalDetection_... | [
[
"numpy.ones_like",
"numpy.argmax",
"numpy.random.uniform",
"numpy.array",
"numpy.sum"
]
] |
anslt/efficientdet_mask | [
"7ee75894a3f3c6428484e85b41f1ffedd657f128"
] | [
"maskrcnn_benchmark/modeling/backbone/efficientdet_backbone.py"
] | [
"# Author: Zylo117\n\nimport math\n\nimport torch\nfrom torch import nn\n\nfrom .efficientdet import BiFPN, Regressor, Classifier, EfficientNet\n# from .efficientdet.utils import Anchors\n\n\nclass EfficientDetBackbone(nn.Module):\n def __init__(self, cfg, **kwargs):\n super(EfficientDetBackbone, self).__... | [
[
"torch.load"
]
] |
blakete/Wearable-Data-Analysis | [
"05fa449db482f28adccb22b7a423099d84ba253a"
] | [
"training_data_flow_from_directory.py"
] | [
"# Author: Blake Edwards\nimport os\nimport re\nimport sys\n\nimport math\nimport numpy as np\nimport pandas as pd\nfrom sys import exit\nfrom glob import glob\nfrom dateutil import parser\nfrom datetime import datetime\n\nif len(sys.argv) != 2:\n print(\"[INCORRECT USAGE] try $ python3 /path/to/downloaded/datas... | [
[
"pandas.read_csv",
"numpy.asarray",
"numpy.set_printoptions",
"numpy.concatenate",
"numpy.std",
"numpy.diff",
"numpy.mean",
"numpy.random.uniform",
"matplotlib.pyplot.rcdefaults",
"numpy.sum"
]
] |
mcfrank/dmww | [
"cdacac49c4574f6d1cd48c4c8a4914432c26d9fb"
] | [
"sampling_helper.py"
] | [
"import numpy as np\nfrom random import *\nfrom scipy.special import gammaln\nfrom scipy import stats\n\n########################################################################\n## PROPOSAL DISTRIBUTIONS FOR HYPERPARAMETER INFERENCE\n\n# proposal function for variables that can't go below zero\ndef alter_0inf_var(... | [
[
"numpy.log",
"scipy.special.gammaln",
"numpy.add",
"numpy.exp",
"numpy.empty"
]
] |
modelhub-ai/modelhub-engine | [
"81e893fb7669ee9912178346efbf828dd8c0410b"
] | [
"framework/modelhubapi_tests/mockmodels/contrib_src_si/inference.py"
] | [
"\"\"\"\nImplementation of several mock models to test the API. Each model has a\nslightly different behaviour, which should be properly handled by the API.\nAlso most models are not fully valid, e.g. they do not comply to the mock\nconfig. This is ok for unit testing, most models are only used for a small\nset of ... | [
[
"numpy.asarray"
]
] |
LielinJiang/PaddleSeg | [
"7c4d39da3d0ff635cac066aeb61e23dfada5d0d7"
] | [
"slim/nas/eval_nas.py"
] | [
"# coding: utf8\n# copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.\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... | [
[
"numpy.set_printoptions",
"numpy.array"
]
] |
dhruvbatra/habitat-api | [
"00a0d51c714c3cc64e0214390daeff9ab390f289"
] | [
"test/test_mp3d_eqa.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\nimport time\n\nimport numpy as np\nimport pytest\n\nimport habitat\nimport habitat.datasets.eqa.mp3d_eqa_data... | [
[
"numpy.allclose"
]
] |
Business-Wizard/License_Plate_Reader_App | [
"968217ffaa74ba636ea83f54ec9825567ca8699c"
] | [
"src/visualization/visualize.py"
] | [
"import matplotlib.pyplot as plt\nfrom tensorflow.keras.models import load_model\nfrom src.models.train_model import visualize_history\nfrom src.data.imageprocess import (pipeline_single, read_image,\n grayscale, threshold_image, dilate_image,\n bl... | [
[
"tensorflow.keras.models.load_model",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
]
] |
eltonlanders/ga-learner-dsmp-repo | [
"750bb4dc8ea0cba8d0411e1e8d80aa036f7eaa38"
] | [
"Loan-Defaulters/code.py"
] | [
"# --------------\n#Importing header files\n\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n\n\n# Code starts here\ndata=pd.read_csv(path)\n\nX=data.drop(['customer.id','paid.back.loan'],axis=1)\n\ny=data['paid.back.loan']\n\nX_train,X_test,y_train,y_test=train_test_split(X,y,test_size=... | [
[
"sklearn.model_selection.GridSearchCV",
"pandas.read_csv",
"sklearn.tree.export_graphviz",
"numpy.arange",
"matplotlib.pyplot.imread",
"matplotlib.pyplot.subplots",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.LabelEncoder",
"sklearn.tree.DecisionTreeClass... |
wenlihaoyu/text-detection-ctpn | [
"1b934c07aa8a3774d38883af83532ec6cf2c7f8c"
] | [
"lib/rpn_msr/generate_anchors.py"
] | [
"# --------------------------------------------------------\n# Faster R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Sean Bell\n# --------------------------------------------------------\n\nimport numpy as np\n\n# Verify that we comp... | [
[
"numpy.arange",
"numpy.array"
]
] |
andreped/H2G-Net | [
"02ad99e404f547517040c44a637f0170b35b705d"
] | [
"src/architectures/UNet.py"
] | [
"from tensorflow.python.keras.layers import Input, Dense, Convolution2D, MaxPooling2D, Dropout, Flatten, SpatialDropout2D, \\\n ZeroPadding2D, Activation, AveragePooling2D, UpSampling2D, BatchNormalization, ConvLSTM2D, \\\n TimeDistributed, Concatenate, Lambda, Reshape, UpSampling3D, Convolution3D, MaxPooling... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.sign",
"tensorflow.python.keras.layers.Flatten",
"tensorflow.python.keras.layers.MaxPooling2D",
"tensorflow.python.keras.layers.Dense",
"tensorflow.reduce_sum",
"tensorflow.python.keras.layers.Convolution2D",
"tensorflow.python.keras.laye... |
dancerphil/crawler-collection | [
"d25c076922fb7c00c923cc6f50394dcd7560ac0e"
] | [
"cny-history/1.py"
] | [
"import pandas as pd\n\ndf = pd.read_csv('data.csv')\ndf = df[['date', 'USD/CNY']]\ndf.rename(columns={'USD/CNY': 'value'}, inplace=True)\ndf.to_json('usd.json', orient='records')\n"
] | [
[
"pandas.read_csv"
]
] |
kevingodlike/char-rnn-tensorflow-master | [
"1bc17d3082eda82d779a4bfc1b44469575bceb43"
] | [
"utils.py"
] | [
"import codecs\nimport os\nimport collections\nfrom six.moves import cPickle\nimport numpy as np\n\n\nclass TextLoader():\n def __init__(self, data_dir, batch_size, seq_length, encoding='utf-8'):\n self.data_dir = data_dir\n self.batch_size = batch_size\n self.seq_length = seq_length\n ... | [
[
"numpy.load",
"numpy.copy",
"numpy.save"
]
] |
PrincetonUniversity/blockchain-detect | [
"8a17256ac98db19cfe1fb2dcc213a11a1f9b2592"
] | [
"grid-search/preamble.py"
] | [
"\n\nimport numpy as np\nimport pickle\nimport pandas as pd\nimport os, os.path\nfrom itertools import *\nimport math\nimport random\nimport scipy.stats\nimport sys\nimport random\nfrom joblib import Parallel, delayed\nimport multiprocessing\nnproc = max(1, multiprocessing.cpu_count())\nfrom scipy.sparse import csr... | [
[
"pandas.read_csv",
"sklearn.metrics.roc_curve",
"scipy.sparse.csr_matrix",
"sklearn.grid_search.GridSearchCV",
"numpy.all",
"numpy.concatenate",
"sklearn.metrics.auc"
]
] |
facebookresearch/svinfer | [
"14edce1af6c91e622b8691f5d78a490a8585e7b5"
] | [
"svinfer/linear_model/linear_regression.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\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# U... | [
[
"numpy.diag",
"numpy.linalg.eigvals",
"numpy.linalg.solve",
"numpy.random.seed",
"numpy.triu_indices",
"numpy.random.multivariate_normal",
"numpy.finfo",
"numpy.concatenate",
"numpy.linalg.lstsq",
"numpy.diag_indices",
"numpy.array",
"numpy.zeros"
]
] |
facebookresearch/robust_mobo | [
"39195f5796e3dd19c411d4cd4c8252488ecbd0ec"
] | [
"robust_mobo/nsgaii_utils.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Meta Platforms, Inc. and 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\nr\"\"\"\nNSGA-II utilities\n\"\"\"\nfrom typing import Dict\nfrom torch import Tensor\nimport torch\nimpor... | [
[
"numpy.zeros",
"numpy.ones"
]
] |
Ekko-zn/StegoAdv | [
"2852dbc85d66f30efb7127695c0d75806bf4aa4c"
] | [
"hpfloss.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport numpy as np\r\nfrom PIL import Image\r\nimport os\r\nfrom cfg import *\r\nimport sys\r\nimg_size = 256\r\ncriterionl1 = torch.nn.L1Loss()\r\nSRM_npy = np.load('SRM_Kernels.npy')\r\nclass HILL(nn.Module):\r\n def __init__(self,img_size):\r\n super(HILL,self... | [
[
"torch.abs",
"torch.nn.Conv2d",
"torch.from_numpy",
"torch.tensor",
"torch.nn.AvgPool2d",
"torch.rand",
"numpy.load",
"torch.nn.L1Loss",
"torch.nn.ReplicationPad2d"
]
] |
Khurramjaved96/Dicta | [
"416638a3d1ad851b00394e55a7574ec978080d51"
] | [
"train_model.py"
] | [
"''' Document Localization using Recursive CNN\n Maintainer : Khurram Javed\n Email : kjaved@ualberta.ca '''\n\nfrom __future__ import print_function\n\nimport argparse\n\nimport torch\nimport torch.utils.data as td\n\nimport dataprocessor\nimport experiment as ex\nimport model\nimport trainer\nimport utils\n\npars... | [
[
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.cuda.manual_seed",
"torch.cuda.is_available"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.