repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
CAVED123/METAWORLD | [
"9f613fe967349c00c6367af53ece499964253793"
] | [
"metaworld/envs/mujoco/sawyer_xyz/sawyer_handle_pull.py"
] | [
"from collections import OrderedDict\nimport numpy as np\nfrom gym.spaces import Dict , Box\n\n\nfrom metaworld.envs.env_util import get_stat_in_paths, \\\n create_stats_ordered_dict, get_asset_full_path\nfrom metaworld.core.multitask_env import MultitaskEnv\nfrom metaworld.envs.mujoco.sawyer_xyz.base import Sa... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.exp",
"numpy.random.uniform",
"numpy.abs",
"numpy.hstack"
]
] |
pfk-beta/tvm | [
"5ecb8c384a66933fec8c7f033cba03337eb1a726"
] | [
"tests/python/contrib/test_hexagon/topi/test_reduce.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.random.choice",
"numpy.exp",
"numpy.take",
"numpy.random.uniform",
"numpy.indices"
]
] |
Huanzhuo/Y-Net | [
"ebc55c9b2ed85e5d37ca03c619f081b8b771b4df"
] | [
"dataset/audioDatasetHdf.py"
] | [
"import musdb\r\nimport librosa\r\nimport soundfile\r\nimport os\r\nimport librosa as lib\r\nfrom tqdm import tqdm\r\nimport numpy as np\r\nimport torch\r\nfrom sortedcontainers import SortedList\r\nimport h5py\r\nimport torch.nn as nn\r\nfrom dataset.util import *\r\nimport random\r\n\r\n\r\ndef getMUSDB(database_... | [
[
"numpy.max",
"numpy.zeros_like",
"numpy.pad",
"numpy.random.choice",
"numpy.zeros",
"numpy.random.seed",
"numpy.ones",
"numpy.mean",
"torch.tensor",
"numpy.abs",
"numpy.cumsum"
]
] |
MPieter/hero_radar_odometry | [
"107c1a07b22784fec54c22e5f8bb03251cc9f786"
] | [
"utils/vis.py"
] | [
"import io\nimport PIL.Image\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport torch\nimport torchvision.utils as vutils\nfrom torchvision.transforms import ToTensor\nfrom utils.utils import enforce_orthog, get_inverse_tf, get_T_ba\nfrom utils.utils import getApproxTimeStamps, wrapto2p... | [
[
"torch.sum",
"numpy.max",
"numpy.concatenate",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.clim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"numpy.sqrt",
"numpy.linalg.inv",
"matplotlib.pyplot.axes",
"torch.nonzero",
"numpy.array",
"numpy.m... |
tflovorn/tmd | [
"74da6d83a59eca0ab380d5ce97a36219db21fee6"
] | [
"tmd/wannier/fitError.py"
] | [
"import numpy as np\nfrom tmd.wannier.bands import Hk_recip\n#from tmd.wannier.extractHr import extractHr\n#from tmd.wannier.parseWin import parse_inner_window\n#from SKfit.wannier.scfUtil import _get_D_from_scf, _get_alat_from_scf\n\ndef FindFitError(Hr, inner_win, DFT_evals):\n '''Return the RMS error and sum ... | [
[
"numpy.dot",
"numpy.linalg.inv",
"numpy.sqrt",
"numpy.linalg.eigvalsh"
]
] |
WeitaoZC/iflow | [
"404ffdbeb27d9fae7d1350de6af84ed7bfdaad99"
] | [
"iflow/visualization/visualize_latent_distr.py"
] | [
"from matplotlib.colors import Normalize, same_color\nimport torch\nimport numpy as np\nimport os\nfrom iflow.utils.generic import to_numpy, to_torch\nimport matplotlib.pyplot as plt\n\n\ndef visualize_latent_distribution(val_trj, iflow, device, fig_number=1):\n n_trj = len(val_trj)\n dim = val_trj[0].shape[-... | [
[
"matplotlib.pyplot.draw",
"numpy.concatenate",
"numpy.max",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"numpy.sqrt",
"matplotlib.pyplot.gca",
"numpy.reshape",
"numpy.zeros",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.stack",
"m... |
Midoriii/Anomaly_Detection_Diploma | [
"11145e3e5210a4e45a33d98b138213edb7bc5d3d"
] | [
"Models/biGAN/BasicBiganXEntropyHiLatDim.py"
] | [
"'''\nCopyright (c) 2021, Štěpán Beneš\n\n\nBasic bigAN net, using cross entropy as loss and higher lat dims\n'''\nimport numpy as np\nfrom Models.biGAN.BaseBiganModel import BaseBiganModel\nfrom Models.Losses.custom_losses import wasserstein_loss\nfrom Models.biGAN.weightclip_constraint import WeightClip\n\nfrom k... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
tgouss/biorbd-viz | [
"0ce7e0beb25f2ee83a2f48d4a7919c076e854473"
] | [
"examples/biorbd_viz.py"
] | [
"# \"\"\"\n# Example script for animating a model\n# \"\"\"\n\nimport numpy as np\n\nfrom BiorbdViz import BiorbdViz\n\nb = BiorbdViz(model_path=\"pyomecaman.bioMod\")\nanimate_by_hand = 0\n\nif animate_by_hand == 0:\n n_frames = 200\n all_q = np.zeros((b.nQ, n_frames))\n all_q[4, :] = np.linspace(0, np.pi... | [
[
"numpy.linspace",
"numpy.zeros"
]
] |
JunnYu/ConvBERT-Prod | [
"a1351e1e7f9400cb8c71d0a15d23629b4cb055d4"
] | [
"paddlenlp/metrics/glue.py"
] | [
"# Copyright (c) 2020 PaddlePaddle 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 re... | [
[
"numpy.bincount",
"numpy.array",
"numpy.empty",
"numpy.zeros",
"numpy.ones",
"numpy.float64",
"numpy.any",
"numpy.argsort",
"numpy.average",
"numpy.expand_dims"
]
] |
JavisDaDa/ELEC546 | [
"813513e6e1d7a75f8ad85f384131be9d36ccfc06"
] | [
"Assignment7/upload/linear_classifier.py"
] | [
"import numpy as np\nfrom linear_svm import svm_loss_vectorized\n\n\nclass LinearClassifier(object):\n\n def __init__(self):\n self.theta = None\n\n def train(self, X, y, learning_rate=1e-3, reg=1e-5, num_iters=100, batch_size=200,\n verbose=False):\n m, d = X.shape\n K = np.... | [
[
"numpy.max",
"numpy.random.randn",
"numpy.argmax",
"numpy.random.choice"
]
] |
GiorgiaAuroraAdorni/deep-q-network-atari-games | [
"fb69c18cdb0dd9c46a38d459367f297e51cdef59"
] | [
"code/my_plots.py"
] | [
"from collections import Counter\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib.ticker import EngFormatter\n\nfrom main import check_dir, moving_average\n\n\ndef plot_step_per_episode(model):\n \"\"\"\n\n :param model:\n :return:\n \"\"\"\n out_dir = 'out/' + model + '/img/'\... | [
[
"numpy.char.strip",
"numpy.array",
"matplotlib.pyplot.xlim",
"matplotlib.ticker.EngFormatter",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.ylim",
"matplotlib.... |
gschramm/pyapetnet | [
"1d88b2e06c40b999360b6dba35823ab5343b3e65"
] | [
"pyapetnet/command_line_tools.py"
] | [
"import os\nimport argparse\nfrom glob import glob\n\ndef list_models():\n parser = argparse.ArgumentParser(description= 'list available trained models for pyapetnet')\n parser.add_argument('--model_path', help = 'absolute path of directory containing trained models',\n defa... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.percentile",
"numpy.ones",
"numpy.flip",
"matplotlib.pyplot.show",
"numpy.linalg.inv",
"numpy.expand_dims"
]
] |
SoftwareDevEngResearch/BeaverDet | [
"db8d43d3eede07f21a0288d36c72bffbdfe1e28d"
] | [
"beaverdet/tests/test_tube.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nPURPOSE:\n Unit tests for tools.py\n\nCREATED BY:\n Mick Carter\n Oregon State University\n CIRE and Propulsion Lab\n cartemic@oregonstate.edu\n\"\"\"\n\n\nfrom math import sqrt\nimport pytest\nimport pint\nimport os\nimport cantera as ct\nimport numpy as np\nimport ... | [
[
"numpy.allclose",
"pandas.DataFrame",
"pandas.read_csv",
"numpy.array"
]
] |
icr-ctl/gnatcatcher | [
"ddfdde8442a66d2409d16b7eddb769a579460652"
] | [
"ribbit_scoring.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jul 9 12:50:06 2021\n\n@author: amandabreton\n\nA python code used to test out Opensoundscape's RIBBIT.\nYou don't need to parse anything in, it's supposed to be\nset to the great_plains_toad_dataset provided by Opensoundscape.\n\"\"\"\n\n# s... | [
[
"numpy.max",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.scatter"
]
] |
leemengtaiwan/tiny-imagenet | [
"c91ea299af4a8eab1ad5f9fd888279251c0147a0"
] | [
"utils.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nCLASS_MAPPING_FILE = 'dataset/words.txt'\nCLASS_LIST_FILE = 'dataset/wnids.txt'\nNUMBER_TO_TEXT_FILE = 'dataset/mapping.json'\n\n\ndef show_images_horizontally(images, labels=[], un_normalize=False, fig_size=(15, 7)):\n \"\"\"Show images in jupyter notebook... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"numpy.transpose",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
clairem789/apero-utils | [
"68ed0136a36b6badeaf15eb20d673052ad79a949"
] | [
"general/mtl_sync/apero_mtl_sync.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n# CODE NAME HERE\n\n# CODE DESCRIPTION HERE\n\nCreated on 2020-02-19 at 09:30\n\n@author: cook\n\"\"\"\nimport numpy as np\nimport os\nimport sys\nimport importlib\n\n\n# =============================================================================\n# Define ... | [
[
"numpy.char.array"
]
] |
ZZCer/BayesianOptimization | [
"d188783ac17241cf63c0b4d9484aabce6b2f2188"
] | [
"bayes_opt/target_space.py"
] | [
"from __future__ import print_function, division\nimport numpy as np\nfrom .helpers import ensure_rng, unique_rows\n\n\ndef _hashable(x):\n \"\"\" ensure that an point is hashable by a python dict \"\"\"\n return tuple(map(float, x))\n\n\nclass TargetSpace(object):\n \"\"\"\n Holds the param-space coord... | [
[
"numpy.empty",
"numpy.asarray"
]
] |
TurkuNLP/finngen-tools | [
"45d95b228ea7044a2d56bd414b8f44e418c42a57"
] | [
"pickled_to_indexed.py"
] | [
"#!/usr/bin/env python3\n\n# Convert the pickled format generated by prepare_data_for_gpt.py into\n# the indexed format consumed e.g. by Megatron.\n\nimport sys\n\nimport torch\n\nfrom argparse import ArgumentParser\n\nfrom pickled import PickledDataset\nfrom megatron.data import indexed_dataset\n\n\ndef argparser(... | [
[
"torch.IntTensor"
]
] |
ElePT/qiskit-terra | [
"0afac936bf43d7b54175c80db1706d32c9aa77f9"
] | [
"qiskit/circuit/parameterexpression.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2019.\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.isfinite"
]
] |
m-a-rahal/Beleif-functions | [
"1672cb4fab3eedc9059c7273158cef7a28558a2b"
] | [
"pyds.py"
] | [
"\"\"\"\nA framework for performing computations in the Dempster-Shafer theory.\n\"\"\"\n\nfrom __future__ import print_function\nfrom itertools import chain, combinations\nfrom functools import partial, reduce\nfrom operator import mul\nfrom math import log, fsum, sqrt\nfrom random import random, shuffle, uniform\... | [
[
"scipy.optimize.fmin_cobyla",
"numpy.zeros"
]
] |
aseifert/million-post-corpus | [
"7161a975353c963d3ba697392e4963809e7b0e1b"
] | [
"experiments/src/evaluate_d2v.py"
] | [
"import os\nimport sys\n\nfrom gensim.models.doc2vec import Doc2Vec\nimport numpy\nfrom sklearn.svm import SVC\n\nfrom preprocessing import normalize, micro_tokenize\nimport conf\n\nclass D2V_feature_extractor(object):\n def __init__(self, d2vfile):\n self.d2v = Doc2Vec.load(d2vfile)\n\n def fit(self, ... | [
[
"numpy.vstack",
"sklearn.svm.SVC"
]
] |
rezan21/Portfolio-Analysis-Library | [
"aaf8f9a18f67231b05d09d41d1fdbb1910e87fd3"
] | [
"tests/test_utils.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pytest\nfrom pal import utils\n\n\ndef test_load_ffme_returns():\n df = utils.load_ffme_returns()\n assert df.shape == (1110, 2)\n assert df.index[0] == pd.Period(\"1926-07\")\n assert df.index[-1] == pd.Period(\"2018-12\")\n assert df.columns.tolist()... | [
[
"numpy.array",
"pandas.Period"
]
] |
dberga/FACIL | [
"c11dd157bc53cfac91814a52c57bddc385365c61"
] | [
"src/networks/old/twobranch_sum.py"
] | [
"from networks.twobranch import twobranch\nimport torch\nimport utils\nfrom copy import deepcopy\n\nclass twobranch_sum(twobranch): \n def __init__(self, pretrained=False, backbone='resnet18', num_out=100, togray=\"mean\", scramble=False,select_kernels='all', remove_batchnorm=None):\n self.backbone = b... | [
[
"torch.nn.Linear"
]
] |
Tobias-Schoch/SSS | [
"f8b078ca7f6482fc7c89d5f9e784a549459eefb7",
"f8b078ca7f6482fc7c89d5f9e784a549459eefb7"
] | [
"Versuch4/task1.3.py",
"Versuch3/task2.2.py"
] | [
"# -------------------------------------\n# Task 1.3\n# -------------------------------------\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Einlesen der .npy Datei\ndata = np.load('data/test.npy')\nfreq = np.zeros(225280)\n\n# Darstellung des Amplitudenspektrums\nplt.plot(data)\nplt.grid()\nplt.xlabel... | [
[
"matplotlib.pyplot.xlim",
"numpy.zeros",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.load",
"matplotlib.pyplot.savefig",
"numpy.fft.fft",
"matplotlib.pyplot.ylabel",
"numpy.abs",
"matplotlib.pyplot.show"
],
[
"matplotli... |
RaspyThommy/ndlib | [
"47baa628c5da600a0a7082b61cade53d8f399087"
] | [
"ndlib/models/epidemics/SIModel.py"
] | [
"from ..DiffusionModel import DiffusionModel\nimport numpy as np\nimport future.utils\n\n__author__ = \"Giulio Rossetti\"\n__license__ = \"BSD-2-Clause\"\n__email__ = \"giulio.rossetti@gmail.com\"\n\n\nclass SIModel(DiffusionModel):\n \"\"\"\n Model Parameters to be specified via ModelConfig\n\n :param bet... | [
[
"numpy.random.random_sample"
]
] |
Hamstard/AtomStalker | [
"ed3c02b27fe7ac07cff7f8ae0d2427a98202c0c3"
] | [
"AtomStalker/TrajectorySimulator.py"
] | [
"import numpy as np\r\nfrom scipy import optimize\r\nimport matplotlib.pylab as plt\r\nimport collections, copy, itertools\r\n\r\nclass TrajectorySource(object):\r\n \"\"\"\r\n Class to generate initial trajectories for linkage inference as well as for continued production\r\n of trajectories feeding into ... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.isnan",
"numpy.random.choice",
"numpy.zeros",
"numpy.ones",
"numpy.random.shuffle",
"numpy.where",
"numpy.random.uniform",
"numpy.arange",
"numpy.random.random"
]
] |
johnbachman/bax_insertion_paper | [
"c9a1f7280998a8c3110f65d604afaa2686cda5c3"
] | [
"bax_insertion/plots/bid_bim_fret_nbd_release/plot_example_fret_fits.py"
] | [
"from bax_insertion.util import set_fig_params_for_publication, format_axis, \\\n fontsize\nfrom bax_insertion.plots.bid_bim_fret_nbd_release.preprocess_data import \\\n df_pre as df\nimport numpy as np\nfrom matplotlib import pyplot as plt\nimport cPickle\nimport bax_insertion.pl... | [
[
"numpy.random.randint",
"numpy.linspace",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplots"
]
] |
agombert/BERT-NER-TF | [
"194171af39f6da7e81105f6fc83813af7a1da8b6"
] | [
"bert.py"
] | [
"\"\"\"BERT NER Inference.\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\n\nimport json\nimport os\n\nimport tensorflow as tf\nfrom nltk import word_tokenize\n\nfrom model import BertNer\nfrom tokenization import FullTokenizer\n\n\nclass Ner:\n\n def __init__(self,model_dir: str):\n ... | [
[
"tensorflow.argmax",
"tensorflow.ones",
"tensorflow.Variable"
]
] |
sarthak268/plan2explore | [
"264f513d46c6e971d5523782344a694b17139a20",
"264f513d46c6e971d5523782344a694b17139a20"
] | [
"plan2explore/tools/overshooting.py",
"plan2explore/utils/video_utils.py"
] | [
"# Copyright 2019 The Dreamer Authors. Copyright 2020 Plan2Explore 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/lic... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.sequence_mask",
"tensorflow.range",
"tensorflow.concat",
"tensorflow.shape",
"numpy.array",
"tensorflow.reshape",
"tensorflow.zeros_like",
"numpy.prod",
"tensorflow.reduce_sum",
"tensorflow.nn.dynamic_rnn",
"tensorflow.cas... |
ryanleary/NeMo | [
"6ad05b45c46edb5d44366bd0703915075f72b4fc"
] | [
"collections/nemo_nlp/nemo_nlp/data/datasets/utils.py"
] | [
"from collections import Counter\nimport glob\nimport json\nimport os\nimport random\nimport re\nimport shutil\nimport subprocess\n\nimport numpy as np\nfrom sentencepiece import SentencePieceTrainer as SPT\nfrom tqdm import tqdm\n\nfrom nemo.utils.exp_logging import get_logger\n\nfrom ...utils.nlp_utils import (ge... | [
[
"numpy.max",
"numpy.asarray",
"numpy.median",
"numpy.percentile",
"numpy.min",
"numpy.mean"
]
] |
markvdw/convgp | [
"543d1fb4f6149f3d18c2eb738df041bafd0d0146"
] | [
"mnist01.py"
] | [
"\"\"\"\nvanilla-mnist.py\nRun the convolutional GP on MNIST, using the standard multi-label classification output.\n\"\"\"\nimport argparse\nimport itertools\nimport os\n\nimport numpy as np\nimport pandas as pd\n\nimport GPflow\nimport exp_tools\nimport opt_tools\nimport convgp.convkernels as ckern\n\n\nclass Mni... | [
[
"pandas.read_pickle",
"numpy.logical_or",
"numpy.random.rand",
"numpy.zeros",
"numpy.vstack"
]
] |
liuzuxin/safety-starter-agents | [
"0e503192897bd01b66300a32ea019e538d30d486"
] | [
"safe_rl/pg/network.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom gym.spaces import Box, Discrete\nfrom safe_rl.pg.utils import combined_shape, EPS\n\n\n\"\"\"\nNetwork utils\n\"\"\"\n\ndef placeholder(dim=None):\n return tf.placeholder(dtype=tf.float32, shape=combined_shape(None,dim))\n\ndef placeholders(*args):\n return [... | [
[
"tensorflow.exp",
"tensorflow.trainable_variables",
"tensorflow.shape",
"numpy.log",
"tensorflow.multinomial",
"numpy.ones",
"tensorflow.variable_scope",
"tensorflow.clip_by_value",
"tensorflow.reduce_sum",
"tensorflow.placeholder",
"tensorflow.layers.dense",
"tenso... |
dataiku/gluon-ts | [
"6e62b685f14b667c2272d60e3558c8d5209750dd"
] | [
"src/gluonts/model/tft/_transform.py"
] | [
"# Copyright 2018 Amazon.com, Inc. or its affiliates. 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# A copy of the License is located at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# or ... | [
[
"numpy.concatenate",
"numpy.ones",
"numpy.broadcast_to",
"numpy.zeros"
]
] |
flokno/tools.tdep | [
"7f8fd4e50f6c1cb94780133a157c695a40fd80c9"
] | [
"scripts/tdep_plot_dos.py"
] | [
"#! /usr/bin/env python\nfrom pathlib import Path\n\nimport h5py as h5\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn as sns\nimport typer\n\nsns.set_context(\"paper\", font_scale=1.7)\nto_invcm = 33.356\n\n\ndef get_canvas():\n fig, ax = plt.subplots()\n return fig, ax\n\n\napp = typer.... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.linspace",
"matplotlib.pyplot.subplots"
]
] |
agsreejith/ISM-correction | [
"1299efce4430e808daf69ee3b1193c7172deed73"
] | [
"ism_correction.py"
] | [
"# -*- coding: utf-8 -*-\r\n\r\n# pip install idlsave\r\n# pip install plotly\r\n\r\n#from IPython import embed\r\n\r\nimport sys\r\nimport idlsave\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport astropy.modeling.functional_models as am\r\nimport astropy.constants as ac\r\nfrom scipy.ndimage impo... | [
[
"numpy.argmin",
"numpy.exp",
"numpy.size",
"numpy.full",
"numpy.log",
"scipy.ndimage.convolve1d",
"numpy.arange",
"numpy.isfinite",
"numpy.sqrt",
"numpy.log10",
"numpy.array",
"numpy.float",
"numpy.zeros",
"scipy.special.wofz",
"numpy.amax",
"numpy.a... |
murraycutforth/MONAI | [
"ad06dff7f85711048690b2e85c99d51001612708"
] | [
"examples/segmentation_3d_ignite/unet_evaluation_array.py"
] | [
"# Copyright 2020 MONAI Consortium\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# Unless required by applicable law or agreed to i... | [
[
"torch.device",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.eye"
]
] |
pluskid/mxnet | [
"c8ce25647eb239a64f834131894eee71d89269a1"
] | [
"tests/python/unittest/test_operator.py"
] | [
"# pylint: skip-file\nimport numpy as np\nimport mxnet as mx\nimport random\nfrom numpy.testing import assert_allclose\nfrom mxnet.test_utils import *\n\ndef np_softmax(x, axis=-1):\n # fix for old numpy on Travis not supporting keepdims\n # x = x - np.max(x, axis=-1, keepdims=True)\n x = x - np.max(x, axi... | [
[
"numpy.dot",
"numpy.random.rand",
"scipy.special.gamma",
"numpy.arccos",
"numpy.minimum",
"numpy.set_printoptions",
"numpy.rint",
"numpy.tan",
"numpy.tile",
"numpy.exp",
"numpy.trunc",
"numpy.multiply",
"numpy.sign",
"numpy.radians",
"numpy.expm1",
"... |
davidobrien1/programming-for-data-analysis | [
"ae27d5a3d73273de09fd599776100d95a4699161"
] | [
"matplotlib-examples/2dplot.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\nx = np.arange(0.0, 10.0, 0.01) # Numpy will give me a range of number between 0 and 10 to 2 places of decimals\ny = 3.0 * x + 1.0 # x and y are arrays\nnoise = np.random.normal(0.0, 1.0, len(x))\n\nplt.plot(x, y + noise, 'r.', label=\"Actual\") # \"b.\" means... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
Dakuro/info_l1_dream | [
"35e0834bc0abb2067161724601ba433403c4b0f4"
] | [
"S1/TP2/ex_02.py"
] | [
"import numpy as np\n\nnb_notes = int(input(\"Entrer un nombre de notes à saisir :\\n\"))\nocc = int(-1)\nask = \"\"\"Voulez-vous afficher le nombre d'étudiants ayant eu 10 au DS ?\n0 - Quitter le programme\n1 - Afficher le nombre d'étudiants\\n\"\"\"\n\nwhile nb_notes < 1:\n print(\"Valeur saisie incorrecte.\")... | [
[
"numpy.empty",
"numpy.mean"
]
] |
thito514/batch5_phenix_happymeal | [
"67e9caa5561e7f308ba502a4d9e2d084d08443af"
] | [
"listing_parser.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n'''\nProduct grouping for balanced meal creation\n'''\n\n__author__ = 'François-Guillaume Fernandez'\n__license__ = 'MIT License'\n__version__ = '0.1'\n__maintainer__ = 'François-Guillaume Fernandez'\n__status__ = 'Development'\n\nimport argparse\nimport pandas as ... | [
[
"pandas.read_csv"
]
] |
MaxInGaussian/ZS-VAFNN | [
"d80846248eb244adf3c56560b15155d1682550cc",
"d80846248eb244adf3c56560b15155d1682550cc"
] | [
"uci-expts/classification/spambase/training.py",
"demo/SGPA_graph.py"
] | [
"# Copyright 2017 Max W. Y. Lam\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to... | [
[
"pandas.DataFrame.from_csv",
"numpy.random.seed",
"numpy.mean",
"numpy.std",
"numpy.arange",
"numpy.hstack",
"numpy.vstack",
"pandas.get_dummies"
],
[
"tensorflow.exp",
"tensorflow.sinh",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.expand_dims",
... |
marsmiao/HugeCTR | [
"c9ff359a69565200fcc0c7aae291d9c297bea70e"
] | [
"sparse_operation_kit/unit_test/test_scripts/test_dense_emb_demo_model_multi_worker.py"
] | [
"\"\"\"\n Copyright (c) 2021, NVIDIA CORPORATION.\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable l... | [
[
"numpy.concatenate",
"tensorflow.nn.compute_average_loss",
"tensorflow.shape",
"tensorflow.GradientTape",
"tensorflow.concat",
"tensorflow.distribute.MultiWorkerMirroredStrategy",
"tensorflow.keras.losses.BinaryCrossentropy"
]
] |
chashi-mahiul-islam-bd/swinirv2 | [
"86a6fc0a56d7674cde7544264a51f5277d9f8e03"
] | [
"data/dataset_usrnet.py"
] | [
"import random\r\n\r\nimport numpy as np\r\nimport torch\r\nimport torch.utils.data as data\r\nimport utils.utils_image as util\r\nfrom utils import utils_deblur\r\nfrom utils import utils_sisr\r\nimport os\r\n\r\nfrom scipy import ndimage\r\nfrom scipy.io import loadmat\r\n# import hdf5storage\r\n\r\n\r\nclass Dat... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.sum",
"torch.FloatTensor",
"numpy.float32",
"numpy.random.randint",
"numpy.expand_dims"
]
] |
eubr-atmosphere/a-MLLibrary | [
"b6ba472baacea6d793ab4f03275cdfa874e83bc3"
] | [
"model_building/decision_tree_experiment_configuration.py"
] | [
"\"\"\"\nCopyright 2019 Marco Lattuada\nCopyright 2019 Danilo Ardagna\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required ... | [
[
"sklearn.tree.DecisionTreeRegressor"
]
] |
xiao1228/nncf | [
"307262119ee3f50eec2fa4022b2ef96693fd8448",
"307262119ee3f50eec2fa4022b2ef96693fd8448",
"307262119ee3f50eec2fa4022b2ef96693fd8448"
] | [
"tests/test_models/ssd_mobilenet.py",
"beta/tests/tensorflow/test_callbacks.py",
"beta/nncf/tensorflow/sparsity/rb/algorithm.py"
] | [
"\"\"\"\n Copyright (c) 2019 Intel Corporation\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 Unless required by applicable law or agr... | [
[
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.load"
],
[
"tensorflow.train.latest_checkpoint",
"tensorflow.random.normal",
"tensorflow.reduce_all",
"tensorflow.losses.CategoricalCrossentropy",
"tensorflow.train.Checkpoint"
],
[
"tensorflow.size"... |
angelfish91/tensor2tensor | [
"168928d29cdd887fd6cdd5d5ad35181bef614154"
] | [
"tensor2tensor/rl/rl_utils.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Tensor2Tensor 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 requir... | [
[
"numpy.mean"
]
] |
liyunbin/Tacotron-2 | [
"3b765aac25810aa591dab42765aab8fcbf76ebf9"
] | [
"train.py"
] | [
"import matplotlib\r\nmatplotlib.use('Agg')\r\n\r\nimport argparse\r\nimport tensorflow as tf \r\nfrom tacotron.train import tacotron_train\r\nfrom wavenet_vocoder.train import wavenet_train\r\nfrom tacotron.synthesize import tacotron_synthesize\r\nfrom infolog import log\r\nfrom hparams import hparams\r\nimport os... | [
[
"matplotlib.use",
"tensorflow.reset_default_graph"
]
] |
nknezek/MgSi-Exsolution | [
"925d3e2f47256a4618fd77c39f23e233d3e9bdcd"
] | [
"control_scripts/run_for_nature_highSi.py"
] | [
"import numpy as np\nfrom shutil import copyfile\nimport matplotlib.pyplot as plt\nimport sys, os\nimport dill\nsys.path.append('../')\nimport mg_si\nimport csv\nimport datetime\n\nfrom mg_si import plot as mplt\n\nprint(sys.argv)\nlayer_thickness = 100 # m\noverturn = 600 # Myr\n\ntimes = np.linspace(0,4568e6*365.... | [
[
"numpy.linspace",
"matplotlib.pyplot.close"
]
] |
ddman1101/SRCNN-Partial-Convolution | [
"a8d4d771b866abd71879207e70864f87b6f2d473"
] | [
"model.py"
] | [
"# -*- coding: UTF-8 -*-\n\nfrom utils import (\n read_data, \n input_setup, \n imsave,\n merge,\n imread,\n merge2,\n psnr,\n psnr2\n)\n\nimport time\nimport os\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport tensorflow as tf\nimport glob\n\nimport feature_map\nimport csv\nimport partial_conv ... | [
[
"numpy.array",
"tensorflow.zeros",
"tensorflow.initialize_all_variables",
"tensorflow.random_normal",
"tensorflow.train.Saver",
"tensorflow.train.get_checkpoint_state",
"numpy.shape",
"tensorflow.get_collection",
"numpy.mean",
"tensorflow.placeholder",
"tensorflow.squar... |
pablode/BlenderUSDHydraAddon | [
"08b1459cf7b7d8a86d14fe1c50bd008134e7ebb7"
] | [
"src/hdusd/engine/final_engine.py"
] | [
"#**********************************************************************\n# Copyright 2020 Advanced Micro Devices, Inc\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://... | [
[
"numpy.concatenate",
"numpy.empty",
"numpy.zeros"
]
] |
s10singh97/Machine_Learning | [
"d8f49568c46427f91a84d85bc7f9580387789b1a"
] | [
"Machine Learning A-Z/Part 2 - Regression/Section 5 - Multiple Linear Regression/Multiple_Linear_Regression/my_multiple_linear_regression.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndataset = pd.read_csv('50_Startups.csv')\n\nX = dataset.iloc[:, :-1].values\ny = dataset.iloc[:, -1].values\n\nfrom sklearn.preprocessing import LabelEncoder, OneHotEncoder\nlabelencoder = LabelEncoder()\nX[:, 3] = labelencoder.fit_transfo... | [
[
"sklearn.preprocessing.LabelEncoder",
"numpy.delete",
"sklearn.linear_model.LinearRegression",
"numpy.zeros",
"numpy.ones",
"sklearn.model_selection.train_test_split",
"numpy.hstack",
"pandas.read_csv",
"sklearn.preprocessing.OneHotEncoder"
]
] |
frnsys/power_districting | [
"955df5861eea7dc632c3f8b879e960583025b8ef"
] | [
"gen_graph.py"
] | [
"import fiona\nimport pandas as pd\nimport geopandas as gpd\nfrom tqdm import tqdm\nfrom gerrychain import Graph\nfrom networkx import is_connected, connected_components\n\n# Census tracts\n# See `data/src/ACS_2018_5YR_TRACT_36_NEW_YORK.gdb/TRACT_METADATA_2018.txt`\ntracts_file = 'data/src/ACS_2018_5YR_TRACT_36_NEW... | [
[
"pandas.factorize",
"pandas.read_csv"
]
] |
donggong1/PAST-ReID | [
"4efc8c32b4d64eda33a0124dac45b7692f77f55a"
] | [
"reid/utils/model.py"
] | [
"\nimport torch.nn as nn\nimport copy\n\n\ndef init_classifier(m):\n if isinstance(m, nn.Linear):\n nn.init.normal_(m.weight, std=0.001)\n if m.bias is not None:\n nn.init.constant_(m.bias, 0)\n\n\ndef create_embedding(in_dim=None, out_dim=None, local_conv=False):\n layers = [\n ... | [
[
"torch.nn.Linear",
"torch.nn.init.constant_",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.init.normal_",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d"
]
] |
Aliasgarsaifee/CS231n | [
"972602c75a4a3d767e5e98b374d23ea4722d2017"
] | [
"assignment2/cs231n/optim.py"
] | [
"import numpy as np\n\n\"\"\"\nThis file implements various first-order update rules that are commonly used\nfor training neural networks. Each update rule accepts current weights and the\ngradient of the loss with respect to those weights and produces the next set of\nweights. Each update rule has the same interfa... | [
[
"numpy.zeros_like",
"numpy.sqrt"
]
] |
takeru1205/Insomnia | [
"72f78db5dc7b9c6e494f31408e0a011606275291"
] | [
"insomnia/models/dqn.py"
] | [
"from copy import deepcopy\nimport random\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\nfrom ..networks import simple_net\nfrom ..replay_buffers import replay_buffer\n\n\nclass DQN:\n \"\"\"Deep Q Network.\n\n Implementation of https://www.nature.com/articles/nature14236.\n\n Attri... | [
[
"torch.no_grad",
"torch.nn.MSELoss",
"torch.load"
]
] |
zafarali/policy-gradient-methods | [
"f0d83a80ddc772dcad0c851aac9bfd41d436c274",
"f0d83a80ddc772dcad0c851aac9bfd41d436c274"
] | [
"pg_methods/conjugate_gradient.py",
"tests/test_objectives.py"
] | [
"\"\"\"Implementation of the conjugate gradient algorithm.\"\"\"\nimport numpy as np\n\ndef conjugate_gradient_algorithm(f_Ax, b, cg_iters=10, residual_tol=1e-10):\n \"\"\"\n Demmel p 312\n https://github.com/joschu/modular_rl/blob/6970cde3da265cf2a98537250fea5e0c0d9a7639/modular_rl/trpo.py#L122\n \"\"\... | [
[
"numpy.zeros_like"
],
[
"torch.IntTensor",
"torch.FloatTensor",
"torch.randn",
"numpy.log"
]
] |
tinkermachine/Mercury2 | [
"b502871e8114da95efb9c4330fd093c7701f8bcb"
] | [
"main_sk.py"
] | [
"import os\nimport numpy as np\nimport logging\nfrom utils.config import get_config_from_json\nfrom data_loader.data_loader import DataLoader\nfrom models.dense_model import DenseModel\nfrom trainer.trainer import Trainer\nfrom os import listdir\nfrom os.path import isfile, join\nfrom sklearn.svm import SVC\n\n# GL... | [
[
"numpy.concatenate",
"numpy.sum",
"numpy.array",
"sklearn.svm.SVC"
]
] |
nrakover/scVI | [
"07e0b6708de8844fb0dd2998a1170b42b0b941e0"
] | [
"tests/dataset/test_anndataset.py"
] | [
"from unittest import TestCase\n\nimport anndata\nimport numpy as np\n\nfrom scvi.dataset import (\n AnnDatasetFromAnnData,\n DownloadableAnnDataset,\n CellMeasurement,\n GeneExpressionDataset,\n)\nfrom .utils import unsupervised_training_one_epoch\nimport scipy.sparse as sp_sparse\n\n\nclass TestAnnDat... | [
[
"numpy.zeros",
"scipy.sparse.csc_matrix",
"numpy.random.poisson",
"numpy.testing.assert_array_equal",
"numpy.ones",
"numpy.random.randint",
"numpy.arange",
"scipy.sparse.csr_matrix"
]
] |
chrisunice/onnx2keras-custom | [
"c37fe43fe5dce274a5a351d3c328cf61daa5f364"
] | [
"test/layers/constants/constant.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom onnx2keras_custom import onnx_to_keras, check_torch_keras_error\nimport onnx\n\n\nclass FTest(nn.Module):\n def __init__(self):\n super(FTest, self).__init__()\n\n def forward(self, x):\n return x... | [
[
"torch.FloatTensor",
"numpy.random.uniform",
"torch.onnx.export"
]
] |
joelb123/alphabetsoup | [
"19cba7094a8e5cb4db4a617f5334308f3abfe584"
] | [
"alphabetsoup/common.py"
] | [
"# -*- coding: utf-8 -*-\n# imports\nfrom pathlib import Path\n\nimport matplotlib.pyplot as plt\n\nimport numpy as np\n\nimport seaborn as sns\n# global variables\nPROGRAM_NAME = 'alphabetsoup'\nDUP_NAME = 'Dups'\nSUBSTRING_NAME = 'Substr'\nGRAPH_TYPES = [DUP_NAME, SUBSTRING_NAME]\nAMBIG_NAME = 'Ambig%'\nSHORT_NAM... | [
[
"matplotlib.pyplot.xlabel",
"numpy.log10",
"matplotlib.pyplot.close",
"matplotlib.pyplot.ylabel"
]
] |
xiaoshicae/Others | [
"a5df75f1da527f94c1c79870a8f5ac7c9a7353c2",
"a5df75f1da527f94c1c79870a8f5ac7c9a7353c2"
] | [
"Chinese-OCR/chinese-ocr-master/ctpn/ctpn/model.py",
"SSD/deployment/model_deploy.py"
] | [
"\nimport tensorflow as tf\nimport sys\nimport os\nfrom cfg import Config\nfrom other import resize_im\nsys.path.append('ctpn')\nfrom lib.networks.factory import get_network\nfrom lib.fast_rcnn.config import cfg\nfrom lib.fast_rcnn.test import test_ctpn\n\ndef load_tf_model():\n cfg.TEST.HAS_RPN = True # Use R... | [
[
"tensorflow.ConfigProto",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.train.get_checkpoint_state"
],
[
"tensorflow.summary.scalar",
"tensorflow.group",
"tensorflow.python.ops.control_flow_ops.with_dependencies",
"tensorflow.logging.info",
"tensorflow.histogr... |
1073521013/rasa_nlu_gq | [
"6c8bea1b14390246b39770abc544986f4c7acf26"
] | [
"rasa_nlu_gao/models/elmo_cn/modules/classify_layer.py"
] | [
"import logging\r\nimport math\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom torch.autograd import Variable\r\n\r\nlogging.basicConfig(level=logging.INFO, format='%(asctime)-15s %(levelname)s: %(message)s')\r\n\r\n\r\nclass SoftmaxLayer(nn.Module):\r\n \"\"\" Naive softmax-lay... | [
[
"torch.nn.Linear",
"torch.nn.Embedding",
"torch.cat",
"torch.LongTensor",
"torch.Tensor",
"torch.nn.CrossEntropyLoss"
]
] |
toshohirasawa/mmt-with-monolingual-data | [
"3f80f3a1807e1a837ef82d75917c1cf581270b84"
] | [
"nmtpytorch/scripts/all_but_the_top.py"
] | [
"#!/usr/bin/env python\n# original all-but-the-top code:\n# https://gist.github.com/lgalke/febaaa1313d9c11f3bc8240defed8390\n\nimport sys, os\nimport logging\nimport argparse\nlogger = logging.getLogger(__name__)\n\nimport numpy as np\nfrom sklearn.decomposition import PCA\nfrom gensim.models import KeyedVectors\ni... | [
[
"numpy.load",
"numpy.save",
"numpy.mean",
"torch.from_numpy",
"sklearn.decomposition.PCA",
"torch.functional.F.normalize",
"numpy.vstack"
]
] |
pbmstrk/odqa | [
"b5917237d5162eae208382e5d25b0c8c47018681"
] | [
"qakgc/retriever/tfidf_doc_ranker.py"
] | [
"# this code is adapted from original source code at\n# https://github.com/facebookresearch/DrQA\n\n# The License file in the root of the directory is the original\n# license file\n\n# code to retrieve documents\n\nimport logging\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom multiprocessing.pool import Thr... | [
[
"numpy.log",
"numpy.log1p",
"numpy.multiply",
"numpy.argsort",
"numpy.argpartition",
"scipy.sparse.csr_matrix",
"numpy.unique"
]
] |
ztmo520/MonoRec | [
"0e8ece0159bd82fb55791fbd2117396ecf1fbb0f"
] | [
"model/monorec/monorec_model.py"
] | [
"import time\n\nimport kornia.augmentation as K\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport torchvision\nfrom torch import nn\n\nfrom model.layers import point_projection, PadSameConv2d, ConvReLU2, ConvReLU, Upconv, Refine, SSIM, Backprojection\nfrom utils import conditional_flip, fil... | [
[
"torch.cat",
"torch.stack",
"torch.nn.LeakyReLU",
"torch.inverse",
"torch.ones",
"torch.nn.functional.pad",
"torch.sum",
"torch.nn.MaxPool2d",
"torch.abs",
"torch.logical_not",
"torch.tensor",
"torch.nn.functional.tanh",
"torch.device",
"numpy.array",
"t... |
shishaboy/epymetheus | [
"d8916b20c6b79e86e5aadb39c7c01a582659f03b"
] | [
"epymetheus/datasets/randomwalk.py"
] | [
"import numpy as np\nimport pandas as pd\n\nfrom epymetheus import Universe\n\n\ndef make_randomwalk(\n n_bars=1000,\n n_assets=10,\n volatility=0.01,\n name=\"RandomWalk\",\n bars=None,\n assets=None,\n seed=None,\n):\n \"\"\"\n Return Universe whose prices are random-walks.\n Daily r... | [
[
"pandas.DataFrame",
"numpy.random.lognormal"
]
] |
jonesholger/lbann | [
"3214f189a1438565d695542e076c4fa8e7332d34"
] | [
"scripts/plotting/print_times.py"
] | [
"import sys\nimport numpy as np\nimport load_events\n\ndef print_layer_times(filename, only_model = -1):\n \"\"\"Print a breakdown of runtimes for each layer in each model.\"\"\"\n results = load_events.load_values(\n filename,\n event_names=['minibatch_time', 'objective_evaluation_time', 'objective_differe... | [
[
"numpy.sum",
"numpy.mean"
]
] |
kobylkinks/LightAutoML | [
"4d62d2f52192aa3fb2d7841481339e35ef7f7f09"
] | [
"lightautoml/automl/presets/tabular_presets.py"
] | [
"\"\"\"Tabular presets.\"\"\"\n\nimport logging\nimport os\n\nfrom collections import Counter\nfrom copy import copy\nfrom copy import deepcopy\nfrom typing import Iterable\nfrom typing import Optional\nfrom typing import Sequence\nfrom typing import cast\n\nimport numpy as np\nimport pandas as pd\nimport torch\n\n... | [
[
"numpy.concatenate",
"numpy.array",
"pandas.arrays.DatetimeArray",
"torch.cuda.device_count",
"numpy.arange",
"pandas.concat",
"numpy.unique",
"torch.set_num_threads"
]
] |
Lanping-Tech/Enhanced-VIT | [
"90a0516f3b6f926d758f1f72b09ab20b60f722ea"
] | [
"models/vit.py"
] | [
"import torch\nfrom torch import nn\n\nfrom einops import rearrange, repeat\nfrom einops.layers.torch import Rearrange\n\n# helpers\n\ndef pair(t):\n return t if isinstance(t, tuple) else (t, t)\n\n# classes\n\nclass PreNorm(nn.Module):\n def __init__(self, dim, fn):\n super().__init__()\n self.... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.LayerNorm",
"torch.nn.Identity",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.Softmax",
"torch.nn.GELU",
"torch.matmul",
"torch.randn"
]
] |
mh3kh/pytorch | [
"c0e31d02d0fce2d99c09a8bef696acc431426718"
] | [
"torch/testing/_asserts.py"
] | [
"import collections.abc\nimport functools\nimport numbers\nimport sys\nfrom typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple, Type, TypeVar, Union, cast\nfrom types import SimpleNamespace\n\nimport torch\nfrom torch import Tensor\n\nfrom ._core import _unravel_index\n\n__all__ = [\"assert_equal\... | [
[
"torch.promote_types",
"torch.any",
"torch.max",
"torch.ne",
"torch.abs",
"torch.isclose",
"torch.as_tensor",
"torch.sum"
]
] |
LZH970328/heartrate_analysis_python | [
"38692a1c974e31a1b982ffe3a3cfe8d8cfb74c10"
] | [
"heartpy/heartpy.py"
] | [
"'''\nmain module for HeartPy.\n'''\n\nfrom datetime import datetime\nimport time\nimport os\nimport sys\n\nimport numpy as np\nfrom scipy.interpolate import UnivariateSpline\nfrom scipy.signal import butter, filtfilt, welch, periodogram, resample_poly, resample\n\nfrom . import exceptions\nfrom .datautils import g... | [
[
"numpy.asarray",
"numpy.percentile",
"numpy.mean",
"numpy.diff",
"numpy.where",
"numpy.power"
]
] |
jmtyszka/mrgaze | [
"29217eab9ea431686fd200f08bddd6615c45d0d3"
] | [
"build/lib/mrgaze/report.py"
] | [
"#!/usr/bin/env python\n#\n# Gaze tracking report generator\n# - collects info from subject/session results directory\n# - report placed in report subdirectory\n#\n# AUTHOR : Mike Tyszka\n# PLACE : Caltech\n# DATES : 2014-05-15 JMT From scratch\n#\n# This file is part of mrgaze.\n#\n# mrgaze is free software: ... | [
[
"numpy.median",
"numpy.arange",
"numpy.argmax"
]
] |
lasofivec/tofu | [
"dbb9f433290e3058dfd04d67fbca157761b0a105"
] | [
"tofu/data/_spectrafit2d.py"
] | [
"\n# Built-in\nimport os\nimport warnings\n\n# Common\nimport numpy as np\nimport scipy.optimize as scpopt\nimport scipy.constants as scpct\nimport scipy.sparse as sparse\nfrom scipy.interpolate import BSpline\nimport matplotlib.pyplot as plt\n\n\n# --------------\n# TO BE MOVED TO tofu.data... | [
[
"scipy.interpolate.BSpline",
"numpy.copy",
"numpy.exp",
"numpy.min",
"numpy.nanmean",
"numpy.size",
"numpy.max",
"numpy.full",
"numpy.concatenate",
"numpy.empty",
"numpy.nanmin",
"numpy.arange",
"numpy.nanmax",
"scipy.sparse.csr_matrix",
"numpy.nanstd",
... |
kishordgupta/NSA-VdetectorPython | [
"21cd5748befe7884cd52b4549afb24d95978fe2f"
] | [
"src/V-detector/algorithms/V_detector(robert).py"
] | [
"import matplotlib.animation as animation\nfrom scipy.integrate import odeint\nfrom numpy import arange\nfrom pylab import *\nimport matplotlib.pyplot as plt\nimport random\nfrom matplotlib.patches import Ellipse\n\nfig, ax = plt.subplots()\n#fig = figure()\nxlabel('x')\nylabel('y')\nz=8\n#circ = Ellipse((0.5, 0.5)... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.subplots"
]
] |
sridharswain/NeuroImpression | [
"ecd4c262fbbec1c45b6092ace27246a6b6b08bb4"
] | [
"server/personality.py"
] | [
"import sys\nimport ast\n# MYERS-BRIGGS PREDICTOR, WHEN BIG FIVE PERSONALITY TRAITS GIVEN AS INPUT\nFinancial_personality = []\n#Give this traits matrix as input\ndict_personality = {}\n\n\ndef personality_analyzer(traits_matrix):\n Personality_word_list = []\n traits_matrix = list(traits_matrix)\n e = tra... | [
[
"numpy.argmax"
]
] |
PauloRui/pythalesians | [
"a32f884a83476a6a6e7e77aa1a3f5f53468bad66"
] | [
"pythalesians/market/indices/indicesfx.py"
] | [
"__author__ = 'saeedamen' # Saeed Amen / saeed@thalesians.com\n\n#\n# Copyright 2015 Thalesians Ltd. - http//www.thalesians.com / @thalesians\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the\n# License. You may obtain a copy of the Licen... | [
[
"pandas.DataFrame"
]
] |
chalothon/word2veclite | [
"336786a96b0d7bca04268d8f65c928a7926c821b"
] | [
"word2veclite/test/test_word2veclite.py"
] | [
"import unittest\nfrom unittest import TestCase\nfrom word2veclite.word2veclite import Word2Vec\nimport numpy as np\nimport tensorflow as tf\n\n\nclass TestFunctions(TestCase):\n\n learning_rate = 0.1\n W1 = np.ones((7, 2))\n W2 = np.array([[0.2, 0.2, 0.3, 0.4, 0.5, 0.3, 0.2],\n [0.3, 0.,... | [
[
"tensorflow.exp",
"numpy.asmatrix",
"numpy.array",
"numpy.ones",
"tensorflow.Variable",
"tensorflow.Session",
"tensorflow.gradients",
"tensorflow.transpose",
"tensorflow.reshape",
"numpy.where",
"tensorflow.placeholder",
"tensorflow.name_scope",
"tensorflow.stac... |
wbazant/humann | [
"13e8c7910d9aff4cabb58df19aa652a3c20e101b"
] | [
"humann/tools/util.py"
] | [
"from __future__ import print_function # PYTHON 2.7+ REQUIRED\nimport os\nimport sys\nimport re\nimport subprocess\nimport csv\nimport gzip\nimport bz2\n\n# ---------------------------------------------------------------\n# utilities used by the split and join tables scripts\n# -------------------------------------... | [
[
"numpy.array"
]
] |
joshmiller17/icr | [
"9ae27ef5c67307cb18895d6870cfc263d6549883"
] | [
"krippendorf_library_sample.py"
] | [
"#!/usr/bin/env python\nimport krippendorff\nimport numpy as np\n\n\ndef main():\n print(\"Example from http://en.wikipedia.org/wiki/Krippendorff's_Alpha\")\n print()\n reliability_data_str = (\n \"* * * * * 3 4 1 2 1 1 3 3 * 3\", # coder A\n \"1 ... | [
[
"numpy.array"
]
] |
CooperControlsLab/CU-Home_feedback_controls | [
"c5f031bed00f1643b2e9dac74c3b336cb98d7d9e"
] | [
"python_code/angle_PID_no_GUI/daniel_plot.py"
] | [
"import matplotlib.pyplot as plt\nimport csv\nimport os \n \nos.chdir(r\"D:\\\\\") #Change directory\nx = []\ny1 = []\ny2 = []\n \ndef csv2list(input):\n with open(input,'r') as csvfile:\n next(csvfile, None)\n plots = csv.reader(csvfile, delimiter=',')\n for row in plots:\n x.app... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
HACC2018/Mea-Kanu | [
"d1db0ad428cc30f71d84e01641ecfc57361385ad"
] | [
"MeaKanu/03-CLASSIFICATION/ClassificationOutputTop5andTiles.py"
] | [
"from keras.models import model_from_json\r\nimport numpy as np\r\nimport os,cv2\r\nfrom keras.utils import np_utils\r\nimport csv\r\n\r\n#################################################################\r\n## PLANT\r\n\r\n# Define data path\r\ndata_pathp = 'D:/MeaKanu/01-SEGMENTATION/plant/a'\r\nimg_listp = sorted... | [
[
"numpy.array"
]
] |
aa10402tw/RealTime-Segmentation | [
"8c5cf13cd5570c48fa7bae9e6ec014989450889d"
] | [
"utils/metrics.py"
] | [
"from sklearn.metrics import confusion_matrix\nimport numpy as np\n\ndef iou(y_pred, y_true, labels):\n y_pred = y_pred.astype(np.int32).flatten()\n y_true = y_true.astype(np.int32).flatten()\n cm = confusion_matrix(y_true, y_pred, labels=labels)\n diag = np.diag(cm)\n sum_row = np.sum(cm, axis=0)\n ... | [
[
"numpy.sum",
"sklearn.metrics.confusion_matrix",
"numpy.diag"
]
] |
Slimane33/pennylane | [
"fe5d1dffa152fd34e4f9224df02eecb219affa06"
] | [
"tests/grouping/test_grouping_utils.py"
] | [
"# Copyright 2018-2020 Xanadu Quantum Technologies Inc.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by ap... | [
[
"numpy.all",
"numpy.array",
"numpy.zeros"
]
] |
furgerf/kaggle-projects | [
"e80a10fe01df2687adc7632bb2afaa0dcec05cbe"
] | [
"titanic/submissions/4/randomforest.py"
] | [
"import csv as csv\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom sklearn.ensemble import RandomForestClassifier\nimport re\n\nSEPARATOR = '-' * 80\nprint('')\nprint('')\nprint('')\nprint('')\nprint(SEPARATOR)\nprint('STARTING...')\nprint(SEPARATOR)\n\ndef load_data():\n train_df =... | [
[
"numpy.array",
"numpy.zeros",
"sklearn.ensemble.RandomForestClassifier",
"numpy.digitize",
"pandas.concat",
"pandas.read_csv",
"numpy.unique"
]
] |
st-walker/tfs | [
"7a229f4fecbf04d544c5116d79a281e4365ccd1d"
] | [
"tests/test_frame.py"
] | [
"import pathlib\nfrom collections import OrderedDict\nfrom functools import partial, reduce\n\nimport pandas as pd\nimport pytest\nfrom pandas._testing import assert_dict_equal\nfrom pandas.testing import assert_frame_equal\n\nimport tfs\nfrom tfs.frame import TfsDataFrame, concat, merge_headers, validate\n\nCURREN... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
zhoufengfan/vision-transformers-cifar10 | [
"bae0d6664f8c32d96e2166d8f6d6163e274d988e"
] | [
"models/network2.py"
] | [
"import torch.nn as nn\r\nimport torchvision\r\nimport cv2\r\nimport torch\r\nimport torchvision.transforms as transforms\r\n\r\n\r\nclass Network2(nn.Module):\r\n def __init__(self):\r\n super().__init__()\r\n self.resnet18 = torchvision.models.resnet18(pretrained=False)\r\n self.fc = nn.Li... | [
[
"torch.nn.Linear",
"torch.nn.ReLU",
"torch.unsqueeze"
]
] |
kintel/iree | [
"7dbe1aea471e880327694ffbfc0b536f1e587f2c"
] | [
"integrations/tensorflow/build_tools/testdata/generate_errors_module.py"
] | [
"# Lint as: python3\n# Copyright 2021 The IREE Authors\n#\n# Licensed under the Apache License v2.0 with LLVM Exceptions.\n# See https://llvm.org/LICENSE.txt for license information.\n# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n\"\"\"Generates sample models for excercising various function signatures... | [
[
"tensorflow.print",
"tensorflow.TensorSpec",
"tensorflow.saved_model.SaveOptions"
]
] |
zjukg/NeuralKG | [
"9fe97c29496ed08bc72c76e4dd71e72cbfbe5afa"
] | [
"src/neuralkg/lit_model/CompGCNLitModel.py"
] | [
"from logging import debug\nimport pytorch_lightning as pl\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nimport os\nimport json\nfrom collections import defaultdict as ddict\nfrom IPython import embed\nfrom .BaseLitModel import BaseLitModel\nfrom neuralkg.eval_task impor... | [
[
"torch.sum",
"torch.numel",
"torch.optim.lr_scheduler.MultiStepLR"
]
] |
hyjie-ts/Deep-Learning | [
"4cf1cc40f10aef2c3919bec9f7de11bf9eff8031"
] | [
"ppdet/data/source/voc.py"
] | [
"# Copyright (c) 2019 PaddlePaddle 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 re... | [
[
"numpy.array"
]
] |
benjiec/pychemy | [
"d45450ad11c93a3e06d80f8f2bd72777b77a1272"
] | [
"pychemy/chem_structure.py"
] | [
"from elements import ELEMENTS\nimport networkx as nx\nfrom collections import OrderedDict\nimport openbabel\nimport matplotlib.pyplot as plt\n\nclass chem_graph():\n\n def __init__(self, OBMol = None, graph = None, is_fragment = False, parent = None):\n G = None\n if OBMol:\n G = chem_graph.graph_from_... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close"
]
] |
tczhangzhi/nni | [
"85c0d841a6a15d64f32d8237e29616227fd03425"
] | [
"nni/retiarii/nn/pytorch/nn.py"
] | [
"import logging\nfrom typing import Any, List\n\nimport torch\nimport torch.nn as nn\n\nfrom ...utils import add_record, blackbox_module, uid, version_larger_equal\n\n_logger = logging.getLogger(__name__)\n\n# NOTE: support pytorch version >= 1.5.0\n\n__all__ = [\n 'LayerChoice', 'InputChoice', 'Placeholder',\n ... | [
[
"torch.cat",
"torch.tensor"
]
] |
guanrongLi/GNN_graph_classification | [
"227e0128fea0d8da9dad9bae32a95b553530c763"
] | [
"utilities.py"
] | [
"# -----------------------------------------------------------------------------\n# This file contains several utility functions for reproducing results \n# of the WWL paper\n#\n# October 2019, M. Togninalli\n# -----------------------------------------------------------------------------\nimport numpy as np\nimport... | [
[
"numpy.concatenate",
"numpy.array",
"torch.cat",
"sklearn.model_selection.StratifiedKFold",
"numpy.asarray",
"numpy.ones_like",
"numpy.fill_diagonal",
"numpy.dot",
"numpy.sum",
"sklearn.model_selection.ParameterGrid",
"numpy.identity",
"torch.squeeze",
"numpy.ar... |
huak95/attacut | [
"100333931023cd009daeddec0cba4cdfce3d0b68"
] | [
"attacut/models/__init__.py"
] | [
"# -*- coding: utf-8 -*-\nimport importlib\nimport re\n\nimport torch\nimport torch.nn as nn\n\nimport attacut\nfrom attacut import logger\n\nlog = logger.get_logger(__name__)\n\n\ndef get_device():\n if torch.cuda.is_available():\n return \"cuda\"\n else:\n return \"cpu\"\n\n\nclass Convolution... | [
[
"torch.nn.BatchNorm1d",
"torch.cuda.is_available",
"torch.load",
"torch.nn.Conv1d"
]
] |
endast/pygsheets | [
"a86599a0457903934f0795994996e16959e2a556"
] | [
"pygsheets/worksheet.py"
] | [
"# -*- coding: utf-8 -*-.\n\n\"\"\"\npygsheets.worksheet\n~~~~~~~~~~~~~~~~~~~\n\nThis module contains worksheet model\n\n\"\"\"\n\nimport datetime\nimport re\n\nfrom .cell import Cell\nfrom .datarange import DataRange\nfrom .exceptions import (IncorrectCellLabel, CellNotFound, InvalidArgumentValue, RangeNotFound)\n... | [
[
"pandas.DataFrame"
]
] |
infinity73/CascadeTabNet | [
"5f7d0cc3a7db8287c7313c26bb068d056811587c"
] | [
"Table Structure Recognition/main.py"
] | [
"from border import border\r\nfrom mmdet.apis import inference_detector, show_result, init_detector\r\nimport cv2\r\nfrom Functions.blessFunc import borderless\r\nimport lxml.etree as etree\r\nimport glob\r\nimport matplotlib.pyplot as plt\r\n\r\n############ To Do ############\r\nimage_path = '/content/CascadeTabN... | [
[
"matplotlib.pyplot.imread"
]
] |
Yuexiaoxi10/Key-Frame-Proposal-Network-for-Efficient-Pose-Estimation-in-Videos | [
"5e9a0d6b6edfc9ebacaa6f85c91b1d8494a285f0"
] | [
"test_jhmdb.py"
] | [
"import time\nfrom torch.utils.data import DataLoader, Dataset\nfrom torch.optim import lr_scheduler\n\nimport torch.nn as nn\nfrom modelZoo.DyanOF import creatRealDictionary\nfrom modelZoo.networks import keyframeProposalNet, load_preTrained_model\nfrom utils import *\n\nfrom JHMDB_dloader import *\nimport scipy.i... | [
[
"torch.utils.data.DataLoader"
]
] |
mnishida/PyMWM | [
"0fffa2717c37ea258655ab9bf5196208e2be8fd1"
] | [
"src/pymwm/slit/__init__.py"
] | [
"from __future__ import annotations\n\nimport cmath\nimport enum\nfrom logging import getLogger\n\nimport numpy as np\nimport psutil\nimport ray\n\nfrom pymwm.utils import slit_utils\nfrom pymwm.waveguide import Database, Sampling, Waveguide\n\nfrom .samples import Samples, SamplesForRay, SamplesLowLoss, SamplesLow... | [
[
"numpy.array",
"numpy.isnan",
"numpy.sin",
"numpy.zeros",
"numpy.ascontiguousarray",
"numpy.exp",
"numpy.sinc",
"numpy.cos",
"numpy.dstack"
]
] |
gigony/test_readthedocs | [
"e8c820ecda15aa59b50c1fe7674cbef00e24553d"
] | [
"monai/deploy/operators/dicom_seg_writer_operator.py"
] | [
"# Copyright 2021 MONAI Consortium\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# Unless required by applicable law or agreed to i... | [
[
"numpy.concatenate",
"numpy.count_nonzero",
"numpy.zeros",
"numpy.amax",
"numpy.amin",
"numpy.expand_dims",
"numpy.unique"
]
] |
spacetelescope/stsciutils | [
"85df1f215071a9c00a1e8cf3da823b5fedf8f2f2"
] | [
"stsciutils/tools/convertgeis.py"
] | [
"#!/usr/bin/env python\n\n# $Id: readgeis.py 10520 2010-10-11 16:39:49Z hack $\n\n\"\"\"\n convertgeis: Read GEIS file and convert it to a waivered-FITS file.\n\n License: http://www.stsci.edu/resources/software_hardware/pyraf/LICENSE\n\n Usage:\n\n convertgeis.py [options] GEISn... | [
[
"numpy.isinf",
"numpy.isnan",
"numpy.zeros",
"numpy.frexp",
"numpy.fromstring"
]
] |
ashwath92/MastersThesis | [
"f74755dc0c32f316da3c860dd5dbfa4c9cad97b3"
] | [
"Evaluation/OnlineEvaluation/metrics.py"
] | [
"import pandas as pd\nimport numpy as np\n\ndef binarize_predictions(relevant_list, predicted_list, importance=True):\n \"\"\" importance=True if the first ground truth is more important than the others\"\"\"\n #print(predicted_list)\n \"\"\"Returns 2 if the first entry is present in the predictions, 1 if ... | [
[
"numpy.sum",
"numpy.array",
"numpy.arange"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.