repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
mahkhaled/class2go | [
"b32cb441e8d96c257f70cb61274812ebeed2649d"
] | [
"main/kelvinator/tasks.py"
] | [
"# Video handling utilities.\n#\n# Two things in this file\n# 1. Kelvinator - simple method of extracting key frames for a video. \n# 2. Resize - simple transcoder to create smaller versions of videos.\n#\n# Requirements:\n# 1. ffmpeg \n# 2. x264 for transcoding\n# 3. Python Imaging: PIL, or Image\n#\n# For more i... | [
[
"numpy.sum",
"numpy.mean",
"numpy.zeros"
]
] |
azkalot1/pytorch-toolbelt | [
"9d7544fa32a6c6588f9f8c4525ba702700ac01cc"
] | [
"pytorch_toolbelt/modules/encoders/densenet.py"
] | [
"from collections import OrderedDict\nfrom typing import List\n\nimport torch\nfrom torch import nn\nfrom torchvision.models import densenet121, densenet161, densenet169, densenet201, DenseNet\n\nfrom .common import EncoderModule, _take, make_n_channel_input\n\n__all__ = [\"DenseNetEncoder\", \"DenseNet121Encoder\"... | [
[
"torch.nn.Sequential",
"torch.nn.AvgPool2d"
]
] |
Ragav-KS/Projectile-Simulator | [
"67b056f900e76dd04312b9b5d762d079a2ee57b5"
] | [
"code/Solver.py"
] | [
"import numpy as np\nimport pandas as pd\n\n\nclass Projectile:\n def __init__(self, dt: float, A: float, B: float, m: float, xi: float, yi: float, vi: float, angle: float,\n g: float) -> None:\n #yapf: disable\n self.dt : float = dt\n self.A : float = A\n ... | [
[
"numpy.array",
"numpy.zeros",
"pandas.DataFrame.from_dict",
"numpy.radians",
"numpy.sqrt"
]
] |
haotongl/PoseRBPF | [
"ecd51a6fa9baffc2e191b5d61940d3e7f68597f3"
] | [
"networks/aae_trainer.py"
] | [
"# Copyright (c) 2020 NVIDIA Corporation. All rights reserved.\n# This work is licensed under the NVIDIA Source Code License - Non-commercial. Full\n# text can be found in LICENSE.md\nfrom __future__ import division\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.init as init\nimport torch... | [
[
"torch.cat",
"matplotlib.pyplot.gcf",
"torch.load",
"torch.sum",
"numpy.concatenate",
"matplotlib.pyplot.savefig",
"torch.randn_like",
"numpy.arange",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.subplot",
"numpy.array",
"matplotlib.pyplot.close",
"torch.cl... |
justinbellucci/DL-image-classifier-app | [
"9f883384e8d4b5603dfd9441c306d30e2b8d72ac"
] | [
"train.py"
] | [
"# PROGRAMMER: Justin Bellucci \n# DATE CREATED: 04_18_2020 \n# REVISED DATE: \n\n# Imports python modules\nimport torch\n# import torch.nn.functional as F\nfrom torch import nn, optim\n# from collections import OrderedDict\nfrom torchvision import models\nfrom workspace_utils impor... | [
[
"torch.nn.NLLLoss",
"torch.no_grad",
"torch.cuda.is_available",
"torch.exp"
]
] |
jonathanfiat/Decoupling-Gating-From-Linearity | [
"e0c6c2de58324b01c02d14edc4aa05668f5a6dd5"
] | [
"networks.py"
] | [
"from functools import partial\n\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch.optim import Adam\n\n\nNON_LINEARITIES = {\n \"none\": lambda x: x,\n \"gate\": lambda x: (torch.sign(x) + 1.) / 2.,\n \"relu\": F.relu,\n \"sign\": torch.sign,\n ... | [
[
"torch.nn.Linear",
"torch.zeros",
"numpy.concatenate",
"numpy.random.permutation",
"torch.no_grad",
"torch.sign",
"numpy.random.randint",
"numpy.sqrt",
"torch.nn.init.calculate_gain",
"torch.pinverse",
"torch.nn.init.xavier_normal_",
"torch.randn",
"torch.gesv"
... |
bubbliiiing/facenet-keras | [
"235f511667958f4471d8007ee9faf26300570f9b"
] | [
"utils/callbacks.py"
] | [
"import os\r\n\r\nimport keras\r\nimport keras.backend as K\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport scipy.signal\r\n\r\nfrom utils.utils_metrics import evaluate\r\n\r\n\r\nclass LossHistory(keras.callbacks.Callback):\r\n def __init__(self, log_dir):\r\n import datetime\r\n ... | [
[
"numpy.array",
"numpy.linalg.norm",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.close",
"numpy.mean",
"... |
xiayule158/ImageClassification | [
"f29a8e8db253c43b94ac3645e29daf6b0ac81351"
] | [
"AlexNetLeakyReLU.py"
] | [
"import os\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom TfUtils import get_data\nfrom LeakyReLU import LeakyReLU\n\nphysical_devices = tf.config.experimental.list_physical_devices('GPU')\ntf.config.experimental.set_visible_devices(physical_devices[1], 'GPU')\nfor gpu in physical_devices[1:2]:\n t... | [
[
"tensorflow.config.experimental.set_visible_devices",
"tensorflow.keras.callbacks.TensorBoard",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",... |
PramuPerera/OCDA | [
"05e6872e74c0de83be45fb4002c103cb85586b4a"
] | [
"dataloader.py"
] | [
"import math\nimport torch\nfrom dataset_file import DatasetFile\nfrom converter import ImageConverter, LabelConverter, FlexibleLabelConverter\n\n\nclass CustomDataloader(object):\n def __init__(self, dataset='mnist.dataset', batch_size=16, fold='train', shuffle=True, last_batch=False, example_count=None, **kwar... | [
[
"torch.FloatTensor",
"torch.LongTensor"
]
] |
affjljoo3581/Samsung-AI-Challenge-for-Scientific-Discovery | [
"717f1d95f9f504fa1e3a463349a373f88acf39ce"
] | [
"utilities/simple_ensemble.py"
] | [
"import argparse\n\nimport pandas as pd\n\nif __name__ == \"__main__\":\n parser = argparse.ArgumentParser()\n parser.add_argument(\"submissions\", nargs=\"+\")\n parser.add_argument(\"output\")\n args = parser.parse_args()\n\n ensembled = [pd.read_csv(name, index_col=\"uid\") for name in args.submis... | [
[
"pandas.read_csv"
]
] |
fatec-noobs/suicide-analysis | [
"ff6e2c653b1e4727d517b1d80222014a89deb3f7"
] | [
"src/services/suicide_ui_service/model.py"
] | [
"from src.services.mortality_data_service.model import MortalityDataService\nimport matplotlib.pyplot as plt\nfrom src.commons import utils\nimport pandas\n\n\nclass SuicideUiService(object):\n\n def __init__(self):\n pandas.set_option('display.max_rows', None)\n pandas.set_option('display.max_colu... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.set_option"
]
] |
lars2309/fletcher | [
"98658fd097c5b8372437d0665916f5b228b5ca93"
] | [
"examples/filter_hls/software/python/filter.py"
] | [
"# Copyright 2018 Delft University of Technology\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 applic... | [
[
"pandas.read_csv"
]
] |
ValentinCalomme/skratch | [
"f234a9b95adfdb20d231d7f8c761ab1098733cb8"
] | [
"source/visualization/linear_regression_classification.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\n\n\nfrom supervised.logistic_regression import LogisticRegression\nfrom supervised.linear_regression import AnalyticalLinearRegression\nfrom utils.preprocessing import add_dummy_feature\n\nseed = 2\nnp.random.seed(seed)\... | [
[
"numpy.zeros",
"numpy.random.seed",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
jackson1895/beautifulday | [
"8efd27e916c8c579c4a9893c69d8847b7c23be18"
] | [
"models/DecoderRNN.py"
] | [
"import random\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .Attention import Attention\n\n\nclass DecoderRNN(nn.Module):\n \"\"\"\n Provides functionality for decoding in a seq2seq framework, with an option for attention.\n Args:\n vocab_size (int): size of the vo... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.Dropout",
"torch.max",
"torch.multinomial",
"torch.LongTensor",
"torch.div",
"torch.nn.init.xavier_normal_",
"torch.exp",
"torch.nn.Embedding"
]
] |
meiyuanqing/MetaThreshold | [
"fbccc7e5356606b929211eedaf5371506232c1b5"
] | [
"RocMeta.py"
] | [
"#!/usr/bin/env python\n# encoding:utf-8\n\"\"\"\nAuthor : Yuanqing Mei\nDate : 2021/4/12\nTime: 15:36\nFile: RocMeta.py\nHomePage : http://github.com/yuanqingmei\nEmail : dg1533019@smail.nju.edu.cn\n\nDeriving supervised method threshold by meta-analysis.\nSupervised methods include: maximizing the AUC value and R... | [
[
"numpy.array",
"pandas.set_option",
"pandas.DataFrame",
"numpy.abs",
"scipy.stats.t.ppf",
"pandas.read_csv",
"scipy.stats.chi2.cdf",
"scipy.stats.norm.cdf"
]
] |
zara-ms/python_class-2 | [
"edd5a4b7a3b3f2759f63208bbf42d5f9e7acb45b"
] | [
"ejer/Dia_9.py"
] | [
"### PANDAS CON DATA.FRAME ###\r\n###Crear Data.frame desde cero\r\nimport pandas as pd\r\nimport numpy as np\r\n\r\npd_DF = pd.DataFrame(np.random.rand(3,2),\r\n columns=['columna_1', 'clumna_2'],\r\n index=['a','b','c'])\r\nprint(pd_DF)\r\n\r\n### Ejercicio 1 con data.frame... | [
[
"numpy.random.choice",
"numpy.random.rand",
"pandas.DataFrame",
"pandas.concat",
"pandas.Series"
]
] |
tmcclintock/ConditionalGMM | [
"c655292be5ec64c3d3942f0a0b7a9d1861450429"
] | [
"ConditionalGMM/UnivariateGMM.py"
] | [
"\"\"\"Helpful functions that can only be computed (easily) for univarate GMMs.\n\"\"\"\nimport numpy as np\nimport scipy as sp\nfrom .condGMM import *\n\nclass UniGMM(object):\n \"\"\"Conditional Gaussian mixture model of a single random variable.\n This class exists to provide helpful routines, such as comp... | [
[
"scipy.stats.norm.pdf",
"numpy.dot",
"numpy.sum",
"numpy.atleast_1d",
"numpy.ndim",
"numpy.sqrt",
"scipy.stats.norm.cdf"
]
] |
a-taniguchi/CSL-BGM | [
"2fc66611928783c9b65c675ec84d9c06e0b6cd8a"
] | [
"For_Simulator/learning/__init__for_action.py"
] | [
"#coding:utf-8\r\n#パラメータ設定ファイル\r\n#Akira Taniguchi 2016/05/31-\r\nimport numpy as np\r\n\r\n####################パラメータ####################\r\nD = 20#8#10 #全データ数\r\nnum_iter = 200 #学習のイテレーション回数\r\n\r\nCNNmode = 0#2 #CNN→PCA(2)・特徴抽出をCNNにする(1)・SIFTにする(0)・DSIFTのBoFにする(-1)\r\n\r\nif CNNmode == 0:\r\n ... | [
[
"numpy.zeros",
"numpy.eye"
]
] |
ardaillon/FCN-f0 | [
"8e60cdcfa4adeb066d06fbc0dc119d3ce44decf8"
] | [
"models/f0_to_target_convertor.py"
] | [
"#! /usr/bin/env python\n\"\"\"\n@author : Luc ardaillon\ncreated : 17/01/2019\nlast revision : 10/04/2019\n\nconversion from the ground truth f0 value to the target vector of pitch classes to be predicted by the models (for training)\n\"\"\"\n\nimport numpy as np\n\ndef freq2cents(f0, f_ref = 10.):\n '''\n C... | [
[
"numpy.zeros",
"matplotlib.pyplot.plot",
"numpy.exp",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.show",
"numpy.linspace",
"numpy.log2"
]
] |
munichpavel/clovek-ne-jezi-se | [
"a9367653ddf0de95eb3c717bbd78f12a60771f9c"
] | [
"clovek_ne_jezi_se/game_state.py"
] | [
"\"\"\"Clovek ne jezi se game board and plays\"\"\"\nfrom math import pi\nfrom typing import Sequence, Union\nimport warnings\n\nimport attr\nimport numpy as np\n\nimport matplotlib.colors as colors\nfrom matplotlib import cm\n\nimport networkx as nx\n\nimport matplotlib.pyplot as plt\n\nfrom .utils import (\n m... | [
[
"numpy.sum",
"matplotlib.colors.to_hex",
"matplotlib.cm.get_cmap",
"matplotlib.pyplot.figure"
]
] |
raulillo82/TFG-Fisica-2021 | [
"8acfd748c7f49ea294606a9c185227927ec2e256"
] | [
"d-j.py"
] | [
"#!/usr/bin/python3\n\n'''\n * Copyright (C) 2021 Raúl Osuna Sánchez-Infante\n *\n * This software may be modified and distributed under the terms\n * of the MIT license. See the LICENSE.txt file for details.\n'''\n\nimport matplotlib as mpl\nmpl.use('TkAgg')\nimport matplotlib.pyplot as plt\nimport qiskit as q\nf... | [
[
"matplotlib.use",
"matplotlib.pyplot.title",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.show"
]
] |
JackDanger/git-of-theseus | [
"16076e0214667257c2660286693d273d24a25a35"
] | [
"git_of_theseus/stack_plot.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# Copyright 2016 Erik Bernhardsson\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... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.savefig",
"numpy.sum",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
WRKampi/scipy | [
"bc7fa1bc6651f7af1f37e3d19e0a58e1f160d346"
] | [
"scipy/stats/stats.py"
] | [
"# Copyright 2002 Gary Strangman. All rights reserved\n# Copyright 2002-2016 The SciPy Developers\n#\n# The original code from Gary Strangman was heavily adapted for\n# use in SciPy by Travis Oliphant. The original code came with the\n# following disclaimer:\n#\n# This software is provided \"as-is\". There are n... | [
[
"numpy.sign",
"numpy.unique",
"numpy.bincount",
"numpy.count_nonzero",
"numpy.empty",
"numpy.log",
"numpy.nonzero",
"numpy.log1p",
"scipy.ndimage.measurements.label",
"numpy.prod",
"numpy.column_stack",
"numpy.diff",
"numpy.float64",
"numpy.iinfo",
"nump... |
ncthuan/viewgrade | [
"c09dab3ad13b5bf2e7437ba3989b8ffa30f1ee0d"
] | [
"viewgrade.py"
] | [
"from pdf2image import convert_from_path, convert_from_bytes\nimport requests\nimport cv2\nimport numpy as np\nimport re\nimport pytesseract\n\n\n# config\nDPI = 200 #-> default img shape 2339x1654, do not change this\nBIN_INV_THRESHOLD = 192\n#\nVERTICAL_FILTER = cv2.getStructuringElement(cv2.MORPH_RECT, (1, 20))... | [
[
"numpy.array",
"numpy.mean"
]
] |
HebatallaTarek/Empathy-Mental-Health | [
"16e2a5f93aabd22803bb39805f8e76c8bea0ccf2"
] | [
"src/models/modeling_utils.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors, Facebook AI Research authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in complianc... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.stack",
"torch.einsum",
"torch.nn.Parameter",
"torch.multinomial",
"torch.load",
"torch.nn.BCEWithLogitsLoss",
"torch.nn.functional.pad",
"torch.nn.CrossEntropyLoss",
"torch.topk",
"torch.nn.LayerNorm",
"torch.gather",
... |
djmhunt/TTpy | [
"0f0997314bf0f54831494b2ef1a64f1bff95c097"
] | [
"fitAlgs/minimize.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\n:Author: Dominic Hunt\r\n\"\"\"\r\nimport logging\r\n\r\nimport numpy as np\r\nimport scipy as sp\r\n\r\nimport itertools\r\n\r\nfrom fitAlgs.fitAlg import FitAlg\r\n\r\n\r\nclass Minimize(FitAlg):\r\n\r\n \"\"\"The class for fitting data using scipy.optimise.minimize\r\n\r\... | [
[
"numpy.nanargmin",
"numpy.around",
"scipy.optimize.minimize"
]
] |
hirasaki1985/Oreilly_deepLearning | [
"378b60ccec67dc616669fcd65ad14c7eddae6767"
] | [
"aiserver/console_backpro_net.py"
] | [
"import sys, os\nsys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定\nimport numpy as np\nfrom dataset.mnist import load_mnist\nfrom controller import Controller\n\n# データの読み込み\n(x_train, t_train), (x_test, t_test) = load_mnist(normalize=True, one_hot_label=True)\n\n# instance\ncontroller = Controller()\n\n# acc... | [
[
"numpy.argmax",
"numpy.zeros"
]
] |
qiyanz/neuropod | [
"13c2bc794b168583588b68269026ec4ed76163ed"
] | [
"source/python/neuropod/backends/tensorflow/packager.py"
] | [
"# Copyright (c) 2020 UATC, 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 agree... | [
[
"tensorflow.io.write_graph"
]
] |
SCH227/Playingwithmaths | [
"f70d3c97212667a6270d4d2875253fbc176266c8"
] | [
"1.Integrals_Gammas/1.Integrals_Gammas.py"
] | [
"import scipy.special as sc\r\nfrom scipy import integrate\r\nfrom numpy import exp\r\n\r\nyp = 40\r\nyc = 50\r\nalpha = 0.2\r\nbeta = 1\r\nt = 7\r\ndelta_y = 1.4\r\n\r\nshape = alpha*t\r\ngamma_shape = sc.gamma(shape)\r\ngamma_shape_1 = sc.gamma(shape-1)\r\ngammainc_yp = sc.gammaincc(shape-1, yp)*gamma_shape_1 # ... | [
[
"scipy.integrate.simps",
"scipy.special.gamma",
"numpy.exp",
"scipy.special.gammaincc",
"scipy.integrate.quad"
]
] |
zpapakipos/vidgear | [
"99ffcecf3ad55cfe84eb866d4a3ec9a6641eb7c1"
] | [
"vidgear/tests/test_helper.py"
] | [
"\"\"\"\r\n===============================================\r\nvidgear library source-code is deployed under the Apache 2.0 License:\r\n\r\nCopyright (c) 2019 Abhishek Thakur(@abhiTronix) <abhi.una12@gmail.com>\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file exce... | [
[
"numpy.zeros"
]
] |
andipeng/decision-transformer | [
"0672dc711cfac4494e751245c2694468e455ebf4"
] | [
"gym/decision_transformer/utils/visualize_policy.py"
] | [
"import gym\nimport click \nimport os\nimport gym\nimport numpy as np\nimport pickle\nimport torch\nimport skvideo.io\n\nimport mj_envs\nfrom mjrl.utils.gym_env import GymEnv\nfrom decision_transformer.evaluation.evaluate_episodes import evaluate_episode_rtg\nfrom decision_transformer.models.decision_transformer im... | [
[
"numpy.concatenate",
"torch.device",
"numpy.array",
"torch.no_grad",
"numpy.mean",
"numpy.std"
]
] |
LukasLuehrs/scikit-activeml | [
"04d7107272ef0438070808475599131d8726f547"
] | [
"skactiveml/utils/tests/test_label.py"
] | [
"import unittest\n\nimport numpy as np\n\nfrom skactiveml.utils import (\n is_labeled,\n is_unlabeled,\n labeled_indices,\n unlabeled_indices,\n check_missing_label,\n check_equal_missing_label,\n)\n\n\nclass TestLabel(unittest.TestCase):\n def setUp(self):\n self.y1 = [np.nan, 2, 5, 10,... | [
[
"numpy.array",
"numpy.testing.assert_array_equal"
]
] |
ffdsfdsf123/ffdsfdsf123 | [
"f55a71c710b7a5469380bfca614bf150212ead79"
] | [
"search/OneShot.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nDEVICE = torch.device('cuda')\n\n\nclass Selection(nn.Module):\n def __init__(self, in_channels, reduction, save_device=torch.device('cpu')):\n super(Selection, self).__init__()\n self.save_device = save_device\n\n self... | [
[
"torch.nn.Linear",
"torch.device",
"torch.cat",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.functional.log_softmax",
"torch.ones",
"torch.nn.Conv2d",
"torch.nn.functional.relu",
"torch.nn.functional.pad"
]
] |
daleroberts/opendatacube-pixeldrill | [
"ec03d3423bb6bc7df50bbebc0b714bd5ba8b5945"
] | [
"pixeldrill.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nInteractive Pixel Drill for AGDCv2.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport matplotlib; matplotlib.use('TkAgg')\n\nimport matplotlib.pyplot as plt\nimpo... | [
[
"matplotlib.use",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.rcParams.get",
"numpy.isnan",
"numpy.nanmax",
"pandas.DataFrame",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.backends.backend_tkagg.NavigationToolbar2TkAgg.__init__",
"matplotl... |
vpreston/jetyak-parsing | [
"2f2ac14a7030962f15aae9272641f623e8ab5412"
] | [
"examples/falkor_uncertainty.py"
] | [
"#!/usr/env/python3\n\n'''\nScript which reads in Falkor mission data and estimates the extraction efficiency of the\ngas sensor based on data readings.\n\nMaintainer: vpreston-at-{whoi, mit}-dot-edu\n'''\n\nimport numpy as np\nfrom parseyak import jetyak\nimport utm\nfrom gasex import airsea\nfrom gasex.diff impor... | [
[
"numpy.array",
"numpy.nanpercentile",
"numpy.nanmin",
"numpy.nanstd",
"numpy.nanmean",
"numpy.sqrt",
"numpy.abs",
"numpy.nanmax",
"numpy.nanmedian",
"numpy.floor"
]
] |
ibeneklins/qiskiteers_h2 | [
"ed989ae074f19f8ff5153d92bc2eed3453c80fad"
] | [
"scripts/sim_noisy_measfilt_layout_opt.py"
] | [
"import numpy as np\nfrom qiskit.circuit import QuantumCircuit\nfrom qiskit.circuit import Parameter\nfrom evaluator import Evaluator\nfrom pauli_string import PauliString\nfrom evaluator import BasicEvaluator\nfrom qiskit import Aer, execute\nfrom hamiltonian import MolecularFermionicHamiltonian\nfrom mapping impo... | [
[
"numpy.load",
"numpy.zeros",
"scipy.optimize.minimize"
]
] |
xiaohanhaowei/cpm | [
"1d6e1df7b38d28ba71e90a401b07faf882d1319d"
] | [
"utils/utils.py"
] | [
"import cv2\nimport numpy as np\nimport math\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n# from OpenGL.GL import *\n# from OpenGL.GLU import *\n\n\ndef make_gaussian(size, fwhm=3, center=None):\n \"\"\" Make a square gaussian kernel.\n size is the length of a side of the square\... | [
[
"numpy.max",
"numpy.concatenate",
"numpy.pad",
"numpy.zeros",
"numpy.percentile",
"numpy.ones",
"numpy.min",
"numpy.exp",
"numpy.arange",
"numpy.argmax",
"numpy.amax",
"numpy.clip",
"numpy.squeeze"
]
] |
jakebrinkmann/lagoon-vampire-bat | [
"799050568741f5aa22f36d3b5be8dbee935e5926"
] | [
"espa_validation/validate_data/image_io.py"
] | [
"\"\"\"image_io.py\n\nPurpose: contains functions to read image data and extract metadata.\n\"\"\"\nimport numpy as np\nimport logging\n\ntry:\n from osgeo import gdal\nexcept ImportError:\n import gdal\n\n\nclass RasterIO:\n @staticmethod\n def open_raster(i):\n \"\"\"Open raster as GDAL object\... | [
[
"numpy.ma.masked_where"
]
] |
CodeProcessor/DeepLab-Training-Pipeline | [
"e6ae556c252703817142828ba28ea51e8cce60e7"
] | [
"deeplab/modelv2.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\" Deeplabv3+ model for Keras.\nThis model is based on TF repo:\nhttps://github.com/tensorflow/models/tree/master/research/deeplab\nOn Pascal VOC, original model gets to 84.56% mIOU\nMobileNetv2 backbone is based on this repo:\nhttps://github.com/JonathanCMitchell/mobilenet_v2_keras\... | [
[
"tensorflow.keras.layers.Add",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.backend.int_shape",
"tensorflow... |
Amritds/StackGAN | [
"e977de26b97a6fc3f0e51f1721a5cfa867bf0665"
] | [
"code/miscc/datasets.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\n\nimport torch.utils.data as data\nfrom PIL import Image\nimport PIL\nimport os\nimport os.path\nimport pickle\nimport random\nimport numpy as np\nimport pandas... | [
[
"numpy.array",
"numpy.minimum",
"numpy.arange",
"pandas.read_csv",
"numpy.maximum"
]
] |
chie2727/ivy | [
"338d75402f7025b22310c2abc23408b1ff376652"
] | [
"ivy_tests/test_ivy/test_functional/test_core/test_elementwise.py"
] | [
"\"\"\"Collection of tests for elementwise functions.\"\"\"\n\n# global\nimport numpy as np\nfrom hypothesis import given, assume, strategies as st\nfrom numbers import Number\n\n# local\nimport ivy\nimport ivy_tests.test_ivy.helpers as helpers\nimport ivy.functional.backends.numpy as ivy_np\n\n\n# abs\n@given(\n ... | [
[
"numpy.random.randint",
"numpy.asarray"
]
] |
Shea192/RepPointsV2 | [
"afbc4b5c2887d5f1c2f7445b2cb9bfeaaf57320c"
] | [
"mmdet/models/dense_heads/reppoints_v2_not_share_head.py"
] | [
"from functools import partial\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import ConvModule, bias_init_with_prob, normal_init\n\nfrom mmdet.core import (PointGenerator, build_assigner, build_sampler,\n images_to_levels, multi_app... | [
[
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.ModuleList"
]
] |
JoeyYoung/sound_localization | [
"1ee171e01b51a8f91f506d9ca2662b068b738961"
] | [
"main_ssl/ssl_map.py"
] | [
"\"\"\"\n hard-encoded corresponding 2D map of CYC 4th floor\n\"\"\"\n\nimport math\nimport numpy as np\nfrom ssl_setup import STEP_SIZE\n\n\nclass Map:\n def __init__(self):\n # start position\n # mass center of the walker\n self.walker_pos_x = None\n self.walker_pos_z = None\n\n ... | [
[
"numpy.abs"
]
] |
GyChou/ray_elegant_carla | [
"16de9f297e24b564ec19d9cf3e9293450ac78cdd"
] | [
"gym_carla_feature/start_env/env_2.py"
] | [
"import time\nimport gym\nfrom gym import spaces\nfrom gym.utils import seeding\nimport numpy as np\nimport carla\nimport pygame\nimport random\nimport math\nfrom skimage.transform import resize\nfrom collections import deque\nfrom gym_carla_feature.start_env.render import BirdeyeRender\nfrom gym_carla_feature.star... | [
[
"numpy.rot90",
"numpy.dot",
"numpy.mean",
"numpy.histogramdd",
"numpy.cos",
"numpy.dtype",
"numpy.concatenate",
"numpy.random.normal",
"numpy.sin",
"numpy.linalg.norm",
"numpy.nan_to_num",
"numpy.arange",
"numpy.sqrt",
"numpy.cross",
"numpy.expand_dims",... |
nikitautiu/deephtml | [
"9ef580132feefd862246e8bc1f594329ddd742b0"
] | [
"learnhtml/model_selection.py"
] | [
"import re\n\nimport dask.dataframe as dd\nimport numpy as np\nimport pandas as pd\nfrom scipy import stats\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.feature_selection impo... | [
[
"sklearn.model_selection.RandomizedSearchCV",
"numpy.geomspace",
"pandas.concat",
"sklearn.svm.LinearSVC",
"pandas.DataFrame",
"numpy.arange",
"sklearn.preprocessing.LabelBinarizer",
"numpy.zeros",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.model_selection.GroupKFo... |
ryan-hunt-122/gym-anm-rltraining | [
"249400357fde2e63659fca8a5122b57590bf323c"
] | [
"gym_anm/tests/simulator/test_simulator_basics.py"
] | [
"import unittest\nimport numpy as np\nimport numpy.testing as npt\n\nfrom gym_anm_custom.simulator import Simulator\nfrom tests.base_test import BaseTest\n\n\nclass TestSimulator(BaseTest):\n def setUp(self):\n self.baseMVA = 10\n\n network = {\n 'baseMVA': self.baseMVA,\n 'bu... | [
[
"numpy.array",
"numpy.testing.assert_equal",
"numpy.exp",
"numpy.random.uniform",
"numpy.conj",
"numpy.abs"
]
] |
idealab-isu/NURBSDiff | [
"d5f6eaec42552e06b8dae60522c363163d8e84f3"
] | [
"examples/NURBSSurfaceFitting.py"
] | [
"import torch\nimport numpy as np\ntorch.manual_seed(120)\nfrom tqdm import tqdm\nfrom pytorch3d.loss import chamfer_distance\nfrom NURBSDiff.surf_eval import SurfEval\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib import cm\nfrom geomdl import exchange\nfrom geomdl.visua... | [
[
"numpy.concatenate",
"torch.rand",
"numpy.array",
"torch.cat",
"numpy.reshape",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"torch.manual_seed",
"matplotlib.pyplot.rc",
"torch.cuda.empty_cache",
"torch.ones",
"matplotlib.... |
fasiha/docrepr | [
"3daa439bead4f7c82e9af472665f55efc9c12b49"
] | [
"docrepr/sphinxext/plot_directive.py"
] | [
"\"\"\"\nA directive for including a matplotlib plot in a Sphinx document.\n\nBy default, in HTML output, `plot` will include a .png file with a\nlink to a high-res .png and .pdf. In LaTeX output, it will include a\n.pdf.\n\nThe source code for the plot may be included in one of three ways:\n\n 1. **A path to a s... | [
[
"matplotlib.use",
"matplotlib.pyplot.close",
"matplotlib.cbook.mkdirs",
"matplotlib.rc_file_defaults",
"matplotlib.rcParams.update",
"matplotlib._pylab_helpers.Gcf.get_all_fig_managers"
]
] |
wendy-xiaozong/rUnet | [
"26b773353e58981e4ce3284f7a51476541d0dfec",
"26b773353e58981e4ce3284f7a51476541d0dfec"
] | [
"project/lig_module/lig_model/lig_model.py",
"project/utils/helpful_files/save_DTI_2_2Dslices.py"
] | [
"from argparse import ArgumentParser\nfrom typing import Any, Dict, Tuple, List\nfrom pathlib import Path\nimport os\n\nimport numpy as np\nimport pytorch_lightning as pl\nimport torch\nfrom skimage.metrics import peak_signal_noise_ratio as psnr\nfrom skimage.metrics import structural_similarity as ssim\nfrom skima... | [
[
"torch.nn.MSELoss",
"numpy.zeros",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"numpy.ones",
"numpy.min",
"numpy.mean",
"torch.nn.L1Loss",
"torch.nn.SmoothL1Loss",
"numpy.savez",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"numpy.clip",
"numpy.squeeze",
"num... |
boubakerwa/transformers | [
"8ed998f6456a60999d6f9a8a6b0094ab2da7473d"
] | [
"src/transformers/trainer.py"
] | [
"# coding=utf-8\n# Copyright 2020-present the HuggingFace Inc. team.\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# Unles... | [
[
"torch.cat",
"torch.cuda.amp.autocast",
"torch.Generator",
"torch.cuda.random.set_rng_state",
"torch.random.get_rng_state",
"torch.cuda.random.set_rng_state_all",
"torch.cuda.is_available",
"torch.load",
"torch.cuda.random.get_rng_state_all",
"torch.nn.DataParallel",
"n... |
stkaplan/legion | [
"ad82a1c1f39ed20a16df29aa331428d42c0ecfb6"
] | [
"bindings/python/examples/region_fields.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright 2020 Stanford University\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless req... | [
[
"numpy.all",
"numpy.add"
]
] |
rsanimesh/pandas-profiling | [
"e67e61c4bc56f69547e12509c1a0784fd74d89cb"
] | [
"pandas_profiling/model/messages.py"
] | [
"\"\"\"Logic for alerting the user on possibly problematic patterns in the data (e.g. high number of zeros , constant\nvalues, high correlations).\"\"\"\nfrom enum import Enum, unique\nfrom typing import List\n\nimport numpy as np\n\nfrom pandas_profiling.config import config\nfrom pandas_profiling.model.base impor... | [
[
"numpy.isnan"
]
] |
SpaceView/Yolact_EfficientNet | [
"efd63e9898f0a050eb3a63bcf03b2202c79631ba"
] | [
"data/config.py"
] | [
"from backbone import EfficientNetBackbone, ResNetBackbone, VGGBackbone, ResNetBackboneGN, DarkNetBackbone\nfrom math import sqrt\nimport torch\n\n# for making bounding boxes pretty\nCOLORS = ((244, 67, 54),\n (233, 30, 99),\n (156, 39, 176),\n (103, 58, 183),\n ( 63, 81, ... | [
[
"torch.nn.functional.relu",
"torch.nn.functional.softmax"
]
] |
newstarjones/spark | [
"d03999ab8846d4897d2ce95ca21a7feed45f292b"
] | [
"python/pyspark/pandas/groupby.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.api.types.is_list_like",
"pandas.api.types.is_hashable",
"pandas.DataFrame",
"pandas.core.common._builtin_table.get",
"pandas.Series"
]
] |
nutte2/highway-env-kalle | [
"6ce58bc01f1d7e56d5d6fefafae64009aee27eaa"
] | [
"highway_env/envs/parking_env.py"
] | [
"from typing import Tuple\n\nfrom gym.envs.registration import register\nfrom gym import GoalEnv\nimport numpy as np\nfrom numpy.core._multiarray_umath import ndarray\n\nfrom highway_env.envs.common.abstract import AbstractEnv\nfrom highway_env.envs.common.observation import MultiAgentObservation\nfrom highway_env.... | [
[
"numpy.deg2rad",
"numpy.array",
"numpy.abs"
]
] |
Cutecodes/anime_faces_gan | [
"8f26b966980a8cb8e03d264f7424fb77a0cb1227"
] | [
"generate.py"
] | [
"import os\r\n\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport torch\r\nimport torchvision\r\nfrom DCGAN import *\r\nimport pickle\r\n\r\n\r\n\r\ndef generate():\r\n G = Generator()\r\n G.load_state_dict(torch.load('./Gmodel.pth'))\r\n ginputdata = Variable(torch.randn((50,1,100)))\r\n ... | [
[
"numpy.transpose",
"matplotlib.pyplot.pause",
"torch.load",
"torch.randn",
"matplotlib.pyplot.subplot"
]
] |
ycarissan/ims3d.py | [
"efe92698ef55fd43e7ff1d6252ab072fc9fb12e2"
] | [
"geometry/geometry.py"
] | [
"import sys\nimport random\nimport pickle\nfrom tqdm import tqdm\n\ntry :\n import numpy as np\nexcept ModuleNotFoundError as error:\n numpy = None\n print(\"numpy module not found\")\n\ntry :\n import scipy.spatial.transform\nexcept ModuleNotFoundError as error:\n scipy = None\n print(\"scipy mod... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"numpy.asarray",
"numpy.arctan2",
"numpy.hypot",
"numpy.append",
"numpy.cross"
]
] |
hkchengrex/semseg | [
"809f03b39ab88c8f37a9c95a2fa7ab1a3026aab0"
] | [
"model/pspnet.py"
] | [
"import torch\nfrom torch import nn\nimport torch.nn.functional as F\n\nimport model.resnet as models\n\n\nclass PPM(nn.Module):\n def __init__(self, in_dim, reduction_dim, bins, BatchNorm):\n super(PPM, self).__init__()\n self.features = []\n for bin in bins:\n self.features.appe... | [
[
"torch.rand",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.Sequential",
"torch.nn.functional.interpolate",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Dropout2d",
"torch.nn.CrossEntropyLoss",
"torch.hub.load"
]
] |
ultrons/fairseq-old | [
"6952b53dda670bc02ff6bbfad6815c1c406698b7"
] | [
"fairseq/models/transformer.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\nimport math\nfrom typing import Any, Dict, List, Optional, Tuple\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional ... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.ModuleList",
"torch.nn.init.constant_",
"torch.nn.functional.dropout",
"torch.FloatTensor",
"torch.nn.init.xavier_uniform_",
"torch.nn.init.normal_",
"torch.empty",
"torch.Tensor",
"torch.nn.Embedding"
]
] |
ilaine/histwords | [
"31e4d200310ebd4051776828eccb8b60c2120427"
] | [
"representations/ppmigen.py"
] | [
"import numpy as np\nimport ioutils as util\nfrom argparse import ArgumentParser\n\nfrom representations.representation_factory import create_representation\nfrom scipy.sparse import coo_matrix\n\ndef make_ppmi_mat(old_mat, row_probs, col_probs, smooth, neg=1, normalize=False):\n prob_norm = old_mat.sum() + (old... | [
[
"scipy.sparse.coo_matrix",
"numpy.get_include",
"numpy.power",
"numpy.log"
]
] |
nismod/east-africa-transport | [
"f847f7d52a3d9f21892470d89e4d0d5073b06f31"
] | [
"scripts/exposure/hazard_layers.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\"\"\"Parse hazard layer metadata from path/filenames\n\"\"\"\nimport re\nimport pandas\nimport os\nimport json\n\ndef load_config():\n \"\"\"Read config.json\"\"\"\n config_path = os.path.join(os.path.dirname(__file__),\"..\",\"..\",\"config.json\")\n with open(con... | [
[
"pandas.read_csv"
]
] |
Flow-Records-for-the-21st-Century/FlowPrint | [
"4b67d1b223ef17ee4097f743454f7ea4e932e8ff"
] | [
"flowprint/preprocessor.py"
] | [
"import numpy\nimport numpy as np\nimport pickle\nimport sys\n\ntry:\n from .flow_generator import FlowGenerator\n from .reader import Reader\nexcept:\n try:\n from flow_generator import FlowGenerator\n from reader import Reader\n except Exception as e:\n raise ValueError(e)\n\nclas... | [
[
"numpy.concatenate",
"numpy.array"
]
] |
AdamHillier/tensorflow | [
"6780ebf4858a56fd0745f03fa5a61b249559f3cd"
] | [
"tensorflow/python/keras/layers/preprocessing/discretization.py"
] | [
"# Copyright 2019 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.array_ops.identity",
"numpy.sort",
"tensorflow.python.keras.engine.base_preprocessing_layer.keras_kpl_gauge.get_cell",
"tensorflow.python.framework.sparse_tensor.SparseTensorSpec",
"numpy.concatenate",
"tensorflow.python.ops.math_ops.cast",
"tensorflow.python.uti... |
yupbank/model-analysis | [
"53382828a7b4ada012e03b8282f014311df988fc",
"53382828a7b4ada012e03b8282f014311df988fc",
"53382828a7b4ada012e03b8282f014311df988fc"
] | [
"tensorflow_model_analysis/eval_saved_model/example_trainers/util.py",
"tensorflow_model_analysis/eval_saved_model/util.py",
"tensorflow_model_analysis/post_export_metrics/post_export_metrics_test.py"
] | [
"# Copyright 2018 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.feature_column.categorical_column_with_identity",
"tensorflow.parse_example",
"tensorflow.feature_column.numeric_column",
"tensorflow.feature_column.categorical_column_with_vocabulary_list",
"tensorflow.sparse_tensor_to_dense",
"tensorflow.core.example.example_pb2.Example",
... |
martinlarsalbert/wPCC | [
"16e0d4cc850d503247916c9f5bd9f0ddb07f8930"
] | [
"src/visualization/plot.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n\ndef plot(\n dataframes: dict,\n subplot=True,\n fig_size=(10, 10),\n styles: list = None,\n keys: list = None,\n):\n\n if keys is None:\n keys = set()\n for label, df in dataframes.items():\n ke... | [
[
"numpy.array",
"numpy.matrix",
"numpy.ceil",
"numpy.sin",
"numpy.zeros",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tight_layout",
"numpy.arctan2",
"numpy.cos",
"numpy.floor"
]
] |
UoA-eResearch/magenta | [
"e5649300f711982c91cdaa327ea4fe1ce756138a"
] | [
"magenta/models/score2perf/score2perf.py"
] | [
"# Copyright 2021 The Magenta 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 by applicable law o... | [
[
"tensorflow.compat.v1.reshape",
"tensorflow.compat.v1.VarLenFeature",
"tensorflow.compat.v1.data.Dataset.from_tensor_slices",
"tensorflow.compat.v1.stack",
"tensorflow.compat.v1.shape",
"tensorflow.compat.v1.expand_dims",
"tensorflow.compat.v1.mod",
"tensorflow.compat.v1.random_uni... |
cmbTea/Covid-19-analysis | [
"84fe62d70c1deabda0267c129708575763d5408a"
] | [
"src/CovidClassSnippet.py"
] | [
"import math\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nimport pandas as pd\nimport os\nimport time\nfrom datetime import timedelta, date\nfrom CovidCases import CovidCases\nfrom CovidCasesECDC import CovidCasesECDC\nfrom CovidCasesOWID import CovidCasesOWID\nfrom... | [
[
"matplotlib.pyplot.show",
"matplotlib.ticker.PercentFormatter",
"matplotlib.ticker.StrMethodFormatter"
]
] |
anukaal/fedjax | [
"75ab7679369f64281d197b66e29543cb90fffbee"
] | [
"fedjax/training/federated_experiment_test.py"
] | [
"# Copyright 2021 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 ... | [
[
"numpy.array"
]
] |
marcbadger/avian-mesh | [
"71a884153e8970de6ee1d934949914790e40e80e"
] | [
"optimization/base_renderer.py"
] | [
"import numpy as np\nimport torch\n\nfrom pytorch3d.structures import Meshes\nfrom pytorch3d.renderer import (\n OpenGLPerspectiveCameras, SoftSilhouetteShader,\n RasterizationSettings, MeshRenderer, MeshRasterizer, BlendParams\n)\n\nclass base_renderer():\n def __init__(self, size, focal=None, fov=None, d... | [
[
"torch.zeros",
"numpy.arctan",
"torch.tensor",
"numpy.log"
]
] |
DH-O/UPDeT | [
"5c73feef31bebed59b0a35873a7133f319ec868b"
] | [
"src/modules/agents/updet_agent.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\nimport torch\nimport argparse\n\n\nclass UPDeT(nn.Module):\n def __init__(self, input_shape, args):\n super(UPDeT, self).__init__()\n self.args = args\n self.transformer = Transformer(args.token_dim, args.emb, args.heads, args.depth, a... | [
[
"torch.nn.Linear",
"torch.rand",
"torch.cat",
"torch.nn.LayerNorm",
"torch.nn.Dropout",
"torch.zeros",
"torch.triu_indices",
"torch.stack",
"torch.nn.Sequential",
"torch.bmm",
"torch.nn.ReLU",
"torch.nn.functional.softmax",
"torch.mean"
]
] |
alekospj/MongoDB_communication | [
"b805b182b80d010deaf033db710a0423cad69b64"
] | [
"src/app.py"
] | [
"\n\n# Dash & Plotly\nimport dash\nfrom dash import html\nfrom dash import dcc\nimport dash_bootstrap_components as dbc\nfrom dash.dependencies import Input, Output, State\nfrom dash.exceptions import PreventUpdate\nimport plotly.express as px\n\n#Python\nimport os\n\n#Others\nimport base64\nimport pandas as pd\n\n... | [
[
"pandas.read_csv"
]
] |
ZiJianZhao/attention-is-all-you-need-pytorch | [
"b4edb1457ececc7a7f3d1f0011b37829a1da5eaa"
] | [
"DataLoader.py"
] | [
"''' Data Loader class for training iteration '''\nimport random\nimport numpy as np\nimport torch\nfrom torch.autograd import Variable\nimport transformer.Constants as Constants\n\nclass DataLoader(object):\n ''' For data iteration '''\n\n def __init__(\n self, src_word2idx, tgt_word2idx,\n ... | [
[
"torch.LongTensor"
]
] |
s-cork/BIO | [
"7f3b3e1e7b47da5ea5f96569836946c4d28277fe"
] | [
"2001/Q2.py"
] | [
"import numpy as np\nfrom string import ascii_uppercase \n\ndef removeDuplicates(word):\n newword = ''\n for letter in word:\n if letter not in newword:\n newword += letter\n return newword\n\n\ndef grid(word, reverse = False):\n ''' expects a word\n returns a nu... | [
[
"numpy.array",
"numpy.argwhere"
]
] |
alejandronotario/case_study_AN | [
"c8668a6d095d109af1b709a88a642da8ce615c2b"
] | [
"code/simulator_method2.py"
] | [
"#!/usr/bin/env python\n\n#title :predictions simulator\n#description :KNN model building to predict the frequency of claims a customer’s going to make with the company\n#author :Alejandro Notario\n#date :2019-11-07\n#version :\n#usage :sim... | [
[
"sklearn.metrics.confusion_matrix",
"sklearn.preprocessing.StandardScaler",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"pandas.to_numeric",
"pandas.get_dummies"
]
] |
ariahosseini/Thermoelectric | [
"c83d89d872c7c5855c4ec31ce6663589d057cbeb",
"c83d89d872c7c5855c4ec31ce6663589d057cbeb"
] | [
"build/lib/ThermoElectric/accum.py",
"build/lib/ThermoElectric/tests/test_tau_screened_coulomb.py"
] | [
"from itertools import product\nimport numpy as np\n\n\ndef accum(accmap, a, func=None, size=None, fill_value=0, dtype=None):\n\n \"\"\"\n An accumulation function similar to Matlab's `accumarray` function.\n\n Parameters\n ----------\n accmap : ndarray\n This is the \"accumulation map\". It ... | [
[
"numpy.expand_dims",
"numpy.atleast_1d",
"numpy.empty",
"numpy.apply_over_axes"
],
[
"numpy.array"
]
] |
pfnet/chainerchem | [
"efe323aa21f63a815130d673781e7cca1ccb72d2"
] | [
"tests/dataset_tests/splitters_tests/test_scaffold_splitter.py"
] | [
"import numpy\nimport pandas\nimport pytest\n\nfrom chainer_chemistry.dataset.parsers.data_frame_parser import DataFrameParser # NOQA\nfrom chainer_chemistry.dataset.preprocessors import AtomicNumberPreprocessor\nfrom chainer_chemistry.dataset.splitters.scaffold_splitter import generate_scaffold # NOQA\nfrom chai... | [
[
"numpy.array_equal",
"numpy.random.rand"
]
] |
MattBixley/Histology | [
"159655dc55d7959dadefbd2f5a490b8a03034ffb"
] | [
"scripts/keras-regression-cnns/pyimagesearch/models.py"
] | [
"# import the necessary packages\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import BatchNormalization\nfrom tensorflow.keras.layers import Conv2D\nfrom tensorflow.keras.layers import MaxPooling2D\nfrom tensorflow.keras.layers import Activation\nfrom tensorflow.keras.layers import ... | [
[
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.MaxPooling2D",
... |
e-rus/bumps | [
"080ff80f939f3edf54a1fdc425e3f333d42ee8c4",
"080ff80f939f3edf54a1fdc425e3f333d42ee8c4"
] | [
"doc/examples/test_functions/model.py",
"bumps/lsqerror.py"
] | [
"\"\"\"\n\nSurjanovic, S. & Bingham, D. (2013).\nVirtual Library of Simulation Experiments: Test Functions and Datasets.\nRetrieved April 18, 2016, from http://www.sfu.ca/~ssurjano.\n\"\"\"\nfrom __future__ import print_function\n\nfrom functools import reduce, wraps\nimport inspect\n\nfrom numpy import sin, cos, l... | [
[
"numpy.sin",
"scipy.special.gammaln",
"numpy.log",
"numpy.log1p",
"numpy.sqrt",
"numpy.cos",
"numpy.linspace",
"numpy.meshgrid"
],
[
"numpy.array",
"numpy.dot",
"numpy.empty",
"numpy.asarray",
"numpy.ones",
"numpy.finfo",
"numpy.diag",
"numpy.tri... |
FabianAltekrueger/WPPNets | [
"7c051285a96357526abbc14348b5f777312e42d5"
] | [
"model/ops.py"
] | [
"# This code is adapted from \n#\n# C. Tian, Y. Xu, W. Zuo, C.-W. Lin, and D. Zhang. \n# Asymmetric cnn for image superresolution. \n# IEEE Transactions on Systems, Man, and Cybernetics: Systems, 2021.\n# \n# which is available at https://github.com/hellloxiaotian/ACNet/blob/master/x4/model/ops.py\n#\n# The only mo... | [
[
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.nn.PixelShuffle",
"torch.nn.Conv2d",
"torch.eye",
"torch.nn.functional.relu",
"torch.Tensor"
]
] |
noahcao/TransTrack | [
"93d6d711db64b06d2974f8a410c9630514bf8db3"
] | [
"datasets/mot.py"
] | [
"# Modified by Peize Sun, Rufeng Zhang\n# ------------------------------------------------------------------------\n# Modified from DETR (https://github.com/facebookresearch/detr)\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n# -------------------------------------------------------------... | [
[
"torch.zeros",
"torch.as_tensor",
"torch.stack",
"torch.tensor"
]
] |
carhaas/nematus | [
"879b43d0b034f45cba4b62446b880df566f27029"
] | [
"nematus/test_cl_objectives.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Unit test for various counterfactual objectives\"\"\"\n\nfrom nmt import train\n\nimport os\nimport unittest\nimport shutil\nimport logging\nimport numpy\n\nNEMATUS = os.path.abspath(os.path.join(__file__, \"../..\"))\nDATA_DIR = NEMATUS + \"/data_unittest/\"\n... | [
[
"numpy.testing.assert_almost_equal",
"numpy.array",
"numpy.zeros"
]
] |
satyamedh/craftassist | [
"d97cbc14bc25149d3ef41737231ab9f3cb7e392a"
] | [
"python/craftassist/voxel_models/geoscorer.py"
] | [
"\"\"\"\nCopyright (c) Facebook, Inc. and its affiliates.\n\"\"\"\n\nimport logging\nimport sys\nimport os\nimport torch\n\nVOXEL_MODELS_DIR = os.path.dirname(os.path.realpath(__file__))\nCRAFTASSIST_DIR = os.path.join(VOXEL_MODELS_DIR, \"../\")\nGEOSCORER_DIR = os.path.join(VOXEL_MODELS_DIR, \"geoscorer/\")\nsys.p... | [
[
"torch.from_numpy"
]
] |
SachinVarghese/alibi | [
"5f86dfce30ae420194ae27e94a4e25b57f0971ff"
] | [
"alibi/explainers/tests/test_anchor_image.py"
] | [
"# flake8: noqa E731\n\nimport keras\nfrom keras.layers import Conv2D, Dense, Dropout, Flatten, MaxPooling2D, Input\nfrom keras.models import Model\nfrom keras.utils import to_categorical\nimport numpy as np\nfrom alibi.explainers import AnchorImage\n\n\ndef test_anchor_image():\n # load and prepare fashion MNIS... | [
[
"numpy.reshape",
"numpy.unique",
"numpy.zeros"
]
] |
EduardoAlm/SeisPolPy | [
"1033d61d56cab963be68ab0a0bcc19bedb8fbfc2"
] | [
"SeisPolPy/tests/test_flinn.py"
] | [
"from SeisPolPy import Flinn, Pinnegar, Rstfr, Vidale\nimport mat4py\nimport numpy as np\nimport base64\nimport io\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\n\ndata = mat4py.loadmat('SeisPolPy/tests/dataACRG.mat') # seismic data\nsig = np.array([data['t'], data['r'], data['z']])\n\ndef test... | [
[
"numpy.array"
]
] |
ceci3/PaddleDetection | [
"df6cfd8db092335464a20654e051dce5235319f4"
] | [
"slim/quantization/compress.py"
] | [
"# Copyright (c) 2019 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.array"
]
] |
sewald101/measureyes | [
"715176b565f95c46afb4d8242a6c8daf884520f8"
] | [
"src/raspberry/app/measure_persons.py"
] | [
"\"\"\"Run webcam to detect persons and log data in a csv file\n\nSource: This code was modified from code provided by PyImageSearch.\n\nUSAGE\n>>> python measure_persons.py -p MobileNetSSD_deploy.prototxt.txt -m MobileNetSSD_deploy.caffemodel\n\npress 'q' to quit\n\"\"\"\n\n# import the necessary packages\nfrom im... | [
[
"numpy.array",
"numpy.arange"
]
] |
VidhiTuteja/greyatom-python-for-data-science | [
"a50ceef4efad0603a9c305d8abf63be54f5df062"
] | [
"Visualization-for-Company-Stakeholders/code.py"
] | [
"# --------------\n#Importing header files\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\n#Reading the file\ndata=pd.read_csv(path)\n\n#Code starts here\n\n# Step 1 \n#Reading the file\n\n\n#Creating a new variable to store the value counts\nloan_status=data['Loan_Status'].value_coun... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xticks"
]
] |
matosjr/keras2c | [
"6787b9c485b1499cad21f981b64c0842c5362337"
] | [
"keras2c/layer2c.py"
] | [
"\"\"\"layer2c.py\nThis file is part of keras2c\nCopyright 2020 Rory Conlin\nLicensed under MIT License\nhttps://github.com/f0uriest/keras2c\n\nWrites individual layers to C code\n\"\"\"\n\n# imports\nfrom keras2c.io_parsing import layer_type, get_model_io_names, get_all_io_names, get_layer_io_names, flatten\nimpor... | [
[
"tensorflow.compat.v1.disable_eager_execution"
]
] |
Naassila/bioptim | [
"511e7ba315de5ca8c3bdcc85decd43bac30676b9"
] | [
"examples/getting_started/custom_initial_guess.py"
] | [
"\"\"\"\nThis example is a trivial box that must superimpose one of its corner to a marker at the beginning of the movement\nand superimpose the same corner to a different marker at the end.\nIt is designed to investigate the different way to define the initial guesses at each node sent to the solver\n\nAll the typ... | [
[
"numpy.random.random",
"numpy.array"
]
] |
joekelley120/PyTorchTimeSeries | [
"642630fec313018a7ab96199a2ae40946aecbf1d"
] | [
"Example/InputOutput/narx/run_narx_servomotor.py"
] | [
"from Helper.InputOutput.narx_helper_methods import *\nfrom Model.InputOutput.narx_model import NARX\nfrom sklearn.preprocessing import MinMaxScaler\n\n\nCURRENT_TIME = time.strftime(\"%Y%m%d_%H%M%S\")\nNARX_SAVE_LOC = 'train/servomotor/'\nNARX_LOAD_LOC = NARX_SAVE_LOC + 'narx_td15_n10'\nNARX_LOAD_DATA = 'narx_mode... | [
[
"sklearn.preprocessing.MinMaxScaler"
]
] |
nachiket92/PGP | [
"9c98885a845cacf3f73277a8e8c1e5f5fe03467c"
] | [
"models/aggregators/global_attention.py"
] | [
"import torch\nimport torch.nn as nn\nfrom models.aggregators.aggregator import PredictionAggregator\nfrom typing import Dict, Tuple\n\n\nclass GlobalAttention(PredictionAggregator):\n \"\"\"\n Aggregate context encoding using scaled dot product attention. Query obtained using target agent encoding,\n Keys... | [
[
"torch.nn.Linear",
"torch.nn.MultiheadAttention",
"torch.cat"
]
] |
Pandinosaurus/PyTorch-StudioGAN | [
"bebb33f612759b86a224392f6fe941d0cc81d3c4"
] | [
"src/metrics/prdc_trained.py"
] | [
"# PyTorch StudioGAN: https://github.com/POSTECH-CVLab/PyTorch-StudioGAN\n# The MIT License (MIT)\n# See license file or visit https://github.com/POSTECH-CVLab/PyTorch-StudioGAN for details\n\n# src/metrics/prdc_trained.py\n\nfrom tqdm import tqdm\nimport math\n\nimport torch\nimport numpy as np\n\nimport prdc\nimp... | [
[
"numpy.array"
]
] |
idobenshaul10/UnSupRAFT | [
"ed5444fbfece906e6a00eff09f49cb7ca9f4bf25"
] | [
"core/raft.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom update import BasicUpdateBlock, SmallUpdateBlock\nfrom extractor import BasicEncoder, SmallEncoder\nfrom corr import CorrBlock, AlternateCorrBlock\nfrom utils.utils import bilinear_sampler, coords_grid, upflow8\nfrom u... | [
[
"torch.nn.functional.unfold",
"torch.cat",
"torch.relu",
"torch.arange",
"torch.tanh",
"torch.nn.functional.interpolate",
"torch.split",
"torch.FloatTensor",
"torch.softmax",
"torch.nn.functional.grid_sample",
"torch.transpose",
"torch.sum"
]
] |
yangsenwxy/mil | [
"8e6b6f0b55bddc961b957a682935cb346f3bca4c"
] | [
"mil/models/bag_level/tests/test_deep_attention.py"
] | [
"import unittest\r\nimport numpy as np\r\n\r\nfrom mil.models import AttentionDeepPoolingMil\r\nfrom mil.utils.padding import Padding\r\n\r\nclass TestAttentionDeepPoolingMil(unittest.TestCase):\r\n def setUp(self): \r\n self.training_bag = np.random.normal(0, 1, (30, 3, 28, 28, 1))\r\n self... | [
[
"numpy.random.normal",
"numpy.zeros"
]
] |
dongyingname/DeepKE | [
"e5511bdad739a36cabd8439faebfceee22aebccb"
] | [
"tools/main.py"
] | [
"import os\nimport hydra\nimport torch\nimport logging\nimport torch.nn as nn\nfrom torch import optim\nfrom hydra import utils\nimport matplotlib.pyplot as plt\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard import SummaryWriter\n# self\nimport sys\n\nsys.path.append(os.path.abspath(os.path.... | [
[
"torch.device",
"torch.utils.tensorboard.SummaryWriter",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"torch.cuda.is_available",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"matplotlib.pyplot.show",
"torch.nn.CrossEntropyLoss"
]
] |
rongpu/desitarget | [
"5b8b8d75a1f556e190a6a88b7219f5ad41bf186e"
] | [
"py/desitarget/skyfibers.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n# -*- coding: utf-8 -*-\n\"\"\"\n====================\ndesitarget.skyfibers\n====================\n\nModule to assign sky fibers at the pixel-level for target selection\n\"\"\"\nimport os\nimport sys\nimport numpy as np\nimport fitsio\nfrom astropy.w... | [
[
"numpy.exp",
"numpy.where",
"numpy.radians",
"scipy.ndimage.measurements.center_of_mass",
"numpy.concatenate",
"numpy.max",
"numpy.zeros_like",
"numpy.unravel_index",
"numpy.arange",
"numpy.argmax",
"numpy.sqrt",
"numpy.vstack",
"numpy.array",
"numpy.zeros",... |
StevenLOL/mne-python | [
"2d31028f857b1b4de05d5098c4534a725b0323c2"
] | [
"mne/io/edf/tests/test_edf.py"
] | [
"# -*- coding: utf-8 -*-\n# Authors: Teon Brooks <teon.brooks@gmail.com>\n# Martin Billinger <martin.billinger@tugraz.at>\n# Alan Leggitt <alan.leggitt@ucsf.edu>\n# Alexandre Barachant <alexandre.barachant@gmail.com>\n# Stefan Appelhoff <stefan.appelhoff@mailbox.org>\n# ... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.round",
"numpy.testing.assert_array_equal",
"scipy.io.loadmat",
"numpy.testing.assert_array_almost_equal",
"numpy.column_stack"
]
] |
qingswu/mmdetection | [
"321eb30034602085821b710108fb4ce4323f69f9",
"321eb30034602085821b710108fb4ce4323f69f9"
] | [
"mmdet/core/post_processing/merge_augs.py",
"mmdet/models/roi_heads/grid_roi_head.py"
] | [
"import copy\nimport warnings\n\nimport numpy as np\nimport torch\nfrom mmcv import ConfigDict\nfrom mmcv.ops import nms\n\nfrom ..bbox import bbox_mapping_back\n\n\ndef merge_aug_proposals(aug_proposals, img_metas, cfg):\n \"\"\"Merge augmented proposals (multiscale, flip, etc.)\n\n Args:\n aug_propos... | [
[
"numpy.array",
"torch.cat",
"torch.stack",
"numpy.mean"
],
[
"torch.cat",
"torch.randperm",
"numpy.zeros"
]
] |
ankile/reinforcement-trading | [
"849ba30d8be05abf1e9eae919463c4eebe812ce8"
] | [
"lib/validation.py"
] | [
"# Adapted from code from the book \"Deep Reinforcement Learning\" by Maxim Lapan\n\nimport numpy as np\nimport torch\nfrom lib import environ\n\n\ndef validation_run(env, net, episodes=100, device=\"cpu\", epsilon=0.02, comission=0.1):\n stats = {\n \"episode_reward\": [],\n \"episode_steps\": [],... | [
[
"numpy.random.random",
"torch.tensor",
"numpy.mean"
]
] |
ivineetm007/drunk-detection | [
"82cc01a745dd78181744f914710a403bf32c7af0"
] | [
"3D_CNN_and_variants/models/5. Loop One/test.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torchvision import models\nfrom torch.utils.data import DataLoader\nfrom model import *\n\nimport csv \n\nfrom torchvision import transforms, utils\nimport pandas as pd\n\nimport cv2\n\nfrom torch.utils.data import Dataset\n\n\nclass VideoDataset(Dataset):\n \"\"\"Datas... | [
[
"torch.FloatTensor",
"torch.no_grad",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load",
"pandas.read_csv"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.