repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
Project-Agni/Detection
[ "6b2c8ec25f8bd2bd15995d67f2808352cec9e2af" ]
[ "agents/usrl/vae.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom a2c_ppo_acktr.utils import init\n\nimport os\nimport numpy as np\nfrom torch.utils.data import RandomSampler, BatchSampler\nfrom .trainer import Trainer\nfrom .utils import EarlyStopping\n\n\nclass Unflatten(nn.Module):\n def __init__(se...
[ [ "torch.nn.init.calculate_gain", "torch.nn.ConvTranspose2d", "torch.nn.init.constant_", "torch.nn.Sigmoid", "torch.exp", "torch.nn.functional.mse_loss", "torch.nn.Linear", "torch.set_grad_enabled", "torch.device", "torch.nn.ReLU", "torch.stack" ] ]
draven-agency/fedlearner
[ "d85eb50b2b43d9bd6b121bd9906eb0731533a615" ]
[ "fedlearner/trainer/estimator.py" ]
[ "# Copyright 2020 The FedLearner Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v1.metrics.mean", "tensorflow.compat.v1.train.MonitoredTrainingSession", "tensorflow.compat.v1.group", "tensorflow.compat.v1.train.Scaffold", "tensorflow.compat.v1.train.MonitoredSession", "tensorflow.compat.v1.train.replica_device_setter", "tensorflow.compat.v1.conf...
Siemwind/PolarSeg
[ "63f912ea5a0edc7ae7128752ba5339ff33e2584f" ]
[ "network/ptBEV.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nimport numba as nb\nimport multiprocessing\nimport torch_scatter\n\nclass ptBEVnet(nn.Module):\n \n def __init__(self, BEV_net, grid_size, pt_model = 'pointnet', fea_dim ...
[ [ "torch.cat", "torch.randperm", "torch.zeros", "torch.unique", "torch.clamp", "torch.ones", "numpy.arange", "numpy.argmax", "torch.argsort", "numpy.zeros", "torch.nn.functional.pad", "torch.nn.BatchNorm1d", "numpy.min", "torch.nn.Linear", "numpy.transpose...
chrisrichardson/libtab
[ "1f6593409bf51427bd6d8d1036bb885f5fbb7a8c" ]
[ "test/test_regge.py" ]
[ "# Copyright (c) 2020 Chris Richardson\n# FEniCS Project\n# SPDX-License-Identifier: MIT\n\nimport libtab\nimport numpy as np\n\n\ndef test_regge_tri():\n # Simplest element\n regge = libtab.Regge(\"triangle\", 1)\n\n # tabulate at origin\n pts = [[0.0, 0.0]]\n w = regge.tabulate(0, pts)[0]\n w = ...
[ [ "numpy.array", "numpy.isclose" ] ]
danielpatrickhug/Top2Vec
[ "3f39d4d07f070b3879a928fec375b4bc4eba5a0c" ]
[ "top2vec/tests/test_top2vec.py" ]
[ "import pytest\nfrom top2vec.Top2Vec import Top2Vec\nfrom sklearn.datasets import fetch_20newsgroups\nimport numpy as np\nimport tempfile\n\n# get 20 newsgroups data\nnewsgroups_train = fetch_20newsgroups(subset='all', remove=('headers', 'footers', 'quotes'))\nnewsgroups_documents = newsgroups_train.data[0:2000]\n\...
[ [ "numpy.inner", "sklearn.datasets.fetch_20newsgroups" ] ]
GeneZC/AlphaPoet
[ "82715e9cc36aedfa78c250a7a7f8129669eea440" ]
[ "main.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport random\nimport pickle\nimport os\nfrom dataloader import Gen_Data_loader, Dis_Data_loader\nfrom generator import Generator\nfrom discriminator import BLEUCNN\nfrom rollout import ROLLOUT\nfrom mobilenet import MobileNet\n\nEMB_DIM = 300 # embedding dimension\nHID...
[ [ "numpy.random.seed", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "numpy.mean", "tensorflow.Session" ] ]
gordonchiang/HoQ
[ "f483648ef0075037de890316475918f154729291" ]
[ "dumps/graph_mobile.py" ]
[ "#!/usr/bin/env python3\n\nfrom copy import deepcopy\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\ndef genList(d, delay, loss):\n return [ d['TCP'][delay][loss], d['TCP+TLS'][delay][loss], d['QUIC'][delay][loss] ]\n\ndef getVal(l):\n return [ l[0]['val'], l[1]['val'], l[2]['val'] ...
[ [ "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ] ]
nobilearn/tensorflow-yolov4-tflite
[ "1b79f20148ed6ab7894ad213363fd31056c527c9" ]
[ "benchmarks.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport time\nimport cv2\nfrom core.yolov4 import YOLOv4, YOLOv3_tiny, YOLOv3, decode\nfrom absl import app, flags, logging\nfrom absl.flags import FLAGS\nfrom tensorflow.python.saved_model import tag_constants\nfrom core import utils\nfrom core.config import cfg\nfrom t...
[ [ "tensorflow.compat.v1.ConfigProto", "tensorflow.constant", "tensorflow.saved_model.load", "tensorflow.config.experimental.set_memory_growth", "tensorflow.config.experimental.list_physical_devices", "tensorflow.expand_dims", "tensorflow.keras.Model", "numpy.copy", "tensorflow.im...
adelevie/transformers
[ "18ca0e91402d17950b870d7c9f67ddb7fd573817" ]
[ "tests/test_modeling_common.py" ]
[ "# coding=utf-8\n# Copyright 2019 HuggingFace 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 appl...
[ [ "torch.jit.save", "torch.abs", "torch.jit.load", "torch.ones", "numpy.abs", "torch.jit.trace", "torch.zeros", "torch.eq", "torch.manual_seed", "numpy.isnan", "torch.isnan", "torch.isinf", "torch.is_tensor", "torch.nn.Embedding", "torch.tensor", "torc...
markdls/models
[ "d2cb4f87ec51057c1c0268274851af6169e1bbbd" ]
[ "research/lfads/distributions.py" ]
[ "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.compat.v1.stack", "numpy.log", "tensorflow.compat.v1.square", "tensorflow.compat.v1.Variable", "tensorflow.compat.v1.exp", "tensorflow.compat.v1.nn.sigmoid", "tensorflow.compat.v1.reduce_mean", "tensorflow.compat.v1.random_normal", "tensorflow.compat.v1.reduce_sum",...
UWRobotLearning/rmp2
[ "c612a014f517204b38c552619a441be4b3d7b67f" ]
[ "rmp2/utils/plot_configs.py" ]
[ "# The first version was licensed as \"Original Source License\"(see below).\n# Several enhancements and at UW Robot Learning Lab\n# \n# Original Source License:\n# \n# Copyright (c) 2019 Georgia Tech Robot Learning Lab\n# Licensed under the MIT License.\n\n\"\"\"\nconfigs for ploting\n\"\"\"\n\nfrom matplotlib imp...
[ [ "matplotlib.cm.get_cmap" ] ]
honey-sangtani-c5i/retail-demo-store
[ "c76e03b2a1750d9ec16f2dd8c952b8c4c8a53ef8" ]
[ "generators/datagenerator/sessions.py" ]
[ "# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# SPDX-License-Identifier: MIT-0\n\nimport datetime\nfrom collections import UserList\nfrom datagenerator.funnel import Funnel\nimport random\nimport numpy as np\n\nclass Sessions(UserList):\n def __init__(self, from_datetime, to_datetime, even...
[ [ "numpy.random.binomial" ] ]
iojon/PyOgg
[ "b03f4a7f3a4e677ab2d4fb9a413be32eb16f0b2d" ]
[ "tests/test_opus_file_stream.py" ]
[ "import pytest\nimport pyogg\nimport os\n\nos.chdir(os.path.dirname(__file__))\n\ndef test_error_in_filename():\n # Load a non-existant file\n filename = \"does-not-exist.opus\"\n with pytest.raises(pyogg.PyOggError):\n opus_stream = pyogg.OpusFileStream(filename)\n\n \ndef test_total_length(...
[ [ "numpy.concatenate" ] ]
smaeyama/mzprojection
[ "5a05252006bcfdf4a33faf1c089ea1a95aa8b349" ]
[ "python/example.py" ]
[ "#!/usr/bin/env python\n\n\nif __name__ == '__main__':\n import numpy as np\n from mzprojection import mzprojection_long_time_series\n #from mzprojection import mzprojection_ensemble_of_time_series\n\n #= Read sample data =\n indata = np.loadtxt('../sample_data/sample_time_series.dat')\n time ...
[ [ "numpy.savetxt", "numpy.vstack", "numpy.abs", "numpy.loadtxt" ] ]
veritas9872/Knowledge-Distillation-Task
[ "d260b1057c96cfc52af8ff7a0775befbd102f59d" ]
[ "train/grid_search.py" ]
[ "\"\"\"\nCode for applying grid search to find the best parameters for knowledge distillation.\nThe distillation ratio and temperature parameters are being tuned in this search.\n\"\"\"\nimport torch\n\nfrom train.distill_knowledge import main\nfrom utils.options import knowledge_distillation_options\n\n\ndef grid_...
[ [ "torch.random.manual_seed" ] ]
AnthonyC958/SNe-Lensing
[ "1d1fc953457de298a55222b1dba06427e35c225b" ]
[ "MICE.py" ]
[ "import Convergence\nimport cones\nfrom astropy.io import fits\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Circle\nfrom matplotlib.collections import PatchCollection\nimport random\nfrom scipy.stats import rankdata\nimport pickle\nfrom scipy.signal import savgol_filter\nimpo...
[ [ "matplotlib.pyplot.legend", "numpy.linspace", "numpy.cumsum", "matplotlib.pyplot.plot", "numpy.mean", "matplotlib.pyplot.subplot2grid", "scipy.signal.savgol_filter", "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "numpy.arange", "numpy.sin", "numpy.std",...
rccannizzaro/QC-StrategyBacktest
[ "847dbd61680466bc60ce7893eced8a8f70d16b2e" ]
[ "QuantConnect - StrategyBacktest.py" ]
[ "########################################################################################\n# #\n# Licensed under the Apache License, Version 2.0 (the \"License\"); #\n# you may not use this file except in compl...
[ [ "numpy.random.RandomState", "pandas.DataFrame.from_dict" ] ]
XYPB/SpecVQGAN
[ "ed3c0f86c41bc408824979305d9c4f6df0877973", "ed3c0f86c41bc408824979305d9c4f6df0877973" ]
[ "specvqgan/onset_baseline/data/greatesthit.py", "sample_visualization.py" ]
[ "from data import *\nimport pdb\nfrom utils import sound, sourcesep\nimport csv\nimport glob\nimport h5py\nimport io\nimport json\nimport librosa\nimport numpy as np\nimport os\nimport pickle\nfrom PIL import Image\nfrom PIL import ImageFilter\nimport random\nimport scipy\nimport soundfile as sf\nimport time\nfrom ...
[ [ "numpy.random.seed", "torch.cat", "numpy.rint", "numpy.ceil", "numpy.random.randint" ], [ "torch.nn.functional.softmax", "torch.load", "torch.cat", "torch.zeros", "torch.zeros_like", "matplotlib.pyplot.get_cmap", "torch.multinomial", "torch.no_grad", "to...
dattranfiot/Carla-ppo
[ "f6961e50a8e43ef65d1c0bb6e953db99c0948b36" ]
[ "utils.py" ]
[ "import types\n\nimport cv2\nimport numpy as np\nimport scipy.signal\nimport tensorflow as tf\n\n\nclass VideoRecorder():\n def __init__(self, filename, frame_size, fps=30):\n self.video_writer = cv2.VideoWriter(\n filename,\n cv2.VideoWriter_fourcc(*\"MPEG\"), int(fps),\n ...
[ [ "tensorflow.group", "tensorflow.Variable", "tensorflow.assign", "tensorflow.layers.dense", "numpy.array", "tensorflow.summary.scalar", "tensorflow.summary.merge" ] ]
Driesssens/ppo-a2c-thesis
[ "4f7b8c8290940bb4dc40cf067a99b890655c55ec" ]
[ "thesis/preprocessor.py" ]
[ "import torch_rl\nimport numpy\nimport torch\n\n\nclass MyObssPreprocessor:\n \"\"\"A preprocessor of observations returned by the environment.\n It converts MiniGrid observation space and MiniGrid observations\n into the format that the model can handle.\"\"\"\n\n def __init__(self, obs_space):\n ...
[ [ "numpy.array", "torch.tensor" ] ]
ameisner/fiberassign
[ "8b13f8681f2b8a0826cdc18387890461ca37989a" ]
[ "py/fiberassign/test/test_qa.py" ]
[ "\"\"\"\nTest fiberassign target operations.\n\"\"\"\nimport os\nimport subprocess\nimport re\nimport shutil\nimport unittest\nfrom datetime import datetime\nimport json\nimport glob\n\nimport numpy as np\n\nimport fitsio\n\nimport desimodel\n\nimport fiberassign\n\nfrom fiberassign.utils import option_list, Global...
[ [ "numpy.random.seed" ] ]
jphacks/TK_1804
[ "b71e5ee95ea60476758979845f3ebfd5a4355d41" ]
[ "src/tools/calibration.py" ]
[ "import numpy as np\nimport cv2\n\ncap = cv2.VideoCapture(0)\n\nif cap.isOpened() is False:\n raise(\"IO Error\")\n\n# termination criteria\ncriteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)\n\n# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)\nobjp = np.zeros((6*7,3),...
[ [ "numpy.savetxt", "numpy.zeros" ] ]
Tekhz/models
[ "8d01c604a03daba8766e443311f704ad02046ad4" ]
[ "official/utils/logging/logger_test.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.constant", "tensorflow.gfile.Exists", "tensorflow.gfile.GFile", "tensorflow.test.main", "tensorflow.gfile.IsDirectory" ] ]
pachterlab/pachterlab-MBLGLMBHGP_2021
[ "3141e78f649a6e0384073ba13cf343277773101c" ]
[ "Figure_2_Supplementary_Figure_3/make_data_faster.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\nimport argparse\nimport scipy.io\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport os\nimport time\nimport copy\nfrom sklearn.preprocessing import LabelEncoder\nfrom scipy import sparse\nimport scipy\nimport anndata\nfrom matplotlib.pyplot i...
[ [ "sklearn.decomposition.TruncatedSVD", "numpy.partition", "numpy.multiply", "numpy.asarray", "sklearn.metrics.pairwise.manhattan_distances", "numpy.log10", "numpy.log1p", "numpy.diagonal", "numpy.divide" ] ]
WalterjhShen/qmpy
[ "686e18cecbb82a6bb523249ac1779a99fb865350" ]
[ "qmpy/analysis/xrd.py" ]
[ "#!/usr/env/bin python\n\nimport itertools\nimport numpy as np\nimport logging\n\nfrom qmpy.data import elements\nfrom qmpy.utils import *\n\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.DEBUG)\n\n\nclass Peak(object):\n \"\"\"\n Attributes:\n angle (float): \n Peak 2*theta angle ...
[ [ "numpy.dot", "numpy.allclose", "numpy.arcsin", "numpy.eye", "numpy.cos", "numpy.sin", "numpy.ceil", "numpy.exp", "numpy.array" ] ]
YuyangL/SOWFA-Postprocess
[ "1c6b157a2a6afa76c9ffabe5edb5997ad57aa88a" ]
[ "Visual_EigenVectors.py" ]
[ "import numpy as np\nfrom FieldData import FieldData\nimport PostProcess_AnisotropyTensor as ppat\nimport time as t\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\nfrom mayavi import mlab\nfrom mayavi.api import Engine\nfrom mayavi.modules.axes import Axes\nimport pickle\nimport os\n\n\"\"\"...
[ [ "numpy.sqrt" ] ]
oleksyoleksy/youtube
[ "e8ce5f73c31966e18197c40aa4dc1a0a1c056d53" ]
[ "thumbnail-rater/get_data2.py" ]
[ "import numpy as np\nimport os\nfrom matplotlib import pyplot as plt\nimport cv2\nimport random\nimport pickle\n\n\nfile_list = []\nclass_list = []\n\nDATADIR = \"data2\"\n\n# All the categories you want your neural network to detect\nCATEGORIES = [\"bad\", \"good\"]\n\n# The size of the images that your neural net...
[ [ "numpy.array" ] ]
shiyegao/mmcv
[ "c567e04d9d8e87d4b9abc3405e06a218d2011b08" ]
[ "mmcv/runner/epoch_based_runner.py" ]
[ "# Copyright (c) Open-MMLab. All rights reserved.\nimport os.path as osp\nimport platform\nimport shutil\nimport time\nimport warnings\n\nimport torch\n\nimport mmcv\nfrom .base_runner import BaseRunner\nfrom .builder import RUNNERS\nfrom .checkpoint import save_checkpoint\nfrom .utils import get_host_info\n\n\n@RU...
[ [ "torch.no_grad" ] ]
neulab/guided_summarization
[ "ea4bbe91f189cdb51f7f6a827210f9adc5319b3c" ]
[ "bert/models/z_trainer.py" ]
[ "import os\n\nimport numpy as np\nimport torch\nfrom tensorboardX import SummaryWriter\n\nimport distributed\nfrom models.reporter import ReportMgr, Statistics\nfrom others.logging import logger\nfrom others.utils import test_rouge, rouge_results_to_str\n\n\ndef _tally_parameters(model):\n n_params = sum([p.nele...
[ [ "torch.no_grad", "torch.save" ] ]
anoidgit/zero
[ "e764ce09a4c7737c6399ac2deaf104bc211ec39e" ]
[ "rnns/cell.py" ]
[ "# coding: utf-8\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport abc\nimport tensorflow as tf\nfrom func import linear\nfrom utils import dtype\n\n\n# This is an abstract class that deals with\n# recurrent cells, e.g. GRU, LSTM, ATR\nclas...
[ [ "tensorflow.zeros" ] ]
tungedng2710/ArcFace_pytorch
[ "fa7d7f42b07af61ad595ef87a687a79e0690f771" ]
[ "utils/losses.py" ]
[ "import torch\nimport torch.nn as nn\n\n# DEVICE=torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n\ndef l2_norm(input, axis = 1):\n norm = torch.norm(input, 2, axis, True)\n output = torch.div(input, norm)\n\n return output\n\nclass FocalLoss(nn.Module):\n def __init__(self, gamma=0, eps=1e...
[ [ "torch.div", "torch.nn.CrossEntropyLoss", "torch.norm", "torch.mm", "torch.zeros_like", "torch.exp", "torch.where", "torch.clamp", "torch.cos" ] ]
Srivathsav-max/armnn-clone
[ "e571cde8411803aec545b1070ed677e481f46f3f" ]
[ "python/pyarmnn/examples/speech_recognition/wav2letter_mfcc.py" ]
[ "# Copyright © 2021 Arm Ltd and Contributors. All rights reserved.\n# SPDX-License-Identifier: MIT\n\nimport numpy as np\nimport os\nimport sys\n\nscript_dir = os.path.dirname(__file__)\nsys.path.insert(1, os.path.join(script_dir, '..', 'common'))\n\nfrom mfcc import MFCC, AudioPreprocessor\n\n\nclass Wav2LetterMFC...
[ [ "numpy.convolve", "numpy.sqrt", "numpy.reshape", "numpy.cos", "numpy.log10", "numpy.zeros_like", "numpy.hanning", "numpy.array", "numpy.zeros" ] ]
96-Zachary/PGCD-for-ABSA
[ "3d02cc2fc987827d279e61d6af3a06e7bfe01caa" ]
[ "models/lstm.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom layers.dynamic_rnn import DynamicLSTM\nimport torch\nimport torch.nn as nn\nimport numpy as np\nimport torch.nn.functional as F\n\n\nclass LSTM(nn.Module):\n def __init__(self, embedding_matrix, opt):\n super(LSTM, self).__init__()\n self.embed_dim = embedding_matr...
[ [ "torch.nn.Linear", "torch.sum", "torch.tensor" ] ]
Embodimentgeniuslm3/datarobot-user-models
[ "9453482896c6cc27468d829ad037a6f164d3c5a3" ]
[ "tests/drum/test_fit.py" ]
[ "import os\nimport shutil\nfrom tempfile import NamedTemporaryFile\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom datarobot_drum.drum.common import ArgumentsOptions\nfrom datarobot_drum.drum.utils import handle_missing_colnames, unset_drum_supported_env_vars\nfrom datarobot_drum.resource.utils im...
[ [ "pandas.read_csv" ] ]
jonathanchu33/pix2pix_cyclegan_guess_noise
[ "c21634be42e246b562b1a1ebf26c953f351228dd" ]
[ "metrics/consolidated.py" ]
[ "import os\nimport numpy as np\nfrom PIL import Image\nimport argparse\n\nIMG_BATCH_SIZE = 14\n# palette_quantization = False # Palette quantization strategy - unused\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(description='Calculate RH, Proposed RH, Seg/IoU Acc. Metrics.')\n parser.add_argum...
[ [ "numpy.logical_and", "numpy.unique", "numpy.linalg.norm", "numpy.mean", "numpy.array" ] ]
chavdim/drl_lab
[ "5d976f11f7487d2c76eec030c15dd52e73d6a48b" ]
[ "tests/test_models.py" ]
[ "from copy import deepcopy\nimport unittest\n\nimport keras\nimport numpy as np\n\nfrom drl_lab.models import (\n build_QCNN,\n QCNN,\n dataset2XY,\n state2data,\n load_model,\n)\nfrom tests.common import (\n nn_hparams,\n get_test_model_path,\n weights_equal,\n)\n\nbatch_size = 10\nobs_shap...
[ [ "numpy.random.permutation", "numpy.random.randn" ] ]
kperrynrel/rdtools
[ "4ca70e3e2cec85fead10cb8e6ef5e098eeb6f686" ]
[ "rdtools/test/interpolate_test.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom rdtools import interpolate\nimport pytest\n\n\n@pytest.fixture\ndef time_series():\n times = pd.date_range('2018-04-01 12:00', '2018-04-01 13:15', freq='15T')\n time_series = pd.Series(data=[9, 6, 3, 3, 6, 9], index=times, name='foo')\n time_series = time_seri...
[ [ "pandas.concat", "pandas.testing.assert_series_equal", "pandas.Series", "pandas.DataFrame", "pandas.testing.assert_frame_equal", "pandas.date_range", "pandas.to_timedelta" ] ]
RICE-EIC/Early-Bird-GCN
[ "25a80b23f2ecfc46ffe00b1cf0e06052b32aad0f" ]
[ "run_threshold_jointEB.py" ]
[ "import os.path as osp\nimport argparse\nimport torch\nimport torch.nn.functional as F\nimport torch_geometric.utils.num_nodes as geo_num_nodes\nfrom torch_geometric.datasets import Planetoid\nimport torch_geometric.transforms as T\nfrom torch_geometric.nn import GCNConv # noga\nfrom utils import *\nfrom pytorch_t...
[ [ "torch.transpose", "torch.load", "torch.zeros", "numpy.max", "numpy.zeros_like", "numpy.mean", "numpy.tril", "torch.save", "torch.eye", "torch.from_numpy", "torch.sort", "numpy.count_nonzero", "numpy.unravel_index", "numpy.zeros", "torch.optim.Adam", ...
dulacp/lifelines
[ "0770bbb6179bbe8f3ce4acec3c0834f3cc0834ee" ]
[ "lifelines/statistics.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import print_function\nfrom itertools import combinations\n\nimport numpy as np\nfrom scipy import stats\nimport pandas as pd\n\nfrom lifelines.utils import group_survival_table_from_events, significance_code\n\n\ndef sample_size_necessary_under_cph(power, ratio_of_particip...
[ [ "scipy.stats.norm.ppf", "numpy.dot", "scipy.stats.norm.cdf", "numpy.sqrt", "numpy.unique", "numpy.asarray", "numpy.arange", "pandas.DataFrame", "numpy.ones", "numpy.max", "numpy.ceil", "numpy.linalg.pinv", "numpy.fill_diagonal", "numpy.array", "numpy.zer...
observingClouds/xarray
[ "66acafa7f1f1477cfd6c5b7c3458859763433092" ]
[ "xarray/core/indexing.py" ]
[ "import enum\nimport functools\nimport operator\nfrom collections import defaultdict\nfrom contextlib import suppress\nfrom datetime import timedelta\nfrom typing import Any, Callable, Iterable, List, Sequence, Tuple, Union\n\nimport numpy as np\nimport pandas as pd\n\nfrom . import duck_array_ops, nputils, utils\n...
[ [ "numpy.asarray", "numpy.issubdtype", "numpy.dtype", "numpy.broadcast", "numpy.max", "numpy.zeros_like", "numpy.any", "numpy.searchsorted", "numpy.where", "numpy.unique", "numpy.arange", "numpy.flatnonzero", "numpy.diff", "numpy.ravel", "numpy.min", "...
Uglamator/WRSCRYP
[ "e0d68ac05c9fc19f1bdd238eb36c272de9610ba5" ]
[ "RedditScrape.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Feb 1 17:17:59 2021\n\n@author: \n\"\"\"\n\nimport praw\nimport pandas as pd\nimport datetime as dt\nimport sqlite3\nconn = sqlite3.connect('TestDB1.db')\nc = conn.cursor()\n#c.execute('CREATE TABLE comments (id,body,created_datetime,score)')\nconn.commit()\npd.set_...
[ [ "pandas.set_option" ] ]
dfreilich/machine-learning-workspace
[ "a1b6e5bd84a4f5708461f3827d64e2bf5a32dffa" ]
[ "18739-hws/hw2/hw2_utils.py" ]
[ "from builtins import range\nfrom six.moves import cPickle as pickle\nimport numpy as np\nimport os\nfrom scipy.misc import imread\nimport platform\nimport tensorflow as tf\nimport numpy as np\nimport math\nfrom matplotlib import pyplot as plt\n\ndef load_pickle(f):\n version = platform.python_version_tuple()\n ...
[ [ "numpy.arange", "tensorflow.cast", "numpy.random.shuffle", "numpy.concatenate", "matplotlib.pyplot.plot", "numpy.mean", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "tensorflow.argmax", "numpy.array", "numpy.sum", "matplotlib.pyplot.show", "matplotlib.p...
BashkirovN/pytorch
[ "f720fd81dfa3f124fdd0747312496bdbfafb75a7" ]
[ "torch/ao/quantization/fx/prepare.py" ]
[ "import torch\nimport operator\nimport warnings\nfrom torch.fx import (\n GraphModule,\n)\nfrom torch.fx.graph import (\n Graph,\n Node,\n)\nfrom torch.fx.node import Argument\n\nfrom ..quantize import (\n propagate_qconfig_,\n)\nfrom ..observer import (\n ObserverBase,\n)\nfrom ..qconfig import QCon...
[ [ "torch.ao.quantization.quantize.convert", "torch.tensor" ] ]
NTAvanHoeffelen/DAIF_CarRacing
[ "1ec51fb0d2de1541df9ca1b1d9d8a7d1130fcf8b" ]
[ "daif_CarRacing.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport numpy as np\nimport datetime\nimport matplotlib.pyplot as plt\nimport torchvision.transforms as T\nimport car_racing as cr\nimport replay_memory as rm\nimport data_collector as dc\nimport random\n\nclass VAE(n...
[ [ "torch.randn_like", "torch.mean", "torch.load", "torch.sum", "torch.multinomial", "matplotlib.pyplot.plot", "torch.no_grad", "numpy.mean", "torch.device", "torch.softmax", "torch.nn.Sigmoid", "numpy.zeros", "torch.nn.ConvTranspose2d", "numpy.ascontiguousarra...
RSEnergyGroup/incubator-airflow
[ "215b8c8170bd63f4c449614945bb4b6d90f6a860" ]
[ "tests/hooks/test_hive_hook.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# 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...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
BIMAU/fvm
[ "fef6e8c577848b105e04273e1357a5e279d26aba" ]
[ "fvm/CylindricalDiscretization.py" ]
[ "import numpy\n\nfrom fvm import utils\nfrom fvm import BoundaryConditions\nfrom fvm import Discretization\n\nclass CylindricalDiscretization(Discretization):\n '''Finite volume discretization of the incompressible Navier-Stokes\n equations on a (possibly non-uniform) Arakawa C-grid in a\n cylindrical coor...
[ [ "numpy.zeros", "numpy.cos" ] ]
HakujouRyu/Lambdata
[ "c9c6881997d635dd09ff42dc8b5277de3e56ca14" ]
[ "lambdata_hakujouryu/df_utils_test.py" ]
[ "\"\"\" Testing functions from the df_utils module\"\"\"\n\n\nimport unittest\n\nimport pandas as pd\n\nfrom df_utils import list_to_col\n\n\nTEST_DF = pd.DataFrame(\n {'one': [1, 1, 1, 1], \n 'two': [2, 2, 2, 2],\n 'dates': ['09/09/1988', '04/02/1992', '01/10/2009', '04/20/1920']})\n\nVER_DF = pd.DataFra...
[ [ "pandas.DataFrame" ] ]
wojtekwalczak/kaggle_titanic
[ "f13258dcb9e964bcad61609fdcc374e3db47824e" ]
[ "titanic/scripts/plotter.py" ]
[ "\"\"\"\n PassengerId Survived Pclass Age SibSp \\\ncount 891.000000 891.000000 891.000000 714.000000 891.000000\nmean 446.000000 0.383838 2.308642 29.699118 0.523008\nstd 257.353842 0.486592 0.836071 14.526497 1.102743\nmin 1.000000 0.000000 ...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.scatter" ] ]
themattinthehatt/dreamscape
[ "3ae2a4fd0fc19bc69b705aa309f3643fb739997f" ]
[ "utils/DataReader.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\n@author: Matt Whiteway, June 2017\nDataReader class that handles mnist and cifar10 datasets\n\"\"\"\n\n\nclass DataReaderMNIST(object):\n \"\"\"DataReader class for mnist\"\"\"\n\n def __init__(self, data_dir, one_hot=True):\n\n from tensorflow.examples.tutorials.mnist...
[ [ "tensorflow.examples.tutorials.mnist.input_data.read_data_sets" ] ]
yellowstarhx/person_search
[ "e36a3d9db5d4b21ff29a9618b4e5f818c8f35300" ]
[ "lib/fast_rcnn/test_utils.py" ]
[ "import numpy as np\nimport cv2\n\nfrom fast_rcnn.config import cfg\nfrom utils.blob import im_list_to_blob\n\n\ndef get_image_blob(im):\n \"\"\"Converts an image into a network input.\n\n Arguments:\n im (ndarray): a color image in BGR order\n\n Returns:\n blob (ndarray): a data blob holding...
[ [ "numpy.hstack", "numpy.abs", "numpy.min", "numpy.round", "numpy.max", "numpy.array", "numpy.zeros" ] ]
s-weigand/pandas
[ "ae71dc1c5a694ce35e345030c3b75650f8b0a175" ]
[ "pandas/core/array_algos/replace.py" ]
[ "\"\"\"\nMethods used by Block.replace and related methods.\n\"\"\"\nimport operator\nimport re\nfrom typing import Optional, Pattern, Union\n\nimport numpy as np\n\nfrom pandas._typing import ArrayLike, Scalar\n\nfrom pandas.core.dtypes.common import (\n is_datetimelike_v_numeric,\n is_numeric_v_string_like,...
[ [ "pandas.core.dtypes.common.is_numeric_v_string_like", "pandas.core.dtypes.common.is_scalar", "pandas.core.dtypes.common.is_re", "numpy.vectorize", "pandas.core.dtypes.missing.isna", "numpy.zeros", "pandas.core.dtypes.common.is_datetimelike_v_numeric" ] ]
Pennycook/performance-portability
[ "3a6a2d524747bba0d5934b3d5838cb6029485079" ]
[ "metrics/scripts/box_plot.py" ]
[ "#!/usr/local/bin/python3\n# Copyright (c) 2020 Performance Portability authors\n# SPDX-License-Identifier: MIT\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom pathlib import Path\n\nimport argparse\n\n# Set up argument parsing\nparser = argparse.ArgumentParser(description=\"Produc...
[ [ "matplotlib.pyplot.close", "matplotlib.pyplot.xticks", "pandas.read_csv", "matplotlib.pyplot.savefig" ] ]
VDIGPKU/OPANAS
[ "873ff09a65d3253ce8351e54880a642517f7e8b5" ]
[ "mmdet/models/necks/info_paths.py" ]
[ "import torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import ConvModule, xavier_init, normal_init\nimport torch\nfrom mmdet.core import auto_fp16\nfrom ..builder import NECKS\nfrom mmcv.ops import DeformConv2d, deform_conv2d\nfrom torch.nn.modules.utils import _pair\nfrom torch.nn import init as in...
[ [ "torch.zeros", "torch.nn.ModuleList", "torch.nn.functional.conv2d", "torch.nn.init.normal_", "torch.nn.functional.interpolate", "torch.nn.modules.utils._pair", "torch.nn.ReLU", "torch.nn.functional.max_pool2d" ] ]
Yuzz1020/ViT-pytorch
[ "702b4eedd51a14f2194ebbd84b3e43242d30c229" ]
[ "train.py" ]
[ "# coding=utf-8\nfrom __future__ import absolute_import, division, print_function\n\nimport logging\nimport argparse\nimport os\nimport random\nimport numpy as np\n\nfrom datetime import timedelta\n\nimport torch\nimport torch.distributed as dist\n\nfrom tqdm import tqdm\nfrom torch.utils.tensorboard import Summary...
[ [ "torch.nn.CrossEntropyLoss", "numpy.random.seed", "torch.cuda.set_device", "torch.manual_seed", "torch.no_grad", "torch.cuda.manual_seed_all", "torch.cuda.is_available", "torch.device", "numpy.load", "torch.cuda.device_count", "torch.distributed.get_world_size", "to...
leiyangleon/RAiDER
[ "40c083a23ded02470939318daba36f3c2a25e52b" ]
[ "tools/RAiDER/models/weatherModel.py" ]
[ "import datetime\nimport os\nfrom abc import ABC, abstractmethod\n\nimport numpy as np\nimport netCDF4\nimport rasterio\nfrom shapely.geometry import box\n\nfrom RAiDER.constants import _ZREF, _ZMIN, _g0\nfrom RAiDER import utilFcns as util\nfrom RAiDER.interpolate import interpolate_along_axis\nfrom RAiDER.interpo...
[ [ "numpy.nanmax", "numpy.nanmin", "numpy.dtype", "numpy.concatenate", "numpy.max", "numpy.zeros_like", "numpy.any", "numpy.nanmean", "numpy.exp", "numpy.where", "numpy.trapz", "numpy.unique", "numpy.arange", "numpy.insert", "numpy.zeros", "numpy.log", ...
bluemixgarage/Mask_RCNN
[ "c8b42b0f582e0d6e6cc40e54b895de6b2e71c72d" ]
[ "mrcnn/model.py" ]
[ "\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implementation.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport random\nimport datetime\nimport re\nimport math\nimport logging\nfrom collections import OrderedDict...
[ [ "numpy.amax", "numpy.expand_dims", "tensorflow.concat", "tensorflow.control_dependencies", "tensorflow.stack", "tensorflow.reduce_sum", "tensorflow.minimum", "tensorflow.cast", "tensorflow.image.non_max_suppression", "tensorflow.equal", "tensorflow.image.crop_and_resize...
oOXpycTOo/FullStackDeepLearning
[ "f53a2307d5a0472320651f202294b608bff4946c" ]
[ "lab5/text_recognizer/models/cnn.py" ]
[ "from typing import Any, Dict, Tuple\nimport argparse\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nCONV_DIM = 64\nFC_DIM = 128\nIMAGE_SIZE = 28\nDEFAULT_BACKBONE = 'resnet'\nDEFAULT_BLOCK = 'residual'\nDEFAULT_POOL_TYPE = 'max_pool'\nSE_REDUCTION_RATE = 4\nN_BLOCKS = 2\n\n\nclass Con...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.nn.Conv2d", "torch.nn.Sigmoid", "torch.flatten", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Identity", "torch.nn.AdaptiveAvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
arthursoprano/pyJHTDB
[ "0de6e851540b49683c3c9af52a84fe94054956b5" ]
[ "pyJHTDB/test.py" ]
[ "########################################################################\n#\n# Copyright 2014 Johns Hopkins University\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# ht...
[ [ "matplotlib.pyplot.clabel", "numpy.random.random", "numpy.linspace", "numpy.fft.rfft", "numpy.sqrt", "numpy.arange", "numpy.abs", "numpy.random.random_sample", "numpy.random.randint", "numpy.random.rand", "numpy.average", "numpy.array", "numpy.zeros", "numpy...
awesome-archive/rlpyt
[ "47176abebc3a19791e34564e4fa6b1b267a68a61" ]
[ "rlpyt/models/pg/mujoco_lstm_model.py" ]
[ "\nimport numpy as np\nimport torch\n\nfrom rlpyt.utils.tensor import infer_leading_dims, restore_leading_dims\nfrom rlpyt.models.mlp import MlpModel\nfrom rlpyt.utils.collections import namedarraytuple\n\nRnnState = namedarraytuple(\"RnnState\", [\"h\", \"c\"])\n\n\nclass MujocoLstmModel(torch.nn.Module):\n\n d...
[ [ "torch.nn.Linear", "numpy.prod", "torch.nn.LSTM" ] ]
Arshin/flaskML
[ "eedaa7d9e33f33b962da84772e9b4220829da4ad" ]
[ "app.py" ]
[ "from flask import Flask, request, url_for, redirect, render_template, jsonify\r\nimport pickle\r\nimport pandas as pd\r\nimport numpy as np\r\n\r\napp = Flask(__name__)\r\n\r\nfilename = 'finalized_model.sav'\r\nmodel = pickle.load(open(filename, 'rb'))\r\ncols = ['preg', 'plas', 'pres', 'skin', 'test', 'mass', 'p...
[ [ "numpy.array", "numpy.float" ] ]
LXP-Never/Speech-signal-processing
[ "50646ee4c4174d68c03613e7385519a330f71940" ]
[ "语音识别/freq_transform.py" ]
[ "import numpy as np\nfrom scipy.io import wavfile\nimport matplotlib.pyplot as plt\n\nsampling_freq, audio = wavfile.read('input_freq.wav') # 读取文件\n\naudio = audio / np.max(audio) # 归一化,标准化\n\nlen_audio = len(audio) # 3251\n\n# 应用傅里叶变换\ntransformed_signal = np.fft.fft(audio)\nprint(transformed_signal)\n# [-0.0...
[ [ "numpy.fft.fft", "numpy.arange", "matplotlib.pyplot.plot", "numpy.max", "matplotlib.pyplot.ylabel", "numpy.ceil", "numpy.log10", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "scipy.io.wavfile.read", "matplotlib.pyplot.figure" ] ]
phemmer/tensorflow
[ "10dfd3256852bc85cc70f7672d945f307fcec145" ]
[ "tensorflow/python/keras/engine/base_layer.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.keras.mixed_precision.experimental.policy.serialize", "tensorflow.python.keras.backend.batch_get_value", "tensorflow.python.keras.mixed_precision.experimental.policy.policy_defaults_to_floatx", "tensorflow.python.framework.ops.executing_eagerly_outside_functions", "tensorflo...
nateagr/tf-yarn
[ "1f958256291a4cacc3c122900c86831b7882f1e3" ]
[ "tf_yarn/pytorch/model_ckpt.py" ]
[ "import os\nimport re\nimport logging\nfrom typing import Optional, Union, Dict, Any\n\nimport torch\nfrom torch.nn.parallel import DistributedDataParallel as DDP\nfrom cluster_pack import filesystem\n\nfrom tf_yarn.pytorch.tasks.worker import PYTORCH_DPP_RANK\n\n\n_logger = logging.getLogger(__name__)\n\n\ndef fin...
[ [ "torch.device", "torch.save" ] ]
leonardowei/pandas
[ "e0edc9912001e74f714958a49a79e8b62d1f0e5e" ]
[ "pandas/tests/groupby/test_grouping.py" ]
[ "\"\"\" test where we are determining what we are grouping, or getting groups \"\"\"\n\nimport numpy as np\nimport pytest\n\nimport pandas as pd\nfrom pandas import (\n CategoricalIndex,\n DataFrame,\n Index,\n MultiIndex,\n Series,\n Timestamp,\n date_range,\n)\nimport pandas._testing as tm\nf...
[ [ "pandas._testing.assert_almost_equal", "pandas.to_datetime", "pandas.Series", "pandas.RangeIndex", "pandas._testing.assert_dict_equal", "pandas.MultiIndex.from_tuples", "pandas.DataFrame", "numpy.dtype", "numpy.random.randn", "pandas._testing.assert_frame_equal", "numpy...
fun-math/Autumn-of-Automation
[ "08c04510f3500ac335f5c830ce3fbabb9c3fa05c" ]
[ "OpenCV/Q1,3.py" ]
[ "import cv2\nimport numpy as np\n\nimg=cv2.imread(\"meme.jpg\",1)\nrows,cols,channels=img.shape\n\nimg_hsv=cv2.cvtColor(img,cv2.COLOR_BGR2HSV)\n\nmask=cv2.inRange(img_hsv,(-5,50,70),(5,255,255))\nmask_inv=cv2.bitwise_not(mask)\n\ndst_bg=cv2.bitwise_and(img,img,mask=mask_inv)\nblue=np.zeros([rows,cols,channels])\nbl...
[ [ "numpy.zeros", "numpy.ones" ] ]
GalDude33/nmt2
[ "de602d04f9bea96ee099b0c23906211bb436ad90" ]
[ "nmt/utils/nmt_utils.py" ]
[ "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.gfile.Exists", "tensorflow.gfile.GFile", "numpy.expand_dims" ] ]
g-guichard/IT-Blog
[ "f4ee2c215ff1a5536178e6e3c90acce3fc646935" ]
[ "samples/DataScience/link-prediction-in-large-scale-networks/data_processing.py" ]
[ "\"\"\" Data processing module. \"\"\"\r\n\r\n# Imports\r\n\r\nimport networkx as nx\r\nfrom networkit import linkprediction as lp, nxadapter\r\nfrom functools import partial\r\nimport pandas as pd\r\n\r\n\r\n# Define local functions\r\n\r\ndef assign_label(pair, graph):\r\n u, v = pair[0], pair[1]\r\n return...
[ [ "pandas.concat", "pandas.DataFrame" ] ]
Eshikamahajan/Airlines-Sentiment-Analysis-
[ "9790b4311c717cf3d223649b78403748415e771a" ]
[ "sentiment.py" ]
[ "import streamlit as st\nimport pandas as pd\nimport numpy as np\nimport plotly.express as px\nfrom plotly.subplots import make_subplots\nimport plotly.graph_objects as go\nfrom wordcloud import WordCloud, STOPWORDS\nimport matplotlib.pyplot as plt\n\n#If required to read a data online , replace the existing URL w...
[ [ "matplotlib.pyplot.imshow", "pandas.read_csv", "pandas.to_datetime", "matplotlib.pyplot.yticks", "pandas.DataFrame", "matplotlib.pyplot.xticks" ] ]
Daniel1586/Initiative_RNN_tutorials
[ "a72f3da670e2c89581059334d4f593258dde240b" ]
[ "keras_working_with_text/001_reuters_mlp.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# Trains and evaluate a simple MLP on the Reuters newswire topic classification task.\n# 训练并评估一个简单的MLP(对路透社新闻主题分类)\n\nimport keras\nimport numpy as np\nfrom keras.datasets import reuters\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Act...
[ [ "numpy.max" ] ]
MiaoBao/MatchZoo-py
[ "752aa448b6df4a9d62eb7e8461481d9bb1c7cc30", "752aa448b6df4a9d62eb7e8461481d9bb1c7cc30" ]
[ "matchzoo/models/model_versions/bertknrm_ex_v6.py", "matchzoo/models/bertknrm_ex_v5.py" ]
[ "\"\"\"An implementation of Bert Model with knrm output layers with explanable structure \nv6\n- same as v5, but using shared bert for query and document\n- change kernel weight activation to relu\n\"\"\"\nimport typing\n\nimport torch\nimport torch.nn as nn\nfrom pytorch_transformers import BertModel\nimport torch...
[ [ "torch.nn.functional.normalize", "torch.nn.Dropout", "torch.zeros", "torch.nn.ModuleList", "torch.tensor", "torch.stack", "torch.nn.ReLU" ], [ "torch.nn.functional.normalize", "torch.nn.Dropout", "torch.zeros", "torch.nn.ModuleList", "torch.tensor", "torch.n...
ic/depthai-python
[ "fe6424277641dbff0f0fe705ddacdbb04a7bf06d" ]
[ "examples/rgb_mobilenet.py" ]
[ "#!/usr/bin/env python3\n\nfrom pathlib import Path\nimport cv2\nimport depthai as dai\nimport numpy as np\nimport time\nimport argparse\n\nnnPathDefault = str((Path(__file__).parent / Path('models/mobilenet-ssd_openvino_2021.2_6shave.blob')).resolve().absolute())\nparser = argparse.ArgumentParser()\nparser.add_arg...
[ [ "numpy.array" ] ]
NegriAndrea/soxs
[ "bb60eda228923fecbfdaec3c47c8d2d237c8a058" ]
[ "soxs/tests/test_spectra.py" ]
[ "from soxs.spectra import Spectrum, ConvolvedSpectrum\nfrom soxs.response import AuxiliaryResponseFile\nfrom numpy.testing import assert_allclose, assert_array_equal\nimport os\nimport tempfile\nimport shutil\n\n\ndef test_arithmetic():\n spec1 = Spectrum.from_powerlaw(1.0, 0.05, 1.0e-4, 0.1, 10.0, 10000)\n s...
[ [ "numpy.testing.assert_array_equal", "numpy.testing.assert_allclose" ] ]
eecshope/optuna
[ "b2daf0d9d032db03b7be49fc4856c78ac7d406e1" ]
[ "optuna/samplers/tpe/sampler.py" ]
[ "import math\n\nimport numpy as np\nimport scipy.special\nfrom scipy.stats import truncnorm\n\nfrom optuna import distributions\nfrom optuna.pruners import HyperbandPruner\nfrom optuna.samplers import base\nfrom optuna.samplers import random\nfrom optuna.samplers.tpe.parzen_estimator import _ParzenEstimator\nfrom o...
[ [ "numpy.minimum", "numpy.sqrt", "numpy.linspace", "numpy.asarray", "numpy.concatenate", "numpy.round", "numpy.exp", "numpy.arange", "numpy.ceil", "numpy.argmax", "numpy.log", "numpy.argsort", "numpy.random.RandomState", "numpy.maximum", "numpy.sort", ...
prashravoor/reid-strong-baseline
[ "9f964250a4418ae2389c7eac87e6132aeb5dbce7" ]
[ "tools/train.py" ]
[ "# encoding: utf-8\n\"\"\"\n@author: sherlock\n@contact: sherlockliao01@gmail.com\n\"\"\"\n\nimport argparse\nimport os\nimport sys\nimport torch\n\nfrom torch.backends import cudnn\n\nsys.path.append('.')\nfrom config import cfg\nfrom data import make_data_loader\nfrom engine.trainer import do_train, do_train_wit...
[ [ "torch.manual_seed", "numpy.random.seed", "torch.load" ] ]
Umasangavi/Thyroid_Disorder_Prediction
[ "6ef2b0a3f52e945b78dd756067cae01478e078a9" ]
[ "src/imbalance.py" ]
[ "import pandas as pd\r\nimport yaml\r\nimport os\r\nimport argparse\r\nfrom imblearn.over_sampling import RandomOverSampler\r\nfrom logger import App_Logger\r\n\r\nfile_object=open(\"application_logging/Loggings.txt\", 'a+')\r\nlogger_object=App_Logger()\r\n\r\ndef read_params(config_path):\r\n with open(config_...
[ [ "pandas.read_csv" ] ]
SuryaThiru/mlgauge
[ "fcdab7dcccaeea5c48972754dcbbbe289c51e775" ]
[ "mlgauge/analysis.py" ]
[ "import os\nfrom copy import deepcopy\nfrom datetime import datetime\n\nfrom tqdm import tqdm\nimport numpy as np\nimport pandas as pd\nimport xarray as xr\nimport seaborn as sns\nimport pmlb\nimport openml\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.utils import check_random_state\n\nfrom...
[ [ "pandas.isnull", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "pandas.MultiIndex.from_product", "numpy.array", "sklearn.utils.check_random_state" ] ]
text-machine-lab/HierarchicalTransformer
[ "639e620484f8b6e8b8b87fd9424130aeeaa74f65" ]
[ "transformer/Translator.py" ]
[ "''' This module will handle the text generation with beam search. '''\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom transformer.Models import Transformer\nfrom transformer.Beam import Beam\nimport transformer.Constants as Constants\n\nclass Translator(object):\n ''' Load with t...
[ [ "torch.LongTensor", "torch.nn.LogSoftmax", "torch.load", "torch.cat", "torch.no_grad", "torch.cuda.is_available", "torch.arange", "torch.topk", "torch.stack" ] ]
bstellato/mlopt
[ "b72930ab9e219a94895b731a306e3023e33d862e" ]
[ "mlopt/tests/test_parallel.py" ]
[ "import unittest\nimport numpy as np\nimport numpy.testing as npt\nfrom mlopt.optimizer import Optimizer\nfrom mlopt.settings import PYTORCH\nfrom mlopt.problem import Problem\nfrom mlopt.tests.settings import TEST_TOL as TOL\nfrom mlopt.sampling import uniform_sphere_sample\nimport pandas as pd\nimport cvxpy as cp...
[ [ "numpy.sqrt", "numpy.random.seed", "numpy.ones", "numpy.random.randn", "numpy.random.rand", "numpy.testing.assert_array_almost_equal" ] ]
pl8787/DeepRank_PyTorch
[ "ec24f83168aeadad7f89fd9fae5992abd0da89b1" ]
[ "deeprank/dataset.py" ]
[ "\"\"\"This is the Data Utils for Letor source code.\n\nThis module is used to read data from letor dataset.\n\"\"\"\n\n__version__ = '0.2'\n__author__ = 'Liang Pang'\n\nimport json\nimport random\nimport sys\n\nimport numpy as np\nimport torch\n\nfrom deeprank import utils\n\n\nclass DataLoader():\n\n def __ini...
[ [ "numpy.zeros" ] ]
solstag/isgc-congress
[ "c1ea92cec81f14d8cdc355730d3d85cd248b75b6" ]
[ "src/sashimi/__init__.py" ]
[ "#! /usr/bin/env python\n\nimport pandas as pd\nfrom .clean import clean_text\n\n\"\"\" NOTES\n\n- Data columns:\n ['abstract_text',\n 'abstract_title',\n 'bibliography',\n 'cancelled',\n 'code',\n 'figure_legend_1',\n 'figure_legend_2',\n 'figure_title_1',\n 'figure_title_2',\n ...
[ [ "pandas.read_csv" ] ]
HakobJak/ml-mipt
[ "ab0cbd5d553e9da309bda54d35b4e93a8eb99696" ]
[ "homeworks_advanced/extra_lab_qa/util.py" ]
[ "\"\"\"Utility classes and methods.\n\nAuthor:\n Chris Chute (chute@stanford.edu)\n\"\"\"\nimport logging\nimport os\nimport queue\nimport re\nimport shutil\nimport string\nimport torch\nimport torch.nn.functional as F\nimport torch.utils.data as data\nimport tqdm\nimport numpy as np\nimport ujson as json\n\nfro...
[ [ "torch.ones", "torch.max", "torch.cuda.set_device", "torch.load", "torch.cat", "torch.from_numpy", "torch.tensor", "torch.matmul", "torch.save", "torch.cuda.is_available", "torch.device", "numpy.load", "torch.cuda.device_count", "numpy.array", "torch.arg...
tonghe90/MinkowskiEngine-1
[ "0f1bc41a2c7ce85a25e575663fcc5582996ffbff" ]
[ "MinkowskiEngine/SparseTensor.py" ]
[ "# Copyright (c) Chris Choy (chrischoy@ai.stanford.edu).\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including without limitation the rights to\n# use, co...
[ [ "torch.Size", "torch.floor", "torch.zeros", "torch.cat", "torch.sparse.DoubleTensor", "torch.IntTensor", "torch.sparse.FloatTensor" ] ]
team-oss/scrape-cran
[ "e46e4c4dfb0079c954112adaa9d230480c2970ae" ]
[ "src/dspg17/ckelling/ScrapingCode/source_forge/LastYear/cleaningJH.py" ]
[ "import pandas as pd\nimport datetime\n\ncategories = ['Audio and Video', 'Business and Enterprise', 'Communications', 'Development', 'Games', 'Graphics', 'Home and Education', 'Science and Engineering', 'Security and Utilities', 'System Administration']\ntimes = [datetime.datetime(year = 2016, month = 10, day = 12...
[ [ "pandas.read_csv" ] ]
davidoj/RL_Aggregation
[ "d1f7fa01016660963e87dd4bcdb475a7b4aed466" ]
[ "Agents.py" ]
[ "'''\nReinforcement learning agents.\n\n\n\nDavid Johnston 2015\n'''\n\n\nimport numpy as np\nimport collections\nimport numbers\nimport random\n\nrandom.seed(1)\n\nclass OnlineAgent:\n \"\"\"\n Generic online agent class; executes e-greedy policy, looks up values\n \"\"\"\n \n def __init__(self,prob...
[ [ "numpy.log2", "numpy.full_like", "numpy.average", "numpy.array", "numpy.zeros" ] ]
lu791019/iii_HA_Image_Recognition_DL
[ "d5f56d62af6d3aac1c216ca4ff309db08a8c9072" ]
[ "src/keras/keras/datasets/reuters.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"Reuters topic classification dataset.\r\n\"\"\"\r\nfrom __future__ import absolute_import\r\nfrom __future__ import division\r\nfrom __future__ import print_function\r\n\r\nfrom ..utils.data_utils import get_file\r\nfrom ..preprocessing.sequence import _remove_long_seq\r\nimport nu...
[ [ "numpy.load", "numpy.array", "numpy.random.RandomState" ] ]
jmettes/PyRate
[ "4b61cefca9522f4546cd45e1691eb00d3e10ec34" ]
[ "tests/test_refpixel.py" ]
[ "# This Python module is part of the PyRate software package.\n#\n# Copyright 2020 Geoscience Australia\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://...
[ [ "numpy.isnan" ] ]
fhooton/FoodMine
[ "2120adc535df1df79c14c20eea8695a794cb5b52" ]
[ "src/tools/chemidr/id_map.py" ]
[ "# Author: Forrest Hooton\n\nimport numpy as np\nimport math\nimport urllib.request as request\nimport requests\nimport time\nimport json\nfrom lxml import etree\n\n\ndef cid2prop(cid, prop):\n\t# Create url for InChI query\n\turl = f\"https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/{str(int(cid))}/property/...
[ [ "numpy.asarray", "numpy.ndarray.tolist" ] ]
heumchri/bark
[ "867e1e4a289f185bae52d659b99abbf108fe1fd4" ]
[ "modules/world/tests/py_map_interface_tests.py" ]
[ "# Copyright (c) 2019 fortiss GmbH\n#\n# This software is released under the MIT License.\n# https://opensource.org/licenses/MIT\n\nimport unittest\nimport time\nimport math\nimport filecmp\nimport matplotlib.pyplot as plt\nfrom bark.world.agent import *\nfrom bark.models.behavior import *\nfrom bark.world import *...
[ [ "numpy.set_printoptions" ] ]
Stevenah/keras-training-system
[ "ef15519d84335621f3e8f73db68cd54134e723fe" ]
[ "experiments/densenet169_trained_on_medical_dataset/_sources/logging_44c21d0c4e2f675554adcf905290024d.py" ]
[ "\nfrom utils.util import pad_string\n\nimport numpy as np\n\nimport os\n\nBASIC_METRICS = {\n 'TP': 'true positive',\n 'TN': 'true negative',\n 'FP': 'false positive',\n 'FN': 'false negative'\n}\n\nADVANCED_METRICS = {\n 'f1': 'f1',\n 'rec': 'recall',\n 'acc': 'accuracy',\n 'prec': 'metthe...
[ [ "numpy.array_str", "numpy.mean" ] ]
jonpodtu/jonpo_02476
[ "8c34d80fb205f546976df0051c5fbd5f0c87fe37" ]
[ "src/models/train_model.py" ]
[ "import os\n\nimport hydra\nimport matplotlib.pyplot as plt\nimport torch\nfrom hydra.utils import to_absolute_path\nfrom model import MyAwesomeModel\nfrom omegaconf import DictConfig\nfrom torch import optim\nfrom torch.utils.data import DataLoader, TensorDataset\n\n\n@hydra.main(config_path=\"config\", config_nam...
[ [ "matplotlib.pyplot.legend", "torch.nn.NLLLoss", "torch.utils.data.DataLoader", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
usert5432/lstm_ee
[ "342ed4f5245311924d6a06b38c4f28eac77778e9" ]
[ "tests/data_generator/tests_data_generator_base.py" ]
[ "\"\"\"Helper blocks to create IDataGenerator tests\"\"\"\n\nimport numpy as np\n\nfrom lstm_ee.data.data_loader.dict_loader import DictLoader\nfrom lstm_ee.data.data_generator.data_generator import DataGenerator\nfrom ..data import (\n TEST_DATA, TEST_INPUT_VARS_SLICE, TEST_INPUT_VARS_PNG3D,\n TEST_INP...
[ [ "numpy.array" ] ]
xroynard/ms_deepvoxscene
[ "e1800a5628e6b9ab20c12d1939e04ac2fd3b4cfc" ]
[ "utils/tester.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n@author: Xavier Roynard\n\"\"\"\n\nfrom __future__ import print_function, division\n\nimport time\nimport os\nimport sys\nimport numpy as np\n\nimport torch\nimport torch.nn.functional as F\n\nimport torch.backends.cudnn as cudnn\ncudnn.benchmark = True\n\n#...
[ [ "torch.nn.functional.softmax", "torch.max", "torch.sum", "torch.set_grad_enabled", "numpy.zeros", "torch.squeeze" ] ]
danielchen-pyc/gmr
[ "6d87623cbc642fbdfab4044ed40cbabed12f3986" ]
[ "gmr/tests/test_sklearn.py" ]
[ "import numpy as np\nfrom numpy.testing import assert_array_almost_equal\nfrom gmr.utils import check_random_state\nfrom nose.tools import assert_less, assert_greater\nfrom nose.plugins.skip import SkipTest\n\n\ndef test_sklearn_regression():\n \"\"\"Test regression with GaussianMixtureRegressor.\"\"\"\n try:...
[ [ "numpy.linspace", "numpy.ones", "numpy.array", "numpy.sum", "numpy.vstack" ] ]
lidayuls/conv-emotion
[ "954805e4236ca8c64ee1f2fb25130deec8a2d52f" ]
[ "DialogueRNN/model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pad_sequence\n\nclass SimpleAttention(nn.Module):\n\n def __init__(self, input_dim):\n super(SimpleAttention, self).__init__()\n self.input_dim = input_dim\n self.scalar = nn.Linear(self.inp...
[ [ "torch.nn.functional.softmax", "torch.cat", "torch.zeros", "torch.nn.utils.rnn.pad_sequence", "torch.nn.GRU", "torch.sum", "torch.nn.Embedding", "torch.FloatTensor", "torch.cuda.is_available", "torch.nn.Dropout", "torch.from_numpy", "torch.bmm", "torch.nn.GRUCel...
WingsUpete/RSODP
[ "35478b02a438c9af2d5d04ee3c60ce70f7c15269" ]
[ "utils/Utils.py" ]
[ "\"\"\"\nUtility functions\n\"\"\"\nimport math\n\nimport numpy as np\nimport os\nimport matplotlib.pyplot as plt\nfrom matplotlib.lines import Line2D\nimport torch\n\nimport Config\n\n\ndef haversine(c0, c1):\n \"\"\"\n :param c0: coordinate 0 in form (lat0, lng0) with degree as unit\n :param c1: coordina...
[ [ "matplotlib.pyplot.legend", "torch.abs", "torch.zeros", "matplotlib.pyplot.plot", "torch.no_grad", "torch.pow", "matplotlib.pyplot.tight_layout", "torch.sqrt", "matplotlib.pyplot.figure", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "torch.cuda.empty_cache",...
ziashen/deblocking_pytorch
[ "b156c5cbd26f0833089e5f1aee6e6d046579b56d" ]
[ "dataset/h5_data.py" ]
[ "# h5_data.py\n\n\nfrom __future__ import print_function\n\nimport os\nimport Image\nimport numpy\nimport h5py\n# import math\n\n'''\ngenerate train_data.h5 and test_data.h5\n\n'''\n# ori images have only 1 channel, while compressed images have 3 channels\nTRAIN_DATA_PATH = \"cmp_y/train/\"\nTRAIN_LABEL_PATH = \"or...
[ [ "numpy.asarray", "numpy.array" ] ]
Valts-M/openvslam-1
[ "12e1778511eb30af4a5ea9153824fe8dc1460996" ]
[ "report_generator/tools/data_linewidth_plot.py" ]
[ "import matplotlib.pyplot as plt\n\nclass data_linewidth_plot():\n def __init__(self, x, y, **kwargs):\n self.ax = kwargs.pop(\"ax\", plt.gca())\n self.fig = self.ax.get_figure()\n self.lw_data = kwargs.pop(\"linewidth\", 1)\n self.lw = 1\n self.fig.canvas.draw()\n\n sel...
[ [ "matplotlib.pyplot.gca" ] ]
VisualComputingInstitute/reid-tracking
[ "13c90ec698c6ce39aff8bc88d1ca9510b94bf931" ]
[ "simple_track_duke.py" ]
[ "# -*- coding: utf-8 -*-\n#TODO: comments/doc\n\nimport numpy as np\nfrom filterpy.kalman import KalmanFilter\nimport scipy\nfrom scipy import ndimage\nfrom scipy import signal\nfrom scipy.linalg import block_diag,inv\nfrom filterpy.common import Q_discrete_white_noise\nfrom filterpy.stats import plot_covariance_el...
[ [ "numpy.array", "numpy.random.rand", "scipy.linalg.block_diag" ] ]
RyusukeYamano/nngen
[ "9ed1f7fb83908794aa94d70287d89545d45fe875" ]
[ "tests/onnx_matrix_conv2d_resblock/onnx_matrix_conv2d_resblock.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import print_function\n\nimport os\nimport sys\nimport functools\nimport math\nimport numpy as np\n\nimport torch\nimport torchvision\nimport torchvision.transforms as transforms\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.autograd\n...
[ [ "torch.onnx.export", "torch.add", "numpy.clip", "torch.randn", "torch.nn.Conv2d", "torch.from_numpy", "numpy.round", "numpy.random.normal", "torch.nn.BatchNorm2d", "numpy.transpose", "numpy.zeros", "numpy.sum" ] ]
lcubelongren/BCCN_classwork
[ "0f5cf9e44bca54b5aba5aeb826586d1aaaa777d1" ]
[ "MHBF/given/exercise8/gridworld.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\nimport base64\nfrom tempfile import NamedTemporaryFile\nfrom IPython.display import HTML\n\n\ndef display_animation(anim):\n \"\"\"\n Create a display object that displays an animation as interactive\n Javascrip...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.plot", "matplotlib.pyplot.quiver", "numpy.copy", "numpy.argmax", "matplotlib.pyplot.subplot", "matplotlib.pyplot.close", "matplotlib.pyplot.axis", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.animation.ArtistAnima...