repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
lmycross/segmentation | [
"9b1f4bfba4c2933d87c49313234da6cfce1d8ad5",
"9b1f4bfba4c2933d87c49313234da6cfce1d8ad5"
] | [
"train/camvid/traindeeplab_vgg.py",
"eval/cityscapes/testlinknet.py"
] | [
"import sys\nsys.path.append('../../')\nfrom datasets.camvid_loader import Loaddata, class_weight, mean, std, MaskToTensor\nimport torch.optim as optim\nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\nimport models.deeplab_vggmode... | [
[
"numpy.sum",
"torch.nn.functional.log_softmax",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.load",
"torch.Tensor",
"torch.nn.NLLLoss2d"
],
[
"torch.load"
]
] |
Starrynightzyq/Drone_Vehicle_Flow_Detection | [
"9b0cf297138423de6add91b5dc3ceef221c3a355"
] | [
"serving-yolov3/yolov3_api.py"
] | [
"# Api调用demo,还是用到了内置函数\nimport cv2\nfrom matplotlib import pyplot as plt\nimport utils as utils\nimport numpy as np\nimport requests\nimport json\nfrom PIL import Image\n\ndef object_detect(input_path=\"./road.jpg\", output_path='./demo.jpg'):\n img_size = 608\n num_channels = 3\n # image_path = \"./docs/i... | [
[
"numpy.array",
"numpy.reshape",
"numpy.copy",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow"
]
] |
xryanglab/RiboCode | [
"f04f73153a486cbb53899327a28afeb0c7faf5db"
] | [
"RiboCode/detectORF.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom builtins import str, zip, map, range\n# -*- coding:UTF-8 -*-\n__author__ = 'Zhengtao Xiao'\n\nfrom .test_func import wilcoxon_greater,combine_pvals\nfrom .prepare_transcripts ... | [
[
"numpy.array",
"numpy.flatnonzero"
]
] |
anhdang000/mmdetection | [
"2eb9435270b8aab57e94a35142a9d62453f4e3e8"
] | [
"mmdet/apis/train.py"
] | [
"import random\nimport warnings\n\nimport numpy as np\nimport torch\nfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallel\nfrom mmcv.runner import (HOOKS, DistSamplerSeedHook, EpochBasedRunner,\n Fp16OptimizerHook, OptimizerHook, build_optimizer,\n buil... | [
[
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.manual_seed_all",
"torch.cuda.current_device"
]
] |
NNDEV1/SatelliteTipDetection | [
"8565017db70a7277c0e22ae00c352de44ee760e6"
] | [
"yolov3/loss.py"
] | [
"import random\nimport torch\nimport torch.nn as nn\n\nfrom utils import intersection_over_union\n\n\nclass YoloLoss(nn.Module):\n def __init__(self):\n super().__init__()\n self.mse = nn.MSELoss()\n self.bce = nn.BCEWithLogitsLoss()\n self.entropy = nn.CrossEntropyLoss()\n sel... | [
[
"torch.nn.MSELoss",
"torch.nn.Sigmoid",
"torch.nn.BCEWithLogitsLoss",
"torch.log",
"torch.exp",
"torch.nn.CrossEntropyLoss"
]
] |
akhipg/nlpMiniproject | [
"6d19febed27bcbbfd085f06513a681ff1d73acd0"
] | [
"chat.py"
] | [
"import random\nimport json\n\nimport torch\n\nfrom model import NeuralNet\nfrom nltk_utils import bag_of_words, tokenize\n\ndevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n\nwith open('intents.json', 'r') as json_data:\n intents = json.load(json_data)\n\nFILE = \"data.pth\"\ndata = torch.... | [
[
"torch.max",
"torch.softmax",
"torch.from_numpy",
"torch.cuda.is_available",
"torch.load"
]
] |
TomWildenhain-Microsoft/keras-onnx | [
"383e431583d9a67da67d5a01f401b9f4df26ae4a"
] | [
"applications/nightly_build/test_mask_rcnn.py"
] | [
"# SPDX-License-Identifier: Apache-2.0\n\nimport os\nimport sys\nimport unittest\nimport keras2onnx\nfrom keras2onnx import set_converter\nfrom keras2onnx.proto import keras\nimport onnx\nimport numpy as np\nfrom os.path import dirname, abspath\nsys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../tes... | [
[
"numpy.allclose",
"numpy.broadcast_to"
]
] |
weagle08/gdal | [
"906ba1e1cbab0cde121d0b9cd5dfa007d518f741"
] | [
"autotest/gdrivers/netcdf.py"
] | [
"#!/usr/bin/env pytest\n# -*- coding: utf-8 -*-\n###############################################################################\n# $Id$\n#\n# Project: GDAL/OGR Test Suite\n# Purpose: Test NetCDF driver support.\n# Author: Frank Warmerdam <warmerdam@pobox.com>\n#\n###############################################... | [
[
"numpy.arange"
]
] |
lewlin/scanpy | [
"59c2475909eaafe7d6d59ae0d52e1faf79db12d1"
] | [
"scanpy/plotting/tools/paga.py"
] | [
"import os\nimport numpy as np\nimport pandas as pd\nimport scipy\nimport warnings\nfrom pandas.api.types import is_categorical_dtype\nimport networkx as nx\nfrom matplotlib import pyplot as pl\nfrom matplotlib.colors import is_color_like\nfrom matplotlib import rcParams, ticker\nfrom collections import Iterable\n\... | [
[
"scipy.sparse.csgraph.connected_components",
"numpy.median",
"numpy.min",
"numpy.mean",
"matplotlib.pyplot.gcf",
"numpy.random.random",
"matplotlib.ticker.FuncFormatter",
"pandas.api.types.is_categorical_dtype",
"numpy.bincount",
"numpy.max",
"matplotlib.pyplot.colorbar... |
Chanakya-School-of-AI/pytorch-tutorials | [
"8745db96172c45f6b07a589a88905a00cc555010"
] | [
"pytorch-hooks/pytorch_hooks_example.py"
] | [
"# author: Vipul Vaibhaw\n# Use this code for educational purpose.\n\nimport torch\n\n# we will start with a simple example \n# let's learn to register hooks\n\nx = torch.randn(1,1)\nw = torch.randn(1,1, requires_grad=True) # necessary to enable requires_grad because hooks work on gradients\n\nw.register_hook(lambd... | [
[
"torch.randn"
]
] |
saikrishnarallabandi/interspeech-2020-papers | [
"8da635757c02c09abf90c4423749a5f44cad65f4"
] | [
"audio_search/wave_rnn.py"
] | [
"import math, pickle, os\nos.environ['CUDA_VISIBLE_DEVICES'] = '1'\nimport numpy as np\nimport torch\nfrom torch.autograd import Variable\nfrom torch import optim\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset, DataLoader\nfrom utils import *\nimport sys\nimport nocond... | [
[
"torch.nn.MaxPool1d",
"torch.load"
]
] |
dwiajik/twit-macet-mining-v2 | [
"6a612fb8549921b83aced1039f1d9a3ba500a2cf"
] | [
"modules/classifier.py"
] | [
"import time\n\nimport nltk\nfrom sklearn.svm import LinearSVC\n\nclass SvmClassifier:\n def __init__(self, training_set):\n start_time = time.time()\n self.svm_classifier = nltk.classify.SklearnClassifier(LinearSVC()).train(training_set)\n self.training_time = round(time.time() - start_time... | [
[
"sklearn.svm.LinearSVC"
]
] |
Alex-Fun/distracted_driver_detection | [
"aaec8316934acbbccd9eae66adaa1970adea4fed"
] | [
"convert_dataset.py"
] | [
"#!/usr/bin/env python3\nimport logging\nimport os\n\nimport cv2\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\n# from vgg import vgg_16\n\n# from object_detection.utils import dataset_util\n\n\nflags = tf.app.flags\nflags.DEFINE_string('data_dir', '', 'Root directory to raw pet dataset.')\nflag... | [
[
"numpy.array",
"tensorflow.train.BytesList",
"tensorflow.train.Int64List",
"tensorflow.train.Features",
"numpy.zeros",
"tensorflow.python_io.TFRecordWriter",
"tensorflow.app.run",
"pandas.read_csv"
]
] |
zbs881314/Self-Driving-Car- | [
"4e18a410b1ad6c542c72c7ee68f0a4042f45f9d3"
] | [
"kalman filter/assignment4-sol.py"
] | [
"import numpy as np\nfrom sim.sim2d_prediction import sim_run\n\n# Simulator options.\noptions = {}\noptions['FIG_SIZE'] = [8,8]\noptions['ALLOW_SPEEDING'] = False # could change to True, make speed up\n\nclass KalmanFilter:\n def __init__(self):\n # Initial State\n self.x = np.matrix([[55.],\n ... | [
[
"numpy.matrix",
"numpy.copy",
"numpy.transpose",
"numpy.linalg.inv"
]
] |
AlgoveraAI/creations | [
"6aa1cfffb4a59b7ff9fd9573ed743195be5bcfdc"
] | [
"apps/ocean-marketplace/app.py"
] | [
"import gradio as gr\nfrom ocean_lib.config import Config\n# from ocean_lib.models.btoken import BToken #BToken is ERC20\nfrom ocean_lib.ocean.ocean import Ocean\nfrom ocean_lib.web3_internal.wallet import Wallet\n# from ocean_lib.web3_internal.currency import from_wei # wei is the smallest denomination of ether e.... | [
[
"matplotlib.pyplot.text",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
mekmarriott/GeneRegressionNet | [
"1372ad36a8fc38f13adcaa41ac54229cdfcd5e08"
] | [
"dnn_test.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport argparse\nfrom models.linear import TFLinearModel\nfrom models.dnn import TFDNNModel\nimport training_utils\nimport visualization_utils\n\nCANCERS = ['gbm', 'luad', 'lusc']\nALPHAS = {'gbm': 0.3, 'luad': 0.085, 'lusc': 0.15}\nDATA_DIR = 'data/patient' # switch to... | [
[
"numpy.random.seed",
"tensorflow.set_random_seed",
"numpy.load",
"numpy.mean"
]
] |
MitchelPaulin/LotteryTicketHypothesis | [
"e2856138d8daf91411b7dd5843f7d49dc4ffac6e"
] | [
"src/Experiments/LT_TabularBase/TabularLearner.py"
] | [
"from fastai import *\nfrom fastai.tabular import *\nfrom fastai.tabular.all import *\nimport torch\nimport torch.nn.utils.prune\nimport random\n\n\ndef _LT_find_linear(layers):\n # find linear in layer\n linear = None\n for l in layers:\n if isinstance(l, torch.nn.Linear):\n ... | [
[
"torch.nn.utils.prune.l1_unstructured",
"torch.FloatTensor",
"torch.cat"
]
] |
jpafcampos/CamVid-Image-Segmentation-using-FCN-ResNet50-with-PyTorch | [
"4e05fe3499949913c11ebbdc202b37386cf9fc19"
] | [
"vit.py"
] | [
"import os.path as osp\nimport copy\nimport torch\nfrom torch import einsum\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import models\nfrom torchvision.models.vgg import VGG\nfrom torchvision.models.utils import load_state_dict_from_url\nimport numpy as np\... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.LayerNorm",
"torch.nn.Identity",
"torch.nn.ModuleList",
"torch.nn.Softmax",
"torch.einsum",
"torch.nn.GELU",
"torch.randn"
]
] |
NehaTelhan/CompVisionFinalProj | [
"abb32bdb25b6ec603ce8232ad09533d9e5d3eb67"
] | [
"Submission/text_extractor.py"
] | [
"# Import some libraries\nimport numpy\nimport skimage.io, skimage.transform, pylab, skimage.color\n\nfrom window_divider import divide_picture_to_windows\nfrom train_neural_network import neural_network_predict, load_cnn_model\nfrom segmentation import run_segmentation\nfrom color_histogram import color_histogram\... | [
[
"numpy.zeros"
]
] |
weronikazak/Handy-Trash-Classifier | [
"f4259d5de5e1a63580e661539bb8ca98579514e1"
] | [
"python/keras2lite.py"
] | [
"import tensorflow.lite as lite\nfrom tensorflow.keras.models import load_model\nimport tensorflow as tf\n\ndef convert():\n\tkeras_model = load_model(\"models/garbage.h5\")\n\ttflite_name = \"models/garbage_lite.tflite\"\n\n\tconverter = lite.TFLiteConverter.from_keras_model(keras_model)\n\tconverter.post_training... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.io.gfile.GFile",
"tensorflow.lite.TFLiteConverter.from_keras_model"
]
] |
HashmatShadab/AdvDrop | [
"b81df3b31a99933d428602307fdb8057f8535fcc"
] | [
"decompression.py"
] | [
"# Standard libraries\nimport itertools\nimport numpy as np\n# PyTorch\nimport torch\nimport torch.nn as nn\n# Local\nimport utils\n\ndef dequantize(image, q_table):\n \"\"\"[summary]\n TODO: Add discription\n Args:\n image ([type]): [description]\n q_table ([type]): [description]\n\n Retu... | [
[
"numpy.array",
"numpy.ceil",
"numpy.zeros",
"torch.from_numpy",
"torch.cuda.is_available",
"torch.tensor",
"numpy.cos",
"numpy.sqrt",
"numpy.outer",
"torch.tensordot"
]
] |
P-Song/HYDRA | [
"b91b3decc622a5b95742dc477988cf8844d1c5c2"
] | [
"HYDRA_Step2/MRF_FullNL_ResCNN_T1T2_L1000_Train.py"
] | [
"\n# coding: utf-8\n\n'''\n\nThe software is for the paper \"HYDRA: Hybrid deep magnetic resonance fingerprinting\". The source codes are freely available for research and study purposes.\n\nPurpose: \n Magnetic resonance fingerprinting (MRF) methods typically rely on dictionary matching to map the temporal MRF ... | [
[
"numpy.set_printoptions",
"sklearn.preprocessing.normalize",
"numpy.sort",
"numpy.concatenate",
"matplotlib.pyplot.savefig",
"tensorflow.ConfigProto",
"numpy.transpose",
"numpy.expand_dims",
"matplotlib.pyplot.title",
"tensorflow.Session",
"numpy.real",
"matplotlib.... |
NNDEV1/CV2Stuff | [
"fc31a51cdd816e313351f0d83ffb0c7339e73ef3"
] | [
"cv2/find_colors.py"
] | [
"import cv2\nimport numpy as np\n\nframeWidth = 640\nframeHeight = 480\ncap = cv2.VideoCapture(0)\ncap.set(3, frameWidth)\ncap.set(4, frameHeight)\ncap.set(10, 150)\n\ndef empty(a):\n pass\n\ncv2.namedWindow(\"TrackBars\")\ncv2.resizeWindow(\"TrackBars\",640,240)\ncv2.createTrackbar(\"Hue Min\",\"TrackBars\",0,17... | [
[
"numpy.hstack",
"numpy.array"
]
] |
fabinsch/fast_human_pose | [
"d2c4d625729f4bec7fd6c1b445cb4c92571ef666"
] | [
"fast_predict.py"
] | [
"import argparse\nimport configparser\nimport os\nimport queue\nimport threading\nimport time\nimport logging\nlogger = logging.getLogger(__name__)\nlogging.basicConfig(level=logging.INFO)\nimport chainercv.transforms as transforms\nimport sys\n\nimport chainer\nimport cv2\nimport numpy as np\nfrom PIL import Image... | [
[
"numpy.moveaxis"
]
] |
MJafarMashhadi/keras-glove | [
"43ce3a262a517e2c7aed04f1726bc7ea049fd031"
] | [
"app/save_utils.py"
] | [
"import pickle\n\nfrom keras.models import Model\nfrom keras.preprocessing.text import Tokenizer\nfrom sklearn.metrics.pairwise import cosine_similarity\nimport numpy as np\n\nfrom app.config import *\n\n\ndef save_model(model: Model, tokenizer: Tokenizer):\n \"\"\"\n Saves the important parts of the model\n ... | [
[
"numpy.load",
"numpy.save",
"sklearn.metrics.pairwise.cosine_similarity"
]
] |
kazuto1011/svm-pytorch | [
"0209ad09bc6739d6dca9abb096c8bcc5783fa5f0"
] | [
"main.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n#\n# Author: Kazuto Nakashima\n# URL: https://github.com/kazuto1011\n# Created: 2017-08-16\n\nimport argparse\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom sklearn.datasets.samples_gener... | [
[
"torch.nn.Linear",
"matplotlib.pyplot.contourf",
"torch.FloatTensor",
"torch.randperm",
"torch.clamp",
"matplotlib.pyplot.figure",
"numpy.where",
"torch.cuda.is_available",
"matplotlib.pyplot.show",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.scatter",
"num... |
rorsgo/combined-pvalues | [
"4e7073ca3966fa8cb18379c5a52aef88a166ab2c"
] | [
"cpv/_common.py"
] | [
"from __future__ import print_function\nimport toolshed as ts\nimport threading\ntry:\n from itertools import tee, izip\nexcept ImportError:\n from itertools import tee\n izip = zip\n basestring = str\n long = int\n\nimport signal\nimport sys\n\ndef get_col_nums(c):\n \"\"\"\n >>> get_col_nums(... | [
[
"numpy.median",
"scipy.stats.chi2.ppf",
"numpy.asarray",
"scipy.stats.chi2.cdf"
]
] |
anthonylzh555/CV_project | [
"96517cd654c5e7f467fad306936e4ad01be64ea2"
] | [
"GestRecg/GestRecg.py"
] | [
"import cv2\nimport numpy as np\nfrom pynput.mouse import Button, Controller\nimport wx\n\nmouse = Controller()\napp = wx.App(False)\nsx,sy = wx.GetDisplaySize()\n(camx, camy) = (400,300)\n\n\"\"\"\n#RED\nlowerBound = np.array([0,80,40])\nupperBound = np.array([25,255,255])\n\"\"\"\n\"\"\"\n#YELLOW\nlowerBound = np... | [
[
"numpy.array",
"numpy.ones"
]
] |
Jammy2211/PyAutoArray | [
"1fb9c84ca2a3333abedfbf96d070fc355e2628e4"
] | [
"test_autoarray/inversion/linear_eqn/test_imaging.py"
] | [
"import autoarray as aa\r\nfrom autoarray.dataset.imaging import WTildeImaging\r\nfrom autoarray.inversion.linear_eqn.imaging import LinearEqnImagingWTilde\r\n\r\nfrom autoarray.mock.mock import MockConvolver, MockLinearEqnImaging, MockMapper\r\n\r\nfrom autoarray import exc\r\n\r\nimport numpy as np\r\nfrom os imp... | [
[
"numpy.array",
"numpy.ones"
]
] |
bradyrx/xarray | [
"db36c5c0cdee2f5313a81fdeca8a8ae5491d1c8f"
] | [
"xarray/core/dataset.py"
] | [
"import copy\nimport functools\nimport sys\nimport warnings\nfrom collections import defaultdict\nfrom html import escape\nfrom numbers import Number\nfrom pathlib import Path\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Callable,\n DefaultDict,\n Dict,\n Hashable,\n Iterable,\n Iterator,... | [
[
"pandas.Index",
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"numpy.datetime_data",
"pandas.Categorical",
"numpy.prod",
"numpy.arange",
"pandas.MultiIndex.from_product",
"pandas.MultiIndex",
"numpy.issubdtype"
]
] |
pveinante/PROJ2 | [
"10a14e7f28f8ecbdcdf40aed217b33819e063c48"
] | [
"Nabil/Tests SeamlessClone/face_swapping.py"
] | [
"import cv2\nimport numpy as np\nimport dlib\nimport time\n\n# Initialisation\nimg = cv2.imread(\"paul.jpg\")\nimg2 = cv2.imread(\"antonin.jpg\")\nheight, width, channels = img2.shape\nimg2_new_face = np.zeros((height, width, channels), np.uint8)\nimg_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\nmask = np.zeros_li... | [
[
"numpy.array",
"numpy.zeros_like",
"numpy.float32",
"numpy.zeros"
]
] |
BorgwardtLab/TOGL | [
"d0c986cf829ca6bbae1a23e5cdab1c99146503cd"
] | [
"topognn/layers.py"
] | [
"\"\"\"Implementation of layers following Benchmarking GNNs paper.\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch_geometric.nn import GCNConv, GINConv, GATConv\n#from torch_geometric.nn.conv import ResGatedGraphConv\nfrom torch_scatter import scatter\nfrom torch_persistent_h... | [
[
"torch.zeros",
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.Identity",
"torch.stack",
"torch.cat",
"torch.arange",
"torch.rand",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d",
"torch.nn.functional.relu",
"torch.Tensor"
]
] |
GewelsJI/Hybrid-E-loss | [
"3a3218e0388dd8106da529e36c20f2177fad735b",
"3a3218e0388dd8106da529e36c20f2177fad735b"
] | [
"scripts/SINet/training.py",
"scripts/SCRN/lib/ResNet_models.py"
] | [
"import os\nimport torch\nimport torch.nn.functional as F\nimport numpy as np\nfrom datetime import datetime\nfrom torchvision.utils import make_grid\nfrom scripts.SINet.lib.SINet import SINet_ResNet50\nfrom utils.data_RGB import get_loader, test_dataset\nfrom utils.utils import clip_gradient, adjust_lr\nfrom tenso... | [
[
"numpy.asarray",
"torch.nn.functional.upsample",
"torch.no_grad",
"torch.tensor",
"torch.load",
"numpy.abs"
],
[
"torch.cat",
"torch.nn.functional.upsample",
"torch.nn.BatchNorm2d",
"torch.nn.Upsample",
"torch.nn.Conv2d"
]
] |
jordancaraballo/xrasterlib | [
"b559caf18ed3e12128ce4f8c9fb75e4f12df950e"
] | [
"terragpu/ai/deep_learning/loss.py"
] | [
"import logging\nimport numpy as np\nfrom tensorflow.keras import backend as K\nimport tensorflow as tf\n\n__author__ = \"Jordan A Caraballo-Vega, Science Data Processing Branch\"\n__email__ = \"jordan.a.caraballo-vega@nasa.gov\"\n__status__ = \"Production\"\n\n# ----------------------------------------------------... | [
[
"tensorflow.keras.backend.stack",
"tensorflow.keras.backend.flatten",
"tensorflow.ones_like",
"tensorflow.zeros_like",
"tensorflow.keras.backend.shape",
"tensorflow.divide",
"tensorflow.keras.backend.sum",
"tensorflow.subtract",
"tensorflow.add",
"tensorflow.keras.backend.n... |
digits/tfx-addons | [
"df5dbe307a50988f31a6477775348213dd5d1886"
] | [
"tfx_addons/message_exit_handler/message_providers/logging_provider_test.py"
] | [
"# Copyright 2022 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 requir... | [
[
"tensorflow.test.main"
]
] |
voletiv/DeepLearningImplementations | [
"22ec85cdc7daa308ff2bec81962ca77e5959a70b"
] | [
"WassersteinGAN/src/utils/data_utils.py"
] | [
"import cv2\nimport glob\nimport h5py\nimport imageio\nimport matplotlib.pylab as plt\nimport matplotlib.gridspec as gridspec\nimport numpy as np\nimport os\n\nfrom scipy import stats\nfrom keras.datasets import mnist, cifar10\nfrom keras.optimizers import Adam, SGD, RMSprop\nfrom keras.preprocessing.image import I... | [
[
"numpy.random.choice",
"matplotlib.pylab.savefig",
"matplotlib.pylab.show",
"numpy.cos",
"numpy.gradient",
"numpy.concatenate",
"numpy.random.normal",
"numpy.sin",
"numpy.max",
"matplotlib.pylab.close",
"numpy.eye",
"numpy.arange",
"matplotlib.pylab.title",
... |
serafim-costa/LDP_Protocols | [
"da4ceb81577d190f88fd57fd2a3224ff0462b30b"
] | [
"post-process/norm_mul.py"
] | [
"import numpy as np\nfrom processor.processor import Processor\n\n\nclass NormMul(Processor):\n def calibrate(self, est_dist):\n estimates = np.copy(est_dist)\n estimates[estimates < 0] = 0\n total = sum(estimates)\n n = sum(self.users.REAL_DIST)\n return estimates * n / total\... | [
[
"numpy.copy"
]
] |
JohnBurden/safelife | [
"338c9c42aa94fed49f6d80151c37dd28ba6f7978"
] | [
"benchmarkAnalysis.py"
] | [
"import json\nimport math\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef getDictRewards(dict):\n\treturn dict['reward']\n\ndef getDictPossRewards(dict):\n\treturn dict['reward_possible']\n\ndef getSideEffectScore(dict):\n\tsideEffectDict = dict['side_effects']\n\t#print(sideEffectDict)\n\tamount,total ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure"
]
] |
jessvb/speech-utils | [
"894277660649196b8c60476b7613b3e297de007c"
] | [
"pitch_utils.py"
] | [
"import parselmouth\nfrom IPython.display import Audio\nfrom parselmouth.praat import call\nimport numpy as np\nimport random\n\ndef increase_pitch(factor, infile, outfile):\n sound = parselmouth.Sound(infile)\n Audio(data=sound.values, rate=sound.sampling_frequency)\n manipulation = call(sound, \"To Manip... | [
[
"numpy.sqrt",
"numpy.mean"
]
] |
lebronyxm/PaddleBoxAcp | [
"7c666f06068f9688821e944bfe4cc9b44815be8c"
] | [
"python/paddle/fluid/contrib/layers/nn.py"
] | [
"# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.random.randint",
"numpy.zeros"
]
] |
vhn0912/Finance | [
"4f6c5ea8f60fb0dc3b965ffb9628df83c2ecef35"
] | [
"Find_Stocks/rsi_values.py"
] | [
"import requests\nimport datetime\nimport talib\nfrom pandas_datareader import DataReader\nimport pickle \nimport bs4 as bs \nimport time \nimport pandas as pd\nimport progressbar\nfrom pandas.util.testing import assert_frame_equal\n\n#Get Dates\nstart_date = datetime.datetime.now() - datetime.timedelta(days=365)\n... | [
[
"pandas.read_pickle"
]
] |
CVI-SZU/CCAM | [
"9d3d0123b625b2c6941069e8fb359019a5cabd59"
] | [
"CUSTOM/core/resnet.py"
] | [
"import math\nimport torch.nn as nn\nimport torch.utils.model_zoo as model_zoo\nmodel_urls = {\n 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',\n 'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth',\n 'resnet50': 'https://download.pytorch.org/models/resnet50-19... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.utils.model_zoo.load_url",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
ToumaKazusa3/WP-MTMCT | [
"915795f798075453916f41e8d2a900ab4884d9ae"
] | [
"src/tracker/mot/FairMOT/src/lib/models/networks/resnet_dcn.py"
] | [
"# ------------------------------------------------------------------------------\r\n# Copyright (c) Microsoft\r\n# Licensed under the MIT License.\r\n# Written by Bin Xiao (Bin.Xiao@microsoft.com)\r\n# Modified by Dequan Wang and Xingyi Zhou\r\n# --------------------------------------------------------------------... | [
[
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.nn.BatchNorm2d",
"torch.nn.ConvTranspose2d",
"torch.utils.model_zoo.load_url",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.init.normal_"
]
] |
gumpy-hybridBCI/gumpy | [
"be41a262cb818b9886354212ab87edfb359d8424"
] | [
"gumpy/data/nst_emg.py"
] | [
"from .dataset import Dataset, DatasetError\nimport os\nimport numpy as np\nimport scipy.io\n\n\nclass NST_EMG(Dataset):\n \"\"\"An NST_EMG dataset.\n\n An NST_EMG dataset usually consists of three files that are within a specific\n subdirectory. The implementation follows this structuring, i.e. the user\n... | [
[
"numpy.where",
"numpy.delete",
"numpy.shape",
"numpy.zeros"
]
] |
anfieldlove/Decision-Tree | [
"df331e994c8f5f6bab4518c3df4474b9b32fa279"
] | [
"code/decision_tree.py"
] | [
"import numpy as np\n\nclass Tree():\n def __init__(self, value=None, attribute_name=\"root\", attribute_index=None, branches=None):\n \"\"\"\n This class implements a tree structure with multiple branches at each node.\n If self.branches is an empty list, this is a leaf node and what is con... | [
[
"numpy.array",
"numpy.delete",
"numpy.where",
"numpy.log2",
"numpy.unique"
]
] |
gonzalorodrigo/ScSFWorkload | [
"2301dacf486df8ed783c0ba33cbbde6e9978c17e"
] | [
"stats/__init__.py"
] | [
"from analysis.jobAnalysis import calculate_histogram\nimport pickle\nimport MySQLdb\nimport numpy as np\n\n\nclass Result(object):\n \"\"\"\n Abstract class for results on a workload analysis. Such a class has to be\n able to calculate some data over a data set. This class stores the results\n in an da... | [
[
"numpy.std",
"numpy.percentile",
"numpy.array",
"numpy.mean"
]
] |
tuomijal/pmdarima | [
"5bf84a2a5c42b81b949bd252ad3d4c6c311343f8"
] | [
"pmdarima/datasets/ausbeer.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport pandas as pd\n\nfrom ..compat import DTYPE\n\n__all__ = [\n 'load_ausbeer'\n]\n\n\ndef load_ausbeer(as_series=False, dtype=DTYPE):\n \"\"\"Quarterly beer production data.\n\n Total quarterly beer production in Australia (in megalitres)\n from 1956:Q... | [
[
"numpy.array",
"pandas.Series"
]
] |
Mikaeelswan/tensorflow | [
"3185874912e5624955e9844d5bdae5a06a0b33c8"
] | [
"tensorflow/python/kernel_tests/cwise_ops_unary_test.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.ones_like",
"tensorflow.python.framework.test_util.force_cpu",
"numpy.exp",
"numpy.where",
"numpy.complex",
"tensorflow.python.platform.test.main",
"numpy.empty",
"numpy.vectorize",
"numpy.arange",
"tensorflow.python.ops.math_ops.complex",
"numpy.sqrt",
"nump... |
TUM-VT/FleetPy | [
"596bcec9fbd2fe52206079641d549bf028d2879d",
"596bcec9fbd2fe52206079641d549bf028d2879d"
] | [
"src/infra/BoardingPointInfrastructure.py",
"src/preprocessing/networks/create_travel_time_tables.py"
] | [
"# -------------------------------------------------------------------------------------------------------------------- #\n# standard distribution imports\n# -----------------------------\nimport enum\nimport os\nimport logging\n\n# additional module imports (> requirements)\n# -------------------------------------... | [
[
"pandas.read_csv"
],
[
"pandas.merge",
"pandas.DataFrame",
"numpy.ones",
"numpy.save",
"pandas.read_csv"
]
] |
SebastianoF/intra-cranial-volume-estimation | [
"5ee5c5e4749b5aa17e99ad3fdb78245076227198"
] | [
"icv/test_icv_basics.py"
] | [
"import os\nfrom os.path import join as jph\nimport numpy as np\nimport nibabel as nib\n\nfrom DummyForMRI.building_blocks import headlike_phantom\n\nfrom icv.icv_estimator import IcvEstimator\n\n\n# Path manager:\nroot_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\npfo_examples = jph(root_d... | [
[
"numpy.zeros",
"numpy.testing.assert_equal",
"numpy.mean",
"numpy.eye",
"numpy.abs",
"numpy.diag"
]
] |
mathemusician/ocr_pytorch | [
"07e56f4d240ca76d5cb447c912fef573a0869577"
] | [
"train_code/train_crnn/crnn_model_PL.py"
] | [
"from pytorch_lightning.callbacks import Callback\nfrom pathed import filedir, importfile, Path\nfrom PIL import Image, ImageDraw, ImageFont\nfrom collections import OrderedDict\nfrom torch.autograd import Variable\nfrom torchvision import transforms\nimport pytorch_lightning as pl\nfrom torch.nn import CTCLoss\nfr... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LSTM",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.CTCLoss",
"torch.cuda.current_device",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.load"
]
] |
IML-DKFZ/m-pax_lib | [
"54a97b0503c779fefbd4e71f9b68fdc465d7193e"
] | [
"src/models/head_mlp.py"
] | [
"import pytorch_lightning as pl\nimport torch\n\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch.optim import SGD, Adam\nfrom torch.optim.lr_scheduler import CosineAnnealingLR\nfrom torchmetrics.functional import confusion_matrix, accuracy\n\nfrom src.models.tcvae_resnet import *\nfrom src.mo... | [
[
"torch.nn.Linear",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.nn.functional.cross_entropy",
"torch.cuda.device_count"
]
] |
vmariiechko/python-image-processing | [
"5613440dc04140845600b8c37a2b28786d504815"
] | [
"src/operations/local/convolve_ui.py"
] | [
"from numpy import array\nfrom PyQt5.QtWidgets import QWidget, QLabel, QSpinBox, QRadioButton, QHBoxLayout, QVBoxLayout\nfrom PyQt5.QtCore import Qt, QMetaObject\nfrom PyQt5.QtGui import QIcon, QPixmap\n\nfrom ..operation_ui import OperationUI\nfrom .local_ui import LocalUI\n\n\nclass ConvolveUI(OperationUI, LocalU... | [
[
"numpy.array"
]
] |
anhquancao/xmuda-extend | [
"4b670ec2f6766e3a624e81dbe5d97b209c1c4f76",
"4b670ec2f6766e3a624e81dbe5d97b209c1c4f76"
] | [
"xmuda/eval_all.py",
"xmuda/models/decoder3D.py"
] | [
"from xmuda.models.SSC2d_proj3d2d import SSC2dProj3d2d\nfrom xmuda.data.NYU.nyu_dm import NYUDataModule\nfrom xmuda.models.SketchTrainer import SketchTrainer\nfrom xmuda.models.LMSC_trainer import LMSCTrainer\nfrom xmuda.models.AIC_trainer import AICTrainer\nfrom xmuda.data.semantic_kitti.kitti_dm import KittiDataM... | [
[
"numpy.log",
"numpy.array",
"numpy.concatenate",
"torch.no_grad"
],
[
"torch.rand",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.functional.interpolate",
"torch.nn.LeakyReLU",
"numpy.ones",
"torch.nn.ReLU",
"torch.nn.Dropout3d",
"torch.cuda.is_available",
... |
rne1223/geemap | [
"0b43bc0bd22bd2ad2453069caac5fe9e754c1253"
] | [
"geemap/eefolium.py"
] | [
"\"\"\" This module extends the folium Map class. It is designed to be used in Google Colab, as Google Colab currently does not support ipyleaflet.\n\"\"\"\n\nimport colour\nimport ee\nimport folium\nimport os\nimport ipywidgets as widgets\nfrom folium import plugins\nfrom .conversion import *\n\n\ndef ee_initializ... | [
[
"numpy.dstack",
"numpy.array"
]
] |
olaals/tpktools | [
"50416ca554809e3d2f364b25531c78cf4751311c"
] | [
"multivision/oa_pointcloud_utils.py"
] | [
"import numpy as np\nfrom oa_robotics import *\nimport open3d as o3d\nimport cv2\n\n\n\ndef get_image_coordinates_treshold(img, threshold):\n coords = np.flip(np.row_stack(np.where(img > threshold)))\n pad = np.pad(coords, [(0,1),(0,0)], mode='constant', constant_values=[(0,1.0),(0,0)])\n return pad\n\ndef... | [
[
"numpy.pad",
"numpy.asarray",
"numpy.zeros",
"numpy.where",
"numpy.einsum",
"numpy.linalg.inv"
]
] |
joosephook/stable-baselines | [
"a6a8052e105369656d34fffc4f7ca4475dcc38df"
] | [
"stable_baselines/gail/dataset/record_expert.py"
] | [
"import os\nimport warnings\n\nimport cv2\nimport numpy as np\nfrom gym import spaces\n\nfrom stable_baselines.common.base_class import BaseRLModel\nfrom stable_baselines.common.vec_env import VecEnv, VecFrameStack\nfrom stable_baselines.common.base_class import _UnvecWrapper\n\n\ndef generate_expert_traj(model, sa... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.savez",
"numpy.zeros"
]
] |
tzyRachel/K-anonymity-Expectation | [
"5993fd34c73423fa1b5fd99b794bd7a70b751db2"
] | [
"exp_approximation2.py"
] | [
"#!/usr/bin/python\n#Expectation with partition\nimport time\nfrom decimal import *\nfrom Prob_simple_version import Prob_en\nfrom scipy.stats import binom\ngetcontext().prec = 100\n\n#E(|e| <= k)\ndef Exp2(A,m,r,k):\n \"\"\"\n Compute the expected number buckets that has collision less or equal 10 by applyin... | [
[
"scipy.stats.binom"
]
] |
VertexStudio/SimboticAirSim | [
"3a5455ffc69d8323c9bc15caf1f26eee56247bd0"
] | [
"Scripts/multiagent.py"
] | [
"#import setup_path \nimport airsim\n\nimport numpy as np\nimport os\nimport tempfile\nimport pprint\n\n# Use below in settings.json with Blocks environment\n\"\"\"\n{\n\t\"SeeDocsAt\": \"https://github.com/Microsoft/AirSim/blob/master/docs/settings.md\",\n\t\"SettingsVersion\": 1.2,\n\t\"SimMode\": \"Multirotor\",... | [
[
"numpy.flipud",
"numpy.fromstring"
]
] |
kalekundert/scikit-optimize | [
"53c618985b2cdea48b2ef2ff9532f3e8bc8c37da"
] | [
"skopt/optimizer/optimizer.py"
] | [
"import sys\nimport warnings\nfrom math import log\nfrom numbers import Number\nimport numpy as np\n\nfrom scipy.optimize import fmin_l_bfgs_b\n\nfrom sklearn.base import clone\nfrom sklearn.base import is_regressor\nfrom joblib import Parallel, delayed\nfrom sklearn.multioutput import MultiOutputRegressor\nfrom sk... | [
[
"numpy.argmin",
"numpy.copy",
"numpy.exp",
"numpy.min",
"numpy.mean",
"numpy.max",
"sklearn.base.is_regressor",
"numpy.ndim",
"sklearn.multioutput.MultiOutputRegressor",
"sklearn.base.clone",
"numpy.vstack",
"numpy.array",
"numpy.zeros",
"numpy.shape",
"... |
BONSAMURAIS/beebee | [
"379b2dc12703ea69ef660f8f7b0072c1dcff9a2c"
] | [
"beebee/convert_entsoe_to_numpy.py"
] | [
"from arborist import get_metadata\nfrom bentso.iterators import iterate_generation, iterate_trade, COUNTRIES\nfrom itertools import count\nfrom pathlib import Path\nimport itertools\nimport json\nimport numpy as np\nimport os\nimport tarfile\nimport tempfile\n\n\n# Generated from\n# https://github.com/BONSAMURAIS/... | [
[
"numpy.save",
"numpy.zeros"
]
] |
kagrze/ignite | [
"18708a76f86623545311d35bc48673eac9e55591"
] | [
"tests/ignite/contrib/metrics/regression/test_geometric_mean_relative_absolute_error.py"
] | [
"import torch\nimport numpy as np\nimport pytest\nfrom ignite.engine import Engine\nfrom ignite.contrib.metrics.regression import GeometricMeanRelativeAbsoluteError\n\n\ndef test_wrong_input_shapes():\n m = GeometricMeanRelativeAbsoluteError()\n\n with pytest.raises(ValueError):\n m.update((torch.rand(... | [
[
"torch.rand",
"numpy.random.rand",
"numpy.random.seed",
"numpy.exp",
"numpy.random.shuffle",
"torch.from_numpy",
"numpy.abs"
]
] |
rodrigogoulartsilva/simpletransformers | [
"e9376b249652d1d172ccd80155943459e43435b1"
] | [
"simpletransformers/conv_ai/conv_ai_model.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n\nfrom __future__ import absolute_import, division, print_function\n\nimport json\nimport logging\nimport math\nimport os\nimport random\nimport statistics\nimport warnings\nfrom collections import defaultdict\nfrom dataclasses import asdict\nfrom itertools import chain\nf... | [
[
"torch.utils.data.RandomSampler",
"torch.cuda.amp.autocast",
"torch.multinomial",
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss",
"torch.nn.DataParallel",
"torch.topk",
"pandas.DataFrame",
"torch.manual_seed",
"torch.tensor",
"torch.utils.data.DataLoader",
"... |
pwjworks/MS-MDA | [
"21f921a933a318820239541adb26b9fc6feba699"
] | [
"normalization/meernet_investi.py"
] | [
"'''\nDescription: \nAuthor: voicebeer\nDate: 2020-09-14 01:01:51\nLastEditTime: 2021-03-16 06:00:49\n'''\n# standard\nimport argparse\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport numpy as np\nimport copy\nimport random\nimport time\nimport math\nfrom torch.utils.tensorboard import ... | [
[
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.no_grad",
"numpy.mean",
"torch.nn.functional.log_softmax",
"torch.manual_seed",
"numpy.std",
"torch.cuda.is_available",
"torch.nn.functional.softmax"
]
] |
SyedSaifAliAlvi/Basic-Neural-Network-with-Pytorch | [
"6cccf2174c7f6e10b529e146f855100cc5464615"
] | [
"neural_network_with_pytorch.py"
] | [
"import torch\nimport numpy as np\nfrom torch.autograd import Variable\n\nX = torch.tensor([[1,0,1,0],[1,0,1,1],[0,1,0,1]],dtype=torch.float32)\ny = y = torch.Tensor([[1],[1],[0]])\n\nepoch = 5000\nlr = 0.1\ninputlayer_neurons = X.shape[1] # number of input features \nhiddenlayer_neurons = 3\noutput_neurons = 1\n\n... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"torch.exp",
"torch.mm",
"torch.tensor",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"torch.Tensor",
"torch.randn"
]
] |
cristobaltapia/sajou | [
"3693149218bfec9e902e55a5341e22be7b522e29"
] | [
"docs/sajou_examples/quickstart_loads.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nFile to test the module sajou.\nExample of the Book \"Mechanics of Structures - Variational and computational methods\"\npage 284\n\"\"\"\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport sajou as sj\n\nm = sj.Model(name='test ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.figure"
]
] |
dkoguciuk/DeepHomography | [
"2c09e6e8a3cf363914ed0f48fa069e472ed0a453"
] | [
"Oneline-DLTv1-with-AFM/resnet.py"
] | [
"import torch.nn as nn\r\nimport torch.utils.model_zoo as model_zoo\r\nimport torch, imageio\r\nfrom utils import transform, DLT_solve\r\nimport torchvision.models as models\r\n\r\ncriterion_l2 = nn.MSELoss(reduce=True, size_average=True)\r\ntriplet_loss = nn.TripletMarginLoss(margin=1.0, p=1, reduce=False,size_ave... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.BatchNorm2d",
"torch.nn.init.kaiming_normal_",
"torch.inverse",
"torch.utils.model_zoo.load_url",
"torch.squeeze",
"torch.cuda.is_available",
"torch.sum",
"torch.mul",
"torch.gather",
"torch.nn.MaxPool2d",
"torch.nn.AvgP... |
dandelin/mmdetection | [
"03e1c72f1bb6222bdf9af3bfe60946cf008c7143"
] | [
"mmdet/models/anchor_heads/ssd_head.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import xavier_init\nimport sys\nimport os\n\nsys.path.insert(\n 0,\n os.path.join(\n os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))),\n os.pardir,\n ),\n)\nfr... | [
[
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.functional.cross_entropy",
"torch.nn.Conv2d",
"torch.LongTensor",
"numpy.sqrt",
"numpy.floor"
]
] |
lrakla/Disaster-Response-Pipeline | [
"bbc65561d05a5b190d7bd447a671ec2a420e094e"
] | [
"models/train_classifier.py"
] | [
"#import necessary packages and libraries\nimport sys\nimport pandas as pd\nimport numpy as np\nfrom nltk import pos_tag\nimport re\nimport nltk\nfrom nltk.stem import WordNetLemmatizer\nnltk.download('punkt')\nnltk.download('stopwords')\nnltk.download('averaged_perceptron_tagger')\nnltk.download('wordnet') # downl... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.svm.SVC",
"sklearn.metrics.classification_report",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.model_selection.GridSearchCV",
"sklearn.feature_extraction.text.TfidfTransformer",
"pandas.read_sql_table"
]
] |
yinglanma/AI-project | [
"db145c59f57f519177f3eedde14c3ce033b2a11d"
] | [
"tensorpack/callbacks/group.py"
] | [
"# -*- coding: UTF-8 -*-\n# File: group.py\n# Author: Yuxin Wu <ppwwyyxx@gmail.com>\n\nimport tensorflow as tf\nfrom contextlib import contextmanager\nimport time\n\nfrom .base import Callback\nfrom .stat import *\nfrom ..utils import *\n\n__all__ = ['Callbacks']\n\nclass CallbackTimeLogger(object):\n def __init... | [
[
"tensorflow.name_scope"
]
] |
JunyiZhu-AI/private-transformers | [
"9d70a570a56e6e19d8a8cb1f8e3b3ffd809a04ef"
] | [
"examples/table2text/run_language_modeling.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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 compliance with the License.\n# You may... | [
[
"torch.optim.lr_scheduler.LambdaLR",
"torch.optim.AdamW",
"torch.testing.assert_allclose"
]
] |
fabiommendes/covid-19 | [
"b66ca8369f84bb8d4637e35ce8add23de9225d05"
] | [
"covid/ui/output.py"
] | [
"import os\n\nimport pandas as pd\nimport streamlit as st\nfrom babel.dates import format_date\n\nimport covid\nfrom covid import gettext as _\nfrom covid.models import SEICHARDemographic as SEICHAR\nfrom covid.ui.components import (\n cards,\n md_description,\n asset,\n double_bar_chart,\n html,\n ... | [
[
"pandas.DataFrame"
]
] |
jjz17/Natural-Strength-Building | [
"84a0ddf602f6aaed2b04b9ca49eb2f58a6bf80b7"
] | [
"application/main.py"
] | [
"from flask import Flask, render_template, request, redirect, url_for, session, jsonify\nimport joblib\nfrom matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas\nfrom matplotlib.figure import Figure\nimport matplotlib.pyplot as plt\nfrom matplotlib.style import use\nimport numpy as np\nfrom sqlal... | [
[
"matplotlib.pyplot.switch_backend",
"numpy.array",
"numpy.random.rand",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.tight_layout",
"matplotlib.figure.Figure",
"matplotlib.backends.backend_agg.FigureCanvasAgg"
]
] |
amygreen/PythonHackathon | [
"9ab78bb15a1e1c33dd724e98e2d99e6cb9f82b4b"
] | [
"PythonHackathon/GroupStatistics.py"
] | [
"import numpy as np\nimport nibabel as nib\nimport pathlib as pl\n\n\nclass GroupStatistics():\n \"\"\"\n This class gets a folder that contains raw data files.\n It merges them into a large array and calculates mean and std per each voxel across all subjects.\n It returns two maps: mean and std maps.\n... | [
[
"numpy.std",
"numpy.stack",
"numpy.mean",
"numpy.eye"
]
] |
treefriend/NLP_study_tf2 | [
"ec064b451efc57b90a002430a01c840ba8262557"
] | [
"Annotated_Transformer/SublayerConnection.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2020-05-20 11:08\n# @Author : Shupeng\n\nimport torch.nn as nn\n\nfrom LayerNorm import LayerNorm\n\n\nclass SublayerConnection(nn.Module):\n \"\"\"\n A residual connection followed by a layer norm.\n Note for code simplicity the norm is first as opposed to last\n ... | [
[
"torch.nn.Dropout"
]
] |
Nicolucas/TEAR | [
"bbeb599cf2bab70fd7a82041336a1a918e8727f2"
] | [
"PythonCodes/ExtractTimeProfileData_DispVel.py"
] | [
"import os, sys, time\nimport numpy as np\nfrom scipy.interpolate import RectBivariateSpline\n\nsys.path.insert(0,\"/home/nico/Documents/TEAR/Codes_TEAR/PythonCodes/LibFolder\")\nfrom Lib_GeneralFunctions import *\nfrom Lib_ProfilePlotting import *\nfrom Lib_ProfileProcessing import *\n\nfrom se2waveload import *\n... | [
[
"scipy.interpolate.RectBivariateSpline",
"numpy.arange"
]
] |
macio232/torchdiffeq | [
"7e097e640a10811d40eddbbcdd5397bc4e082e69"
] | [
"torchdiffeq/_impl/fixed_adams.py"
] | [
"import collections\nimport sys\nimport torch\nimport warnings\nfrom .solvers import FixedGridODESolver\nfrom .misc import _compute_error_ratio, _linf_norm\nfrom .misc import Perturb\nfrom .rk_common import rk4_alt_step_func\n\n_BASHFORTH_COEFFICIENTS = [\n [], # order 0\n [11],\n [3, -1],\n [23, -16, ... | [
[
"torch.abs",
"torch.as_tensor",
"torch.tensor"
]
] |
Alsasolo/mmcv | [
"6dfc9312fa872c7fd63a5e6971e9ecca8e3d4ef1"
] | [
"mmcv/onnx/onnx_utils/symbolic_helper.py"
] | [
"\"\"\"Modified from https://github.com/pytorch/pytorch.\"\"\"\nimport warnings\nfrom functools import wraps\nfrom sys import maxsize\n\nimport torch\nimport torch.onnx\n# This import monkey-patches graph manipulation methods on Graph, used for the\n# ONNX symbolics\nimport torch.onnx.utils\nfrom torch._C import Li... | [
[
"torch.onnx.symbolic_opset9.unsqueeze",
"torch.ones",
"torch._C.ListType.ofTensors",
"torch.tensor",
"torch.onnx.symbolic_opset10._slice"
]
] |
jeya-maria-jose/Cuff_less_BP_Prediction | [
"d8bac12e27b24046c71e8aa5391544d402bb5ef3"
] | [
"models_DL/cnn_basic/cnn_train.py"
] | [
"import torch \nimport torch.nn as nn\nimport torchvision\nimport torchvision.transforms as transforms\nfrom custom_data import bpdata_train,bpdata_test\nimport numpy as np\nfrom sklearn.metrics import mean_squared_error, r2_score\nfrom sklearn import metrics \n\nbp_train_dataset = bpdata_train(csv_file='/home/jey... | [
[
"torch.nn.Linear",
"torch.nn.MSELoss",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.tensor",
"torch.utils.data.DataLoader"
]
] |
agartland/pwseqdist | [
"d48d3bf4e6c79e5ba2417a1010f673179b27da68"
] | [
"pwseqdist/running_metrics.py"
] | [
"import numpy as np\nimport numba as nb\n\nfrom .matrices import dict_from_matrix, parasail_aa_alphabet, identity_nb_distance_matrix, tcr_nb_distance_matrix\n\n__all__ = ['nb_running_editdistance',\n 'nb_running_tcrdist']\n\n\"\"\"TODO:\n - The way that nndist and neighbors is dynamically expanded when i... | [
[
"numpy.max",
"numpy.zeros"
]
] |
aman2930/tpu | [
"1724c0ee08523ecb4e10872026afd2d8391137c1"
] | [
"tools/data_converter/image_classification/simple_example.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... | [
[
"numpy.uint8",
"numpy.random.choice",
"numpy.random.randint",
"numpy.random.random",
"tensorflow.compat.v1.io.gfile.GFile"
]
] |
plantdna/htp | [
"0b12c6a2eb376840b3df11055cd66da695a82aca"
] | [
"scripts/snp2htp/generator_htp_index.py"
] | [
"import pandas as pd\nimport traceback\nfrom scripts.base_class import BaseClass\n\nbase_class = BaseClass()\n\ndef match_haplotype(seq, htp_haplotype_df):\n '''\n 找出与指定序列相似度最高的单体型序号\n '''\n max_similar_index = 0\n max_rate = 0\n for index, row in htp_haplotype_df.iterrows():\n rate = base_... | [
[
"pandas.merge"
]
] |
HarshCasper/scipy | [
"8773fde8a82ef7c47b23adcf9ff32be729348daa"
] | [
"scipy/__init__.py"
] | [
"\"\"\"\nSciPy: A scientific computing package for Python\n================================================\n\nDocumentation is available in the docstrings and\nonline at https://docs.scipy.org.\n\nContents\n--------\nSciPy imports all the functions from the NumPy namespace, and in\naddition provides:\n\nSubpackage... | [
[
"scipy._lib._pep440.parse",
"scipy._lib._testutils.PytestTester",
"scipy._lib._pep440.Version"
]
] |
thiagopbueno/loggibud | [
"e63acc2c55e380b24f71a4574704488e03d30c17",
"e63acc2c55e380b24f71a4574704488e03d30c17"
] | [
"loggibud/v1/plotting/plot_instance.py",
"loggibud/v1/baselines/task2/qrp_sweep.py"
] | [
"import logging\nfrom argparse import ArgumentParser\n\nimport numpy as np\nimport folium\n\nfrom ..types import CVRPInstance, DeliveryProblemInstance\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef plot_cvrp_instance(instance: CVRPInstance):\n\n origin = instance.origin\n points = [delivery.point for deli... | [
[
"numpy.mean"
],
[
"numpy.array",
"numpy.ceil",
"numpy.zeros",
"numpy.nonzero",
"numpy.sort",
"numpy.arctan2",
"numpy.linspace",
"numpy.vstack"
]
] |
ebritsyn/obormot | [
"de05707d0a9b7a8de813ee8e1104dea02caeb236"
] | [
"tests/test_image_processing.py"
] | [
"import io\n\nimport numpy as np\nimport cv2\n\nfrom utils.image_processing import Model\n\nMODEL = Model()\n\n\ndef test_ndarray2bytes():\n shape = (20, 20, 3)\n arr = np.ones(shape) * 255\n arr = arr.astype('uint8')\n assert isinstance(MODEL.ndarray2bytes(arr), io.BytesIO)\n\n\ndef test_convert2rgb():... | [
[
"numpy.ones"
]
] |
MDobransky/thesis-grizzly | [
"b038b477596879465636eae34444d70742a86e8f"
] | [
"diplomova_praca_lib/helpers/experiments_plots/perform_average_pool.py"
] | [
"import argparse\r\nfrom pathlib import Path\r\n\r\nimport numpy as np\r\nfrom tensorflow.python.keras.layers import GlobalAveragePooling2D\r\n\r\nfrom diplomova_praca_lib.storage import FileStorage\r\n\r\n\r\ndef main():\r\n parser = argparse.ArgumentParser()\r\n parser.add_argument('--input', type=str)\r\n ... | [
[
"tensorflow.python.keras.layers.GlobalAveragePooling2D"
]
] |
mariamingallonMM/AI-ML-W4-normal-probability-distribution | [
"95569929078b22555f870675f27aeca29f8ce487"
] | [
"main.py"
] | [
"# Importing required libraries\n \nimport numpy as np\nimport scipy.stats\nimport math\nfrom scipy.stats import multivariate_normal\n\n\ndef normal_dist(x , mean , var):\n\n \"\"\"\n Calculates a normal distribution in a variate x,\n with mean mu (mean) and variance sigma^2 (sd)\n as a statistic distri... | [
[
"numpy.exp"
]
] |
jeguzzi/robomaster_ros | [
"8c565deb320f752d8ced7caa87ae7674ffd522a2"
] | [
"robomaster_ros/robomaster_ros/decompress_h264.py"
] | [
"# We can use several tools to decompress a h264:\n# - ffmpeg, libav and their Python library pyav\n# - the decoder that comes with the robomaster (libmedia)\n\nfrom typing import Iterator, Any\n\nimport numpy as np\n\nimport rclpy\nimport rclpy.node\nfrom cv_bridge import CvBridge\nimport sensor_msgs.msg\nimport r... | [
[
"numpy.frombuffer"
]
] |
purvaudai/facebook-archive | [
"61cb728009ead30f9ef006184b73e90477d04773"
] | [
"plot_messages.py"
] | [
"import matplotlib.pyplot as plt\nimport os\nimport re\nfrom copy import deepcopy\nimport timestring\nimport datetime\nfrom datetime import timedelta\nimport dateutil.parser\nimport numpy as np\nimport argparse\n\ndef loop_messages(loc):\n\n osfiles = [f for f in os.listdir(loc+'/messages/') if os.path.isfile(lo... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"numpy.cumsum",
"matplotlib.pyplot.show"
]
] |
jlvahldiek/MONAILabel | [
"381f42aa4160a12aeb510646b043f696ad7b984f"
] | [
"monailabel/endpoints/batch_infer.py"
] | [
"# Copyright (c) MONAI Consortium\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to in... | [
[
"torch.cuda.empty_cache",
"torch.cuda.is_available"
]
] |
mrcsbrn/TCC_software | [
"17a5335aed17d4740c3bbd0ef828b0fc5dcea1da"
] | [
"Sindri/CubicEquationsOfState/SchmidtAndWenzel1979.py"
] | [
"import numpy as np\n\nfrom EOSMixture import EOSMixture\nfrom MixtureRules.ClassicMixtureRule import ClassicMixtureRule\nfrom MixtureRules.MixtureRulesInterface import (\n BiBehavior,\n ThetaiBehavior,\n DeltaMixtureRuleBehavior,\n EpsilonMixtureRuleBehavior,\n MixtureRuleBehavior,\n)\nfrom constant... | [
[
"numpy.min",
"numpy.sqrt"
]
] |
zdadadaz/visual_zoo | [
"2fa9833e53d3654b47f395a6286f1327b5fa6e08"
] | [
"src/unet3d.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom collections import OrderedDict\n\nimport torch\nimport torch.nn as nn\n\n\n# https://arxiv.org/pdf/1606.06650.pdf\n# https://github.com/wolny/pytorch-3dunet/blob/master/pytorch3dunet/unet3d/model.py\n\nclass UNet3D(nn.Module):\n # acdc 112x112x112x3\n def __init__(self, in_cha... | [
[
"torch.cat",
"torch.nn.MaxPool3d",
"torch.nn.LeakyReLU",
"torch.nn.Conv3d",
"torch.load",
"torch.nn.AdaptiveMaxPool3d",
"torch.nn.InstanceNorm3d",
"torch.nn.AdaptiveAvgPool3d",
"torch.nn.ConvTranspose3d"
]
] |
kristianbrandser/julekalender2020 | [
"45601cfda6e513796ea90c6a9379c7d180c39d10"
] | [
"julekalender2020/luke3.py"
] | [
"import numpy\n\nhiddenwords_orig = numpy.genfromtxt('julekalender2020/luke3/matrix.txt',dtype=str)\n\nhiddenwords_transposed = []\nfor i in range(len(hiddenwords_orig[0])):\n new_string = ''.join([line[i] for line in hiddenwords_orig])\n hiddenwords_transposed.append(new_string)\n\nhiddenwords_chararray = nu... | [
[
"numpy.char.array",
"numpy.genfromtxt",
"numpy.chararray",
"numpy.shape"
]
] |
themains/pydomains | [
"84394bb2eec3c718ee20fafd8ab90cb8a652eb20"
] | [
"pydomains/data/phishtank2csv.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nDownload PhishTank and pre-processed to CSV format\n\"\"\"\n\nimport os\nimport sys\n\nimport pandas as pd\n\nfrom pydomains.utils import url2domain, download_file\n\nPHISHTANK_DOWNLOAD_URL = 'http://data.phishtank.com/data/online-valid.csv.bz2'\nPHISHTANK_... | [
[
"pandas.read_csv"
]
] |
EUCHI1996/bootcamp | [
"35c926b346ae588d58b35a2442b960f6e1085246"
] | [
"solutions/question_answering_system/quick_deploy/src/get_answer.py"
] | [
"from functools import reduce\nimport numpy as np\nimport time\nimport logging\nimport pandas as pd\n\nfrom src.pg_operating import create_pg_table, copy_data_to_pg, build_pg_index, search_in_pg, get_result_answer\nfrom src.config import DEFAULT_TABLE\nfrom src.milvus_operating import has_table, create_table, drop_... | [
[
"pandas.read_csv",
"pandas.isna",
"numpy.sqrt"
]
] |
Helilysyt/tensorlayer | [
"2dc4482a13aff3833a246b4d85b69a5d9079f01d"
] | [
"tensorlayer/layers/convolution/deformable_conv.py"
] | [
"#! /usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\n\nimport tensorlayer as tl\nfrom tensorlayer import logging\nfrom tensorlayer.decorators import deprecated_alias, private_method\nfrom tensorlayer.layers.core import Layer\n\n__all__ = [\n 'DeformableConv2d',\n]\n\n\nclass DeformableConv2d(... | [
[
"tensorflow.floor",
"tensorflow.nn.conv3d",
"tensorflow.shape",
"tensorflow.range",
"tensorflow.expand_dims",
"tensorflow.gather_nd",
"tensorflow.reshape",
"tensorflow.transpose",
"tensorflow.math.ceil",
"tensorflow.stack",
"tensorflow.tile",
"tensorflow.nn.bias_add... |
Gaurav7888/vision | [
"a227a2026ef57fce08c1a73bad61bbabc3a52bfd"
] | [
"gallery/plot_transforms.py"
] | [
"\"\"\"\n==========================\nIllustration of transforms\n==========================\n\nThis example illustrates the various transforms available in :ref:`the\ntorchvision.transforms module <transforms>`.\n\"\"\"\n\nfrom PIL import Image\nfrom pathlib import Path\nimport matplotlib.pyplot as plt\nimport nump... | [
[
"torch.manual_seed",
"numpy.asarray",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots"
]
] |
bijmuj/GANwriting | [
"c07640909e27aa3007a73d2af800c07132496ef1"
] | [
"utils.py"
] | [
"import wandb\nimport string\nimport cv2\nimport torch\nimport random\nimport docx2txt\nimport os\nimport glob\nimport math\nimport numpy as np\nfrom torch.utils.data import DataLoader, TensorDataset\nfrom models import GenModel_FC\nfrom collections import defaultdict\nfrom PIL import Image as im\nfrom config impor... | [
[
"torch.device",
"numpy.uint8",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"torch.no_grad",
"torch.from_numpy",
"numpy.float32",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.utils.data.TensorDataset"
]
] |
kura19-ds/python_data_analysis_ohmsha | [
"4cd52200d8a163d27a6c6bf526dcc541924a4da1"
] | [
"sample_program_6_1_2_3_regression.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\n@author: hkaneko\r\n\"\"\"\r\n\r\nimport sys\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport sample_functions\r\nfrom sklearn import metrics\r\nfrom sklearn import svm\r\nfrom sklearn.cross_decomposition import PLSRegression\r\nfrom sklearn.model_selection import tra... | [
[
"sklearn.cross_decomposition.PLSRegression",
"numpy.linalg.matrix_rank",
"pandas.DataFrame",
"sklearn.metrics.r2_score",
"numpy.arange",
"sklearn.svm.SVR",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"sklearn.model_selection.cross_val_predict"
]
] |
eric-erki/Prometheus | [
"def07745ebcbe08ebb2fbba124bd07873edc8c9c",
"def07745ebcbe08ebb2fbba124bd07873edc8c9c"
] | [
"losses/huber.py",
"models/unet_old.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass HuberLoss(nn.Module):\n def __init__(self, clip_delta=1.0, reduction=\"elementwise_mean\"):\n super(HuberLoss, self).__init__()\n self.clip_delta = clip_delta\n self.reduction = reduction or \"none\"\n\n def forward(self, y_pred, y_true, wei... | [
[
"torch.abs",
"torch.mean",
"torch.clamp",
"torch.sum"
],
[
"torch.cat",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.ConvTranspose2d",
"torch.nn.ReLU",
"torch.nn.Upsample",
"torch.nn.Conv2d"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.