repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
Thijsvanede/Tiresias
[ "b007e19fb1bb5d073001aa156673c9dd382f939a" ]
[ "tiresias/__main__.py" ]
[ "import argparse\nimport torch\nimport warnings\nfrom argformat import StructuredFormatter\n\nfrom .preprocessor import Preprocessor\nfrom .tiresias import Tiresias\n\nif __name__ == \"__main__\":\n########################################################################\n# Parse argu...
[ [ "torch.cuda.is_available" ] ]
bm777/python-chatbot
[ "6883fa9b3e7b3802ff19bd0bd7384b809c02df64" ]
[ "chatbot_app/chatbot/botpredictor.py" ]
[ "# Copyright 2017 Bo Shao. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applica...
[ [ "tensorflow.placeholder", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.tables_initializer" ] ]
techthiyanes/vakyansh-tts
[ "b090eb0aa3b36cf19de99902da7caef959dad45b" ]
[ "src/glow_tts/train.py" ]
[ "import os\nimport json\nimport argparse\nimport math\nimport torch\nfrom torch import nn, optim\nfrom torch.nn import functional as F\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard import SummaryWriter\nimport torch.multiprocessing as mp\nimport torch.distributed as dist\nfrom apex.parallel...
[ [ "torch.distributed.init_process_group", "torch.no_grad", "torch.multiprocessing.spawn", "torch.cuda.device_count", "torch.manual_seed", "torch.cuda.set_device", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.utils.data.distributed.DistributedSampler", "tor...
Soriano-Trigueros/TDA-tutorial
[ "affc482d2b736281ea9c052f60fc085bed024d4b" ]
[ "DTM_filtrations.py" ]
[ "import numpy as np\nimport math\nimport random\nimport gudhi\nfrom sklearn.neighbors import KDTree\nfrom sklearn.metrics.pairwise import euclidean_distances\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\n\ndef DTM(X,query_pts,m):\n '''\n Compute the values of the DTM (with expon...
[ [ "numpy.concatenate", "numpy.random.normal", "numpy.sin", "numpy.random.rand", "numpy.zeros", "numpy.sum", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "numpy.multiply", "numpy.stack", "numpy.cos", "numpy.sqrt", "sklearn.neighbors.KDTree", "sklea...
catgloss/safe-control-gym
[ "b3f69bbed8577f64fc36d23677bf50027e991b2d" ]
[ "safe_control_gym/controllers/safe_explorer/safe_ppo_utils.py" ]
[ "\"\"\"Utility function for the PPO-based safe explorer.\n\n\"\"\"\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom gym.spaces import Box\n\nfrom safe_control_gym.math_and_models.neural_networks import MLP, CNN, RNN, init_\nfrom safe_control_gym.math_and_models.distributions import Normal, Categoric...
[ [ "torch.min", "torch.nn.Module.__init__", "torch.clamp", "torch.ones", "torch.exp" ] ]
wangwllu/spanning_attack
[ "5d2788f7264ad2718e68b0cfb14f11970c3f65ab" ]
[ "subattack/strategies/samplers.py" ]
[ "import torch\nfrom abc import ABC, abstractmethod\n\n\nclass Sampler(ABC):\n\n def __init__(self, device):\n self._device = device\n\n @abstractmethod\n def sample(sample_size):\n pass\n\n\nclass SphereSampler(Sampler):\n\n def __init__(self, shape, device, epsilon=1e-7):\n super()...
[ [ "torch.rand", "torch.randn" ] ]
parvatijay2901/FaceNet_FR
[ "406f1cba3285b39ecb4a36ff4ce709bcfc23dcff" ]
[ "Web/demos/read_frames_fast.py" ]
[ "# Modified from: \r\n# https://www.pyimagesearch.com/2017/02/06/faster-video-file-fps-with-cv2-videocapture-and-opencv/\r\n\r\n# Performance:\r\n# Python 2.7: 105.78 --> 131.75\r\n# Python 3.7: 15.36 --> 50.13\r\n\r\n# USAGE\r\n# python read_frames_fast.py --video videos/jurassic_park_intro.mp4\r\n\r\n...
[ [ "numpy.dstack" ] ]
GateNLP/NN_Framework
[ "b5f3fcb5a97a2ce8808fdb13f0d5cae3f853298d" ]
[ "XSModelManager/models/BERT_Simple.py" ]
[ "from transformers import BertModel\nfrom .miscLayer import SimpleHidden\nimport os\nimport torch.nn.functional as F\nimport torch\nimport torch.nn as nn\n\n\nclass BERT_Embedding(nn.Module):\n def __init__(self, config):\n super().__init__()\n\n self.trainable_layers = None\n if 'BERT' in c...
[ [ "torch.nn.Linear", "torch.sum" ] ]
sxie22/schnetpack
[ "a421e7c121c7bdb2838fb30f887812110ecfa3c6" ]
[ "src/schnetpack/task.py" ]
[ "from pathlib import Path\nfrom typing import Optional, Dict, List, Type, Any, Union\n\nimport pytorch_lightning as pl\nimport torch\nfrom torch import nn as nn\nfrom torchmetrics import Metric\n\nfrom schnetpack.model.base import AtomisticModel\n\n__all__ = [\"ModelOutput\", \"AtomisticTask\"]\n\n\nclass ModelOutp...
[ [ "torch.nn.ModuleDict", "torch.set_grad_enabled", "torch.nn.ModuleList" ] ]
sun1753814280/models
[ "e28e9e46b8d34ed0720a3d2c8eee24a504b7d0f4" ]
[ "research/deeplab/datasets/data_generator.py" ]
[ "# Lint as: python2, python3\n# Copyright 2018 The TensorFlow Authors All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/L...
[ [ "tensorflow.image.decode_jpeg", "tensorflow.data.TFRecordDataset", "tensorflow.gfile.Glob", "tensorflow.expand_dims", "tensorflow.FixedLenFeature", "tensorflow.image.is_jpeg", "tensorflow.constant", "tensorflow.image.decode_png", "tensorflow.logging.warning", "tensorflow.pa...
jlartey-aims/Resistivity
[ "94295102afc664c001f77c88f902772e06a467c0" ]
[ "examples/14-utils/plot_2D_data.py" ]
[ "\"\"\"\nPlotting 2D data\n================\n\nOften measured data is in 2D, but locations are not gridded.\nData can be vectoral, hence we want to plot direction and\namplitude of the vector. Following example use SimPEG's\nanalytic function (electric dipole) to generate data\nat 2D plane.\n\"\"\"\nfrom SimPEG imp...
[ [ "matplotlib.pyplot.colorbar", "numpy.random.randn", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "numpy.linspace", "matplotlib.pyplot.subplot" ] ]
lastmeta/sensorimotor
[ "93a7fb1080d5e835ae28242750e61174869b04fc" ]
[ "sensorimotor/envs/rubiks_cube.py" ]
[ "import copy\nimport time\nimport numpy as np\nnp.set_printoptions(precision=8, suppress=True, linewidth=400, threshold=100)\nimport gym\n\n\nclass RubiksCube(gym.Env):\n metadata = {'render.modes': ['human']}\n def __init__(self):\n super(RubiksCube, self).__init__()\n self.action_space = self....
[ [ "numpy.float64", "numpy.set_printoptions" ] ]
zarszz/vit-pytorch
[ "d93cd84ccdb338572fe978c08bd95ca93bee11cc" ]
[ "vit_pytorch/distill.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch import nn\nfrom vit_pytorch.vit import ViT\nfrom vit_pytorch.t2t import T2TViT\nfrom vit_pytorch.efficient import ViT as EfficientViT\n\nfrom einops import rearrange, repeat\n\n# helpers\n\ndef exists(val):\n return val is not None\n\n# classes\n\nclass ...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.LayerNorm", "torch.no_grad", "torch.nn.functional.log_softmax", "torch.nn.functional.cross_entropy", "torch.nn.functional.softmax", "torch.randn" ] ]
takuhirok/rGAN
[ "6f7a092de5814c662fd17224b3d48bebe7e03c2f" ]
[ "utils/visualizer.py" ]
[ "import os\n\nimport torch\nfrom torchvision import utils\n\n\nclass Visualizer():\n def __init__(self,\n netG,\n device,\n out,\n num_samples=10,\n num_columns=None,\n batch_size=100,\n range=(-1, 1))...
[ [ "torch.no_grad", "torch.cat", "torch.arange" ] ]
dreadbird06/vace_wpe
[ "3e9d9d9b0ebe3d3e360e678af5960ff23d57eae2" ]
[ "vace_wpe.py" ]
[ "\"\"\"\nauthor: Joon-Young Yang (E-mail: dreadbird06@gmail.com)\n\"\"\"\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom torch_custom.torch_utils import shape, to_gpu, to_arr\nfrom torch_custom.custom_layers import CustomModel, update_dict\n\nfrom torch_custom.stf...
[ [ "torch.device", "torch.stack", "torch.nn.MSELoss", "torch.nn.L1Loss", "torch.cuda.is_available", "torch.randn" ] ]
Rafiatu/scraper
[ "3974ca5b47c3b24032363c7339580bdb392eeeef" ]
[ "src/scraper/scraper.py" ]
[ "import pandas as pd\nimport requests\nimport math\nfrom bs4 import BeautifulSoup\n\n\nclass ScraperError(Exception):\n pass\n\n\nclass eBay:\n \"\"\"\n Holds everything related to extracting the relevant information\n from the website of interest.\n \"\"\"\n def __init__(self):\n s...
[ [ "pandas.DataFrame" ] ]
mackelab/brian2
[ "3a58c8e1ca87f70972aca24c6eeb78c539c190db" ]
[ "brian2/codegen/generators/numpy_generator.py" ]
[ "import itertools\n\nimport numpy as np\n\nfrom brian2.parsing.bast import brian_dtype_from_dtype\nfrom brian2.parsing.rendering import NumpyNodeRenderer\nfrom brian2.core.functions import DEFAULT_FUNCTIONS, timestep\nfrom brian2.core.variables import ArrayVariable\nfrom brian2.utils.stringtools import get_identifi...
[ [ "numpy.ceil", "numpy.random.rand", "numpy.random.poisson", "numpy.random.randn", "numpy.clip", "numpy.int32", "numpy.floor" ] ]
andim/optimmune
[ "cc9bcd8d17d6803c1f1d44786f7e7ae9d49c3ca5", "cc9bcd8d17d6803c1f1d44786f7e7ae9d49c3ca5" ]
[ "lib/mppaper.py", "fig5/fig5.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib\n\n# presentation colors\ncdarkprime = '#0E1E97'\ncmediumprime = '#3246e0'\nclightprime = '#e2e5fe'\ncdarkcomp = '#9b7c0f'\ncmediumcomp = '#f6c51c'\nclightcomp = '#fef8e2'\ncdarkgrey = '#303030'\ncmediumgrey = '#888888'\nclightgrey = '#e5e5e5'\...
[ [ "numpy.array", "matplotlib.rcParams.update" ], [ "matplotlib.gridspec.GridSpec" ] ]
torralba-lab/3j2
[ "042ea167e8d1f7cea196cd4fab7368e00aa925e6" ]
[ "dataset.py" ]
[ "import os\nimport pickle\nimport random\n\nfrom PIL import Image\nimport numpy as np\nimport pandas as pd\nimport torch\nimport torch.utils.data\nimport torchvision.transforms as transforms\n\n\nPAD, UNK, EOS = 0, 1, 2\nEOS_TOKS = {'.', '!'}\n\nclass RecipeDataset(torch.utils.data.Dataset):\n def __init__(self,...
[ [ "torch.LongTensor", "torch.FloatTensor", "pandas.read_hdf", "torch.from_numpy" ] ]
problemo55/LedWheel
[ "bdc500e9b36cc72110019b33ebbaf48db46b208f" ]
[ "mavlink-master/pymavlink/quaternion.py" ]
[ "#!/usr/bin/env python\n\n\n\"\"\"\nQuaternion implementation for use in pymavlink\n\"\"\"\n\nfrom __future__ import absolute_import, division, print_function\nimport numpy as np\nfrom .rotmat import Vector3, Matrix3\n\n__author__ = \"Thomas Gubler\"\n__copyright__ = \"Copyright (C) 2014 Thomas Gubler\"\n__license_...
[ [ "numpy.array", "numpy.sin", "numpy.trace", "numpy.dot", "numpy.zeros", "numpy.allclose", "numpy.finfo", "numpy.diag", "numpy.arctan2", "numpy.cos", "numpy.sqrt", "numpy.hstack", "numpy.cross" ] ]
CX000/sqlnet_inference_py36
[ "8ee44414b0f04a17d7df6a2b8413620095bac5ff" ]
[ "sqlnet/model/sqlnet.py" ]
[ "from __future__ import division\nimport json\nfrom time import time\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\nfrom .modules.word_embedding import WordEmbedding\nfrom .modules.aggregator_predict import AggPredictor\nfrom .modules....
[ [ "torch.nn.LogSoftmax", "numpy.array", "numpy.zeros", "torch.nn.Softmax", "torch.nn.Sigmoid", "torch.autograd.Variable", "torch.from_numpy", "numpy.argmax", "torch.nn.BCEWithLogitsLoss", "numpy.argsort", "torch.log", "torch.nn.CrossEntropyLoss" ] ]
wbadart/simplegcn
[ "1af6f9ce5c97c4ba15d8950b0dd692d89f4de871" ]
[ "tests.py" ]
[ "#!/usr/bin/env python3\n\n\"\"\"\ntests/test_model.py\n\nUnit tests of `simplegcn.model' module.\n\nWill Badart\ncreated: OCT 2018\n\"\"\"\n\nimport numpy as np\nfrom pytest import fixture\n\nfrom simplegcn import GCNLayer\nfrom simplegcn.demo import GCN, relu, softmax\n\n\nRANDOM_STATE = 0xdecafbad\nnp.random.see...
[ [ "numpy.max", "numpy.isinf", "numpy.array", "numpy.isnan", "numpy.random.seed", "numpy.sum", "numpy.exp" ] ]
anascacais/MLB-P5-P6
[ "b1db3a784d16c73a40e5c262d82c9db62e89bf5d" ]
[ "features/hrv_features.py" ]
[ "\nimport time\nimport pandas as pd\nimport numpy as np\n\nfrom numba import jit\n\nimport math\n\nfrom scipy.signal import welch\n\n\ndef pointecare_feats(nn):\n x1 = np.asarray(nn[:-1])\n x2 = np.asarray(nn[1:])\n\n # SD1 & SD2 Computation\n sd1 = np.std(np.subtract(x1, x2) / np.sqrt(2))\n sd2 = np...
[ [ "numpy.add", "numpy.asarray", "numpy.sum", "numpy.diff", "numpy.subtract", "numpy.sqrt", "scipy.signal.welch", "numpy.hstack", "numpy.argwhere" ] ]
rubenOliver/AIVA_2021_METAL_IMPERFECTIONS
[ "d33e2cf441c2e511c3082dd898b209ebf1aac813" ]
[ "server.py" ]
[ "# This code has been carried out for the Applications subject of the\n# Master's Degree in Computer Vision at the Rey Juan Carlos University\n# of Madrid.\n# Date: April 2021\n# Authors: Rubén Oliver, Ismael Linares and Juan Luis Carrillo\n\nfrom http.server import BaseHTTPRequestHandler\nimport socketserver\nimpo...
[ [ "numpy.frombuffer" ] ]
cinjon/playground
[ "ad9ec58b2157fa6102636e7f61ef9a712c507a90", "ad9ec58b2157fa6102636e7f61ef9a712c507a90" ]
[ "pommerman/research/qmix_agent.py", "pommerman/research/train_qmix.py" ]
[ "from research_agent import ResearchAgent\nfrom pommerman import characters\n\nimport torch\nimport torch.optim as optim\nfrom torch.autograd import Variable\nfrom copy import deepcopy\n\n\nclass QMIXMetaAgent(ResearchAgent):\n \"\"\"\n This agent acts as a wrapper for multiple QMIX-trained agents. The agent ...
[ [ "torch.optim.Adam" ], [ "torch.cat", "torch.cuda.manual_seed", "numpy.array", "torch.nn.MSELoss", "torch.autograd.Variable", "torch.FloatTensor", "numpy.mean", "torch.from_numpy", "torch.manual_seed", "numpy.std", "torch.cuda.empty_cache" ] ]
biosustain/gtfa
[ "5ad3bc7a5c5219defa47d69b61fb58e81b6a9caf" ]
[ "tests/test_fitting.py" ]
[ "import arviz as az\nimport pandas as pd\nimport pytest\n\nfrom src.fitting import run_stan\nfrom src.model_configuration import load_model_configuration\nfrom src.pandas_to_cmdstanpy import get_coords\n\n\ndef test_steady_state(model_small):\n \"\"\"\n Test that the results coming from the model satisfy stea...
[ [ "pandas.read_csv" ] ]
shijiale0609/Statistical-Computing-Methods
[ "e780746d5f1e4b475bf38eb15d9d825daf45ffa6", "e780746d5f1e4b475bf38eb15d9d825daf45ffa6", "e780746d5f1e4b475bf38eb15d9d825daf45ffa6" ]
[ "Homework/HW5/HW5_Software/Python Code/Hm5-4.py", "Homework/HW3/Python_code/plotFigures.py", "Homework/HW4_SHI_JIALE/HW4_SHI_JIALE_PythonCode/HW4P4.py" ]
[ "'''\nNicholas Geneva\nngeneva@nd.edu\nNovember 4, 2017\n'''\nimport sys\nimport random\nimport numpy as np\nimport scipy as sc\nimport matplotlib as mlp\nimport matplotlib.pyplot as plt\n\nfrom matplotlib import rc\nfrom scipy import special\nfrom scipy import stats\n\ndef particleFilter(nsteps, a, b, c, d):\n ...
[ [ "numpy.max", "numpy.random.normal", "numpy.log", "numpy.zeros", "numpy.sum", "numpy.exp", "matplotlib.pyplot.close", "matplotlib.rc", "matplotlib.pyplot.subplots", "numpy.take", "numpy.random.uniform", "numpy.sort", "numpy.argsort", "numpy.abs", "numpy.s...
fgerzer/gnn_acopf
[ "6446f05609f53788b012df3d57e7e7ef567db3a5" ]
[ "gnn_acopf/models/power_base_model.py" ]
[ "from torch.nn import functional as F\nimport torch\nfrom torch import nn\nfrom torch.nn.parameter import Parameter\nfrom torch.nn import init\n\n\ndef build_optimizer(model):\n optimizer = torch.optim.Adam(model.parameters(), lr=1e-3)\n lr_scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=1000...
[ [ "torch.zeros", "torch.optim.lr_scheduler.StepLR", "torch.isnan", "torch.ones", "torch.all", "torch.tensor", "torch.nn.init.uniform_", "torch.nn.init.zeros_", "torch.Tensor", "torch.sum" ] ]
dylancromer/orphics
[ "6a9acc051e0b3ce5a36cd2960cff01bd758819c7" ]
[ "orphics/catalogs.py" ]
[ "'''\nUtilities for dealing with galaxy catalogs, projecting catalogs into pixelated maps, etc.\n'''\n\n\nimport numpy as np\nfrom pixell import enmap,curvedsky\nimport healpy as hp\nfrom astropy.io import fits\nfrom orphics import maps\n\nclass Pow2Cat(object):\n def __init__(self,ells,clgg,clkg=None,clkk=None,...
[ [ "numpy.exp", "numpy.nanmean", "pandas.read_hdf", "numpy.cos", "numpy.histogram", "numpy.nan_to_num", "numpy.random.poisson", "numpy.logical_and", "scipy.optimize.fmin", "numpy.sqrt", "numpy.append", "numpy.vstack", "numpy.zeros", "numpy.nansum", "numpy.d...
oke-aditya/kaggle_submissions
[ "0aca072cb9a3a3a11f574c9dcc69804b7a5a5afe" ]
[ "Advanced/Melanoma_Classification/src/create_folds.py" ]
[ "import pandas as pd\nfrom collections import Counter\nfrom sklearn import model_selection\n\nif __name__ == \"__main__\":\n df = pd.read_csv(\"../input/train.csv\")\n df[\"kfold\"] = -1\n df = df.sample(frac=1).reset_index(drop=True)\n y = df[\"target\"].values\n kf = model_selection.StratifiedKFold...
[ [ "pandas.read_csv", "sklearn.model_selection.StratifiedKFold" ] ]
LucasFidon/fetal-brain-segmentation-partial-supervision-miccai21
[ "69506cbed21c7d04946020e0d09246610c8da6d4" ]
[ "src/image/inference_image.py" ]
[ "\"\"\"\n@brief The class InferenceImage aims at managing the aggregation\n of the patches prediction into a volume in the same space\n as the original input volume.\n\n@author Lucas Fidon (lucas.fidon@kcl.ac.uk)\n@date July 2021.\n\"\"\"\n\nimport numpy as np\n\nSUPPORTED_FUSION = ['uniform', 'gau...
[ [ "numpy.max", "numpy.array", "numpy.zeros_like", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.exp", "numpy.argmax", "numpy.linspace" ] ]
MastafaF/multilingual_similarity_compare
[ "6b3ccc0a239747c0f649e58d49088833c20b8b3c" ]
[ "src/lib/indexing.py" ]
[ "# Adapted from LASER repo\n# Mastafa Foufa <mastafa.foufa@hotmail.com>\n\n#!/usr/bin/python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n#\n# LASER...
[ [ "numpy.zeros", "numpy.memmap", "numpy.fromfile", "numpy.linspace", "numpy.dtype" ] ]
uw-bionlp/uwbionlp-parser
[ "2216b25521438d7ca53a6b717e5b2ed94731cf88" ]
[ "deident/nn/neuroner.py" ]
[ "import os\nimport matplotlib\nmatplotlib.use('Agg')\nimport pickle\nimport nn.train as train\nimport nn.dataset as ds\nfrom nn.entity_lstm import EntityLSTM\nfrom nn.conll_to_objects import conll_to_objects\nfrom nn.utils_nlp import load_pretrained_token_embeddings, brat_to_conll, convert_conll_from_bio_to_bioes\n...
[ [ "matplotlib.use", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.Session", "tensorflow.reset_default_graph", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer" ] ]
shuuji3/Cirq
[ "a9c1f6411431fa69aee58ea49c14df7974f59e7b" ]
[ "cirq/google/merge_interactions.py" ]
[ "# Copyright 2018 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.dot", "numpy.eye" ] ]
neutrinoceros/yt_astro_analysis
[ "35dac44b8a5b2e2fe3a48fa9e0d14cbd9e497c4d" ]
[ "yt_astro_analysis/halo_analysis/tests/test_halo_catalog.py" ]
[ "\"\"\"\nHaloCatalog answer tests\n\n\n\n\"\"\"\n\n# -----------------------------------------------------------------------------\n# Copyright (c) 2017, yt Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this softw...
[ [ "numpy.array" ] ]
justusschock/dl-utils
[ "be95707da9cb812a5f25a11f1469055e0b7abcd2", "be95707da9cb812a5f25a11f1469055e0b7abcd2" ]
[ "dlutils/models/gans/boundary_equilibrium/models.py", "dlutils/models/resnext.py" ]
[ "import torch\n\n\nclass Generator(torch.nn.Module):\n \"\"\"\n A Basic generator network\n \"\"\"\n\n def __init__(self, n_channels, latent_dim, img_size):\n \"\"\"\n\n Parameters\n ----------\n n_channels : int\n the number of image channels\n latent_dim :...
[ [ "torch.nn.Linear", "torch.nn.Tanh", "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.nn.Upsample", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm1d" ], [ "torch.nn.ReLU", "torch.nn.Sequential", "torch.nn.Linear" ] ]
awolant/DALI
[ "e7df0b255c59a118843bfe3ecaf317d7ee1ed6bb" ]
[ "dali/test/python/test_backend_impl_gpu.py" ]
[ "# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless req...
[ [ "numpy.full", "numpy.array", "numpy.random.rand" ] ]
msuherma/learning-reproducible-codes-vanderplas
[ "0185748d90a7905f9f48fcc3cfc02d347210c200" ]
[ "jupyterworkflow/tests/test_data.py" ]
[ "from jupyterworkflow.data import get_fremont_data\nimport pandas as pd\nimport numpy as np\n\ndef test_fremont_data():\n assert all(data.columns ==['Total', 'East', 'West']) #this is to make sure the columns are right\n assert isinstance(data.index, pd.DatetimeIndex)\n assert len(np.unique(data.index.time...
[ [ "numpy.unique" ] ]
maplewen4/Kubo_Demo
[ "cff2cd7fb704d0fb7b25bd0e4d10b1e88c12dcbe" ]
[ "kubo_demo_bowen/xixihaha.py" ]
[ "import numpy as np\nimport scipy.fftpack as fourier_transform\n\n\nclass Kubo(object):\n \"\"\"\n The kubo model contains all attributions: C(t), g(t), I(w)\n \n Attributes\n ----------\n tau : float\n The decay constant. Must be the same unit with time t. AUt is preferred.\n ...
[ [ "scipy.fftpack.fftfreq", "numpy.exp", "numpy.flipud", "scipy.fftpack.fft", "numpy.conj", "numpy.amax", "numpy.append", "numpy.column_stack" ] ]
caraya10/captum
[ "258928905875c18e85a2413b3bb97def1bfb730a" ]
[ "captum/attr/_core/neuron/neuron_feature_ablation.py" ]
[ "#!/usr/bin/env python3\nfrom typing import Any, Callable, List, Tuple, Union\n\nimport torch\nfrom torch.nn import Module\n\nfrom captum.log import log_usage\n\nfrom ...._utils.common import _verify_select_column\nfrom ...._utils.typing import BaselineType, TensorOrTupleOfTensorsGeneric\nfrom ..._utils.attribution...
[ [ "torch.no_grad" ] ]
fromm1990/GomapClustering
[ "de2a14c7ae3598f50c02439b176d419d4722a810" ]
[ "src/GoMapClustering/dbscan_fcm4dd.py" ]
[ "import numpy as np\r\nfrom pandas import DataFrame\r\nfrom sklearn.cluster import DBSCAN\r\n\r\nfrom GoMapClustering.AngularClustering import FCM4DDHard\r\nfrom GoMapClustering.base import GoMapClusterMixin\r\n\r\n\r\nclass DBSCANFCM4DD(GoMapClusterMixin):\r\n\r\n def __init__(\r\n self,\r\n c: in...
[ [ "pandas.DataFrame", "sklearn.cluster.DBSCAN" ] ]
fccaa/python-neo
[ "7d57dd8b5eb5facc2f48fcb4f4009b8f2a553cf6" ]
[ "neo/rawio/mearecrawio.py" ]
[ "\"\"\"\nClass for reading data from a MEArec simulated data.\n\nSee:\nhttps://mearec.readthedocs.io/en/latest/\nhttps://github.com/alejoe91/MEArec\nhttps://link.springer.com/article/10.1007/s12021-020-09467-7\n\nAuthor : Alessio Buccino\n\"\"\"\n\nfrom .baserawio import (BaseRawIO, _signal_channel_dtype, _unit_cha...
[ [ "numpy.where", "numpy.array" ] ]
Shivaliverma/Machine-Learning
[ "47c9397b42d828838140aea1e7e04c638a738935" ]
[ "4.Support_vector_machine.py" ]
[ "#!/usr/bin/env python3\n# -*-coding: utf-8-*-\n# Author : LiangjunFeng\n# Blog : http://my.csdn.net/Liangjun_Feng\n# GitHub : https://www.github.com/LiangjunFeng\n# File : support_vector_machine.py\n# Date : 2017/09/21 11:12\n# Version: 0.1\n# Description: support_vector_machine\n\nimport numpy\nimport cvxop...
[ [ "numpy.array", "numpy.dot", "numpy.linalg.norm", "numpy.zeros", "numpy.sum", "matplotlib.pyplot.title", "numpy.ones", "numpy.hstack", "matplotlib.pyplot.plot", "numpy.sign", "numpy.ravel", "numpy.outer", "matplotlib.pyplot.show", "numpy.vstack" ] ]
henrymoss/BOSS
[ "f19eaf7231ed007cce9e12fba0f7f936eb48cfdb" ]
[ "boss/code/parameters/candidate_parameter.py" ]
[ "import itertools\nfrom typing import Iterable, Union, Tuple, List\nimport numpy as np\nfrom emukit.core.parameter import Parameter\n\n\nclass CandidateStringParameter(Parameter):\n \"\"\"\n A class for string inputs consisting of a set of valid strings\n \"\"\"\n def __init__(self, name: str, candidate...
[ [ "numpy.array", "numpy.random.randint" ] ]
Minou21/horus-ner
[ "3b8887511696786cd2658094222909cedef25494" ]
[ "experiments/util/eval.py" ]
[ "import csv\nimport itertools\nimport logging\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom sklearn.metrics import confusion_matrix\nfrom horus.core.util import definitions\nfrom horus.core.feature_extraction import Core\n\n\ndef confusion_matrix_analysis(horus_matrix):\n df = p...
[ [ "sklearn.metrics.confusion_matrix", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.text", "pandas.DataFrame", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplo...
benjaminaaron/GO_DILab
[ "20630d1a1d513a25de20b2edaeeac097a1b53be4", "20630d1a1d513a25de20b2edaeeac097a1b53be4", "20630d1a1d513a25de20b2edaeeac097a1b53be4", "20630d1a1d513a25de20b2edaeeac097a1b53be4" ]
[ "src/explore/go_dqn.py", "src/learn/dev_yu/learn_old.py", "src/learn/bots/_32/bot.py", "src/learn/bots/_12/bot.py" ]
[ "# Reinforcement Learning (DQN) tutorial\n# =====================================\n\nimport gym\nimport math\nimport random\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom collections import namedtuple\nfrom itertools import count\nfrom copy import deepcopy\nfrom PIL import Image\n\nim...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.functional.smooth_l1_loss", "torch.cuda.is_available", "matplotlib.pyplot.gcf", "torch.nn.Softmax", "torch.autograd.Variable", "torch.FloatTensor", "torch.zeros", "numpy.array", "matplotlib.pyplot.title", "matplotlib.pyplot....
kevinyamauchi/stardist
[ "951e1ba413d32e883ad1e0f620a1fe149ca00d74", "951e1ba413d32e883ad1e0f620a1fe149ca00d74" ]
[ "stardist/big.py", "tests/test_model2D.py" ]
[ "import numpy as np\nimport warnings\nimport math\nfrom tqdm import tqdm\nfrom skimage.measure import regionprops\nfrom skimage.draw import polygon\nfrom csbdeep.utils import _raise, axes_check_and_normalize, axes_dict\nfrom itertools import product\n\nfrom .geometry import polygons_to_label_coord, polyhedron_to_la...
[ [ "numpy.concatenate", "numpy.max", "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.min", "numpy.stack", "numpy.isscalar", "numpy.issubdtype", "numpy.unique" ], [ "numpy.tile", "numpy.count_nonzero", "scipy.ndimage.rotate", "matplotlib.pyplot.tigh...
hahaxun/mmf
[ "6d32c3925ed9bf938e19a071aaa5e72a5cf01ee1" ]
[ "multimodelity/models/mmbt.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\n# MMBTModel, ModalEmbeddings is copied from [1]\n# as we have internal dependency on transformers v2.3.\n# These will be removed when we upgrade to package v2.5+.\n# [1]: https://github.com/huggingface/transformers/blob/master/src/transformers/modeling_mmbt.py ...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "torch.cat", "torch.arange", "torch.gather", "torch.ones", "torch.jit.is_scripting", "torch.tensor", "torch.nn.CrossEntropyLoss" ] ]
spyglass700/blue-marlin
[ "b2e4689b2ebc0966db6a96f6c5ecb4478998d605" ]
[ "Model/predictor_dl_model/predictor_dl_model/trainer/client_rest.py" ]
[ "\"\"\"\nA client that talks to tensorflow_serving loaded with kaggle model.\n\nThe client read kaggle feature data set, queries the service with\nsuch feature data to get predictions, and calculates the inference error rate.\n\n\"\"\"\n\nimport pickle\nimport json\nimport requests\nimport numpy as np\nfrom predict...
[ [ "numpy.concatenate", "numpy.zeros_like", "numpy.isnan", "numpy.add", "numpy.median", "pandas.date_range", "numpy.tile", "numpy.mean", "numpy.take", "pandas.DateOffset", "numpy.std", "numpy.stack", "numpy.subtract", "numpy.expm1", "numpy.expand_dims", ...
alvations/yanmtt
[ "9da45055e95f6e66faa17306ad79630071b84d9e" ]
[ "train_nmt.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2021 National Institute of Information and Communication Technology (Raj Dabre)\n# \n# Permission is hereby granted, free of charge, to any person\n# obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the\n# Software without r...
[ [ "torch.cuda.amp.autocast", "torch.distributed.destroy_process_group", "torch.distributed.init_process_group", "torch.save", "torch.no_grad", "torch.multiprocessing.spawn", "torch.nn.parallel.DistributedDataParallel", "torch.ones", "torch.manual_seed", "torch.cuda.set_device...
Dimbinantenaina/computervision-recipes
[ "44c0906e583169f3c313985bdf17f54243542375" ]
[ "utils_cv/segmentation/model.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\nfrom functools import partial\nfrom pathlib import Path\nfrom typing import List, Union\n\nfrom fastai.basic_data import DeviceDataLoader\nfrom fastai.basic_train import Learner\nimport numpy as np\nimport PIL\nfrom skl...
[ [ "numpy.array", "sklearn.metrics.confusion_matrix", "numpy.asarray", "numpy.mean", "numpy.diag" ] ]
robin-qu/Movie-Recommender
[ "728bfdb8e5ec2aac1c51372bd98f55cb446887f8" ]
[ "dataOverview/dataset_analysis.py" ]
[ "\"\"\"\nMovie Recommender Project\nHongbin Qu\nThis program examines the basic infomation of the datasets\nand generates some plots\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nlinks = '../dataset/links.csv'\nmovies = '../dataset/movies.csv'\nratings = '../dataset/ratings....
[ [ "numpy.zeros", "numpy.sum", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.where", "matplotlib.pyplot.hist", "numpy.arange", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "numpy.var", "matplotlib.pyplot.show...
Sundrops/mmdetection
[ "d3cf38d91c454b1a6881e8c36c1e4a66dc5521b8" ]
[ "mmdet/models/dense_heads/anchor_head.py" ]
[ "import torch\nimport torch.nn as nn\nfrom mmcv.cnn import normal_init\nfrom mmcv.runner import force_fp32\n\nfrom mmdet.core import (anchor_inside_flags, build_anchor_generator,\n build_assigner, build_bbox_coder, build_sampler,\n images_to_levels, multi_apply, multicl...
[ [ "torch.zeros_like", "torch.nn.Conv2d", "torch.cat" ] ]
Aamer98/FeatureNorm
[ "fbf3d3b4cef81b3351347d272eb51b6cdd9f0cc5", "fbf3d3b4cef81b3351347d272eb51b6cdd9f0cc5" ]
[ "old_code/noBN_twoModel_BN_CEcopy_1e3.py", "old_code/noBN_twoModel_BN_mse.py" ]
[ "import random\nimport math\nimport copy\nfrom datasets import miniImageNet_few_shot, tiered_ImageNet_few_shot, ImageNet_few_shot\nfrom collections import OrderedDict\nimport warnings\nimport models\nimport time\nimport data\nimport utils\nimport sys\nimport numpy as np\nimport os\nimport argparse\nfrom tqdm import...
[ [ "torch.nn.Linear", "torch.device", "torch.cat", "torch.cuda.manual_seed", "torch.nn.MSELoss", "numpy.random.seed", "torch.save", "torch.no_grad", "torch.manual_seed", "torch.cuda.empty_cache", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.opti...
ErikBertolino/Anomaly-Detection
[ "edd14ccf3015d3bca48bd55b5b0d4aa98c98ff85" ]
[ "source/loss_functions.py" ]
[ "import torch\n\n#Nota bene: In training, the average of losses in each batch is returned. \n#In testing, this is not the case.\n\ndef loss_enc(z_code, z_code_hat, test):\n \n if(test):\n l_enc = torch.sum((z_code - z_code_hat)**2, dim=(1))\n else: \n l_enc = torch.sum((z_code - z_code_ha...
[ [ "torch.abs", "torch.mean", "torch.sum" ] ]
LvJC/SOLO
[ "422f9114a052d825e414be90c6995f8e7fee4c52" ]
[ "mmdet/datasets/custom.py" ]
[ "import mmcv\nimport numpy as np\nimport os.path as osp\nfrom torch.utils.data import Dataset\n\nfrom .pipelines import Compose\nfrom .registry import DATASETS\n\n\n@DATASETS.register_module\nclass CustomDataset(Dataset):\n \"\"\"Custom dataset for detection.\n\n Annotation format:\n [\n {\n ...
[ [ "numpy.where", "numpy.random.choice" ] ]
betatim/hcrystalball
[ "693b9b406f05afa23cfc4647c43260166a7076fe" ]
[ "src/hcrystalball/ensemble/_simple_ensemble.py" ]
[ "import pandas as pd\nfrom sklearn.base import BaseEstimator\n\nfrom hcrystalball.utils import check_X_y\nfrom hcrystalball.utils import enforce_y_type\nfrom hcrystalball.utils import check_fit_before_predict\nfrom hcrystalball.utils import get_estimator_name\nfrom hcrystalball.exceptions import DuplicatedModelName...
[ [ "pandas.DataFrame" ] ]
patrickphatnguyen/TIRG-Vietnamese
[ "4df1558e578415db6102bc05a116fb5a78cbb7d1" ]
[ "img_text_composition_models.py" ]
[ "# Copyright 2019 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicab...
[ [ "torch.nn.Linear", "torch.nn.functional.sigmoid", "torch.cat", "torch.nn.Dropout", "torch.nn.MSELoss", "torch.autograd.Variable", "torch.nn.BatchNorm2d", "torch.nn.functional.adaptive_avg_pool2d", "numpy.random.shuffle", "torch.nn.ReLU", "torch.nn.functional.cross_entro...
fatalfeel/DeblurGAN
[ "cc4ccf09d23b91389dbea70a34797cb80331819c" ]
[ "datasets/aligned_dataset.py" ]
[ "import os.path\nimport random\nimport torchvision.transforms as transforms\nimport torch\nimport torch.utils.data as data\nfrom data.image_folder import make_dataset\nfrom PIL import Image\n\nclass AlignedDataset(data.Dataset):\n def __init__(self, opt):\n # super(AlignedDataset,self).__init__(opt)\n ...
[ [ "torch.LongTensor" ] ]
a-r-j/graphein
[ "f2dd884915e621e6a5e233f1a4564bf613fbdc81" ]
[ "graphein/ml/conversion.py" ]
[ "from __future__ import annotations\n\nfrom typing import List, Literal, Optional, TypeVar\n\nimport networkx as nx\nimport numpy as np\nimport torch\n\nfrom graphein.utils.utils import import_message\n\ntry:\n from torch_geometric.data import Data\nexcept ImportError:\n import_message(\n submodule=\"g...
[ [ "numpy.array", "numpy.asarray" ] ]
onnx/sklearn-onnx
[ "befbc94340f062c73348a98ae553bd43fb71d276" ]
[ "skl2onnx/operator_converters/multioutput.py" ]
[ "# SPDX-License-Identifier: Apache-2.0\n\nimport numpy as np\nfrom ..common._registration import register_converter\nfrom ..common._topology import Scope, Operator\nfrom ..common._container import ModelComponentContainer\nfrom ..algebra.onnx_ops import (\n OnnxConcat, OnnxReshapeApi13, OnnxIdentity)\ntry:\n f...
[ [ "numpy.array" ] ]
Hydroxy-OH/pytorch-yolo3
[ "9b874384508ba6e82b4c8064129f925f07ae9942" ]
[ "darknet.py" ]
[ "import numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom cfg import *\nfrom region_loss import RegionLoss\nfrom yolo_layer import YoloLayer\n\n#from layers.batchnorm.bn import BN2d\n\n\nclass MaxPoolStride1(nn.Module):\n def __init__(self):\n super(MaxPoolStride1, ...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.nn.SmoothL1Loss", "torch.nn.functional.pad", "torch.nn.functional.avg_pool2d", "torch.nn.Softmax", "torch.nn.MaxPool2d", "torch.IntTensor", "torch.nn.function...
zgjslc/Film-Recovery-master1
[ "4497a9930398c9e826ac364056a79e5bcbf6c953" ]
[ "utils/loss_deform.py" ]
[ "# coding: utf-8\n# filename: loss_deform.py\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn import SmoothL1Loss\nfrom dataloader.bw2deform import deform2bw_tensor_batch\nfrom dataloader.data_process import reprocess_t2t_auto\nfrom dataloader.bw_mapping import bw_mapping_tensor_batch\nfrom evaluater.eval_ssim...
[ [ "torch.nn.MSELoss", "torch.nn.AvgPool2d", "torch.std", "torch.ones", "torch.nn.SmoothL1Loss", "torch.ones_like", "torch.zeros_like", "torch.mean" ] ]
unifuzz/metrics
[ "5d7f926b0d02c50652e6042624b3a9322c1267ec" ]
[ "code/plot_boxplot_bug_realword_all.py" ]
[ "import os\r\nimport shutil\r\nimport matplotlib.pyplot as plt \r\nimport matplotlib\r\nimport numpy as np \r\nimport scipy.stats as stats\r\nimport scipy.optimize as opt\r\nimport pandas as pd \r\nimport random\r\nimport xlrd\r\nimport seaborn as sns\r\nfrom pprint import pprint\r\nfrom pandas.core.frame import Da...
[ [ "matplotlib.gridspec.GridSpecFromSubplotSpec", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.MaxNLocator", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "m...
scpepper69/ml-object-detection
[ "13c16d9be7a67bdb1bf5e63d5e36cad0a3d4aafd", "13c16d9be7a67bdb1bf5e63d5e36cad0a3d4aafd" ]
[ "tf_tutorial/app/app/camera_gp.py", "human_face/app/app/camera_pb.py" ]
[ "import numpy as np\nimport os\nimport cv2\nimport time\n\nfrom object_detection.utils import label_map_util\nfrom object_detection.utils import visualization_utils as vis_util\n\nfrom graphpipe import remote\n\nlabel_file='mscoco_label_map.pbtxt'\ncategory_index = label_map_util.create_category_index_from_labelmap...
[ [ "numpy.expand_dims" ], [ "tensorflow.Graph", "tensorflow.Session", "tensorflow.import_graph_def", "tensorflow.GraphDef", "numpy.expand_dims" ] ]
tonyjo/nyu-ta2
[ "b7a7904a1e67d0eeebf82d5095f77df0e0401b1b" ]
[ "d3m_ta2_nyu/parameter_tuning/bayesian.py" ]
[ "import logging\nimport numpy as np\nfrom smac.configspace import ConfigurationSpace\nfrom ConfigSpace.hyperparameters import IntegerHyperparameter, FloatHyperparameter, CategoricalHyperparameter, \\\n OrdinalHyperparameter\nfrom smac.facade.smac_facade import SMAC\nfrom smac.scenario.scenario import Scenario\nf...
[ [ "numpy.random.RandomState" ] ]
Xiao9905/P-tuning-v2
[ "0dddbafed3d70194701756d1ccd1c952c69dea99" ]
[ "tasks/superglue/dataset.py" ]
[ "from datasets.load import load_dataset, load_metric\nfrom transformers import (\n AutoTokenizer,\n DataCollatorWithPadding,\n EvalPrediction,\n default_data_collator,\n)\nimport numpy as np\nimport logging\nfrom collections import defaultdict\n\ntask_to_keys = {\n \"boolq\": (\"question\", \"passage...
[ [ "sklearn.metrics.f1_score", "numpy.argmax" ] ]
HitLuca/Incremental-Predictive-Monitoring-of-Business-Processes-with-A-priori-knowledge
[ "4090b622ae8b316aa2de41a3779240136fc92656" ]
[ "src/evaluation/prepare_data.py" ]
[ "\"\"\"\nThis script prepares data in the format for the testing\nalgorithms to run\n\nAuthor: Anton Yeshchenko\n\"\"\"\n\nfrom __future__ import division\n\nimport copy\nimport csv\nimport re\nimport time\n# from collections import Counter\nfrom datetime import datetime\nfrom itertools import izip\n\nimport numpy ...
[ [ "numpy.math.exp", "numpy.zeros", "numpy.mean", "numpy.argsort", "numpy.cumsum" ] ]
lingxiao-he/fast-reid
[ "df5ad9469b38b8176121357fe5de2b1cf30aae1c" ]
[ "fastreid/solver/optim/ralamb.py" ]
[ "####\n# CODE TAKEN FROM https://github.com/mgrankin/over9000\n####\n\nimport torch, math\nfrom torch.optim.optimizer import Optimizer\n\n# RAdam + LARS\nclass Ralamb(Optimizer):\n\n def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0):\n defaults = dict(lr=lr, betas=betas, ep...
[ [ "torch.zeros_like" ] ]
xlDownxl/SfmLearner-Pytorch
[ "e04becc8f16725d15cb603f4cf438a6059aa8adf" ]
[ "datasets/pair_folders.py" ]
[ "import torch.utils.data as data\nimport numpy as np\nfrom imageio import imread\nfrom path import Path\nimport random\nimport os\n\n\ndef load_as_float(path):\n return imread(path).astype(np.float32)\n\n\nclass PairFolder(data.Dataset):\n \"\"\"A sequence data loader where the files are arranged in this way:...
[ [ "numpy.random.seed", "numpy.copy", "numpy.linalg.inv" ] ]
ashlylau/adversarial-robustness-toolbox
[ "0ab24714db39f0d7e428e57f4eb6f9c0d34ca898" ]
[ "examples/cifar.py" ]
[ "import sys\nimport os\nimport numpy as np\nimport argparse\nimport time\nimport json\nfrom pathlib import Path\n\nimport argparse\nimport os\nimport shutil\nimport sys\n\nimport numpy as np\nimport torch\nimport random \nrandom.seed(42)\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data\n...
[ [ "torch.nn.Linear", "numpy.mean", "torch.load", "numpy.cos", "torch.nn.CrossEntropyLoss", "numpy.concatenate", "numpy.empty", "torch.nn.AvgPool2d", "sklearn.metrics.accuracy_score", "numpy.argmax", "torch.utils.data.DataLoader", "numpy.append", "torch.nn.Flatten"...
JamesBrofos/Iliad
[ "2220e1e519f479e402072f80f4bc67e419842c4e" ]
[ "iliad/proposals/coupled_leapfrog_proposal.py" ]
[ "from typing import Callable, Tuple\n\nimport numpy as np\n\nfrom odyssey.distribution import Distribution\n\nfrom iliad.integrators.info import CoupledInfo\nfrom iliad.integrators.vectors import coupled_leapfrog\nfrom iliad.integrators.vectors.vector_fields import riemannian_vector_field, softabs_vector_field\nfro...
[ [ "numpy.zeros_like" ] ]
GorAlexander/pandas
[ "60a3389d06ffe79d0d9950f9530afa11f997ce37" ]
[ "pandas/core/internals/array_manager.py" ]
[ "\"\"\"\nExperimental manager based on storing a collection of 1D arrays\n\"\"\"\nfrom __future__ import annotations\n\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n Hashable,\n TypeVar,\n)\n\nimport numpy as np\n\nfrom pandas._libs import (\n NaT,\n lib,\n)\nfrom pandas._typing im...
[ [ "pandas.core.dtypes.common.is_datetime64_ns_dtype", "pandas.core.indexes.api.ensure_index", "pandas.core.construction.extract_array", "pandas._libs.lib.is_integer", "pandas.core.internals.blocks.ensure_block_shape", "pandas.core.dtypes.cast.ensure_dtype_can_hold_na", "pandas.core.dtype...
vanyoleyang/seqhand
[ "576a444bab8e3094a5970a9840b0be6a6b94d6d9" ]
[ "gen_sequential_synth_data.py" ]
[ "import torch\nimport cv2\nimport imageio\nimport pickle\nimport os\nfrom tqdm import tqdm\n\nfrom numpy.linalg import norm\n\nfrom Encoder_BH2MANO import Encoder_BH2MANO\nfrom gen_3d_pose_flow import *\n\nfrom manopth.manolayer import ManoLayer\n\nfrom opendr.renderer import ColoredRenderer\nfrom opendr.camera imp...
[ [ "torch.rand", "torch.tensor", "torch.load" ] ]
OptiMaL-PSE-Lab/Expensive-Black-Box-Optim-ChemEng
[ "19c34dcff8c983926df501b93152fa3b3b0305d6" ]
[ "case_studies/Controller_tuning/Control_system.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Feb 11 13:31:22 2021\n\n@author: dv516\n\"\"\"\n\nimport numpy as np\nfrom scipy.integrate import solve_ivp\nimport matplotlib.pyplot as plt\n\ndef sys_model(t, x, u):\n \"\"\"Function modelling the dynamic behaviour of the system in question with a control term u...
[ [ "numpy.random.normal", "numpy.array", "numpy.sum", "numpy.exp", "scipy.integrate.solve_ivp" ] ]
cni-md/nipype
[ "ca3cf74d21a17f3c67dce38783fd05a742116aa3" ]
[ "nipype/algorithms/confounds.py" ]
[ "# -*- coding: utf-8 -*-\n# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n'''\nAlgorithms to compute confounds in :abbr:`fMRI (functional MRI)`\n'''\nfrom __future__ import (print_function, division, unicode_literals,\n absol...
[ [ "numpy.median", "scipy.linalg.svd", "matplotlib.backends.backend_pdf.FigureCanvasPdf", "numpy.mean", "numpy.where", "numpy.apply_along_axis", "numpy.linalg.lstsq", "numpy.cos", "numpy.zeros_like", "numpy.nan_to_num", "numpy.eye", "numpy.arange", "numpy.sqrt", ...
faroit/bat_beamshapes
[ "9c2919b4e56dbd0cfc1039edc608ce1592b78df3" ]
[ "beamshapes/utilities.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nUtility functions \n=================\nFunctions that helps with formatting shape and converting between object types.\n\n\"\"\"\nimport mpmath\nimport numpy as np \n\n\ndB = lambda X : 20*np.log10(np.abs(X))\n\ndef args_to_str(**args):\n '''\n Convert...
[ [ "numpy.abs" ] ]
jafermarq/speechbrain
[ "b640e366dd0daa713ac2d7d19b77fbf7ed38486c" ]
[ "speechbrain/nnet/loss/stoi_loss.py" ]
[ "# ################################\r\n# From paper: \"End-to-End Waveform Utterance Enhancement for Direct Evaluation\r\n# Metrics Optimization by Fully Convolutional Neural Networks\", TASLP, 2018\r\n# Authors: Szu-Wei, Fu 2020\r\n# ################################\r\n\r\nimport torch\r\nimport torchaudio\r\nimpo...
[ [ "torch.zeros", "torch.min", "torch.max", "torch.square", "torch.norm", "numpy.hanning", "torch.linspace", "torch.sum", "numpy.finfo", "torch.squeeze", "torch.matmul", "torch.mean", "torch.pow" ] ]
vpicavet/LoopStructural
[ "cde34fabc53b4d5cb0f8e22f53a574fac44dfbd6" ]
[ "LoopStructural/utils/utils.py" ]
[ "import logging\n\nimport numpy as np\nimport re\nfrom LoopStructural.utils import getLogger\nlogger = getLogger(__name__)\n\n\ndef strike_symbol(strike):\n R = np.zeros((2, 2))\n R[0, 0] = np.cos(np.deg2rad(-strike))\n R[0, 1] = -np.sin(np.deg2rad(-strike))\n R[1, 0] = np.sin(np.deg2rad(-strike))\n ...
[ [ "numpy.deg2rad", "numpy.fromfile", "numpy.array", "numpy.zeros" ] ]
CSMMLab/neuralEntropyClosures
[ "5efc5961f2fac36921a749d35f3636c61d1cc873" ]
[ "experimental/dataPlotter.py" ]
[ "'''\nsmall script to plot cpp output\n'''\n\nimport csv\n\nfrom mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import\nimport matplotlib.pyplot as plt\nfrom matplotlib import cm\nimport numpy as np\nimport pandas as pd\nimport time\nfrom src import utils\n\nplt.style.use(\"kitish\")\n\n\ndef main():\n ...
[ [ "numpy.sin", "matplotlib.pyplot.xlim", "matplotlib.pyplot.contourf", "numpy.zeros", "numpy.random.rand", "numpy.random.seed", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "ma...
jeff7021/organseg_dags
[ "2ba7deb90836aaf8e0e35d879fd00b65787bb491" ]
[ "models/unet.py" ]
[ "import os\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom torchsummary import summary\r\n\r\nclass UNet3D(nn.Module):\r\n def __init__(self, in_channels, out_channels, interpolate=True, conv_layer_order='cbr', init_ch=16):\r\n super(UNet3D, self).__init__()\r\n\r\n ...
[ [ "torch.cat", "torch.nn.MaxPool3d", "torch.nn.functional.interpolate", "torch.nn.GroupNorm", "torch.nn.ReLU", "torch.nn.Dropout3d", "torch.cuda.is_available", "torch.nn.Conv3d", "torch.nn.BatchNorm3d", "torch.nn.ConvTranspose3d" ] ]
yuvalkirstain/pytorch-lightning
[ "ac1744242104a2f6a46a3d211723e4dbf90ad544" ]
[ "tests/models/test_amp.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.is_autocast_enabled", "torch.cuda.is_available", "torch.optim.lr_scheduler.StepLR" ] ]
jeongyoonlee/audiomentations
[ "7f0112ae310989430e0ef7eb32c4116114810966" ]
[ "audiomentations/augmentations/transforms.py" ]
[ "import functools\nimport os\nimport random\nimport sys\nimport tempfile\nimport uuid\nimport warnings\n\nimport librosa\nimport numpy as np\nfrom scipy.signal import butter, sosfilt, convolve\n\nfrom audiomentations.core.audio_loading_utils import load_sound_file\nfrom audiomentations.core.transforms_interface imp...
[ [ "numpy.ones_like", "numpy.minimum", "numpy.copy", "scipy.signal.convolve", "numpy.concatenate", "numpy.random.normal", "numpy.zeros_like", "numpy.array", "numpy.zeros", "scipy.signal.sosfilt", "numpy.percentile", "numpy.roll", "numpy.random.randn", "numpy.st...
AllOtherUserNamesTaken/PyFVCOM
[ "46b00c66c3802f27d73c2c3009291c75b449aad6" ]
[ "PyFVCOM/validation.py" ]
[ "\"\"\"\nValidation of model outputs against in situ data stored and extracted from a database.\n\nThis also includes the code to build the databases of time series data sets.\n\n\"\"\"\n\nimport datetime as dt\nimport glob as gb\nimport os\nimport sqlite3 as sq\nimport subprocess as sp\n\nimport matplotlib.path as...
[ [ "numpy.max", "numpy.asarray", "numpy.copy", "numpy.min", "numpy.mean", "matplotlib.pyplot.figure", "numpy.interp", "numpy.std", "numpy.any", "numpy.loadtxt", "pandas.read_hdf", "numpy.ndim", "numpy.floor", "numpy.hstack", "numpy.squeeze", "numpy.isin...
zhaominyiz/STDF-PyTorch
[ "cb94c5f2eb18b38665a33947ec0801580ef5ccc8" ]
[ "dataset/mfqev2.py" ]
[ "import glob\nimport random\nimport torch\nimport os.path as op\nimport numpy as np\nfrom cv2 import cv2\nfrom torch.utils import data as data\nfrom utils import FileClient, paired_random_crop, augment, totensor, import_yuv\n\n\ndef _bytes2img(img_bytes):\n img_np = np.frombuffer(img_bytes, np.uint8)\n img = ...
[ [ "numpy.clip", "numpy.squeeze", "torch.stack", "numpy.frombuffer" ] ]
RingBDStack/HE-AGCRCNN
[ "7e310d568feeb1614ec5345ed1bcd15e02986efa" ]
[ "GCCNN/GCCNN.py" ]
[ "import sys\r\nsys.setrecursionlimit(15000)\r\n\r\nimport torch\r\nimport torch.nn.functional as F\r\nfrom torch import nn\r\nimport numpy as np\r\nimport os\r\nfrom torch.nn import DataParallel\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom torch.autograd import Variable\r...
[ [ "numpy.concatenate", "torch.zeros", "numpy.array", "torch.nn.MaxPool2d", "torch.nn.Sigmoid", "torch.max", "torch.autograd.Variable", "numpy.load", "torch.cuda.device_count", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.load", "torch.nn.DataParallel" ] ]
vslutov/hockey-player-classificator
[ "a60072f79b37b446508868aa751c83b77cdbbaa5" ]
[ "classifying/markup.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# ----------------------------------------------------------------------------\n# \"THE BEER-WARE LICENSE\" (Revision 42):\n# <vslutov@yandex.ru> wrote this file. As long as you retain this notice you\n# can do whatever you want with this stuff. If we meet some ...
[ [ "matplotlib.use", "numpy.logical_not", "numpy.array", "matplotlib.backends.backend_tkagg.NavigationToolbar2TkAgg", "numpy.logical_or", "numpy.dstack", "numpy.zeros", "matplotlib.backend_bases.key_press_handler", "numpy.logical_and", "matplotlib.backends.backend_tkagg.Figure...
KarimDahawy/CapStone-Project
[ "f7715bd0893b355d746aeffd63ff2f2cbd802fae" ]
[ "ros/src/tl_detector/tl_detector.py" ]
[ "#!/usr/bin/env python\nimport rospy\nfrom std_msgs.msg import Int32\nfrom geometry_msgs.msg import PoseStamped, Pose\nfrom styx_msgs.msg import TrafficLightArray, TrafficLight\nfrom styx_msgs.msg import Lane\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge\nfrom light_classification.tl_classifier...
[ [ "scipy.spatial.KDTree" ] ]
5658www638/yolo_tensorflow
[ "6fea4a3bdc6154154f62aec77378079de77e503c" ]
[ "test.py" ]
[ "import os\r\nimport cv2\r\nimport argparse\r\nimport numpy as np\r\nimport tensorflow as tf\r\nimport yolo.config as cfg\r\nfrom yolo.yolo_net import YOLONet\r\nfrom utils.timer import Timer\r\n\r\n\r\nclass Detector(object):\r\n\r\n def __init__(self, net, weight_file):\r\n self.net = net\r\n sel...
[ [ "numpy.square", "numpy.array", "numpy.reshape", "numpy.zeros", "tensorflow.Session", "tensorflow.train.Saver", "numpy.nonzero", "numpy.multiply", "numpy.transpose", "numpy.argmax", "numpy.argsort", "numpy.arange", "tensorflow.global_variables_initializer" ] ]
krassowski/drug-disease-profile-matching-evaluation
[ "cc2048ebac16b7618ad69fb1e1fb7869492bf179" ]
[ "signature_scoring/evaluation/subtypes.py" ]
[ "import random\nfrom collections import defaultdict\nfrom contextlib import redirect_stdout, redirect_stderr\nfrom io import StringIO\nfrom typing import Dict\nfrom warnings import warn\n\nfrom pandas import concat, DataFrame, Categorical\nfrom tqdm import tqdm\n\nfrom data_frames import to_nested_dicts\nfrom data_...
[ [ "pandas.DataFrame", "pandas.Categorical", "pandas.concat" ] ]
yangchengtest/UdaCity_Car_Final
[ "5ea4bf01c08e37506a329cad5ff3598911c95121" ]
[ "ros/src/waypoint_updater/waypoint_updater.py" ]
[ "#!/usr/bin/env python\n\nimport rospy\nfrom geometry_msgs.msg import PoseStamped\nfrom styx_msgs.msg import Lane, Waypoint\nfrom scipy.spatial import KDTree\nimport math\nimport numpy as np\nfrom std_msgs.msg import Int32\nimport yaml\n'''\nThis node will publish waypoints from the car's current position to some `...
[ [ "scipy.spatial.KDTree", "numpy.array", "numpy.dot" ] ]
ligongzzz/quantum
[ "40e3c253006eb78488896eb9d7f9699536dd7343" ]
[ "tensorflow_quantum/core/serialize/serializer_test.py" ]
[ "# Copyright 2020 The TensorFlow Quantum 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# Unl...
[ [ "numpy.float64", "numpy.float32", "tensorflow.test.main" ] ]
s-ilic/ECLAIR
[ "d82e1cf96f4f3676120e94cd46a7ed7734002b0c" ]
[ "likelihoods/Planck2018_highTTTEEE/__init__.py" ]
[ "import os\nimport clik\nimport numpy as np\n\n### Some important variables ###\nclik_root = os.environ.get('PLANCK_2018_DATA')\nif clik_root == None:\n raise ValueError('The environment variable PLANCK_2018_DATA is not set.')\n\n### Planck 2018 high ells TT, TE, EE\nhell_TTTEEE = clik.clik(clik_root + '/hi_l/pl...
[ [ "numpy.array" ] ]
jvpoulos/cs289-project
[ "a3686de769c9709587a68731275a0b7065ba88f1" ]
[ "code/plot_cpu_time.py" ]
[ "from os.path import splitext\nimport numpy as np\nimport matplotlib.pylab as plt\nimport seaborn as sbn\n\n# enumerate results files\nresult_files = np.loadtxt('result_filenames.np', dtype=str)\n\nmodel_tech_time = {}\n\n# plot and save results to png\nfor result_filename in result_files:\n # save ave k-fold cp...
[ [ "numpy.loadtxt", "numpy.load", "matplotlib.pylab.savefig" ] ]
Autonomobile/AutoPylot
[ "01daafa380c90a0e5525111021a287cce9342cf5" ]
[ "main_programs/examples/drive_with_controller.py" ]
[ "import os\nimport time\n\nimport numpy as np\nfrom autopylot.actuators import Actuator\nfrom autopylot.cameras import Camera\nfrom autopylot.controllers import Controller\nfrom autopylot.datasets import preparedata, transform\nfrom autopylot.models import utils\nfrom autopylot.utils import io, logger, memory, sett...
[ [ "numpy.argmax" ] ]
nikolim/cablab
[ "1dcf0d7da01ed3988f84309acfb31cc9a9893de1" ]
[ "cablab/algorithms/archive/a2c.py" ]
[ "import os\nimport time\nimport numpy as np\nimport torch\n\nimport gym\nimport gym_cabworld\n\nfrom algorithms.a2c_model import PolicyNetwork\nfrom common.features import clip_state, cut_off_state\nfrom common.logging import create_log_folder, get_last_folder\nfrom common.logging import Tracker\n\n\ndef train_a2c(...
[ [ "torch.tensor" ] ]
tirkarthi/DeBERTa
[ "c558ad99373dac695128c9ec45f39869aafd374e", "c558ad99373dac695128c9ec45f39869aafd374e" ]
[ "DeBERTa/apps/_utils.py", "DeBERTa/data/dynamic_dataset.py" ]
[ "import torch\nfrom collections import OrderedDict, Mapping, Sequence\n\ndef merge_distributed(data_list, max_len=None):\n if torch.distributed.is_initialized() and torch.distributed.get_world_size()>1:\n world_size = torch.distributed.get_world_size()\n else:\n world_size = 1\n merged = []\n def gather(d...
[ [ "torch.distributed.is_initialized", "torch.cat", "torch.distributed.get_world_size", "torch.distributed.broadcast" ], [ "numpy.ndarray", "numpy.arange" ] ]
KyunghyunLee/RAdam
[ "2b1ffc999e12838cbffd9a4ddbb238f3f8cad437" ]
[ "cifar_imagenet/utils/logger.py" ]
[ "# A simple torch style logger\n# (C) Wei YANG 2017\nfrom __future__ import absolute_import\nimport matplotlib as mpl\nmpl.use('Agg')\n\nimport matplotlib.pyplot as plt\nimport os\nimport sys\nimport numpy as np\n\n__all__ = ['Logger', 'LoggerMonitor', 'savefig']\n\ndef savefig(fname, dpi=None):\n dpi = 150 if d...
[ [ "matplotlib.use", "numpy.asarray", "matplotlib.pyplot.savefig", "matplotlib.pyplot.grid", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.subplot" ] ]
zfjsail/wechat-wow-analysis
[ "9fc678f7931f0eac2e8b326d141b60ca7039eece" ]
[ "data_loader.py" ]
[ "import os\nimport numpy as np\nimport sklearn\nfrom sklearn import preprocessing\nimport torch\nfrom torch.utils.data import Dataset\nfrom torch.utils.data.sampler import Sampler\n\nfrom utils import load_w2v_feature\nimport settings\n\nimport logging\n\nlogger = logging.getLogger(__name__)\nlogging.basicConfig(le...
[ [ "numpy.max", "numpy.bincount", "numpy.zeros", "torch.FloatTensor", "numpy.identity", "sklearn.preprocessing.scale", "numpy.unique", "sklearn.utils.shuffle" ] ]
jacnugent/fv3net
[ "e62038aee0a97d6207e66baabd8938467838cf51" ]
[ "external/fv3fit/tests/emulation/test_layers_norm.py" ]
[ "import pytest\nimport numpy as np\nimport tensorflow as tf\n\nfrom fv3fit.emulation import layers\n\n_all_layers = [\n layers.StandardNormLayer,\n layers.StandardDenormLayer,\n layers.MaxFeatureStdNormLayer,\n layers.MaxFeatureStdNormLayer,\n layers.MeanFeatureStdNormLayer,\n layers.MeanFeatureSt...
[ [ "numpy.testing.assert_allclose", "numpy.array", "tensorflow.GradientTape", "tensorflow.Variable", "numpy.mean", "numpy.testing.assert_array_almost_equal", "numpy.std" ] ]