repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
bombaci-vsc/sarpy | [
"3e31e9d7fca77612b60f2507f6f7068d1660a3e2"
] | [
"sarpy/io/complex/other_nitf.py"
] | [
"\"\"\"\nWork in progress for reading some other kind of complex NITF.\n\"\"\"\n\n__classification__ = \"UNCLASSIFIED\"\n__author__ = \"Thomas McCullough\"\n\nimport logging\nfrom typing import Union\n\nfrom datetime import datetime\nimport numpy\nfrom scipy.constants import foot\n\nfrom sarpy.compliance import str... | [
[
"numpy.sin",
"numpy.array",
"numpy.log",
"numpy.any",
"numpy.sqrt",
"numpy.cos",
"numpy.deg2rad",
"numpy.isfinite",
"numpy.log10",
"numpy.dtype",
"numpy.datetime64"
]
] |
JoyeBright/Deep-Learning | [
"ba62cc8b3cbeeacc11b69f52999aac2bd0d7f018"
] | [
"ActivationFunction.py"
] | [
"# Forward Propagation Algorithm By Using Activation Function\nimport numpy as np\n\n# Define rectified linear unit function\n\n\ndef relu(inp):\n out = max(0, inp)\n return out\n\n\ninput_data = np.array([2,3])\n\n# Using dictionary in order to save weights of hidden and output layer\nweights = { 'node0': np... | [
[
"numpy.array"
]
] |
ThomasDemaris/TheFinalFaceIt | [
"1c6dc575000bba02d847062b002c15e9409eaa50"
] | [
"trainDatabase.py"
] | [
"#!/usr/bin/env python\n\nimport os\nimport cv2\nimport sys\nimport shutil\nimport random\nimport operator\nimport sqlite3\nimport pickle\nimport numpy as np\n\n\"\"\"\nTrain and save the eigenvectors for a specified database.\n\nExample Call:\n $> python eigenfaces.py bdd_faces\n\"\"\"\nclass Eigenfaces(object)... | [
[
"numpy.matrix",
"numpy.linalg.norm",
"numpy.empty",
"numpy.reshape",
"numpy.argmin",
"numpy.array",
"numpy.sum",
"numpy.linalg.eig",
"numpy.argpartition"
]
] |
google-research/valan | [
"9fc6e38f411e6cb76408bf033cdc056ace980973"
] | [
"framework/log_ckpt_restoration.py"
] | [
"# coding=utf-8\n# Copyright 2019 Google LLC\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable la... | [
[
"tensorflow.io.gfile.GFile",
"tensorflow.io.gfile.isdir"
]
] |
saullocastro/tudaesasII | [
"32c7e0fad9a58d783ce280270eb3556ad8946182"
] | [
"scripts_lectures/MDOF_systems/mdof10_plate_simply_supported_modes.py"
] | [
"import sys\nsys.path.append('../..')\n\nimport matplotlib.pyplot as plt\nfrom matplotlib import cm\nimport numpy as np\nfrom scipy.linalg import eigh\nfrom composites.laminate import read_isotropic\n\nfrom tudaesasII.quad4r import Quad4R, update_K, update_M, DOF\n\n\nnx = 19\nny = 19\n\na = 1.\nb = 0.5\n\nE = 70.e... | [
[
"numpy.ndenumerate",
"numpy.isclose",
"numpy.asarray",
"numpy.zeros",
"scipy.linalg.eigh",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show",
"numpy.linspace",
"numpy.meshgrid",
"numpy.cross"
]
] |
bio-ontology-research-group/ogcn | [
"2b9e3cbf14c826c02cd176b62842b4fc773fa723"
] | [
"RelAtt/rgcn_lp_attn.py"
] | [
"\"\"\"\r\nModeling Relational Data with Graph Convolutional Networks\r\nPaper: https://arxiv.org/abs/1703.06103\r\nCode: https://github.com/MichSchli/RelationPrediction\r\nDifference compared to MichSchli/RelationPrediction\r\n* Report raw metrics instead of filtered metrics.\r\n* By default, we use uniform edge s... | [
[
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.arange",
"torch.set_grad_enabled",
"numpy.mean",
"torch.from_numpy",
"torch.cuda.set_device",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.load",
"torch.nn.init.calculate_gain",
"torch.Tensor",
... |
honchardev/Fun | [
"ca7c0076e9bb3017c5d7e89aa7d5bd54a83c8ecc"
] | [
"AI/MullerBook/ch3/dbscan_overview.py"
] | [
"# DBSCAN - density-based spatial clustering of applications with noise.\n\n# DBSCAN works by identifying points that are in “crowded” regions of the feature\n# space, where many data points are close together.\n# These regions are referred to as dense regions in feature space.\n\n# The idea behind DBSCAN is that c... | [
[
"sklearn.datasets.make_blobs",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.xlabel",
"sklearn.cluster.DBSCAN",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"sklearn.datasets.make_moons"
]
] |
dtiarks/ThesisPlot | [
"b9eaa5f2b2c472667cb17b2ba5a0471c741f0abe"
] | [
"Chap3/Laser/zero_expansion.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Oct 09 13:29:17 2017\n\n@author: daniel\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport os\nimport json\nimport io\n\nfreq = [49.8933, 57.7919, 55.29, 46.71, 58.315]\nTemp = [25.0, 30.0, 35.0, 40.0, 31.74]\nTs = np.arange(... | [
[
"numpy.arange"
]
] |
LSijing/Bayesian-pde-inverse-problem | [
"4fa94f89e580364dc5c4babe5363589446b763d6"
] | [
"pdeinverse/utils.py"
] | [
"# -*- coding: utf-8 -*-\n\n\nimport numpy as np\n\n\ndef compute_PCA(X, mean=True, k=0, A=None, normalize=True):\n \"\"\"\n PCA w.r.t A-norm, where A is a positive definite matrix.\n X : column-wise data set with size n-by-m, i.e. m samples of n dimension\n k : number of modes required (not include mea... | [
[
"numpy.zeros",
"numpy.absolute"
]
] |
JosephChataignon/pyclustering | [
"bf4f51a472622292627ec8c294eb205585e50f52"
] | [
"pyclustering/nnet/tests/unit/ut_dynamic_visualizer.py"
] | [
"\"\"\"!\n\n@brief Unit-tests for basic dynamic visualizer.\n\n@authors Andrei Novikov (pyclustering@yandex.ru)\n@date 2014-2020\n@copyright BSD-3-Clause\n\n\"\"\"\n\n\nimport unittest;\n\n# Generate images without having a window appear.\nimport matplotlib;\nmatplotlib.use('Agg');\n\n\nfrom pyclustering.nnet.dynam... | [
[
"matplotlib.use"
]
] |
kevinleewy/RL-GAN-Net | [
"709bd8e28872e86fc6b4674e2c578ee3f519268f"
] | [
"visualizer.py"
] | [
"import numpy as np\nimport os\nimport ntpath\nimport time\n#from misc import\nfrom PIL import Image\n#from misc import html\n\nclass Visualizer():\n def __init__(self, opt):\n # self.opt = opt\n self.display_id = opt.display_id\n self.use_html = 0\n self.win_size = opt.display_winsiz... | [
[
"numpy.array",
"numpy.transpose"
]
] |
koryca/once-for-all | [
"0c476d9c74c89d8fcf3d5d43dda06c0c73faad51"
] | [
"ofa/imagenet_classification/run_manager/run_manager.py"
] | [
"# Once for All: Train One Network and Specialize it for Efficient Deployment\n# Han Cai, Chuang Gan, Tianzhe Wang, Zhekai Zhang, Song Han\n# International Conference on Learning Representations (ICLR), 2020.\n\nimport math\nimport os\nimport random\nimport time\nimport json\nimport numpy as np\nimport torch.nn as ... | [
[
"numpy.mean",
"torch.nn.functional.mse_loss",
"torch.nn.functional.softmax",
"torch.nn.CrossEntropyLoss",
"torch.nn.DataParallel"
]
] |
scolburn54/rcwa_tf | [
"50c7f6e477b2784c32586d6eddb13ef9e4adec02"
] | [
"src/solver.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport rcwa_utils\nimport tensor_utils\n\n\ndef initialize_params(wavelengths = [632.0],\n thetas = [0.0],\n phis = [0.0],\n pte = [1.0],\n ptm = [0.0],\n pixelsX = ... | [
[
"tensorflow.exp",
"tensorflow.image.resize_with_crop_or_pad",
"tensorflow.ones",
"tensorflow.signal.ifftshift",
"tensorflow.reshape",
"numpy.mean",
"tensorflow.linalg.cross",
"tensorflow.sqrt",
"tensorflow.clip_by_value",
"tensorflow.math.sqrt",
"tensorflow.tile",
"... |
ZiGaMi/StewardPlatformEvaluation | [
"9995507ec70156ec950fc79a388cfcd08ab7e65a"
] | [
"simulation/human_perception.py"
] | [
"# ===============================================================================\n# @file: human_perception.py\n# @note: This script is for model design of human perception of movement \n# @author: Ziga Miklosic\n# @date: 13.01.2021\n# @brief: Evaluation of human movement perception model base on \n# ... | [
[
"numpy.angle",
"scipy.signal.bilinear",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.style.use",
"scipy.signal.freqz",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
raznem/RL_cs294 | [
"e671e8ad602e58adcae44fbed8aaaf39942a1dbc"
] | [
"hw3/dqn_utils.py"
] | [
"\"\"\"This file includes a collection of utility functions that are useful for\nimplementing DQN.\"\"\"\nimport gym\nimport tensorflow as tf\nimport numpy as np\nimport random\n\ndef huber_loss(x, delta=1.0):\n # https://en.wikipedia.org/wiki/Huber_loss\n return tf.where(\n tf.abs(x) < delta,\n ... | [
[
"numpy.concatenate",
"tensorflow.abs",
"numpy.array",
"numpy.zeros_like",
"numpy.empty",
"tensorflow.clip_by_norm",
"tensorflow.variables_initializer",
"tensorflow.train.ExponentialMovingAverage",
"tensorflow.square"
]
] |
supercaoO/WSR | [
"6087b5c70aa770020105553983586a2b4a0f4d40"
] | [
"networks/wsr_arch.py"
] | [
"import numpy as np\nfrom networks.block import *\nfrom pytorch_wavelets import DWTInverse\n\n\nclass RecurrentBlock(nn.Module):\n def __init__(self, num_features, num_simdb, act_type, norm_type):\n super(RecurrentBlock, self).__init__()\n self.compress_in = ConvBlock(2 * num_features, num_features... | [
[
"numpy.log2"
]
] |
c-randall/p2d_pemfc | [
"3d8899b9ba4f7940b46851ab9c3f3ea79aaec736"
] | [
"pemfc_runner.py"
] | [
"\"\"\" Model Description \"\"\"\n\"-----------------------------------------------------------------------------\"\n\"\"\"This model is a half cell model of of PEM fuel cell cathode. The runner file\nallows the user to execute two different geometries for the catalyst layer:\ncore-shell and flodded-agglomerate. In... | [
[
"numpy.array"
]
] |
Nit-1997/AntiPhishing | [
"4e6ddc742d1d786b822d41c80c7378b5b51d5b67"
] | [
"boards/AntiPhishing.py"
] | [
"# -*- coding: utf-8 -*-\r\n\r\n\r\nimport pandas as pd\r\nfrom sklearn.utils import shuffle\r\nimport ipaddress\r\nfrom os.path import splitext\r\nfrom urllib.parse import urlparse\r\nimport tldextract\r\n\r\ndef filetoDF(file):\r\n file = \"dataset2.csv\"\r\n df = pd.read_csv(file)\r\n print(df.head())\r... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
huan123/py-fatser-rcnn | [
"b0c02e004bcd480a01671603578fe18740b85ac0"
] | [
"tools/trainval_net.py"
] | [
"# -*- coding: utf-8 -*-\n# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Zheqi He, Xinlei Chen, based on code from Ross Girshick\n# --------------------------------------------------------\n#使用voc训练时配置参数... | [
[
"numpy.random.seed"
]
] |
li-phone/DefectNet | [
"f1b6f44a34581c8942d7ee5341cb9da4e76a225a"
] | [
"mmdet/models/detectors/two_stage.py"
] | [
"import torch\nimport torch.nn as nn\n\nfrom mmcv.utils.config import Dict\nfrom mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler\nfrom .. import builder\nfrom ..registry import DETECTORS\nfrom .base import BaseDetector\nfrom .test_mixins import BBoxTestMixin, MaskTestMixin, RPNTestMixin\n\n\n... | [
[
"torch.zeros",
"torch.cat",
"torch.ones",
"torch.Tensor",
"torch.randn"
]
] |
stanley-chang/I2DL | [
"78740460e1f52ce7643358fc548281f1bbe73a42"
] | [
"exercise_11/exercise_code/rnn/base_classifier.py"
] | [
"import pytorch_lightning as pl\nimport torch\nimport numpy as np\nimport torch.nn as nn\nimport pickle\nimport torch.nn.functional as F\nfrom torchvision import transforms\nfrom .mnist_dataset import *\n\nclass Base_Classifier(pl.LightningModule):\n\n def general_step(self, batch, batch_idx, mode):\n ima... | [
[
"torch.nn.functional.cross_entropy",
"torch.stack",
"torch.utils.data.DataLoader",
"torch.max"
]
] |
maxkrakauer/BERT | [
"cf05ef98e459bfd64e3dad0d423a0f9ccef5a4d9"
] | [
"AlephBERT-main/models/alephbert-base/hebrew-model.py"
] | [
"import json\nfrom transformers import BertForMaskedLM, BertTokenizerFast\nimport torch\nimport pickle\nimport io\nimport sys\n\ntorch.device('cpu')\n\n\nclass CPU_Unpickler(pickle.Unpickler):\n def find_class(self, module, name):\n if module == 'torch.storage' and name == '_load_from_bytes':\n ... | [
[
"torch.device",
"torch.no_grad",
"torch.argsort",
"torch.tensor",
"torch.sum"
]
] |
FranckLejzerowicz/prep_songbird | [
"784412302d410a38de87d98f4852425e44f4d2e9"
] | [
"prep_songbird/_io_utils.py"
] | [
"# ----------------------------------------------------------------------------\n# Copyright (c) 2020, Franck Lejzerowicz.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file LICENSE, distributed with this software.\n# ------------------------------------------------... | [
[
"pandas.read_csv"
]
] |
Rocks-n-Code/COGCCpy | [
"93b32bff7249ed3b735b60d59915e006d713ae73"
] | [
"build/lib/COGCCpy/tops.py"
] | [
"import pandas as pd\nimport requests\nimport time\nimport re\n\nclass formation_tops:\n\n def __init__(self, apis):\n self.apis = [x.replace('-', '')[:10] for x in apis]\n state_codes = [x[:2] for x in self.apis if x[:2] != '05']\n if len(state_codes) > 0:\n raise ValueError('Sta... | [
[
"pandas.DataFrame",
"pandas.read_html",
"pandas.concat"
]
] |
punit-bhatt/cmu-10601-intro-to-ml | [
"a4b7bdb27a388a2996e3f4dac99f34156ff9f01e"
] | [
"assignments/solutions/hw8/handout/python/rendering.py"
] | [
"\"\"\"\r\n2D rendering framework\r\nTaken from: https://github.com/openai/gym/blob/master/gym/envs/classic_control/rendering.py\r\n\"\"\"\r\nfrom __future__ import division\r\nimport os\r\nimport six\r\nimport sys\r\n\r\nif \"Apple\" in sys.version:\r\n if 'DYLD_FALLBACK_LIBRARY_PATH' in os.environ:\r\n ... | [
[
"numpy.fromstring",
"numpy.frombuffer"
]
] |
wphicks/xgboost | [
"3912f3de06bcc76295d18dab7f0a5f68e4e460c0"
] | [
"python-package/xgboost/data.py"
] | [
"# pylint: disable=too-many-arguments, too-many-branches\n# pylint: disable=too-many-return-statements, import-error\n'''Data dispatching for DMatrix.'''\nimport ctypes\nimport json\nimport warnings\n\nimport numpy as np\n\nfrom .core import c_array, _LIB, _check_call, c_str\nfrom .core import DataIter, DeviceQuant... | [
[
"numpy.array",
"numpy.isnan",
"numpy.vectorize",
"numpy.ascontiguousarray",
"pandas.api.types.is_sparse"
]
] |
xieyulai/MSP-STTN | [
"4f986b40fb0f3c292dcb6e186ed9b8aba1f7306b"
] | [
"dataset/data_fetcher_long.py"
] | [
"import numpy as np\nimport torch\nimport time\n\nfrom dataset.utils import string2timestamp\n\n\nclass DataFetcher(object):\n \"\"\"\n construct XC, XP, XT, Y\n\n current timestamp - offset = timestamp of interest\n data = fetchdata (timestamp of interest)\n \"\"\"\n\n def __init__(self, data, ra... | [
[
"numpy.concatenate",
"numpy.asarray",
"numpy.stack",
"numpy.timedelta64",
"numpy.vstack"
]
] |
mrandri19/alfi | [
"3782ab93ab8d77f55914b0795db0f132088c5281"
] | [
"experiments/evaluation_scripts_for_paper/compare_p53_parameters.py"
] | [
"import argparse\nimport yaml\nimport seaborn as sns\nimport time\nimport numpy as np\nimport torch\n\nfrom matplotlib import pyplot as plt\nfrom pathlib import Path\n\nfrom alfi.datasets import P53Data\nfrom alfi.plot import tight_kwargs\n\nfrom experiments.model_specs.variational import build_variational, plot_va... | [
[
"matplotlib.pyplot.savefig",
"numpy.stack",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.linspace"
]
] |
AakashSudhakar/biodata-compound-activity-with-bioassays | [
"a56fe46e753eeaf05f1419b2ec501881362268c3"
] | [
"structures/dataset_preprocessor.py"
] | [
"#!python3\n\n\nimport pandas as pd\nfrom os import listdir\nfrom os.path import isfile, join\n\n\nclass Dataset_Preprocessor(object):\n \"\"\" Class object instance for bioassay dataset preprocessing analysis. \"\"\"\n def __init__(self):\n \"\"\" Initializer method. \"\"\"\n self.REL_PATH_TO_D... | [
[
"pandas.read_csv",
"pandas.concat"
]
] |
siddharthbharthulwar/Synthetic-Vision-System | [
"b6cbfdcd474639538f0d60eb4ba1d45a7fec0b44"
] | [
"Pipeline/testing.py"
] | [
"from terraingrid import TerrainGrid\nimport matplotlib.pyplot as plt \nfrom sklearn.metrics import f1_score, precision_score, recall_score\nimport numpy as np \nimport cv2 as cv\ndef pixel_accuracy(eval_segm, gt_segm):\n '''\n sum_i(n_ii) / sum_i(t_i)\n '''\n\n check_size(eval_segm, gt_segm)\n\n cl,... | [
[
"numpy.union1d",
"numpy.zeros",
"numpy.sum",
"numpy.mean",
"matplotlib.pyplot.subplots",
"numpy.logical_and",
"matplotlib.pyplot.show",
"numpy.unique"
]
] |
erinaceous/shadows | [
"43c86c18936f6af4c0c54f30419e8f7bfb244e9a"
] | [
"learning/edges/extractor/utils.py"
] | [
"#!/usr/bin/env python\n# vim: set tabstop=4 shiftwidth=4 textwidth=79 cc=72,79:\n\"\"\"\n feature_utils: Utilities relating to extract_features.py\n Original Author: Owain Jones [odj@aber.ac.uk]\n\"\"\"\n\nfrom __future__ import print_function\nimport numpy as np\nimport random\nimport gzip\nimport math\nimp... | [
[
"numpy.array",
"numpy.arange",
"numpy.hypot",
"numpy.clip",
"numpy.linspace"
]
] |
ShahroozFaghihRoohi/Phase2_Submission_Python_02 | [
"896549fbbf8d6b66fc0627fe146cb2ea17701df4"
] | [
"get_sepsis_score.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\nimport pickle\n\ndef Interpolation(InMat):\n OutMat = np.zeros(InMat.shape, dtype=float)\n for i in range(InMat.shape[1]):\n Col = InMat[:,i]\n if (np.any(np.isnan(Col))):\n if (np.all(np.isnan(Col))):\n dd = 1\n ... | [
[
"numpy.isnan",
"numpy.nan_to_num",
"numpy.empty",
"numpy.zeros",
"numpy.interp"
]
] |
MohamedHmini/IWW | [
"b270534a2b22d45d4ad989d5402b0dea73d169ea"
] | [
"iww/features_extraction/lists_detector.py"
] | [
"import sys\nimport os\nimport pandas as pd\nimport numpy as np\nimport itertools\nfrom sklearn.manifold import TSNE\nfrom sklearn.cluster import DBSCAN\nfrom sklearn.cluster import KMeans\nfrom sklearn.metrics.pairwise import cosine_similarity\nfrom sklearn.metrics.pairwise import euclidean_distances\nimport matpl... | [
[
"sklearn.metrics.pairwise.euclidean_distances",
"pandas.set_option"
]
] |
vvekic/serve | [
"f02a56bf1f0de1705fd9f399c1115d36e343c90c"
] | [
"ts/torch_handler/text_classifier.py"
] | [
"# pylint: disable=E1102\n# TODO remove pylint disable comment after https://github.com/pytorch/pytorch/issues/24807 gets merged.\n\"\"\"\nModule for text classification default handler\nDOES NOT SUPPORT BATCH!\n\"\"\"\nimport logging\nimport torch\nimport torch.nn.functional as F\nfrom torchtext.data.utils import ... | [
[
"torch.as_tensor",
"torch.tensor",
"torch.nn.functional.softmax"
]
] |
PGBI/Surprise | [
"46b9914995e6c8c7d227b46f2eaeef2d4600580f"
] | [
"surprise/model_selection/search.py"
] | [
"from __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nfrom abc import ABCMeta, abstractmethod\nfrom itertools import product\nimport numpy as np\nfrom joblib import Parallel\nfrom joblib import delayed\nfrom six import moves, string_types, with_metaclass\n... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.asarray",
"numpy.empty_like"
]
] |
tanyanair/segmentation_uncertainty | [
"197064039a33effe7405d26f048c3daf352413f1"
] | [
"bunet/utils/tf_metrics.py"
] | [
"\"\"\"\nTensorflow implementation of metrics and utils\n\"\"\"\nimport tensorflow as tf\n\nEPSILON = 1e-5\n_smooth = 1\n\n\ndef dice_coef(y_tru, y_prd):\n y_tru = tf.reshape(y_tru, [2, -1])\n y_prd = tf.reshape(y_prd, [2, -1])\n y_prd_pr = tf.sigmoid(y_prd)\n intersection = tf.reduce_sum(y_prd_pr * y_t... | [
[
"tensorflow.exp",
"tensorflow.nn.weighted_cross_entropy_with_logits",
"tensorflow.sigmoid",
"tensorflow.reshape",
"tensorflow.reduce_sum",
"tensorflow.tile",
"tensorflow.reduce_mean",
"tensorflow.random_normal"
]
] |
GregorySchwing/alchemlyb | [
"6eb1f537e1dbc81cf65c4f53267acc75812459b2"
] | [
"src/alchemlyb/parsing/gomc.py"
] | [
"\"\"\"Parsers for extracting alchemical data from `GOMC <http://gomc.eng.wayne.edu/>`_ output files.\n\n\"\"\"\nimport pandas as pd\nimport numpy as np\nfrom .util import anyopen\n\n\n# TODO: perhaps move constants elsewhere?\n# these are the units we need for dealing with GOMC, so not\n# a bad place for it, hones... | [
[
"pandas.DataFrame",
"pandas.Index"
]
] |
elvinmirzazadeh/Machine_Learning_A_Z | [
"179b881e343958bac41a717a17b9c4ec55e8d060"
] | [
"Part 3 - Classification/Section 17 - Kernel SVM/kernel_svm.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndataset = pd.read_csv('data/Social_Network_Ads.csv')\nX = dataset.iloc[:, 2:-1].values\ny = dataset.iloc[:, -1].values\n\nfrom sklearn.model_selection import train_test_split\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_... | [
[
"sklearn.metrics.confusion_matrix",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.plot",
"matplotlib.colors.ListedColormap",
"sklearn.svm.SVC",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.show",
"pandas.read_csv",
"numpy.unique"
]
] |
testouya/mlu-ops | [
"68b0d568868bb7b5057ef67bff315a0db49cd690"
] | [
"bangpy-ops/ops/pairwise_distance/test_pairwise_distance.py"
] | [
"# Copyright (C) [2021] by Cambricon, Inc.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, me... | [
[
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.random.uniform",
"numpy.random.randint",
"torch.nn.PairwiseDistance",
"torch.Tensor"
]
] |
TanZheling/mmclassification | [
"1c3ff80f4f8a0b57a57eb08f2325a0c4befb7201"
] | [
"mmcls/models/utils/attention.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn.bricks.registry import DROPOUT_LAYERS\nfrom mmcv.cnn.bricks.transformer import build_dropout\nfrom mmcv.cnn.utils.weight_init import trunc_normal_\nfrom mmcv.runner.base_module impor... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.roll",
"torch.arange",
"torch.nn.Softmax",
"torch.nn.functional.pad"
]
] |
ZM-Zhou/SMDE-Pytorch | [
"7a8eb3400b450a492df05cd4724dfd259c3a733a"
] | [
"datasets/utils/export_gt_depth.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport os\n\nimport argparse\nimport numpy as np\nimport PIL.Image as pil\n\nimport os\nimport sys\nsys.path.append(os.getcwd())\nfrom datasets.utils.data_reader import generate_depth_map\n\n\ndef export_gt_depths_kitti():\n\n parser = argparse... | [
[
"numpy.array"
]
] |
joshuamosesb/gramex | [
"e416cb609698b5941a18b06743c853dee50e0500"
] | [
"tests/test_logviewer.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals\n\nimport os.path\nimport pandas as pd\nimport gramex.cache\nfrom glob import glob\nimport sqlalchemy as sa\nfrom nose.tools import eq_, ok_\nfrom nose.tools import assert_almost_equals as aae\nfrom pandas.testing import assert_frame_equal as afe\nfr... | [
[
"pandas.Grouper"
]
] |
YashBit/accelerate-skillDiscovery | [
"129a32c3d376eabb5d054dcd949c33aa686a97d4"
] | [
"library-algo/diayn-main/rlkit/torch/dqn/dqn_with_encoder.py"
] | [
"from collections import OrderedDict\n\nimport numpy as np\nimport torch\nimport torch.optim as optim\nfrom torch import nn as nn\n\nimport rlkit.torch.pytorch_util as ptu\nfrom rlkit.core.eval_util import create_stats_ordered_dict\nfrom rlkit.torch.torch_rl_algorithm import TorchTrainer\n\n\nclass DQNTrainer(Torch... | [
[
"torch.nn.MSELoss"
]
] |
atrettin/pisa | [
"9702ed946e3f669f1126ca4ffe96b49280a8ff12"
] | [
"pisa/utils/stats.py"
] | [
"\"\"\"\nStatistical functions\n\"\"\"\n\n\nfrom __future__ import absolute_import, division\n\nimport numpy as np\nfrom scipy.special import gammaln\nfrom uncertainties import unumpy as unp\n\nfrom pisa import FTYPE\nfrom pisa.utils.comparisons import FTYPE_PREC, isbarenumeric\nfrom pisa.utils.log import logging\n... | [
[
"numpy.exp",
"numpy.nanmean",
"numpy.zeros_like",
"numpy.nan_to_num",
"numpy.log",
"numpy.nanmin",
"numpy.argmax",
"numpy.sqrt",
"numpy.isfinite",
"numpy.nanmax",
"numpy.square",
"numpy.array",
"numpy.zeros",
"numpy.ma.masked_invalid",
"numpy.clip",
... |
athenian-robotics/common-robotics-python | [
"a2ede8fb3072cf1baa53672f76081aa6bfde397f"
] | [
"arc852/contour_finder.py"
] | [
"import cv2\nimport numpy as np\n\nfrom arc852.constants import MINIMUM_PIXELS_DEFAULT, HSV_RANGE_DEFAULT\nfrom arc852.opencv_utils import contour_slope_degrees, contains_in_list, get_center\n\n\nclass ContourFinder(object):\n def __init__(self,\n bgr_color,\n hsv_range=HSV_RANGE_... | [
[
"numpy.array",
"numpy.uint8"
]
] |
robhansen/advent2021 | [
"390d49dd237200a8939b0d5486bbeb37c079807c"
] | [
"puzzle/day19.py"
] | [
"#!/usr/bin/env python3\r\n\r\nimport sys\r\nimport numpy\r\n\r\nif len(sys.argv) != 2:\r\n print(\"Help: {} <filename>\".format(sys.argv[0]))\r\n sys.exit(0)\r\n\r\nTRANSLATIONS = [(0,0,0),(0,0,1),(0,0,2),(0,0,3),(0,1,0),(0,1,1),(0,1,2),(0,1,3),(0,2,3),(0,3,3),\r\n (1,0,0),(1,0,1),(1,0,2),(1,0... | [
[
"numpy.array",
"numpy.zeros"
]
] |
mengesser/miricoord | [
"e4f7bef16f8a2e6f1d46c97a2b3d78cd50de7bec"
] | [
"miricoord/mrs/toolversions/mrs_pipetools_cdp6.py"
] | [
"#\n\"\"\"\nUseful python tools for working with the MIRI MRS.\nThis contains cdp6 specific code.\n\nThis version of the tools uses the JWST pipeline implementation\nof the distortion solution to do the transformations,\nand hooks into offline versions of the CRDS reference\nfiles contained within this github repos... | [
[
"numpy.array"
]
] |
ismedina/geomloss | [
"bbd6289a139174effedb6855e1e992eb77772c67"
] | [
"geomloss/examples/optimal_transport/plot_wasserstein_barycenters_1D.py"
] | [
"\"\"\"\nWasserstein barycenters in 1D\n==================================\n\nLet's compute Wasserstein barycenters\nwith a Sinkhorn divergence,\nusing Eulerian and Lagrangian optimization schemes.\n\"\"\"\n\n##############################################\n# Setup\n# ---------------------\n\nimport numpy as np\nimp... | [
[
"torch.linspace",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"matplotlib.pyplot.tight_layout",
"sklearn.neighbors.KernelDensity",
"torch.nn.functional.softmax",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.show",
"numpy.linspace",
"matplotlib.pyplot.subplot"
... |
pstroe/goldberg_nnm4nlp | [
"2b66842e4c85b882c3c22959b3522daff3465493"
] | [
"lib/language_classification.py"
] | [
"\n# coding: utf-8\n\n# # Multi-Class Classification - Language Classification\n# \n# This notebook implements the method presented in Goldberg's [2017] book \"Neural Network Methods for Natural Language Processing\". It shows the steps you need to go through in order to successfully train a classifier, and it shou... | [
[
"numpy.linalg.norm",
"numpy.zeros",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.ones",
"sklearn.preprocessing.LabelBinarizer",
"sklearn.svm.LinearSVC"
]
] |
rzumer/VideoLowLevelVision | [
"1c15dbe74f0b33d2e74d0a717a22ccbd67cdf269"
] | [
"VLLV/Models/Dbpn.py"
] | [
"\"\"\"\nCopyright: Wenyi Tang 2017-2018\nAuthor: Wenyi Tang\nEmail: wenyi.tang@intel.com\nCreated Date: June 15th 2018\nUpdated Date: Sep 11th 2018\n\nDeep Back-Projection Networks For Super-Resolution (CVPR 2018)\nSee https://arxiv.org/abs/1803.02735\n\"\"\"\n\nfrom VLLV.Framework.SuperResolution import SuperReso... | [
[
"tensorflow.control_dependencies",
"tensorflow.summary.image",
"tensorflow.losses.get_regularization_losses",
"tensorflow.concat",
"tensorflow.train.AdamOptimizer",
"tensorflow.summary.scalar",
"tensorflow.image.psnr",
"tensorflow.losses.absolute_difference",
"tensorflow.add_n"... |
jeromekelleher/zarr | [
"3c8e9291e96e090e20caf6950da69a3cc180652f"
] | [
"zarr/core.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import, print_function, division\nimport binascii\nimport operator\nimport itertools\nimport hashlib\nimport re\n\n\nimport numpy as np\n\n\nfrom zarr.util import (is_total_slice, human_readable_size, normalize_resize_args,\n normalize_... | [
[
"numpy.array",
"numpy.ceil",
"numpy.empty",
"numpy.copyto",
"numpy.zeros",
"numpy.ascontiguousarray",
"numpy.asfortranarray",
"numpy.frombuffer",
"numpy.squeeze",
"numpy.asanyarray",
"numpy.dtype"
]
] |
cortwave/camera-model-identification | [
"b2cbac93308bd6e1bc9d38391f5e97f48da99263"
] | [
"arsenyinfo/src/rebalance.py"
] | [
"from glob import glob\n\nimport numpy as np\nimport pandas as pd\nfrom fire import Fire\n\n\ndef main(model_name):\n files = [pd.read_csv(x) for x in glob(f'result/probas_{model_name}*.csv')]\n df = pd.concat(files)\n df = df.groupby('fname').agg(np.sum).reset_index()\n df.to_csv(f'result/blended_proba... | [
[
"numpy.any",
"pandas.read_csv",
"pandas.concat"
]
] |
PandaWhoCodes/my_ml_journey | [
"5a82e4340cb33d137495638cf134efce65ac7fac"
] | [
"iris/7.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy\nimport numpy as np\nimport math\n\n\"\"\"-------------------------------------------------\n\tName : calCovariance()\n\tInput = 4*n matrix, mean of Iris data\n\tOutput = 4*4 covariance matrix\n\tDescription : calculate covariance for each component\n------------------... | [
[
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.plot",
"numpy.linalg.det",
"numpy.arange",
"numpy.transpose",
"numpy.sqrt",
"matplotlib.pyplot.show",
"matplotlib.pyplot.contour",
"numpy.linalg.inv",
"matplotlib.pyplot.axis"
]
] |
anze-gn/CBLBs | [
"5a62236e4db3f08e4058da76621a185c64fd24ba"
] | [
"robustness/solver_population.py"
] | [
"import math\nimport pickle \nimport numpy as np\nimport matplotlib.pyplot as plt \nimport matplotlib.ticker as ticker\nimport random as rand \nfrom numpy import random \nfrom sklearn import decomposition \nfrom deap import creator, base, tools, algorithms \nfrom sklearn.decomposition import PCA\nfrom mpl_toolkits... | [
[
"numpy.random.rand",
"matplotlib.pyplot.errorbar",
"numpy.min",
"numpy.mean",
"numpy.where",
"numpy.max",
"numpy.linalg.norm",
"matplotlib.ticker.MaxNLocator",
"numpy.log",
"numpy.prod",
"matplotlib.pyplot.gca",
"sklearn.decomposition.PCA",
"matplotlib.pyplot.su... |
deklanw/maxent_graph | [
"cc5a34640630147115e2d6bbccf3980e69bf9934"
] | [
"tests/test_models.py"
] | [
"import pytest\nimport numpy as np\n\nfrom maxent_graph import BICM, DECM, BWCM, ECM, BIECM, RCM\nfrom maxent_graph.util import nx_get_A, nx_get_B\n\nmodels = [\n BICM(nx_get_B(\"data/my_senate_116_bipartite.graphml\")),\n BICM(nx_get_B(\"data/opsahl-southernwomen_bipartite.graphml\")),\n DECM(nx_get_A(\"d... | [
[
"numpy.allclose"
]
] |
yufengyuanx/tensorflow | [
"66d5d1fa0c192ca4c9b75cde216866805eb160f2"
] | [
"tensorflow/python/debug/cli/debugger_cli_common_test.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.debug.cli.debugger_cli_common.CommandLineExit",
"tensorflow.python.debug.cli.debugger_cli_common.RichTextLines",
"tensorflow.python.platform.gfile.Remove",
"tensorflow.python.platform.googletest.main",
"tensorflow.python.debug.cli.debugger_cli_common.CommandHandlerRegistry",... |
yoshihikoueno/pdfminer-layout-scanner | [
"437f7f2329db79c0f794fe41f4156218a982cec5"
] | [
"pdf_layout_scanner/layout_scanner.py"
] | [
"#!/usr/bin/python3\n\nimport sys\nimport os\nfrom tqdm import tqdm\nfrom binascii import b2a_hex\nimport pandas as pd\nimport pickle\nfrom pdfminer.pdfparser import PDFParser\nfrom pdfminer.pdfdocument import PDFDocument, PDFNoOutlines\nfrom pdfminer.pdfpage import PDFPage\nfrom pdfminer.pdfinterp import PDFResour... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
medjebbar/deepchem | [
"d636878164abb0562e3f5a9f2f187d3b5a5a097b"
] | [
"deepchem/feat/molecule_featurizers/rdkit_descriptors.py"
] | [
"\"\"\"\nBasic molecular features.\n\"\"\"\n\nimport numpy as np\n\nfrom deepchem.utils.typing import RDKitMol\nfrom deepchem.feat.base_classes import MolecularFeaturizer\n\n\nclass RDKitDescriptors(MolecularFeaturizer):\n \"\"\"RDKit descriptors.\n\n This class computes a list of chemical descriptors like\n mol... | [
[
"numpy.asarray"
]
] |
w111liang222/fulaoban | [
"a3fec75845295a8ea2d709fb90b83e266293e2ff"
] | [
"parser.py"
] | [
"import os\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\nfrom laserscan import LaserScan\nfrom poseloader import PoseLoader\nfrom scipy.spatial.transform import Rotation as R\n\nEXTENSIONS_SCAN = ['.bin']\nEXTENSIONS_POSE = ['.txt']\n\n\ndef is_scan(filename):\n return any(filename.end... | [
[
"numpy.concatenate",
"numpy.zeros",
"torch.from_numpy",
"torch.tensor",
"torch.utils.data.DataLoader",
"scipy.spatial.transform.Rotation.from_rotvec"
]
] |
deepjets/deepjets | [
"fc9c610d4fd80975d8d25eb0d7cd41d7dd318c75"
] | [
"deepjets/preprocessing.py"
] | [
"import numpy as np\nfrom skimage import transform\n\n\ndef translate(jet_csts, subjets):\n \"\"\"Translate constituents and jets, leading subjet at (eta, phi) = (0, 0).\n \"\"\"\n # Translate constituents\n jet_csts['eta'] -= subjets['eta'][0]\n jet_csts['phi'] -= subjets['phi'][0]\n # Ensure phi... | [
[
"numpy.histogram2d",
"numpy.array",
"numpy.ceil",
"numpy.sin",
"numpy.reshape",
"numpy.sum",
"numpy.linalg.eigh",
"numpy.rint",
"numpy.sign",
"numpy.arange",
"numpy.arctan2",
"numpy.cos",
"numpy.mod"
]
] |
nuo010/pyefun | [
"ac2290d4bcc8de16c195d2782f3eacd26e5e6ed4"
] | [
"pyefun/chartUtil.py"
] | [
"#-*- coding: utf-8 -*-\nimport random,io\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom .public import *\n\n\n图表颜色 = [\n '#F0F8FF', '#FAEBD7', '#00FFFF', '#7FFFD4', '#F0FFFF', '#F5F5DC', '#FFE4C4', '#FFEBCD', '#8A2BE2', '#A52A2A',\n '#DEB887', '#5F9EA0', '#7FFF00', '#D2691E', '#FF7F50', '#6495ED'... | [
[
"matplotlib.pyplot.text"
]
] |
anetczuk/pybraingym | [
"4f930021d7802e88c75a1a0aed135dd4de66cc1b"
] | [
"src/pybraingym/interface.py"
] | [
"# MIT License\n#\n# Copyright (c) 2019 Arkadiusz Netczuk <dev.arnet@gmail.com>\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 t... | [
[
"scipy.zeros"
]
] |
zparnold/cs7641 | [
"e37e7b9259237adffbeb36ccc8dd17f67892286a"
] | [
"assignment2/nn_function.py"
] | [
"import sys\n\nimport six\n\nsys.modules['sklearn.externals.six'] = six\nimport mlrose_hiive as mlrose\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.metrics import accuracy_score\nimport matplotlib.pyplot as plt\nfrom matpl... | [
[
"matplotlib.lines.Line2D",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.subplots",
"sklearn.metrics.accuracy_score",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.show",
"pandas.read_csv",
"pandas.get_dummies"
]
] |
chaowentao/mmpose | [
"b528c60ef4fab56d35d1ed7e187023794639be26"
] | [
"mmpose/datasets/datasets/top_down/topdown_mpii_trb_dataset.py"
] | [
"import copy as cp\nimport os\nimport os.path as osp\nfrom collections import OrderedDict\n\nimport json_tricks as json\nimport numpy as np\n\nfrom mmpose.datasets.builder import DATASETS\nfrom .topdown_base_dataset import TopDownBaseDataset\n\n\n@DATASETS.register_module()\nclass TopDownMpiiTrbDataset(TopDownBaseD... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.sum",
"numpy.ones"
]
] |
Immich/jina | [
"1f5f7cf4d82029d76ab41df157526fe6f6e0da50",
"1f5f7cf4d82029d76ab41df157526fe6f6e0da50"
] | [
"tests/unit/executors/indexers/test_numpyindexer.py",
"tests/unit/executors/indexers/test_numpyindexer_batching.py"
] | [
"import os\n\nimport numpy as np\nimport pytest\n\nfrom jina.executors.indexers import BaseIndexer\nfrom jina.executors.indexers.vector import NumpyIndexer\n\n# fix the seed here\n\nnp.random.seed(500)\nretr_idx = None\nnum_data = 100\nnum_dim = 64\nnum_query = 10\nvec_idx = np.array(np.random.randint(0, high=num_d... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"numpy.testing.assert_equal",
"numpy.random.seed",
"numpy.array_equal",
"numpy.ones",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.sort",
"numpy.argsort",
... |
yarikoptic/scipy | [
"f0ebf744dea44c14f298311b8930cd8f55ae9f96"
] | [
"scipy/signal/ltisys.py"
] | [
"\"\"\"\nltisys -- a collection of classes and functions for modeling linear\ntime invariant systems.\n\"\"\"\nfrom __future__ import division, print_function, absolute_import\n\n#\n# Author: Travis Oliphant 2001\n#\n# Feb 2010: Warren Weckesser\n# Rewrote lsim2 and added impulse2.\n# Aug 2013: Juan Luis Cano\n# ... | [
[
"numpy.product",
"numpy.dot",
"numpy.exp",
"numpy.issubdtype",
"scipy.linalg.eigvals",
"numpy.zeros_like",
"numpy.eye",
"scipy.linalg.eig",
"numpy.transpose",
"numpy.atleast_2d",
"numpy.array",
"scipy.interpolate.interp1d",
"numpy.zeros",
"numpy.real",
"... |
JasonWherry/SamplingApp | [
"604df918c52ef7e4f3555203dc9e6c9c9f0511e9"
] | [
"old.py"
] | [
"\"\"\"\nAuthor: Jason Wherry\tStart Date: 5/08/2020\t\tTo Run: python3 main.py\n\nWhat am I actually plotting? --> The means calculated from each sample\n\nIdeas:\n - Add tests to unit_tests.py to test the functions\n\n - Add the following to menu option #1 (to educate the user)\n\t- make a histogram of the popu... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.random.binomial",
"pandas.DataFrame",
"scipy.stats.skew",
"numpy.random.uniform",
"matplotlib.pyplot.show",
"scipy.stats.kurtosis",
"scipy.stats.tvar",
"matplotlib.pyplot.subplot"
]
] |
srichers/thornado | [
"bc6666cbf9ae8b39b1ba5feffac80303c2b1f9a8"
] | [
"Workflow/AMReX/AMReX_MakeMovie_2D_Spherical_TwoFields.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"\nGenerate a movie showing two fields side-by-side\nfrom data files created in MakeDataFiles.py.\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import animation\nimport subprocess\n\n# --- Get user's HOME directory ---\nHOME = subprocess.check_output... | [
[
"numpy.max",
"numpy.log10",
"matplotlib.pyplot.text",
"numpy.int",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.close",
"numpy.min",
"matplotlib.pyplot.figure",
"numpy.any",
"numpy.loadtxt",
"matplotlib.colors.SymLogNorm",
"matplotlib.pyplot.Normalize",
... |
wiki-yu/fastapi-algorithm-library | [
"8f745e9fe4d1d063dc8505d4c7f467e95209a385"
] | [
"app/libs/action_localization/spatio_temporal_pytorch/datasets/dataset.py"
] | [
"#!/usr/bin/python\n# encoding: utf-8\n\nimport os\nimport random\nimport torch\nimport numpy as np\nfrom torch.utils.data import Dataset\nfrom PIL import Image\nfrom datasets.clip import *\nimport glob\n\nclass listDataset(Dataset):\n\n # clip duration = 8, i.e, for each time 8 frames are considered together\n ... | [
[
"torch.cat"
]
] |
tensorturtle/CSI-Camera | [
"3aaa7ddbc574a2e9c3bdcf6c47db27a91ebb5345"
] | [
"instrumented/dual_camera_naive.py"
] | [
"# MIT License\n# Copyright (c) 2019 JetsonHacks\n# See license\n# Using a CSI camera (such as the Raspberry Pi Version 2) connected to a\n# NVIDIA Jetson Nano Developer Kit using OpenCV\n# Drivers for the camera and OpenCV are included in the base image\n\nimport cv2\nfrom timecontext import Timer\nimport numpy as... | [
[
"numpy.hstack"
]
] |
poypoyan/edhmm | [
"4d8a1fafa69a1d69e4a99963436179db4a91d7a5"
] | [
"edhsmm/hsmm_base.py"
] | [
"import numpy as np\nfrom scipy.stats import multivariate_normal\nfrom scipy.special import logsumexp\nfrom sklearn import cluster\nfrom sklearn.utils import check_array\n\nfrom . import _hsmm_core as core, hsmm_utils\nfrom .hsmm_utils import log_mask_zero, iter_from_X_lengths\n\n\n# Base Class for Explicit Duratio... | [
[
"numpy.full",
"numpy.array",
"scipy.special.logsumexp",
"numpy.empty",
"numpy.asarray",
"sklearn.cluster.KMeans",
"numpy.random.default_rng",
"numpy.exp",
"numpy.identity",
"numpy.allclose",
"scipy.stats.multivariate_normal",
"numpy.arange",
"numpy.linalg.eigval... |
vossenwout/gtadeepproblog | [
"56bcf5208e79c17510b5d288068fabc6cd64f3cf"
] | [
"src/deepproblog/utils/confusion_matrix.py"
] | [
"from typing import List, Union\n\nimport numpy as np\n\nfrom deepproblog.utils import TabularFormatter\n\n\nclass ConfusionMatrix(object):\n def __init__(self, classes: Union[int, List[str]] = 0):\n if isinstance(classes, int):\n self.n = classes\n self.classes = list(range(self.n))... | [
[
"numpy.zeros"
]
] |
wrrobin/Kernels | [
"c8f4b2054c649b176d737647671e227bcfb19da6"
] | [
"PYTHON/stencil-numba.py"
] | [
"#!/usr/bin/env python3\n#\n# Copyright (c) 2015, Intel Corporation\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# * Redistributions of source code must retain the above copyright\n# notice, this l... | [
[
"numpy.reshape",
"numpy.fromfunction",
"numpy.zeros"
]
] |
MLJejuCamp2017/MAD-GAN-MLCAMP | [
"0615e4acd7f8488abc58f62985e400373b62b5d1"
] | [
"src/main_working.py"
] | [
"import os\nimport scipy.misc\nimport numpy as np\n\nfrom model import MADGAN\nfrom utils import pp, visualize, to_json, show_all_variables\n\nimport tensorflow as tf\n\nflags = tf.app.flags\nflags.DEFINE_integer(\"epoch\", 25, \"Epoch to train [25]\")\nflags.DEFINE_float(\"learning_rate\", 0.0002, \"Learning rate ... | [
[
"tensorflow.ConfigProto",
"tensorflow.app.run",
"tensorflow.Session"
]
] |
krickwix/ncsdk | [
"c3714ed607d3a4c6612668428765fea82efee166"
] | [
"examples/caffe/GoogLeNet/run.py"
] | [
"#! /usr/bin/env python3\n\n# Copyright (c) 2017-2018 Intel 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 obtain a copy of the License at\n#\n# http://www.apache.org/licenses... | [
[
"numpy.loadtxt",
"numpy.load"
]
] |
cy-TOHACKS21/GoGoMeet- | [
"94d785ed388a955e987c0acda8332e0035010074"
] | [
"Cogs/meet.py"
] | [
"import discord\r\nimport asyncio\r\nimport datetime\r\nfrom discord.ext import commands\r\nimport os\r\nimport requests\r\nimport json\r\nimport pandas as pd\r\nimport re\r\nfrom datetime import datetime, timedelta\r\n\r\n\r\n# Retrieving Distance Matrix API key\r\nfin = open('Saved/Keys.txt')\r\nlines = list(map(... | [
[
"pandas.DataFrame"
]
] |
MasazI/python-r-stan-bayesian-model-2 | [
"288876b31b6c3d74d523babc475d4794cd29680a"
] | [
"exec/5-exec-5-7.py"
] | [
"import numpy as np\nimport seaborn as sns\nimport pandas\nimport mcmc_tools\nimport matplotlib.pyplot as plt\nfrom scipy.stats import norm\n\n# ファイルの読み込み\n# y: 生存していた種子数 応答変数\n# N: 調査した種子数\n# x: 体サイズ\n# f: 処理の違い(CまたはT)\ndata4a = pandas.read_csv('data4a.csv')\nprint(data4a.head())\nprint(data4a.describe())\n\n# ここで... | [
[
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.xlabel",
"numpy.percentile",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"pandas.concat",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.axes"
]
] |
ziyaointl/scipy | [
"eac43b07eb9681ce52526ce8bc82f0ce2510ce34"
] | [
"scipy/interpolate/tests/test_bsplines.py"
] | [
"from __future__ import division, absolute_import, print_function\n\nimport numpy as np\nfrom numpy.testing import (assert_equal, assert_allclose, assert_,\n suppress_warnings)\nfrom pytest import raises as assert_raises\nimport pytest\n\nfrom scipy.interpolate import (BSpline, BPoly, PPol... | [
[
"scipy.interpolate._fitpack_impl.splrep",
"numpy.testing.assert_allclose",
"numpy.dot",
"numpy.ones_like",
"scipy.interpolate.BSpline",
"scipy.interpolate._fitpack._splint",
"numpy.testing.suppress_warnings",
"numpy.where",
"scipy.interpolate.PPoly.from_spline",
"numpy.lina... |
dizcza/EmbedderSDR | [
"52e48efcddab44ed5040ea98e7e886a600cc0632"
] | [
"experiment/kwta_inverse.py"
] | [
"from collections import defaultdict\n\nimport torch\nimport torch.utils.data\nimport torchvision\nimport torchvision.transforms.functional as F\nfrom PIL import Image\nfrom torchvision.datasets import MNIST\n\nfrom mighty.monitor.viz import VisdomMighty\nfrom mighty.utils.data import DataLoader\nfrom mighty.utils.... | [
[
"torch.stack",
"torch.arange",
"torch.cuda.is_available",
"torch.randn",
"torch.pow"
]
] |
BrouBoni/segmentation_RT | [
"e44f4fafe23652f3122a5e65bd8515283dcfdbe0"
] | [
"segmentation_rt/dl/model/model.py"
] | [
"import os\nimport random\nimport time\nfrom collections import OrderedDict\nfrom datetime import datetime\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nimport torchio as tio\nfrom torch.utils.tensorboard import SummaryWriter\n\nimport segmentation_rt.dl.model.networks as networks\nfrom segm... | [
[
"torch.device",
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.save",
"torch.no_grad",
"torch.FloatTensor",
"matplotlib.pyplot.close",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.load",
"torch.nn.CrossEntropyLoss"
]
] |
DwaraknathT/pyfl | [
"e9a4d1ca98c6167a567d0d46771ac9e1c7bb7322"
] | [
"pyfl/models/resnet.py"
] | [
"'''\nProperly implemented ResNet-s for CIFAR10 as described in paper [1].\nThe implementation and structure of this file is hugely influenced by [2]\nwhich is implemented for ImageNet and doesn't have option A for identity.\nMoreover, most of the implementations on the web is copy-paste from\ntorchvision's resnet ... | [
[
"torch.nn.Linear",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.functional.relu",
"torch.nn.init.xavier_normal_"
]
] |
enwudz/pytracker | [
"e6648c40ecd68dbe995b0873af7ed6d438e32f95"
] | [
"npy2csv.py"
] | [
"## This is the NEWEST version (Aug 24,2020). It accommodates time \"gaps\" among the npy files that result from stopping and starting data collection.\n\n# Until Dec26,2020, its filename was \"testing.py\"\n\nimport numpy as np\nimport sys\nimport analysisTools\nfrom matplotlib import dates\n\nbinSize = 1\n\n# cho... | [
[
"numpy.savetxt",
"numpy.shape",
"matplotlib.dates.num2date",
"numpy.hstack",
"numpy.vstack"
]
] |
erinfry6/machine-learning-engineering-for-production-public | [
"22af96d2cba8f8021ed08c3b88f3c0d8fa51a01e"
] | [
"course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/main.py"
] | [
"import pickle\nimport numpy as np\nfrom typing import List\nfrom fastapi import FastAPI\nfrom pydantic import BaseModel, conlist\n\n# test \n\napp = FastAPI(title=\"Predicting Wine Class with batching\")\n\n# Open classifier in global scope\nwith open(\"models/wine-95.pkl\", \"rb\") as file:\n clf = pickle.load... | [
[
"numpy.array"
]
] |
vishal1905/face-alignment | [
"5c2069aefdfbc028b37021542db68e5a2789db4d"
] | [
"face_alignment/api.py"
] | [
"import torch\r\nfrom enum import IntEnum\r\nfrom skimage import io\r\nimport numpy as np\r\nfrom distutils.version import LooseVersion\r\n\r\nfrom .utils import *\r\n\r\n\r\nclass LandmarksType(IntEnum):\r\n \"\"\"Enum class defining the type of landmarks to detect.\r\n\r\n ``_2D`` - the detected points ``(x... | [
[
"numpy.concatenate",
"torch.cat",
"numpy.zeros",
"torch.no_grad",
"torch.from_numpy",
"torch.tensor"
]
] |
wkitlasten/flopy | [
"e77536f43cb6e01ba54ac2a9f047925c188b1486"
] | [
"flopy/utils/reference.py"
] | [
"\"\"\"\nModule spatial referencing for flopy model objects\n\n\"\"\"\nimport json\nimport numpy as np\nimport os\nimport warnings\n\nfrom collections import OrderedDict\n\n__all__ = [\"TemporalReference\"]\n# all other classes and methods in this module are deprecated\n\n# web address of spatial reference dot org\... | [
[
"numpy.tile",
"numpy.where",
"numpy.cos",
"numpy.max",
"numpy.sin",
"numpy.empty",
"numpy.add.reduce",
"scipy.ndimage.rotate",
"matplotlib.pyplot.subplots",
"numpy.nanmin",
"numpy.arange",
"matplotlib.pyplot.gca",
"numpy.nanmax",
"numpy.array",
"numpy.sa... |
elhamalamoudi/deepPID | [
"a6b80abeebda3c86fd99dc37805977e8994b6c36"
] | [
"robots.py"
] | [
"import rospy\nfrom nav_msgs.msg import Odometry\nfrom geometry_msgs.msg import Twist\nimport numpy as np\nimport tf.transformations\nfrom plotter import plotter\nfrom pid import pi_controller_pioneer, pid_controller_pioneer\nfrom std_srvs.srv import Empty\n#TODO nothing is stored here yet. So no plots will be abai... | [
[
"numpy.divide",
"numpy.array",
"numpy.zeros",
"numpy.exp",
"numpy.mean",
"numpy.std",
"numpy.abs",
"numpy.clip"
]
] |
dsblank/pytorch-lightning | [
"ed26c177b2c1d93c800dc8f83ffe69ce999c11db"
] | [
"tests/models/mixins.py"
] | [
"from collections import OrderedDict\n\nimport torch\n\nfrom pytorch_lightning.core.decorators import data_loader\n\n\nclass LightningValidationStepMixin:\n \"\"\"\n Add val_dataloader and validation_step methods for the case\n when val_dataloader returns a single dataloader\n \"\"\"\n\n @data_loader... | [
[
"torch.mean",
"torch.tensor",
"torch.argmax",
"torch.sum"
]
] |
liusida/ds2_arxiv | [
"1ee8a3f65cfb662a1af6dca29cde3e07ec5b322b"
] | [
"ds2_arxiv/13.0.twitter.py"
] | [
"import socket, os, re, time\nimport pandas as pd\nimport numpy as np\nfrom ds2_arxiv.tools.my_firefox import MyFirefox\nfrom bs4 import BeautifulSoup\nimport random\n\nlocal_debug = socket.gethostname()!=\"star-lab\"\n\ndef google_search(author):\n author = author.lower()\n f_author = author.replace(\" \", \... | [
[
"pandas.read_pickle"
]
] |
cannlytics/cannabis-data-science | [
"1d5f3085e7b2858b6791840b90335be4669268b3"
] | [
"2021-11-24/retailer_stats_ma.py"
] | [
"\"\"\"\nMassachusetts Cannabis Dispensary Statistics\nCopyright (c) 2021 Cannlytics and the Cannabis Data Science Meetup Group\n\nAuthors: Keegan Skeate <keegan@cannlytics.com>\nCreated: 11/24/2021\nUpdated: 11/24/2021\nLicense: MIT License <https://opensource.org/licenses/MIT>\n\nObjective:\n \n Calculate t... | [
[
"pandas.to_datetime",
"matplotlib.pyplot.show",
"pandas.DataFrame"
]
] |
zhongyuchen/information-extraction | [
"6cf9905bed5ee9c33706854cd6ceae04194aa5e4"
] | [
"classification/model_bert.py"
] | [
"import torch\nfrom torch import nn\n# from torch.nn import CrossEntropyLosss\n\nimport os\nimport json\n\nfrom fastNLP.modules.encoder.bert import BertModel, BertEmbeddings, BertEncoder, BertPooler, BertLayerNorm\n\nCONFIG_FILE = 'bert_config.json'\n\n\n# fastNLP formated class based on BertModel\nclass BertForMul... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.ones_like",
"torch.load",
"torch.zeros_like"
]
] |
marcusklasson/vcca_grocerystore | [
"c88483e3722a2508b866dbe4e67f4e7d2e10b92c"
] | [
"models/vcca_private/vcca_private_xw.py"
] | [
"\nimport tensorflow as tf\nimport numpy as np\n\nfrom models.networks.lstm_networks import language_generator, build_sampler, language_encoder\nfrom data.import_data import load_captions\n\nclass VCCA_private(object):\n\n def __init__(self, dim_x, dim_z, dim_w, word_to_idx, lambda_x=1.0, lambda_w=1.0,\n ... | [
[
"tensorflow.exp",
"numpy.ceil",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.nn.leaky_relu",
"numpy.sum",
"numpy.random.permutation",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"tensorflow.reduce_sum",
"tensorflow.layers.dense",
"tensorflow.reduc... |
rhett-chen/graspnet-baseline | [
"825d1885e100e418b7a11590f18957270db09408"
] | [
"pointnet2/pointnet2_utils.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n# \n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n''' Modified based on: https://github.com/erikwijmans/Pointnet2_PyTorch '''\nfrom __future__ import (\n division,\n absolute_... | [
[
"torch.zeros",
"torch.cat",
"torch.sqrt",
"torch.unique",
"torch.randint",
"torch.Tensor",
"torch.matmul"
]
] |
jkelowitt/GenStrIde | [
"7047ac6bc4943030cf3ec21abf01dac8ed713d47"
] | [
"utils/DataContainer.py"
] | [
"import numpy as np\nimport random\nimport sys\n\nclass data_t(object):\n def __init__(self, data, labels=None):\n self.labels = labels\n self.data = data\n self.num_examples = data.shape[0]\n\n def next_batch(self, batch_size, index):\n idx = index * batch_size\n n_idx = in... | [
[
"numpy.random.shuffle",
"numpy.argmax",
"numpy.arange",
"numpy.squeeze",
"numpy.vstack"
]
] |
yukiito2/cupy | [
"7e707b8ccea13d79b9026c91c27143cb78014d4b"
] | [
"tests/cupy_tests/logic_tests/test_type_test.py"
] | [
"import numpy\n\nfrom cupy import testing\n\n\nclass TestBinaryRepr(testing.NumpyAliasBasicTestBase):\n\n func = 'isscalar'\n\n\n@testing.parameterize(\n *testing.product({\n 'value': [\n 0, 0.0, True,\n numpy.int32(1), numpy.array([1, 2], numpy.int32),\n numpy.complex(... | [
[
"numpy.int32",
"numpy.array",
"numpy.complex"
]
] |
dolphindb/api_python3 | [
"caf1c6a38fe3dc0febf33ca5f299c2cdae0f139d"
] | [
"test/test_upload.py"
] | [
"import unittest\r\nimport dolphindb as ddb\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom numpy.testing import assert_array_equal\r\nfrom pandas.testing import assert_frame_equal, assert_series_equal\r\nfrom setup import HOST, PORT, WORK_DIR, DATA_DIR\r\n\r\n\r\nclass TestUploadObject(unittest.TestCase):\r\n... | [
[
"pandas.isnull",
"numpy.array",
"pandas.testing.assert_frame_equal",
"numpy.matrix",
"pandas.DataFrame",
"numpy.testing.assert_array_equal",
"numpy.eye",
"numpy.arange",
"pandas.Series",
"numpy.datetime64"
]
] |
chaithyagr/torchkbnufft | [
"3592175fe2d1f611fb2cfec4d4150a850c92605f"
] | [
"torchkbnufft/math.py"
] | [
"import torch\n\n\ndef complex_mult(a, b, dim=0):\n \"\"\"Complex multiplication, real/imag are in dimension dim.\n\n Args:\n a (tensor): A tensor where dimension dim is the complex dimension.\n b (tensor): A tensor where dimension dim is the complex dimension.\n dim (int): An integer ind... | [
[
"torch.cos",
"torch.stack",
"torch.sin"
]
] |
thesombady/PhysicsNum | [
"cb098af9e24fca54dc30562757c461b88bce38b1"
] | [
"PhysicsNum/Linearreg.py"
] | [
"import numpy as np\nimport math\nimport matplotlib.pyplot as plt\n\ndef Linearreg(xlist, ylist):\n \"\"\" Takes two inputs, in list, tuple or arrays and computes a linear regression with method of least squares.\n Returns k, m, such that y = kx + m & maximum deviation. \"\"\" #Add the return of std-error and... | [
[
"numpy.array",
"numpy.linalg.inv"
]
] |
JherezTaylor/thesis-preprocessing | [
"7b52ee05af90b451c8bd07c29610cce36e08aa94"
] | [
"hatespeech_core/modules/pattern_classifier/SimpleClassifier.py"
] | [
"import os\n\nimport numpy as np\nimport pandas as pd\n\nfrom .PatternVectorizer import PatternVectorizer\n\nclass SimpleClassifier:\n \n def __init__(self, scoreMatrix, classes=None):\n # scoreMatrix each represent the vector of one pattern\n self.scoreMatrix = scoreMatrix\n \n # Default set classe... | [
[
"numpy.all",
"pandas.DataFrame",
"pandas.merge"
]
] |
soichih/TractSeg | [
"f78d0c6dc998905e593cbf4346745467e30d1979"
] | [
"tractseg/libs/Utils.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ)\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 Li... | [
[
"numpy.square",
"numpy.array"
]
] |
agolo/haystack | [
"ff6bc38b85ecec3c4d3d7c47b0f2a60da6b1f898"
] | [
"test/benchmarks/results_to_json.py"
] | [
"import json\nimport pandas as pd\nfrom pprint import pprint\n\n\ndef reader(reader_csv=\"reader_results.csv\"):\n model_rename_map = {\n 'deepset/roberta-base-squad2': \"RoBERTa\",\n 'deepset/minilm-uncased-squad2': \"MiniLM\",\n 'deepset/bert-base-cased-squad2': \"BERT base\",\n 'de... | [
[
"pandas.read_csv",
"pandas.merge"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.