repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
kakaobrain/bassl
[ "551fe94343debf60a64c787be6752284153a0f7a" ]
[ "bassl/pretrain/utils/metric.py" ]
[ "\"\"\"\n- kNN Precision\n\"\"\"\n\nfrom collections import defaultdict\n\nimport torch\nimport torchmetrics\n\n\nclass KnnPrecisionMetric(torchmetrics.Metric):\n def __init__(self, top_k_list):\n super().__init__(compute_on_step=False, dist_sync_on_step=True)\n self.add_state(\"feat_data\", defaul...
[ [ "torch.stack", "torch.argsort", "torch.eye", "torch.cuda.empty_cache" ] ]
PolymerGuy/AXITOM
[ "7682be5b21fa933b9bea4082fe9a830076431feb" ]
[ "axitom/phantoms.py" ]
[ "import numpy as np\n\n\"\"\" Phantoms\n\nThis module contains the phantoms that can be used for forward projection and virtual experiments\n\n\"\"\"\n\ndef barrel(domain_size=128, outer_rad_fraction=0.7,center_val=None):\n \"\"\" Barrel shaped phantom with a linear density gradient\n The domain size is cubic...
[ [ "numpy.arange", "numpy.zeros", "numpy.sqrt" ] ]
seanliu96/R-Net
[ "8462330451079a2ff67cd431fe30a57a6ca3d802" ]
[ "util.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport re\nfrom collections import Counter\nimport string\n\n\ndef get_record_parser(config, is_test=False):\n def parse(example):\n para_limit = config.test_para_limit if is_test else config.para_limit\n ques_limit = config.test_ques_limit if is_test e...
[ [ "tensorflow.constant", "tensorflow.FixedLenFeature", "tensorflow.less", "tensorflow.data.TFRecordDataset", "tensorflow.decode_raw", "tensorflow.less_equal", "tensorflow.cast", "numpy.iinfo", "tensorflow.where", "tensorflow.contrib.data.group_by_window" ] ]
Praneethvvs/CircleCi_FastApi
[ "0aec14fcffcfe7053cf7db688728347feea26f70" ]
[ "selenium_pipeline/hyatt_hotels_fetch_addresses.py" ]
[ "import time\n\nimport pandas as pd\nfrom selenium import webdriver\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.support.ui import WebDriverWait\nfrom selenium.webdriver.support import expected_conditions as EC\nfrom selenium.webdriver.common.desired_capabilities import DesiredCapabilities\...
[ [ "pandas.DataFrame" ] ]
joshuabuildsthings/GamestonkTerminal
[ "385d12803ae1725a22b0a440c3b88bffa974edcd" ]
[ "openbb_terminal/stocks/discovery/fidelity_view.py" ]
[ "\"\"\" Fidelity View \"\"\"\n__docformat__ = \"numpy\"\n\nimport logging\nimport os\nimport re\n\nimport pandas as pd\n\nfrom openbb_terminal.decorators import log_start_end\nfrom openbb_terminal.helper_funcs import export_data, print_rich_table\nfrom openbb_terminal.stocks.discovery import fidelity_model\nfrom op...
[ [ "pandas.set_option" ] ]
weaselers/candy_cane_contest
[ "1d619529cd8640c20b534ec9a3f6d5f786bb78aa" ]
[ "pull_vegas_slot_machine_v9.py" ]
[ "import numpy as np\nimport pandas as pd\nimport random, os, datetime, math\nfrom random import shuffle\nfrom collections import OrderedDict\nfrom collections import defaultdict\n\n\ntotal_reward = 0\nbandit_dict = {}\n\n\ndef set_seed(my_seed=42):\n os.environ[\"PYTHONHASHSEED\"] = str(my_seed)\n random.seed...
[ [ "numpy.random.seed" ] ]
nytbliang/siamattnat
[ "880643ee09e7e4fa6a0af9631a9a8b32dd06c94d" ]
[ "tools/test.py" ]
[ "# Copyright (c) SenseTime. All Rights Reserved.\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport argparse\nimport os\n\nimport cv2\nimport torch\nimport numpy as np\n\nfrom pysot.core.config import c...
[ [ "numpy.array", "torch.set_num_threads" ] ]
CADWRDeltaModeling/vtools3
[ "226bd2920c73f36dfc2f4eaedda8adccdfd1dfc3" ]
[ "vtools/datastore/station_info.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport sys\nimport pandas as pd\nimport argparse\nfrom vtools.datastore import station_config\n\ndef station_info(search):\n station_lookup = station_config.config_file(\"station_dbase\")\n if search == \"config\":\n print(station_config.configuration(...
[ [ "pandas.read_csv" ] ]
adrn/gaia
[ "dac05003f7952af88697b271295a90bb0df091ec" ]
[ "pyia/data.py" ]
[ "# coding: utf-8\n\"\"\" Data structures. \"\"\"\n\n# Standard library\nimport pathlib\n\n# Third-party\nimport astropy.coordinates as coord\nfrom astropy.table import Table, Column\nfrom astropy.time import Time\nimport astropy.units as u\nimport numpy as np\n\nfrom .extinction import get_ext\nfrom .ruwetools impo...
[ [ "numpy.sqrt", "numpy.isfinite", "numpy.asarray", "numpy.isnan", "numpy.stack", "numpy.random.RandomState", "numpy.vstack" ] ]
lvwuyunlifan/crop
[ "7392d007a8271ff384c5c66ed5717afbc4172b4d" ]
[ "logger.py" ]
[ "# Code referenced from https://gist.github.com/gyglim/1f8dfb1b5c82627ae3efcfbbadb9f514\n\nimport tensorflow as tf\n\nimport numpy as np\n\nimport scipy.misc\n\ntry:\n\n from StringIO import StringIO # Python 2.7\n\nexcept ImportError:\n\n from io import BytesIO # Python 3.x\n\n\nclass Logger(object):\n\n ...
[ [ "tensorflow.summary.FileWriter", "numpy.min", "numpy.max", "tensorflow.Summary.Value", "numpy.prod", "tensorflow.HistogramProto", "tensorflow.Summary", "numpy.histogram", "numpy.sum" ] ]
neurodata/bilateral-connectome
[ "b04162f84820f81cf719e8a5ddd4dae34d8f5f41" ]
[ "pkg/pkg/utils/toy.py" ]
[ "import numpy as np\nimport pandas as pd\nimport seaborn as sns\nfrom graspologic.simulations import sbm\n\n\ndef sample_toy_networks(seed=888888, ns=None, B=None):\n np.random.seed(seed)\n if ns is None:\n ns = [5, 6, 7]\n if B is None:\n B = np.array([[0.8, 0.2, 0.05], [0.05, 0.9, 0.2], [0....
[ [ "numpy.arange", "numpy.array", "numpy.random.seed" ] ]
DarrenZhang01/Neural_Tangents_TensorFlow
[ "2fd360c8b1b8c9106044034f6a8b5c2734db9c3d" ]
[ "tf_dot_general/tf_dot_general_test.py" ]
[ "# Copyright 2020 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.array", "tensorflow.python.platform.test.main", "numpy.ones" ] ]
hhcho/densvis
[ "d65bb3133a5072356f45d2d6f4f0d16ad33032fd" ]
[ "densmap/densmap.py" ]
[ "import sys\nimport numpy as np\nimport argparse\nimport pickle\n\nimport densmap\nfrom sklearn.datasets import load_digits\n\ndef parse_args():\n parser = argparse.ArgumentParser(description=__doc__)\n parser.add_argument('-i','--input', help='Input .txt or .pkl', default='data.txt')\n parser.add_argument...
[ [ "numpy.savetxt", "numpy.stack", "numpy.loadtxt" ] ]
gkbharathy/econ_model_02
[ "d91ddf148b009bf79852d9aec70f3a1877e0f79a" ]
[ "dolo/algos/value_iteration.py" ]
[ "import time\nimport numpy as np\nimport numpy\nimport scipy.optimize\nfrom dolo.numeric.processes import DiscretizedIIDProcess\n# from dolo.numeric.decision_rules_markov import MarkovDecisionRule, IIDDecisionRule\nfrom dolo.numeric.decision_rule import DecisionRule, ConstantDecisionRule\nfrom dolo.numeric.grids im...
[ [ "numpy.zeros", "numpy.zeros_like" ] ]
dokato/mne-python
[ "a188859b57044fa158af05852bcce2870fabde91" ]
[ "mne/decoding/transformer.py" ]
[ "# -*- coding: utf-8 -*-\n# Authors: Mainak Jas <mainak@neuro.hut.fi>\n# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# Romain Trachel <trachelr@gmail.com>\n#\n# License: BSD (3-clause)\n\nimport numpy as np\n\nfrom .mixin import TransformerMixin\nfrom .base import BaseEstimator\n...
[ [ "numpy.asarray", "numpy.reshape", "sklearn.preprocessing.RobustScaler", "numpy.atleast_2d", "numpy.atleast_3d", "numpy.zeros_like", "numpy.mean", "numpy.transpose", "sklearn.preprocessing.StandardScaler" ] ]
timothyfisherphd/CRISPR_Cancer_Chromatin_State_Activity
[ "91cbd8519baaeccab404574d61e21dbf0ea1f26f" ]
[ "main02_ceres_data.py" ]
[ "## Generating Ceres Data\nfrom collections import defaultdict\nimport pandas as pd\n\nmainDicticionary=defaultdict(list)\nstateDictionary=defaultdict(list)\ncountScoreDictionary=defaultdict(int)\nsumScoreDictionary=defaultdict(int)\nmeanScoreDictionary=defaultdict(int)\n\nn = 0\nwith open('/Users/timothyfisher/Des...
[ [ "numpy.std" ] ]
AnesBenmerzoug/ray
[ "5921e87ecd4e359fad60dab55f45855456d591e5" ]
[ "rllib/agents/trainer.py" ]
[ "from datetime import datetime\nimport numpy as np\nimport copy\nimport logging\nimport math\nimport os\nimport pickle\nimport time\nimport tempfile\nfrom typing import Callable, Dict, List, Optional, Type, Union\n\nimport ray\nfrom ray.exceptions import RayError\nfrom ray.rllib.agents.callbacks import DefaultCallb...
[ [ "numpy.stack" ] ]
Archer-pro666/BAAF-Net
[ "663d1681d4d05ad3caaacd98e6dedfdc9caa4930" ]
[ "helper_tf_util.py" ]
[ "\"\"\" Wrapper functions for TensorFlow layers.\n\nAuthor: Charles R. Qi\nDate: November 2016\n\"\"\"\n\nimport numpy as np\nimport tensorflow as tf\n\n\ndef _variable_on_cpu(name, shape, initializer, use_fp16=False):\n \"\"\"Helper to create a Variable stored on CPU memory.\n Args:\n name: name of the ...
[ [ "tensorflow.device", "tensorflow.get_variable", "numpy.sqrt", "tensorflow.control_dependencies", "tensorflow.nn.max_pool", "tensorflow.stack", "tensorflow.nn.conv2d_transpose", "tensorflow.train.ExponentialMovingAverage", "tensorflow.nn.l2_loss", "tensorflow.nn.conv1d", ...
AdrienCorenflos/tensorflow
[ "1b5220e89fecca70375b372a5bddc7f961c6a736" ]
[ "tensorflow/python/data/util/nest_test.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.data.util.nest.map_structure_up_to", "tensorflow.python.framework.sparse_tensor.SparseTensorValue", "tensorflow.python.data.util.nest.assert_same_structure", "tensorflow.python.data.util.nest.is_sequence", "tensorflow.python.data.util.nest.flatten_up_to", "numpy.ones", ...
tblondelle/TransferLearningProject
[ "1c6a9bba2480919e22dd08756f328a47a321eafa", "1c6a9bba2480919e22dd08756f328a47a321eafa", "1c6a9bba2480919e22dd08756f328a47a321eafa" ]
[ "learning/MLP_base.py", "learning/classifiers_in_progress/Word2Vec_legacy.py", "learning/classifiers_in_progress/Regressors.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals, print_function, division\nfrom io import open\nimport unicodedata\nimport string\nimport re\nimport random\nimport os\nimport time\n\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.decomposition import TruncatedSVD\nfrom s...
[ [ "sklearn.decomposition.TruncatedSVD", "torch.Tensor", "torch.nn.Linear", "torch.FloatTensor", "torch.cuda.is_available", "torch.nn.L1Loss", "sklearn.feature_extraction.text.TfidfVectorizer", "torch.save" ], [ "numpy.zeros", "numpy.linalg.norm" ], [ "sklearn.metr...
chencq1234/ssds.pytorch
[ "340aeac3e5f15ffeee6750f40bfbd64343926fc9" ]
[ "lib/dataset/dataset_factory.py" ]
[ "from lib.dataset import voc\nfrom lib.dataset import coco\n\ndataset_map = {\n 'voc': voc.VOCDetection,\n 'coco': coco.COCODetection,\n }\n\ndef gen_dataset_fn(name):\n \"\"\"Returns a dataset func.\n\n Args:\n name: The name of the dataset.\n\n Returns:\n fu...
[ [ "torch.utils.data.DataLoader", "torch.from_numpy", "torch.is_tensor", "torch.stack", "numpy.empty" ] ]
ninamiolane/move
[ "83ab147ad1ebab6972591357f02fa29e186116f0" ]
[ "move/config.py" ]
[ "import logging\nimport torch\n\n#Set the configuration of the model \nlogging.info('Confirgure the run')\nbatch_size = 8\nlearning_rate= 3e-4\nepochs = 10\nseq_len=128\nnegative_slope = 0 #LeakyRelu\n\nlogging.info('Setup device')\nif torch.cuda.is_available():\n device = torch.device('cuda')\nelse:\n device...
[ [ "torch.device", "torch.cuda.is_available" ] ]
sc0ttms/SE-TFCN
[ "466a2d641c6ff4184c768c1e7aaf2b8a8158ce51" ]
[ "dataset/compute_metrics.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport sys\nimport os\nimport argparse\nimport toml\nimport librosa\nimport pandas as pd\nimport numpy as np\nfrom tqdm import tqdm\nfrom joblib import Parallel, delayed\n\nsys.path.append(os.getcwd())\nfrom audio.metrics import SI_SDR, STOI, WB_PESQ, NB_PESQ, REGISTERED_METRICS\n\n\ndef...
[ [ "pandas.read_csv", "numpy.mean", "pandas.DataFrame" ] ]
xwhan/fairseq-wklm
[ "9c7c927fca75cd2b08c0207ff7f7682ed95a98e0" ]
[ "fairseq/modules/fb_elmo_token_embedder.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nfrom typing import Dic...
[ [ "torch.nn.Softmax", "torch.nn.Dropout", "torch.ones", "torch.full", "torch.cat", "torch.nn.init.constant_", "torch.Tensor", "torch.nn.init.xavier_normal_", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.no_grad", "torch._dim_arange" ] ]
revsic/tf-attentive-neural-process
[ "efa3bb0a9b6cfebaa3c1e025a9da00aef8d0a1e2" ]
[ "neural_process/anp.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport tensorflow_probability as tfp\n\nfrom neural_process.module.base import Encoder, Decoder, GaussianProb\n\nclass AttentiveNP:\n \"\"\"Attentive Neural Process\n Attributes:\n z_encoder: Encoder, encoder for latent representation\n z_prob: Gauss...
[ [ "tensorflow.concat", "tensorflow.shape", "tensorflow.reduce_sum", "tensorflow.expand_dims", "numpy.mean" ] ]
Spinch/CarND-Capstone
[ "7e507df9f1cc72c76514907464ca9ca3d3ac9e85" ]
[ "ros/src/tl_detector/light_classification/tl_classifierNN.py" ]
[ "\nimport rospy\nimport cv2\nimport numpy as np\nfrom styx_msgs.msg import TrafficLight\nfrom darknet_ros_msgs.msg import BoundingBoxes\n\nclass TLClassifierNN(object):\n def __init__(self):\n #TODO load classifier\n self.lastBBox = [[0, 0], [0, 0]]\n self.lastBBoxT = rospy.get_time()\n\n ...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.multiply" ] ]
maropu/lljvm-translator
[ "322fbe24a27976948c8e8081a9552152dda58b4b" ]
[ "python/src/test/resources/pyfunc/numpy_random12_test.py" ]
[ "import numpy as np\n\ndef numpy_random12_test(n):\n return np.random.random_sample(n)\n" ]
[ [ "numpy.random.random_sample" ] ]
ZachMontgomery/PolyFits
[ "0634bcd3a24b12a22b566a0c134cddf733d28641" ]
[ "test/test_multivariablePolynomialFit_Function.py" ]
[ "import numpy as np\nimport polyFits as pf\nimport json\n\nfn = './test/'\nf = open(fn+'database.txt', 'r')\ndatabase = f.readlines()\nf.close()\n\naoa, dp, cl, cd, cm = [], [], [], [], []\nfor line in database[1:]:\n aoa.append( float( line[ 8: 25] ) )\n dp.append( float( line[ 34: 51] ) )\n cl.append( ...
[ [ "numpy.array" ] ]
tpmp-inra/ipapi
[ "b0f6be8960a20dbf95ef9df96efdd22bd6e031c5" ]
[ "ipt/ipt_filter_contour_by_size.py" ]
[ "from ipso_phen.ipapi.base.ipt_abstract import IptBase\r\nfrom ipso_phen.ipapi.tools import regions\r\nimport numpy as np\r\nimport cv2\r\n\r\nimport logging\r\n\r\nlogger = logging.getLogger(__name__)\r\n\r\nfrom ipso_phen.ipapi.base import ip_common as ipc\r\n\r\n\r\nclass IptFilterContourBySize(IptBase):\r\n ...
[ [ "numpy.zeros_like", "numpy.dstack" ] ]
ekhoda/optimization-tutorial
[ "8847625aa49813823b47165c5f457294729459b6" ]
[ "process_data.py" ]
[ "import pandas as pd\n\nfrom helper import load_raw_data\n\n\ndef load_data():\n return get_modified_data(load_raw_data())\n\n\ndef get_modified_data(input_df_dict):\n # Our \"parameters\" table is very simple here. So, we can create a new dictionary\n # for our parameters as follows or just modify our df ...
[ [ "pandas.DataFrame" ] ]
ericgarza70/machine-learning-book
[ "40520104c3d76d75ce4aa785e59e8034f74bcc8e" ]
[ "ch16/ch16-part1-self-attention.py" ]
[ "# coding: utf-8\n\n\nimport sys\nfrom python_environment_check import check_packages\nimport torch\nimport torch.nn.functional as F\n\n# # Machine Learning with PyTorch and Scikit-Learn \n# # -- Code Examples\n\n# ## Package version checks\n\n# Add folder to path in order to load from the check_packages.py script...
[ [ "torch.nn.functional.softmax", "torch.empty", "torch.zeros", "torch.manual_seed", "torch.nn.Embedding", "torch.tensor", "torch.matmul", "torch.nn.Linear", "torch.rand", "torch.bmm", "torch.allclose", "torch.dot" ] ]
LucasPagano/sga-
[ "5b4b88ebf826c2be022f34eb66d5a712b911724a" ]
[ "scripts/train.py" ]
[ "import argparse\nimport gc\nimport logging\nimport os\nimport sys\nimport time\n\nfrom collections import defaultdict\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\nfrom sgan.data.loader import data_loader\nfrom sgan.losses import gan_g_loss, gan_d_loss, l2_loss\nfrom sgan.losses import dis...
[ [ "torch.cuda.synchronize", "torch.load", "torch.cat", "torch.zeros", "torch.min", "torch.sum", "torch.numel", "torch.no_grad", "torch.save", "torch.stack", "torch.nn.init.kaiming_normal_" ] ]
BryanYehuda/CompressionMethodComparison
[ "79db365b46242e49116f92bb871545c0fce26635" ]
[ "CompressionCheck.py" ]
[ "from math import log10, sqrt\nimport cv2\nimport numpy as np\n \ndef PSNR(original, compressed):\n mse = np.mean((original - compressed) ** 2)\n if(mse == 0):\n return 100\n max_pixel = 255.0\n psnr = 20 * log10(max_pixel / sqrt(mse))\n return psnr\n\ndef SNR(original, compressed):\n mse ...
[ [ "numpy.mean" ] ]
A03ki/f-AnoGAN
[ "fecd9672f8f216e2d9ee618b2a03ed6b6d2fa3ba" ]
[ "fanogan/test_anomaly_detection.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.utils.model_zoo import tqdm\n\n\ndef test_anomaly_detection(opt, generator, discriminator, encoder,\n dataloader, device, kappa=1.0):\n generator.load_state_dict(torch.load(\"results/generator\"))\n discriminator.load_state_dict(torch....
[ [ "torch.nn.MSELoss", "torch.utils.model_zoo.tqdm", "torch.load" ] ]
metehancekic/wireless-fingerprinting
[ "41872761260b3fc26f33acec983220e8b4d9f42f" ]
[ "preproc/preproc_wifi.py" ]
[ "'''\nContains code for fractionally spaced equalization, preamble detection\nAlso includes a modified version of Teledyne's data read and preprocessing code\n'''\n\nimport numpy as np\nimport os\nimport json\nimport csv\nimport math\nimport fractions\nimport resampy\nfrom tqdm import tqdm, trange\nimport matplotli...
[ [ "numpy.sqrt", "numpy.concatenate", "numpy.int", "scipy.fftpack.fft", "numpy.angle", "numpy.exp", "numpy.roll", "numpy.conjugate", "matplotlib.pyplot.tight_layout", "numpy.arange", "numpy.size", "numpy.argmax", "matplotlib.pyplot.subplot", "numpy.zeros", ...
tszssong/HRNet-Image-Classification
[ "6d8ee24aedf2e0b3134102c221a29fb9b0ce2e1b" ]
[ "tools/train.py" ]
[ "# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Bin Xiao (Bin.Xiao@microsoft.com)\n# Modified by Ke Sun (sunk@mail.ustc.edu.cn)\n# ---------------------------------------------------------------------------...
[ [ "torch.optim.lr_scheduler.MultiStepLR", "torch.nn.CrossEntropyLoss", "torch.load", "torch.rand", "torch.cuda.is_available", "torch.nn.DataParallel", "torch.optim.lr_scheduler.StepLR" ] ]
eaidova/UNITER
[ "5b4c9faf8ed922176b20d89ac56a3e0b39374a22" ]
[ "model/model.py" ]
[ "\"\"\"\nCopyright (c) Microsoft Corporation.\nLicensed under the MIT license.\n\nPytorch modules\nsome classes are modified from HuggingFace\n(https://github.com/huggingface/transformers)\n\"\"\"\nimport copy\nimport json\nimport logging\nfrom io import open\n\nimport torch\nfrom torch import nn\nfrom apex.normali...
[ [ "torch.nn.Dropout", "torch.cat", "torch.zeros_like", "torch.nn.Embedding", "torch.nn.Linear" ] ]
cybercore-co-ltd/Onnx2Caffe
[ "aa4a90b7539e2b5ee0ad42f507021585da58be80" ]
[ "tools/verify_caffe_model.py" ]
[ "import argparse\nimport numpy as np\nimport onnx\nimport onnxruntime as rt\nimport torch\nimport os\nimport mmcv\nimport caffe\n\nfrom terminaltables import AsciiTable\n\ndef parse_args():\n parser = argparse.ArgumentParser()\n parser.add_argument('onnx_checkpoint', help='onnx checkpoint file')\n parser.a...
[ [ "torch.randn", "torch.from_numpy", "numpy.linalg.norm", "numpy.abs" ] ]
lsternlicht/tia
[ "fe74d1876260a946e52bd733bc32da0698749f2c" ]
[ "tia/tests/test_rlab_table.py" ]
[ "import unittest\n\nimport pandas as pd\nimport pandas.util.testing as pdtest\n\nimport tia.rlab.table as tbl\n\n\nclass TestTable(unittest.TestCase):\n def setUp(self):\n self.df1 = df1 = pd.DataFrame({'A': [.55, .65], 'B': [1234., -5678.]}, index=['I1', 'I2'])\n # Multi-index frame with multi-ind...
[ [ "pandas.Series", "pandas.DataFrame", "pandas.MultiIndex.from_arrays", "pandas.util.testing.assert_frame_equal", "pandas.date_range" ] ]
onlyrico/PyABSA
[ "d0905eb5253eaa564d2244cd777e3a734bca777a" ]
[ "pyabsa/core/apc/classic/__bert__/dataset_utils/data_utils_for_training.py" ]
[ "# -*- coding: utf-8 -*-\n# file: data_utils.py\n# author: songyouwei <youwei0314@gmail.com>\n# Copyright (C) 2018. All Rights Reserved.\n\nimport os\nimport pickle\n\nimport numpy as np\nimport tqdm\nfrom findfile import find_file\nfrom google_drive_downloader.google_drive_downloader import GoogleDriveDownloader a...
[ [ "numpy.asarray", "numpy.sum", "numpy.ones" ] ]
akashpattnaik/pre-ictal-similarity
[ "85f963aa0c6d2d0a6e971ffa005c400e136a0a76" ]
[ "code/05-soz_subgraph.py" ]
[ "# %%\n# %load_ext autoreload\n# %autoreload 2\n# Imports and environment setup\nimport numpy as np\nimport sys\nimport os\nfrom numpy.core.fromnumeric import sort\nimport pandas as pd\nimport json\nfrom scipy.io import loadmat\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\nfrom os.path import join as osp...
[ [ "numpy.abs", "numpy.random.choice", "numpy.reshape", "numpy.squeeze", "scipy.stats.zscore", "numpy.max", "numpy.size", "numpy.argmax", "numpy.mean", "scipy.stats.mannwhitneyu", "numpy.var", "numpy.argsort", "numpy.zeros", "numpy.sum" ] ]
tkuri/irradiance_estimation
[ "3f7e0e8d4772222faad7257a70a8dec0198e4810" ]
[ "models/variation/pix2pix_tm2_mc_full_in2_model.py" ]
[ "import torch\nfrom .base_model import BaseModel\nfrom . import networks\nfrom torch.nn import functional as F\n\nclass Pix2PixTm2McFullIn2Model(BaseModel):\n \"\"\" This class implements the pix2pix model, for learning a mapping from input images to output images given paired data.\n\n The model training req...
[ [ "torch.transpose", "torch.cat", "torch.zeros_like", "torch.unsqueeze", "torch.matmul", "torch.nn.functional.interpolate", "torch.clamp", "torch.nn.L1Loss" ] ]
LI-Mingyu/GraphScope-MY
[ "942060983d3f7f8d3a3377467386e27aba285b33" ]
[ "python/tests/unittest/test_context.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# Copyright 2020 Alibaba Group Holding Limited. 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# h...
[ [ "pandas.read_csv" ] ]
proximal-dg/proximal_dg
[ "000e925c7daab099b2c3735f99e65e6b2a00a799" ]
[ "torchgan/metrics/proximal_duality_gap.py" ]
[ "import torch\nimport torch.nn.functional as F\nimport torchvision\nimport copy\nimport time\nimport os\nfrom ..utils import reduce\nfrom .metric import EvaluationMetric\nfrom torchgan.trainer import *\nimport torch.multiprocessing as mp\nimport numpy as np\nfrom ray import tune\nfrom torch.optim import Adam\n__all...
[ [ "torch.no_grad", "numpy.mean" ] ]
danielhettegger-rl/stable-baselines3
[ "23de12e95d96b7bb6136c6a338e407ae7db7c545" ]
[ "stable_baselines3/sac/policies.py" ]
[ "import warnings\nfrom typing import Any, Dict, List, Optional, Tuple, Type, Union\n\nimport gym\nimport torch as th\nfrom torch import nn\n\nfrom stable_baselines3.common.distributions import SquashedDiagGaussianDistribution, StateDependentNoiseDistribution\nfrom stable_baselines3.common.policies import BaseModel,...
[ [ "torch.nn.Sequential", "torch.zeros_like", "torch.nn.Linear", "torch.clamp", "torch.nn.Hardtanh" ] ]
ssahn3087/pedestrian_detection
[ "d9a6cb9d10246941cff8575c803ab60b3a9d7d04" ]
[ "train.py" ]
[ "import os\nimport torch\nimport numpy as np\nimport math\nfrom torch.autograd import Variable\nfrom datetime import datetime\nfrom faster_rcnn import network\nfrom faster_rcnn.network import init_data, data_to_variable\nfrom faster_rcnn.network import train_net_params, print_weight_grad\nfrom faster_rcnn.faster_rc...
[ [ "torch.utils.data.DataLoader", "numpy.random.seed", "torch.optim.SGD" ] ]
cameronliang/BayesVP
[ "3a38e6fc8b85f96f402289fde74f996971edec93" ]
[ "bayesvp/tests/test_likelihood.py" ]
[ "import unittest\nimport os\nimport sys\nimport numpy as np\n\nfrom bayesvp.config import DefineParams\nfrom bayesvp.likelihood import Posterior\nfrom bayesvp.utilities import get_bayesvp_Dir\n\n###############################################################################\n# TEST CASE 1: OVI line with stock confi...
[ [ "numpy.array" ] ]
Aravind-Suresh/CVJyo
[ "6cb324fb538a50939335fd28ee90e23fbb32f2c0" ]
[ "cvjyo.py" ]
[ "import cv2\nimport numpy as np\nimport sys\nimport math\n\ndef markPoints(pts, img):\n for pt in pts:\n cv2.circle(img, tuple((pt[0], pt[1])), 2, 0, -1)\n\ndef contourAreaComparator(cnt1, cnt2):\n\tif cv2.contourArea(cnt1) > cv2.contourArea(cnt2):\n\t\treturn 1\n\telse:\n\t\treturn -1\n\ndef orderClockwi...
[ [ "numpy.asarray", "numpy.arange", "numpy.ones", "numpy.max", "numpy.array", "numpy.zeros", "numpy.where" ] ]
JuanCRCano/AmericanOpt_Methods
[ "38a4de4da20337e629ab47edf2d2e7e134586264" ]
[ "options/valuation.py" ]
[ "import pandas as pd\nimport numpy as np\nimport math as mt\nfrom sklearn.linear_model import LinearRegression\n\ndef Binomial_Tree(Spot, Strike, Vencimiento, Volatilidad, TLibre_Riesgo, Call_Put, Tasa_Foranea=0, Tasa_Dividendo=0,\n Ramificaciones_Arbol=100, Modelo=\"Cox Equity\"):\n if Modelo =...
[ [ "numpy.maximum", "numpy.random.normal", "sklearn.linear_model.LinearRegression", "numpy.zeros", "numpy.where" ] ]
othesoluciones/TFM
[ "8ed46985604c83c517612b38326b39a61b4cf102" ]
[ "static/generaMapas/generaCalendarioPolinico.py" ]
[ "#Conectamos a la base de datos\nimport base64\nimport json\nfrom pymongo import MongoClient as Connection\n\ncadenaCon= 'mongodb://othesoluciones:'+base64.b64decode(\"b3RoZXNvbHVjaW9uZXM=\")+'@ds029635.mlab.com:29635/othesoluciones1'\nMONGODB_URI =cadenaCon\nconexion = Connection(MONGODB_URI)\ndb = conexion.otheso...
[ [ "pandas.DataFrame" ] ]
insoo223/openCVhowse
[ "d8885ab4f87a9d577fd660e60d41222dc2156332" ]
[ "chapter07/detect_car_bow_svm_sliding_window.py" ]
[ "import cv2\nimport numpy as np\nimport os\n\nfrom non_max_suppression import non_max_suppression_fast as nms\n\nif not os.path.isdir('CarData'):\n print('CarData folder not found. Please download and unzip '\n 'http://l2r.cs.uiuc.edu/~cogcomp/Data/Car/CarData.tar.gz '\n 'or https://github.com/...
[ [ "numpy.array" ] ]
prokhn/onti-2019-bigdata
[ "b9296141958f544177388be94072efce7bdc7814" ]
[ "experiments_dikower/controllers/drlbox/net/q_net.py" ]
[ "\nimport tensorflow as tf\nfrom drlbox.common.namescope import TF_NAMESCOPE\nfrom drlbox.net.net_base import RLNet\n\n\nclass QNet(RLNet):\n\n def set_model(self, model):\n self.model = model\n self.weights = model.weights\n self.ph_state, = model.inputs\n self.tf_values, = model.out...
[ [ "tensorflow.reduce_sum", "tensorflow.losses.huber_loss", "tensorflow.placeholder", "tensorflow.name_scope", "tensorflow.one_hot", "tensorflow.abs" ] ]
NeutralKaon/spec2nii
[ "52f0dc42ad176fdbb173ac051803372909e9971c" ]
[ "spec2nii/nifti_orientation.py" ]
[ "import numpy as np\nfrom scipy.spatial.transform import Rotation\n\n\nclass NIFTIOrient:\n def __init__(self, affine):\n self.Q44 = affine\n qb, qc, qd, qx, qy, qz, dx, dy, dz, qfac = nifti_mat44_to_quatern(affine)\n self.qb = qb\n self.qc = qc\n self.qd = qd\n self.qx ...
[ [ "numpy.diag", "scipy.spatial.transform.Rotation.from_euler", "numpy.zeros", "numpy.sqrt" ] ]
DavidBraun777/TensorNetwork
[ "55942a12a859a8c6f8be473e623dbf0ddfd790b5" ]
[ "tensornetwork/backends/backend_test.py" ]
[ "\"\"\"Tests for graphmode_tensornetwork.\"\"\"\nimport builtins\nimport sys\nimport pytest\nimport numpy as np\n\n\ndef clean_tensornetwork_modules():\n for mod in list(sys.modules.keys()):\n if mod.startswith('tensornetwork'):\n sys.modules.pop(mod, None)\n\n\n@pytest.fixture(autouse=True)\ndef clean_bac...
[ [ "numpy.array", "numpy.ones" ] ]
jvc2688/cpm
[ "409e9ada39fc6238a63a75fb8474a3af70410347" ]
[ "cpm/code/leastSquareSolver.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import division, print_function\n\n__all__ = [\"linear_least_squares\"]\n\nimport numpy as np\nfrom scipy import linalg\n\n\ndef linear_least_squares(A, y, yvar=None, l2=None):\n \"\"\"\n Solve a linear system as fast as possible.\n \n :param A: ``...
[ [ "numpy.dot", "scipy.linalg.cho_factor", "numpy.diag_indices_from", "numpy.isscalar", "numpy.zeros" ] ]
Jimmy2027/torchio
[ "98e5f4f379e877fa20c49f93645a3d0e0834f650" ]
[ "torchio/data/inference/aggregator.py" ]
[ "from typing import Tuple\nimport torch\nimport numpy as np\nfrom ...utils import to_tuple\nfrom ...torchio import TypeData, TypeTuple\nfrom ..subject import Subject\n\n\nclass GridAggregator:\n r\"\"\"Aggregate patches for dense inference.\n\n This class is typically used to build a volume made of batches af...
[ [ "numpy.ones_like", "torch.zeros", "numpy.max", "numpy.copy", "numpy.floor" ] ]
life-game-player/Hephaestus
[ "0c695193d8d2d8c70061e2e26ec8c718544342c6" ]
[ "services/models/mnemosyne.py" ]
[ "import torch\n\n\ndef create(\n host, user, passwd,\n module, operator, operation, result\n):\n \"\"\"\n Operation:\n 1: Create\n 2: Modify\n 3: Query\n 4: Delete\n\n Result:\n 0: Succeeded\n 1: Failed\n \"\"\"\n conn = ...
[ [ "torch.execute_list", "torch.connect" ] ]
HERMINDERSINGH1234/ML_Extra_Resolution_Increases
[ "1fefceeab83f03fa8194cb63f78c5dbf7e90aeae" ]
[ "LPIPSmodels/dist_model.py" ]
[ "\r\nfrom __future__ import absolute_import\r\n\r\nimport sys\r\nsys.path.append('..')\r\nsys.path.append('.')\r\nimport numpy as np\r\nimport torch\r\nfrom torch import nn\r\nimport os\r\nfrom collections import OrderedDict\r\nfrom torch.autograd import Variable\r\nimport itertools\r\nfrom .base_model import BaseM...
[ [ "torch.optim.Adam", "torch.mean", "torch.load", "scipy.ndimage.zoom", "numpy.cumsum", "numpy.concatenate", "numpy.mean", "numpy.argsort", "torch.clamp", "numpy.array", "numpy.sum", "torch.autograd.Variable" ] ]
abtinshahidi/astromodels
[ "580e972ccc69f4fad57e22030923ee27f9d59ee3" ]
[ "astromodels/sources/extended_source.py" ]
[ "import collections\n\nimport astropy.units as u\nimport numpy as np\n\nfrom astromodels.core.spectral_component import SpectralComponent\nfrom astromodels.core.tree import Node\nfrom astromodels.core.units import get_units\nfrom astromodels.functions.functions import Constant\nfrom astromodels.sources.source impor...
[ [ "numpy.squeeze", "numpy.array", "numpy.repeat", "numpy.sum" ] ]
hysunflower/Serving
[ "50d0c2900f3385b049f76b91e38cc69d8e8a102d" ]
[ "python/paddle_serving_app/local_predict.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/lic...
[ [ "numpy.array" ] ]
cclauss/darts
[ "77a461b62edb232406891028645b2331a24a8b4d" ]
[ "rnn/train_search.py" ]
[ "import argparse\nimport os, sys, glob\nimport time\nimport math\nimport numpy as np\nimport torch\nimport logging\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.backends.cudnn as cudnn\nfrom architect import Architect\n\nimport gc\n\nimport data\nimport model_search as model\n\nfrom utils im...
[ [ "torch.nn.functional.softmax", "numpy.random.random", "torch.cuda.set_device", "numpy.random.seed", "torch.manual_seed", "torch.cuda.is_available", "torch.cuda.manual_seed_all", "torch.nn.DataParallel" ] ]
qiuqiangkong/dcase2019_task2
[ "62575c8cdd4723cfdf497b290b6dddcce316c60b" ]
[ "utils/data_generator.py" ]
[ "import numpy as np\nimport h5py\nimport csv\nimport time\nimport logging\nimport os\nimport glob\nimport matplotlib.pyplot as plt\nimport logging\nimport pandas as pd\n\nfrom utilities import scale\nimport config\n\n\nclass Base(object):\n def __init__(self):\n '''Base class for train, validate and test ...
[ [ "pandas.read_csv", "numpy.arange", "numpy.tile", "numpy.ones", "numpy.concatenate", "numpy.array", "numpy.random.RandomState", "numpy.zeros" ] ]
dizcza/cdtw-python
[ "a83fffd6fc222a1691f07421fd4dbf46dc19e0aa" ]
[ "tests/test_cdtw.py" ]
[ "import unittest\nimport math\n\nimport numpy as np\nfrom cdtw.dtw import *\nfrom numpy.testing import assert_array_equal, assert_array_almost_equal\n\ntry:\n import dtaidistance\n DTAIDISTANCE_INSTALLED = True\nexcept ImportError:\n DTAIDISTANCE_INSTALLED = False\n\n\nclass TestCDTW(unittest.TestCase):\n\...
[ [ "numpy.sqrt", "numpy.random.seed", "numpy.testing.assert_array_equal", "numpy.random.randn", "numpy.testing.assert_array_almost_equal" ] ]
huajianjiu/ANSMESC
[ "76323a46f638c717e23388cf529734081a70eeee" ]
[ "attention.py" ]
[ "# author - Richard Liao\n# Dec 26 2016\n# Attention GRU network\n\nfrom keras import backend as K\nfrom keras.engine.topology import Layer\nfrom keras import initializers, regularizers, constraints\n\n\nclass AttentionWithContext(Layer):\n \"\"\"\n Attention operation, with a context/query vector, for te...
[ [ "numpy.random.randint" ] ]
AlexandrovLab/SigProfilerTopography
[ "34c7cf24392bc77953370038a520ffc8d0bdee50" ]
[ "SigProfilerTopography/source/plotting/TranscriptionReplicationStrandBiasFigures.py" ]
[ "# This source code file is a part of SigProfilerTopography\n# SigProfilerTopography is a tool included as part of the SigProfiler\n# computational framework for comprehensive analysis of mutational\n# signatures from next-generation sequencing of cancer genomes.\n# SigProfilerTopography provides the downstream dat...
[ [ "numpy.nanmax", "matplotlib.pyplot.legend", "matplotlib.pyplot.rc", "pandas.DataFrame", "numpy.any", "matplotlib.pyplot.gca", "pandas.read_csv", "numpy.arange", "matplotlib.pyplot.Circle", "matplotlib.pyplot.subplot", "matplotlib.gridspec.GridSpec", "matplotlib.pypl...
yourtrading-ai/py_yourtrading_ai
[ "b69424f2afc40fe258c7ddae2fb47acc383ecbe5" ]
[ "src/data_upload/batch.py" ]
[ "import asyncio\nimport io\nimport ssl\n\nimport aiohttp\nimport aleph_client.asynchronous\nimport certifi\nimport pandas as pd\n\nfrom data_upload.data_utils import clean_time_duplicates\n\n\ndef get_download_url(symbol, interval=\"hourly\"):\n if interval == \"daily\":\n interval = \"d\"\n elif inter...
[ [ "pandas.read_csv" ] ]
otsubo/CIFAR-ConvolutionalAutoEncoder-Chainer
[ "bbda81dc7b52f42e07e9daaff38ce7453b24e008" ]
[ "generate_cloth_img.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Jul 21 08:51:18 2018\n\n@author: user\n\"\"\"\n\nimport argparse\n\nimport os\nimport os.path as osp\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\n\nimport chainer\nfrom chainer import cuda\nfrom chainer.datasets import get_cifar10\nf...
[ [ "matplotlib.pyplot.tight_layout", "numpy.expand_dims", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplot.axis", "matplotlib.pyplot.show", "numpy.random.RandomState", "matplotlib.pyplot.figure" ] ]
nataliepopescu/osdi21-artifact
[ "6a268c90a8ce449256b5c290caeb7e0e3b9d7e5c" ]
[ "scripts/table4_run.py" ]
[ "import os\nimport subprocess\nimport re\nimport time\nfrom numpy import average \nfrom ExpStats import runExpWithName\n\nROOT_PATH = os.path.dirname(os.path.realpath(__file__))\n\ndef parseThroughput(out):\n try:\n m = re.search(r'Requests/sec: ([0-9,.]+)', out)\n # m = re.search(r'([0-9,]+) ns/it...
[ [ "numpy.average" ] ]
noemiefedon/RELAY
[ "1bf9c27ee1bcf1be0a7652fcca0ea38dd47b14b8" ]
[ "src/one_stack.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nFunctions to check a design manufacturability\n\n- check_ss_manufacturability\n checks the manufacturability of a stacking sequence list\n\"\"\"\n__version__ = '1.0'\n__author__ = 'Noemie Fedon'\n\nimport sys\nimport numpy as np\nsys.path.append(r'C:\\RELAY')\nfrom src.contiguit...
[ [ "numpy.array" ] ]
postpascal/py-futu-api
[ "cb274d5ab5387dca190b739d161f2bc8eabe073d" ]
[ "futu/quote/open_quote_context.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n Market quote and trade context setting\n\"\"\"\n\nimport datetime\nimport math\nfrom time import sleep\n\nimport pandas as pd\nfrom futu.common.open_context_base import OpenContextBase, ContextStatus\nfrom futu.quote.quote_query import *\n\n\nclass OpenQuoteContext(OpenContextB...
[ [ "pandas.DataFrame" ] ]
david8862/keras-CenterNet
[ "e74b933f6dd5ffac04f2de3eb0d887742be8490f" ]
[ "utils/setup.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport setuptools\nfrom setuptools.extension import Extension\nfrom distutils.command.build_ext import build_ext as DistUtilsBuildExt\n\n\nclass BuildExtension(setuptools.Command):\n description = DistUtilsBuildExt.description\n user_options = DistUtils...
[ [ "numpy.get_include" ] ]
qianqianjun/DCGAN
[ "4e2d37f1d785e592e59334b91d197ef0475c1c99" ]
[ "main.py" ]
[ "\"\"\"\nwrite by qianqianjun\n2019.12.20\n运行GAN进行训练的入口文件。\n\"\"\"\nimport os\nimport tensorflow as tf\nfrom train_argparse import hps\nfrom dataset_loader import train_images\nfrom data_provider import MnistData\nfrom DCGAN import DCGAN\nfrom utils import combine_imgs\n\n# 创建生成结果目录\noutput_dir='./out'\nif not os.p...
[ [ "tensorflow.global_variables_initializer", "tensorflow.Session" ] ]
StevenTang1998/TextBox
[ "acd8298c7e6618384d585146f799d02cc475520c" ]
[ "textbox/model/Seq2Seq/t5.py" ]
[ "# @Time : 2021/3/15\n# @Author : Zhuohao Yu\n# @Email : zhuohao@ruc.edu.cn\n\nr\"\"\"\nT5\n################################################\nReference:\n Colin et al. \"Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer\" at JMLR 2020.\n\"\"\"\n\nimport torch\nimport torch.nn a...
[ [ "torch.nn.CrossEntropyLoss" ] ]
comydream/OpenNMT-py
[ "bdca05a3fac8f864b21c86a8ad03c09895212e70" ]
[ "onmt/translate/greedy_search.py" ]
[ "import torch\nimport torch.nn.functional as F\n\nfrom onmt.translate.decode_strategy import DecodeStrategy\n\n\ndef sample_topp(logits, keep_topp):\n sorted_logits, sorted_indices = torch.sort(logits,\n descending=True,\n ...
[ [ "torch.div", "torch.nn.functional.softmax", "torch.zeros", "torch.cat", "torch.lt", "torch.distributions.Categorical", "torch.sort", "torch.arange", "torch.topk" ] ]
Lsplastic/Tensorflow_ssd
[ "f2935079fb8d2cd2288ef5f7a415749243f34542" ]
[ "dataset/dataset_inspect.py" ]
[ "# Copyright 2018 Changan Wang\r\n\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n# Unless required by applicable ...
[ [ "tensorflow.python_io.tf_record_iterator", "tensorflow.python_io.TFRecordOptions" ] ]
dkkim1005/Neural_Network_Quantum_State
[ "7e94929c5ef65ce87f63bf20c81acaa524adca82" ]
[ "python/meas_smag.py" ]
[ "#!/usr/bin/env python3\nimport numpy as np\nfrom pynqs import sampler\n\nfloatType = 'float32'\nsymmType = 'tr'\n# hyper parameter sets of rbm and MCMC sampler\nkwargs = {\n 'nInputs' : 16,\n 'nHiddens' : 4,\n 'nChains' : 1000,\n 'seedNumber' : 0,\n 'seedDistance' : 123456789,\n 'init_mcmc_steps' : 300\n}\n#...
[ [ "numpy.sum", "numpy.zeros", "numpy.mean" ] ]
salesforce/DialFact
[ "d400b250147e45c106b18e52254b1060f7c1575d" ]
[ "scripts/run_fever_scoring.py" ]
[ "import argparse\nimport sys\nimport jsonlines\nfrom tqdm import tqdm\nimport logging\nimport json\nimport torch\nimport torch.nn.functional as F\nimport jsonlines\nimport random\nimport os\nimport numpy as np\nfrom scipy.special import softmax\n# os.environ[\"NCCL_SHM_DISABLE\"] = \"1\"\nfrom tqdm import tqdm\nfro...
[ [ "torch.utils.data.DataLoader" ] ]
praeclarumjj3/CuML
[ "1c812d3b07a11c3a69a284d9960058a874d97bfa" ]
[ "CuSVD/testcases/gen_testcase.py" ]
[ "#!/usr/bin/python3\n\n#########################################################################\n# Generate M x N matrix of real numbers and store #\n# the the matrix in file named 'testcase_<M>_<N>' #\n# Parameters: ...
[ [ "sklearn.preprocessing.StandardScaler" ] ]
masayoshi-nakamura/CognitiveArchitectureLecture
[ "5e036b48e92f266062eb7be8a366e754dee24f2c" ]
[ "examples/brainsimulator_agent/components/visual_area_component.py" ]
[ "\nimport brica1\nimport numpy as np\nimport pygazebo.msg.poses_stamped_pb2\nimport pickle\n\nclass VisualAreaComponent(brica1.Component):\n def __init__(self):\n super(VisualAreaComponent, self).__init__()\n self.last_position = np.array((0, 0))\n\n def __position_to_area_id(self, pos2d):\n ...
[ [ "numpy.array" ] ]
vtekur/gnn_pathplanning
[ "150ca315c214134eda8f5c5b55ce71da9360bcce" ]
[ "utils/visualize.py" ]
[ "#!/usr/bin/env python3\nimport yaml\nimport matplotlib\n# matplotlib.use(\"Agg\")\nfrom matplotlib.patches import Circle, Rectangle, Arrow\nfrom matplotlib.collections import PatchCollection\nfrom matplotlib.patches import ConnectionPatch\nfrom matplotlib.patches import FancyArrowPatch\nimport matplotlib.pyplot as...
[ [ "numpy.array", "matplotlib.pyplot.cm.get_cmap", "matplotlib.pyplot.ylim", "numpy.set_printoptions", "matplotlib.patches.Rectangle", "scipy.io.loadmat", "matplotlib.pyplot.Line2D", "matplotlib.patches.Circle", "numpy.linalg.norm", "matplotlib.pyplot.xlim", "matplotlib.li...
zyyhhxx/convNet.pytorch
[ "85f65f80b6d75810077c54bd3a8c9094cc2a26f9" ]
[ "models/resnet.py" ]
[ "import torch\nimport torch.nn as nn\nimport torchvision.transforms as transforms\nimport math\nfrom .modules.se import SEBlock\nfrom .modules.checkpoint import CheckpointModule\nimport os\nimport sys\nsys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))\nfrom utils.mixup import MixUp\n\n__...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.nn.AdaptiveAvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
sahiljuneja/kaggle-ctds
[ "caac226f2c5d33b6d324c5cf33a777758b9163d1" ]
[ "utils/modify_ravdess.py" ]
[ "import re\nimport os\nimport argparse\nimport librosa\nimport librosa.display\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef modify_data(input_path, save_path, dir_dict):\n \n path = os.listdir(input_path)\n for folders in path:\n \n folders = os.path.sep.join([input_path, fol...
[ [ "matplotlib.pyplot.savefig" ] ]
akhambhati/dyne2
[ "d2f050b3d14ef429fc9c52821e87f1c9a52a521d" ]
[ "dyne/adjacency/coherence.py" ]
[ "\"\"\"\nCoherence pipes for quantifying signal similarity (i.e. connectivity)\n\nCreated by: Ankit Khambhati\n\nChange Log\n----------\n2016/03/06 - Implemented WelchCoh and MTCoh pipes\n\"\"\"\n\nfrom __future__ import division\nimport numpy as np\nfrom mtspec import mt_coherence, mtspec\nfrom scipy.signal import...
[ [ "scipy.signal.coherence", "numpy.flatnonzero", "numpy.mean", "numpy.diff", "numpy.float" ] ]
jwillis0720/seaborn
[ "0dc93d01c78370e91ebdf72c888719fbbc6d1085" ]
[ "seaborn/algorithms.py" ]
[ "\"\"\"Algorithms to support fitting routines in seaborn plotting functions.\"\"\"\nimport numbers\nimport numpy as np\nimport warnings\nfrom math import sqrt\n\n\ndef wls_confidence_interval(data, z=1.96):\n \"\"\"Calculate the Wilson score confidence interval for a data set.\n\n data : array of 1-dimensiona...
[ [ "numpy.unique", "numpy.asarray", "numpy.array", "numpy.random.RandomState", "numpy.random.default_rng" ] ]
lluo5779/Robo-Adviser
[ "43aa4b73bfc96e55ed664328330a930975596124" ]
[ "server/models/portfolio/risk.py" ]
[ "import numpy as np\nimport pandas as pd\n\n\ndef risk_prefs(horizon, aversion, cardinal, return_target, l, mu_bl1, mu_bl2, cov_bl1):\n\n if horizon is None:\n horizon = 10\n\n alpha = 0.05\n\n safe_target = float(((mu_bl1 + mu_bl2) / 2).mean())\n\n # set the variances for the first period estima...
[ [ "numpy.diag", "numpy.divide" ] ]
haziq9978/PythonChatbot
[ "8eb77140b32a4c6770dab20d4e26be03504ac5ee" ]
[ "train.py" ]
[ "import numpy as np\nimport random\nimport json\n\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import Dataset, DataLoader\n\nfrom nltk_utils import bag_of_words, tokenize, stem\nfrom model import NeuralNet\n\nwith open('dataCombine.json', 'r') as f:\n intents = json.load(f)\n\nall_words = []\ntags...
[ [ "torch.nn.CrossEntropyLoss", "torch.utils.data.DataLoader", "torch.cuda.is_available", "numpy.array", "torch.save" ] ]
whxf/nlp_api
[ "a63b67287e9a90381cac14bb1c5b723ccbeb14a3" ]
[ "tools/similarity.py" ]
[ "\"\"\"\n@author: Li Xi\n@file: similarity.py\n@time: 2019/10/30 15:37\n@desc:\n计算文本相似度:\n1. WordMoverDistance 基于词移距离的文本相似度计算 【比较文档的相似度】\n2. WordVectorSimilarity word-vector的句子相似度计算 【比较句子的相似度】\n注意事项:\n* 两种方法都需要输入句子分词之后的结果,类型需要时list\n* 为提升效率/效果,可对分词结果进行处理,如去除停用词等\n* 具体使用方法见文件的最下\n* 可自定义加载词向量文件\n\"\"\"\nimport os\n\...
[ [ "numpy.zeros", "numpy.sum" ] ]
AnonymousExplorer/Conditional-GANs-Pytorch
[ "6c15ec67217156d6f041e34efe29ab62f9ef7c7d" ]
[ "train_InfoGAN1.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport json\n\nimport model\nimport numpy as np\nimport pylib\nimport PIL.Image as Image\nimport tensorboardX\nimport torch\nimport torchvision\nimport torchvision.datasets as dsets\ni...
[ [ "torch.cat", "torch.randn", "numpy.eye", "torch.nn.functional.cross_entropy", "torch.cuda.is_available", "torch.device", "numpy.random.randint" ] ]
zooechiu/pyro2
[ "b0ca4aa7b1b0f0d445c6a8d0ab63fcc0bc8a431c" ]
[ "compressible_sr/problems/rt.py" ]
[ "from __future__ import print_function\n\nimport numpy as np\n\nimport sys\nimport mesh.patch as patch\nimport compressible_sr.eos as eos\nfrom util import msg\n\n\ndef init_data(my_data, rp):\n \"\"\" initialize the rt problem \"\"\"\n\n msg.bold(\"initializing the rt problem...\")\n\n # make sure that we...
[ [ "numpy.cos", "numpy.exp", "numpy.sqrt" ] ]
SaadChaouki/ml-eli5-cli5
[ "625a69edadf4737e41c58193873cf8a54273d7f0" ]
[ "visualisations/linear_regression.py" ]
[ "from supervised.regression.linearRegression import LinearRegression\nfrom visualisations.color_palette import two_colors\nfrom deep_learning.loss import MSELoss\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.datasets import make_regression\n\nfrom matplotlib.animation import FuncAnimation\ni...
[ [ "matplotlib.pyplot.legend", "matplotlib.use", "matplotlib.pyplot.subplots", "sklearn.model_selection.train_test_split", "sklearn.datasets.make_regression", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ]...
gaocegege/ray
[ "c852213b8349b6b9e9e7353573e2259a1b9ef925" ]
[ "python/ray/tests/test_basic.py" ]
[ "# coding: utf-8\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport collections\nfrom concurrent.futures import ThreadPoolExecutor\nimport json\nimport logging\nfrom multiprocessing import Process\nimport os\nimport random\nimport re\nimport set...
[ [ "numpy.testing.assert_equal", "numpy.uint32", "numpy.arange", "numpy.uint8", "numpy.int32", "numpy.int8", "pandas.DataFrame", "numpy.ones", "numpy.int64", "numpy.random.normal", "numpy.random.permutation", "numpy.uint64", "numpy.float64", "numpy.float32", ...
Bifaxin/pandas
[ "2ec7f2f279d770b286c9c7679ba7ad0e2f14dcbe" ]
[ "pandas/core/indexes/interval.py" ]
[ "\"\"\" define the IntervalIndex \"\"\"\nfrom operator import le, lt\nimport textwrap\nfrom typing import Any, Optional, Tuple, Union\nimport warnings\n\nimport numpy as np\n\nfrom pandas._config import get_option\n\nfrom pandas._libs import Timedelta, Timestamp, lib\nfrom pandas._libs.interval import Interval, Int...
[ [ "pandas.tseries.frequencies.to_offset", "numpy.linspace", "pandas.core.dtypes.common.is_dtype_equal", "pandas.core.dtypes.common.is_datetime64tz_dtype", "pandas._libs.interval.IntervalTree", "pandas.core.indexes.base.Index", "numpy.concatenate", "pandas._config.get_option", "nu...
myforkmachine/pyprobml
[ "a750b6e33e849ca75300fec1b9ee4b61def80c52" ]
[ "auto_generated_scripts/combining_kernels_by_summation.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\ntry:\n import jax\nexcept:\n get_ipython().run_line_magic('pip', 'install jax jaxlib')\n import jax\nimport jax.numpy as jnp\n\ntry:\n import matplotlib.pyplot as plt\nexcept:\n get_ipython().run_line_magic('pip', 'install matplotlib')\n imp...
[ [ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots" ] ]
iyanmv/galois
[ "a5e6386a684e3e0b47af608217002795dc25c702" ]
[ "galois/_fields/_main.py" ]
[ "\"\"\"\nA module that contains the main classes for Galois fields -- FieldClass, FieldArray,\nand Poly. They're all in one file because they have circular dependencies. The specific GF2\nFieldClass is also included.\n\"\"\"\nimport inspect\nimport math\nimport random\nfrom typing import Tuple, List, Sequence, Iter...
[ [ "numpy.issubdtype", "numpy.dtype", "numpy.all", "numpy.max", "numpy.any", "numpy.iinfo", "numpy.bool_", "numpy.where", "numpy.random.default_rng", "numpy.roll", "numpy.unique", "numpy.arange", "numpy.add.reduce", "numpy.atleast_1d", "numpy.count_nonzero"...
iacercalixto/WALS
[ "7f4b5042591d536f6b371d5fb252616d2da7abaf" ]
[ "onmt/train_single.py" ]
[ "#!/usr/bin/env python\n\"\"\"\n Training on a single process\n\"\"\"\nfrom __future__ import division\n\nimport argparse\nimport os\nimport random\nimport torch\n\nimport onmt.opts as opts\n\nfrom onmt.inputters.inputter import build_dataset_iter, lazily_load_dataset, \\\n _load_fields, _collect_report_featu...
[ [ "torch.cuda.set_device", "torch.cuda.manual_seed", "torch.load", "torch.manual_seed", "torch.cuda.is_available" ] ]
HaoranZ99/RL-2
[ "253c2fd8c705f88d9cc79abd9f331dc99b5895eb" ]
[ "logger.py" ]
[ "import numpy as np\nimport time, datetime\nimport matplotlib.pyplot as plt\n\nclass Logger():\n def __init__(self, save_dir):\n self.save_log = save_dir / \"log\"\n with open(self.save_log, \"w\") as f:\n f.write(\n f\"{'Episode':>8}{'Step':>8}{'Epsilon':>10}{'MeanReward'...
[ [ "numpy.round", "matplotlib.pyplot.clf", "numpy.mean" ] ]
petrux/LiteFlowX
[ "96197bf4b5a87e682c980d303a0e6429cdb34964" ]
[ "liteflow/tests/test_layers_base.py" ]
[ "\"\"\"Test the base class of the layers hierarchy.\"\"\"\n\n# Disable pylint warning about too many statements\n# and local variables since we are dealing with tests.\n# pylint: disable=R0914, R0915\n\nimport mock\nimport tensorflow as tf\n\nfrom liteflow import layers, utils\n\n\nclass Layer(layers.Layer):\n \...
[ [ "tensorflow.variable_scope", "tensorflow.get_variable", "tensorflow.get_variable_scope" ] ]
boknilev/fairseq
[ "5da0bffba945105ef7e0d4e7e5610e1cf966a459" ]
[ "train.py" ]
[ "#!/usr/bin/env python3 -u\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"\nTrain a new model on one or across multiple GPUs.\n\"\"\"\n\nimport collections\nimport math\nimpor...
[ [ "torch.cuda.set_device", "torch.multiprocessing.spawn", "numpy.random.seed", "torch.manual_seed", "torch.cuda.is_available", "torch.cuda.device_count" ] ]
LSSTDESC/sims_TruthCatalog
[ "348f5d231997eed387aaa6e3fd4218c126e14cdb", "348f5d231997eed387aaa6e3fd4218c126e14cdb" ]
[ "bin.src/write_star_variability_stats.py", "scripts/Run3.1i/write_lensed_agn_truth.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nScript to generate stellar_variability table using multiprocessing\non a single 32 core Cori-Haswell node.\n\"\"\"\nimport numpy as np\nimport multiprocessing\nfrom desc.sims_truthcatalog import write_star_variability_stats\n\n\nstars_db_file = ('/global/projecta/projectdirs/lsst/'\n...
[ [ "numpy.array" ], [ "numpy.linspace" ] ]
Joshua-Elms/CSCI-B365
[ "f28dda6da3098ec4b9472ee546c3e6798d358ce8" ]
[ "Meteorology_Modeling_Project/preprocessing/brute_force.py" ]
[ "import pandas as pd\nfrom itertools import combinations, chain\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.impute import KNNImputer\nfrom numpy import corrcoef\nfrom random import shuffle\n\npath = \"/Users/joshuaelms/Desktop/github_repos/CSCI-B365/Meteorology_Modeling_Project/data/pretty_data...
[ [ "pandas.read_csv", "pandas.DataFrame", "sklearn.linear_model.LinearRegression", "sklearn.impute.KNNImputer", "numpy.corrcoef" ] ]