repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
ReinaIshikawa/multimodal-vae-public | [
"2a358eb3593e9942e0846eb0095519acef462fa6"
] | [
"mnist/train.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\n\nimport os\nimport sys\nimport shutil\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom torchvision import t... | [
[
"torch.autograd.Variable",
"torch.clamp",
"torch.nn.functional.log_softmax",
"torch.abs",
"torch.cuda.is_available",
"torch.load",
"torch.mean"
]
] |
sami-ets/DeepNormalize | [
"5ed53280d98a201d45bb9973e79736136273eaea",
"5ed53280d98a201d45bb9973e79736136273eaea"
] | [
"deepNormalize/training/sampler.py",
"deepNormalize/training/unet.py"
] | [
"import math\nimport numpy as np\nimport torch\n\nfrom deepNormalize.utils.constants import AUGMENTED_INPUTS, NON_AUGMENTED_INPUTS, IMAGE_TARGET, DATASET_ID\n\n\nclass Sampler(object):\n\n def __init__(self, keep_augmented_prob: float):\n self._keep_augmented_prob = keep_augmented_prob\n\n def __call__... | [
[
"torch.cat"
],
[
"numpy.array",
"numpy.zeros",
"torch.nn.functional.interpolate",
"torch.where",
"torch.squeeze",
"torch.tensor",
"torch.nn.functional.softmax",
"numpy.expand_dims"
]
] |
arthus701/gpytorch | [
"c7eb6fd732ed15d7578421d851a2c274ffdca100"
] | [
"gpytorch/optim/ngd.py"
] | [
"#!/usr/bin/env python3\n\nfrom typing import Iterable, Union\n\nimport torch\n\n\nclass NGD(torch.optim.Optimizer):\n r\"\"\"Implements a natural gradient descent step.\n It **can only** be used in conjunction with a :obj:`~gpytorch.variational._NaturalVariationalDistribution`.\n\n .. seealso::\n -... | [
[
"torch.no_grad"
]
] |
westrayhao/fiftyone | [
"364aeb0566f650df4fb45743f991d6ea286a23e8"
] | [
"fiftyone/core/aggregations.py"
] | [
"\"\"\"\nAggregations.\n\n| Copyright 2017-2021, Voxel51, Inc.\n| `voxel51.com <https://voxel51.com/>`_\n|\n\"\"\"\nimport numpy as np\n\nimport eta.core.utils as etau\n\nfrom fiftyone.core.expressions import ViewField as F\nimport fiftyone.core.media as fom\nimport fiftyone.core.utils as fou\n\n\nclass Aggregation... | [
[
"numpy.array",
"numpy.abs",
"numpy.linspace"
]
] |
caron14/pycaret | [
"d0b079ba35fc211875b1abfe4b8753c367d8ace1"
] | [
"pycaret/internal/tabular.py"
] | [
"# Module: Classification\n# Author: Moez Ali <moez.ali@queensu.ca>\n# License: MIT\n# Release: PyCaret 2.2\n# Last modified : 26/08/2020\n\nfrom enum import Enum, auto\nimport math\nfrom pycaret.internal.meta_estimators import (\n PowerTransformedTargetRegressor,\n get_estimator_from_meta_estimator,\n)\nfrom... | [
[
"pandas.reset_option",
"sklearn.tree.plot_tree",
"sklearn.model_selection.cross_validate",
"numpy.mean",
"numpy.where",
"numpy.unique",
"pandas.concat",
"sklearn.model_selection._search.GridSearchCV",
"sklearn.model_selection.StratifiedKFold",
"pandas.set_option",
"pand... |
chrwolff/udacityMLCapstone | [
"44c11d34defd90c6ff1180376ecc764d82ed09af"
] | [
"webapp/server.py"
] | [
"from flask import Flask, request, jsonify, send_from_directory\nimport pandas as pd\nimport numpy as np\nimport json\nimport xgboost as xgb\n\napp = Flask(__name__)\n\nfeatures = ['latitude_pca', 'longitude_pca',\n 'apparentTemperature', 'dewPoint', 'humidity', 'precipIntensity',\n 'precipPro... | [
[
"pandas.DataFrame",
"pandas.date_range",
"pandas.Timestamp",
"pandas.MultiIndex.from_product",
"pandas.read_csv"
]
] |
LiFaytheGoblin/aequitas | [
"e5690baa955c94ea6459af5064cf1c741a345646"
] | [
"examples/compas_data_for_aequitas.py"
] | [
"# The purpose of this script is to transform raw data to \n# the format expected by Aequitas.\n#\n# SOURCE: ProPublica \n# Data: https://github.com/propublica/compas-analysis/raw/master/compas-scores-two-years.csv\n# ProPublica's methodology: https://www.propublica.org/article/how-we-analyzed-the-compas-recidivism... | [
[
"pandas.read_csv"
]
] |
dannis999/RE-MIMO | [
"199ddec7f142ba5bd87e76e0b5f7790c64e69b0c"
] | [
"iid_channels/qam_64/oamp_net/test_oampnet.py"
] | [
"import torch\nimport numpy as np\nimport torch.nn as nn\nimport pickle\nimport os\nimport math\nimport torch.nn.functional as F\n\nfrom collections import defaultdict\nfrom sample_generator import sample_generator\nfrom oampnet import oampnet\n\n# Parameters\nNT = 32\nNR = 64\n\nmod_n = 64\nnum_layers = 10\n\n# Ba... | [
[
"torch.cat",
"numpy.asarray",
"torch.no_grad",
"torch.argmin",
"numpy.arange",
"numpy.sqrt",
"torch.load",
"numpy.linspace",
"torch.chunk",
"torch.pow"
]
] |
glavrentiadis/pygmm | [
"0ad5c870a102ec483a725d1f7f87507cd419c378"
] | [
"pygmm/idriss_2014.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Idriss (2014, :cite:`idriss14`) model.\"\"\"\n\nimport numpy as np\n\nfrom . import model\n\n__author__ = 'Albert Kottke'\n\n\nclass Idriss2014(model.GroundMotionModel):\n \"\"\"Idriss (2014, :cite:`idriss14`) model.\n\n This model was developed for active tectonic regions as p... | [
[
"numpy.arange",
"numpy.log",
"numpy.clip"
]
] |
rguerrettaz/client | [
"06a8759ad9c3c407e815cecbd789c3a2d44e4a2b"
] | [
"tests/test_history.py"
] | [
"import pytest\nimport os\nimport json\nimport six\nimport numpy as np\nfrom click.testing import CliRunner\n\nfrom wandb.history import History\nfrom wandb import media\nfrom wandb import data_types\nimport torch\n\n\n@pytest.fixture\ndef history():\n with CliRunner().isolated_filesystem():\n yield Histo... | [
[
"numpy.random.randint",
"torch.randn"
]
] |
mftorres/seqcap_processor | [
"ce8ff01b3918bd29105db7b3d91b1d12572f014e"
] | [
"secapr/assemble_reads.py"
] | [
"#author: Tobias Andermann, tobias.andermann@bioenv.gu.se\n\n'''\nAssemble trimmed Illumina read files (fastq)\n'''\n\nimport os\nimport sys\nimport re\nimport glob\nimport shutil\nimport argparse\nimport subprocess\nimport pandas as pd\nimport numpy as np\nfrom Bio import SeqIO\nimport time\n\n# Complete path func... | [
[
"numpy.array",
"pandas.DataFrame.from_dict",
"pandas.DataFrame",
"numpy.round",
"numpy.append",
"numpy.vstack"
]
] |
lstasiak/ml-django-app | [
"23547c7eaa3ef6a80ae9b39f2f84430c4e56280d"
] | [
"backend/apps/ml/income_classifier/random_forest.py"
] | [
"from pathlib import Path\n\nimport joblib\nimport pandas as pd\n\n\nclass RandomForestClassifier:\n def __init__(self):\n path_to_artifacts = \"./research/\"\n self.values_fill_missing = joblib.load(path_to_artifacts + \"train_mode.joblib\")\n self.encoders = joblib.load(path_to_artifacts ... | [
[
"pandas.DataFrame"
]
] |
psaks/auto-sklearn | [
"e21047aa7b52e762a58992e33ffcebb420586e67"
] | [
"test/test_pipeline/test_regression.py"
] | [
"import copy\nimport itertools\nimport resource\nimport sys\nimport tempfile\nimport traceback\nimport unittest\nimport unittest.mock\n\nfrom joblib import Memory\nimport numpy as np\nimport sklearn.datasets\nimport sklearn.decomposition\nfrom sklearn.base import clone\nimport sklearn.ensemble\nimport sklearn.svm\n... | [
[
"numpy.testing.assert_array_almost_equal",
"sklearn.base.clone",
"sklearn.utils.validation.check_is_fitted"
]
] |
griffincalme/MicroDeconvolution | [
"447af89e4db9a9874a475cba4e58b6d9dee502c3"
] | [
"ScriptsUsedInPaper/IHCRandomWalkTimed.py"
] | [
"'''\nTo Do\nShow speed comparison between my hand annotation and\nthe computer output with 6600k @ 4.5 GHz\nand 6200U as well\nwith and without library speedup cg_mg\n\nfor human counting time for just a count and also time\nfor calculations of percent coverage. using pixels? or ratio of inches?\nhand annotate in ... | [
[
"numpy.array",
"numpy.ones_like",
"numpy.count_nonzero",
"numpy.add",
"numpy.zeros_like",
"numpy.shape",
"matplotlib.pyplot.subplots",
"numpy.subtract",
"numpy.linalg.inv"
]
] |
NivekNey/tensorflow | [
"3e21fe5faedab3a8258d344c8ad1cec2612a8aa8"
] | [
"tensorflow/python/framework/convert_to_constants_test.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.training.tracking.tracking.AutoTrackable",
"tensorflow.python.ops.variables.Variable",
"tensorflow.python.framework.ops.Graph",
"tensorflow.python.saved_model.save.save",
"tensorflow.python.framework.convert_to_constants.convert_variables_to_constants_v2",
"tensorflow.py... |
thatch/BitSwanPump | [
"98a5b8d09f9b59d5361611cee0bd45e7b4c69e3f"
] | [
"bspump/matrix/namedmatrix.py"
] | [
"import logging\nimport os\nimport numpy as np\n\nimport asab\nfrom .utils.index import Index, PersistentIndex\nfrom .matrix import Matrix, PersistentMatrix\n\n###\n\nL = logging.getLogger(__name__)\n\n###\n\n\n\nclass NamedMatrix(Matrix):\n\n\tdef __init__(self, app, dtype='float_', id=None, config=None):\n\t\tsup... | [
[
"numpy.array",
"numpy.zeros"
]
] |
TIan1874/PCA-Net | [
"fe4e4d00380ec477e6e6b28175f99750b58ddc47"
] | [
"main.py"
] | [
"import logging\nimport argparse\nimport torch\nimport torchvision.transforms as transforms\nfrom torch.utils.data import DataLoader\nimport torch.backends.cudnn as cudnn\n\nfrom dataset import config, Dataset, collate_fn\nfrom utils import *\nfrom train import train, test\nfrom model import *\n\nos.environ[\"CUDA_... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.cuda.manual_seed",
"torch.optim.lr_scheduler.StepLR",
"torch.cuda.manual_seed_all",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.CrossEntropyLoss",
"torch.nn.DataParallel"
]
] |
raviriley/stocks_data | [
"a884bd5ce04dff7e8f0f38fe97e3a3b67ffbbb33"
] | [
"stocks_data/functions.py"
] | [
"import pandas as pd\nfrom stocks_data.stock import stock\n\ndef getCorrelatedPairsFromStocks(list_of_stocks, pearson_threshold):\n threshold = pearson_threshold\n dic_pearsons={}\n #stocks_tickers = []\n for i in range(len(list_of_stocks)):\n ticker = list_of_stocks[i].ticker\n #stocks_ti... | [
[
"numpy.dot",
"numpy.zeros",
"numpy.log",
"pandas.DataFrame.from_dict",
"pandas.DataFrame",
"numpy.sum",
"numpy.ones",
"numpy.linalg.pinv",
"numpy.flipud",
"numpy.argsort",
"pandas.read_csv",
"numpy.linalg.inv"
]
] |
ChantalTax/dipy | [
"da656ca630934a79e5eabd4aee64f8f0ae05bf95"
] | [
"dipy/reconst/tests/test_dti.py"
] | [
"\"\"\" Testing DTI\n\n\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\nimport numpy as np\nfrom nose.tools import (assert_true, assert_equal,\n assert_almost_equal, assert_raises)\nfrom numpy.testing import assert_array_equal, assert_array_almost_equal, assert_\nim... | [
[
"numpy.dot",
"numpy.random.rand",
"numpy.tile",
"numpy.mean",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.linalg.norm",
"numpy.empty",
"numpy.log",
"numpy.linalg.eigh",
"numpy.eye",
"numpy.testing.assert_array_almost_equal",
"numpy.arange",
"numpy.sqrt",... |
changliao1025/pyswat | [
"cdcda1375be8c0f71459a78438b1e9f8a22a77bc"
] | [
"swaty/swaty_read_model_configuration_file.py"
] | [
"from collections import _OrderedDictKeysView\nimport os\nfrom pprint import pp \nimport sys #used to add system path\n\nimport datetime\nimport json\nimport numpy as np\nimport pyearth.toolbox.date.julian as julian\nfrom swaty.auxiliary.text_reader_string import text_reader_string\nfrom swaty.classes.pycase import... | [
[
"numpy.arange"
]
] |
dschaub95/FINDER-TSP | [
"d69ee6a954aac317b717622a9c0744e3f2827c64"
] | [
"py_utils/FINDER_test_utils.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\nimport tsplib95\nimport networkx as nx\nfrom tqdm import tqdm\nimport sys\nimport re\n\ndef prepare_testset_FINDER(data_dir, scale_factor=0.000001):\n graph_list = []\n\n atoi = lambda text : int(text) if text.isdigit() else text\n natural_keys = lambda ... | [
[
"numpy.array",
"numpy.isnan",
"pandas.DataFrame",
"numpy.mean",
"numpy.std",
"pandas.concat",
"pandas.read_csv"
]
] |
eelgin/BigDataUsingPython | [
"c4a25a7db37c5fe0b12a180b850a8900772f1f64"
] | [
"final_project/defunct/data_formatter.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport os\n\ndirectory = 'data/individual_stocks_5yr'\nfiles = os.listdir(directory)\n\nsp_data = pd.DataFrame(columns=['date'])\n\nfor file in files:\n\n\ttmp = pd.read_csv(directory+'/'+file)\n\n\tname = file.rpartition('_')[0]\n\n\tprin... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.merge"
]
] |
ZiyiDuan/LewPeaLab_EEG_pipeline | [
"1f923585d18edfe6b43637bd1cb11db1a1740698"
] | [
"EEG_pipeline_MVPA/MVPA_multi-subjects_8_posBins.py"
] | [
"# !/usr/bin/env python\n# -*-coding:utf-8 -*-\n\n\"\"\"\n# File : MVPA_multi-subjects_8_posBins.py\n# Time :2021/4/16 10:40\n# Author :ZoeDuan\n# version :python 3.7\n# Description: The pipeline of decoding 8-class alpha-band power from Foster et al(2017)\n# Data: Experime... | [
[
"numpy.array",
"numpy.empty",
"numpy.savetxt",
"numpy.zeros",
"sklearn.preprocessing.StandardScaler",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"sklearn.svm.SVC",
"numpy.mean",
"scipy.stats.ttest_1samp",
"numpy.nonzero",
"skl... |
MSchnei/MRI_segmentation_preparation_scripts | [
"02f65b584e09908247202fff57714b63ef44e7dd"
] | [
"plotting/01u_plot_learning.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"Compare classic, dense, denseExt U-Net at dr 0.05 with unweighted loss.\"\"\"\n\nimport os\nimport numpy as np\nimport seaborn as sns\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom load_tfevents import func_load_event\n\n# %% Set input parameters\... | [
[
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.ylabel"
]
] |
garrettkatz/directional-fibers | [
"3cd5262d80f684184ef12e273ad4bd3c3ce60b82"
] | [
"readme.py"
] | [
"# Code from README.md\n\nimport numpy as np\nN = 2\nW = 1.2*np.eye(N) + 0.1*np.random.randn(N,N)\nf = lambda v: np.tanh(W.dot(v)) - v\n\nI = np.eye(W.shape[0])\ndef Df(V):\n D = 1-np.tanh(W.dot(V))**2\n return D.T[:,:,np.newaxis]*W[np.newaxis,:,:] - I[np.newaxis,:,:]\n\nef = lambda v: 10**-10\n\nimport dfibe... | [
[
"numpy.fabs",
"numpy.random.randn",
"numpy.zeros",
"numpy.eye"
]
] |
willpatera/cvd_pupillometry | [
"fd015d9221112dfa43a3b512b51324733d5b73b0"
] | [
"build/lib/pyplr/preproc.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n'''\npyplr.preproc\n=============\n\nScripting tools for preprocessing pupil data.\n\n@author: jtm\n\n'''\n\nimport numpy as np\nimport scipy.signal as signal\n\n\ndef even_samples(samples, sample_rate, fields=['diameter'], zero_index=False):\n '''Resample data ... | [
[
"scipy.signal.savgol_filter",
"scipy.signal.butter",
"numpy.interp",
"scipy.signal.filtfilt",
"numpy.unique"
]
] |
ndcuong91/mmocr | [
"46e6faad9bf268af2d8e68ce279fcb328269c504"
] | [
"mmocr/datasets/kie_dataset.py"
] | [
"import copy\nfrom os import path as osp\n\nimport numpy as np\nimport torch\n\nimport mmocr.utils as utils\nfrom mmdet.datasets.builder import DATASETS\nfrom mmocr.core import compute_f1_score\nfrom mmocr.datasets.base_dataset import BaseDataset\nfrom mmocr.datasets.pipelines.crop import sort_vertex\n\n\n@DATASETS... | [
[
"numpy.concatenate",
"numpy.zeros_like",
"numpy.array",
"torch.cat",
"numpy.fill_diagonal",
"numpy.stack",
"torch.Tensor",
"numpy.maximum"
]
] |
LuisRondoCuevas/schainpy | [
"ef41efe03993a6ae56e587334a1bfc529fccc2df"
] | [
"schainpy/model/io/jroIO_hf.py"
] | [
"'''\nCreated on Jul 3, 2014\n\n@author: roj-com0419\n'''\n\nimport os,sys\nimport time,datetime\nimport h5py\nimport numpy\nimport fnmatch\nimport re\n\nfrom schainpy.model.data.jroheaderIO import RadarControllerHeader, SystemHeader\nfrom schainpy.model.data.jrodata import Voltage\nfrom schainpy.model.proc.jroproc... | [
[
"numpy.array",
"numpy.arange",
"numpy.dtype",
"numpy.zeros"
]
] |
rkasher/OG-USA | [
"220651fe7f444e66d838971288b10f6932f405fb"
] | [
"ogusa/TPI.py"
] | [
"# imports\nimport numpy as np\nimport pickle\nimport scipy.optimize as opt\nfrom dask.distributed import Client\nfrom dask import compute, delayed\nimport dask.multiprocessing\nfrom ogusa import tax, utils, household, firm, fiscal\nfrom ogusa import aggregates as aggr\nimport os\n\n\n'''\nSet minimizer tolerance\n... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"numpy.squeeze",
"numpy.fmax",
"numpy.ones",
"scipy.optimize.fsolve",
"numpy.exp",
"numpy.any",
"numpy.arange",
"numpy.abs",
"numpy.absolute",
"numpy.linspace",
"numpy.diag"
]
] |
clonker/PyEMMA | [
"a36534ce2ec6a799428dfbdef0465c979e6c68aa",
"a36534ce2ec6a799428dfbdef0465c979e6c68aa"
] | [
"pyemma/_base/model.py",
"pyemma/coordinates/data/util/reader_utils.py"
] | [
"import copy\nimport numpy as _np\nimport inspect\nimport warnings\n\nfrom pyemma._ext import six\nfrom pyemma._ext.sklearn.base import _pprint\nfrom pyemma.util.statistics import confidence_interval\nfrom pyemma.util.reflection import call_member\n\n__author__ = 'noe'\n\n\nclass Model(object):\n \"\"\" Base cla... | [
[
"numpy.std",
"numpy.mean"
],
[
"numpy.random.randint",
"numpy.zeros",
"numpy.vstack",
"numpy.argwhere"
]
] |
brooks-anderson/pytorch | [
"dd928097938b6368fc7e2dc67721550d50ab08ea"
] | [
"torch/testing/_internal/common_quantization.py"
] | [
"r\"\"\"Importing this file includes common utility methods and base clases for\nchecking quantization api and properties of resulting modules.\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.quantized as nnq\nimport torch.nn.quantized.dynamic as nnqd\nfrom torch.nn.intrinsic import _FusedModule\nim... | [
[
"torch.nn.Linear",
"torch.nn.EmbeddingBag",
"torch.cat",
"torch.nn.LSTM",
"torch.quantization.QuantStub",
"torch.nn.GRU",
"torch.nn.LSTMCell",
"torch.nn.BatchNorm2d",
"torch.testing.FileCheck",
"torch.quantization.quantize_jit",
"torch.nn.Hardswish",
"torch.jit.trac... |
patrikkj/algorithms | [
"25799fb57807eca1784202c499fda8a5a94acea3"
] | [
"common/cost.py"
] | [
"import numpy as np\n\nfrom .activations import sigmoid\n\n\n# Regularization\ndef l2_reg(params, l=0.01):\n return l * np.sum(np.square(params))\n\ndef l2_reg_grad(params, l=0.01):\n return 2 * l * params\n\n\n# Sum of squared errors\ndef reduce_mean_sse(W, b, X, y):\n return np.mean(np.square((np.dot(X, ... | [
[
"numpy.square",
"numpy.log",
"numpy.dot",
"numpy.mean"
]
] |
ml-research/PyTorch-BayesianCNN | [
"7933d6d6523be7d54e2347ba1497f63317f04af6"
] | [
"attacks/pytorch_bayesian.py"
] | [
"from art.estimators.classification import PyTorchClassifier\nimport numpy as np\nfrom typing import Any, Dict, List, Optional, Tuple, Union, TYPE_CHECKING\n\nclass PyTorchBaysianClassifier(PyTorchClassifier):\n\n def predict( # pylint: disable=W0221\n self, x: np.ndarray, batch_size: int = 128, training... | [
[
"torch.no_grad",
"torch.tensor",
"numpy.vstack",
"torch.from_numpy"
]
] |
Project-Ellie/tutorials | [
"9090cc7669d3e59889b15139724e662ce11be1ee"
] | [
"other_stuff/DeepGomoku/GomokuTools_deprecated.py"
] | [
"import numpy as np\n\n\nclass GomokuTools:\n\n \n @staticmethod \n def str_base(number, base, width=8):\n def _str_base(number,base):\n (d, m) = divmod(number, base)\n if d > 0:\n return _str_base(d, base) + str(m)\n return str(m)\n s = _str... | [
[
"numpy.array",
"numpy.zeros",
"numpy.rollaxis",
"numpy.sign",
"numpy.power"
]
] |
so2liu/CNNArt | [
"9d91bf08a044e7d5068f8446663726411d2236dd"
] | [
"utils/scaling.py"
] | [
"\nimport numpy as np\nfrom scipy import interpolate\nimport math\nimport time\n\ndef fScaleOnePatch(dPatch, randPatchSize, PatchSize):\n xaxis = np.linspace(0, PatchSize[0], randPatchSize[0])\n yaxis = np.linspace(0, PatchSize[1], randPatchSize[1])\n zaxis = np.linspace(0, PatchSize[2], randPatchSize[2])\... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.reshape",
"numpy.rollaxis",
"scipy.interpolate.interpn",
"numpy.multiply",
"numpy.arange",
"numpy.linspace"
]
] |
km-t/dcpython | [
"c0fcd5557691004d7d9d22a662d90e52ecc5f34f"
] | [
"digital-curling/named/network/train.py"
] | [
"import numpy as np\nfrom keras import metrics, callbacks\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, BatchNormalization\nfrom keras.optimizers import rmsprop\nfrom tqdm import tqdm\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n\nclass Train:\n x = None\n y = None... | [
[
"numpy.array",
"numpy.empty",
"numpy.zeros",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"numpy.append",
"matplotlib.pyplot.show",
"pandas.read_csv"
]
] |
xinpingwang/tf-faster-rcnn | [
"b70382b3787906c7f7e46bfd372f6894d58d78fd"
] | [
"tools/convert_from_depre.py"
] | [
"# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Xinlei Chen\n# --------------------------------------------------------\n\"\"\"\nConvert depreciated VGG16 snapshots to the ones that support tensorflow fo... | [
[
"tensorflow.set_random_seed",
"tensorflow.multiply",
"numpy.random.seed",
"tensorflow.train.MomentumOptimizer",
"tensorflow.Session",
"tensorflow.Variable",
"tensorflow.global_variables",
"tensorflow.train.Saver",
"tensorflow.ConfigProto",
"tensorflow.variable_scope",
"... |
zhjpqq/scaledensenet | [
"5ae56786c7f628b8320b76d559ecaa6fa1d2ac0e"
] | [
"xmodels/msnet.py"
] | [
"# -*- coding: utf-8 -*-\n__author__ = 'ooo'\n__date__ = '2019/6/9 12:17'\n\n\"\"\"\nMulti-Resolution Net\n\"\"\"\nfrom collections import OrderedDict\nimport math\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom xmodules.classifier import AdaPoolView, ReturnX, ViewLayer\nimport xtils... | [
[
"torch.nn.Linear",
"torch.rand",
"torch.nn.functional.relu6",
"torch.cat",
"torch.nn.Dropout",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.init.kaiming_normal_",
"torch.nn.Upsample",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"numpy.arange",
"torch.... |
53X/asteroid | [
"69e82fed49bab84975592ae868aaf6dceb91d6cd"
] | [
"asteroid/dsp/overlap_add.py"
] | [
"import torch\nfrom scipy.signal import get_window\nfrom asteroid.losses import PITLossWrapper\nfrom torch import nn\n\n\nclass LambdaOverlapAdd(torch.nn.Module):\n \"\"\"Segment signal, apply func, combine with OLA.\n\n Args:\n nnet (callable): function to apply to each segment.\n n_src (int): ... | [
[
"torch.nn.functional.fold",
"torch.stack",
"torch.autograd.set_grad_enabled",
"torch.from_numpy",
"scipy.signal.get_window"
]
] |
leo-ware/dowhy | [
"3a2a79e2159a7f29456dd419a3c90395a384364e"
] | [
"dowhy/utils/dgps/linear_dgp.py"
] | [
"from dowhy.utils.dgp import DataGeneratingProcess\nimport numpy as np\nimport pandas as pd\n\nclass LinearDataGeneratingProcess(DataGeneratingProcess):\n '''\n Implements a data generating process that returns data having linear relationship between the treatment, outcome and confounders \n '''\n\n NAM... | [
[
"numpy.hstack",
"numpy.random.randn",
"numpy.matmul",
"numpy.mean"
]
] |
calumrussell/qstrader | [
"826d3eeb63b95b9d8587f5e2152c030f2c57bbba"
] | [
"tests/unit/broker/transaction/test_transaction.py"
] | [
"import pandas as pd\n\nfrom qstrader.asset.equity import Equity\nfrom qstrader.broker.transaction.transaction import Transaction\n\n\ndef test_transaction_representation():\n \"\"\"\n Tests that the Transaction representation\n correctly recreates the object.\n \"\"\"\n dt = pd.Timestamp('2015-05-06... | [
[
"pandas.Timestamp"
]
] |
gyan42/ml-serving-playground | [
"262837afc78d8c59954b17efc8e3fc027393bf76"
] | [
"streamlit/gans/backend/model/dcgan.py"
] | [
"\nimport torch\nimport torchvision.transforms as Transforms\n\nuse_gpu = True if torch.cuda.is_available() else False\n\nmodel = torch.hub.load('facebookresearch/pytorch_GAN_zoo:hub', 'DCGAN', pretrained=True, useGPU=use_gpu)\n\nnum_images = 1\n\ndef dcgan():\n noise, _ = model.buildNoiseData(num_images)\n w... | [
[
"torch.no_grad",
"torch.cuda.is_available",
"torch.hub.load"
]
] |
charmsoya/pytorch-3dunet | [
"07a8dabf988ac3df110a3c10db6ed5fb769498d9"
] | [
"pytorch3dunet/unet3d/metrics.py"
] | [
"import importlib\nimport os\nimport time\n\nimport hdbscan\nimport numpy as np\nimport torch\nfrom skimage import measure\nfrom skimage.metrics import adapted_rand_error, peak_signal_noise_ratio\nfrom sklearn.cluster import MeanShift\n\nfrom pytorch3dunet.unet3d.losses import compute_per_channel_dice\nfrom pytorch... | [
[
"numpy.max",
"numpy.logical_not",
"torch.acos",
"numpy.argmin",
"torch.max",
"torch.norm",
"sklearn.cluster.MeanShift",
"numpy.min",
"numpy.stack",
"torch.tensor",
"numpy.argmax",
"numpy.unique",
"torch.zeros_like",
"numpy.expand_dims",
"torch.sum"
]
] |
LizhengMathAi/svgd | [
"9606388cf4565e4fafe82869feef7a7ba8986ef2"
] | [
"experiments/resnet_adam.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\n\ndef bn_layer(input_tensor):\n size = input_tensor.get_shape().as_list()[-1]\n\n mean, variance = tf.nn.moments(input_tensor, axes=[0, 1, 2])\n beta = tf.Variable(initial_value=tf.zeros(size, dtype=tf.float32), name=\"beta\")\n gamma = tf.Variable(initial... | [
[
"tensorflow.nn.conv2d",
"tensorflow.matmul",
"tensorflow.ones",
"tensorflow.nn.moments",
"numpy.mean",
"tensorflow.global_variables_initializer",
"tensorflow.nn.avg_pool",
"tensorflow.cast",
"tensorflow.trainable_variables",
"pandas.DataFrame",
"tensorflow.argmax",
... |
JLefortBesnard/nilearn | [
"5385ad69337a12463baa2c60d408d1f3bb95fcb3"
] | [
"nilearn/datasets/func.py"
] | [
"\"\"\"\nDownloading NeuroImaging datasets: functional datasets (task + resting-state)\n\"\"\"\nimport fnmatch\nimport glob\nimport warnings\nimport os\nimport re\nimport json\n\nimport nibabel as nib\nimport numpy as np\nimport numbers\n\nfrom io import BytesIO\n\nimport nibabel\nimport pandas as pd\nfrom scipy.io... | [
[
"numpy.ones_like",
"numpy.genfromtxt",
"sklearn.utils.deprecated",
"numpy.where",
"numpy.concatenate",
"numpy.max",
"sklearn.utils.Bunch",
"pandas.DataFrame",
"numpy.lib.recfunctions.join_by",
"numpy.arange",
"numpy.isfinite",
"numpy.in1d",
"numpy.recfromcsv",
... |
trimcao/lef-parser | [
"9872122203b064451fd30ad7eb39bead3415eb5e"
] | [
"plot_cell.py"
] | [
"\"\"\"\nProgram to plot cell using DEF and LEF data.\n\nAuthor: Tri Minh Cao\nEmail: tricao@utdallas.edu\nDate: September 2016\n\"\"\"\nfrom def_parser import *\nfrom lef_parser import *\nimport util\nimport matplotlib.pyplot as plt\nimport time\n\ndef inside_area(location, corners):\n \"\"\"\n Check if the ... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.Polygon",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.axis"
]
] |
raphaelmerx/fairseq_extension | [
"89e29008d0c6a56fe4a5daad727e3c663e6b3962"
] | [
"fairseq_cli/generate.py"
] | [
"#!/usr/bin/env python3 -u\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\"\"\"\nTranslate pre-processed data with a trained model.\n\"\"\"\n\nimport logging\nimport math\nimport o... | [
[
"numpy.random.seed",
"torch.cuda.is_available"
]
] |
kliiu/Texygen | [
"b8896f5477e7a02d99ba23c29871731bc31aca19"
] | [
"models/mle/MleGenerator.py"
] | [
"import numpy as np\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\nfrom tensorflow.python.ops import tensor_array_ops, control_flow_ops\n\n\nclass Generator(object):\n def __init__(self, num_vocabulary, batch_size, emb_dim, hidden_dim,\n sequence_length, start_token,\n ... | [
[
"tensorflow.compat.v1.strided_slice",
"tensorflow.compat.v1.zeros",
"tensorflow.compat.v1.transpose",
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.matmul",
"tensorflow.compat.v1.device",
"tensorflow.compat.v1.constant",
"tensorflow.compat.v1.placeholder",
"... |
acdmammoths/parallelcubesampling | [
"c6fa613e9877f6a57c73c24d93223f738bdf3aae"
] | [
"src/dataprep.py"
] | [
"import numpy as np\nimport math\nfrom typing import Optional, Tuple, Union\nfrom cubeutils import get_active_indices, get_active_strata\n\n\ndef prepare_inputs(\n data: np.ndarray,\n init_probs: np.ndarray,\n is_pop_size_fixed: bool = False,\n is_sample_size_fixed: bool = False,\n strata: Optional[n... | [
[
"numpy.array",
"numpy.zeros",
"numpy.random.default_rng",
"numpy.append",
"numpy.repeat",
"numpy.unique"
]
] |
andrewhuman/ava_action_location | [
"0a7c4bd3e71b8f366dd5ae4174fdf8d7f5286f25"
] | [
"lib/datasets/ucf24data/util.py"
] | [
"import numpy as np\nfrom PIL import Image\nimport random\n\n\ndef read_image(path, dtype=np.float32, color=True):\n \"\"\"Read an image from a file.\n\n This function reads an image from given file. The image is CHW format and\n the range of its value is :math:`[0, 255]`. If :obj:`color = True`, the\n ... | [
[
"numpy.array",
"numpy.asarray",
"numpy.minimum",
"numpy.flatnonzero",
"numpy.ones",
"numpy.logical_and",
"numpy.maximum"
]
] |
TommasoPino/pyquaternion | [
"5f55e38bc5adcd34db73b7dd9fa96d2391a2427a"
] | [
"pyquaternion/quaternion.py"
] | [
"\"\"\"\nThis file is part of the pyquaternion python module\n\nAuthor: Kieran Wynn\nWebsite: https://github.com/KieranWynn/pyquaternion\nDocumentation: http://kieranwynn.github.io/pyquaternion/\n\nVersion: 1.0.0\nLicense: The MIT License (MIT)\n\nCopyright (c) 2015 Kieran Wynn\n\nPe... | [
[
"numpy.dot",
"numpy.arccos",
"numpy.cos",
"numpy.random.random",
"numpy.sin",
"numpy.linalg.norm",
"numpy.arcsin",
"numpy.eye",
"numpy.argmax",
"numpy.cross",
"numpy.array",
"numpy.zeros",
"numpy.linalg.det",
"numpy.allclose",
"numpy.arctan2",
"numpy... |
rsasaki0109/ensemble_kalman_filter | [
"d5e9d71c8726357379dc121515a8b370dbb8bc7f"
] | [
"ensemble_kalman_filter.py"
] | [
"\n\"\"\"\n\nEnsemble Kalman Filter(EnKF) localization sample\n\nauthor: Ryohei Sasaki(rsasaki0109)\n\nRef:\n- [Ensemble Kalman filtering](https://rmets.onlinelibrary.wiley.com/doi/10.1256/qj.05.135)\n\n\"\"\"\n\nimport numpy as np\nimport math\nimport matplotlib.pyplot as plt\n\n# Simulation parameter\nQsim = np.... | [
[
"numpy.array",
"matplotlib.pyplot.axis",
"numpy.zeros",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"numpy.tile",
"numpy.average",
"numpy.mean",
"numpy.eye",
"matplotlib.pyplot.cla",
"numpy.random.randn",
"numpy.linalg.eig",
"numpy.arange",
"matplotl... |
verolero86/rl_graph_generation | [
"2f278c46a179cc43583298d24983e42fa0d536a6"
] | [
"gym-molecule/gym_molecule/envs/molecule.py"
] | [
"import gym\nimport itertools\nimport numpy as np\nfrom rdkit import Chem # TODO(Bowen): remove and just use AllChem\nfrom rdkit.Chem import AllChem\nfrom rdkit.Chem.Descriptors import qed, MolLogP\nfrom rdkit.Chem import rdMolDescriptors\nfrom rdkit.Chem.FilterCatalog import FilterCatalogParams, FilterCatalog\n# ... | [
[
"numpy.array",
"numpy.ceil",
"numpy.isnan",
"numpy.random.rand",
"numpy.zeros",
"numpy.random.seed",
"numpy.sum",
"numpy.mean",
"numpy.eye",
"numpy.std",
"numpy.random.randint",
"numpy.power",
"numpy.abs",
"numpy.argmax"
]
] |
chuajiesheng/twitter-sentiment-analysis | [
"7617243c953a20c517a737c79fe0f54e55aef140"
] | [
"analysis/end_to_end.py"
] | [
"import numpy as np\nimport nltk\nimport sklearn\nimport tokenizers\nimport multiprocessing\nimport itertools\nimport functools\n\n\ndef get_dataset():\n files = ['./analysis/input/negative_tweets.txt', './analysis/input/neutral_tweets.txt', './analysis/input/positive_tweets.txt']\n\n x = []\n for file in ... | [
[
"numpy.array",
"sklearn.feature_extraction.text.TfidfTransformer",
"sklearn.metrics.accuracy_score",
"sklearn.linear_model.LogisticRegression",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.feature_selection.SelectKBest",
"sklearn.metrics.f1_score",
"sklearn.model_sel... |
kangvcar/MoviesAnalyse | [
"31d37ae745af6dd9b5bd5d007aebd63cf1b4247c"
] | [
"analyse/movie_analyse.py"
] | [
"#!/usr/bin/python\n# coding=utf-8\n\nimport time\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib\nimport jieba\nimport jieba.analyse\nimport os\nfrom pyecharts import options as opts\nfrom pyecharts.charts import Map\nfrom pyecharts.charts import Pie\nfrom pyecharts.cha... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.read_json"
]
] |
bio-phys/pyDHAMed | [
"d42f2a67a2650a0f8b09a798c2afe3b6d85aab08"
] | [
"pydhamed/prepare_dhamed.py"
] | [
"from __future__ import print_function\nfrom six.moves import range\n\nimport numpy as np\nfrom collections import defaultdict\n\ndef state_lifetimes_counts(transition_count_matrix_l,\n n, nwin):\n \"\"\"\n \n Calculate lifetimes in each of the states (for each run/window)\n \n... | [
[
"numpy.sum",
"numpy.array",
"numpy.zeros"
]
] |
CristianoPizzamiglio/scikit-spatial | [
"95ca2d4f2948cf6a69ec4bc7236b70fd66db1de5"
] | [
"src/skspatial/objects/vector.py"
] | [
"\"\"\"Module for the Vector class.\"\"\"\nfrom __future__ import annotations\n\nimport math\nfrom typing import cast\n\nimport numpy as np\nfrom matplotlib.axes import Axes\nfrom mpl_toolkits.mplot3d import Axes3D\n\nfrom skspatial._functions import np_float\nfrom skspatial.objects._base_array import _BaseArray1D\... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.linalg.det",
"numpy.float64",
"numpy.sign",
"numpy.subtract",
"numpy.clip",
"numpy.cross"
]
] |
tomtix/osux | [
"cf87171ffca9513c3a05e2156618b20cea4aef98"
] | [
"src/taikorank/test/linear_fun.py"
] | [
"#!/usr/bin/python3\n\n# Copyright (©) 2015-2016 Lucas Maugère, Thomas Mijieux\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unles... | [
[
"matplotlib.pylab.ylabel",
"matplotlib.pylab.show",
"matplotlib.pylab.xlabel",
"matplotlib.pylab.title",
"matplotlib.pylab.plot"
]
] |
ArielYssou/Aperiodic_CP | [
"f8dda241c20850f49a5046dd8306cb122dd7a652"
] | [
"Aperiodic_CP/abax_bissection.py"
] | [
"import subprocess\nfrom scipy.optimize import curve_fit\nfrom numpy import linspace, logspace, log, polyfit, isnan\nfrom random import randint\nfrom os import listdir\nfrom os.path import isfile, isdir, join\nfrom time import sleep\n\ndef file_len(fname):\n with open(fname) as f:\n for i, l in enumerate(... | [
[
"numpy.linspace",
"numpy.log"
]
] |
symant233/zfsoft-captcha2 | [
"feb689bbdbb0a306f8d342152d67cf23c5849ea5"
] | [
"app.py"
] | [
"from flask import Flask, url_for, request, redirect\nfrom predictor import split_pic, analyse\nfrom tensorflow import keras\napp = Flask(__name__) # __main__\nmodel = keras.models.load_model('./model/Model_tf.net')\n\n\n@app.route(\"/\")\ndef hello(name=None):\n return \"\"\"home page\n upload: /upload\n ... | [
[
"tensorflow.keras.models.load_model"
]
] |
rizkifatihah/k-means | [
"1b50ac6d4c72f67e9116d9e9dcc9732e590aa006"
] | [
"k-means.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.cluster import KMeans\nfrom sklearn.preprocessing import MinMaxScaler\n\nobejct = pd.read_csv(\"name_file.csv\")\nobejct.head()\n\nplt.scatter(obejct.x, obejct.y, s =10, c = \"c\", marker = \"o\", alpha = 1)\nplt.show()\nx_array... | [
[
"numpy.array",
"matplotlib.pyplot.colorbar",
"pandas.DataFrame",
"sklearn.cluster.KMeans",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"sklearn.preprocessing.MinMaxScaler",
"matplotlib.pyplot.scatter",
"pandas.read_csv"
]
] |
bemu/diagnosis_covid19 | [
"625954beb136caa3348edfc75de16cc4db21ee43",
"84abe2fd1cc46e4f16d3f59be18ff3c8b5fa08c0"
] | [
"multi_period_scores/analysis_mp.py",
"analysis_tools/analysis_lesion_size.py"
] | [
"import numpy as np\nimport seaborn as sb\nimport os\nimport matplotlib.pyplot as plt\ndef inter_vecter(v):\n length=v.shape[0]\n x=np.linspace(0, 1, 40)\n xp = np.linspace(0, 1, length)\n new_v=np.interp(x, xp, v)\n return new_v\n\ndatas=open('val_slices_count.txt','r').readlines()\nfull_names=[da.s... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.interp",
"matplotlib.pyplot.figure",
"numpy.argsort",
"numpy.linspace",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.xticks"
],
[
"numpy.array",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotl... |
ZettaAI/DeepEM | [
"98de568d96fc793dd7461e088ef7fc079d828c8a"
] | [
"deepem/data/dataset/pinky_basil/mip0_padded_x512_y512_z32.py"
] | [
"import numpy as np\nimport os\n\nimport dataprovider3.emio as emio\n\n\n# Basil dataset\nbasil_dir = 'basil/ground_truth/mip0/padded_x512_y512_z32'\nbasil_info = {\n 'vol001':{\n 'img': 'img.h5',\n 'seg': 'seg.h5',\n 'psd': 'psd.h5',\n 'msk': 'msk.d128.h5',\n 'blv': 'blv.h5',\... | [
[
"numpy.zeros"
]
] |
tsesarrizqi/tflite2 | [
"f48c1868e5f64f5fcdd1939a54cfad28a84be2b0"
] | [
"tensorflow/contrib/estimator/python/estimator/replicate_model_fn_test.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.losses.losses.absolute_difference",
"tensorflow.contrib.estimator.python.estimator.replicate_model_fn._replicate_model_fn_with_mode",
"tensorflow.python.ops.variables.Variable",
"tensorflow.python.training.training.get_global_step",
"tensorflow.python.ops.variable_scope.... |
hellotem/fixmatch | [
"5b27a3bc057a8f2a144e5c8287bc44f715621508"
] | [
"third_party/auto_augment/wrn.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Google UDA Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.variable_scope",
"numpy.prod",
"tensorflow.nn.relu"
]
] |
albertonavaa/Cirq | [
"76352585b9667873e60d51ee8cf7e6549c9d9a5e"
] | [
"cirq/sim/clifford/clifford_simulator.py"
] | [
"# Copyright 2019 The Cirq 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o... | [
[
"numpy.array",
"numpy.random.RandomState"
]
] |
lee14257/delphi-epidata | [
"b007d778321e68be5526ca9ce1113b13d24d6fe8"
] | [
"src/acquisition/covid_hosp/common/database.py"
] | [
"\"\"\"Common database code used by multiple `covid_hosp` scrapers.\"\"\"\n\n# standard library\nfrom contextlib import contextmanager\nimport math\n\n# third party\nimport mysql.connector\nimport pandas as pd\n\n# first party\nimport delphi.operations.secrets as secrets\n\n\nclass Database:\n\n def __init__(self,... | [
[
"pandas.Timestamp"
]
] |
ammunk/Bayesian-Non-Parametric-NMF | [
"f233c2278cb5c44cc14d7e2c14625cda36428a09"
] | [
"npbNMF/truncated_normal_functions/trandn.py"
] | [
"import sys\nimport numpy as np\nfrom scipy.special import erfc, erfcinv, expm1\n\ndef trandn(l,u):\n ## truncated normal generator\n # * efficient generator of a vector of length(l)=length(u)\n # from the standard multivariate normal distribution,\n # truncated over the region [l,u];\n # infinite va... | [
[
"numpy.logical_not",
"numpy.logical_or",
"numpy.asarray",
"numpy.logical_and",
"numpy.any",
"numpy.random.uniform",
"numpy.sqrt",
"numpy.abs",
"scipy.special.expm1"
]
] |
RollyAngell/ComputerVision-ND-Udacity | [
"5d4254af6fcf9e36c2dc0f4369b35365e6f54ed6"
] | [
"Projects/P1_Facial_Keypoints/models.py"
] | [
"## TODO: define the convolutional neural network architecture\n## Making changes\n\nimport torch\nfrom torch.autograd import Variable\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... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.Conv2d",
"torch.nn.functional.relu"
]
] |
hfathian/porespy | [
"8747e675ba8e6410d8448492c70f6911e0eb816a"
] | [
"porespy/networks/__snow_dual__.py"
] | [
"import numpy as np\nfrom porespy.networks import regions_to_network\nfrom porespy.networks import add_boundary_regions\nfrom porespy.networks import label_boundary_cells\nfrom porespy.networks import _net_dict\nfrom porespy.tools import pad_faces\nfrom porespy.filters import snow_partitioning\nfrom porespy.metrics... | [
[
"numpy.bincount",
"numpy.trim_zeros",
"numpy.amax",
"numpy.concatenate"
]
] |
phenix2017/dl-ift6135-h19 | [
"8a720744c094e903901d36a35edca99f8faf6a85"
] | [
"Assignment_1/Practice/kaggle/model_functions.py"
] | [
"import csv\nimport datetime\nimport numpy as np\nimport os\nimport torch\nimport torch.nn as nn\nimport tqdm\nimport time\n\nimport utils\n\n\ndef train(args, model, train_loader, optimizer, epoch, start_time, log_file,\n train_epochs, train_losses, train_accuracy, valid_epochs, valid_losses, valid_accura... | [
[
"torch.nn.NLLLoss",
"torch.no_grad",
"numpy.argsort"
]
] |
zeeshanahmad10809/sst-deep-tensorflow | [
"4d21b3a3d90d92eade1e09b7dc50c19b56a0b43c"
] | [
"testing.py"
] | [
"from utils import load_saved_model\nfrom sst.dataset import SSTContainer\nimport numpy as np\nfrom sklearn.metrics import (\n precision_score,\n recall_score,\n f1_score,\n confusion_matrix,\n accuracy_score,\n)\nfrom loguru import logger\n\n\ndef test(root, binary, filename=\"\"):\n model = load... | [
[
"numpy.array",
"sklearn.metrics.accuracy_score",
"numpy.argmax",
"sklearn.metrics.precision_score",
"sklearn.metrics.f1_score",
"sklearn.metrics.recall_score"
]
] |
atpk/Computer-Networks-Lab | [
"5df51cc2ef38ebde56922799db507d6d059bcb7e"
] | [
"4/PythonCodesForGraphs/q3_1.py"
] | [
"import matplotlib.pyplot as plt\r\n\r\nx = [103.0, 96.2, 213.0, 238.0, 259.0, 282.0, 73.2, 226.0, 96.6, 271.0, 191.0, 216.0, 237.0, 103.0, 82.3, 101.0, 229.0, 249.0, 271.0, 192.0, 215.0, 238.0, 92.1, 72.0, 102.0, 89.2, 249.0, 170.0, 295.0, 216.0, 130.0, 88.0, 186.0, 206.0, 226.0, 249.0, 273.0, 193.0, 216.0, 98.7, ... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
SpencerCompton/EconML | [
"3e66b9507b43f8af291009d26186283fa4bb4ced"
] | [
"econml/_ortho_learner.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\n\"\"\"\n\nOrthogonal Machine Learning is a general approach to estimating causal models\nby formulating them as minimizers of some loss function that depends on\nauxiliary regression models that also need to be estima... | [
[
"numpy.concatenate",
"numpy.full",
"sklearn.preprocessing.LabelEncoder",
"numpy.array_equal",
"numpy.zeros",
"numpy.median",
"numpy.ones",
"numpy.mean",
"sklearn.utils.check_random_state",
"numpy.arange",
"numpy.ravel",
"numpy.intersect1d",
"numpy.ndim",
"nu... |
cericdahl/SBCcode | [
"90a7841a5c1208d64f71a332289d9005a011aa21"
] | [
"UserCode/bressler/coincidentbubblescintillation.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jun 6 09:37:12 2019\n\n@author: bressler\n\"\"\"\n\nimport SBCcode as sbc\nfrom os import listdir\nfrom os.path import isfile,join\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy\nfrom gaincalc import get_gain\nimport pulse... | [
[
"scipy.optimize.curve_fit",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.diff",
"matplotlib.pyplot.hist",
"numpy.fabs",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.scatter"
]
] |
elias-ramzi/pytorch-metric-learning | [
"1fb343124d15fd2f63d535df26aa1463daf4ceee"
] | [
"tests/miners/test_pair_margin_miner.py"
] | [
"import unittest\n\nimport torch\n\nfrom pytorch_metric_learning.distances import CosineSimilarity, LpDistance\nfrom pytorch_metric_learning.miners import PairMarginMiner\nfrom pytorch_metric_learning.utils import common_functions as c_f\n\nfrom .. import TEST_DEVICE, TEST_DTYPES\n\n\nclass TestPairMarginMiner(unit... | [
[
"torch.randint",
"torch.randn",
"torch.arange"
]
] |
777ki/alibabacloud-pai-dsw-cn-demo | [
"361c91dd0a302c5073b84cea5ca64dd7b00b0c35"
] | [
"dawnbench_mlperf_dsw/quantize/quant_hooks_v2.py"
] | [
"# Copyright 2017 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... | [
[
"numpy.max",
"numpy.concatenate",
"numpy.array",
"numpy.add",
"numpy.zeros",
"numpy.argmin",
"numpy.log",
"numpy.sum",
"numpy.ones",
"numpy.load",
"numpy.save",
"numpy.where",
"numpy.abs",
"numpy.floor"
]
] |
jleuschn/dival | [
"483915b2e64c1ad6355311da0429ef8f2c2eceb5"
] | [
"dival/reconstructors/fbpunet_reconstructor.py"
] | [
"from warnings import warn\nfrom copy import deepcopy\n\nimport torch\nimport numpy as np\nimport torch.nn as nn\nfrom odl.tomo import fbp_op\n\nfrom dival.reconstructors.standard_learned_reconstructor import (\n StandardLearnedReconstructor)\nfrom dival.reconstructors.networks.unet import UNet\nfrom dival.datas... | [
[
"torch.optim.lr_scheduler.CosineAnnealingLR",
"numpy.asarray",
"torch.nn.DataParallel"
]
] |
clausia/qiskit-nature | [
"3e66f54496445f08ce26c58eea3789f28eed4cc8"
] | [
"test/algorithms/ground_state_solvers/test_groundstate_eigensolver.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2020, 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio... | [
[
"numpy.zeros",
"numpy.eye"
]
] |
yangninghua/code_library | [
"b769abecb4e0cbdbbb5762949c91847a0f0b3c5a"
] | [
"book-code/numpy-ml/numpy_ml/neural_nets/initializers/initializers.py"
] | [
"import re\nfrom functools import partial\nfrom ast import literal_eval as eval\n\nimport numpy as np\n\nfrom ..optimizers import OptimizerBase, SGD, AdaGrad, RMSProp, Adam\nfrom ..activations import ActivationBase, Affine, ReLU, Tanh, Sigmoid, LeakyReLU\nfrom ..schedulers import (\n SchedulerBase,\n Constant... | [
[
"numpy.sqrt"
]
] |
Tudor33/nni | [
"020408a235fd3cc625ba5627971448647e6ff1f2"
] | [
"nni/algorithms/compression/torch/pruning/simulated_annealing_pruner.py"
] | [
"# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\n\nimport logging\nimport os\nimport math\nimport copy\nimport csv\nimport json\nimport numpy as np\nfrom schema import And, Optional\n\nfrom nni.utils import OptimizeMode\n\nfrom nni.compression.torch.compressor import Pruner\nfrom nni.comp... | [
[
"numpy.random.uniform",
"numpy.asarray",
"numpy.abs",
"numpy.clip"
]
] |
rjbordon/dataflow-sample-applications | [
"e7a58ac3fc7af9022d0ae61702a5f6043bc4b2db"
] | [
"timeseries-streaming/timeseries-python-applications/MLPipelineExamples/test_pipelines/stream_inference.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"tensorflow.train.Example"
]
] |
hyyh619/ViZDoom-Imitation-Defend-Center | [
"952ab8f923ef8e13b9a7dd9a935effeb1af42267"
] | [
"c51_ddqn.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import print_function\n\nimport skimage as skimage\nfrom skimage import transform, color, exposure, io\nfrom skimage.viewer import ImageViewer\nimport random\nfrom random import choice\nimport numpy as np\nfrom collections import deque\nimport time\nimport math\nimport os\nim... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.reshape",
"numpy.zeros",
"numpy.rollaxis",
"tensorflow.Session",
"tensorflow.ConfigProto",
"numpy.float32",
"numpy.stack",
"numpy.vstack",
"numpy.argmax",
"numpy.argsort",
"numpy.append",
"numpy.expand_dims"
]
] |
tsmbland/andi_challenge | [
"18e6e1420d269066b3a7646e1525f017026edf4c"
] | [
"Task1_Exponent/Train/2D.py"
] | [
"import os\nimport sys\n\nsys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/../..')\n\nfrom andi_funcs import TrackGeneratorRegression, import_tracks, import_labels, package_tracks\nfrom models import regression_model_2d\nfrom tensorflow.keras.optimizers import Adam\nfrom tensorflow.keras.callbacks im... | [
[
"tensorflow.keras.models.load_model",
"numpy.savetxt",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.callbacks.ModelCheckpoint"
]
] |
MingyuLi19910814/machine_learning_from_scratch | [
"e6fa52045e9cdcf38fe4c8c5f5577c3dade71281"
] | [
"supervised/Classifier/RandomForest.py"
] | [
"import numpy as np\nfrom DecisionTree import DecisionTreeClassifier\nfrom sklearn.ensemble import RandomForestClassifier\nfrom collections import Counter\nfrom Evaluate import evaluate_classifier\n\n\nclass RandomForest:\n def __init__(self, n_estimators, max_depth, max_features):\n self.n_estimators = n... | [
[
"sklearn.ensemble.RandomForestClassifier",
"numpy.random.choice",
"numpy.zeros"
]
] |
paul-cvp/e2ecorefpytorch | [
"51cb274f5916867b0a6d76314391e0843a541a27"
] | [
"allen/allen_self_attentive_span_extractor.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom overrides import overrides\n\nfrom allen.allen_params import Params\nfrom allen.allen_time_distributed import TimeDistributed\nimport allen.allen_util as util\n\n\nclass SelfAttentiveSpanExtractor(nn.Module):\n \"\"\"\n Computes span ... | [
[
"torch.nn.Linear"
]
] |
wangstone666/mmdetection | [
"5ce2f219c1cedd6ccd1e531232341497c893d7fe"
] | [
"mmdet/apis/inference.py"
] | [
"import warnings\n\nimport matplotlib.pyplot as plt\nimport mmcv\nimport numpy as np\nimport torch\nfrom mmcv.ops import RoIPool\nfrom mmcv.parallel import collate, scatter\nfrom mmcv.runner import load_checkpoint\n\nfrom mmdet.core import get_classes\nfrom mmdet.datasets.pipelines import Compose\nfrom mmdet.models... | [
[
"torch.no_grad",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show",
"torch.set_grad_enabled"
]
] |
shervinazadi/topoGenesis | [
"5c73a5adf4afbda781540c6c08d24e2da62810b8"
] | [
"examples/py/gradient_decent.py"
] | [
"from time import sleep # for delaying between iterations\nimport click # for cleaning the command line\nimport topogenesis as tg\nimport numpy as np\nnp.random.seed(0)\n\n# create a step one moore neighbourhood\ns = tg.create_stencil(\"von_neumann\", 1)\n\n\n# assign the arg-minimum function\ns.functio... | [
[
"numpy.random.seed",
"numpy.unravel_index",
"numpy.random.rand",
"numpy.zeros"
]
] |
gml-explore/gradual-ml | [
"cc3b0806498798c394f844980d268a7ceac2228d"
] | [
"src/gradual-ml/numbskull_extend/inference.py"
] | [
"\"\"\"TODO.\"\"\"\n\nfrom __future__ import print_function, absolute_import\nimport numba\nfrom numba import jit\nimport numpy as np\nimport math\n\n\n@jit(nopython=True, cache=True, nogil=True)\ndef gibbsthread(shardID, nshards, var_copy, weight_copy, weight, variable,\n factor, fmap, vmap, factor_... | [
[
"numpy.argmax",
"numpy.random.rand"
]
] |
tjuwlz/NER | [
"a84b11650f2ec2d531e5925f5bab0726eb7c7af3"
] | [
"NER_v2/modules/rnn_encoder.py"
] | [
"import torch\nimport torch.nn as nn\n\n\n# 通用的RNN\nclass RNNEncoder(nn.Module):\n def __init__(self, input_size, # 输入的特征维度\n hidden_size, # 隐层特征维度\n num_layers=1, # RNN层数\n batch_first=True, # (batch_size, seq_len, feature_size)\n b... | [
[
"torch.zeros",
"torch.device",
"torch.cat",
"torch.nn.ModuleList",
"torch.bernoulli"
]
] |
BBN-Q/pyqgl2 | [
"7acc8b244ee7799c21df03ecff8325e15cdb94d3"
] | [
"src/python/qgl2/basic_sequences/SPAM.py"
] | [
"# Copyright 2016 by Raytheon BBN Technologies Corp. All Rights Reserved.\n\nfrom qgl2.qgl2 import qgl2decl, qreg, qgl2main, pulse, QRegister\n\nfrom qgl2.qgl1 import X, U, Y90, X90, MEAS, Id\n\nfrom qgl2.util import init\n\nfrom itertools import chain\nfrom numpy import pi\n\n@qgl2decl\ndef spam_seqs(angle, qubit... | [
[
"numpy.linspace"
]
] |
ikibalin/cryspy_editor | [
"dbc84518c8e0de61185f9c66586ccc07af16350c"
] | [
"build/lib/cryspy_editor/widgets/w_pd2d_proc.py"
] | [
"import numpy\nfrom PyQt5 import QtWidgets\n\nfrom .i_graph_mod_1d import cwidg_central as cwidg_pwd\nfrom .interactive_matrix import cwidg_central as cwidg_matrix\nfrom .FUNCTIONS import get_layout_rciftab_obj, del_layout\nfrom .w_item_constr import w_for_item_constr\n\ndef w_for_pd2d_proc(obj, layout_11, layout_1... | [
[
"numpy.isnan",
"numpy.vstack"
]
] |
XLearning-SCU/2021-NeurIPS-NCR | [
"31dd08ec114a9c5abca88fb14b4487ffebaed292"
] | [
"NCR/co_train.py"
] | [
"\"\"\"Training script\"\"\"\n\nimport os\nimport time\nimport copy\nimport shutil\nimport random\n\nimport numpy as np\nimport torch\nfrom sklearn.mixture import GaussianMixture\n\nfrom data import get_loader, get_dataset\nfrom model import SGRAF\nfrom vocab import Vocabulary, deserialize_vocab\nfrom evaluation im... | [
[
"torch.zeros",
"torch.no_grad",
"sklearn.mixture.GaussianMixture",
"torch.cuda.is_available",
"numpy.sort",
"torch.load"
]
] |
neptune0818/ground-station-app | [
"045e17b543633df6b7c463f252e8fe01fa372c71"
] | [
"gui/DataLoggerTest.py"
] | [
"'''\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY... | [
[
"numpy.random.randint"
]
] |
MOAISUS/jina | [
"9157e1a9429ccd04c7e5123273d40b136f69d977"
] | [
"jina/executors/encoders/torchvision.py"
] | [
"__copyright__ = \"Copyright (c) 2020 Jina AI Limited. All rights reserved.\"\n__license__ = \"Apache-2.0\"\n\nimport numpy as np\n\nfrom . import BaseNumericEncoder\nfrom ..decorators import batching, as_ndarray\n\n\nclass TorchEncoder(BaseNumericEncoder):\n def __init__(self,\n model_name: str,... | [
[
"torch.device",
"numpy.moveaxis"
]
] |
saurabhraj-115/Recommendation-Systems | [
"60fcdb06a142a09a7f079ec937110ad2891851ae"
] | [
"fin.py"
] | [
"\nfrom __future__ import print_function #importing relevant tools\nimport numpy as np\nfrom sklearn.metrics.pairwise import cosine_similarity\nfrom sklearn.model_selection import train_test_split\nimport pandas as pd\nfrom os import system\nimport math\nfrom itertools imp... | [
[
"numpy.product",
"numpy.ceil",
"numpy.count_nonzero",
"numpy.zeros",
"numpy.argmin",
"pandas.DataFrame",
"numpy.genfromtxt",
"numpy.sqrt",
"sklearn.metrics.pairwise.cosine_similarity"
]
] |
xeisberg/pecos | [
"c9cf209676205dd000479861667351e724f0ba1c"
] | [
"test/pecos/ann/test_hnsw.py"
] | [
"# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance\n# with the License. A copy of the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"lic... | [
[
"numpy.random.seed",
"scipy.sparse.csr_matrix",
"numpy.argsort"
]
] |
zhuxinqimac/stylegan2 | [
"5c3bda161ead21ea290de4190d3704e59cf6de64"
] | [
"metrics/frechet_inception_distance.py"
] | [
"# Copyright (c) 2019, NVIDIA Corporation. All rights reserved.\n#\n# This work is made available under the Nvidia Source Code License-NC.\n# To view a copy of this license, visit\n# https://nvlabs.github.io/stylegan2/license.html\n\n\"\"\"Frechet Inception Distance (FID).\"\"\"\n\nimport os\nimport numpy as np\nim... | [
[
"numpy.square",
"numpy.dot",
"numpy.cov",
"numpy.trace",
"numpy.empty",
"tensorflow.tile",
"numpy.tile",
"numpy.real",
"numpy.mean",
"tensorflow.device",
"tensorflow.random_normal"
]
] |
TerenceChen95/Retina-Unet-Pytorch | [
"fad5a9a0bcab5d81a0f1bb2537b9a2ead87828ca"
] | [
"generate_train_dataset.py"
] | [
"from dataset import Dataset\nimport os\nimport h5py\nimport numpy as np\nfrom PIL import Image\nfrom config import config\nfrom torchvision import transforms\n\ndef write_hdf5(arr, outfile):\n with h5py.File(outfile, 'w') as f :\n f.create_dataset(\"image\", data=arr, dtype=arr.dtype)\n\n\ndef get_datase... | [
[
"numpy.empty"
]
] |
BenTenmann/scirpy | [
"2c5b99e7c5205adc506a10d1aca97250051fab81"
] | [
"scirpy/tests/test_workflow.py"
] | [
"\"\"\"Test entire workflows using small example datasets.\n\nThe workflow is additionally tested using a larger dataset\nby running the tutorial on the CI.\n\nCurrently, these tests are mainly designed to be ran on the\nBioconda-CI when building the container as a quick consistency check.\nThe tests need to be qui... | [
[
"pandas.read_pickle",
"pandas.testing.assert_frame_equal"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.