repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
airalcorn2/NBA_Tutorials | [
"80063c35f0f884ffc4e16f0bd98965cdf65da01c",
"85179300864d2c97a727a7b2a5ee46d250bdac20",
"85179300864d2c97a727a7b2a5ee46d250bdac20"
] | [
"shot_bins/binning_shots.py",
"rapm_prior/download_stats_nba_data.py",
"rapm_prior/rapm_with_prior.py"
] | [
"import pandas as pd\nimport math\n\n# Adjust pandas settings to show more columns when printing dataframe\npd.set_option('display.max_columns', 500)\npd.set_option('display.width', 1000)\n\n# Read the csv file into a dataframe\nshots = pd.read_csv(\"shots.csv\")\n\n# Print the first 10 rows\n#print(shots.head(10))... | [
[
"pandas.set_option",
"pandas.read_csv",
"pandas.Series"
],
[
"pandas.set_option",
"pandas.DataFrame"
],
[
"pandas.read_csv",
"pandas.DataFrame",
"numpy.concatenate",
"numpy.apply_along_axis",
"numpy.transpose",
"sklearn.linear_model.RidgeCV",
"pandas.set_opt... |
guaacoelho/devito | [
"7e0b873114675752c4a49ed9076ee5d52997833c"
] | [
"tests/test_gpu_openmp.py"
] | [
"import numpy as np\nimport pytest\n\nfrom conftest import skipif, opts_device_tiling\nfrom devito import (Grid, Dimension, Function, TimeFunction, Eq, Inc, solve,\n Operator, norm, cos)\nfrom devito.exceptions import InvalidOperator\nfrom devito.ir.iet import retrieve_iteration_tree\nfrom exampl... | [
[
"numpy.array",
"numpy.empty",
"numpy.linspace"
]
] |
naykun/mmf | [
"064a6dc83db8a7072492f0d22d2bd14cfda7ad47"
] | [
"mmf/modules/metrics.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\"\"\"\nThe metrics module contains implementations of various metrics used commonly to\nunderstand how well our models are performing. For e.g. accuracy, vqa_accuracy,\nr@1 etc.\n\nFor implementing your own metric, you need to follow these steps:\n\n1. Create yo... | [
[
"torch.mean",
"torch.nn.functional.softmax",
"torch.sigmoid",
"torch.max",
"torch.round",
"torch.sum",
"torch.tensor",
"torch.le",
"torch.no_grad",
"torch.arange",
"torch.topk",
"torch.logical_and"
]
] |
niuchuangnn/aurora-maskrcnn | [
"b17acd8c68f9ff3bb561d8f977893948a69c06e5"
] | [
"maskrcnn_benchmark/structures/segmentation_mask.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\n\nimport pycocotools.mask as mask_utils\nimport numpy as np\n\n# transpose\nFLIP_LEFT_RIGHT = 0\nFLIP_TOP_BOTTOM = 1\n\n\nclass Mask(object):\n \"\"\"\n This class is unfinished and not meant for use yet\n It is suppose... | [
[
"torch.mm",
"torch.max",
"torch.zeros",
"torch.min",
"numpy.cos",
"torch.from_numpy",
"numpy.sin",
"torch.tensor",
"torch.as_tensor"
]
] |
wisematch/KDMOT | [
"03be0a148fc5d5a43c13a0427c429305b92e6838"
] | [
"src/lib/models/fastreid/modeling/backbones/regnet/effnet.py"
] | [
"# !/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"EfficientNet models.\"\"\"\n\nimport logging\n\nimport torch\nimport torch.nn as nn\n\nfrom ....lay... | [
[
"torch.sigmoid",
"torch.nn.Conv2d",
"torch.nn.Sigmoid",
"torch.nn.AdaptiveAvgPool2d",
"torch.device"
]
] |
shinyemimalef/FRISS | [
"56b12cfc7cfc2b935fa45004706bd1ba14f4afcd"
] | [
"friss/dataset_utils.py"
] | [
"import math\nimport random\nimport torch\nfrom torch.utils.data import Subset\nfrom torch.utils.data.sampler import Sampler\n\nfrom friss.MfcSentsDataset import MfcSentsDataset\nfrom friss.configs.config import config_args\n\nmfc_sents_dataset = MfcSentsDataset(config_args['data_dir'], \"immigration_all\")\n\nclas... | [
[
"torch.LongTensor"
]
] |
ritviksahajpal/LUH2 | [
"aec79f737aebcaa273de5f8f1aeadd3317d03aa4"
] | [
"LUH2/GlobalCropRotations/crop_stats.py"
] | [
"import logging\nimport os\nimport pdb\nimport sys\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\nimport pygeoutil.util as util\nimport GLM.constants as constants_glm\nimport constants\nimport plots\n\nreload(sys)\nsys.setdefaultencoding('utf-8')\npd.options.mode.chained_assignment =... | [
[
"pandas.merge",
"matplotlib.pyplot.tight_layout",
"pandas.read_csv",
"pandas.concat",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"numpy.shape",
"matplotlib.pyplot.close",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot... |
tzontzy13/Intro-to-AI | [
"a8040f64e2c9b8b8e5686919ea646210e619946f"
] | [
"Week2.py"
] | [
"import os\nimport pandas as pd\nimport numpy as np\nfrom sklearn import datasets\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.model_selection import KFold\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.metrics import confusion_matrix\ni... | [
[
"matplotlib.pyplot.imshow",
"sklearn.metrics.confusion_matrix",
"sklearn.model_selection.KFold",
"sklearn.tree.DecisionTreeClassifier",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"sklearn.datasets.load_wine",
"numpy.append",
"sk... |
denilDG/tcs-humain | [
"3bc371b0b89e783ce042c5c5a26e6bf0ad3894c4"
] | [
"preprocess.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Aug 13 16:13:47 2019\n\n@author: DG\n\"\"\"\n#import libaries\n\nimport shutil\nimport os\nimport pandas as pd\nfrom urllib.request import urlretrieve\nfrom PIL import Image\nfrom PIL import ImageFile\nImageFile.LOAD_TRUNCATED_IMAGES = True\n\n\n\n#Function for downl... | [
[
"pandas.read_json",
"pandas.DataFrame"
]
] |
ethan-asapp/flambe | [
"70257167058c7b82ee39f74167a6161bd264ad18"
] | [
"flambe/nn/mos.py"
] | [
"# type: ignore[override]\n\nimport torch\nimport torch.nn as nn\nfrom torch import Tensor\n\nfrom flambe.nn.mlp import MLPEncoder\nfrom flambe.nn.module import Module\n\n\nclass MixtureOfSoftmax(Module):\n \"\"\"Implement the MixtureOfSoftmax output layer.\n\n Attributes\n ----------\n pi: FullyConnect... | [
[
"torch.nn.Softmax",
"torch.nn.LogSoftmax",
"torch.cat",
"torch.nn.Tanh"
]
] |
jscohen4/cohen-policy-tree-adaptation | [
"a6efafda591e5850fc264f3756cce2bb8e07719f",
"a6efafda591e5850fc264f3756cce2bb8e07719f",
"a6efafda591e5850fc264f3756cce2bb8e07719f"
] | [
"figure-4-parallel-axis.py",
"baseline-cc.py",
"SA_files/SA-pareto-sort.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom subprocess import call\nimport random\nimport json\nimport os\nfrom os import listdir\nfrom os.path import isfile, join\nimport seaborn as sns\nimport pickle\nfrom matplotlib import cm\ndef init_plotting():\n sns.set_style(\"whitegrid\... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"numpy.load",
"matplotlib.pyplot.show"
],
[
"pandas.read_csv",
"numpy.random.seed",
"numpy.save",
"pandas.DataFrame",
... |
cadkins052/tab-vcr | [
"ea713a6ef7ca54eb3123d8729dfc26dc604644c5"
] | [
"dataloaders/image_loader.py"
] | [
"\"\"\"\nDataloaders for VCR\n\"\"\"\nimport json\nimport os\n\nimport numpy as np\nimport torch\nfrom allennlp.data.dataset import Batch\nfrom allennlp.data.fields import TextField, ListField, LabelField, SequenceLabelField, ArrayField, MetadataField\nfrom allennlp.data.instance import Instance\nfrom allennlp.data... | [
[
"torch.all",
"numpy.all",
"numpy.row_stack",
"torch.stack",
"numpy.array"
]
] |
dechunwang/SSH-pytorch | [
"eaea3d96ed6ba42a1c8ff82eff109b5ac97fee9d"
] | [
"model/rpn/proposal_layer.py"
] | [
"import torch\nimport torch.nn as nn\nimport numpy as np\nimport math\nimport yaml\nfrom model.utils.config import cfg\n\nfrom model.rpn.generate_anchors import generate_anchors\nfrom model.utils.bbox import bbox_transform_inv ,clip_boxes, clip_boxes_batch\nfrom model.nms.nms_wrapper import nms\n\n\n\nimport pdb\nD... | [
[
"numpy.arange",
"numpy.array",
"numpy.meshgrid",
"torch.sort"
]
] |
kojitominaga/scratch | [
"5eaf4de30c89ff1e855a6be493105d1201f07f74"
] | [
"lakes/misc/tarscripts/makeinputtarList6.py"
] | [
"import numpy as np\nimport pandas as pd\nimport os\n\nlakes = pd.read_table('Feb2015GranadaList.csv', sep=',')\nf = open('listtodownloadKzt', 'w')\n\nfor i, v in lakes['ebhex'].iteritems():\n hex = v.lstrip('0x')\n while len(hex) < 6:\n hex = '0' + hex\n print(hex)\n d0 = hex[:2]\n d1 = hex[:... | [
[
"pandas.read_table"
]
] |
SreelathaChopparapu/EVA-6 | [
"9d19646fbe3004148ea7015c78c8892bb1a5d321"
] | [
"src/models.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchsummary.torchsummary import summary\n\nclass BasicBlock(nn.Module):\n expansion = 1\n\n def __init__(self, in_planes, planes, stride=1):\n super(BasicBlock, self).__init__()\n self.conv1 = nn.Conv2d(\n in... | [
[
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.functional.relu",
"torch.nn.AdaptiveAvgPool2d",
"torch.cuda.is_available",
"torch.nn.BatchNorm2d"
]
] |
TimZaman/DIGITS | [
"820c82f257233845f21a9ef2addd84d3c59cf006"
] | [
"plugins/data/sunnybrook/digitsDataPluginSunnybrook/data.py"
] | [
"# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.\nfrom __future__ import absolute_import\n\nimport csv\nimport cv2\nimport fnmatch\nimport math\nimport os\nimport random\nimport re\n\nimport dicom\nimport numpy as np\n\nfrom digits.utils import subclass, override, constants\nfrom digits.utils.consta... | [
[
"numpy.empty",
"numpy.zeros_like",
"numpy.loadtxt"
]
] |
InquestGeronimo/deepsparse | [
"d8fae99b123696ecc89a179f793b6a7112ad2e1f"
] | [
"src/deepsparse/benchmark/stream_benchmark.py"
] | [
"# Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Un... | [
[
"numpy.std",
"numpy.median",
"numpy.mean",
"numpy.percentile"
]
] |
How-s-it-going/TripleHorseDeer_lang | [
"8c2a91aa821712299f05ebfe37e5599cee7518ed"
] | [
"THD.py"
] | [
"#!/usr/bin/env python\r\n\"\"\"\r\nThis is a Brainfuck interpreter (not a compiler) written in Python. It is\r\nsomewhat optimized for speed, as much as that is possible. By default it allows\r\nfor 30000 bytes of memory, but this can be configured by passing a parameter.\r\nSome protections are in place in order ... | [
[
"numpy.zeros"
]
] |
xuzf-git/Algorithm-Toy | [
"5a3b15cd12baff487ebd41e0c1a3071874f43a2c"
] | [
"GAN/1010/1-1010-GAN.py"
] | [
"'''\nDescription: 生成1010格式数据的GAN\nAuthor: xuzf\nDate: 2021-05-09 14:22:22\nFilePath: /Algorithm-Toy/GAN/1-1010-GAN.py\n'''\n\nimport random\nimport torch\nimport torch.nn as nn\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef generate_real():\n '''\n @description: 生成1010格式的训... | [
[
"pandas.DataFrame",
"torch.nn.Sigmoid",
"torch.nn.Linear",
"torch.FloatTensor",
"torch.rand",
"numpy.array",
"torch.nn.MSELoss",
"matplotlib.pyplot.figure"
]
] |
pratikkorat26/pix2pix_for_cityscapes | [
"2e88bd3ba42da847ee0b1235f4b63289d94d990e"
] | [
"pix2pix/generator.py"
] | [
"from utils import ConvBlock\r\nimport torch\r\nimport torch.nn as nn\r\n\r\n#C64-C128-C256-C512-C512-C512-C512-C512\r\nclass Generator(nn.Module):\r\n def __init__(self , in_channels ,feature, **kwargs):\r\n super(Generator, self).__init__()\r\n self.initial_down = nn.Sequential(\r\n nn... | [
[
"torch.nn.ConvTranspose2d",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.rand",
"torch.nn.ReLU"
]
] |
sagieppel/Instance-and-semantic-segmentation-of-materials-phases-and-vessels-in-chemistry-laboratory- | [
"3765d87bef04ac1a5dae19105163942577b30b5c"
] | [
"InstanceVessel/FCN_NetModel.py"
] | [
"# Fully convolutional neural net GES net /pointer net, given an image a point in the imagee and an ROI mask, the net predict the region/segment of the object/stuff containing the pointer th score of the segment predicition (IOU/Accuracy), and wether this segment is vessel or other object/image (only in case were t... | [
[
"torch.nn.functional.softmax",
"torch.ones",
"torch.zeros",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"numpy.array"
]
] |
shayneobrien/generative-models | [
"74fbe414f81eaed29274e273f1fb6128abdb0ff5"
] | [
"src/mm_gan.py"
] | [
"\"\"\" (MM GAN) https://arxiv.org/abs/1406.2661\nMini-max GAN\n\nFrom the abstract: 'We propose a new framework for estimating generative models\nvia an adversarial process, in which we simultaneously train two models: a\ngenerative model G that captures the data distribution, and a discriminative\nmodel D that es... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"torch.load",
"torch.randn",
"matplotlib.pyplot.subplots",
"torch.nn.Linear",
"torch.log",
"numpy.mean",
"matplotlib.pyplot.close",
"matplotlib.pyplot.show",
"matplotlib.pyplot.style.use"
]
] |
HZHE18/pyroomacoustics | [
"057b2db62bf2c7ee62fb03329a27b2eaafdaa30e"
] | [
"pyroomacoustics/doa/doa.py"
] | [
"# Author: Eric Bezzam\n# Date: Feb 15, 2016\nfrom __future__ import division, print_function, absolute_import\n\nfrom .utils import polar_distance\n\n\"\"\"Direction of Arrival (DoA) estimation.\"\"\"\n\nimport numpy as np\nimport math\nimport sys\nimport warnings\nfrom abc import ABCMeta, abstractmethod\n\nfrom .... | [
[
"matplotlib.pyplot.tight_layout",
"numpy.sqrt",
"numpy.abs",
"numpy.linspace",
"numpy.unique",
"numpy.arange",
"numpy.tile",
"matplotlib.pyplot.savefig",
"numpy.ones",
"numpy.round",
"numpy.array",
"numpy.exp",
"numpy.zeros",
"numpy.vstack",
"matplotlib.... |
KingQino/Online-Hand-Gesture-Recognition | [
"3427c7b154d567b6655d38192d8921d6010a68ff"
] | [
"Networks/resnet.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2020/7/23 5:34 PM\n# @Author : Yinghao Qin\n# @Email : y.qin@hss18.qmul.ac.uk\n# @File : resnet.py\n# @Software: PyCharm\nimport math\n\nimport torch.nn as nn\n\n\nclass BasicBlock(nn.Module):\n expansion = 1\n\n def __init__(self, in_channel, out_channel, stride=1... | [
[
"torch.nn.AvgPool3d",
"torch.nn.Sequential",
"torch.nn.init.kaiming_normal",
"torch.nn.MaxPool3d",
"torch.nn.Conv3d",
"torch.nn.Linear",
"torch.nn.ReLU",
"torch.nn.BatchNorm3d"
]
] |
e1000/pygame | [
"e6dd93c138733c24c71f4295300802c30bf0df18"
] | [
"test/sndarray_test.py"
] | [
"import unittest\n\nfrom numpy import int8, int16, uint8, uint16, array, alltrue\n\nimport pygame\nfrom pygame.compat import as_bytes\nimport pygame.sndarray\n\n\nclass SndarrayTest (unittest.TestCase):\n array_dtypes = {8: uint8, -8: int8, 16: uint16, -16: int16}\n\n def _assert_compatible(self, arr, size):\... | [
[
"numpy.alltrue",
"numpy.array"
]
] |
asberk/noise2self | [
"137498bf420b2d9a0b1939e15d530dc9c8a8a4bf"
] | [
"models/modules.py"
] | [
"import torch.nn as nn\n\n\nclass ConvBlock(nn.Module):\n def __init__(\n self,\n in_channels,\n out_channels,\n dropout=False,\n norm=\"batch\",\n residual=True,\n activation=\"leakyrelu\",\n transpose=False,\n ):\n super(ConvBlock, self).__init_... | [
[
"torch.nn.Dropout2d",
"torch.nn.ConvTranspose2d",
"torch.nn.ELU",
"torch.nn.Conv2d",
"torch.nn.InstanceNorm2d",
"torch.nn.LeakyReLU",
"torch.nn.SELU",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
JSharpClone/thesis | [
"63c742ec6d2b97ebaddb3d2212435a65b6777dd0"
] | [
"models/model.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nfrom torchvision import models\r\n\r\nfrom lib.rpn_util import *\r\nfrom models.CA import *\r\nfrom models import resnet\r\n\r\nimport numpy as np\r\n\r\nclass RPN(nn.Module):\r\n\r\n def __init__(self, phase, conf):\r\n super(RPN, self).__init__()\r\n trai... | [
[
"torch.nn.Softmax",
"torch.nn.Dropout",
"torch.nn.Dropout2d",
"torch.cat",
"torch.nn.Conv2d",
"torch.from_numpy",
"torch.tensor",
"torch.nn.LeakyReLU",
"numpy.load",
"torch.nn.ReLU",
"numpy.array"
]
] |
fmlopezguzman/low-cost-eeg-classification | [
"9c654bc8b8166c37b2126c6a13eca1bc1866562d"
] | [
"spikerClient.py"
] | [
"# Backyard Brains Sep. 2019\r\n# Made for python 3\r\n# First install serial library\r\n# Install numpy, pyserial, matplotlib\r\n# pip3 install pyserial\r\n#\r\n# Code will read, parse and display data from BackyardBrains' serial devices\r\n#\r\n# Written by Stanislav Mircic\r\n# stanislav@backyardbrains.com\r\n\r... | [
[
"numpy.linspace",
"numpy.append",
"numpy.savetxt",
"numpy.array",
"numpy.vstack"
]
] |
bideeen/ivy | [
"d167c245c2c94fb88a6cb00286bf37154e435aea"
] | [
"ivy_tests/test_ivy/test_functional/test_nn/test_losses.py"
] | [
"\n# global\nimport pytest\nimport numpy as np\n\n# local\nimport ivy\nimport ivy.functional.backends.numpy\nimport ivy_tests.test_ivy.helpers as helpers\n\n\n# cross_entropy\n@pytest.mark.parametrize(\n \"t_n_p_n_res\", [([[0., 1., 0.]], [[0.3, 0.2, 0.5]], [1.609438])])\n@pytest.mark.parametrize(\n \"dtype\"... | [
[
"numpy.asarray"
]
] |
kedartatwawadi/OpticalFlow_Visualization | [
"9d05cc6cac9ecb1dc16ee8cb9d291c2ff3e68ce6"
] | [
"example/main.py"
] | [
"# MIT License\n#\n# Copyright (c) 2018 Tom Runia\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, mod... | [
[
"numpy.load",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show"
]
] |
Exo-TiC/ExoTiC-ISM | [
"9602c4e7c601640c72e7c5cc5fe44fbe5df93a13"
] | [
"exoticism/tests/test_marginalisation.py"
] | [
"import csv\nimport glob\nimport os\nimport numpy as np\n\nfrom exoticism.config import CONFIG_INI\nfrom exoticism.margmodule import find_data_parent\nfrom exoticism.marginalisation import total_marg\n\n\ndef test_marginalisation_w17_fit_time():\n \"\"\"Test the correct marginalised parameters for W17 with the g... | [
[
"numpy.allclose"
]
] |
pvdstel/CLMR | [
"4e5d9984e05d40989394dbdbba0fe097c6d3cb69"
] | [
"export.py"
] | [
"\"\"\"\nThis script will extract a pre-trained CLMR PyTorch model to an ONNX model.\n\"\"\"\n\nimport argparse\nimport os\nimport torch\nfrom collections import OrderedDict\nfrom copy import deepcopy\nfrom clmr.models import SampleCNN, Identity\nfrom clmr.utils import load_encoder_checkpoint, load_finetuner_checkp... | [
[
"torch.randn",
"torch.onnx.export"
]
] |
grantsrb/supervised_gym | [
"10c5f41d67a6c95a087ed1a83bdef1400ec689c3"
] | [
"tests/unittests.py"
] | [
"import unittest\nimport supervised_gym as sg\nimport torch\nimport numpy as np\nimport torch.multiprocessing as mp\n\nclass ExperienceTests(unittest.TestCase):\n def test_shared_tensors(self):\n hyps = {\n \"exp_len\": 13,\n \"batch_size\": 16,\n \"obs_shape\": (3,9,9),\n... | [
[
"torch.randn",
"numpy.array_equal",
"torch.arange"
]
] |
lisy14liz/importance-sampling | [
"15040a3c4435735e9b0155d3d0228909bd4e47b7"
] | [
"importance_sampling/samplers.py"
] | [
"#\n# Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/\n# Written by Angelos Katharopoulos <angelos.katharopoulos@idiap.ch>\n#\n\nfrom functools import partial\n\nfrom blinker import signal\nimport tensorflow as tf\nfrom tensorflow.keras.layers import Dense, Embedding, Flatten, Input, LSTM, Masking... | [
[
"numpy.zeros_like",
"numpy.exp",
"numpy.roll",
"numpy.hstack",
"numpy.ones_like",
"tensorflow.keras.layers.Embedding",
"numpy.arange",
"tensorflow.math.reduce_sum",
"tensorflow.keras.layers.Flatten",
"numpy.log",
"tensorflow.keras.layers.Masking",
"numpy.random.choi... |
dingyunxing/James-code-paradise | [
"688a8e6c8b569bacb6ac9f6754f43a5a3a7eba7a"
] | [
"model.py"
] | [
"'''This program aims to build a multiple regression model\n based on a given CSV file.\n The whole project implementation by top-down design.\n It includes the model construction and the prediction.\n Main functions includes:\n 1.Open csv file and read it, all variables should be int or float.\n 2.Defi... | [
[
"numpy.array",
"numpy.mat"
]
] |
Mikma03/Python_Bill_Lubanovic_BookCodes | [
"8b5b228bb500a08af645a1db6f7c5f33ef5f0512"
] | [
"20. Chapter_/ch20_matplotlib.py"
] | [
"import matplotlib.pyplot as plt\nfrom random import randint\n\nlinear = list(range(1, 21))\nwiggly = list(num + randint(-1, 1) for num in linear)\n\nfig, plots = plt.subplots(nrows=1, ncols=3)\n\nticks = list(range(0, 21, 5))\nfor plot in plots:\n plot.set_xticks(ticks)\n plot.set_yticks(ticks)\n\nplots[0].s... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
raoshenglong/Course | [
"55ab4c31164c6a169b9eb606bf9c0eaf36a1b4a0"
] | [
"src/LinearRegressSimplify.py"
] | [
"import numpy as np\nimport torch\nfrom torch.utils import data\nfrom torch import nn\nfrom d2l import torch as d2l\n\ndef load_array(data_arrays, batch_size, is_train=True): #@save\n \"\"\"构造一个PyTorch数据迭代器。\"\"\"\n dataset = data.TensorDataset(*data_arrays)\n return data.DataLoader(dataset, batch_size, s... | [
[
"torch.utils.data.TensorDataset",
"torch.utils.data.DataLoader",
"torch.tensor",
"torch.nn.Linear",
"torch.nn.MSELoss"
]
] |
HumamAlwassel/BMN-Boundary-Matching-Network | [
"152123068eccbde4ab0ed89cc3e842457484b9fc"
] | [
"detection_result_generate_cuhk_share.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue May 23 14:21:39 2017\n\n@author: wzmsltw\n\"\"\"\nimport json\nimport os\n\nimport numpy as np\nimport pandas as pd\nfrom progressbar import ProgressBar\n\npbar = ProgressBar()\nimport multiprocessing as mp\n\n\ndef load_json(file):\n with open(file) as json_file:... | [
[
"numpy.square",
"pandas.read_csv",
"numpy.argmax",
"pandas.DataFrame"
]
] |
frozsgy/personality-analysis-framework | [
"8375de1f18bda7a885eb555df5d0764290ec8e98"
] | [
"main.py"
] | [
"import sys\nimport re\n\nimport json\nimport requests\nimport yaml\n\nimport numpy as np\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.feature_extraction.text import TfidfTransformer\nfrom sklearn.feature_extraction.text import CountVectorizer\n\nimport twitter.download\nimport utils.p... | [
[
"sklearn.feature_extraction.text.TfidfTransformer",
"sklearn.feature_extraction.text.CountVectorizer",
"numpy.array",
"numpy.add"
]
] |
gnap/transformers | [
"fcb4f11c9232cee2adce8140a3a7689578ea97de"
] | [
"src/transformers/models/blenderbot_small/modeling_tf_blenderbot_small.py"
] | [
"# coding=utf-8\n# Copyright 2021 The Facebook, Inc and The HuggingFace Inc. team. 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.o... | [
[
"tensorflow.keras.layers.LayerNormalization",
"tensorflow.convert_to_tensor",
"tensorflow.concat",
"tensorflow.control_dependencies",
"tensorflow.zeros",
"tensorflow.cast",
"tensorflow.keras.layers.Dropout",
"tensorflow.tuple",
"tensorflow.gather",
"tensorflow.compat.v1.var... |
Moonlington/Luna | [
"04d1f9075d5f0b2b0b6d1bdcbdf464e8b368872b"
] | [
"cogs/Funstuff.py"
] | [
"import discord\nfrom discord.ext import commands\nfrom cogs.utils import checks\nimport os\nimport random\nimport copy\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nfrom itertools import islice, cycle, tee\nfrom textblob import TextBlob\nfrom io import BytesIO\nimport re\nimport asyncio\nimp... | [
[
"matplotlib.pyplot.gca",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close"
]
] |
EveCharbie/BioptimPaperExamples | [
"89b7daea6686b8c008aa1f8e6d2700f9441231d8"
] | [
"gait/main.py"
] | [
"\"\"\"\nThis is an example on gait biomechanics.\nExperimental data (markers trajectories, ground reaction forces and moments) are tracked.\n\"\"\"\nfrom time import time\n\nimport numpy as np\nimport biorbd_casadi as biorbd\nfrom bioptim import Solver, Shooting\n\nfrom gait.load_experimental_data import LoadData\... | [
[
"numpy.mean"
]
] |
Wapwolf/AttnGANtmp | [
"4be0eb5b301c1af2a903e97912ca1584dd49b7e3"
] | [
"code/main.py"
] | [
"from __future__ import print_function\n\nfrom miscc.config import cfg, cfg_from_file\nfrom datasets import TextDataset\nfrom trainer import condGANTrainer as trainer\n\nimport os\nimport sys\nimport time\nimport random\nimport pprint\nimport datetime\nimport dateutil.tz\nimport argparse\nimport numpy as np\n\nimpo... | [
[
"numpy.random.seed",
"numpy.asarray",
"torch.manual_seed",
"numpy.max",
"torch.cuda.manual_seed_all",
"numpy.argsort"
]
] |
macenpav/nn-convert | [
"764c1a06de1def199880824b789c4133a3fcd533"
] | [
"nn_convert/tf_to_tflite.py"
] | [
"import tensorflow.compat.v1 as tf\nimport argparse\nimport os\n\n\ndef convert_to_tflite(graph_def_file, in_layer_name, out_layer_name, input_shapes=None):\n file_name, file_ext = os.path.splitext(graph_def_file)\n converter = tf.lite.TFLiteConverter.from_frozen_graph(graph_def_file, [in_layer_name], [out_la... | [
[
"tensorflow.compat.v1.lite.TFLiteConverter.from_frozen_graph"
]
] |
YuzhongHuangCS/journal-citation-cartels | [
"7b82d9e081555f5b40eb6cc6f44f65ce1c3c1a0f"
] | [
"workflow/plot-citation-net-cartels.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\nimport warnings\n\nwarnings.simplefilter(action=\"ignore\")\nimport pandas as pd\nimport numpy as np\nfrom scipy import sparse\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport pickle\nimport textwrap\nimport re\nimport sys, os\nimport utils\n\nsys.path.appen... | [
[
"pandas.merge",
"pandas.read_csv",
"matplotlib.pyplot.subplots"
]
] |
kriegeskorte-lab/SIIM-ISIC-Melanoma-Classification-1st-Place-Solution | [
"2c4a5428c6d410e97d2a74aacd5f86b3750d32cf"
] | [
"dataset.py"
] | [
"import os\nimport cv2\nimport numpy as np\nimport pandas as pd\nimport albumentations\nimport torch\nfrom torch.utils.data import Dataset\n\nfrom tqdm import tqdm\n\n\nclass MelanomaDataset(Dataset):\n def __init__(self, csv, mode, meta_features, transform=None):\n\n self.csv = csv.reset_index(drop=True)... | [
[
"pandas.concat",
"numpy.log",
"torch.tensor",
"numpy.log1p",
"numpy.zeros",
"pandas.get_dummies"
]
] |
mbarbetti/tf-gen-models | [
"04926cafae98da5553e118efcc6dca9de7bbd9e9"
] | [
"tf_gen_models/algorithms/gan/WGAN.py"
] | [
"import tensorflow as tf\nfrom tf_gen_models.algorithms.gan import GAN\n\n\nclass WGAN (GAN):\n def __init__ ( self , \n generator ,\n discriminator , \n input_shape = None ,\n output_shape = None ,\n latent_dim = 128 ) -> None:\n... | [
[
"tensorflow.clip_by_value",
"tensorflow.zeros_like",
"tensorflow.reduce_sum",
"tensorflow.reduce_mean"
]
] |
hbyido/attention-learn-to-route | [
"b7988b2fee4eb1e95626f1a3bb114e46c1bf9d18"
] | [
"nets/attention_model.py"
] | [
"import torch\nfrom torch import nn\nimport torch.nn.functional as F\nfrom torch.utils.checkpoint import checkpoint\nimport math\nfrom typing import NamedTuple\nfrom utils.tensor_functions import compute_in_batches\n\nfrom nets.graph_encoder import GraphAttentionEncoder\nfrom torch.nn import DataParallel\nfrom util... | [
[
"torch.nn.functional.softmax",
"torch.nn.functional.log_softmax",
"torch.Tensor",
"torch.isnan",
"torch.cat",
"torch.zeros_like",
"torch.is_tensor",
"torch.nn.Linear",
"torch.nonzero",
"torch.stack",
"torch.nn.functional.tanh"
]
] |
skn123/butterfly | [
"7217b5d93bc78e1229fed3761bcc70d943f604b7"
] | [
"torch_butterfly/multiply.py"
] | [
"import math\nfrom typing import Tuple, Optional\n\nimport torch\nfrom torch.nn import functional as F\n\n\n@torch.jit.script\ndef butterfly_multiply_fw(twiddle: torch.Tensor, input: torch.Tensor, increasing_stride: bool,\n output_size: Optional[int] = None) -> torch.Tensor:\n return tor... | [
[
"torch.ops.torch_butterfly.butterfly_multiply",
"torch.ops.torch_butterfly.butterfly_multiply_bw",
"torch.nn.functional.pad",
"torch.ops.torch_butterfly.butterfly_multiply_fw"
]
] |
MikeFalowski/taurus | [
"ef041bf35dd847caf08a7efbe072f4020d35522e"
] | [
"lib/taurus/qt/qtgui/extra_guiqwt/builder.py"
] | [
"#!/usr/bin/env python\n\n#############################################################################\n##\n# This file is part of Taurus\n##\n# http://taurus-scada.org\n##\n# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain\n##\n# Taurus is free software: you can redistribute it and/or modify\n# it unde... | [
[
"numpy.arange",
"numpy.zeros",
"numpy.isscalar",
"numpy.ones"
]
] |
flexatone/learn-pyarrow | [
"b485ad65f940b555907f6345c07a68e7e3ee3763"
] | [
"test2.py"
] | [
"import datetime\nimport functools\nimport multiprocessing as mp\nimport os\nimport sys\nimport time\nfrom pprint import pprint\nfrom timeit import Timer\n\nimport numpy as np\nimport psutil\nimport pyarrow as pa\nimport pyarrow.compute as pc\n\nfrom util import run_timer\n\n\ndef get_sample_data(rows):\n data =... | [
[
"numpy.random.rand",
"numpy.sum",
"numpy.vstack"
]
] |
monakurp/P4UL | [
"a502de0767fd2f3a06346ca8a72c6201adbe002b"
] | [
"pyPlot/uniplot.py"
] | [
"#!/usr/bin/env python3\n\nimport sys\nimport matplotlib.pyplot as plt\nimport argparse\nfrom utilities import filesFromList, inputIfNone\nfrom plotTools import userLabels, plotXX\n''' \nDescription: A script to plot multiple files with data in [x, y1, y2, ..., yn] format.\nRun the script in the directory where you... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.figure"
]
] |
risto-trajanov/nevergrad | [
"8c123bd5911debc4840c1683112251cee0cf6121",
"8c123bd5911debc4840c1683112251cee0cf6121"
] | [
"nevergrad/functions/iohprofiler/core.py",
"nevergrad/functions/rl/test_envs.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\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 numpy as np\nimport nevergrad as ng\nfrom .. import base\n\n# pylint: disable=import-outside-toplevel\n\... | [
[
"numpy.sqrt"
],
[
"numpy.testing.assert_array_equal",
"numpy.array"
]
] |
dendisuhubdy/TorchProteinLibrary | [
"89f0f6c311658b9313484cd92804682a251b1b97",
"89f0f6c311658b9313484cd92804682a251b1b97"
] | [
"UnitTests/RMSD/Coords2RMSD/test_backward.py",
"UnitTests/ReducedModel/Angles2Backbone/test_forward.py"
] | [
"import sys\nimport os\nimport torch\nimport matplotlib.pylab as plt\nimport numpy as np\nfrom TorchProteinLibrary.RMSD import Coords2RMSD\n\ndef test_gradient(device = 'cpu'):\n\tL=3\n\tx0 = torch.tensor([[2,0,0, 3,0.1,1, 3,0.1,0 ]], dtype=torch.double, device=device).requires_grad_()\n\tx1 = torch.zeros(x0.size()... | [
[
"numpy.sqrt",
"torch.zeros",
"torch.tensor",
"matplotlib.pylab.figure",
"matplotlib.pylab.plot",
"matplotlib.pylab.legend",
"matplotlib.pylab.savefig"
],
[
"torch.zeros",
"numpy.min",
"torch.randn",
"numpy.linalg.norm",
"matplotlib.pylab.title",
"numpy.max",... |
reporeferences/angeloyeo.github.io | [
"c249e860665b918d1144f9cc5093dbe24b384224",
"c249e860665b918d1144f9cc5093dbe24b384224"
] | [
"pics/2020-10-10-autoencoder/pca_and_ae/no02_ae_on_MNIST.py",
"python/20190-08-25_gradient/main.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Oct 14 17:45:44 2020\n\n@author: biosensor1\n\n어떠한 비선형성도 없는 AutoEncoder 제작\n\"\"\"\n\nimport torch\nimport torchvision.transforms as transforms\nfrom torch.utils import data\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport ... | [
[
"matplotlib.pyplot.legend",
"torch.utils.data.DataLoader",
"torch.nn.Linear",
"torch.cuda.is_available",
"torch.device",
"numpy.where",
"torch.nn.MSELoss",
"matplotlib.pyplot.figure"
],
[
"numpy.zeros",
"numpy.linspace"
]
] |
chengconvnet/crack-dection | [
"f4da7e44a2dc1196d26bfdfb1f55374b7a53b302",
"f4da7e44a2dc1196d26bfdfb1f55374b7a53b302"
] | [
"utils/write_plot.py",
"utils/loader.py"
] | [
"# 废弃\n\nfrom matplotlib import pyplot as plt\nimport pandas as pd\nfrom tensorflow.keras.callbacks import ModelCheckpoint\n\n\ndef create_history(save_path_mode, model, epochs, batch_size, train_generator, validation_generator):\n # 模型保存格式默认是saved_model,可以自己定义更改原有类来保存hdf5\n ckpt = ModelCheckpoint(save_path_m... | [
[
"tensorflow.keras.callbacks.ModelCheckpoint",
"pandas.DataFrame.from_dict"
],
[
"tensorflow.data.Dataset.zip",
"tensorflow.image.resize",
"tensorflow.io.read_file",
"tensorflow.data.Dataset.cardinality",
"tensorflow.image.decode_jpeg"
]
] |
JLU2016/CPNDet | [
"2b52fd77944158f46b7968775b7719af5ff81d20"
] | [
"code/config.py"
] | [
"import os\nimport numpy as np\n\nclass Config:\n def __init__(self):\n self._configs = {}\n self._configs[\"dataset\"] = None\n self._configs[\"sampling_function\"] = \"kp_detection\"\n\n # Training Config\n self._configs[\"display\"] = 5\n self._con... | [
[
"numpy.random.RandomState"
]
] |
ihtiihti/reco-gym | [
"70fe31a2f1330869f7efc26b849c509a575503fd"
] | [
"agents/bandit_count.py"
] | [
"import numpy as np\n\nfrom reco_gym import Configuration\n\nfrom .abstract import Agent\n\nbandit_count_args = {\n 'num_products': 10,\n}\n\n\nclass BanditCount(Agent):\n \"\"\"\n Bandit Count\n\n The Agent that selects an Action for the most frequently clicked Action before.\n \"\"\"\n\n def __i... | [
[
"numpy.load",
"numpy.zeros",
"numpy.save"
]
] |
leucinw/TIPTOP | [
"aa072760beef2da5a319ebde4b59577f2fc545e6"
] | [
"IP_MatchTXYZ.py"
] | [
"''' \nMIT License\n\nCopyright (c) 2021 Chengwen Liu\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, ... | [
[
"numpy.loadtxt"
]
] |
wvsharber/BMS_testing | [
"aa3d542249b2a88ed97de6b833f71ec7eb1065fb"
] | [
"src/beatmapsynth.py"
] | [
"from __future__ import print_function\nimport numpy as np\nimport pandas as pd\nimport librosa\nimport json\n#import requests\nimport pickle\n#import matplotlib.pyplot as plt\nfrom io import BytesIO, TextIOWrapper, StringIO\nfrom zipfile import ZipFile\nimport os\nimport soundfile as sf\nimport audioread\nfrom pyd... | [
[
"numpy.diag",
"pandas.concat",
"numpy.abs",
"pandas.Series",
"numpy.random.choice",
"numpy.median",
"scipy.ndimage.median_filter",
"scipy.sparse.csgraph.laplacian",
"pandas.DataFrame",
"numpy.cumsum",
"numpy.concatenate",
"scipy.linalg.eigh",
"numpy.flatnonzero"... |
jsnydes/tpu | [
"d06f0af0e48bb5e815b4db48c2d1e7168066064a"
] | [
"models/official/detection/modeling/shapemask_model.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.compat.v1.reshape",
"tensorflow.compat.v1.sigmoid",
"tensorflow.compat.v1.shape",
"tensorflow.compat.v1.estimator.tpu.TPUEstimatorSpec",
"tensorflow.compat.v1.cast",
"tensorflow.compat.v1.transpose"
]
] |
francois-berder/boardfarm | [
"7c0c8397e4e0f4ccd97ec88e7d737086bdde14d1"
] | [
"analysis/analysis.py"
] | [
"# Copyright (c) 2015\n#\n# All rights reserved.\n#\n# This file is distributed under the Clear BSD license.\n# The full text can be found in LICENSE in the root directory.\n\nimport os\nimport re\n\n# no repr\nnewline = r\"\\r\\n\\[[^\\]]+\\] \"\nnewline_match = r\"\\r\\n\\[([^\\]]+)\\] \"\n# with repr\nnewline_re... | [
[
"matplotlib.pyplot.gca",
"matplotlib.use",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlabel",
"matplotlib.ticker.FormatStrFormatter",
"matplotlib.pyplot.ylabel"
]
] |
joefarrington/bloodbank_rl | [
"f285581145034b498f01c9b44f95437ceddb042a"
] | [
"bloodbank_rl/tianshou_utils/logging.py"
] | [
"# Create a logger that will use mlflow\n# This is heavily based on the PyTorch Lightning MLFlow logger\n# https://github.com/PyTorchLightning/PyTorch-Lightning/blob/master/pytorch_lightning/loggers/mlflow.py\n\nimport tianshou\nimport numpy as np\nfrom datetime import datetime\nfrom pathlib import Path\nimport tor... | [
[
"numpy.hstack",
"numpy.array",
"numpy.mean"
]
] |
HerrYu123/deeplabv3 | [
"4f29d2bfb725a77b22fb04e1e0006ae742fa5d47"
] | [
"utils/preprocess_data.py"
] | [
"# camera-ready\n\nimport pickle\nimport numpy as np\nimport cv2\nimport os\nfrom collections import namedtuple\nfrom utils import check_mkdir\nfrom ipdb import set_trace as b\nfrom tqdm import tqdm\n# (NOTE! this is taken from the official Cityscapes scripts:)\nLabel = namedtuple( 'Label' , [\n\n 'name' ... | [
[
"numpy.log",
"numpy.vectorize",
"numpy.sum",
"numpy.equal"
]
] |
sljlp/veGiantModel | [
"c6ba5e9fc6c7ce74329afb2d984c5aa591a8a535"
] | [
"src/veGiantModel/engine/p2p.py"
] | [
"# Copyright (c) 2021, ByteDance Inc. All rights reserved.\r\n'''\r\nCopyright 2019 The Microsoft DeepSpeed Team\r\n'''\r\n\r\nimport os\r\nimport torch\r\nimport torch.distributed as dist\r\nfrom deepspeed.utils import logger, log_dist\r\n\r\nENABLE_PYTORCH_BROADCAST = os.environ.get(\"ENABLE_PYTORCH_BROADCAST\",... | [
[
"torch.distributed.get_rank",
"torch.distributed.broadcast",
"torch.distributed.new_group",
"torch.distributed.barrier"
]
] |
50Death/Visual-BigData-Algorithm | [
"7ffc8e6776f4bced870c37b6c636be75f273ac78"
] | [
"BigData2/K-Means.py"
] | [
"import pandas\nimport numpy\nfrom sklearn.cluster import KMeans\nfrom sklearn import metrics\nimport matplotlib.pyplot as plt\n\nCLUSTER_NUMBER = 10\nRANDOM_STATE = 10\n\n\ndef read_data():\n print('Loading CSV file...')\n csv_data = pandas.read_csv(\"F:\\\\Python3\\\\1DataSet\\\\sf-crime\\\\train.csv\")\n ... | [
[
"pandas.read_csv",
"sklearn.metrics.calinski_harabasz_score",
"matplotlib.pyplot.scatter",
"sklearn.cluster.KMeans",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.xlabel",
"sklearn.datasets.samples_generator.make_blobs",
"numpy.array",
"matplotlib.pyplot.pause",
"matplotlib.p... |
haoningwu3639/EE231_Project | [
"4e9596aaf2c3d2f157cca517d0d6059f6d117c32"
] | [
"SuperPoint/superpoint/models/classical_detectors_descriptors.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport cv2\nimport sys\n\n# sys.path.append('/cluster/home/pautratr/3d_project/SuperPointPretrainedNetwork')\n\nfrom .base_model import BaseModel\nfrom .utils import box_nms\n# from demo_superpoint import SuperPointNet, SuperPointFrontend\n\n\ndef classical_detector_des... | [
[
"tensorflow.device",
"tensorflow.greater_equal",
"numpy.uint8",
"tensorflow.reduce_sum",
"numpy.transpose",
"numpy.array",
"numpy.zeros"
]
] |
migalkin/NodePiece | [
"a2189801657d41797a3db99c38f071a6468be2c5"
] | [
"oos_lp/src/vocab/nodepiece_encoder.py"
] | [
"import torch\nimport numpy as np\nimport random\nimport torch.nn.functional as F\n\nfrom torch import nn\nfrom vocab.nodepiece_tokenizer import NodePiece_Tokenizer\nfrom torch.nn import TransformerEncoderLayer, TransformerEncoder\n\nfrom tqdm import tqdm\nfrom collections import defaultdict\nfrom typing import Opt... | [
[
"torch.nn.Dropout",
"torch.zeros",
"torch.cat",
"torch.nn.Embedding",
"torch.tensor",
"torch.nn.TransformerEncoderLayer",
"torch.nn.Linear",
"numpy.random.permutation",
"torch.no_grad",
"numpy.mean",
"torch.nn.TransformerEncoder",
"torch.nn.init.xavier_uniform_",
... |
ermekaitygulov/made-robotics | [
"aefaa96627bf2d871fb925acfaab43b3deb8ee57"
] | [
"week03_turtle_world_first_node/signal_generator_node.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\nimport rospy\nfrom std_msgs.msg import Float32\n\n\nclass SignalGenerator:\n def __init__(self):\n # Creaytin publisher for the signal\n self.signal_pub = rospy.Publisher(\"signal\", Float32, queue_size=10)\n\n def generate_and_publish_signal(self):\... | [
[
"numpy.random.randn",
"numpy.sin"
]
] |
lateral/hyperplane-hasher | [
"41c0969087f30cb0c5876f860d234028e44692d9"
] | [
"test_classes/test_dynamodb_adapter.py"
] | [
"#!/usr/bin/python\n\nimport unittest\nimport numpy as np\nfrom nn.dynamodb_adapter import DynamoDBAdapter\nfrom test_key_value_store import KeyValueStoreTestsAbstract\nimport boto.dynamodb2\nfrom boto.dynamodb2.fields import HashKey, RangeKey\nfrom boto.dynamodb2.table import Table\nfrom boto.dynamodb2.types impor... | [
[
"numpy.dtype"
]
] |
Ttantto/wph_quijote | [
"2ada4366794d6bedf070862fbe0172a2045e5483"
] | [
"wph_syntheses/sufficient_stat.py"
] | [
"import torch\n\nfrom .utils import periodic_dis\n\n\ndef compute_idx_of_sufficient_stat(L, J, dj, dl, dn):\n L2 = L * 2\n idx_j1, idx_j2, idx_k1, idx_k2, idx_ell2, idx_dn1, idx_dn2 = [], [], [], [], [], [], []\n idx_lists = (idx_j1, idx_j2, idx_k1, idx_k2, idx_ell2, idx_dn1, idx_dn2)\n\n # j1=j2, k1=0,... | [
[
"torch.tensor"
]
] |
Miracle2333/BSPPN | [
"f29182972fd4a13c47d5fb08b7e4faea2aabd77d"
] | [
"building.py"
] | [
"\"\"\"\nMask R-CNN\nConfigurations and data loading code for MS COCO.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\n------------------------------------------------------------\n\nUsage: import the module (see Jupyter notebooks for ex... | [
[
"numpy.max",
"numpy.size",
"numpy.min",
"numpy.ones"
]
] |
roggiezhang-nv/mxnet-sample | [
"d7be7c4c4ca20beff93a152c62181774b5c122d8"
] | [
"python/ml/vision/style_transfer/__init__.py"
] | [
"import mxnet as mx\nimport numpy as np\n\ndef __get_style_gram(styles):\n gram_list = []\n gram_scale_list = []\n for style in styles:\n shape = style.shape\n style = mx.nd.reshape(style, shape = (int(shape[1]), int(np.prod(shape[2:]))))\n gram = mx.nd.FullyConnected(style, style, no_... | [
[
"numpy.array",
"numpy.prod"
]
] |
vitekpoor/ZDO2021 | [
"6494eb2e241ad07ef2ded513da520441e1327c97"
] | [
"tests/test_zdo2021.py"
] | [
"import pytest\nimport os\nimport skimage.io\nimport glob\nimport numpy as np\nimport sklearn.metrics\nimport matplotlib.pyplot as plt\nimport json\nfrom pathlib import Path\nfrom skimage.draw import polygon\n\nimport zdo2021.main\n\n# cd ZDO2021\n# python -m pytest\n\ndef test_run_random():\n vdd = zdo2021.main... | [
[
"matplotlib.pyplot.imshow",
"numpy.expand_dims",
"matplotlib.pyplot.contour",
"numpy.mean",
"numpy.array",
"matplotlib.pyplot.show",
"numpy.zeros"
]
] |
mehfuzz/new_model | [
"611e105b4adf3011ef7fa8508391b8f88a294cd5"
] | [
"official/core/train_utils.py"
] | [
"# Copyright 2021 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.Variable",
"tensorflow.io.gfile.exists",
"tensorflow.train.Checkpoint",
"tensorflow.io.gfile.GFile",
"tensorflow.io.gfile.glob",
"tensorflow.io.gfile.makedirs",
"tensorflow.io.gfile.remove",
"tensorflow.io.gfile.rmtree",
"tensorflow.summary.scalar"
]
] |
PipelineAI/models | [
"d8df07877aa8b10ce9b84983bb440af75e84dca7",
"d8df07877aa8b10ce9b84983bb440af75e84dca7"
] | [
"keras/mnist-v1/model/pipeline_invoke_tfserving.py",
"tensorflow/mnist-retrain/model/pipeline_invoke_tflite.py"
] | [
"import os\nimport numpy as np\nimport json\nimport logging\n\nfrom pipeline_model import TensorFlowServingModel\nfrom pipeline_monitor import prometheus_monitor as monitor\nfrom pipeline_logger import log\n\nimport tensorflow as tf\n\n_logger = logging.getLogger('pipeline-logger')\n_logger.setLevel(logging.INFO)\n... | [
[
"numpy.array",
"tensorflow.make_tensor_proto"
],
[
"numpy.array",
"tensorflow.contrib.lite.TocoConverter.from_saved_model",
"tensorflow.contrib.lite.Interpreter"
]
] |
YacobBY/ICDAR2019-ArT-Recognition-Alchemy | [
"5b03f73386f0a45ecc498f653d96012caa4a0c76"
] | [
"Source/datasets/svt.py"
] | [
"from __future__ import absolute_import\n\nimport cv2\nimport os\nimport sys\nfrom PIL import Image, ImageDraw, ImageFont\nimport numpy as np\nimport math\nimport random\nimport re\nimport json\n\nimport torch\nimport torch.utils.data as data\nimport torchvision.transforms as transforms\n\nfrom Source.utils.data im... | [
[
"numpy.expand_dims",
"numpy.tile",
"torch.from_numpy",
"numpy.ones",
"numpy.full",
"numpy.transpose",
"numpy.array",
"numpy.zeros"
]
] |
arekmula/tello_drawer | [
"464e233173634609159757f803e597337e82196c"
] | [
"src/drone_processing/helpers.py"
] | [
"import numpy as np\nimport time\n\n\ndef convert_to_distance_in_xy(point_list):\n \"\"\"\n Converts list of points in space to list of distances between previous point in list\n\n :param point_list:\n :return:\n \"\"\"\n temp_list = []\n for i in range(1, len(point_list)):\n temp_list.a... | [
[
"numpy.sqrt"
]
] |
uoe-agents/GRIT | [
"905a0048a9527997c2bdc7f817828e2604750f5f"
] | [
"core/lanelet_helpers.py"
] | [
"import shapely\nfrom lanelet2 import geometry\nfrom lanelet2.core import BasicPoint2d\nfrom shapely.geometry import Polygon, LineString\nfrom shapely.errors import TopologicalError\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nclass LaneletHelpers:\n\n @classmethod\n def plot_path(cls, path):\n ... | [
[
"matplotlib.pyplot.plot",
"numpy.arctan2",
"numpy.argmin"
]
] |
charliec443/TreeGrad2 | [
"87eecc8ba857056f0ff6be0a7bd6544e0ae38991"
] | [
"scratch/ebm_model_debugging.py"
] | [
"\"\"\"\nUses a base EBM model for learning an architecture which we can then apply\ntransfer learning or fine-tuning\n\nReference: https://tensorflow.google.cn/recommenders/examples/featurization?hl=zh-cn\n\nAdding categorical support...\nWe just want to test for simple 2d examples\n\"\"\"\nimport copy\nfrom colle... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.keras.layers.Activation",
"tensorflow.gather_nd",
"tensorflow.concat",
"sklearn.datasets.make_moons",
"tensorflow.stack",
"tensorflow.keras.layers.Dense",
"tensorflow.python.ops.numpy_ops.np_config.enable_numpy_behavior",
"sklearn.mod... |
sangxia/nips-2017-adversarial | [
"6b766bb019a82189912236860b1850a25aad1737"
] | [
"submissions/nontargeted_attack/fgsm_par.py"
] | [
"import time\nstart_time = time.time()\n\nimport multiprocessing as mp\nmp.set_start_method('fork')\n\nimport ctypes as c\n\nimport argparse\nimport os\nimport numpy as np\nimport pandas as pd\nfrom PIL import Image\nimport image_generators\n\ndef get_array(raw_arr, dims):\n return np.frombuffer(raw_arr).reshape... | [
[
"pandas.read_csv",
"numpy.frombuffer",
"numpy.random.normal",
"numpy.max",
"numpy.prod",
"tensorflow.set_random_seed",
"numpy.sum"
]
] |
Pathi-rao/NNs_Family | [
"9bb91184a9a2d7cd471e379ddaff9276f6bc1f64"
] | [
"Siamese_NNs/AT&T_anomaly_detection/model_debugging.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.nn.modules import activation\nfrom torchsummary import summary\n\nclass Print(nn.Module):\n def __init__(self):\n super(Print, self).__init__()\n\n def forward(self, x):\n print(x.size())\n return x\n\nclass SiameseNetwork(nn.Module):\n ... | [
[
"torch.nn.ReflectionPad2d",
"torch.randn",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
shahab-ehsanfar/Channel_Estimation_UW_802_11p_11bd | [
"fb8585dba523d95cfa18fce7bcfa27333e8adf97"
] | [
"Python_Codes/DNN_Testing.py"
] | [
"import pickle\nimport numpy as np\nfrom scipy.io import loadmat\nfrom tensorflow.keras.models import load_model\n#import sys\nfrom sklearn.preprocessing import StandardScaler\nimport scipy.io\n\nDNN_Model = 30\n#Ch = sys.argv[1]\n#mod = sys.argv[2]\n#scheme = sys.argv[3]\n#hl1 = sys.argv[4]\n#hl2 = sys.argv[5]\n#h... | [
[
"numpy.arange",
"sklearn.preprocessing.StandardScaler"
]
] |
zhegan27/VILLA | [
"80d3602d71d65700eab373acb0507e31e251b7e7"
] | [
"data/vcr.py"
] | [
"\"\"\"\nCopyright (c) Microsoft Corporation.\nLicensed under the MIT license.\n\nVCR dataset\n\"\"\"\nimport copy\nimport json\nimport torch\nfrom torch.nn.utils.rnn import pad_sequence\nfrom toolz.sandbox import unzip\nfrom cytoolz import concat\nfrom .data import (DetectFeatTxtTokDataset, TxtTokLmdb, DetectFeatL... | [
[
"torch.stack",
"torch.tensor",
"torch.nn.utils.rnn.pad_sequence",
"torch.cat"
]
] |
gitaar9/Multiview2Novelview | [
"5b3dd8c33f8de4659fbbaedfc59601098903968d"
] | [
"temporary_scripts/create_dataset_from_folder.py"
] | [
"import h5py\nimport numpy as np\n\n\nh = h5py.File(\"test\", 'w')\n\n\nid = '123'\n# Example of ids:\n# f10263256eeb840b732c9e6120e90cf8_18_20\n# 11c9c57efad0b5ec297936c81e7f6629_27_0\npose = np.array([2, 3])\n# Example of poses:\n# 27 0\n# 18 20\n# 0 20\nimage = np.array([1]) # Shape should be 256, 256, 3\nh.cre... | [
[
"numpy.array"
]
] |
hanskrupakar/MRI-tumor-segmentation-Brats | [
"5a1a51b159a556261cd485db45f4d705974c86f4"
] | [
"tf_models.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras.layers import Conv3D, MaxPooling3D, UpSampling3D, Activation, Conv3DTranspose\nfrom tf_layers import *\n\n\ndef PlainCounterpart(input, name):\n\n x = Conv3DWithBN(input, filters=24, ksize=3, strides=1, padding='same', name=name + '_conv_15rf_1x')\n x = Conv3DWi... | [
[
"tensorflow.keras.layers.Conv3D",
"tensorflow.keras.layers.Activation"
]
] |
cyclone923/cups-rl | [
"27e9588e9648c394abcb4db66408e9242724047b"
] | [
"algorithms/rainbow/memory.py"
] | [
"\"\"\"\nAdapted from https://github.com/Kaixhin/Rainbow\n\"\"\"\nimport random\nfrom collections import namedtuple\nimport torch\nimport numpy as np\n\n\n# Segment tree data structure where parent node values are sum/max of children node values\nclass SegmentTree:\n \"\"\"\n This class implements a sum-tree,... | [
[
"torch.zeros",
"numpy.power",
"torch.cat",
"torch.tensor",
"torch.stack",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros",
"torch.device"
]
] |
voithru/asr-text_classification-pipeline | [
"720106cc7e06e7d7a811dee14f660be2b4fb97fc"
] | [
"stt/asr/asr_processor.py"
] | [
"import json\nfrom pathlib import Path\n\nimport librosa\nimport torch\nfrom transformers import (\n Wav2Vec2CTCTokenizer,\n Wav2Vec2FeatureExtractor,\n Wav2Vec2ForCTC,\n Wav2Vec2Processor,\n)\n\nfrom ..parameters import ASRParameters\n\n\nclass ASRProcessor:\n def __init__(self, asr_params: ASRParam... | [
[
"torch.no_grad",
"torch.argmax"
]
] |
cs60050/TeamGabru | [
"6cdc321ad0b2d9fc1ec5b0b638a880865d4d88c1"
] | [
"3-Time-Series-Analysis/outlier_detection/demo_pixel.py"
] | [
"import cv2\nimport pickle\nimport numpy as np\nimport os\nimport glob\n\ntestfolders = [24,32]\n\nbasepath = \"/home/prabhat/Documents/Anomaly/dataset/UCSD_Anomaly_Dataset.v1p2/UCSDped1/Test\"\n\n\n\n\ndef process_atom(bins, magnitude, fmask, tag_image, out, image_out, clf, atom_shape=[10,10,5]):\n\n\tbin_count = ... | [
[
"numpy.sqrt",
"numpy.arange",
"numpy.arctan2",
"numpy.ceil",
"numpy.count_nonzero",
"numpy.zeros"
]
] |
msa1906/practiceOfDeepLearning | [
"f49aca4532c155597c669cf2189f211cafbebf96"
] | [
"tensorflow/contrib/linear_optimizer/python/ops/sdca_ops.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.state_ops.assign_add",
"tensorflow.python.ops.data_flow_ops.dynamic_stitch",
"tensorflow.python.ops.string_ops.string_to_hash_bucket_fast",
"tensorflow.python.framework.ops.device",
"tensorflow.python.ops.state_ops.scatter_add",
"tensorflow.python.ops.math_ops.sub",
... |
maiskovich/deepbrain | [
"df9d5968d26ec6248da6f1b8046eedff36439507"
] | [
"deepbrain/train/extractor/cc359_to_tfrecord.py"
] | [
"import tensorflow as tf\nif tf.__version__ > \"2.0.0\":\n import tensorflow.compat.v1 as tf\nimport os\nimport nibabel as nib\nimport numpy as np\nimport random\nimport re\nfrom skimage.transform import resize\n\n\nfrom const import *\n\n\ndef int64_feature(value):\n return tf.train.Feature(int64_list=tf.tra... | [
[
"tensorflow.compat.v1.train.BytesList",
"tensorflow.compat.v1.train.Int64List",
"numpy.max",
"tensorflow.compat.v1.train.FloatList",
"numpy.zeros_like"
]
] |
safesact/scripts | [
"a2c6a315db304062be7b153b385ef0afc6ef216d"
] | [
"machine_learning/fraud_predictor.py"
] | [
"import pickle\nfrom .btc_dataloader import get_account_summary\nimport numpy as np\n\nmodel_path = \"models/rfc_bitcoin.bin\"\n\ndef predict_if_btc_fraud(btc_address):\n rfc_clf = pickle.load(open(model_path, 'rb'))\n in_data = get_account_summary(btc_address)\n pred = rfc_clf.predict(np.array(in_data).re... | [
[
"numpy.array"
]
] |
rezaarmand/sngan.pytorch | [
"fcd0ce118e3e7663e7ec32920a8b571aab0e40cc"
] | [
"models/gen_resblock.py"
] | [
"# -*- coding: utf-8 -*-\n# @Date : 3/26/20\n# @Author : Xinyu Gong (xy_gong@tamu.edu)\n# @Link : None\n# @Version : 0.0\n\nimport torch.nn as nn\n\n\nclass GenBlock(nn.Module):\n def __init__(self, in_channels, out_channels, hidden_channels=None, ksize=3, pad=1,\n activation=nn.ReLU(), up... | [
[
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.UpsamplingNearest2d",
"torch.nn.BatchNorm2d"
]
] |
sagardsaxena/img2img_sa | [
"16e3b825da42348cfb1d98af5fa65101896e3765"
] | [
"sagan_models.py"
] | [
"'''\r\nPytorch implementation of Self-Attention Generative Adversarial Networks (SAGAN)\r\nhttps://github.com/heykeetae/Self-Attention-GAN\r\n'''\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom torch.autograd import Variable\r\nfrom spectral import SpectralNorm\r\nimport num... | [
[
"torch.nn.Softmax",
"torch.nn.Sequential",
"numpy.log2",
"torch.nn.ConvTranspose2d",
"torch.zeros",
"torch.nn.Conv2d",
"torch.nn.Tanh",
"torch.bmm",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
idiap/wav2vec-lfmmi | [
"2dc997d6b5b2ae3bb42ffd7df46158b7abc64d01"
] | [
"espresso/models/external_language_model.py"
] | [
"# Copyright (c) Yiming Wang\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\n\nimport torch\n\nfrom espresso.data import AsrDictionary\nfrom espresso.tools.lexical_prefix_tree import lexical_prefix_tree\nfrom espresso.t... | [
[
"torch.cumsum",
"torch.no_grad"
]
] |
Helmholtz-AI-Energy/kseta_2021 | [
"fa6398817ffd4e4478e48164a471d1fa612c954f"
] | [
"notebooks/util.py"
] | [
"import os.path\nimport pickle\nimport requests\nimport torch\n\n\nFILE_NAME = 'decays.pkl'\n\n\ndef download_data(path: str = 'https://bwsyncandshare.kit.edu/s/xDm7iBdKBZKYoJG/download') -> torch.Tensor:\n \"\"\"\n Download the data containing particle decays simulated with phasespace\n \"\"\"\n if not... | [
[
"torch.tile"
]
] |
FitMachineLearning/rocket-lander | [
"c0fef26c8bd92c6826a1380f580079eeb7b904ef"
] | [
"Main_Keras.py"
] | [
"'''\nLunarLanderContinuous solution with\n - Selective Memory\n - Actor Critic\n - Parameter Noising\n - Q as discriminator\nsolution by Michel Aka author of FitML github blog and repository\nhttps://github.com/FitMachineLearning/FitML/\nhttps://www.youtube.com/channel/UCi7_WxajoowBl4_9P0DhzzA/featured\nUpdate\nDe... | [
[
"numpy.random.random",
"numpy.abs",
"numpy.alen",
"numpy.power",
"numpy.arange",
"numpy.save",
"numpy.concatenate",
"numpy.std",
"numpy.vectorize",
"numpy.argmax",
"numpy.random.rand",
"numpy.load",
"numpy.array",
"numpy.zeros",
"numpy.vstack",
"nump... |
zrphercule/onnx | [
"781545783a4e2bbbda48fc64318fb2c6d8bbb3cc"
] | [
"onnx/backend/test/case/node/reshape.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport numpy as np # type: ignore\n\nimport onnx\nfrom ..base import Base\nfrom . import expect\n\n\nclass Reshape(Base):\n\n @staticmethod\n def export(... | [
[
"numpy.reshape",
"numpy.array",
"numpy.random.random_sample"
]
] |
CodyScholtens/Phy | [
"9a330b9437a3d0b40a37a201d147224e6e7fb462"
] | [
"phy/utils/tests/test_context.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"Test context.\"\"\"\n\n#------------------------------------------------------------------------------\n# Imports\n#------------------------------------------------------------------------------\n\nfrom pickle import dump, load\n\nimport numpy as np\nfrom numpy.testing import asser... | [
[
"numpy.arange",
"numpy.random.rand"
]
] |
lberrada/convex_adversarial | [
"419f4b2fea9f9e84e12b9837f71b0eb6453954b2"
] | [
"examples/trainer.py"
] | [
"\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom convex_adversarial import robust_loss, robust_loss_parallel\nimport torch.optim as optim\nfrom problems import store_in_xp\n\nimport numpy as np\nimport time\nimport gc\n\nfrom attacks import _pgd\n\nDEBUG = False\n\ndef train_robust(... | [
[
"torch.optim.Adam",
"torch.nn.CrossEntropyLoss",
"torch.cat",
"torch.utils.data.DataLoader",
"torch.cuda.empty_cache",
"torch.utils.data.sampler.SubsetRandomSampler",
"torch.set_grad_enabled",
"torch.no_grad",
"torch.clamp",
"torch.autograd.Variable"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.