repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
cta-sst-1m/ctapipe
[ "10b058f8dcc166177d1eb5b2af638ca37722a021", "10b058f8dcc166177d1eb5b2af638ca37722a021" ]
[ "ctapipe/calib/camera/pedestals.py", "examples/display_event.py" ]
[ "\"\"\"\nFactory for the estimation of the flat field coefficients\n\"\"\"\n\nfrom abc import abstractmethod\nimport numpy as np\nfrom astropy import units as u\nfrom ctapipe.core import Component\n\n\nfrom ctapipe.image.extractor import ImageExtractor\nfrom ctapipe.core.traits import Int, Unicode, List\n\n__all__ ...
[ [ "numpy.ma.getdata", "numpy.ma.std", "numpy.ma.median", "numpy.logical_or", "numpy.asanyarray", "numpy.ma.mean", "numpy.ma.array", "numpy.zeros" ], [ "numpy.sqrt", "matplotlib.pyplot.pause", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplot", "matplotli...
1maginasian/PaddleHub
[ "7e680db4b2750a3d0b63d64c10d457586f473aa9" ]
[ "paddlehub/datasets/base_nlp_dataset.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.array" ] ]
Ewen2015/GossipCat
[ "6792c2ddee16515d9724583c9b57f332cff4b206" ]
[ "gossipcat/graph/GraphFE.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\nauthor: Ewen Wang\nemail: wolfgangwong2012@gmail.com\nlicense: Apache License 2.0\n\"\"\"\nimport pandas as pd\nimport numpy as np\nimport networkx as nx\nimport itertools \n\ndef link_pred_generator(function):\n def link_pred(graph, source,...
[ [ "numpy.dot", "pandas.concat", "pandas.DataFrame" ] ]
bcjonescbt/pyro
[ "1bc46ddd4485a18434bf1c5c128a8b020b46c559" ]
[ "pyro/infer/mcmc/util.py" ]
[ "# Copyright (c) 2017-2019 Uber Technologies, Inc.\n# SPDX-License-Identifier: Apache-2.0\n\nimport functools\nimport warnings\nfrom collections import OrderedDict, defaultdict\nfrom functools import partial, reduce\nfrom itertools import product\nimport traceback as tb\n\nimport torch\nfrom torch.distributions imp...
[ [ "torch.jit.trace", "torch.reshape", "torch.tensor", "torch.isfinite", "torch.stack", "torch.distributions.biject_to" ] ]
SaoirseARM/model-optimization
[ "a396089bca13ab9d38d533406dff717b6694b0d6" ]
[ "tensorflow_model_optimization/python/core/clustering/keras/cluster_integration_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" ] ]
zhangyimi/Research
[ "94519a72e7936c77f62a31709634b72c09aabf74" ]
[ "CV/VehicleCounting/vehicle_counting/hausdorff_dist.py" ]
[ "import numpy as np\nimport numba\nimport distances\nfrom inspect import getmembers\n\ndef _find_available_functions(module_name):\n all_members = getmembers(module_name)\n available_functions = [member[0] for member in all_members if isinstance(member[1], numba.targets.registry.CPUDispatcher)]\n return av...
[ [ "numpy.issubdtype" ] ]
ekirving/qpbrute
[ "38a9555d9c0724403c68f40d29478be446a4ec7e" ]
[ "qpbrute/qpbayes.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nCompare all fitted models to each other using Bayes factors from admixture_graph\n\"\"\"\n__author__ = \"Evan K. Irving-Pease\"\n__copyright__ = \"Copyright 2018\"\n__email__ = \"evan.irvingpease@gmail.com\"\n__license__ = \"MIT\"\n\nimport argparse\nimport g...
[ [ "pandas.DataFrame" ] ]
Sinaxist/mne-python
[ "33146156f2660f122ecc04fa0d5b3fd3c34b549e" ]
[ "mne/utils.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Some utility functions.\"\"\"\nfrom __future__ import print_function\n\n# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n#\n# License: BSD (3-clause)\n\nimport atexit\nfrom distutils.version import LooseVersion\nfrom functools import wraps\nimport ftplib\nfrom...
[ [ "scipy.sparse.isspmatrix", "numpy.dot", "numpy.amax", "scipy.linalg.svd", "numpy.isfinite", "numpy.array_equal", "numpy.asarray", "numpy.empty_like", "numpy.isfortran", "numpy.finfo", "numpy.max", "numpy.show_config", "scipy.sparse.isspmatrix_csc", "numpy.ar...
miguelamendez/SignalPerceptron
[ "0e50f1b8e1c7f35675ccd2687f000d6534f70364" ]
[ "SP/ml/archs/config.py" ]
[ "\"\"\"\n Description: Config file to build DL Architectures.\n \n \"\"\"\n#Internal libraries\nimport os\nimport sys\nfull_path = os.path.dirname(os.path.realpath(__file__))\nprint(\"archs_config\",full_path)\nsys.path.append(os.path.dirname(os.path.dirname(full_path)))\n\n#Importing architecture librarie...
[ [ "torch.tensor" ] ]
HarryPham0123/FPT_data_centric_competition
[ "3fa1e0ac48fdae2649b639229d9a74f75e461878" ]
[ "Data_Competition/utils/loss.py" ]
[ "\"\"\"\nSource: YOLOv5 🚀 by Ultralytics https://github.com/ultralytics/yolov5\n\nLoss functions\n\"\"\"\n\nimport torch\nimport torch.nn as nn\n\nfrom utils.metrics import bbox_iou\nfrom utils.torch_utils import is_parallel\n\n\ndef smooth_BCE(eps=0.1): # https://github.com/ultralytics/yolov3/issues/238#issuecom...
[ [ "torch.abs", "torch.sigmoid", "torch.ones", "torch.max", "torch.zeros", "torch.cat", "torch.zeros_like", "torch.tensor", "torch.exp", "torch.nn.BCEWithLogitsLoss", "torch.arange", "torch.full_like", "torch.argsort", "torch.ones_like" ] ]
leotam/MONAI
[ "866d53df3f754e25fb4635abeb3f27cdaaa718cd" ]
[ "monai/transforms/intensity/dictionary.py" ]
[ "# Copyright 2020 - 2021 MONAI Consortium\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agre...
[ [ "numpy.copy", "numpy.interp", "numpy.linspace" ] ]
tsmbland/pims
[ "4f51b31f6a5bac41f4c680c7db1396f00838369e" ]
[ "pims/ffmpeg_reader.py" ]
[ "# The MIT License (MIT)\n#\n# Copyright (c) 2014 Zulko\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, cop...
[ [ "numpy.frombuffer" ] ]
konykwj/TANAGRA
[ "72180991e89d748d937ad192f0e386bc474fc453" ]
[ "tanagra/NMF_Analysis_Functions.py" ]
[ "#!/usr/bin/env python3\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Oct 3 21:31:48 2019\r\n\r\n@author: Bill Konyk\r\n\r\nThis contains all the functions needed to execute the main NMF Analysis strategy as contained in the NMF_Analysis class.\r\n\r\nThe process follows the method described in https://ar...
[ [ "sklearn.decomposition.NMF", "numpy.arange", "numpy.matmul", "numpy.linalg.norm", "numpy.random.shuffle", "numpy.ones", "scipy.sparse.csr_matrix", "numpy.shape", "numpy.zeros", "numpy.vstack" ] ]
jl45621/SLM-Lab
[ "42c48af308dfe36401990aca3795bc481cf28c17" ]
[ "slm_lab/lib/util.py" ]
[ "from contextlib import contextmanager\nfrom datetime import datetime\nfrom importlib import reload\nfrom slm_lab import ROOT_DIR, EVAL_MODES\nimport cv2\nimport json\nimport numpy as np\nimport operator\nimport os\nimport pandas as pd\nimport pydash as ps\nimport regex as re\nimport subprocess\nimport sys\nimport ...
[ [ "matplotlib.pyplot.imshow", "numpy.amax", "pandas.DataFrame", "numpy.concatenate", "numpy.all", "torch.cuda.manual_seed_all", "numpy.divide", "pandas.read_csv", "matplotlib.pyplot.figure", "numpy.isnan", "torch.multiprocessing.Pool", "numpy.ndenumerate", "torch....
sebi06/czitools
[ "3fed073d5e56db0aaebe87f0e38af80b0724f005" ]
[ "examples/scripts/test_zenheatmap.py" ]
[ "# -*- coding: utf-8 -*-\n\n#################################################################\n# File : test_zenheatmap.py\n# Version : 0.1\n# Author : sebi06\n# Date : 04.12.2021\n#\n# Disclaimer: This code is purely experimental. Feel free to\n# use it at your own risk.\n#\n################...
[ [ "pandas.isnull", "pandas.read_csv", "matplotlib.pyplot.show", "numpy.full" ] ]
onesandzeroes/pandas
[ "22d982a8afdef3c438c9c93dfe5299cc5ca07de2" ]
[ "pandas/sparse/tests/test_array.py" ]
[ "from pandas.compat import range\nimport re\nimport operator\nimport warnings\n\nfrom numpy import nan\nimport numpy as np\n\nfrom pandas import _np_version_under1p8\nfrom pandas.sparse.api import SparseArray, SparseSeries\nfrom pandas._sparse import IntIndex\nfrom pandas.util.testing import assert_almost_equal, as...
[ [ "pandas.util.testing.assertIsInstance", "numpy.take", "numpy.asarray", "pandas.util.testing.assert_produces_warning", "numpy.random.randn", "pandas.sparse.api.SparseSeries", "pandas.util.testing.assert_numpy_array_equal", "numpy.arange", "numpy.sin", "pandas._sparse.IntInde...
chok68/video-scene-inventory
[ "fad046aebe824834cc891e9b81b7a300debf7409" ]
[ "scenedetect/detectors/motion_detector.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# PySceneDetect: Python-Based Video Scene Detector\n# ---------------------------------------------------------------\n# [ Site: http://www.bcastell.com/projects/pyscenedetect/ ]\n# [ Github: https://github.com/Breakthrough/PySceneDetect/ ]\n# [ Documentation...
[ [ "numpy.sum", "numpy.ones" ] ]
balisujohn/adversarial-patch-vgg16
[ "63d092e3059afa09df13d360acae5c8567cdeed9" ]
[ "test_adversarial_patch.py" ]
[ "import json\nfrom random import randrange\nimport random\nimport os\n\n\nimport matplotlib.pyplot as plt\nimport torch\nimport torchvision\nimport torchvision.models as models\nfrom torchvision import transforms, datasets\nimport torch.nn as nn\nimport torch.nn.functional as functional\nimport torch.optim as optim...
[ [ "torch.ones", "torch.utils.data.DataLoader", "numpy.argmax", "torch.where", "matplotlib.pyplot.show" ] ]
TICCLAT/ticcl-output-reader
[ "9474533092f6438053d660fd57b645a41b0f9345" ]
[ "tests/test_extension.py" ]
[ "import ticcl_output_reader as m\nfrom unittest import TestCase\nimport numpy as np\n\n\nclass ExampleTest(TestCase):\n\n def test_example1(self):\n self.assertEqual(4, m.example1([4, 5, 6]))\n\n def test_example2(self):\n x = np.array([[0., 1.], [2., 3.]])\n res = np.array([[2., 3.], [4....
[ [ "numpy.arange", "numpy.array", "numpy.testing.assert_allclose" ] ]
fuying-wang/tianshou
[ "866e35d550fe9aaaff5492f463eb59d9196efc83" ]
[ "test/continuous/test_sac_with_il.py" ]
[ "import os\nimport gym\nimport torch\nimport pprint\nimport argparse\nimport numpy as np\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom tianshou.env import DummyVectorEnv\nfrom tianshou.utils.net.common import Net\nfrom tianshou.trainer import offpolicy_trainer\nfrom tianshou.data import Collector, Repl...
[ [ "numpy.random.seed", "torch.manual_seed", "torch.set_num_threads", "torch.utils.tensorboard.SummaryWriter", "torch.cuda.is_available" ] ]
DarkstartsUp/stock_predict_with_LSTM
[ "42dc56954b5262d6e50d1552505f1e87741d6256" ]
[ "data_download.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\n@Author: jifeng\r\n@File Create: 20200606\r\n@Last Modify: 20200606\r\n@Function: from tushare get stock data, generate array\r\n\"\"\"\r\n\r\nimport tushare as ts\r\nimport pandas as pd\r\nimport time\r\nimport numpy as np\r\nts.set_token('33aeeaf3e4e6b1cac85a6035f0adf9fe0efb9...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
po3navy/tf-quant-finance
[ "cd63262d94a1aaeeeb33f37709a25b14d4d993a6" ]
[ "tf_quant_finance/experimental/pricing_platform/framework/rate_instruments/cashflow_streams.py" ]
[ "# Lint as: python3\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "tensorflow.compat.v2.zeros_like", "tensorflow.compat.v2.argsort", "tensorflow.compat.v2.searchsorted", "tensorflow.compat.v2.equal", "numpy.unique", "tensorflow.compat.v2.concat", "tensorflow.compat.v2.name_scope", "tensorflow.compat.v2.cast", "tensorflow.compat.v2.where", ...
eric8607242/OSNASLib
[ "2e758a9e5d9e03eecb9c4cc0e2e6a8ec38cf7052" ]
[ "search_space/sgnas/sgnas_model.py" ]
[ "import numpy as np\n\nimport torch.nn as nn\n\nfrom ..base_model import BaseModel\nfrom ..block_builder import get_block\n\nclass SGNASModel(BaseModel):\n def _construct_stage_layers(self, architecture, bn_momentum, bn_track_running_stats, *args, **kwargs):\n \"\"\" Construct searched layers in entire se...
[ [ "torch.nn.Sequential" ] ]
dataiku/dss-plugin-decision-tree-builder
[ "5bc53e8331e8f2e94b5e0c52fd720ebf6ea499f1" ]
[ "python-tests/test_score.py" ]
[ "import pandas as pd\nfrom dku_idtb_scoring.score import add_scoring_columns, get_scored_df_schema\nfrom dku_idtb_decision_tree.tree import ScoringTree\nfrom pytest import raises\n\nnodes = {\n\t\"0\": {\n\t\t\"id\": 0,\n\t\t\"parent_id\": -1,\n\t\t\"treated_as_numerical\": {\"num\": None},\n\t\t\"feature\": None,\...
[ [ "pandas.DataFrame" ] ]
hajiejue/FP-Code
[ "d144336cfd8e70b289a673567f727b9c9abbf9f5" ]
[ "segan/models/generator.py" ]
[ "import torch\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport torch.nn.utils as nnu\nimport torch.nn as nn\nimport random\nimport numpy as np\ntry:\n from core import *\n from modules import *\nexcept ImportError:\n from .core import *\n from .modules import *\n\n# BEWARE: ...
[ [ "torch.nn.Dropout", "scipy.signal.cheby1", "torch.max", "torch.ones", "torch.cat", "torch.nn.LSTM", "torch.randn", "torch.nn.ModuleList", "torch.min", "torch.zeros", "torch.nn.PReLU", "torch.nn.Tanh", "scipy.signal.dimpulse", "torch.FloatTensor", "torch....
XavierCHEN34/ClickSEG
[ "0c801cfa5f67f066fdaab28ff8f3afde1cb71ace" ]
[ "scripts/annotations_conversion/coco_lvis.py" ]
[ "import cv2\nimport pickle\nimport numpy as np\nfrom pathlib import Path\nfrom tqdm import tqdm\n\nfrom isegm.data.datasets import LvisDataset, CocoDataset\nfrom isegm.utils.misc import get_bbox_from_mask, get_bbox_iou\nfrom scripts.annotations_conversion.common import get_masks_hierarchy, get_iou, encode_masks\n\n...
[ [ "numpy.full_like", "numpy.max", "numpy.logical_not", "numpy.zeros" ] ]
siddtheshah/text2illustrate
[ "69ad0bf2b05c199626bda716f1af72064c28ef41" ]
[ "t2i/visualizer.py" ]
[ "import cv2\nimport numpy as np\n\nfrom t2i.entity import *\nfrom t2i.script import *\nfrom t2i.assetBook import *\nfrom t2i.endpointResolver import *\nfrom t2i.animate import *\nfrom threading import Lock, Thread\n\nimport sys\n\nCANVAS_WIDTH = 800\nCANVAS_HEIGHT = 600\n\nclass StaticVisualGraph:\n class Visual...
[ [ "numpy.array" ] ]
gladonias/neuronal-filters
[ "39eb6700725f91a374eafd50e1a814b6d9762d66" ]
[ "L4_DBC/run_RmpRiTau.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"Python script to run cell model\"\"\"\n\n\n\"\"\"\n/* Copyright (c) 2015 EPFL-BBP, All rights reserved.\n\nTHIS SOFTWARE IS PROVIDED BY THE BLUE BRAIN PROJECT ``AS IS''\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY A...
[ [ "numpy.array" ] ]
gy20073/robosuite
[ "cb02dd64c02d7b3d76f6016c9d00dc9391776ef9" ]
[ "robosuite/demo.py" ]
[ "import numpy as np\nimport robosuite as suite\nimport time\n\nif __name__ == \"__main__\":\n\n # get the list of all environments\n envs = sorted(suite.environments.ALL_ENVS)\n\n # print info and select an environment\n print(\"Welcome to Surreal Robotics Suite v{}!\".format(suite.__version__))\n pr...
[ [ "numpy.random.randn", "numpy.random.rand" ] ]
JungUnYun/License-Plate-Recognition
[ "2db81526532a23c4cfe5f1824d09e19e2fa25911" ]
[ "LPR/models.py" ]
[ "from __future__ import division\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\n\nfrom PIL import Image\n\nfrom utils.parse_config import *\nfrom utils.utils import build_targets\nfrom collections import defaultdict\n\nimport matplot...
[ [ "torch.nn.Sequential", "torch.nn.CrossEntropyLoss", "torch.sigmoid", "numpy.fromfile", "torch.cat", "torch.nn.ModuleList", "torch.from_numpy", "torch.arange", "torch.nn.BCELoss", "torch.exp", "torch.nn.LeakyReLU", "torch.nn.BatchNorm2d", "torch.nn.ZeroPad2d", ...
lartpang/CMWNet.pytorch
[ "b0cabc8c083c89077842e729191a27c3f2904b74" ]
[ "utils.py" ]
[ "# -*- coding: utf-8 -*-\n# @Time : 2021/6/3\n# @Author : Lart Pang\n# @GitHub : https://github.com/lartpang\n\nimport os\nimport random\nfrom collections import abc, defaultdict\nfrom numbers import Number\nfrom typing import List\n\nimport cv2\nimport numpy as np\nimport torch\nimport torch.nn.functional as ...
[ [ "torch.nn.Parameter", "torch.cuda.manual_seed", "numpy.random.seed", "torch.manual_seed", "torch.repeat_interleave", "torch.no_grad", "torch.cuda.manual_seed_all", "torch.nn.functional.interpolate" ] ]
rychallener/TauREx3_public
[ "eb0eeeeca8f47e5e7d64d8d70b43a3af370b7677" ]
[ "taurex/plot/plotter.py" ]
[ "import h5py\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport taurex.plot.corner as corner\nimport matplotlib as mpl\nfrom taurex.util.util import decode_string_array\nimport os\n\nfrom matplotlib import rc\n\n# some global matplotlib vars\nmpl.rcParams['axes.li...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.imshow", "matplotlib.pyplot.rc", "matplotlib.pyplot.plot", "numpy.max", "numpy.concatenate", "numpy.where", "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplot", "matplotlib.pyplot.errorbar...
aeturrell/example-reproducible-research
[ "4de882d1af05ade52e3991c1c4e1f939c9714f8f" ]
[ "src/analysis.py" ]
[ "\"\"\"\nThis script performs a regression\n\"\"\"\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport statsmodels.formula.api as smf\nfrom pathlib import Path\n\n\ndef regression():\n # Load data and format datetime\n df = pd.read_csv(\n Path(\"raw/raw_data.csv\"),\n index_col=0,\n ...
[ [ "matplotlib.pyplot.subplots" ] ]
nicholasz2510/zipf-from-text
[ "2ab0ce5fc248969de3019c6dd44e15d7937b4189" ]
[ "just_list.py" ]
[ "import matplotlib.pyplot as plt\n\nf = open(\"biggest_cities.txt\", \"r\")\n\nplt.plot([int(x.split(\",\")[3]) for x in f.readlines()][:15])\nplt.ylabel(\"City size\")\nplt.xlabel(\"City rank\")\nplt.show()\n\nf.close()\n" ]
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
Kau5h1K/ds5500-userprivacy-deploy
[ "38c91d20596163427b4f169c9ee221057ac438ce" ]
[ "haystack/modeling/data_handler/dataset.py" ]
[ "import logging\nimport numbers\nfrom typing import Iterable, List\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset, ConcatDataset, TensorDataset\nfrom transformers import BatchEncoding\n\nfrom haystack.modeling.utils import flatten_list\n\nlogger = logging.getLogger(__name__)\n\n\ndef flat...
[ [ "torch.utils.data.TensorDataset", "torch.tensor" ] ]
eruffaldi/pyml-tools
[ "ec2501245c494a0816208bbc8a90b21286a15c02" ]
[ "src/multiclassCM.py" ]
[ "import numpy as np\n\ndef confusionMatrix(predicted,actual,classes):\n\tmat = np.zeros([classes,classes])\n\n\tfor i in range(len(actual)):\n\t\tmat[int(round(predicted[i])),actual[i]] += 1\n\treturn mat\n\ndef getAccuracy(matrix):\n\t#sum(diag(mat))/(sum(mat))\n\tsumd = np.sum(np.diagonal(matrix))\n\tsumall = np....
[ [ "numpy.diagonal", "numpy.add", "numpy.zeros", "numpy.sum" ] ]
RyutaroHashimoto/aws_sagemaker
[ "fabe4727498c1f2807cda29df8d35c71cc1b27bd" ]
[ "2_training/Original_Container/tabnet/container/model/predictor.py" ]
[ "from __future__ import print_function\n\nimport json\nimport os\nfrom io import StringIO\n\nimport flask\nimport pandas as pd\nimport torch\nfrom model import TabNet_Regressor as model\nfrom pytorch_tabnet.tab_model import TabNetRegressor as original\n\nprefix = '/opt/ml/'\nmodel_path = os.path.join(prefix, 'model...
[ [ "pandas.read_csv", "torch.cuda.is_available", "pandas.DataFrame" ] ]
dom-s/cnn-text-classification-tf
[ "8cc93f06a76ddf6201f56938f3bff21b8e45c497" ]
[ "train.py" ]
[ "#! /usr/bin/env python\n\nimport tensorflow as tf\nimport numpy as np\nimport os\nimport time\nimport datetime\nimport data_helpers\nfrom text_cnn import TextCNN\nfrom tensorflow.contrib import learn\n\n# Parameters\n# ==================================================\n\n# Data loading params\ntf.flags.DEFINE_flo...
[ [ "tensorflow.train.global_step", "tensorflow.global_variables", "tensorflow.cast", "numpy.concatenate", "tensorflow.train.AdamOptimizer", "tensorflow.flags.DEFINE_float", "numpy.hstack", "tensorflow.Graph", "tensorflow.Variable", "tensorflow.ConfigProto", "tensorflow.Ses...
psorus/oan
[ "7d1b05e58e3ae470aab04bc806764f52d20b9b5b" ]
[ "oneoff_test/oneoff/auc.py" ]
[ "import numpy as np\n\n\nf=np.load(\"roc.npz\")\nfpr,tpr=f[\"fpr\"],f[\"tpr\"]\n\n\ndef iterdual(q):\n las=None\n for zw in q:\n if not las is None:\n yield las,zw\n las=zw\ndef iterdelta(q):\n for a,b in iterdual(q):\n yield a-b\ndef itermean(q):\n for a,b in iterdual(q)...
[ [ "numpy.load" ] ]
no-brainer/asr-homework
[ "5fafd51ea2ca90da54dad335dd8fd3c44f6f97b5" ]
[ "hw_asr/model/crnn.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\n\nfrom hw_asr.base import BaseModel\nfrom hw_asr.model.utils import get_same_padding\n\n\nclass ResidualBlock(nn.Module):\n # https://arxiv.org/pdf/1603.05027.pdf\n\n ...
[ [ "torch.nn.Sequential", "torch.nn.GELU", "torch.nn.Dropout", "torch.nn.LSTM", "torch.nn.Conv2d", "torch.nn.LayerNorm", "torch.nn.Linear" ] ]
Yuu94/bert-ja-maruchi-classification
[ "2ce88be548dc796c73835140b3c214f851f17e0b" ]
[ "run_classifier_livedoor.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
[ [ "tensorflow.contrib.cluster_resolver.TPUClusterResolver", "tensorflow.metrics.accuracy", "tensorflow.FixedLenFeature", "tensorflow.nn.log_softmax", "tensorflow.reduce_sum", "tensorflow.gfile.GFile", "tensorflow.cast", "tensorflow.train.init_from_checkpoint", "tensorflow.gfile.M...
hcrlab/stretch_ros
[ "237e9e56d759aa4de71dc09b02ec28ff6bcb1559" ]
[ "stretch_funmap/src/stretch_funmap/numba_create_plane_image.py" ]
[ "import numpy as np\nfrom numba import njit\n\n\n@njit(fastmath=True)\ndef numba_create_plane_image(plane_parameters, image):\n image_height, image_width = image.shape\n alpha, beta, gamma = plane_parameters\n\n for y in range(image_height):\n for x in range(image_width):\n image[y, x] = ...
[ [ "numpy.linalg.inv", "numpy.round", "numpy.array", "numpy.zeros_like" ] ]
bcgov/wps
[ "71df0de72de9cd656dc9ebf8461ffe47cfb155f6" ]
[ "api/app/c_haines/severity_index.py" ]
[ "\"\"\" Logic pertaining to the generation of c_haines severity index from GDAL datasets.\n\"\"\"\nimport os\nimport io\nimport asyncio\nfrom datetime import datetime, timezone, timedelta\nfrom typing import Final, Tuple, Generator, Optional, List\nfrom contextlib import contextmanager\nimport tempfile\nimport logg...
[ [ "numpy.array" ] ]
MarkRivers/tomopy
[ "77e1b30d7a4cb86b6a779c50184c9483c527a534" ]
[ "source/tomopy/prep/alignment.py" ]
[ "#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n\r\n# #########################################################################\r\n# Copyright (c) 2016-2019, UChicago Argonne, LLC. All rights reserved. #\r\n# #\r\n# Copyright 2016-2019....
[ [ "numpy.amax", "numpy.sqrt", "numpy.pad", "numpy.clip", "numpy.reshape", "numpy.arange", "numpy.std", "numpy.zeros", "numpy.amin", "scipy.ndimage.map_coordinates", "numpy.meshgrid", "numpy.array", "numpy.logical_and", "numpy.absolute", "numpy.gradient", ...
willyrv/optimal_lexic
[ "9f13c3cd65430168f1b7565aaf513dcf835b01a8" ]
[ "ETM/main.py" ]
[ "#/usr/bin/python\n\nfrom __future__ import print_function\n\nimport argparse\nimport torch\nimport pickle \nimport numpy as np \nimport os \nimport math \nimport random \nimport sys\nimport matplotlib.pyplot as plt \nimport data\nimport scipy.io\n\nfrom torch import nn, optim\nfrom torch.nn import functional as F\...
[ [ "torch.mm", "torch.cuda.manual_seed", "numpy.random.seed", "torch.randperm", "torch.manual_seed", "torch.load", "numpy.random.choice", "torch.sum", "torch.from_numpy", "torch.zeros", "numpy.random.normal", "torch.no_grad", "torch.log", "torch.cuda.is_availab...
meyer-lab/tfac-ccle
[ "949a17f345f9a6d13d42c5284195b4e0362919ae" ]
[ "tfac/dataHelpers.py" ]
[ "\"\"\"Contains function for importing and handling OHSU data\"\"\"\nfrom os.path import join, dirname\nimport numpy as np\nimport pandas as pd\n\npath_here = dirname(dirname(__file__))\n\n\ndef importLINCSprotein():\n \"\"\" Import protein characterization from LINCS. \"\"\"\n dataA = pd.read_csv(join(path_h...
[ [ "numpy.square", "pandas.concat", "numpy.append", "numpy.mean", "pandas.unique", "numpy.nanmean" ] ]
Theocrat/Iris
[ "5aaba5dc915f53d148106c0c6bca57e09c548d9c" ]
[ "Iris_recog/locate.py" ]
[ "from pupil import *\nfrom iris import *\nfrom numpy import zeros\nfrom skimage import draw\nfrom imworks import *\n\ndef locate(fname):\n\tpupil_img = pupil_detect(fname)\n\trows = pupil_img.shape[0]\n\tcols = pupil_img.shape[1]\n\n\tfor col in range(cols):\n\t\tcol = cols - 1 - col\n\t\tif sum(pupil_img[:,col]) >...
[ [ "numpy.zeros" ] ]
GabrielGustavoMS/processamentoDeImagens
[ "df4d553a60b4299b1ae161ca8f067105c46f9155" ]
[ "opencv2/BlackHat.py" ]
[ "import cv2\r\nimport numpy as np\r\n\r\nimg = cv2.imread('j.png',0)\r\nkernel = np.ones((5,5),np.uint8)\r\n\r\nblackhat = cv2.morphologyEx(img, cv2.MORPH_BLACKHAT, kernel)\r\n\r\nres1 = np.hstack((img, blackhat))\r\n\r\ncv2.imshow('Imagem Comum J, Com blackhat', res1)\r\ncv2.waitKey(0) \r\ncv2.destroyAllWindows()...
[ [ "numpy.hstack", "numpy.ones" ] ]
Anysomeday/SpecPatConv3D-Network
[ "2839268171bc17f58f38c1815368e248f1f7ad34" ]
[ "train.py" ]
[ "from sklearn.metrics import confusion_matrix, classification_report, accuracy_score\nfrom argparse import ArgumentParser\nfrom model import *\nimport tensorflow as tf\nimport numpy as np\nfrom helper import showClassTable, maybeExtract\nimport os\n\nfrom tqdm import tqdm\n\nnumber_of_band = {'Indian_pines': 2, 'Sa...
[ [ "numpy.expand_dims", "tensorflow.equal", "tensorflow.cast", "sklearn.metrics.confusion_matrix", "numpy.mean", "tensorflow.train.AdamOptimizer", "tensorflow.Graph", "numpy.argmax", "tensorflow.name_scope", "tensorflow.Session", "tensorflow.trainable_variables", "tens...
Sina-Mehdiz/Bioptim
[ "49c13c089db8200f503d0209f7f8685607d9ccaa" ]
[ "examples/getting_started/custom_initial_guess.py" ]
[ "\"\"\"\nThis example is a trivial box that must superimpose one of its corner to a marker at the beginning of the movement\nand superimpose the same corner to a different marker at the end.\nIt is designed to investigate the different way to define the initial guesses at each node sent to the solver\n\nAll the typ...
[ [ "numpy.array", "numpy.random.random" ] ]
Manifold-Computing/MMAML-Classification
[ "bdf1a93e798ab81619563038b95a3c5aa18717e0" ]
[ "maml/models/conv_embedding_model.py" ]
[ "from collections import OrderedDict\nimport torch\nimport torch.nn.functional as F\nimport numpy as np\n\n\nclass ConvEmbeddingModel(torch.nn.Module):\n def __init__(self, input_size, output_size, embedding_dims,\n hidden_size=128, num_layers=1,\n convolutional=False, num_conv=4,...
[ [ "torch.nn.Sequential", "torch.mean", "torch.nn.functional.batch_norm", "torch.zeros", "torch.cat", "torch.nn.ModuleList", "torch.nn.GRU", "torch.nn.functional.conv2d", "torch.nn.Conv2d", "numpy.stack", "torch.nn.Linear", "torch.nn.functional.relu", "torch.nn.Bat...
janakhpon/Datavisualization-plot
[ "1144cbc9cd16cd6ecaf996f6554ab039920e31ce" ]
[ "ex0001.py" ]
[ "import matplotlib.pyplot as plt\n\nyears = [1950, 1955, 1960, 1965, 1970, 1975, 1980, 1985, 1990, 1995, 2000, 2005, 2010, 2015, 2016, 2017, 2018, 2019]\npops = [0.00, 1.92, 2.14, 2.22, 2.37, 2.34, 2.26, 2.10, 1.71, 1.21, 1.25, 0.94, 0.67, 0.81, 0.69, 0.64, 0.61, 0.63]\ndeaths = [0.00, 0.77, 0.68, 0.54, 0.38, 0.23...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "matplotlib.pyplot.setp", "matplotlib.pyplot.grid" ] ]
ZhaozhiQIAN/SyncTwin-NeurIPS-2021
[ "78eff91d0287c7f1f66c76ca24834c7d1029ad3b" ]
[ "sim/pkpd.py" ]
[ "import numpy as np\nimport numpy.random\nimport scipy.integrate\nimport torch\n\nfrom config import DEVICE\n\n\ndef f(t, y, Kin, K, O, H, D50): # noqa: E741\n P = y[0]\n R = y[1]\n D = y[2]\n\n dP = Kin[int(t)] - K * P\n dR = K * P - (D / (D + D50)) * K * R\n dD = O[int(t)] - H * D\n\n return...
[ [ "torch.randn_like", "torch.cat", "numpy.arange", "numpy.stack", "torch.tensor", "numpy.concatenate", "numpy.ones", "torch.arange", "numpy.zeros", "torch.ones_like" ] ]
pdamiano-11/Team-4-Code
[ "39736f258ca14b96410d74e30e1f57d5e0fe18ba", "39736f258ca14b96410d74e30e1f57d5e0fe18ba" ]
[ "GMiguel/Project02.py", "src/UserStories/us30.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n\nimport pandas as pd\nimport datetime\nfrom tabulate import tabulate\n\ndef collectInputFile(gedcom_name):\n file = open(gedcom_name, \"r\")\n lines = []\n for line in file:\n lines.append(str(line))\n\n for idx, line in enumerate(lines):\n lines...
[ [ "pandas.to_datetime" ], [ "pandas.isna" ] ]
lazar505/transformer-xl
[ "76668624cbf5233fd02883701ffad0446f62de7b" ]
[ "run_web_transformer.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom absl import flags\nimport bottle\nimport io\nimport math\nimport numpy as np\nimport os\nimport pickle\nimport random\nfrom scipy.special import softmax\nimport spacy\nimport sys\nimport tensorflo...
[ [ "tensorflow.device", "tensorflow.compat.v1.train.Saver", "scipy.special.softmax", "tensorflow.add_n", "tensorflow.compat.v1.app.run", "tensorflow.gradients", "tensorflow.compat.v1.trainable_variables", "tensorflow.compat.v1.get_variable_scope", "numpy.zeros", "tensorflow.in...
kim-jiyoon/aimd
[ "6616528cb4cde0a92c3336b2f109a1160e1eb271" ]
[ "aimd/diffusion.py" ]
[ "# coding: utf-8\n# Copyright (c) MoGroup at UMD.\n# Distributed under the terms of the MIT License.\n\nfrom __future__ import division, unicode_literals\nimport numpy as np\nfrom monty.json import MSONable\nfrom scipy import stats\nfrom scipy.optimize import curve_fit\nfrom pymatgen.io.vasp.outputs import Vasprun\...
[ [ "numpy.diag", "numpy.sqrt", "numpy.cumsum", "numpy.concatenate", "numpy.max", "numpy.round", "numpy.any", "scipy.optimize.curve_fit", "numpy.square", "numpy.arange", "numpy.zeros", "numpy.log", "numpy.power", "numpy.fft.ifft", "scipy.stats.linregress", ...
parlamentikon/parlamentikon
[ "bae9b23b656e89bb922d4b321554964413541327" ]
[ "parlamentikon/TabulkySchuze.py" ]
[ "\nimport pandas as pd\n\nfrom parlamentikon.utility import pretypuj, mask_by_values, format_to_datetime_and_report_skips\nfrom parlamentikon.Helpers import MItem\n\n#from parlamentikon.Snemovna import *\n#from parlamentikon.PoslanciOsoby import *\n\nfrom parlamentikon.setup_logger import log\n\n# Informace k tabul...
[ [ "pandas.read_csv" ] ]
pedrohma/python-ai-study
[ "362a33aaaf3e334c3e669458dec34a4fcf15029c" ]
[ "neural network/neural.py" ]
[ "from numpy import exp, array, random, dot\n\nclass NeuralNetwork():\n def __init__(self):\n random.seed(1)\n\n self.synaptic_weights = 2 * random.random((3,1)) - 1\n\n def __sigmoid(self, y):\n return 1/(1 + exp(-y))\n\n def __sigmoid_derivative(self, y):\n return y * (1 - y)\n...
[ [ "numpy.dot", "numpy.random.random", "numpy.random.seed", "numpy.array", "numpy.exp" ] ]
Pragalbha-Patil/S-TASLC-Python
[ "d3d89f98cd7c2a5e8fbedccd0e40e6e15e0a8b43" ]
[ "main.py" ]
[ "from threading import Thread\n# import pygame\n# import speake3\nimport speech_recognition as sr\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport cv2\nfrom easygui import *\nimport os\nfrom PIL import Image, ImageTk\nfrom itertools import count\nimport tkinter as tk\nimport string\nimport platform\n\nd...
[ [ "matplotlib.pyplot.imshow", "numpy.asarray", "matplotlib.pyplot.draw", "matplotlib.pyplot.close", "matplotlib.pyplot.pause" ] ]
alexisgroshenry/NPM3D_DSNet
[ "d1a2ec071728dcb3c733ecdee3a27f4534b67f33" ]
[ "utils/eval_np.py" ]
[ "#!/usr/bin/env python3\n\n# This file is covered by the LICENSE file in the root of this project.\n\nimport numpy as np\nimport time\n\n\nclass PanopticEval:\n \"\"\" Panoptic evaluation using numpy\n \n authors: Andres Milioto and Jens Behley\n\n \"\"\"\n\n def __init__(self, n_classes, device=None, ignore=N...
[ [ "numpy.maximum", "numpy.logical_and", "numpy.unique", "numpy.stack", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.random.randint" ] ]
jusjusjus/phac-python
[ "107c1e3f2f80972ff675754af9b38e271f5005b9" ]
[ "phac/hilbert.py" ]
[ "import numpy as np\n\nfrom .util import trapezoid, _hilbert\n\n\nclass SegmentedSignal:\n\n def __init__(self, nsegment: int, noverlap: int, n: int = None,\n arr: np.ndarray = None, dtype=np.float64):\n self.arr = np.zeros(n, dtype=dtype) if arr is None else arr\n self.nsegment = n...
[ [ "numpy.ceil", "numpy.zeros" ] ]
jeremyjordan/flower-classifier
[ "812003a12cefcc9bc8d68aa8167d3dc95b562d5f" ]
[ "tests/models/test_baseline.py" ]
[ "import pytest\nimport torch\n\nfrom flower_classifier.models.baseline import BaselineResnet\n\nN_CLASSES = 102\n\n\n@pytest.fixture(scope=\"module\")\ndef network():\n network = BaselineResnet(n_classes=N_CLASSES)\n return network\n\n\n@pytest.mark.parametrize(\n \"batch_size, img_height, img_width\",\n ...
[ [ "torch.zeros" ] ]
uoguelph-mlrg/Theano-MPI
[ "4bf0ebc167967dc3cb0969d4b12e304ef11d724a" ]
[ "theanompi/models/alex_net.py" ]
[ "# This version of alex_net.py is modified based on the theano_alexnet project. See the original project here:\n# https://github.com/uoguelph-mlrg/theano_alexnet, and its copy right:\n# Copyright (c) 2014, Weiguang Ding, Ruoyan Wang, Fei Mao and Graham Taylor\n# All rights reserved.\n\nimport numpy as np\n\nimport ...
[ [ "numpy.zeros", "numpy.float32" ] ]
skyInGitHub/audio_adversarial_examples
[ "b5f63fc30cc2c59b4812d00fa974b92afd6e2a0b" ]
[ "classify.py" ]
[ "## classify.py -- actually classify a sequence with DeepSpeech\n##\n## Copyright (C) 2017, Nicholas Carlini <nicholas@carlini.com>.\n##\n## This program is licenced under the BSD 2-Clause licence,\n## contained in the LICENCE file in this directory.\n\nimport numpy as np\nimport tensorflow as tf\nimport argparse\n...
[ [ "tensorflow.nn.ctc_beam_search_decoder", "tensorflow.placeholder", "tensorflow.variable_scope", "tensorflow.Session", "tensorflow.train.Saver", "scipy.io.wavfile.read" ] ]
senysenyseny16/pytorch
[ "e65a1edabb2b8e2bec752cba69cc3f434626a482" ]
[ "torch/fx/graph_module.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.overrides\nfrom torch.nn.modules.module import _addindent\nfrom torch.package import PackageImporter, PackageExporter\nimport linecache\nfrom typing import Type, Dict, List, Any, Union, Optional, Set\nfrom .graph import Graph, _is_from_torch, _custom_builtins, Pyth...
[ [ "torch.nn.Module", "torch.nn.modules.module._addindent", "torch.save" ] ]
youngerous/BERT-sentiment-classifier
[ "8c6a466e0a23e3b60212be15437b877b7e17bcb6" ]
[ "main.py" ]
[ "import multiprocessing\nfrom argparse import ArgumentParser, Namespace\nfrom typing import Tuple\n\nimport nlp\nimport pytorch_lightning as pl\nimport torch\nimport transformers\nfrom pytorch_lightning.loggers import TensorBoardLogger\n\n\nclass IMDBSentimentClassifier(pl.LightningModule):\n def __init__(self, ...
[ [ "torch.nn.CrossEntropyLoss", "torch.max", "torch.cat", "torch.utils.data.DataLoader", "torch.tensor", "torch.stack" ] ]
potato1996/IMGCaptioning
[ "23eff63e506cb785e2e4483f37f830ecc54edc3b" ]
[ "Decoder.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision.models as models\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\nfrom torch.autograd import Variable\n\n\nclass Decoder(nn.Module):\n \"\"\" Decoder part(training) -- A RNN Decoder to produce the ...
[ [ "torch.nn.Dropout", "torch.nn.functional.log_softmax", "torch.nn.LSTM", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.Embedding", "torch.tensor", "torch.nn.Linear", "torch.nn.utils.rnn.pad_packed_sequence", "torch.cuda.is_available" ] ]
03pie/SMPCUP2017
[ "956f97fce8620b3b0c35e6b3757347ede30c64ba", "956f97fce8620b3b0c35e6b3757347ede30c64ba" ]
[ "make_idf.py", "feature_extraction2.py" ]
[ "from sklearn.feature_extraction.text import TfidfVectorizer\nimport pandas as pd\nfrom segmentation import segment, stop_words\n# make_Tfidfvectorizer\ndef make_idf(corpus):\n\tvectorizer = TfidfVectorizer(stop_words=stop_words)\n\tvectorizer.fit_transform(corpus)\n\treturn vectorizer\n\nif __name__ == '__main__':...
[ [ "sklearn.feature_extraction.text.TfidfVectorizer" ], [ "pandas.read_table", "pandas.merge", "pandas.read_csv", "pandas.DataFrame" ] ]
christophschuhmann/BLIP
[ "498f963762db65e7290eea02573e1749f955b3d0" ]
[ "caps.py" ]
[ "#@title Captioning Images of various Types { vertical-output: true }\n#hide\nimport os\nimport glob\nrep_pen=1.4\nfiles= glob.glob(\"./images/*.jpg\")\ntarget_dir= \"./captions/\"\ntry:\n os.mkdir(target_dir)\nexcept:\n pass\n\n\nfrom PIL import Image\nimport numpy as np\nimport torch\nimport clip\nimport langua...
[ [ "numpy.asarray", "numpy.matmul", "numpy.linalg.norm", "torch.no_grad", "torch.cuda.is_available" ] ]
Hyperion-shuo/Agent-Ticket
[ "c9df0eba1250ac5c0b8372c191374c020f586b42" ]
[ "Wang/BrainDDPG.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport gym\nimport time\n\n\nnp.random.seed(1)\ntf.set_random_seed(1)\n\n##################### hyper parameters ####################\n\n# MAX_EPISODES = 200\n# MAX_EP_STEPS = 200\n# LR_A = 0.001 # learning rate for actor\n# LR_C = 0.001 # learning rate for criti...
[ [ "tensorflow.get_variable", "tensorflow.control_dependencies", "tensorflow.train.ExponentialMovingAverage", "tensorflow.train.AdamOptimizer", "numpy.hstack", "tensorflow.get_collection", "tensorflow.layers.dense", "tensorflow.Session", "tensorflow.random_normal_initializer", ...
guilhermevarela/ilu
[ "e4db9744c28f9e04ae82c884f131ee8cd9601cc8" ]
[ "tests/ql/test_dpq.py" ]
[ "import os\nimport pickle\nimport unittest\n\nimport numpy as np\nfrom ilurl.core.params import QLParams, Bounds\nfrom ilurl.core.ql.dpq import DPQ\n\n\nclass TestDPQUpdate(unittest.TestCase):\n '''Tests update Q\n Builds a simple process MDP\n\n actions:\n left ((0,)) and right ((1,))\n\n state...
[ [ "numpy.argmax" ] ]
xymyeah/models
[ "7bc7f4e1a1800efd15de9b90c054c9ab5aba4ad8" ]
[ "fluid/DeepASR/train.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport sys\nimport os\nimport numpy as np\nimport argparse\nimport time\n\nimport paddle.v2.fluid as fluid\nimport data_utils.augmentor.trans_mean_variance_norm as trans_mean_variance_norm\nimport data...
[ [ "numpy.mean" ] ]
sdban/tf-quant-finance
[ "dfe6b80d7c1146ae51ceb3ced92a83d1d4520697" ]
[ "tf_quant_finance/rates/analytics/cashflows.py" ]
[ "# Lint as: python3\n# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "tensorflow.compat.v2.zeros_like", "tensorflow.compat.v2.math.exp", "tensorflow.compat.v2.TensorShape", "tensorflow.compat.v2.name_scope", "tensorflow.compat.v2.math.reduce_sum", "tensorflow.compat.v2.convert_to_tensor", "tensorflow.compat.v2.compat.v1.name_scope", "tensorflow.comp...
davidharvey1986/rrg
[ "26b4658f14279af21af1a61d57e9936daf315a71", "26b4658f14279af21af1a61d57e9936daf315a71" ]
[ "lib/RRGtools/cluster_member_removal.py", "lib/RRGtools/astro_tools.py" ]
[ "'''\nRemove cluster members from catlogue\n\nThis algorithm will take 2 filters from HST and match the catalogues\nIt will then look and the color-magnitude plot and find the red sequence.\nFrom this it wil remove galaxies that appear to be in the cluster from the catalogue\n\n\nIt requires that the pyRRG code has...
[ [ "numpy.min", "matplotlib.pyplot.ylim", "matplotlib.pyplot.draw", "matplotlib.pyplot.plot", "numpy.max", "matplotlib.pyplot.xlim", "matplotlib.pyplot.close", "numpy.array", "numpy.lib.recfunctions.append_fields", "matplotlib.pyplot.show" ], [ "numpy.linspace", "n...
lintondf/COVIDtoTimeSeries
[ "b676a87ecf414cae3bea742e946d0e6458d641cf" ]
[ "covid/Analysis2.py" ]
[ "'''\nCreated on Apr 9, 2020\n\n@author: D. F. Linton, Blue Lightning Development, LLC\n'''\n\nimport os\nfrom pathlib import Path\nimport warnings\nimport io\nimport requests\nimport urllib.parse\nimport numpy as np\nimport scipy.stats as stats\nfrom scipy.stats import norm\nfrom seasonal import fit_seasons, adjus...
[ [ "numpy.hstack", "numpy.log", "pandas.read_csv", "numpy.asarray", "matplotlib.pyplot.subplots", "matplotlib.pyplot.draw", "sklearn.linear_model.LinearRegression", "pandas.plotting.register_matplotlib_converters", "matplotlib.pyplot.close", "numpy.exp", "matplotlib.gridsp...
aloaberasturi/biLSTM_NER
[ "ad7442d1aab17edb9cfe0f1e49c7ea3342b368a8" ]
[ "src/nnerc_learner.py" ]
[ "#!usr/bin/python3\nimport json\nimport numpy as np\nfrom pathlib import Path\nfrom nnerc_utils import load_data, encode_words, j_dump, load_glove, classify_token, embedding_matrix, what_capital\nfrom nnerc_common import traindata_file, valdata_file, NetConfig\nfrom keras.preprocessing.text import Tokenizer\nfrom k...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
MatheusZickuhr/python-neat
[ "ce80175dcbfcf7a159499cb90d904605cd4c78a3" ]
[ "python_ne/core/neural_network/neural_network.py" ]
[ "import numpy as np\n\nimport python_ne.core.neural_network.saving as saving\nfrom python_ne.core.neural_network import activations\nfrom python_ne.core.neural_network.dense_layer import DenseLayer\n\n\nclass NeuralNetwork:\n\n def __init__(self):\n self.layers = []\n\n def initialize(self):\n \...
[ [ "numpy.array" ] ]
ArlindKadra/Auto-PyTorch
[ "6e72d5ba088981b89371f29773d243a211a4d068" ]
[ "baselines/refit_experiment.py" ]
[ "import argparse\nimport json\nimport logging\nlogging.basicConfig(level=logging.DEBUG)\nimport os\nimport random\n\nimport hpbandster.core.result as hpres\nimport numpy as np\nimport openml\n\nfrom data.loader import Loader\nfrom worker import XGBoostWorker, TabNetWorker\n\n\nparser = argparse.ArgumentParser(\n ...
[ [ "numpy.random.seed" ] ]
ningyuwhut/dqn-tensorflow-annotated
[ "3051bf418a06ba659170b738c03651383699c80b" ]
[ "main.py" ]
[ "from __future__ import print_function\nimport random\nimport tensorflow as tf\n\nfrom dqn.agent import Agent\nfrom dqn.environment import GymEnvironment, SimpleGymEnvironment\nfrom config import get_config\n\nflags = tf.app.flags\n\n# Model\nflags.DEFINE_string('model', 'm1', 'Type of model')\nflags.DEFINE_boolean...
[ [ "tensorflow.set_random_seed", "tensorflow.test.is_gpu_available", "tensorflow.ConfigProto", "tensorflow.app.run" ] ]
Miguel-Antonm/deploy_DL_space_weather_forecast
[ "d94ec77ebe1b2d6c952c2a9f5515d872a62b73e2" ]
[ "swfd/load_model.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/02_load_model.ipynb (unless otherwise specified).\n\n__all__ = ['NORMALIZE', 'HORIZONS', 'COLUMNS', 'loadModel', 'formatDate', 'getCsvData', 'getNameRunFolders',\n 'singlePrediction', 'ensemblePrediction', 'ensembleMeanVar', 'modelPrediction', 'getAllHorizo...
[ [ "numpy.matrix", "torch.Tensor", "torch.load", "torch.cuda.is_available", "numpy.array", "numpy.empty" ] ]
smartswdeveloper/pandas
[ "a9be7153fff15a9e28793dd54327b5342c34be51" ]
[ "pandas/tests/reshape/test_concat.py" ]
[ "from collections import OrderedDict, abc, deque\nimport datetime as dt\nfrom datetime import datetime\nfrom decimal import Decimal\nfrom io import StringIO\nfrom itertools import combinations\nfrom warnings import catch_warnings\n\nimport dateutil\nimport numpy as np\nfrom numpy.random import randn\nimport pytest\...
[ [ "pandas._testing.assert_almost_equal", "pandas.Series", "pandas.PeriodIndex", "pandas.RangeIndex", "pandas.tests.extension.decimal.to_decimal", "pandas.MultiIndex.from_tuples", "pandas.DataFrame", "numpy.concatenate", "pandas.core.indexes.datetimes.date_range", "numpy.rando...
dotrungkien/face_recognition
[ "52c552c4f73850e62db88d0dc7271d73e4150180" ]
[ "cifar10_input.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.image.resize_image_with_crop_or_pad", "tensorflow.image.random_brightness", "tensorflow.transpose", "tensorflow.image.random_flip_left_right", "tensorflow.image.random_contrast", "tensorflow.slice", "tensorflow.summary.image", "tensorflow.decode_raw", "tensorflow.ca...
mo6zes/Reproducing-Deep-Fair-Clustering
[ "91f915436821eb05cdd021d3e9eb050a248fe993" ]
[ "dfc.py" ]
[ "import torch\nimport wandb\nfrom sklearn.metrics import normalized_mutual_info_score\nfrom torch import nn\nfrom torch.nn import Parameter\n\nfrom adverserial import AdversarialNetwork, adv_loss\nfrom dataloader import mnist_usps\nfrom eval import predict, cluster_accuracy, balance, tsne_visualization\nfrom utils ...
[ [ "torch.set_default_tensor_type", "torch.nn.Parameter", "torch.nn.KLDivLoss", "torch.zeros", "torch.cat", "torch.sum", "torch.no_grad", "torch.nn.init.xavier_uniform_", "sklearn.metrics.normalized_mutual_info_score", "torch.nn.MSELoss" ] ]
Hoa-Lab/audiogram
[ "91fe29ebb1d460ef97bbb8014bf529ff443a134c" ]
[ "b03_model/a04_dl_02_score.py" ]
[ "import pandas as pd\nimport numpy as np\nimport pickle\nimport tensorflow.keras as keras\nfrom sklearn.metrics import f1_score, accuracy_score\nfrom pathlib import Path\nfrom sklearn.metrics import confusion_matrix\n\n#--------------------------------------------------------\nfd_out='./out/a04_dl_02_score'\nfd_mod...
[ [ "tensorflow.keras.models.load_model", "sklearn.metrics.confusion_matrix", "pandas.DataFrame", "numpy.argmax", "numpy.load", "sklearn.metrics.f1_score", "sklearn.metrics.accuracy_score" ] ]
ac2sherry/DAT210x-ac2sherry
[ "c8ded1109dda5ac59b07f1608e2cb7e7d9396ac5" ]
[ "Module6/assignment1.py" ]
[ "import matplotlib as mpl\nimport matplotlib.pyplot as plt\n\nimport pandas as pd\nimport numpy as np \nimport time\n\n\n# \n# INFO: Your Parameters.\n# You can adjust them after completing the lab\nC = 1\nkernel = 'linear'\niterations = 5000 # TODO: Change to 200000 once you get to Question#2\n\n#\n# INFO: You c...
[ [ "matplotlib.pyplot.text", "matplotlib.pyplot.yticks", "pandas.read_csv", "matplotlib.pyplot.contourf", "matplotlib.pyplot.scatter", "matplotlib.style.use", "pandas.isnull", "numpy.arange", "sklearn.model_selection.train_test_split", "sklearn.neighbors.KNeighborsClassifier",...
hammuRawi/DeepField
[ "3b336ed110ff806316f1f6a99b212f99256a6b56" ]
[ "deepfield/datasets/datasets.py" ]
[ "# pylint: disable=too-many-lines\n\"\"\"Dataset wrappers for Fields.\"\"\"\nimport os\nimport pickle\nimport inspect\nimport numpy as np\nimport pandas as pd\nimport torch\n\nfrom torch.utils.data import Dataset\n\nfrom ..field import Field\nfrom ..field.base_component import BaseComponent\nfrom ..field.utils impo...
[ [ "numpy.nanmax", "pandas.to_datetime", "numpy.nanmin", "numpy.concatenate", "numpy.max", "numpy.mean", "numpy.nanmean", "numpy.random.randint", "numpy.arange", "numpy.stack", "numpy.atleast_1d", "numpy.min", "numpy.power", "torch.is_tensor", "pandas.Timed...
jdlarsen-UA/flopy
[ "bf2c59aaa689de186bd4c80685532802ac7149cd" ]
[ "autotest/t057_test_mp7.py" ]
[ "import os\nimport shutil\nimport numpy as np\nimport flopy\n\nmodel_ws = os.path.join(\"temp\", \"t057\")\n# delete the directory if it exists\nif os.path.isdir(model_ws):\n shutil.rmtree(model_ws)\n\nexe_names = {\"mf2005\": \"mf2005\", \"mf6\": \"mf6\", \"mp7\": \"mp7\"}\nrun = True\nfor key in exe_names.keys...
[ [ "numpy.rec.fromarrays", "numpy.dtype", "numpy.ones" ] ]
theofpa/continual-object-instances
[ "630ab4b115e5bf6004a26855a7af24e37372e5bb" ]
[ "src/train.py" ]
[ "import torch\nfrom tqdm import tqdm\n\nfrom utils import device, args\nfrom utils import save_model, send_to_device, print_train_progress\nfrom metrics import evaluation\n\n\ndef train(model, criterion, train_loader, query_loader, gallery_loader, optimizer, experiment_name):\n for epoch in range(args.n_epochs):...
[ [ "torch.no_grad" ] ]
jhyuklee/piqa
[ "a38b94eb1e5146720ca443d3e8bebb93bd3c32f9" ]
[ "squad/piqa_evaluate.py" ]
[ "\"\"\" Official alpha evaluation script for PIQA (inherited from SQuAD v1.1 evaluation script).\"\"\"\nfrom __future__ import print_function\n\nimport os\nfrom collections import Counter\nimport string\nimport re\nimport argparse\nimport json\nimport sys\n\nimport scipy.sparse\nimport numpy as np\n\n\ndef normaliz...
[ [ "numpy.matmul" ] ]
ndoo/depthai-face-to-mqtt
[ "bbcf5c87401e155593f1bddffeb835e59f12a6aa" ]
[ "main.py" ]
[ "# coding=utf-8\nimport os\nfrom pathlib import Path\nfrom queue import Queue\nimport argparse\nfrom time import monotonic\nimport datetime\nimport throttle\nimport logging\n\nimport cv2\nimport depthai\nimport numpy as np\nfrom imutils.video import FPS\n\nparser = argparse.ArgumentParser()\n\nparser.add_argument(\...
[ [ "numpy.dot", "numpy.ascontiguousarray", "numpy.linalg.norm", "numpy.savez_compressed", "numpy.load", "numpy.array" ] ]
Lambda-School-Labs/yelp-dataset-challenge-2-ds
[ "fa7cace65e502e335bdb804519e2b3ec5b6e77c6" ]
[ "wordcloudapi/wordcloudapp/timeseries.py" ]
[ "import numpy as np\nimport pandas as pd\nimport ast\nfrom collections import Counter\nfrom .models import DB, reviews\n\ndef wc_count(docs):\n \"\"\"Count the occurance of each word and rank\n \"\"\"\n total=len(docs)\n wc = pd.DataFrame({'word':docs, 'count':np.ones(len(docs))})\n wc = wc.groupby('...
[ [ "pandas.concat", "pandas.qcut", "pandas.read_sql" ] ]
VCAT19/torch-ngp
[ "dcbfe061b30808875a80f12a10a383b51b35f121" ]
[ "nerf/gui.py" ]
[ "import torch\nimport numpy as np\nimport dearpygui.dearpygui as dpg\nfrom scipy.spatial.transform import Rotation as R\n\nfrom nerf.utils import *\n\n\nclass OrbitCamera:\n def __init__(self, W, H, r=2, fovy=60):\n self.W = W\n self.H = H\n self.radius = r # camera distance from center\n ...
[ [ "torch.cuda.synchronize", "numpy.radians", "scipy.spatial.transform.Rotation.from_rotvec", "scipy.spatial.transform.Rotation.from_quat", "numpy.eye", "torch.cuda.Event", "torch.tensor", "torch.no_grad", "numpy.array", "numpy.zeros" ] ]
brandonwillard/symbolic-pymc
[ "84e8d612c714f502f8d188c1766498f4ff7beecf" ]
[ "symbolic_pymc/theano/ops.py" ]
[ "import numpy as np\nimport theano\nimport theano.tensor as tt\n\nfrom collections.abc import Iterable, ByteString\nfrom warnings import warn\nfrom copy import copy\n\nfrom theano.tensor.raw_random import RandomStateType\n\n\ndef param_supp_shape_fn(ndim_supp, ndims_params, dist_params, rep_param_idx=0, param_shape...
[ [ "numpy.size", "numpy.random.RandomState" ] ]
johli/scrambler
[ "608f6b50efc1cb222d8df8a9f0231a4a9c1a9c1a" ]
[ "scrambler/models/scrambler_models.py" ]
[ "import keras\nfrom keras.models import Sequential, Model, load_model\n\nfrom keras.layers import Dense, Dropout, Activation, Flatten, Input, Lambda\nfrom keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, Conv1D, MaxPooling1D, LSTM, ConvLSTM2D, GRU, CuDNNLSTM, CuDNNGRU, BatchNormalization, LocallyConnecte...
[ [ "numpy.concatenate", "tensorflow.get_default_graph", "tensorflow.python.framework.ops.RegisterGradient", "numpy.arange", "tensorflow.nn.moments", "tensorflow.ConfigProto", "numpy.argmax", "tensorflow.Session", "tensorflow.ceil", "tensorflow.argmax", "numpy.zeros", "...
atlan-antillia/EfficientDet-Japanese-RoadSigns
[ "401c37c19972e5571e1f189943f01b16bc202274" ]
[ "TFRecordInspector.py" ]
[ "#******************************************************************************\n#\n# Copyright (c) 2021 Antillia.com TOSHIYUKI ARAI. 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...
[ [ "tensorflow.sparse.to_dense", "tensorflow.data.TFRecordDataset", "tensorflow.io.parse_single_example", "tensorflow.io.VarLenFeature", "tensorflow.io.FixedLenFeature", "numpy.int64", "tensorflow.image.decode_image" ] ]
lucaskup/PorosityAnalisys
[ "e2c443b886a440b67a80ecde510365697064a4ca" ]
[ "code/compare_models.py" ]
[ "from sklearn.model_selection import cross_validate\n\nimport pandas as pd\nimport numpy as np\n\nfrom scipy.stats import t\nfrom sklearn.model_selection import RepeatedKFold\n\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.linear_model import Ridge\nfrom sklearn.linear_model import Lasso\nfrom sk...
[ [ "sklearn.ensemble.RandomForestRegressor", "numpy.sqrt", "sklearn.linear_model.ElasticNet", "pandas.DataFrame", "numpy.mean", "numpy.var", "sklearn.preprocessing.MinMaxScaler", "pandas.read_csv", "sklearn.linear_model.Lasso", "sklearn.svm.SVR", "sklearn.linear_model.Ridg...
sameelab/mutprediction-with-shape
[ "8ca44a25d57903564f1e187d03880ba8a6babe37" ]
[ "TFBS_analysis/script_TFBS_mutrates.py" ]
[ "# python3\n\n# Libraries\nimport os\nimport sys\nimport re\nimport numpy as np\nimport pandas as pd\nfrom collections import Counter\nfrom Bio import SeqIO, motifs\nfrom Bio.Seq import Seq\nfrom scipy.stats import pearsonr, spearmanr, kstest, entropy\n\n\n# Import filenames list\nfile_shape, file_muts, file_logo, ...
[ [ "pandas.read_csv", "numpy.nonzero", "pandas.DataFrame", "numpy.max", "numpy.shape" ] ]
srishag/Machine-Learning-For-Trading
[ "34ea564c9f1645d5cf1ebf1e4948ada0cfd957b7" ]
[ "Lesson 4/23_access_array_elements.py" ]
[ "\"\"\"Accessing NumPy arrays.\"\"\"\nimport numpy as np\n\n\ndef test_run():\n a = np.random.rand(5, 4)\n print(\"Array:\\n\", a)\n\n # Accessing element at position (3, 2)\n element = a[3, 2]\n print(element)\n\n # Elements in defined range\n print(a[0, 1:3])\n\n # Top left corner of array...
[ [ "numpy.random.rand" ] ]
yangjiang001/pdia-1
[ "8dcd0960bf2e540f11cd37ccb92cbac1bbd51368" ]
[ "pdia/qc/dropStudentsWithRepeatedBlock.py" ]
[ "import pandas as pd\n\nfrom pdia.utils.createUniqueRunID import createUniqueRunID\nfrom pdia.qc.dropStudents import dropStudents\n\n\ndef dropStudentsWithRepeatedBlock(df,\n saveDroppedAs=None,\n studentId='BookletNumber',\n ...
[ [ "pandas.Series" ] ]
DhruvaBansal00/MultimodalGNN-VQA
[ "658da6f7f18883fb1302cd13c0b5603de836e199" ]
[ "mgn/models/seq2seq.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass Seq2seq(nn.Module):\n \"\"\"Seq2seq model module\n To do: add docstring to methods\n \"\"\"\n \n def __init__(self, encoder, decoder):\n super(Seq2seq, self).__init__()\n self.encoder = encoder\n self.decoder = decoder\n\n def fo...
[ [ "torch.autograd.backward", "torch.exp", "torch.diag", "torch.stack", "torch.index_select" ] ]