repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
sarvex/estimator
[ "5f53a7d36676ab4553c75a8cd9668f885536e8f8" ]
[ "tensorflow_estimator/python/estimator/head/multi_head_test.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.strings.as_string", "tensorflow.constant", "tensorflow.executing_eagerly", "tensorflow.Variable", "tensorflow.test.main", "tensorflow.math.sigmoid", "numpy.array" ] ]
RyanNavillus/tcav
[ "ef3bb59fc08fe04d836f00ad0036dd71f5e5079b" ]
[ "tcav/model_test.py" ]
[ "\"\"\"\nCopyright 2019 Google LLC\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n https://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing...
[ [ "tensorflow.io.gfile.rmtree", "tensorflow.Variable", "tensorflow.io.write_graph", "tensorflow.io.gfile.exists", "tensorflow.compat.v1.saved_model.simple_save", "tensorflow.io.gfile.makedirs", "tensorflow.math.multiply", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.plac...
nishantsule/Guitar-Effects
[ "5bf40f641e477f5655c91c3967ebccf8104e6d96" ]
[ "guitareffects.py" ]
[ "import numpy as np\nfrom bokeh.plotting import figure, show\n# from bokeh.io import output_notebook\nfrom bokeh.palettes import Colorblind\nimport pydub\nimport os\n\n# This class defines the core Guitar Effects object. \n# It contains functions to read and write audio files.\n# It also contains all the different ...
[ [ "numpy.absolute", "numpy.arange", "numpy.sin", "numpy.sign", "numpy.frombuffer", "numpy.concatenate", "numpy.shape", "numpy.roll", "numpy.exp", "numpy.zeros", "numpy.sum" ] ]
wwhio/PaddleGAN
[ "f84ddda4273346cb693724a51e64fefd9b10877c" ]
[ "ppgan/models/generators/occlusion_aware.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.\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 r...
[ [ "numpy.zeros" ] ]
pedrohtg/pytorch
[ "b8f1b330d4ecad08d93624d9d1d510f3bcd197c7" ]
[ "semantic_segmentation/data.py" ]
[ "import os\nimport random\nfrom PIL import Image\nimport torch\nfrom torch.utils.data import Dataset\n\n\n# Labels: -1 license plate, 0 unlabeled, 1 ego vehicle, 2 rectification border, 3 out of roi, 4 static, 5 dynamic, 6 ground, 7 road, 8 sidewalk, 9 parking, 10 rail track, 11 building, 12 wall, 13 fence, 14 guar...
[ [ "torch.zeros" ] ]
neuroailab/RAFT
[ "03e532cdcad35d3582b053035ec10257c73cbaaa" ]
[ "core/utils/segmentation_metrics.py" ]
[ "import numpy as np\nimport scipy\nimport sklearn.metrics\nimport skimage\nfrom skimage.segmentation.boundaries import find_boundaries\nfrom sklearn.cluster import KMeans\n\nimport torch\nfrom torchvision import transforms\nimport torch.nn.functional as F\nimport pdb\n\ndef object_id_hash(objects, dtype_out=torch.i...
[ [ "torch.randint", "torch.cat", "torch.iinfo", "torch.unique", "numpy.mean", "numpy.nanmean", "numpy.zeros_like", "scipy.optimize.linear_sum_assignment", "torch.pow", "torch.ones", "numpy.unique", "numpy.stack", "torch.tensor", "numpy.zeros", "numpy.power"...
wconti27/DS4300_FIFA_Tool
[ "ea34a8cfbd634dbac864122fc73d2a4b1efb1702" ]
[ "import_data.py" ]
[ "import pymongo\nimport os\nimport pandas as pd\nimport json\n\ndef main():\n client = pymongo.MongoClient(\"mongodb://localhost:27017/\")\n databases = client.list_database_names()\n\n if \"fifa\" not in databases:\n db = client[\"fifa\"]\n\n players_collection = db[\"players\"]\n ult...
[ [ "pandas.read_csv" ] ]
wkoa/slip_detection
[ "077b34ed69c44cbc6bed13a018e6ec223c9902f0" ]
[ "train_net.py" ]
[ "import os\n\nimport torch\nfrom torch import optim\nfrom torch import nn\nfrom torch.utils.data.dataloader import DataLoader\n\nfrom tensorboardX import SummaryWriter\n\nfrom libs.models import network\nfrom libs.utils import data_loader\n\nparams = {}\ndevice = torch.device(\"cuda:0\" if torch.cuda.is_available()...
[ [ "torch.nn.CrossEntropyLoss", "torch.max", "torch.load", "torch.no_grad", "torch.cuda.is_available", "torch.utils.data.dataloader.DataLoader" ] ]
mkuchnik/Efficient_Augmentation
[ "a82190c02509682c34f2df782fb58f8ffd3b11da" ]
[ "experiments.py" ]
[ "import numpy as np\nimport sklearn.model_selection\nimport logging\n\nimport collections\nimport pprint\nimport time\n\nimport selection_policy\nimport augmentations\nimport experiments\nimport experiments_util\nimport featurized_classifiers\nimport sklearn.cluster\nimport sklearn.preprocessing\nimport sample_dpp\...
[ [ "numpy.savez", "numpy.abs", "numpy.unique", "numpy.concatenate", "numpy.copy", "numpy.exp", "matplotlib.pyplot.show", "numpy.where", "numpy.sum", "numpy.isin" ] ]
parksang21/ARPL
[ "d2e4af489d789a277bea3f0b4f31a5072239e623" ]
[ "models/resnet.py" ]
[ "'''ResNet in PyTorch.\nBasicBlock and Bottleneck module is from the original ResNet paper:\n[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun\n Deep Residual Learning for Image Recognition. arXiv:1512.03385\nPreActBlock and PreActBottleneck module is from the later paper:\n[2] Kaiming He, Xiangyu Zhang, Sha...
[ [ "torch.nn.Sequential", "torch.randn", "torch.nn.functional.avg_pool2d", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.functional.relu", "torch.nn.AdaptiveAvgPool2d", "torch.nn.BatchNorm2d" ] ]
sergiolevin/statsmodels
[ "13a901edfc0d4ab05e09438749df2487af04d77e" ]
[ "statsmodels/genmod/generalized_linear_model.py" ]
[ "\"\"\"\nGeneralized linear models currently supports estimation using the one-parameter\nexponential families\n\nReferences\n----------\nGill, Jeff. 2000. Generalized Linear Models: A Unified Approach.\n SAGE QASS Series.\n\nGreen, PJ. 1984. \"Iteratively reweighted least squares for maximum\n likelihood es...
[ [ "numpy.dot", "numpy.sqrt", "numpy.linalg.matrix_rank", "numpy.asarray", "scipy.stats.distributions.poisson", "numpy.exp", "scipy.stats.distributions.binom", "scipy.stats.distributions.gamma", "numpy.allclose", "numpy.empty_like", "numpy.column_stack", "numpy.zeros",...
SepandKashani/audio_tools
[ "e606e4e05ef571968ccd862a1f65698c3eb9f78c" ]
[ "audio_tools/network.py" ]
[ "import itertools\nimport pickle\nimport queue\nimport socket\nimport threading\nimport time\n\nimport numpy as np\n\nimport audio_tools.interface as ati\nimport audio_tools.util.interop as atui\n\n\nclass PacketServer(ati.PacketStream):\n \"\"\"\n Route packets from a PacketStream to several PacketClients th...
[ [ "numpy.frombuffer" ] ]
spsancti/albumentations
[ "dd0c5dbf1b28d7e78f1fbd93139089e04144cfd3" ]
[ "albumentations/augmentations/bbox_utils.py" ]
[ "from __future__ import division\nfrom albumentations.core.utils import DataProcessor\n\nimport numpy as np\n\n__all__ = [\n \"normalize_bbox\",\n \"denormalize_bbox\",\n \"normalize_bboxes\",\n \"denormalize_bboxes\",\n \"calculate_bbox_area\",\n \"filter_bboxes_by_visibility\",\n \"convert_bb...
[ [ "numpy.min", "numpy.clip", "numpy.max", "numpy.any", "numpy.array", "numpy.isclose" ] ]
rafaelols/airflow
[ "8e4af5fb576a9568af476c0607819649b724adea" ]
[ "dags/treinos_igti/treino05.py" ]
[ "from airflow import DAG\nfrom airflow.operators.bash_operator import BashOperator\nfrom airflow.operators.python_operator import PythonOperator, BranchPythonOperator\nfrom datetime import datetime, timedelta\nimport pandas as pd\nimport random\nimport zipfile\nimport os\nimport psycopg2\nfrom sqlalchemy import cre...
[ [ "pandas.concat", "pandas.read_csv" ] ]
Jacarlianda/FinMind
[ "181e478727c7cda498da2b42495e2a6fea9688e3" ]
[ "BackTesting/demo.py" ]
[ "import pandas as pd\nimport requests\n\n\n# class name,必須跟檔案名一致,例如 class demo,檔名也是 demo.py\nclass demo:\n def __init__(self,\n stock_price,\n **kwargs, ):\n # -------------------------------------------------------------------\n # 此區塊請勿更動\n stock_price = stoc...
[ [ "pandas.DataFrame" ] ]
titu1994/tf-eager-examples
[ "c95a02a96fab794331afa49a1d0ce684fb3340b8" ]
[ "scripts/04_02_cnn_block.py" ]
[ "import os\nimport numpy as np\n\nimport tensorflow as tf\nfrom tensorflow.python.keras.datasets import mnist\nfrom tensorflow.contrib.eager.python import tfe\n\n# enable eager mode\ntf.enable_eager_execution()\ntf.set_random_seed(0)\nnp.random.seed(0)\n\nif not os.path.exists('weights/'):\n os.makedirs('weights...
[ [ "tensorflow.nn.relu", "tensorflow.device", "tensorflow.enable_eager_execution", "tensorflow.keras.layers.GlobalAveragePooling2D", "tensorflow.nn.softmax", "numpy.random.seed", "tensorflow.zeros", "tensorflow.contrib.eager.python.tfe.Saver", "tensorflow.keras.layers.Dense", ...
bme-chatbots/dialogue-generation
[ "4106f41d6841bcbca8555a20c0977b93d7848249" ]
[ "src/train.py" ]
[ "\"\"\"\n@author: Patrik Purgai\n@copyright: Copyright 2019, dialogue-generation\n@license: MIT\n@email: purgai.patrik@gmail.com\n@date: 2019.07.12.\n\"\"\"\n\n# pylint: disable=import-error\n# pylint: disable=no-name-in-module\n# pylint: disable=no-member\n# pylint: disable=not-callable\n# pylint: di...
[ [ "torch.distributed.init_process_group", "torch.nn.functional.log_softmax", "torch.nn.functional.nll_loss", "numpy.random.seed", "torch.manual_seed", "torch.load", "torch.cuda.set_device", "torch.isnan", "torch.distributed.barrier", "torch.exp", "torch.no_grad", "tor...
UP-RS-ESP/GEW-DAP05-2018
[ "04ca0327b4a4ea5b6869e3e985672639651771e8" ]
[ "Session_06/fibonacci-python/bench.py" ]
[ "import numpy as np\n\ndef fibf(n):\n a = 0.0\n b = 1.0\n for i in range(n):\n a, b = a+b, a\n\n return a\n\ndef fibr(n):\n if n == 0 or n == 1:\n a = n\n else:\n a = fibr(n-1)+fibr(n-2)\n\n return a\n\ndef main():\n import sys\n from timeit import timeit\n from ma...
[ [ "matplotlib.pyplot.semilogy", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "numpy.zeros", "matplotlib.pyplot.figure" ] ]
yo16/df_overview
[ "6274eb4e4c07e850a67c75834f7f87e86cce926e" ]
[ "src/df_overview.py" ]
[ "# df_overviewモジュール\n# 2018/5/11 yo16\n\nimport numpy as np\nimport pandas as pd\nimport copy\n\n# df_overviewクラス\nclass df_overview(object):\n\t# 分析対象のDataFrame\n\t_df = None\n\t\n\t_debugMode = 1\t\t# [ 0:release | 1:debug ]\n\t\n\t\n\t# -------------------------------------------\n\t# コンストラクタ\n\t# --------------...
[ [ "pandas.DataFrame" ] ]
hopsparser/npdependency
[ "57571dd797281ad6d0a413aa46d797e423a1f7e8" ]
[ "tests/test_parser.py" ]
[ "import pathlib\nimport tempfile\nfrom typing import List, Tuple\n\nimport torch.cuda\n\nimport hypothesis.strategies as st\nimport pytest\nfrom hypothesis import assume, given, settings\nfrom torch.testing import assert_close\n\nfrom hopsparser.parser import BiAffineParser\nfrom hopsparser.deptree import DepGraph\...
[ [ "torch.testing.assert_close" ] ]
pdturney/management-theory
[ "1701a334d00bb6c1a3d6c3995e4fad1383e4c398" ]
[ "table_manager_worker_productivity.py" ]
[ "#\r\n# Table Manager Worker Productivity\r\n#\r\n# Peter Turney, February 28, 2021\r\n#\r\n# Run all 844 fusion seeds and store the results internally in\r\n# a numpy tensor:\r\n#\r\n# tensor = 844 fusions x 1001 time steps x 5 colours\r\n#\r\n# - 844 fusion events from 18 fusion_storage.bin files\r\n# - 1001 time...
[ [ "numpy.zeros" ] ]
ttobisawa/python-bigquery
[ "f55864ec3d6381f2b31598428a64822fdc73cb56" ]
[ "tests/unit/test_table.py" ]
[ "# Copyright 2015 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed t...
[ [ "pandas.core.dtypes.dtypes.CategoricalDtype", "pandas.core.dtypes.dtypes.np.dtype", "numpy.dtype", "pandas.DataFrame" ] ]
aidanscannell/mogpe
[ "25a9af473d73d6fa35bd060bee0eb2c372b995e5" ]
[ "examples/quadcopter-sim/scenario-1/train_from_checkpoint.py" ]
[ "#!/usr/bin/env python3\nimport numpy as np\nimport tensorflow as tf\nimport gpflow as gpf\nfrom mogpe.training import train_from_config_and_checkpoint\n\n\ndef load_quadcopter_dataset(filename, standardise=False):\n data = np.load(filename)\n # X = data['x']\n X = data[\"x\"][:, 0:2]\n Y = data[\"y\"]\...
[ [ "numpy.load", "tensorflow.nn.moments", "tensorflow.sqrt" ] ]
moritz-raabe/P.808
[ "6f6bcf089d5d14d0248dbedd9b9278389ceee08c" ]
[ "src/master_script.py" ]
[ "\"\"\"\r\n/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Microsoft Corporation. All rights reserved.\r\n* Licensed under the MIT License. See License.txt in the project root for license information.\r\n*------------------------------------------...
[ [ "pandas.concat", "pandas.read_csv", "pandas.DataFrame" ] ]
marbiru/gan
[ "c5aa09b0a104f530aea09073cf795d2b3b582218" ]
[ "tensorflow_gan/examples/mnist_estimator/train_experiment_lib.py" ]
[ "# coding=utf-8\n# Copyright 2019 The TensorFlow GAN Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi...
[ [ "tensorflow.compat.v1.metrics.mean", "tensorflow.data.Dataset.from_tensors", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.io.gfile.exists", "tensorflow.io.gfile.GFile", "numpy.squeeze", "tensorflow.random.normal", "tensorflow.io.gfile.makedirs", "tensorflow.data.Data...
chenlheng/pymarl
[ "b6455f939199eec909356608195201d5c80c06b0" ]
[ "src/modules/critics/coma.py" ]
[ "import torch as th\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\n\nclass COMACritic(nn.Module):\n def __init__(self, scheme, args):\n super(COMACritic, self).__init__()\n\n self.args = args\n self.n_actions = args.n_actions\n self.n_agents = args.n_ag...
[ [ "torch.nn.Linear", "numpy.array", "torch.eye", "torch.zeros_like" ] ]
amyburden/keras-CenterNet
[ "5e78070595f73f80d80295800c8d16aa6507feba" ]
[ "utils/compute_overlap.py" ]
[ "import numpy as np\n\ndef compute_overlap(\n boxes,\n query_boxes\n):\n \"\"\"\n Args\n a: (N, 4) ndarray of float\n b: (K, 4) ndarray of float\n\n Returns\n overlaps: (N, K) ndarray of overlap between boxes and query_boxes\n \"\"\"\n N = boxes.shape[0]\n K = query_boxe...
[ [ "numpy.zeros", "numpy.float64" ] ]
data-science-workshops/deep-learning
[ "6f7c4c6aa2cc3cbf781a89e85137ebfc65faa80a" ]
[ "notebooks/utils/callback.py" ]
[ "import numpy as np\nfrom time import time\nfrom keras.callbacks import Callback\n\nclass TimingCallback(Callback):\n def __init__(self):\n super(TimingCallback, self).__init__()\n self.epoch_logs=[]\n self.batch_logs=[]\n self.train_logs=[]\n\n def on_epoch_begin(self, epoch, logs...
[ [ "numpy.array" ] ]
FelixFaber/ASAP
[ "951d9667143095e42f1566816b4ab90d901b56a8", "951d9667143095e42f1566816b4ab90d901b56a8" ]
[ "asaplib/compressor/split.py", "scripts/ridge_regression.py" ]
[ "\"\"\"\nTODO: Module-level description\n\"\"\"\n\nimport collections\nfrom abc import ABCMeta\n\nimport numpy as np\nfrom sklearn.externals.six import with_metaclass\nfrom sklearn.model_selection._split import KFold as _KFold\nfrom sklearn.model_selection._split import ShuffleSplit as _ShuffleSplit\nfrom sklearn.u...
[ [ "sklearn.utils.check_random_state", "sklearn.externals.six.with_metaclass", "numpy.log", "numpy.arange", "numpy.random.rand", "numpy.exp", "numpy.zeros", "numpy.sum" ], [ "sklearn.model_selection.train_test_split", "numpy.genfromtxt", "numpy.asmatrix", "numpy.sh...
BourneXu/AntiGPS
[ "69469b5667e39ae4b239cb85359a8c8f94084e95" ]
[ "script/utility.py" ]
[ "# -*- coding:utf-8 -*-\nimport io\nimport os\nimport random\n\nimport numpy as np\nimport pandas as pd\nimport geocoder\nimport hypertools as hyp\nimport plotly.express as px\nimport matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nfrom geopy import distance\nfrom loguru import lo...
[ [ "numpy.reshape", "matplotlib.pyplot.subplots", "pandas.DataFrame", "matplotlib.pyplot.plot", "matplotlib.pyplot.show" ] ]
WarrenWeckesser/voronoiz
[ "aad2b62bda3015bfb998142b8694c555a518d748" ]
[ "examples/make_animation.py" ]
[ "\nimport numpy as np\nfrom voronoiz import voronoi_grid\nfrom numpngw import write_apng\n\n\nxmin = 0\nxmax = 5\nymin = 0\nymax = 5\n\npoints = np.array([[0.00, 0.00],\n [1.00, 4.51],\n [1.20, 0.30],\n [2.50, 2.60],\n [2.40, 0.80],\n ...
[ [ "numpy.pad", "numpy.linspace", "numpy.cos", "numpy.sin", "numpy.array" ] ]
bysen32/WS-DAN.PyTorch
[ "de206591f037ea82fc52eaf6915de7f64375e0c9" ]
[ "models/wsdan.py" ]
[ "\"\"\"\nWS-DAN models\n\nHu et al.,\n\"See Better Before Looking Closer: Weakly Supervised Data Augmentation Network for Fine-Grained Visual Classification\",\narXiv:1901.09891\n\nCreated: May 04,2019 - Yuchong Gu\nRevised: Dec 03,2019 - Yuchong Gu\n\"\"\"\nimport logging\nimport numpy as np\nimport torch\nimport ...
[ [ "torch.nn.functional.normalize", "torch.nn.Softmax", "torch.nn.AdaptiveMaxPool2d", "torch.abs", "torch.cat", "torch.sign", "torch.einsum", "torch.nn.Linear", "torch.nn.functional.upsample_bilinear" ] ]
FilipeMaia/afnumpy
[ "11958f501f7ddeb88915a44d0fd4914e1779e7dd" ]
[ "afnumpy/core/numeric.py" ]
[ "import arrayfire\nimport numpy\nimport afnumpy\nfrom .. import private_utils as pu\nfrom numpy import newaxis\nimport numbers\nfrom numpy import broadcast\nfrom ..decorators import *\n\ndef concatenate(arrays, axis=0):\n if(len(arrays) < 1):\n raise ValueError('need at least one array to concatenate')\n ...
[ [ "numpy.abs", "numpy.isnan", "numpy.ones", "numpy.broadcast", "numpy.isinf" ] ]
jacksonsdean/evolutionary-robotics-
[ "af333afb03dcb3759da233aecd93975dde17df7d" ]
[ "util.py" ]
[ "import math\nimport os\nimport time\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport networkx as nx\n# import pygraphviz as pgv \n# from node_functions import *\n# from networkx.drawing.nx_agraph import graphviz_layout\nimport sys\nimport inspect\nimport random\nimport pyrosim.pyrosim as pyrosim\nfrom ...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "numpy.arange", "numpy.isclose", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.gcf", "numpy.mean", "matplotlib.pyplot.subplots_adjust", "numpy.array"...
AlessandroRigoli/project_vg
[ "cb1323bee60cdb4108fe0aab68791321c7974832" ]
[ "train.py" ]
[ "\nimport math\nimport torch\nimport logging\nimport numpy as np\nfrom tqdm import tqdm\nimport torch.nn as nn\nimport multiprocessing\nfrom os.path import join\nfrom datetime import datetime\nfrom torch.utils.data.dataloader import DataLoader\nfrom os.path import exists\nimport h5py\ntorch.backends.cudnn.benchmark...
[ [ "numpy.append", "torch.utils.data.dataloader.DataLoader", "torch.nn.TripletMarginLoss", "torch.cuda.device_count", "numpy.zeros" ] ]
widdowquinn/Notebooks-Bioinformatics
[ "f1d6f89eb629bc30a3e712139a1187e58df47119" ]
[ "helpers/baserate.py" ]
[ "# baserate.py\n#\n# Helper code for the baserate_fallacy.ipynb notebook in the\n# Notebooks-Bioinformatics repo\n\nimport matplotlib.pylab as pylab\n\n\ndef p_correct_given_pos(sens, fpr, b):\n \"\"\"Returns a simple Bayesian probability for the probability\n that a prediction is correct, given that the pred...
[ [ "matplotlib.pylab.xlim", "matplotlib.pylab.text", "matplotlib.pylab.title", "matplotlib.pylab.xlabel", "matplotlib.pylab.ylabel", "matplotlib.pylab.plot", "matplotlib.pylab.ylim", "matplotlib.pylab.arange" ] ]
shaneding/cudf
[ "bf68778b78be93ad27ad897589b320fa73de096b" ]
[ "python/cudf/cudf/tests/test_binops.py" ]
[ "# Copyright (c) 2018-2021, NVIDIA CORPORATION.\n\nfrom __future__ import division\n\nimport decimal\nimport operator\nimport random\nfrom itertools import product\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nimport cudf\nfrom cudf.core import Series\nfrom cudf.core.index import as_index\nfrom cudf....
[ [ "numpy.true_divide", "numpy.datetime_data", "numpy.random.random", "pandas.Series", "numpy.random.seed", "pandas.DateOffset", "numpy.random.choice", "numpy.isnan", "numpy.float16", "pandas.Index", "pandas.DataFrame", "numpy.dtype", "numpy.testing.assert_array_eq...
CooKey-Monster/spiral
[ "88c81334d684d713fab626b524af0a47075f80c5" ]
[ "nineturn/dtdg/types.py" ]
[ "# Copyright 2022 The Nine Turn 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 requi...
[ [ "numpy.hstack", "numpy.array", "numpy.zeros" ] ]
devitocodes/joey
[ "bde8eb554d548764a50dd5384d1da9b0f0c9d0a2" ]
[ "joey/layers.py" ]
[ "from abc import abstractmethod\nfrom joey import Layer\nfrom joey import activation\nfrom joey import default_name_allocator as alloc\nfrom joey import default_dim_allocator as dim_alloc\nfrom devito import Grid, Function, Constant, Eq, Inc, \\\n ConditionalDimension\nfrom sympy import exp, Max, And, Min, sign\...
[ [ "numpy.concatenate" ] ]
henktillman/ray
[ "fe6d7052460203bb7d58d5c6cbc199bd92424809" ]
[ "python/ray/tests/test_advanced_3.py" ]
[ "# coding: utf-8\nimport glob\nimport logging\nimport os\nimport json\nimport sys\nimport socket\nimport time\n\nimport numpy as np\nimport pickle\nimport pytest\n\nimport ray\nimport ray.ray_constants as ray_constants\nimport ray.cluster_utils\nimport ray.test_utils\nfrom ray import resource_spec\nimport setprocti...
[ [ "numpy.zeros", "numpy.ones" ] ]
atharva-diwan/PolyLaneNet
[ "c89500428ddd72e7c3027955d88fd074603f48e0" ]
[ "lib/datasets/lane_dataset.py" ]
[ "import cv2\nimport numpy as np\nimport imgaug.augmenters as iaa\nfrom imgaug.augmenters import Resize\nfrom torchvision.transforms import ToTensor\nfrom torch.utils.data.dataset import Dataset\nfrom imgaug.augmentables.lines import LineString, LineStringsOnImage\n\nfrom .elas import ELAS\nfrom .llamas import LLAMA...
[ [ "numpy.linspace", "numpy.random.seed", "torch.manual_seed", "numpy.ones", "numpy.array", "numpy.polyval" ] ]
noamkatzir/palm-hand-reading
[ "1a405759c03218fc74d661805bced8e4f4a92e74" ]
[ "tests/test5.py" ]
[ "__author__ = 'noam'\n\nimport os\nimport cv2\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\ndef sortObjects(contours):\n areas = []\n for i in xrange(len(contours)):\n M = cv2.moments(contours[i])\n centroid_x = int(M['m10']/M['m00'])\n centroid_y = int(M['m01']/M['m00'])\n...
[ [ "matplotlib.pyplot.imshow", "numpy.array", "numpy.zeros", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
wuhuzi/tensor2robot
[ "4b8d40244e2618dd5f46bfed6698d5ed812847cc" ]
[ "bin/run_t2r_trainer.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Tensor2Robot Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless require...
[ [ "tensorflow.compat.v1.logging.set_verbosity" ] ]
simonvh/gimmemotifs
[ "e40ab914a93210864c358b39ae677ac0792a80f2" ]
[ "test/test_rank.py" ]
[ "import unittest\nimport tempfile\nimport os\nimport pandas as pd\nfrom gimmemotifs.rank import rankagg, _rankagg_stuart\n\n\nclass TestRank(unittest.TestCase):\n \"\"\"A test class to test rank aggregation\"\"\"\n\n def setUp(self):\n self.data_dir = \"test/data/rank\"\n self.fname = os.path.jo...
[ [ "pandas.read_csv" ] ]
justaddcoffee/dipper
[ "085c1601ae5b88848ddcdad0d52387e8f450b1be" ]
[ "dipper/sources/SGD.py" ]
[ "import logging\nimport pandas as pd\n\nfrom dipper.sources.Source import Source\nfrom dipper.models.assoc.Association import Assoc\nfrom dipper.models.Model import Model\nfrom dipper.models.Reference import Reference\nfrom ontobio.ontol_factory import OntologyFactory\n\n\n__author__ = 'timputman'\n\nLOG = logging....
[ [ "pandas.read_csv" ] ]
terryli710/COVID_19_Rapid_Triage_Risk_Predictor
[ "ccf737806d914f390d21b441d18688630b4fa6f9" ]
[ "radiomics_patch/imageoperations.py" ]
[ "from __future__ import print_function\n\nimport logging\n\nimport numpy\nimport pywt\nimport SimpleITK as sitk\nimport six\nfrom six.moves import range\n\nlogger = logging.getLogger(__name__)\n\n\ndef getMask(mask, **kwargs):\n \"\"\"\n Function to get the correct mask. Includes enforcing a correct pixel data ty...
[ [ "numpy.true_divide", "numpy.sqrt", "numpy.asarray", "numpy.ndarray", "scipy.ndimage.interpolation.map_coordinates", "numpy.arctan2", "numpy.max", "numpy.mean", "numpy.digitize", "numpy.exp", "numpy.where", "numpy.histogram", "numpy.allclose", "numpy.pad", ...
caseypw/m2g
[ "be29587322ab1fafb96f6afb726efbdb39b64b66" ]
[ "m2g/graph.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\nm2g.graph\n~~~~~~~~~~\n\nContains the primary functionality for connectome estimation after tractography has completed.\nUsed in the final stage of the pipeline.\n\"\"\"\n\n\n# standard library imports\nimport os\nimport time\nimport csv\nfrom itertools import combinations\nfrom co...
[ [ "numpy.sum", "numpy.unique", "numpy.isnan", "matplotlib.use", "numpy.eye", "numpy.arange", "matplotlib.pyplot.savefig", "numpy.round", "numpy.shape", "matplotlib.pyplot.close", "numpy.isinf" ] ]
prosyslab-warehouse/tensorflow-2.6.2
[ "153df12f5343096713587e21d4143b9acfbb3513" ]
[ "tensorflow/python/ops/nn_fused_batchnorm_test.py" ]
[ "# Copyright 2016 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.ops.gradient_checker.compute_gradient", "tensorflow.python.ops.math_ops.rsqrt", "numpy.random.random_sample", "tensorflow.python.ops.gradients_impl.gradients", "tensorflow.python.ops.array_ops.transpose", "tensorflow.python.framework.test_util.disable_xla", "tensorfl...
GloriaGo/sparkRAW
[ "c00ff36070d8a03e3df2452747e59b42b9e2df1e" ]
[ "python/pyspark/sql/dataframe.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "pandas.DataFrame.from_records" ] ]
audio-is-fun/chord-detection-algorithm
[ "8cf41ccd72a035131bc744b440b4dd12671c1fac" ]
[ "detect_chords_microphone_old.py" ]
[ "'''\nAutomatic chords detection algorithm (real time).\n\nImplementation of the algorithm described in Described in the Bachelor Thesis: \nDesign and Evaluation of a Simple Chord Detection Algorithm by Christoph Hausner.\n\nImplemented by Haldo Sponton (haldosponton@gmail.com).\n\nNote: this functionality requires...
[ [ "numpy.concatenate", "numpy.array" ] ]
THGLab/sidechainnet
[ "e6f4f6a30ad4e202db3afb28e4d958937cb57135" ]
[ "sidechainnet/utils/organize.py" ]
[ "\"\"\"Contains methods for organizing SidechainNet data into a Python dictionary.\"\"\"\n\nimport copy\nimport datetime\nimport os\nimport pickle\nimport re\n\nimport numpy as np\n\nfrom sidechainnet.utils.download import determine_pnid_type\n\nEMPTY_SPLIT_DICT = {\n \"seq\": [],\n \"ang\": [],\n \"ids\":...
[ [ "numpy.concatenate", "numpy.random.seed", "numpy.random.choice" ] ]
anandj91/tensorboard
[ "92d8971eecdd4a185b899cae5e34bdeeafe94c76" ]
[ "tensorboard/plugins/projector/projector_plugin.py" ]
[ "# Copyright 2016 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" ] ]
fox-ds/river
[ "9ce947ebfc012ec7059de0a09c765b2da7fc1d25" ]
[ "river/misc/test_cov_matrix.py" ]
[ "import math\n\nimport numpy as np\nimport pandas as pd\n\nfrom river import misc\n\n\ndef test_cov_matrix():\n\n # NOTE: this test only works with ddof=1 because pandas ignores it if there are missing values\n ddof = 1\n\n cov = misc.CovMatrix(ddof=ddof)\n p = 5\n X_all = pd.DataFrame(columns=range(...
[ [ "pandas.concat", "numpy.random.random", "numpy.random.randint" ] ]
altescy/logexp
[ "19389c884c686ca42f691500e82e8963bd039f0c" ]
[ "examples/scikit-learn/iris.py" ]
[ "import typing as tp\nimport copy\nimport importlib\n\nimport colt\nimport logexp\nfrom sklearn.base import BaseEstimator\nfrom sklearn.datasets import load_iris\nfrom sklearn.model_selection import train_test_split\n\nfrom logger import create_logger\n\nlogger = create_logger(__name__)\nex = logexp.Experiment(\"sk...
[ [ "sklearn.datasets.load_iris", "sklearn.model_selection.train_test_split" ] ]
dtak/adversarial_robustness
[ "eb1e3af5301789cc6e7562750145ab91f80dcca7" ]
[ "adversarial_robustness/datasets/notmnist.py" ]
[ "from __future__ import print_function\nimport glob\nimport os\nimport numpy as np\nfrom six.moves import cPickle as pickle\nfrom six.moves.urllib.request import urlretrieve\nimport tarfile\nimport sys\nfrom adversarial_robustness.dataset import *\n\nclass notMNIST(Dataset):\n def __init__(self, data_dir=default_d...
[ [ "scipy.ndimage.imread", "numpy.ndarray", "numpy.random.shuffle", "numpy.std", "numpy.random.permutation", "numpy.mean" ] ]
isaac-gw/astropy
[ "efea853d7e127379370ed83fc89c66fa3b662324" ]
[ "astropy/modeling/tests/test_units_mapping.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport pytest\nimport numpy as np\n\nfrom astropy import units as u\nfrom astropy.units import Quantity, UnitsError, equivalencies\nfrom astropy.modeling.models import UnitsMapping\n\n\ndef test_properties():\n model = UnitsMapping(((u.dimensionle...
[ [ "numpy.all", "numpy.arange" ] ]
binh234/facial-liveness-detection
[ "841aca9e4a1adc63fd72dbd578e5f74c8b93f29a" ]
[ "prepare_dataset.py" ]
[ "import os\nimport pandas as pd\nimport itertools\nimport random\nimport requests\nfrom sklearn.model_selection import train_test_split\nfrom io import BytesIO\nfrom zipfile import ZipFile\n\ndef download_file_from_google_drive(id, destination):\n URL = \"https://docs.google.com/uc?export=download\"\n\n sessi...
[ [ "pandas.concat", "sklearn.model_selection.train_test_split", "pandas.DataFrame" ] ]
ankitshah009/MMdnn
[ "a03d800eb4016765e97f82eb5d2e69f98de3a9cf" ]
[ "mmdnn/conversion/tensorflow/saver.py" ]
[ "import tensorflow as tf\n\n\ndef save_model(MainModel, network_filepath, weight_filepath, dump_filepath, dump_tag = 'SERVING'):\n if dump_tag == 'SERVING':\n tag_list = [tf.saved_model.tag_constants.SERVING]\n else:\n tag_list = [tf.saved_model.tag_constants.TRAINING]\n res = MainModel.KitMo...
[ [ "tensorflow.saved_model.signature_def_utils.build_signature_def", "tensorflow.saved_model.builder.SavedModelBuilder", "tensorflow.global_variables_initializer", "tensorflow.Session", "tensorflow.saved_model.utils.build_tensor_info" ] ]
kbj2060/pytrader
[ "ad32ed16917ccf7baa6affefac2229be5affa1ef" ]
[ "database.py" ]
[ "# TODO : Not Yet Implemented\nimport glob\nimport sqlite3\n\nimport h5py\nimport pandas as pd\n\n\ndef convert_sql_to_csv():\n con = sqlite3.connect(\"../data/stock.db\")\n code_list = con.execute(\"SELECT name from sqlite_master WHERE type='table'\").fetchall()\n code = code_list[0][0]\n for code in c...
[ [ "pandas.read_sql" ] ]
WenqinSHAO/rtt_changedetect_rnn_lstm
[ "9a8b0f3a500c0f2fa825c17ca053ebbf85f94e61" ]
[ "model.py" ]
[ "import numpy as np\nimport time\nfrom keras.layers import Input, Concatenate, Dot, Flatten\nfrom keras.layers.core import Dense, Activation, Dropout\nfrom keras.layers.recurrent import LSTM\nfrom keras.layers.wrappers import Bidirectional, TimeDistributed\nfrom keras.models import Model, model_from_json\nfrom kera...
[ [ "matplotlib.pyplot.close", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure" ] ]
robertfasano/argent
[ "49a779e54063ad4f6432b78d1f8070d2f0a932a7" ]
[ "argent/generator/channel_parsing.py" ]
[ "import numpy as np\n\ndef get_ttl_channels(playlist):\n ''' Crawls through the playlist to assemble a list of all TTL channels\n whose state is specified at some point. Returns a list of the format\n ['ttlA0', 'ttlA1', ...]\n '''\n ttls = []\n for stage in playlist:\n sequence = st...
[ [ "numpy.unique" ] ]
chihina/Scratch_autoencoder
[ "d55ae810c9fb4589b8d3ba3ed6bf3462d97e7a14" ]
[ "AutoEncoder_pytorch_gpu_ver2.py" ]
[ "\r\n# coding: utf-8\r\n\r\n# In[ ]:\r\n\r\nimport time\r\nfrom torchvision import transforms\r\nfrom torchvision.datasets import MNIST\r\nfrom torchvision.utils import save_image\r\nimport torch.nn.functional as F\r\nimport sys, os\r\nfrom PIL import Image\r\nimport numpy as np\r\nimport torch\r\nimport torchvisio...
[ [ "numpy.uint8", "torch.utils.data.DataLoader", "torch.nn.Tanh", "torch.nn.Linear", "torch.utils.data.random_split", "torch.cuda.is_available", "torch.nn.ReLU", "torch.nn.MSELoss", "torch.autograd.Variable" ] ]
mattwilkin/StrainRecon
[ "5c8e0cf6792e1d58db764f6734b5028adc133b8b" ]
[ "optimizers_mjw.py" ]
[ "# import pycuda.driver as cuda\nimport numpy as np\nfrom cuda import cuda, nvrtc\nimport time\nimport gpuarray\nfrom config import Config\nfrom run_cuda import run_cuda_function\n\n\ndef CrossEntropyMethod(recon, x, y,\n XD, YD, OffsetD, MaskD, TrueMaskD, scoreD, S_gpu,\n ...
[ [ "numpy.absolute", "numpy.min", "numpy.eye", "numpy.tile", "numpy.max", "numpy.mean", "numpy.argpartition", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
cle1109/scot
[ "48598b79d4400dad893b134cd2194715511facda" ]
[ "scot/parallel.py" ]
[ "# Released under The MIT License (MIT)\n# http://opensource.org/licenses/MIT\n# Copyright (c) 2014 SCoT Development Team\n\nfrom __future__ import print_function\n\n\ndef parallel_loop(func, n_jobs=1, verbose=1):\n \"\"\"run loops in parallel, if joblib is available.\n\n Parameters\n ----------\n func ...
[ [ "sklearn.externals.joblib.delayed", "sklearn.externals.joblib.Parallel" ] ]
daniel-furman/pyimpute
[ "58706f44b0d29a9cfe98b97378e8cdb5490de5cd" ]
[ "src/pyimpute/_main.py" ]
[ "from __future__ import print_function\nimport rasterio\nimport numpy as np\nimport os\nimport math\nimport logging\nfrom sklearn import metrics\nfrom sklearn import cross_validation\nlogger = logging.getLogger('pyimpute')\n\n\ndef load_training_vector(response_shapes, explanatory_rasters, response_field, metric='m...
[ [ "sklearn.cross_validation.cross_val_score", "sklearn.cross_validation.train_test_split", "numpy.nonzero", "numpy.unique", "numpy.asarray", "numpy.arange", "sklearn.metrics.confusion_matrix", "numpy.random.shuffle", "numpy.bincount", "numpy.array", "sklearn.metrics.class...
tohtsky/pymc3
[ "68d5201292b45feecbfaf88a10aa8e392d5ab9f2" ]
[ "pymc3/tests/test_model.py" ]
[ "# Copyright 2020 The PyMC Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "numpy.ones", "numpy.testing.assert_almost_equal", "numpy.random.randn", "numpy.ma.masked_values", "numpy.testing.assert_allclose", "numpy.random.binomial", "numpy.array", "numpy.zeros" ] ]
sailordiary/m3f.pytorch
[ "f06a8eaff1f00563cb40e2dc5183de4324b08bff" ]
[ "models/vox2_dataset.py" ]
[ "import os\n\nimport math\nimport random\n\nimport numpy as np\nimport cv2\nfrom .cv_augment import adjust_brightness, adjust_contrast\n\nimport torch\nfrom torch.utils.data import Dataset\n\n\ndef load_video(path, start, length,\n is_training=False,\n mirror_augment=False,\n ...
[ [ "torch.from_numpy", "numpy.stack" ] ]
This-50m/vega
[ "52b53582fe7df95d7aacc8425013fd18645d079f" ]
[ "vega/modules/cells/dag_cell.py" ]
[ "# -*- coding:utf-8 -*-\n\n# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the MIT License.\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; withou...
[ [ "numpy.shape" ] ]
yinchimaoliang/K-Net
[ "5e50ee58957dce972f51096804ff69171c2f072e" ]
[ "knet/det/mask_hungarian_assigner.py" ]
[ "import numpy as np\nimport torch\n\nfrom mmdet.core import AssignResult, BaseAssigner\nfrom mmdet.core.bbox.builder import BBOX_ASSIGNERS\nfrom mmdet.core.bbox.match_costs.builder import MATCH_COST, build_match_cost\n\ntry:\n from scipy.optimize import linear_sum_assignment\nexcept ImportError:\n linear_sum_...
[ [ "torch.einsum", "torch.sum", "torch.from_numpy", "numpy.concatenate", "scipy.optimize.linear_sum_assignment" ] ]
iancze/hierarchical-mutual-inclinations
[ "a9d40df941d6cc0ce32e0cd9efc1596f011be223" ]
[ "make_real_data.py" ]
[ "import numpy as np\nfrom astropy.table import Table\nfrom astropy.io import ascii\n\ndeg = np.pi/180.0\n\n# table of stars with inclinations and uncertainties\n# name, #i_disk, i_disk_err, i_star, i_star_err (deg)\nrows = [(\"V4046 Sgr\", 33.5, 1.4, 33.42, 0.58),\n(\"AK Sco\", 109.4, 0.5, 108.76, 2.4),\n(\"DQ Tau\...
[ [ "numpy.cos", "numpy.sin" ] ]
ewinston/qiskit-sdk-py
[ "4d64125aba4ff31f15d0054b90437bcef352782e" ]
[ "qiskit/transpiler/passes/scheduling/calibration_creators.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or ...
[ [ "numpy.sqrt" ] ]
University-of-Reading-Space-Science/ExtremeEvents
[ "1a14aaf48984f72d24ce2d99fba97c04a31d7621" ]
[ "code/helio_time.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Oct 15 18:30:50 2020\n\n@author: mathewjowens\n\nA collect of time conversion routes. Mostly ported from Matlab\n\n\"\"\"\n\nimport numpy as np\nimport datetime as datetime\nimport pandas as pd\n\n\n\ndef date2jd(*args):\n \n \"\"\"\n date2mjd(year,month,day...
[ [ "numpy.all", "numpy.vectorize", "numpy.zeros", "numpy.floor" ] ]
hejj16/Machine-Learning-Algorithms
[ "d832c0a59f60eeab30502f8b28fc0f3de08bb479" ]
[ "PPCA.py" ]
[ "import numpy as np\r\n\r\n\r\nclass PPCA:\r\n\r\n def __init__(self):\r\n self.dim = 0\r\n self.latent_dim = 0\r\n self.W = None\r\n self.mu = None\r\n self.sigma2 = None\r\n self.alpha = None\r\n\r\n def fit(self, data, alpha_threshold=1e3, alpha_max_iter=10, alpha_...
[ [ "numpy.diag", "numpy.random.seed", "numpy.linalg.inv", "numpy.eye", "numpy.trace", "numpy.linalg.norm", "numpy.random.randn", "numpy.random.rand", "numpy.mean", "numpy.sum" ] ]
shanliang1992/Paddle-Lite
[ "a499e9988482b97da0736629be602828e8cf46b7" ]
[ "lite/tests/unittest_py/op/test_elementwise_sub_op.py" ]
[ "# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.random.randint" ] ]
SahayDivyanshu/Model-Predictive-Control
[ "9243c4fc182416841ba14ffb427f2d812a798b1f" ]
[ "Obstacle_Avoidance.py" ]
[ "import numpy as np\nfrom sim.sim2d import sim_run\n\n# Simulator options.\noptions = {}\noptions['FIG_SIZE'] = [8,8]\noptions['OBSTACLES'] = True\n\nclass ModelPredictiveControl:\n def __init__(self):\n self.horizon = 15\n self.dt = 0.2\n\n # Reference or set point the controller will achie...
[ [ "numpy.tan", "numpy.cos", "numpy.sqrt", "numpy.sin" ] ]
src-d/tm-experiments
[ "031595582d66b0dababaf0b0963925aa7032b18b" ]
[ "tmexp/label.py" ]
[ "from argparse import ArgumentParser\nfrom collections import defaultdict\nfrom enum import Enum\nfrom functools import partial\nimport itertools\nimport os\nfrom typing import Dict, List, Optional, Union\n\nimport numpy as np\n\nfrom .cli import CLIBuilder, register_command\nfrom .constants import DIFF_MODEL\nfrom...
[ [ "numpy.log", "numpy.min", "numpy.ones", "numpy.argwhere", "numpy.copy", "numpy.load", "numpy.array", "numpy.sum" ] ]
sinonchen13/Video-Person-ReID
[ "4b09ab300ea93a21cfd03fbf61a27f3d901336b9" ]
[ "test-all-ensemble.py" ]
[ "from __future__ import print_function, absolute_import\nimport os\nimport gc\nimport sys\nimport time\nimport math\nimport argparse\nimport os.path as osp\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.backends.cudnn as cudnn\nfrom torch.utils.data import DataLoader\n\nimport models\nimpo...
[ [ "numpy.asarray", "numpy.max", "numpy.append", "torch.cuda.is_available", "numpy.load" ] ]
toxa81/aiida_scripts
[ "756e04e0576726a3677de95d9186ce7159fedf6b" ]
[ "eos_v2/mod_eos.py" ]
[ "import numpy as np\n\n#=======================\n# Birch-Murnaghan EOS\n#=======================\ndef birch_murnaghan(V,E0,V0,B0,B01):\n r = (V0/V)**(2./3.)\n return (E0 + 9./16. * B0 * V0 * (r-1.)**2 * ( 2.+ (B01-4.)*(r-1.)))\n\n#=======================\n# function to fit the EOS\n#=======================\nd...
[ [ "numpy.array" ] ]
hanklu2020/mabessa_F3DAS
[ "57b1bd1cb85d96567ad1044c216535ab3df88db3" ]
[ "sample_data/Set-PD-Ix-100/3_Analyses/DOE_Ix-PD-100/Input_point1/Imperfection_point1/DoE_point69/script_DoE69_meshing.py" ]
[ "# Abaqus/CAE script\n# Created by M.A. Bessa (M.A.Bessa@tudelft.nl) on 12-Nov-2019 05:18:47\n#\nfrom abaqus import *\nfrom abaqusConstants import *\nsession.viewports['Viewport: 1'].makeCurrent()\n#session.viewports['Viewport: 1'].maximize()\nfrom caeModules import *\nfrom driverUtils import executeOnCaeStartup\ne...
[ [ "numpy.zeros", "numpy.linalg.norm" ] ]
vanstrn/RL_public
[ "0e971e40e063b17918460e19728f95d7924af8db" ]
[ "SampleSelection.py" ]
[ "\nimport itertools\nimport numpy as np\nfrom scipy.spatial import ConvexHull\nfrom random import randint\nimport matplotlib.pyplot as plt\n\ndef SampleSelection_v1(setOfPoints,nSamples,returnIndicies=False,nTrials=200):\n \"\"\"Randomly selecting samples to use for SF analysis. Checks for repetition in the samp...
[ [ "numpy.allclose", "numpy.unique", "numpy.squeeze", "numpy.linalg.norm", "sklearn.cluster.DBSCAN", "numpy.append", "numpy.random.rand", "scipy.spatial.ConvexHull", "numpy.exp", "numpy.where", "sklearn.preprocessing.MinMaxScaler" ] ]
STU-IT/trafik_cv
[ "f3d4285e9e57decc3bda1f6f1964a16759f8b5d0" ]
[ "trafik_Projeckt/ass.py" ]
[ "import numpy as np\nimport cv2\n\ncap = cv2.VideoCapture('biler/rød-bil-fra-venstre.mp4')\n\n# take first frame of the video\nfor i in range(10):\n ret,frame = cap.read()\n\n# setup initial location of window\nr,h,c,w = 300,90,0,125 # simply hardcoded the values\ntrack_window = (c,r,w,h)\n\n# set up the ROI fo...
[ [ "numpy.int0", "numpy.array" ] ]
amjames/optrotvib
[ "a2bce7d4a69ce2cdc57078ab0f1104787bd2e12b" ]
[ "optrotvib/engine/g09_engine.py" ]
[ "import sys\nimport re\nimport os\nfrom pathlib import Path\nimport subprocess as sp\nimport numpy as np\nimport traceback\n\nfrom . import cpu_info\n\n\nfrom victor.constants import physconst\nfrom victor import util\n\n# Collection helpers\ndef _array_from_fchk(fchk_text, array_name):\n matcher = re.compile(r'...
[ [ "numpy.allclose", "numpy.tril_indices_from", "numpy.triu_indices_from", "numpy.zeros_like", "numpy.zeros", "numpy.trace" ] ]
icemtel/carpet
[ "5905e02ab0e44822829a672955dccad3e09eea07" ]
[ "scripts/basin/worker_basin.py" ]
[ "'''\nIntegrates trajectory for many cycles\n- tries to load previously computed cycles; starts from the last point available\n- saved result in a separate file (e.g. phi_0_pt1.npy)\n- finishes early if a trajectory almost converged to a fixed point\n\n- IF integrated for many thousands of cycles - may want to unco...
[ [ "numpy.sqrt", "numpy.linalg.norm", "numpy.save", "numpy.concatenate", "numpy.load", "numpy.array" ] ]
CxrImagePreProcessing/SemanticGenesis
[ "53a72e8df413b61279a6ce21532ac70dcf57fda5" ]
[ "self_discovery/vnet3d.py" ]
[ "import numpy as np\nfrom keras import backend as K\nfrom keras.engine import Input, Model\nfrom keras.layers import Conv3D, MaxPooling3D, UpSampling3D, Activation, BatchNormalization, PReLU, Deconvolution3D,Concatenate\n\nK.set_image_data_format(\"channels_first\")\n\ntry:\n from keras.engine import merge\nexce...
[ [ "numpy.power" ] ]
pierthodo/rtrl
[ "eae3ad3dbfa3aefb2923eea1061ea909ec073abd" ]
[ "rtrl/sac.py" ]
[ "from collections import deque\nfrom copy import deepcopy, copy\nfrom dataclasses import dataclass, InitVar\nfrom functools import lru_cache, reduce\nfrom itertools import chain\nimport numpy as np\nimport torch\nfrom torch.nn.functional import mse_loss\n\nfrom rtrl.memory import Memory\nfrom rtrl.nn import PopArt,...
[ [ "torch.nn.functional.mse_loss", "numpy.float32", "torch.cuda.is_available" ] ]
HsuJeremy/Spotify-Curator
[ "40c499f472566409fcd52e066f45267425452807" ]
[ "server/spotify_model/spotify_predict.py" ]
[ "#!/usr/bin/env python3\nimport os\nimport joblib\nimport pandas as pd\nfrom schema import Schema\nfrom ml_model_abc import MLModel\n\n\nclass SpotifyModel(MLModel):\n # # Need to find a way to validate ints too or convert ints to floats\n # input_schema = Schema([{\n # 'acousticness': float,\n # ...
[ [ "pandas.DataFrame" ] ]
ariel-berger/Mask_Identification
[ "f22bc8975d34781e5db71ccc0c80fdc4d9608696" ]
[ "train_separately.py" ]
[ "import time\nimport torch\nimport torch.nn as nn\nfrom tqdm import tqdm\nfrom utils import train_utils\nfrom torch.utils.data import DataLoader\nfrom utils.types import Scores, Metrics\nfrom dataset import MaskDataset\nfrom models.separate_model import MaskModel, BBModel\nfrom utils.train_utils import get_metrics,...
[ [ "numpy.random.random", "torch.utils.data.DataLoader", "torch.utils.data.random_split", "torch.no_grad", "torch.cuda.is_available", "torch.nn.functional.smooth_l1_loss", "torch.optim.lr_scheduler.StepLR" ] ]
self-supervisor/Escaping-Stochastic-Traps-With-Aleatoric-Mapping-Agents
[ "b55d8d938fe4c313936c9a15e32b738b5d033809" ]
[ "noisy_mnist/unit_test.py" ]
[ "import numpy as np\nimport pytest\nimport torch\n\nfrom noisy_mnist_aleatoric_uncertainty_for_poster import *\n\n\n@pytest.fixture(scope=\"module\", params=[\"train\", \"test\"])\ndef noisy_mnist_env(request):\n\n mnist_env = NoisyMnistEnv(request.param, 0, 2)\n return mnist_env\n\n\n@pytest.fixture(scope=\"...
[ [ "numpy.array_equal", "torch.eq", "torch.zeros_like", "torch.cuda.is_available", "numpy.array", "numpy.zeros" ] ]
emonhossainraihan/Self-Supervised-Learning-for-Sketch
[ "953c13c7d0a3534091b22a0e0504da91be211155" ]
[ "Networks.py" ]
[ "import torch.nn as nn\nimport torchvision.models as backbone_\nimport torch.nn.functional as F\nimport torch\nfrom torchvision.ops import MultiScaleRoIAlign\nfrom collections import OrderedDict\nimport torch\nimport torchvision\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\nfrom torch....
[ [ "torch.nn.Sequential", "torch.nn.AdaptiveMaxPool2d", "torch.nn.ConvTranspose2d", "torch.nn.LSTM", "torch.nn.Conv2d", "torch.nn.Tanh", "torch.tanh", "torch.nn.Linear", "torch.nn.InstanceNorm2d", "torch.nn.LeakyReLU", "torch.cuda.is_available", "torch.nn.ReLU" ] ]
photosynthesis-team/photosynthesis.metrics
[ "4dc9e42057798a4c9c00e121c647a97fe90ea493" ]
[ "piq/utils/common.py" ]
[ "import torch\nimport re\nimport warnings\n\nfrom typing import Tuple, List, Optional, Union, Dict, Any\n\nSEMVER_VERSION_PATTERN = re.compile(\n r\"\"\"\n ^\n (?P<major>0|[1-9]\\d*)\n \\.\n (?P<minor>0|[1-9]\\d*)\n \\.\n (?P<patch>0|[1-9]\\d*)\n (?:-(?P<prereleas...
[ [ "torch.is_tensor" ] ]
logic-and-learning-lab/aaai22-dcc
[ "e2176545f222fd0fe4788297f5448f278c46e440" ]
[ "benchmark.py" ]
[ " #!/usr/bin/env python3\nimport os\nimport sys\nimport psutil\nimport pathlib\nimport subprocess\nimport numpy as np\nimport scipy.stats as stats\nfrom popper.split import runner, prog_to_code\nfrom popper.utils import Settings\nfrom pyswip import Prolog\nfrom multiprocessing.pool import Pool, ThreadPool\nfrom ...
[ [ "scipy.stats.chi2.cdf", "scipy.stats.sem", "numpy.mean" ] ]
oojo12/aavae
[ "dd92797d34c8f0cbd4d7d0bb846f0a9f32f5e189" ]
[ "src/models/projection.py" ]
[ "import torch\nfrom torch import nn\nimport torch.nn.functional as F\n\n\nclass ProjectionHeadAE(nn.Module):\n def __init__(self, input_dim=2048, hidden_dim=2048, output_dim=128):\n super(ProjectionHeadAE, self).__init__()\n\n self.projection_head = nn.Sequential(\n nn.Linear(input_dim, ...
[ [ "torch.nn.Linear", "torch.nn.ReLU", "torch.nn.BatchNorm1d" ] ]
borgwang/reinforce_py
[ "41f67327ae7e1bf87d4648e3ea5f406466c532c9" ]
[ "algorithms/A3C/atari/atari_env_deprecated.py" ]
[ "import os\n\nimport gym\nimport numpy as np\n\nfrom skimage.color import rgb2gray\nfrom skimage.transform import resize\n\n\nclass Atari(object):\n s_dim = [84, 84, 1]\n a_dim = 3\n\n def __init__(self, args, record_video=False):\n self.env = gym.make('BreakoutNoFrameskip-v4')\n self.ale = s...
[ [ "numpy.reshape", "numpy.append", "numpy.random.randint" ] ]
nicrie/xeofs
[ "4c0ed49b45794ce0abb641c98b82638b2faa4828" ]
[ "tests/models/test_rotator_wrapper.py" ]
[ "import numpy as np\nimport pandas as pd\nimport xarray as xr\nimport pytest\n\nfrom xeofs.models.eof import EOF\nfrom xeofs.pandas.eof import EOF as pdEOF\nfrom xeofs.xarray.eof import EOF as xrEOF\nfrom xeofs.models.rotator import Rotator\nfrom xeofs.pandas.rotator import Rotator as pdRotator\nfrom xeofs.xarray.r...
[ [ "pandas.DataFrame", "numpy.testing.assert_allclose" ] ]
safecloud-project/recast
[ "e9138580594569cbbc7d325e8cd4b1740667edac" ]
[ "pyproxy/pyproxy/metadata.py" ]
[ "\"\"\"\nMetadata management for the files and blocks stored in playcloud\n\"\"\"\nimport datetime\nimport logging\nimport json\nimport random\nimport socket\nimport time\n\nimport enum\nimport IPy\nimport numpy\nimport redis\n\nLOGGER = logging.getLogger(\"metadata\")\n\ndef compute_block_key(path, index, length=2...
[ [ "numpy.random.normal" ] ]
MeteoSwiss/mwr_raw2l1
[ "6f8d8b80c203bcbd7f42a53b618ae63f321b68cb" ]
[ "mwr_raw2l1/readers/reader_rpg_base.py" ]
[ "import struct\n\nimport numpy as np\n\nfrom mwr_raw2l1.errors import FileTooLong, FileTooShort, MissingTimeInput, TimerefError, UnknownFileType\nfrom mwr_raw2l1.log import logger\nfrom mwr_raw2l1.readers.reader_rpg_helpers import interpret_angle, interpret_coord, interpret_time\nfrom mwr_raw2l1.utils.file_utils im...
[ [ "numpy.prod", "numpy.frombuffer", "numpy.array", "numpy.dtype" ] ]
wesselb/gpar
[ "70f5cb7cd2dec075e33dd7d9cd133b5bc1798777" ]
[ "examples/paper/ml_data/evaluate_neural_net.py" ]
[ "import numpy as np\nfrom keras.datasets import mnist\nfrom keras.layers.core import Dense, Dropout, Activation\nfrom keras.models import Sequential\nfrom keras.optimizers import Adam\nfrom keras.regularizers import l1_l2\nfrom keras.utils import np_utils\n\n\ndef build_model(params):\n n_hidden_layers = int(np....
[ [ "numpy.random.get_state", "numpy.random.seed", "numpy.round", "numpy.random.permutation", "numpy.random.set_state", "numpy.exp" ] ]
moneypi/rcnn_mxnet_debug
[ "ee918c878ccee7877f87072f9a86218fa77de2f6" ]
[ "symdata/anchor.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.hstack", "numpy.sqrt", "numpy.meshgrid", "numpy.random.choice", "numpy.arange", "numpy.ones", "numpy.round", "numpy.array", "numpy.zeros", "numpy.where" ] ]
ShiminLei/LA-Dialog-Generation-System
[ "c44fb8399d75e9a7e0f08dd12d6c05e2e87653c4" ]
[ "meld-utt-skip.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import print_function\n\nimport argparse\nimport logging\nimport os\n\nimport torch\n\nfrom laed import evaluators, utt_skip_utils\nfrom laed import main as engine\nfrom laed.dataset import corpora\nfrom laed.dataset import data_loaders\nfrom laed.models import sent_models\...
[ [ "torch.load" ] ]
hammamqassim/QC-App-Oriented-Benchmarks
[ "e8e6c41a6b8378820d5b88653cad91fe6e855bc1" ]
[ "phase-estimation/qiskit/pe_benchmark.py" ]
[ "\"\"\"\nPhase Estimation Benchmark Program - Qiskit\n\"\"\"\n\nimport sys\nimport time\n\nimport numpy as np\nfrom qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister\n\nsys.path[1:1] = [\"_common\", \"_common/qiskit\", \"quantum-fourier-transform/qiskit\"]\nsys.path[1:1] = [\"../../_common\", \"../.....
[ [ "numpy.random.seed", "numpy.random.choice" ] ]