repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
georgetown-cset/ai-relevant-papers | [
"bab36b738385208165d7c4f269ccd2afa91fc2c3"
] | [
"scibert/models/bert_text_classifier.py"
] | [
"from typing import Dict, Optional, List, Any\n\nimport torch\nimport torch.nn.functional as F\nfrom allennlp.data import Vocabulary\nfrom allennlp.models.model import Model\nfrom allennlp.modules import FeedForward, TextFieldEmbedder, Seq2SeqEncoder\nfrom allennlp.nn import InitializerApplicator, RegularizerApplic... | [
[
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.nn.MultiLabelMarginLoss",
"torch.nn.functional.softmax"
]
] |
benjaminr/biopython | [
"ad4fe9b0026fd9d4aa417168f4b620f6a681a0ff"
] | [
"Bio/codonalign/codonseq.py"
] | [
"# Copyright 2013 by Zheng Ruan (zruan1991@gmail.com).\n# All rights reserved.\n# This code is part of the Biopython distribution and governed by its\n# license. Please see the LICENSE file that should have been included\n# as part of this package.\n\"\"\"Code for dealing with coding sequence.\n\nCodonSeq class is... | [
[
"scipy.linalg.expm",
"scipy.optimize.minimize",
"numpy.zeros"
]
] |
ngduduong/captum | [
"6fe5f0f23ea975e73e0c0dee79bdc01b4223d283"
] | [
"captum/attr/_utils/common.py"
] | [
"#!/usr/bin/env python3\nfrom typing import Optional, Tuple, Union, overload\n\nimport torch\nfrom torch import Tensor\n\nfrom enum import Enum\nfrom inspect import signature\n\nfrom .approximation_methods import SUPPORTED_METHODS\n\n\nclass ExpansionTypes(Enum):\n repeat = 1\n repeat_interleave = 2\n\n\ndef ... | [
[
"torch.cat",
"torch.tensor",
"torch.numel",
"torch.full_like"
]
] |
mauriceqch/pcc_attr_folding | [
"2fc37de7fb146a724ebada2e39df51de272fa01a"
] | [
"src/ops/nn_distance/nn_distance_test.py"
] | [
"#!/usr/bin/python\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport unittest\nimport numpy as np\nimport tensorflow.compat.v1 as tf\nfrom nn_distance import nn_distance\nfrom nn_distance2 import nn_distance2\n\n\ndef simple_nn(xyz1,... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.argmin",
"tensorflow.compat.v1.Graph",
"numpy.zeros",
"numpy.sum",
"numpy.testing.assert_equal",
"numpy.random.randn",
"numpy.min",
"tensorflow.compat.v1.Session",
"numpy.argpartition",
"tensorflow.compat.v1.dev... |
Vcevalod/nnUNet4 | [
"86d4ff739e537e7054ff5bd8305982287b40a16c"
] | [
"nnunet/inference/segmentation_export.py"
] | [
"# Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\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# ... | [
[
"numpy.array",
"numpy.zeros",
"numpy.copy",
"numpy.load",
"numpy.min"
]
] |
thanhhau097/mlops | [
"6073dd75882c37f84a3c082acec9db9199492319"
] | [
"deployment/interface/main.py"
] | [
"import cv2\nimport gradio as gr\nimport numpy as np\n\nfrom modeling.inference import MNISTInference\n\n\ndef rgb2gray(rgb):\n return np.dot(rgb[..., :3], [0.2989, 0.5870, 0.1140])\n\n\ndef predict(img):\n img = cv2.resize(img, (28, 28))\n img = np.array(rgb2gray(img), dtype=np.float32)\n return str(mo... | [
[
"numpy.dot"
]
] |
nilskk/models | [
"dfb8bd66b54aa7f3c574089ed24b30b2e5ffa41c"
] | [
"research/object_detection/utils/learning_schedules.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.compat.v1.executing_eagerly",
"tensorflow.compat.v1.cast",
"tensorflow.compat.v1.floor",
"tensorflow.compat.v1.one_hot",
"tensorflow.compat.v1.where",
"tensorflow.compat.v1.greater_equal",
"tensorflow.compat.v1.log",
"tensorflow.compat.v1.cos",
"tensorflow.compat.v1... |
guangxinli/akshare | [
"e27666f94051749e3a2d8c4b669b43f03e16d7cb"
] | [
"akshare/stock/zh_stock_kcb_sina.py"
] | [
"# -*- coding:utf-8 -*-\n# /usr/bin/env python\n\"\"\"\nAuthor: Albert King\ndate: 2019/10/30 11:28\ncontact: jindaxiang@163.com\ndesc: 新浪财经-科创板-实时行情数据和历史行情数据(包含前复权和后复权因子)\n优化: 在科创板行情的获取上采用多线程模式(新浪会封IP, 不再优化)\n\"\"\"\nimport datetime\nimport re\n\nimport demjson\nimport pandas as pd\nimport requests\nfrom tqdm impo... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.merge"
]
] |
dipta007/SEMal | [
"8c89e385ff946a2f9b9c5cefff3e0becc8e6a455"
] | [
"LEMP/5_lemp_roc_curve.py"
] | [
"import numpy as np\nfrom os import listdir\nfrom os.path import isfile, join\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import accuracy_score, matthews_corrcoef, precision_score, roc_auc_score, confusion_matrix, classification_report\n# from error_measurement import matthews_correl... | [
[
"numpy.concatenate",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.load",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.show",
"sklearn.metrics.roc_auc_score",... |
bminixhofer/gerpt2 | [
"9ed06f34cc5e7978631e0eae690e57646abc1024"
] | [
"prepare/generate_aligned_wte.py"
] | [
"from tqdm.auto import tqdm\nimport click\nimport numpy as np\nfrom transformers import GPT2LMHeadModel, GPT2TokenizerFast\nfrom sklearn.metrics.pairwise import cosine_similarity\nimport torch\nimport math\nimport json\n\n\ndef load_vectors(path, max_n=200_000):\n with open(path) as f:\n ids = {}\n ... | [
[
"numpy.array",
"numpy.zeros",
"torch.save",
"torch.normal",
"numpy.stack",
"numpy.argsort",
"sklearn.metrics.pairwise.cosine_similarity",
"torch.zeros_like"
]
] |
vtabbott/generative-models | [
"c97ae1b396a32ef8908e27468aef78b758202d1c"
] | [
"GAN/generative_adversarial_parallelization/gap_pytorch.py"
] | [
"import torch\r\nimport torch.nn\r\nimport torch.nn.functional as nn\r\nimport torch.autograd as autograd\r\nimport torch.optim as optim\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.gridspec as gridspec\r\nimport os\r\nimport random\r\nfrom torch.autograd import Variable\r\nfrom ten... | [
[
"torch.nn.Linear",
"torch.nn.Sigmoid",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"matplotlib.pyplot.close",
"torch.from_numpy",
"torch.nn.ReLU",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axis",
"torch.log",
"torch.randn",
"matplotlib.gridspec... |
EricWebsmith/pyod | [
"c26b11f6b8e4b404607ae16879e2b0b4c3e46811"
] | [
"pyod/models/cblof.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Clustering Based Local Outlier Factor (CBLOF)\n\"\"\"\n# Author: Yue Zhao <zhaoy@cmu.edu>\n# Shangwen Huang <https://github.com/shangwen777>\n# License: BSD 2 clause\n\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport warnings\nimport numpy as ... | [
[
"numpy.bincount",
"sklearn.utils.validation.check_is_fitted",
"numpy.zeros",
"numpy.sum",
"sklearn.utils.validation.check_array",
"sklearn.cluster.KMeans",
"numpy.min",
"sklearn.utils.estimator_checks.check_estimator",
"numpy.where",
"numpy.intersect1d",
"numpy.argsort"... |
NDM-123/AISearch | [
"b047d19609a60017855ee724666819949ffa3da6"
] | [
"AIsearch.py"
] | [
"import numpy \r\nimport sys \r\nimport nmslib \r\nimport time \r\nimport math\r\nimport pandas as pd\r\nfrom sklearn.neighbors import NearestNeighbors\r\nfrom sklearn.model_selection import train_test_split\r\nprint(sys.version)\r\nprint(\"NMSLIB version:\", nmslib.__version__)\r\n\r\n\r\n# Just read the data\r\na... | [
[
"sklearn.preprocessing.LabelEncoder",
"numpy.log",
"numpy.sum",
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
]
] |
gmetsov/slow-momentum-fast-reversion | [
"861c13ff2ea1d9e0b24523356c574c3ceaacf5bb"
] | [
"src/classical_strategies.py"
] | [
"import numpy as np\nimport pandas as pd\n\nfrom typing import List, Tuple\n\nVOL_LOOKBACK = 60 # for ex-ante volatility\nVOL_TARGET = 0.15 # 15% volatility target\n\ndef calc_returns(srs: pd.Series, day_offset: int = 1) -> pd.Series:\n \"\"\"for each element of a pandas time-series srs,\n calculates the re... | [
[
"numpy.log",
"numpy.exp",
"numpy.sign",
"numpy.sqrt",
"pandas.Series"
]
] |
Jiawei-Li20/cogdl | [
"a5540e018661d8a62f40282f2bfdde87e766c76f"
] | [
"cogdl/tasks/node_classification.py"
] | [
"import argparse\nimport copy\nfrom typing import Optional\nimport scipy.sparse as sp\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom tqdm import tqdm\n\nfrom cogdl.datasets import build_dataset\nfrom cogdl.models import build_model\nfrom cogdl.models.supervised_model import SupervisedHom... | [
[
"torch.Size",
"numpy.isinf",
"numpy.max",
"numpy.random.choice",
"scipy.sparse.diags",
"torch.arange",
"numpy.random.permutation",
"numpy.ones",
"numpy.min",
"torch.sparse.FloatTensor",
"torch.from_numpy",
"scipy.sparse.eye",
"torch.nn.functional.log_softmax",
... |
richardmeng/gym | [
"a6c06fc1e3e8842c3e3fffd9e701dd1beeba5541"
] | [
"gym/envs/classic_control/cartpole.py"
] | [
"\"\"\"\nClassic cart-pole system implemented by Rich Sutton et al.\nCopied from https://webdocs.cs.ualberta.ca/~sutton/book/code/pole.c\n\"\"\"\n\nimport logging\nimport math\nimport gym\nfrom gym import spaces\nfrom gym.utils import seeding\nimport numpy as np\n\nlogger = logging.getLogger(__name__)\n\nclass Cart... | [
[
"numpy.finfo",
"numpy.array"
]
] |
aaronjones111/PassGAN | [
"2315bdabca7df99917f94a2ceb9de43e55a32618"
] | [
"models3.py"
] | [
"import tensorflow as tf\nimport tflib as lib\nimport tflib.ops.linear\nimport tflib.ops.conv1d\n\n\"\"\"\nUse this file for experimenting\n\ncompanion to samples3.py\n\"\"\"\n\ndef ResBlock(name, inputs, dim):\n # print(\"- Creating ResBlock -\")\n output = inputs\n output = tf.nn.relu(output)\n output... | [
[
"tensorflow.random_normal",
"tensorflow.shape",
"tensorflow.nn.relu",
"tensorflow.reshape"
]
] |
gafergus/CV_scientist | [
"7feb42c72e91d677c317e97c916be3eef0d8e270"
] | [
"cv_framework/cv_scientist.py"
] | [
"import gin\r\nimport math\r\nimport os\r\nimport pandas as pd\r\nfrom tqdm import tqdm\r\nfrom cv_framework.data_access.data_prep import FilePrep\r\nfrom cv_framework.model_definitions.model_utils import data_shape\r\nfrom cv_framework.training.model_comp import comp_model\r\nfrom cv_framework.data_access.generato... | [
[
"pandas.DataFrame"
]
] |
CedricDViou/nenupy-tf | [
"cc048da782b4e3584e5406558c89eaae04425c09"
] | [
"nenupytf/process/analysis.py"
] | [
"#! /usr/bin/python3\n# -*- coding: utf-8 -*-\n\n\n\"\"\"\n ********\n analysis\n ********\n\n Test de docstring\n\"\"\"\n\n\n__author__ = ['Alan Loh']\n__copyright__ = 'Copyright 2019, nenupytf'\n__credits__ = ['Alan Loh']\n__maintainer__ = 'Alan Loh'\n__email__ = 'alan.loh@obspm.fr'\n__status__ = 'Pro... | [
[
"numpy.median",
"numpy.std",
"scipy.optimize.curve_fit",
"numpy.exp"
]
] |
b04901014/keras | [
"016d85c9e6d8a36fe7107e32752f6a9cd8d77c86"
] | [
"keras/backend/tensorflow_backend.py"
] | [
"import tensorflow as tf\n\nfrom tensorflow.python.training import moving_averages\nfrom tensorflow.python.ops import tensor_array_ops\nfrom tensorflow.python.ops import control_flow_ops\ntry:\n from tensorflow.python.ops import ctc_ops as ctc\nexcept ImportError:\n import tensorflow.contrib.ctc as ctc\n\nimp... | [
[
"tensorflow.nn.conv2d",
"tensorflow.group",
"tensorflow.ones_like",
"tensorflow.ones",
"tensorflow.zeros_like",
"tensorflow.nn.separable_conv2d",
"tensorflow.clip_by_value",
"tensorflow.greater",
"tensorflow.unpack",
"tensorflow.nn.avg_pool",
"tensorflow.random_normal_i... |
DavidRother/semeval2020-task1 | [
"715f82afb8b282669d59ff610b63714d19db4618"
] | [
"semeval2020/util/embeddingloader.py"
] | [
"from os import listdir\nimport os.path\nimport pandas as pd\n\n\nclass EmbeddingLoader:\n\n def __init__(self, base_path, language='german', corpus='corpus2', explicit_word_list=None):\n self.explicit_word_list = explicit_word_list or []\n self.language = language\n self.corpus = corpus\n ... | [
[
"pandas.read_csv"
]
] |
bugerry87/flownet3d | [
"d55391a3d6ab0d5748d55eb4dfce40c68fd9b742"
] | [
"utils/utils.py"
] | [
"'''\r\nHelper functions for this project.\r\n\r\nAuthor: Gerald Baulig\r\n'''\r\n\r\n#Global libs\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom time import time\r\nfrom glob import glob, iglob\r\n\r\n\r\ndef myinput(prompt, default=None, cast=None):\r\n ''' myinput(prompt, default=None, cast=... | [
[
"numpy.array",
"numpy.ceil",
"numpy.sqrt",
"matplotlib.pyplot.subplots"
]
] |
norihitoishida/nyaggle | [
"fb838f0010a666835216c588919540e9bfbc5731"
] | [
"tests/validation/test_cross_validate.py"
] | [
"from typing import List\n\nimport numpy as np\n\nfrom catboost import CatBoostClassifier\nfrom lightgbm import LGBMClassifier\nfrom sklearn.datasets import make_classification, make_regression\nfrom sklearn.linear_model import RidgeClassifier, Ridge\nfrom sklearn.metrics import roc_auc_score, r2_score\nfrom sklear... | [
[
"sklearn.linear_model.RidgeClassifier",
"sklearn.metrics.r2_score",
"sklearn.linear_model.Ridge",
"sklearn.model_selection.KFold",
"sklearn.datasets.make_regression",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.roc_auc_score",
"sklearn.datasets.make_classification"... |
harry-stark/jax | [
"236efbdbac643f497f1455ebbcebb7d726f3703c"
] | [
"tests/profiler_test.py"
] | [
"# 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 applicable law or agreed ... | [
[
"tensorflow.python.profiler.profiler_client.trace",
"tensorflow.python.profiler.profiler_v2.ProfilerOptions"
]
] |
TheYuanLiao/individual_mobility_model | [
"3026b8d51e50ffe24a398b22789c86230cd971ce"
] | [
"src/py/sqlite3-converter.py"
] | [
"import os\nimport subprocess\nimport yaml\nimport sqlite3\nfrom sqlalchemy import create_engine\nimport pandas as pd\nimport multiprocessing as mp\nfrom tzwhere import tzwhere\nfrom dateutil import tz\nfrom datetime import datetime as dt\ntzg = tzwhere.tzwhere()\n\n\ndef get_repo_root():\n \"\"\"Get the root di... | [
[
"pandas.read_sql_query"
]
] |
MachengShen/Implicit_ensemble_training | [
"e649f21937612f6aae1b9ba158011c0dce49000c"
] | [
"IET_module/networks/soft_modular_model.py"
] | [
"import numpy as np\nfrom typing import Tuple, List\nfrom ray.rllib.models.modelv2 import ModelV2\nfrom ray.rllib.models.torch.torch_modelv2 import TorchModelV2\nfrom ray.rllib.utils.annotations import override\nfrom ray.rllib.utils.framework import try_import_torch\nfrom ray.rllib.models.torch.misc import SlimFC\n... | [
[
"torch.nn.functional.softmax"
]
] |
mukkachaitanya/parity-models | [
"29db79387c39ab5106d6b098cf26f70c49ee7450"
] | [
"clipper-parm/integration-tests/deploy_pytorch_models.py"
] | [
"from __future__ import absolute_import, print_function\nimport os\nimport sys\nimport requests\nimport json\nimport numpy as np\nimport time\nimport logging\n\ncur_dir = os.path.dirname(os.path.abspath(__file__))\n\nimport torch\nimport torch.utils.data as data\nfrom torch import nn, optim\nfrom torch.autograd imp... | [
[
"torch.nn.Linear",
"torch.autograd.Variable",
"numpy.genfromtxt",
"torch.from_numpy",
"numpy.random.randint",
"torch.LongTensor",
"torch.nn.functional.softmax",
"torch.Tensor"
]
] |
xabeab/BlueNRG-GUI | [
"1134c2625f9126b76aad3677af62827372db80f1"
] | [
"gui.py"
] | [
"from peripheral import *\nfrom processes import *\nfrom settings import *\nfrom tkinter import *\nfrom tkinter import ttk\nimport matplotlib\nmatplotlib.use(\"TkAgg\")\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk\nfrom matplotlib.figure import Figure\nimport matplotlib.pyp... | [
[
"matplotlib.use",
"matplotlib.animation.FuncAnimation",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg",
"matplotlib.pyplot.style.use",
"matplotlib.figure.Figure",
"matplotlib.backends.backend_tkagg.NavigationToolbar2Tk"
]
] |
waissfowl/QAP_pt | [
"af9ccc67aa5fd84017bda796d9831521f63d983d"
] | [
"src/qap/Logger.py"
] | [
"import numpy as np\nimport os\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nfrom scipy.spatial import ConvexHull\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torch import optim\nimport torch.nn.functional as F\n\nif torc... | [
[
"matplotlib.use",
"numpy.array",
"torch.cuda.manual_seed",
"torch.eq",
"matplotlib.pyplot.xlabel",
"torch.save",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.semilogy",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"torch.manual_seed",
"torch.cuda.is_avai... |
KilnOfTheSecondFlame/EnvironmentDashboard | [
"44818e2f55e2d3aee14f01fb05daa058e83e9d23"
] | [
"app.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport plotly.io as pio\nimport plotly.figure_factory as ff\nimport plotly.graph_objects as go\nimport pandas as pd\nimport configparser\n\nfrom plotly.subplots import make_subplot... | [
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
zvikam/Checkpoint-CSA | [
"ea428078d99e0768637f65f19387a6f9c5246f52"
] | [
"2020/Can_You_See_It/Can_You_See_It2.py"
] | [
"import cv2\nimport time\nimport os\nimport sys\nimport numpy as np\n\n\ndef get_divisors(n):\n for i in range(8, int(n / 2) + 1):\n if n % i == 0:\n yield i\n yield n\n\nfor i in sys.argv[1:]:\n bindata = np.fromfile('data2', dtype='uint8')[int(i):]\n\n n = int(len(bindata))\n dims... | [
[
"numpy.fromfile"
]
] |
Mdlglobal-atlassian-net/agents | [
"ba3817ea48d574d314017542e1e4858566f953f4"
] | [
"tf_agents/bandits/agents/constraints_test.py"
] | [
"# coding=utf-8\n# Copyright 2018 The TF-Agents 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 required b... | [
[
"tensorflow.range",
"tensorflow.compat.v1.enable_v2_behavior",
"numpy.ones",
"tensorflow.nest.flatten",
"tensorflow.constant",
"tensorflow.executing_eagerly",
"tensorflow.compat.v1.initializers.constant",
"tensorflow.test.main",
"tensorflow.greater",
"tensorflow.compat.v1.e... |
dkarageo/lovpy | [
"85f43c07aeed4b318238c35da606de2dc65ca24f"
] | [
"examples/valid_numpy_test.py"
] | [
"import numpy as np\n\n\ndef print_const(arr):\n print(repr(arr[1]))\n\n\ndef main():\n x = np.array([.1, .2, .9])\n print_const(x)\n print_const(x)\n\n\nif __name__ == \"__main__\":\n main()\n"
] | [
[
"numpy.array"
]
] |
Yu-Yy/MathPoseGNN | [
"9759955957b4cca192f5a98031245277c12750f3"
] | [
"cvpack/torch_modeling/engine/engine.py"
] | [
"# encoding: utf-8\n\nimport os\nimport os.path as osp\nimport time\nimport argparse\n\nimport torch\nimport torch.distributed as dist\n\nfrom collections import OrderedDict\nfrom cvpack.utils.pyt_utils import (\n parse_torch_devices, extant_file, link_file, ensure_dir)\nfrom cvpack.utils.logger import get_logge... | [
[
"torch.device",
"torch.distributed.init_process_group",
"torch.save",
"torch.cuda.set_device",
"torch.cuda.empty_cache",
"torch.distributed.barrier"
]
] |
zbzhu99/ILSwiss | [
"9be4ff89a0005cd404014696aacc0eefd7596b86"
] | [
"rlkit/data_management/normalizer.py"
] | [
"\"\"\"\nBased on code from Marcin Andrychowicz\n\"\"\"\nimport numpy as np\n\n\nclass Normalizer(object):\n def __init__(\n self,\n size,\n eps=1e-8,\n default_clip_range=np.inf,\n mean=0,\n std=1,\n ):\n self.size = size\n self.eps = eps\n self.... | [
[
"numpy.square",
"numpy.zeros",
"numpy.ones",
"numpy.mean",
"numpy.var",
"numpy.clip",
"numpy.expand_dims"
]
] |
dcdenu4/invest | [
"3d115d4d903674236f1e9e9962d737029ebd0701"
] | [
"tests/test_ufrm.py"
] | [
"# coding=UTF-8\r\n\"\"\"Tests for Urban Flood Risk Mitigation Model.\"\"\"\r\nimport unittest\r\nimport tempfile\r\nimport shutil\r\nimport os\r\n\r\nfrom osgeo import gdal\r\nfrom osgeo import osr\r\nfrom osgeo import ogr\r\nimport numpy\r\nimport pygeoprocessing\r\nimport shapely.geometry\r\n\r\n\r\nclass UFRMTe... | [
[
"numpy.testing.assert_allclose",
"pandas.read_csv",
"numpy.isclose",
"numpy.log"
]
] |
mihdalal/plan2explore | [
"18291bd052823a91c2cb53e31f24bae973f2361f"
] | [
"plan2explore/training/trainer.py"
] | [
"# Copyright 2019 The Dreamer Authors. Copyright 2020 Plan2Explore Authors. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/lic... | [
[
"tensorflow.control_dependencies",
"tensorflow.convert_to_tensor",
"tensorflow.get_default_graph",
"tensorflow.cond",
"tensorflow.summary.scalar",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.train.get_checkpoint_state",
"tensorflow.ConfigProto",
"tensorflow.... |
ukky17/vitaminPrediction | [
"bfd46cc58d87c2818b9ba185b9e2d18e72ee6407"
] | [
"test.py"
] | [
"import argparse\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.svm import SVC\nfrom sklearn.ensemble import RandomForestClassifier\nfr... | [
[
"matplotlib.pyplot.xlim",
"sklearn.ensemble.RandomForestClassifier",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.savefig",
"numpy.sum",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"sklearn.svm.SVC",
"skl... |
NakamuraTakashi/pyroms | [
"f02324a85be6c7694f83d2fb0ed0b27e869c89b9"
] | [
"pyroms_toolbox/pyroms_toolbox/remapping_tensor.py"
] | [
"# encoding: utf-8\n\nimport os\nimport numpy as np\nimport glob\ntry:\n import netCDF4 as netCDF\nexcept:\n import netCDF3 as netCDF\n\nimport pyroms\nimport pyroms_toolbox\nimport _remapping\n\nimport matplotlib.pyplot as plt\n\nimport datetime\n\ndef remapping_tensor(varname, srcfile, wts_files, srcgrd, dstgrd... | [
[
"numpy.where",
"numpy.sin",
"numpy.dot",
"numpy.cos"
]
] |
tpoisonooo/ppq | [
"cba525dd0e8abe9743e02a013fcf22fb320ae07d"
] | [
"ppq/api/interface.py"
] | [
"import os\nfrom typing import Any, Callable, List\n\nimport torch\nfrom ppq.core import (NetworkFramework, TargetPlatform, empty_ppq_cache,\n ppq_warning)\nfrom ppq.executor import TorchExecutor\nfrom ppq.IR import (BaseGraph, GraphCommand, GraphCommandType, GraphFormatter,\n ... | [
[
"torch.zeros",
"torch.onnx.export"
]
] |
nishimoto/py_r_stats | [
"1e4a2dbe68feb25d34f2cbf1a769cb44238ae6cd"
] | [
"visualization/plt.mnist.py"
] | [
"#!/usr/bin/env python\n#!pip install japanize_matplotlib # プロット中で日本語を使用するためにインストール\n\nimport itertools\nimport pandas as pd\nimport matplotlib.pylab as plt\nfrom IPython.display import display\n\ndf = pd.read_csv(\"mnist_train.csv\", header=None, index_col=0)\ndisplay(df.head())\n\nxs = []\nys = []\nfor x, y in it... | [
[
"pandas.read_csv",
"matplotlib.pylab.scatter"
]
] |
etiennegalea/braindecode | [
"5753ea8b255e2dd2f120df80116ec1bd4c199f78"
] | [
"datasets/sleep_physionet.py"
] | [
"# Authors: Hubert Banville <hubert.jbanville@gmail.com>\n#\n# License: BSD (3-clause)\n\n\nimport os\n\nimport numpy as np\nimport pandas as pd\nimport mne\nfrom mne.datasets.sleep_physionet.age import fetch_data\n\nfrom .base import BaseDataset, BaseConcatDataset\n\n\nclass SleepPhysionet(BaseConcatDataset):\n ... | [
[
"numpy.where",
"pandas.Series"
]
] |
XeniaLLL/GDN | [
"931b940f938041c092f2e133d6e6fe7bc4f8c127"
] | [
"models/graph_layer.py"
] | [
"import torch\nfrom torch.nn import Parameter, Linear, Sequential, BatchNorm1d, ReLU\nimport torch.nn.functional as F\nfrom torch_geometric.nn.conv import MessagePassing\nfrom torch_geometric.utils import remove_self_loops, add_self_loops, softmax\n\nfrom torch_geometric.nn.inits import glorot, zeros\nimport time\n... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.is_tensor",
"torch.nn.functional.dropout",
"torch.Tensor",
"torch.nn.functional.leaky_relu"
]
] |
nertsam/DAGsched | [
"dcd431384fe1dd3f0f55a9287fc980f2b445beaf"
] | [
"model/plots/plot_design.py"
] | [
"from __future__ import division\nfrom matplotlib import rcParams\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport sys\nimport numpy as np\nimport itertools\n\nrcParams['ps.useafm'] = True\nrcParams['pdf.use14corefonts'] = True\nrcParams['text.usetex'] = True\n\n\ndef plot(filegroups):\n \n name... | [
[
"numpy.arange",
"matplotlib.pyplot.subplots_adjust",
"numpy.load",
"matplotlib.pyplot.subplots"
]
] |
sebastianwindeck/AML_Task5 | [
"cf261827bb28604f44a1f8ce8212c0711910b5a7"
] | [
"helpers/plotter.py"
] | [
"import numpy as np\nimport itertools\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import confusion_matrix\n\n\ndef _plot_confusion_matrix(cm, classes,\n normalize=False,\n title='Confusion matrix',\n cmap=plt.cm.Blues):\n \"\"\... | [
[
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.xlabel",
"numpy.set_printoptions",
"matplotlib.pyplot.title",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.ravel",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"matplotlib... |
mehmani/MFRED-DisAgV001 | [
"245f457c630a8149275728d47c7ac56188c3c20f"
] | [
"scores_sequence.py"
] | [
"def scores_sequence(Y_pred, Y_test, activation_threshold = 0.1 ,plot_results= False, print_results = False):\r\n \r\n import numpy as np\r\n import pandas as pd\r\n import seaborn as sns\r\n import matplotlib.pyplot as plt\r\n\r\n \"\"\"\r\n a function that computes the classification scores ... | [
[
"pandas.DataFrame.from_dict",
"numpy.putmask"
]
] |
sejunssi/benchmarking_gnns | [
"881c92850f5366f7f8ca008da375037a41936681"
] | [
"tmp/smoothing_all.py"
] | [
"# %% md\n\n# Notebook for generating and saving SBM CLUSTER graphs\n\n# %%\n\nimport numpy as np\nimport torch\nimport pickle\nimport time\n\n# % matplotlib\n# inline\nimport matplotlib.pyplot as plt\nimport scipy.sparse\nimport os\nprint(os.getcwd())\n\n# %% md\n\n# Generate SBM CLUSTER graphs\n\n# %%\n\n\ndef sc... | [
[
"numpy.concatenate",
"numpy.full",
"numpy.random.binomial",
"numpy.random.rand",
"numpy.zeros",
"matplotlib.pyplot.spy",
"numpy.random.permutation",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"torch.from_numpy",
"numpy.where",
"matplotlib.pyplot.hist",
... |
JsonLieo/RL_Study | [
"9519b999eab505a8396e6c2dab211d05cad0c2b8"
] | [
"RNN/DeepRNN.py"
] | [
"#!/usr/bin/python\n# -*- coding: UTF-8 -*-\n\"\"\"\n@author:LXM\n@file:DeepRNN.py\n@time:2020/10/13\n\"\"\"\nimport numpy as np\nimport tensorflow.compat.v1 as tf\nimport matplotlib.pyplot as plt\nimport tensorflow.keras as keras\n\n# 定义RNN参数\nHIDDEN_SIZE = 30 # LSTM中隐藏节点的个数。\nNUM_LAYERS... | [
[
"numpy.array",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.keras.layers.RNN",
"tensorflow.compat.v1.data.Dataset.from_tensor_slices",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"tensorflow.compat.v1.variabl... |
DD-DeCaF/upload | [
"6f938ae3012eecac292f7a531780f9f0c9873903"
] | [
"src/upload/upload.py"
] | [
"# Copyright 2018 Novo Nordisk Foundation Center for Biosustainability, DTU.\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... | [
[
"pandas.melt",
"pandas.read_csv"
]
] |
kavehshamsi/scadec | [
"3cc1e0eba5db12be5b16aea7b7fd4909faf42714"
] | [
"python/sca_attack.py"
] | [
"import time\n#from pyftdi.ftdi import Ftdi\n#ft = Ftdi()\n#url = 'ftdi://ftdi:2232:FT2RTNYW/2'\n#ft.open_bitbang_from_url(url, 0b00001111)\n#print(ft.is_connected)\n#print(ft.bitbang_enabled)\n#print(ft.device_version)\n#print(ft.fifo_sizes)\n#print(ft.get_identifiers(url))\n#print(ft.has_mpsse)\n#print(ft.has_wid... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.random.randint"
]
] |
annagruendler/haystack | [
"49886f88f02c413d07828772b82a4d79b21c893c"
] | [
"haystack/reader/farm.py"
] | [
"import logging\nimport multiprocessing\nfrom pathlib import Path\nfrom typing import List, Optional, Union, Dict, Any\nfrom collections import defaultdict\nfrom time import perf_counter\n\nimport numpy as np\nfrom farm.data_handler.data_silo import DataSilo\nfrom farm.data_handler.processor import SquadProcessor\n... | [
[
"numpy.asarray"
]
] |
ni30kp/HR_Employee_Wellbeing | [
"fa2ef37a365bc0671ae6fbbc354755341f7bed5f"
] | [
"main.py"
] | [
"from tkinter import *\nfrom tkinter import ttk\nfrom tkinter import messagebox\nimport pandas as pd\nimport numpy as np\n\n\nbusiness_travel=3\ndept=3\nedu_field=3\ngender=3\njob_role=3\nmartital=3\nover_time=3\n\n\ndef get_entry_data():\n age = int(el1.get())\n\n if el2.get() == \"Non Travel\":\n bu... | [
[
"sklearn.preprocessing.LabelEncoder",
"numpy.reshape",
"sklearn.linear_model.LogisticRegression",
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
]
] |
Elmecio/IForestASD_based_methods_in_sk-Multiflow | [
"eee23b77dc52de704f559cdfbce06b1b96bd2854"
] | [
"source/iforestasd_scikitmultiflow_with_PCA.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Notebook_test_iForestASD_Scikitmultiflow.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1APZBgZ0fuHufYWM5QKqFhR7cpPs0bF2T\n\n# iForestASD : Unsupervised Anomaly Detection with Scikit-MultiFlow\n\nAn Imple... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.log",
"numpy.where",
"numpy.arange",
"numpy.log2"
]
] |
dankunis/visual-geometry-project | [
"ff03e66046655529d851a7d5b771ee213bc8b8f9"
] | [
"src/camera_calibration.py"
] | [
"#!/usr/bin/env python3.7.2\n# vim: set ts=4 et:\n# -*- indent-tabs-mode: t; tab-width: 4 -*-\n#\n# @brief Camera Calibration function\n# @details In this function the camera calibration will be calculated from a given chessboard_images\n# @author Simon Rueba <simon.rueba@student.uibk.ac.at>\n# Daniel K... | [
[
"numpy.asarray",
"numpy.zeros"
]
] |
Sr-vZ/Auto-Grade-OMR | [
"855a30c1e89826c07cbb84e141d5bb2eb2ccf574"
] | [
"document_scanner.py"
] | [
"import cv2\nimport numpy as np\nimport os\nimport argparse\n\ndef transform(pos):\n\tpts = []\n\tn = len(pos)\n\tfor i in range(n):\n\t\tpts.append(list(pos[i][0]))\n\t#print pts\n\tsums = {}\n\tdiffs = {}\n\ttl = tr = bl = br = 0\n\tfor i in pts:\n\t\tx = i[0]\n\t\ty = i[1]\n\t\tsum = x+y\n\t\tdiff = y-x\n\t\tsum... | [
[
"numpy.float32",
"numpy.sqrt"
]
] |
JJoving/wenet | [
"4a2195744dba43fe4fb9ad8d46a2b90a80dbdc4e"
] | [
"wenet/dataset/dataset.py"
] | [
"# Copyright (c) 2020 Mobvoi Inc. (authors: Binbin Zhang, Chao Yang)\n# Copyright (c) 2021 Jinsong Pan\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.or... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.copy",
"torch.from_numpy",
"numpy.random.random_sample",
"torch.utils.data.DataLoader",
"numpy.argsort",
"torch.Tensor"
]
] |
vishalbelsare/xam | [
"93c066990d976c7d4d74b63fb6fb3254ee8d9b48"
] | [
"xam/ensemble/stacking.py"
] | [
"import collections\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn import metrics\nfrom sklearn import model_selection\nfrom sklearn import preprocessing\nfrom sklearn import utils\nfrom sklearn.base import BaseEstimator\nfrom sklearn.base import ClassifierMixin\nfrom sklearn.base import clone\nfrom sklea... | [
[
"sklearn.utils.validation.check_is_fitted",
"sklearn.model_selection.StratifiedKFold",
"numpy.mean",
"numpy.std",
"sklearn.model_selection.KFold",
"numpy.hstack",
"sklearn.base.clone",
"sklearn.preprocessing.LabelBinarizer",
"numpy.unique"
]
] |
tingyingwu2010/rsome | [
"4fec4694ac40de8b0de484728f4abda9ac63d563"
] | [
"ro.py"
] | [
"from .socp import Model as SOCModel\nfrom .lp import LinConstr, Bounds, CvxConstr, ConeConstr\nfrom .lp import Vars, VarSub, Affine, Convex\nfrom .lp import DecRule, DecRuleSub\nfrom .lp import RoAffine, RoConstr\nfrom .lp import Solution\nfrom .subroutines import *\nimport numpy as np\nfrom scipy.sparse import cs... | [
[
"numpy.prod"
]
] |
oisindoherty3/drem | [
"478fe4e72fd38628f4ddc3745c16efe75ee98e4d"
] | [
"src/drem/utilities/pandas_tasks.py"
] | [
"from pathlib import Path\nfrom typing import Any\nfrom typing import Iterable\nfrom typing import List\nfrom typing import Union\n\nimport pandas as pd\n\nfrom icontract import require\nfrom prefect import Task\nfrom prefect import task\n\n\n@task\n@require(\n lambda df, column_names: set(column_names).issubset... | [
[
"pandas.read_parquet",
"pandas.concat"
]
] |
yulongfan/tryEverything | [
"2f66a8d33c3539e46d91527186bc52515ce5b14f"
] | [
"example/google_im2txt/102flower/train.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.gfile.IsDirectory",
"tensorflow.logging.set_verbosity",
"tensorflow.flags.DEFINE_string",
"tensorflow.flags.DEFINE_boolean",
"tensorflow.Graph",
"tensorflow.train.Saver",
"tensorflow.logging.info",
"tensorflow.ConfigProto",
"tensorflow.contrib.slim.learning.train",
... |
mthcom/Transformer | [
"4862e46edd2979eb6afa3209247ee0498835216d"
] | [
"Process.py"
] | [
"import pandas as pd\nimport torchtext\nfrom torchtext import data\nfrom Tokenize import tokenize\nfrom Batch import MyIterator, batch_size_fn\nimport os\nimport dill as pickle\n\ndef read_data(opt):\n \n if opt.src_data is not None:\n try:\n opt.src_data = open(opt.src_data).read().strip().... | [
[
"pandas.DataFrame"
]
] |
Microsoft/CameraTraps | [
"0f1d5c4f6d7823279a693735778fb985814c5161"
] | [
"visualization/visualization_utils.py"
] | [
"\"\"\"\nvisualization_utils.py\n\nCore rendering functions shared across visualization scripts\n\"\"\"\n\n#%% Constants and imports\n\nfrom io import BytesIO\nfrom typing import Union\nimport time\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport requests\nfrom PIL import Image, ImageFile, ImageFont, ... | [
[
"numpy.array",
"numpy.ceil",
"matplotlib.pyplot.subplots"
]
] |
Q2MM/q2mm | [
"7cda5c376d6e76ebc2a7231e8b7fb11ada389062"
] | [
"q2mm/calculate.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nExtracts data from reference files or calculates FF data.\n\nTakes a sequence of keywords corresponding to various\ndatatypes (ex. mb = MacroModel bond lengths) followed by filenames,\nand extracts that particular data type from the file.\n\nNote that the order of filenames IS IMPORT... | [
[
"numpy.array",
"numpy.count_nonzero",
"numpy.dot",
"numpy.linalg.eigh",
"numpy.load",
"numpy.tril_indices_from",
"numpy.diag"
]
] |
lkusch/Kratos | [
"e8072d8e24ab6f312765185b19d439f01ab7b27b"
] | [
"applications/RomApplication/tests/test_empirical_cubature_method.py"
] | [
"#import python class test\nimport KratosMultiphysics.KratosUnittest as KratosUnittest\nimport KratosMultiphysics.kratos_utilities as kratos_utilities\n\n#import python packages\ntry:\n import numpy as np\n from KratosMultiphysics.RomApplication.empirical_cubature_method import EmpiricalCubatureMethod\n nu... | [
[
"numpy.linspace",
"numpy.power",
"numpy.zeros"
]
] |
FeiLi5/git-github.com-yt-project-yt | [
"0c6cf75351b91e4da80f6a0207ebbcb73dd72a59"
] | [
"yt/tests/test_testing.py"
] | [
"\"\"\"\nTests for yt.testing\n\"\"\"\n#-----------------------------------------------------------------------------\n# Copyright (c) 2018, yt Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n#------... | [
[
"matplotlib.get_backend"
]
] |
avramidis/fastseriation | [
"bddc79f21c8172c9af339d058190ab9255d3f66d"
] | [
"tests/test_basic.py"
] | [
"import unittest\nimport sys\nimport numpy\n\nsys.path.append('..')\nimport fastseriation.seriate\n\n\nclass TestFastSeriationMethods(unittest.TestCase):\n\n def test_fastseriation_1(self):\n\n nrows = 10\n ncols = 2\n\n scores = numpy.zeros((nrows, ncols))\n for i in range(nrows):\n ... | [
[
"numpy.flipud",
"numpy.array_equiv",
"numpy.random.permutation",
"numpy.zeros"
]
] |
CollinJ0/antibodies | [
"7bfe86e9848f7194eefde1e0ea2765181278fb59"
] | [
"antibodies/plot.py"
] | [
"#!/usr/bin/env python\r\n# filename: plot.py\r\n\r\nimport itertools\r\nimport os\r\nimport sys\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\nimport matplotlib.pyplot as plt\r\nimport seaborn as sns\r\n\r\nfrom abutils.utils import mongodb\r\nfrom abutils.utils import color\r\n\r\nimport pymongo\r\nfrom ... | [
[
"pandas.DataFrame",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xticks"
]
] |
nju-websoft/AliNet | [
"feb34993f1181df1cc05cc1542bd6f3590fa1ce2"
] | [
"code/align/preprocess.py"
] | [
"import random\n\nimport numpy as np\nimport pandas as pd\n\n\ndef remove_unlinked_triples(triples, linked_ents):\n print(\"before removing unlinked triples:\", len(triples))\n new_triples = set()\n for h, r, t in triples:\n if h in linked_ents and t in linked_ents:\n new_triples.add((h, ... | [
[
"pandas.DataFrame",
"numpy.array",
"pandas.merge"
]
] |
MarcusRainbow/TwoPlayerGame | [
"a10c0a5f949bcb6e03bdf8197c513511b3c29f98"
] | [
"connect4.py"
] | [
"from game import Game\r\nfrom board import Board\r\nimport numpy as np\r\nfrom typing import Tuple, List\r\n\r\nclass Connect4(Game):\r\n def __init__(self, starting_grid = np.zeros((6, 7), dtype=int)):\r\n self.starting_grid = starting_grid\r\n\r\n def clean_board(self) -> Board:\r\n return Bo... | [
[
"numpy.zeros",
"numpy.copy",
"numpy.where",
"numpy.transpose",
"numpy.size"
]
] |
Borda/pyImSegm | [
"c52e709f9fcd90bcc6ab06e515685fd4c4e6c301"
] | [
"experiments_ovary_centres/run_center_clustering.py"
] | [
"\"\"\"\nThe clustering is already part of the center prediction scipt.\nThe path to the image and segmentation serves just for visualisation,\nfor the own clustering they are not needed.\n\nCopyright (C) 2017 Jiri Borovec <jiri.borovec@fel.cvut.cz>\n\"\"\"\n\nimport logging\nimport os\nimport sys\nfrom functools i... | [
[
"matplotlib.use",
"numpy.array",
"pandas.DataFrame",
"matplotlib.pylab.close",
"numpy.mean",
"sklearn.cluster.DBSCAN",
"matplotlib.pylab.subplots"
]
] |
KonstantinKlepikov/pykeen | [
"bbfd0effc4b541a83c365865456df230059c0c77"
] | [
"src/pykeen/models/unimodal/structured_embedding.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"Implementation of structured model (SE).\"\"\"\n\nimport functools\nfrom typing import Optional\n\nimport numpy as np\nimport torch\nimport torch.autograd\nfrom torch import nn\nfrom torch.nn import functional\n\nfrom ..base import EntityEmbeddingModel\nfrom ...constants import DEF... | [
[
"torch.norm",
"torch.split",
"torch.cat",
"numpy.sqrt"
]
] |
hernot/hickle | [
"3b5efbb0d10f13a434b6eed9046dec7fc7bbde85"
] | [
"hickle/tests/test_hickle.py"
] | [
"#! /usr/bin/env python\n# encoding: utf-8\n\"\"\"\n# test_hickle.py\n\nUnit tests for hickle module.\n\n\"\"\"\n\n\n# %% IMPORTS\n# Built-in imports\nfrom collections import OrderedDict as odict\nimport os\nfrom pprint import pprint\n\n# Package imports\nimport h5py\nimport numpy as np\nfrom py.path import local\n... | [
[
"numpy.array",
"numpy.zeros",
"numpy.float",
"numpy.ones",
"numpy.float64",
"numpy.allclose",
"numpy.ma.array",
"numpy.arange",
"numpy.all",
"numpy.linspace",
"numpy.dtype"
]
] |
ssg-research/openfl | [
"b60cbfbdad595e653c94cee23fd35add993b94b0"
] | [
"openfl-tutorials/interactive_api/PyTorch_DogsCats_ViT/envoy/dogs_cats_shard_descriptor.py"
] | [
"# Copyright (C) 2020-2021 Intel Corporation\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Cats and dogs shard descriptor.\"\"\"\n\nimport json\nimport os\nimport shutil\nfrom hashlib import md5\nfrom logging import getLogger\nfrom pathlib import Path\nfrom random import shuffle\nfrom typing import Optional\nfrom... | [
[
"numpy.asarray"
]
] |
0x00-pl/tvm | [
"f3abb3d88f3a1145a4454649b454fe0139f19bc9"
] | [
"tests/python/frontend/tflite/test_forward.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... | [
[
"tensorflow.python.ops.math_ops.mat_mul",
"numpy.random.rand",
"tensorflow.python.ops.nn_ops.pool",
"tensorflow.python.ops.math_ops.minimum",
"tensorflow.python.ops.math_ops.tanh",
"tensorflow.python.ops.math_ops.sigmoid",
"tensorflow.python.ops.array_ops.concat",
"tensorflow.pytho... |
burntyellow/adelman_ci | [
"cca251a51b34843faed0275cce01d7a307829993"
] | [
"src/westpa/core/data_manager.py"
] | [
"\"\"\"\nHDF5 data manager for WEST.\n\nOriginal HDF5 implementation: Joseph W. Kaus\nCurrent implementation: Matthew C. Zwier\n\nWEST exclusively uses the cross-platform, self-describing file format HDF5\nfor data storage. This ensures that data is stored efficiently and portably\nin a manner that is relatively st... | [
[
"numpy.array",
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"numpy.multiply.reduce",
"numpy.digitize",
"numpy.dtype"
]
] |
kartik4949/tinygrad | [
"ac229ea750371f7480c4e477d49949944361a001"
] | [
"tinygrad/tensor.py"
] | [
"# inspired by https://github.com/karpathy/micrograd/blob/master/micrograd/engine.py\nimport sys\nimport inspect\nimport functools\nimport os\nfrom collections import defaultdict\nimport numpy as np\n\n# **** profiler ****\n\nDEBUG = os.getenv(\"DEBUG\", None) is not None\nif DEBUG:\n import atexit, time\n debug_... | [
[
"numpy.array",
"numpy.random.binomial",
"numpy.empty",
"numpy.zeros",
"numpy.ones",
"numpy.random.randn",
"numpy.eye",
"numpy.prod",
"numpy.random.uniform"
]
] |
yulinliu101/DeepTP | [
"bc4f9adad6dda6c32e58026dda7863e0cb2a6072"
] | [
"src/evaluate_prediction.py"
] | [
"# -*- coding: utf-8 -*-\n# @Author: liuyulin\n# @Date: 2018-10-22 14:31:13\n# @Last Modified by: Yulin Liu\n# @Last Modified time: 2019-06-23 20:44:21\n\nimport numpy as np\nimport pandas as pd\nfrom visualize_samples import plot_fp_act\nimport pickle\nfrom scipy.interpolate import interp1d\nfrom utils import ... | [
[
"numpy.concatenate",
"scipy.interpolate.interp1d",
"numpy.array",
"matplotlib.pyplot.subplots",
"numpy.stack",
"numpy.arange",
"numpy.argmax",
"numpy.sqrt",
"numpy.abs",
"pandas.read_csv"
]
] |
alowet/iblapps | [
"9be936cd6806153dde0cbff1b6f2180191de3aeb"
] | [
"task_qc_viewer/ViewEphysQC.py"
] | [
"import logging\n\nfrom PyQt5 import QtCore, QtWidgets\nfrom matplotlib.figure import Figure\nfrom matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT\nimport pandas as pd\nimport numpy as np\n\nimport qt as qt\n\n_logger = logging.getLogger('ibllib')\n\n\nclass DataFrameModel(QtCore.Q... | [
[
"numpy.max",
"numpy.array",
"pandas.DataFrame",
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.__init__",
"numpy.min",
"matplotlib.backends.backend_qt5agg.NavigationToolbar2QT",
"matplotlib.figure.Figure",
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.updateGeometry"... |
Minsoo2022/Pose-Transfer | [
"10a60bb33d51a06e1200f5726f2367b5be4a6b79"
] | [
"models/inpainting.py"
] | [
"import numpy as np\nimport torch\nimport os\nfrom collections import OrderedDict\nfrom torch.autograd import Variable\nimport itertools\nimport util.util as util\nfrom util.image_pool import ImagePool\nfrom .base_model import BaseModel\nfrom . import networks\n# losses\nfrom losses.L1_plus_perceptualLoss import L1... | [
[
"torch.autograd.Variable",
"torch.cat",
"numpy.zeros",
"torch.nn.L1Loss"
]
] |
p4vv37/pyradox | [
"cfc8c07d637a1cc189dd8d200f8a55d00405b81f"
] | [
"tests/test_res_next.py"
] | [
"import sys, os\n\nsys.path.append(os.path.dirname(os.getcwd()))\n\nfrom tensorflow import keras\nimport numpy as np\nfrom pyradox import convnets\n\n\ndef test():\n inputs = keras.Input(shape=(28, 28, 1))\n x = keras.layers.ZeroPadding2D(2)(\n inputs\n ) # padding to increase dimenstions to 32x32\... | [
[
"tensorflow.keras.layers.GlobalAvgPool2D",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.Input",
"tensorflow.keras.layers.ZeroPadding2D"
]
] |
srinivas212/dlrm | [
"03a1534ff9fbe6a531609100a08d6f41d7f48d29"
] | [
"dlrm_s_pytorch.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n#\n# Description: an implementation of a deep learning recommendation model (DLRM)\n# The model input consists of dense and sparse fea... | [
[
"torch.cat",
"torch.nn.EmbeddingBag",
"torch.nn.ModuleList",
"numpy.set_printoptions",
"torch.nn.parallel.scatter_gather.scatter",
"torch.set_printoptions",
"torch.cuda.is_available",
"torch.load",
"torch.transpose",
"torch.nn.parallel.replicate.replicate",
"numpy.froms... |
cliveseldon/examples | [
"c93b792d67c8c52bc91d4ccf5fbaead4e2324331"
] | [
"github_issue_summarization/workflow/workspace/src/recommend.py"
] | [
"import argparse\nimport keras\nimport pandas as pd\nfrom seq2seq_utils import load_text_processor\nfrom seq2seq_utils import Seq2Seq_Inference\n\n# Parsing flags.\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--input_csv\")\nparser.add_argument(\"--input_model_h5\")\nparser.add_argument(\"--input_body... | [
[
"pandas.read_csv"
]
] |
zhazhijibaba/zhazhijibaba_programming_lessons | [
"124bd0166796ee3af947917c84e00679274100ca"
] | [
"programming_lesson3/rmsd.py"
] | [
"import numpy as np\n\ndef centroid(X):\n \"\"\"\n Centroid is the mean position of all the points in all of the coordinate\n directions, from a vectorset X.\n https://en.wikipedia.org/wiki/Centroid\n C = sum(X)/len(X)\n Parameters\n ----------\n X : array\n (N,D) matrix, where N is p... | [
[
"numpy.dot",
"numpy.linalg.det",
"numpy.transpose",
"numpy.linalg.svd",
"numpy.sqrt"
]
] |
PierreMsy/DRL_cooperation | [
"0385f4c88857659f44ddd5fc8c5c6c33344a38cc"
] | [
"marl_coop/agent/self_maddpg_agent.py"
] | [
"import numpy as np\nimport torch\n\nfrom marl_coop.agent import Base_agent\nfrom marl_coop.model import Actor_network_creator, Critic_network_creator\nfrom marl_coop.model.component import CriterionCreator\nfrom marl_coop.component import BufferCreator, NoiseCreator\nfrom marl_coop.utils.helper import to_np\n\n\nc... | [
[
"numpy.array",
"torch.no_grad",
"torch.stack",
"torch.from_numpy"
]
] |
Rigonz/PopDensity_SatelliteNightLight | [
"88b0fae1e09984e08506063908d9c7fce6dc2229"
] | [
"POP CHECK R0 py36.py"
] | [
"'''\nCreated on: see version log.\n@author: rigonz\ncoding: utf-8\n\nIMPORTANT: requires py3.6 (rasterio)\n\nScript that:\n1) reads a series of raster files,\n2) runs some checks,\n3) makes charts showing the results.\n\nThe input data corresponds to a region of the world (ESP) and represents\nthe population densi... | [
[
"numpy.full",
"numpy.delete",
"matplotlib.pyplot.colorbar",
"numpy.ceil",
"numpy.array",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.figure",
"matplotlib.py... |
justCodeThings/rockpaperscissors | [
"46ea5b9b4ddb8d0b3fcd181dfadd9ca587f5a30d"
] | [
"machinevmachine.py"
] | [
"from sklearn.linear_model import LinearRegression\nfrom time import sleep, time\nimport random\n\nrounds = 1\nvalid_input = {1 : 1, 2 : 2, 3 : 3}\nvalid_output = {1 : \"Rock\", 2 : \"Paper\", 3 : \"Scissors\"}\nvictory_dict = {1 : 2, 2 : 3, 3 : 1}\nai_one_response = 0\nai_two_response = 0\nai_one_outcome = 0\nai_t... | [
[
"sklearn.linear_model.LinearRegression"
]
] |
alfrisch/aqua | [
"179ce59bd1366ebdc85e21a98336e3cf31565e8d"
] | [
"test/test_iqpe.py"
] | [
"# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2019.\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... | [
[
"numpy.array",
"numpy.testing.assert_almost_equal",
"scipy.sparse.csc_matrix",
"numpy.testing.assert_approx_equal",
"numpy.exp"
]
] |
hernot/bitshuffle | [
"a60471d37a8cbbd8265dc8cfa83a9320abdcb590"
] | [
"tests/make_regression_tdata.py"
] | [
"\"\"\"\nScript to create data used for regression testing.\n\n\"\"\"\n\nimport numpy as np\nfrom numpy import random\nimport h5py\n\nimport bitshuffle\nfrom bitshuffle import h5\nfrom h5py import h5z\n\nBLOCK_SIZE = 64 # Smallish such that datasets have many blocks but are small.\nCOMP_LVL = 10 # ZSTD compressio... | [
[
"numpy.random.randint",
"numpy.dtype"
]
] |
pasqoc/heterocl | [
"bdb87b01cbdf613fe746d25dd949e18cd4942ecf"
] | [
"hlib/python/hlib/ip/fft.py"
] | [
"import heterocl as hcl\nimport numpy as np\nfrom hlib.op.extern import *\n\ndtype = hcl.Int()\n\n@register_extern_ip(vendor=\"xilinx\")\ndef single_fft_hls(X_real, X_imag, F_real=None, F_imag=None, name=None):\n\n if name is None: name = \"hls::fft<config>\"\n L = X_real.shape[0]\n assert X_real.shape == ... | [
[
"numpy.log2",
"numpy.zeros"
]
] |
linu1983/openpilot | [
"15791f1ad00b5f9417e2455dafa3426bfe22095a"
] | [
"selfdrive/controls/lib/latcontrol_indi.py"
] | [
"import math\nimport numpy as np\n\nfrom cereal import log\nfrom common.realtime import DT_CTRL\nfrom common.numpy_fast import clip\nfrom selfdrive.car.toyota.values import SteerLimitParams\nfrom selfdrive.car import apply_toyota_steer_torque_limits\nfrom selfdrive.controls.lib.drive_helpers import get_steer_max\nf... | [
[
"numpy.array",
"numpy.dot"
]
] |
jdheinz/project-ordo_ab_chao | [
"4063f93b297bab43cff6ca64fa5ba103f0c75158"
] | [
"src/django_website/display_graphs/views.py"
] | [
"from django.shortcuts import render\nfrom ebaysdk.finding import Connection as finding\nimport xmltodict\nfrom json import loads, dumps\nimport pandas as pd\nimport numpy as np\nimport datetime\n\nfrom . import outOfSample, neuralNetwork, mLinearRegression\n\n# create empty dataframe within scope of entire file\nc... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.Series"
]
] |
vanatteveldt/dldemo | [
"017982fc756c6047fb6bc8d20e3b6878c76e39b5"
] | [
"demo.py"
] | [
"import logging\n\nimport gensim\nimport numpy as np\nimport pandas as pd\nfrom keras.callbacks import Callback\nfrom keras.layers import Dense, Input, GlobalMaxPooling1D, Conv1D, Embedding\nfrom keras.models import Model\nfrom keras.optimizers import RMSprop\nfrom keras.preprocessing.sequence import pad_sequences\... | [
[
"pandas.read_csv"
]
] |
espinielli/traffic | [
"151b29664d9ea25f720fcfbdc6a01966b53391ff"
] | [
"traffic/data/basic/navaid.py"
] | [
"# flake8: noqa\n\nimport logging\nfrom functools import lru_cache\nfrom pathlib import Path\nfrom typing import Dict, Iterator, Optional\n\nimport pandas as pd\n\nfrom ...core.mixins import GeoDBMixin\nfrom ...core.structure import Navaid, NavaidTuple\n\n__github_url = \"https://raw.githubusercontent.com/\"\nbase_... | [
[
"pandas.read_pickle",
"pandas.DataFrame.from_records"
]
] |
Erotemic/plottool_ibeis | [
"dfa0d627cfd9fd8221dbb73d97dcac1e7ddf216f"
] | [
"plottool_ibeis/interact_annotations.py"
] | [
"\"\"\"\nInteractive tool to draw mask on an image or image-like array.\n\nTODO:\n * need concept of subannotation\n * need to take options on a right click of an annotation\n * add support for arbitrary polygons back in .\n * rename species_list to label_list or category_list\n * Just use metadata i... | [
[
"matplotlib.lines.Line2D",
"numpy.array",
"numpy.isclose",
"numpy.linalg.norm",
"matplotlib.path.Path",
"numpy.sin",
"numpy.argmin",
"numpy.asarray",
"numpy.fabs",
"numpy.random.uniform",
"numpy.arctan2",
"numpy.cos",
"numpy.clip",
"numpy.maximum"
]
] |
thuzhf/Advanced-Machine-Learning | [
"fa79efd16fea34f2b5b95425058b70b546307ed4"
] | [
"de-anonymization/src/mnist_input_data.py"
] | [
"# Copyright 2015 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"numpy.zeros",
"tensorflow.as_dtype",
"tensorflow.gfile.Open",
"tensorflow.gfile.Exists",
"numpy.random.shuffle",
"tensorflow.gfile.GFile",
"numpy.multiply",
"tensorflow.gfile.MakeDirs",
"numpy.arange",
"numpy.frombuffer",
"numpy.dtype"
]
] |
Briggybros/Uni-Deep-Learning | [
"5225130435356f1d7fc4c8bdbb3dcc34f9bef964"
] | [
"Lab_4_gs15687/cifar_augment.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport sys\n\nimport os\nimport os.path\n\nimport tensorflow as tf\n\nsys.path.append(os.path.join(os.path.dirname(__file__), '..', 'labsheets', 'CIFAR10'))\nimport cifar10 as cf\n\nFLAGS = tf.app.flag... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.reshape",
"tensorflow.control_dependencies",
"tensorflow.local_variables_initializer",
"tensorflow.global_variables_initializer",
"tensorflow.argmax",
"tensorflow.Variable",
"tensorflow.global_variables",
"tensorflo... |
eugene87222/kornia | [
"5f9b06b8d64bcd43eebd186ae21d22a1d0165b5e"
] | [
"test/morphology/test_bottom_hat.py"
] | [
"import pytest\nimport torch\nfrom torch.autograd import gradcheck\nfrom torch.testing import assert_allclose\n\nfrom kornia.morphology import bottom_hat\n\n\nclass TestBottomHat:\n def test_smoke(self, device, dtype):\n kernel = torch.rand(3, 3, device=device, dtype=dtype)\n assert kernel is not N... | [
[
"torch.rand",
"torch.autograd.gradcheck",
"torch.ones",
"torch.tensor",
"torch.testing.assert_allclose",
"torch.ones_like",
"torch.jit.script"
]
] |
takuma-ynd/pommerman-network | [
"8dfd5aae65262d0a404ddd75bc130081b6fdb638"
] | [
"pommerman/envs/v0.py"
] | [
"\"\"\"The baseline Pommerman environment.\n\nThis evironment acts as game manager for Pommerman. Further environments,\nsuch as in v1.py, will inherit from this.\n\"\"\"\nimport json\nimport os\n\nimport numpy as np\nimport time\nfrom gym import spaces\nfrom gym.utils import seeding\nimport gym\n\nfrom .. import c... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.ones"
]
] |
woes-lynne/3DRenderPy | [
"44d9106b51ae4ce8307c794b85d4ec649751beb3"
] | [
"src/RenderPy/Canvas.py"
] | [
"import os\nimport numpy as np\nfrom PIL import Image\nfrom RenderPy.Color import Color\n# ---------------------\n\"\"\" \nCanvas class helps to describe a set of pixel in grids that help generate images.\nEach canvas contains 2 elements: weight ,height\nwidth, height are all float value\nwidth: defining the number... | [
[
"numpy.array"
]
] |
shray2k/low_pt_tau_reco | [
"f3a8700b86a6630239fd7516d05977cd50a28b44"
] | [
"model/model.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport uproot\nfrom array import array\n\n#check whether you are using CPUs or GPUs\nfrom tensorflow.python.client import device_lib\nprint('Available devices are', device_lib.list_local_devices())\nprint('#######')\n\ntau_feature_names = [\n b'pi_minus1_pt',\n b'... | [
[
"numpy.array",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Dropout",
"tensorflow.python.client.device_lib.list_local_devices",
"tensorflow.keras.Sequential",
"tensorflow.keras.optimizers.Adam"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.