repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
JiaheXu/CIS | [
"01881beb8db270ecda917af07c2588ed66dddbc9"
] | [
"CIS1_PA3/CIS1-PA3/KD_tree.py"
] | [
"import numpy as np\nimport sys, os\nimport time\nimport glob\nfrom registration_3d import *\nfrom cartesian import *\nfrom collections import namedtuple\nfrom operator import itemgetter\nfrom pprint import pformat\nimport matplotlib.pyplot as plt\nfrom read_files import *\nimport argparse\nfrom ICPmatching import ... | [
[
"numpy.array",
"numpy.finfo",
"numpy.linalg.norm",
"numpy.zeros"
]
] |
waitingkuo/tensorflow | [
"ce3572a08b9ecfa5c8dd94921c2011f37b58e608"
] | [
"tensorflow/contrib/bayesflow/python/kernel_tests/variational_inference_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.initialize_all_variables",
"tensorflow.shape",
"tensorflow.contrib.distributions.kl",
"tensorflow.expand_dims",
"tensorflow.contrib.distributions.Normal",
"tensorflow.constant",
"tensorflow.contrib.layers.linear",
"tensorflow.test.main"
]
] |
iyerr3/sagemaker-python-sdk | [
"cfaa2c6aabb3860e722bf68b27e0f9c3b8fc5570"
] | [
"tests/integ/test_tf_script_mode.py"
] | [
"# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in th... | [
[
"numpy.zeros"
]
] |
lsst-uk/macauff | [
"02ce5caeaa1523957f914155dd433c7d1bf65869"
] | [
"macauff/tests/test_perturbation_auf.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE\n'''\nTests for the \"perturbation_auf\" module.\n'''\n\nimport pytest\nimport os\nimport numpy as np\nfrom numpy.testing import assert_allclose\nfrom scipy.special import j0, j1\n\nfrom ..matching import CrossMatch\nfrom ..misc_functions_fortran import m... | [
[
"numpy.ones",
"numpy.sum",
"numpy.diff",
"numpy.histogram",
"scipy.special.j1",
"scipy.special.j0",
"numpy.any",
"numpy.ones_like",
"numpy.copy",
"numpy.amax",
"numpy.log10",
"numpy.where",
"numpy.linspace",
"numpy.mean",
"numpy.sqrt",
"numpy.zeros",... |
cehanagan/pylith | [
"ac2c1587f87e45c948638b19560813d4d5b6a9e3"
] | [
"tests/fullscale/viscoelasticity/nofaults-3d/axialstrainrate_genmaxwell_soln.py"
] | [
"# ----------------------------------------------------------------------\n#\n# Brad T. Aagaard, U.S. Geological Survey\n# Charles A. Williams, GNS Science\n# Matthew G. Knepley, University at Buffalo\n#\n# This code was developed as part of the Computational Infrastructure\n# for Geodynamics (http://geodynamics.or... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.array",
"numpy.where",
"numpy.linspace"
]
] |
sclipman/TransmissionCluster2 | [
"3dbe4c23bc0ae0489e2686d915615bbb32631f4d"
] | [
"EPI-ClusT.py"
] | [
"#!/usr/bin/env python3\n\n###############################################################################\n# Program: EPI-ClusT.py\n# Type: Python Script\n# Version: 1.0\n# Author: Steven J. Clipman\n# Description: Empiral Phylogeny Informed Cluster Tool for identifying\n# distance thresholds and defi... | [
[
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.hist",
"matplotlib.use",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.bar"
]
] |
pengbeicn/turicreate | [
"43930dc95d1d74da21214b2ea8c717200daeaca6"
] | [
"src/unity/python/turicreate/toolkits/activity_classifier/_activity_classifier.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright © 2017 Apple Inc. All rights reserved.\n#\n# Use of this source code is governed by a BSD-3-clause license that can\n# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause\n\"\"\"\nClass definition and utilities for the activity classification too... | [
[
"numpy.concatenate",
"numpy.expand_dims",
"numpy.argsort",
"numpy.argmax"
]
] |
illumi-Zoldyck/Courses- | [
"88a8fc9c1abe22e3dd2989e6cb97a8f229a521b9"
] | [
"Imperial College London - Mathematics for Machine Learning Specialization/Imperial College London - Mathematics for Machine Learning Multivariate Calculus/lagrange-multipliers.py"
] | [
"# salimt\r\n# Import libraries\r\n# Import libraries\r\nimport numpy as np\r\nfrom scipy import optimize\r\n\r\n# First we define the functions, YOU SHOULD IMPLEMENT THESE\r\ndef f (x, y) :\r\n return - np.exp(x - y**2 + x*y)\r\n\r\ndef g (x, y) :\r\n return np.cosh(y) + x - 2\r\n\r\ndef dfdx (x, y) :\r\n retur... | [
[
"scipy.optimize.root",
"numpy.cosh",
"numpy.sinh",
"numpy.exp"
]
] |
gholdman1/Graphene-Modeling | [
"61fdf5941f4c43866e846902a21e58e5e1b2a47e"
] | [
"graphenemodeling/experiments/photonics/optical_models.py"
] | [
"import os\nimport numpy as np\nfrom scipy import integrate\n\ndef LorentzTerm(w,w0,gamma,s):\n\t'''\n\tA single term in a Lorentz Oscillator sum.\n\n\tParameters\n\t----------\n\n\tw:\t\tarray-like, frequency at which to evaluate the response (rad/s)\n\n\tw0:\t\tscalar, resonance frequency (rad/s)\n\n\tgamma:\tsca... | [
[
"numpy.zeros_like",
"scipy.integrate.quad",
"numpy.exp",
"numpy.shape",
"numpy.sqrt"
]
] |
2017qiuju/tensorflow | [
"41948f588ba2852ebae712358117ffa86e32a24b"
] | [
"tensorflow/python/eager/context.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.pywrap_tensorflow.TF_DeviceListCount",
"tensorflow.python.pywrap_tensorflow.TFE_ContextOptionsSetConfig",
"tensorflow.python.pywrap_tensorflow.TFE_ContextSetAsyncForThread",
"tensorflow.python.pywrap_tensorflow.TFE_ContextOptionsSetAsync",
"tensorflow.python.util.tf_export.t... |
wangg12/mx-DeepIM | [
"b99e33193ef5b0927d79ca1d7e7d40ca3373c98c"
] | [
"deepim/config/config.py"
] | [
"# --------------------------------------------------------\n# Deep Iterative Matching Network\n# Licensed under The Apache-2.0 License [see LICENSE for details]\n# Written by Yi Li, Gu Wang\n# --------------------------------------------------------\nfrom __future__ import print_function, division\nimport yaml\nim... | [
[
"numpy.array"
]
] |
timpal0l/transformers | [
"d86d57faa3b6511c6e4d9139535d77b695b9af8a"
] | [
"src/transformers/models/layoutlm/modeling_layoutlm.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Microsoft Research Asia LayoutLM Team Authors and the HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://w... | [
[
"torch.ones",
"torch.nn.Linear",
"torch.nn.Softmax",
"torch.nn.Embedding",
"torch.nn.Tanh",
"torch.nn.CrossEntropyLoss",
"torch.nn.LayerNorm",
"torch.arange",
"torch.zeros",
"torch.nn.Dropout",
"torch.matmul"
]
] |
S-o-T/vlb | [
"78495570e002d0ed6badd3df62f86e416839b0af"
] | [
"python/bench/MatchingScoreBench.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n# ===========================================================\n# File Name: MatchingScoreBench.py\n# Author: Xu Zhang, Columbia University\n# Creation Date: 01-25-2019\n# Last Modified: Mon Apr 15 15:19:28 2019\n#\n# Description: Matching score benchmark\n#\n# Copy... | [
[
"numpy.sum",
"numpy.argsort",
"numpy.get_include",
"numpy.zeros"
]
] |
thegodone/pytorch_geometric | [
"4e9e494e3862f59afebd5678f802700bc4f6ff45"
] | [
"examples/dimenet_utils.py"
] | [
"# Shameless steal from: https://github.com/klicperajo/dimenet\n\nimport numpy as np\nfrom scipy.optimize import brentq\nfrom scipy import special as sp\n\ntry:\n import sympy as sym\nexcept ImportError:\n sym = None\n\n\ndef Jn(r, n):\n return np.sqrt(np.pi / (2 * r)) * sp.jv(n + 0.5, r)\n\n\ndef Jn_zeros... | [
[
"numpy.zeros",
"numpy.arange",
"scipy.optimize.brentq",
"scipy.special.jv",
"numpy.sqrt",
"numpy.array"
]
] |
SulemanKhurram/ThesisExperiments | [
"4fdf7b6558c87a096dcdc374c35085ac946d3a58"
] | [
"main_Bayes_Exp01e.py"
] | [
"from __future__ import print_function\n\nimport os\nimport sys\nimport time\nimport argparse\nimport datetime\nimport math\nimport pickle\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nimport torchvision\nimport torchvision.transforms as transforms\nfrom torch.utils.data import SubsetRandomSampler\n\nf... | [
[
"torch.utils.data.DataLoader",
"sklearn.metrics.classification_report",
"torch.no_grad",
"torch.cuda.is_available",
"matplotlib.pyplot.ylabel",
"sklearn.metrics.precision_score",
"torch.max",
"matplotlib.pyplot.plot",
"sklearn.metrics.roc_curve",
"matplotlib.pyplot.figure",... |
kyle1/sportsreference | [
"baa4890382e7c9e5e38a42c1a71303431345378b"
] | [
"tests/integration/boxscore/test_nba_boxscore.py"
] | [
"import mock\nimport os\nimport pandas as pd\nfrom datetime import datetime\nfrom flexmock import flexmock\nfrom sportsreference import utils\nfrom sportsreference.constants import HOME\nfrom sportsreference.nba.constants import BOXSCORE_URL, BOXSCORES_URL\nfrom sportsreference.nba.boxscore import Boxscore, Boxscor... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
bgpeyton/QCEngine | [
"54f42a719edf3f1937dcaf8ab2adbb1171304e12"
] | [
"qcengine/programs/gamess/harvester.py"
] | [
"\"\"\"Compute quantum chemistry using Iowa State's GAMESS executable.\"\"\"\n\nimport logging\nimport pprint\nimport re\nfrom decimal import Decimal\nfrom typing import Tuple\n\nimport numpy as np\nimport qcelemental as qcel\nfrom qcelemental.models import Molecule\nfrom qcelemental.molparse import regex\n\nfrom .... | [
[
"numpy.array"
]
] |
xinbaiusc/MLR-OOD | [
"b6e0ac19b17a61cf7599bf1ce9bf27c8451d1c10"
] | [
"train.py"
] | [
"# coding=utf-8\n# This code is modified based on generative.py at \n#\n# https://github.com/google-research/google-research/tree/master/genomics_ood\n#\n# Copyright 2021 University of Southern California.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file excep... | [
[
"tensorflow.summary.scalar",
"tensorflow.data.TFRecordDataset",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.logging.set_verbosity",
"tensorflow.train.Int64List",
"tensorflow.train.Feature",
"tensorflow.data.Iterator.from_string_handle",
"tensorflow.contrib.rnn.La... |
tvogiannou/ctrigrid | [
"a562bf0b72af87deb0b24a0fd4b3687be98af113"
] | [
"python/tests/test_grid.py"
] | [
"\nimport sys\nimport numpy\nimport time\n\nimport ctrigrid_bindings # this needs to be copied in the local directory\n\n\ns=0.5\ncube_vertices=[\n -s, -s, -s,\n s, -s, -s,\n s, s, -s,\n -s, s, -s,\n -s, -s, s,\n s, -s, s,\n s, s, s,\n -s, s, s,\n ... | [
[
"numpy.hstack",
"numpy.random.rand"
]
] |
MAZiqing/FEDformer | [
"7914d39df829494a8172afb9676982c3789d491d"
] | [
"layers/utils.py"
] | [
"import torch\nimport torch.nn as nn\n\nimport numpy as np\nfrom functools import partial\n\nfrom scipy.special import eval_legendre\nfrom sympy import Poly, legendre, Symbol, chebyshevt\n\ndef legendreDer(k, x):\n def _legendre(k, x):\n return (2*k+1) * eval_legendre(k, x)\n out = 0\n for i in np.a... | [
[
"torch.sum",
"numpy.logical_or",
"numpy.eye",
"torch.min",
"torch.max",
"torch.nn.MSELoss",
"numpy.zeros",
"torch.std",
"torch.no_grad",
"numpy.abs",
"numpy.arange",
"scipy.special.eval_legendre",
"numpy.polynomial.polynomial.Polynomial",
"numpy.sqrt",
"... |
meliascosta/dicom2nifti | [
"b3bb7c93bc8456f61e5372235627c1c91195b015"
] | [
"scripts/anonymize_testdata.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\ndicom2nifti\n\n@author: abrys\n\"\"\"\nfrom __future__ import print_function\n\nimport pydicom\nimport pydicom.uid\nimport pydicom.dataset\nimport logging\nimport numpy\nimport os\nimport datetime\nfrom six import string_types, iteritems\n\nimport dicom2nifti.compressed_dicom as co... | [
[
"numpy.random.randint"
]
] |
HenryOsborne/SemanticSegmentation | [
"d41549c3fd22731d7a12cdb1b438f730b0ebfcbc"
] | [
"models/CCNet/ccnet.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nfrom models.CCNet.CC import CC_module as CrissCrossAttention\n\naffine_par = True\nBatchNorm2d = nn.BatchNorm2d\n\n\ndef outS(i):\n i = int(i)\n i = (i + 1) / 2\n i = int(np.ceil((i + 1) / 2.0))\n i = (i + 1) / 2\n return i\n\n\ndef conv3x3(in... | [
[
"torch.nn.MaxPool2d",
"numpy.ceil",
"torch.nn.Dropout2d",
"torch.rand",
"torch.nn.Upsample",
"torch.cuda.is_available",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.cat"
]
] |
pollenjp/pytorch-lightning | [
"06f83492919c4c72a989f9bb8f271b92b479648b"
] | [
"tests/trainer/test_trainer.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"torch.utils.data.DataLoader",
"torch.stack",
"torch.nn.Linear",
"torch.load",
"torch.Size",
"torch.nn.init.constant_",
"torch.eq",
"torch.equal",
"torch.cuda.device_count",
"torch.tensor",
"torch.cuda.is_available",
"torch.zeros",
"torch.isfinite"
]
] |
gordonnchy/kamusi | [
"61600f9fac1d7a1fe74b1a48add55545f3f98e47"
] | [
"to_json.py"
] | [
"import pandas as pd\n\n\ndef convert_to_json():\n kamusi = pd.read_csv(\n \"words.csv\", usecols=[\"Index\", \"Word\", \"Meaning\", \"Synonyms\", \"Conjugation\"]\n )\n kamusi = kamusi.set_index(\"Index\")\n kamusi.to_json(\"kamusi.json\", orient=\"index\")\n\n\nif __name__ == \"__main__\":\n ... | [
[
"pandas.read_csv"
]
] |
AyodeAwe/cuspatial | [
"77971ac91a24228bc46cf461c0ac7b6f2ed78e44"
] | [
"python/cuspatial/cuspatial/io/geopandas_adapter.py"
] | [
"# Copyright (c) 2020-2021 NVIDIA CORPORATION.\n\nimport numpy as np\nfrom geopandas import GeoSeries as gpGeoSeries\nfrom shapely.geometry import (\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n)\n\n\nclass GeoPandasAdapter:\n def __init__(self, geoseries:... | [
[
"numpy.array",
"numpy.zeros"
]
] |
shipjobs/herbarium | [
"db49442e9322e20c2556bffa9dbcb0dfcd695788"
] | [
"herbarium/data/build.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\nfrom collections import defaultdict\nimport itertools\nimport logging\nimport numpy as np\nimport operator\nimport pickle\nimport torch.utils.data\nfrom tabulate import tabulate\nfrom termcolor import colored\n\nfrom herbarium.config import configurable\nfrom her... | [
[
"numpy.arange",
"numpy.histogram",
"numpy.asarray",
"numpy.zeros"
]
] |
poppingtonic/fastai2 | [
"026fb13f5df3f338378fbd37d9ce8b0399ef1927"
] | [
"fastai2/callback/captum.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/73_callback.captum.ipynb (unless otherwise specified).\n\n__all__ = ['json_clean', 'IntegradedGradientsCallback', 'CaptumInsightsCallback']\n\n# Cell\nimport tempfile\nfrom ..basics import *\nfrom ..learner import Callback\n\n# Cell\n\n# Dirty hack as json_clean does... | [
[
"matplotlib.colors.LinearSegmentedColormap.from_list"
]
] |
Inquiring-Nomad/ml-ops-simple | [
"ab7047e0b1d0ff8fbb2843d7a727a8d2a0f47b37"
] | [
"src/models/eval_model.py"
] | [
"import os\nimport warnings\nimport sys\nimport pandas as pd\nimport numpy as np\nfrom sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score\nfrom sklearn.model_selection import train_test_split,cross_val_score\nfrom sklearn.model_selection import GridSearchCV,RandomizedSearchCV\nfrom sklearn.lin... | [
[
"sklearn.metrics.mean_absolute_error",
"sklearn.metrics.r2_score",
"sklearn.metrics.mean_squared_error",
"pandas.read_csv"
]
] |
olsonjonny/cusp_cirq_demo | [
"f7236d93018d4c7d7eb177dba3188d9c1fa1cffe"
] | [
"cusp/cusp_stage2.py"
] | [
"\"\"\"Routines for Stage Two of CUSP: Training the Quantum Autoencoder.\"\"\"\n\nimport numpy as np\nfrom multiprocessing import Pool\n\nfrom cirq import Circuit, MeasurementGate, ParamResolver\nfrom cirq.ops import *\nfrom cirq.google import ExpZGate, XmonQubit, XmonSimulator\nfrom cirq.circuits import InsertStra... | [
[
"numpy.array",
"numpy.abs"
]
] |
JulienL3vesque/Hexoskin_RnD_OSM | [
"b524430d6f4b2b300d119b6a1586141e6c2d14a3",
"b524430d6f4b2b300d119b6a1586141e6c2d14a3"
] | [
"Python Project Filter-Detect-GUI/mne/io/bti/tests/test_bti.py",
"Python Project Filter-Detect-GUI/various_functions.py"
] | [
"from __future__ import print_function\n# Authors: Denis Engemann <denis.engemann@gmail.com>\n#\n# License: BSD (3-clause)\n\nimport os\nimport os.path as op\nfrom functools import reduce, partial\nimport warnings\n\nimport numpy as np\nfrom numpy.testing import (assert_array_almost_equal, assert_array_equal,\n ... | [
[
"numpy.eye",
"numpy.allclose",
"numpy.testing.assert_array_equal",
"numpy.testing.assert_array_almost_equal",
"numpy.testing.assert_allclose",
"numpy.array"
],
[
"numpy.arange",
"numpy.size",
"matplotlib.pyplot.scatter",
"numpy.diff"
]
] |
sky-2002/weaviate-examples | [
"34bb73f8d2096e04aaf19455f2f8da743f21b8d5"
] | [
"attendance-system-example/mark.py"
] | [
"import weaviate\nimport cv2\nimport os,sys\nimport pandas as pd\nfrom student_test import getFaces, testImage, testit\n\ndef markAttendance(faces,own=False):\n '''\n This function takes in a list of image paths (paths of face images)\n and then uses weaviate's image2vec-neural module to classify\n each... | [
[
"pandas.DataFrame"
]
] |
ufpa-organization-repositories/artificial-neural-networks | [
"bfd3e62f9f8c353a1d3ca798928a7db5a6aabc50"
] | [
"final_homework/aplicacaoKohonen_nDeTecnologias.py"
] | [
"from openpyxl import load_workbook\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# book = load_workbook('results_teste.xlsx')\nbook = load_workbook('results_pleno_completo.xlsx')\nsheet = book.active\nfrom trabalho_final.kohonen import kohonen\n\ni = 2\nend = False\n\njobs_dict = dict()\n\nwhile not end:... | [
[
"matplotlib.pyplot.legend",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"numpy.random.random",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.linspace",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.scatter"
]
] |
OliverZijia/tensorlayer2 | [
"01113b53e84a3bbb298b9c35ebd53254e487350f"
] | [
"tests/layers/test_layers_convolution.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport unittest\n\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n\nimport tensorflow as tf\nimport tensorlayer as tl\nfrom tensorlayer.layers import *\nfrom tensorlayer.models import *\n\nfrom tests.utils import CustomTestCase\n\n\nclass Layer_Convolution_1D... | [
[
"tensorflow.constant_initializer"
]
] |
RajanPatel97/FYP | [
"81ca4a6782c1205e1313da280ee5f5cdeb4f19f7"
] | [
"Embeddings/Char-CNN-RNN/generate_cnn_features.py"
] | [
"import os \nimport csv\nimport torchvision\nimport torchvision.transforms as transforms\nimport torch\nimport torch.nn as nn\nfrom PIL import Image\nfrom PIL import ImageFile\nImageFile.LOAD_TRUNCATED_IMAGES = True\nimport pickle\nimport numpy as np\ndata_folder = '/media/user/DATA/ArtImages'\n\n\nnet = torchvisio... | [
[
"torch.no_grad"
]
] |
CodeRevenge/practicas_ia_2 | [
"b81e3b68680b61785918b19360cb0afc5b14c26e"
] | [
"Practica06_Clustering/codigoFuente/Algorithms/RBF.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\n\nclass RBF(object):\n \"\"\"Implementation of a Radial Basis Function Network\"\"\"\n def __init__(self, hidden_neurons=2, learning_rate=0.01, max_ephochs=100, min_error = 0.01):\n self.hidden_neurons = hidden_neurons\n self.learning_rate ... | [
[
"numpy.random.uniform",
"matplotlib.pyplot.legend",
"numpy.linalg.norm",
"numpy.sin",
"numpy.zeros",
"numpy.squeeze",
"numpy.argmin",
"matplotlib.pyplot.tight_layout",
"numpy.random.randn",
"numpy.abs",
"numpy.exp",
"numpy.std",
"matplotlib.pyplot.show",
"nu... |
vxsharma-14/project-NAnPack | [
"fad644ec9a614605f84562745a317e5512db1d58"
] | [
"nanpack/mesh.py"
] | [
"\"\"\"A module consisting of various meshing functions.\"\"\"\r\n# ***********************************************************************\r\n#\r\n# FILE mesh.py\r\n#\r\n# AUTHOR Dr. Vishal Sharma\r\n#\r\n# VERSION 1.0.0-alpha4\r\n#\r\n# WEBSITE https://github.com/vxsharma-14/proj... | [
[
"numpy.zeros"
]
] |
ambader/hcrystalball | [
"713636e698d9a260fab982764fce4a13699be1a8"
] | [
"tests/integration/test_frequency.py"
] | [
"import pandas as pd\nimport pytest\n\n\n@pytest.mark.parametrize(\n \"X_y_with_freq, freq\",\n [\n (\"series_with_freq_D\", \"D\"),\n (\"series_with_freq_M\", \"M\"),\n (\"series_with_freq_Q\", \"Q-DEC\"),\n (\"series_with_freq_Y\", \"A-DEC\"),\n ],\n indirect=[\"X_y_with_fr... | [
[
"pandas.infer_freq"
]
] |
PlanNoa/video_super_resolution | [
"534e6e6b55d652c61306df4bc11e83a456855dd4"
] | [
"my_packages/FlowProjection/networks/FlowNetSD.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.nn import init\n\nfrom .submodules import conv, deconv, i_conv, predict_flow\n\n\nclass FlowNetSD(nn.Module):\n def __init__(self, batchNorm=True):\n super(FlowNetSD, self).__init__()\n\n self.batchNorm = batchNorm\n self.conv0 = conv(self.bat... | [
[
"torch.nn.init.xavier_uniform_",
"torch.nn.init.uniform_",
"torch.nn.Upsample",
"torch.cat",
"torch.nn.ConvTranspose2d"
]
] |
OpenMLCo/Yolo-OCR | [
"33fdc86316674458285bb78f55dc643e557c2d1c",
"33fdc86316674458285bb78f55dc643e557c2d1c"
] | [
"Yolo-OCR/extract_info_cedula.py",
"Yolo-OCR/extract_info_RUT.py"
] | [
"# Extraer bounding boxes\nfrom pytesseract import Output\nimport pytesseract\n# import imutils\n# import argparse\nimport os\nimport glob\nimport random\nimport darknet\n# import time\nimport cv2\nimport numpy as np\nimport darknet\n# import matplotlib.pyplot as plt\n\n# def parser():\n# parser = argparse.Argu... | [
[
"numpy.ascontiguousarray",
"numpy.max",
"numpy.min",
"numpy.concatenate",
"numpy.unique"
],
[
"numpy.ascontiguousarray",
"numpy.argmin",
"numpy.min",
"numpy.concatenate",
"numpy.unique"
]
] |
earlbabson/torchflare | [
"15db06d313a53a3ec4640869335ba87730562b28"
] | [
"tests/mixers/test_mixers.py"
] | [
"from torchflare.batch_mixers.mixers import cutmix, mixup, get_collate_fn\nimport torch\n\n\nx = torch.randn(4, 3, 256, 256)\ntargets = torch.tensor([0, 1, 0, 1])\n\nds = torch.utils.data.TensorDataset(x, targets)\n\n\ndef test_mixup():\n dl = torch.utils.data.DataLoader(ds, batch_size=2)\n batch = next(iter(... | [
[
"torch.utils.data.DataLoader",
"torch.randn",
"torch.tensor",
"torch.is_tensor",
"torch.utils.data.TensorDataset"
]
] |
tansaku/examples | [
"cc121d3354ff7f9814b6eee881dce6e6c55d0e68"
] | [
"tensorflow_examples/lite/model_maker/core/task/audio_classifier.py"
] | [
"# Copyright 2020 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.math.confusion_matrix",
"tensorflow.distribute.get_strategy",
"tensorflow.rank",
"tensorflow.math.argmax"
]
] |
thanhhvnqb/FCOS | [
"6e089528d909e56bb7348b56a2ab8f788bf9d2ed"
] | [
"tools/train_net.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nr\"\"\"\nBasic training script for PyTorch\n\"\"\"\n\n# Set up custom environment before nearly anything else is imported\n# NOTE: this should be the first import (no not reorder)\nfrom fcos_core.utils.env import setup_environment # noqa F40... | [
[
"torch.cuda.empty_cache",
"torch.nn.SyncBatchNorm.convert_sync_batchnorm",
"torch.distributed.init_process_group",
"torch.nn.parallel.DistributedDataParallel",
"torch.device",
"torch.cuda.set_device"
]
] |
nschloe/pynosh | [
"331454b29246e6c009878589aad2dccb9fda6c30"
] | [
"pynosh/magnetic_vector_potentials.py"
] | [
"\"\"\"Module that provides magnetic vector potentials.\"\"\"\nimport numpy\n\n\ndef constant_field(X, B):\n \"\"\"Converts a spatially constant magnetic field B at X\n into a corresponding potential.\n \"\"\"\n # This is one particular choice that works.\n return 0.5 * numpy.cross(B, X)\n\n\ndef mag... | [
[
"numpy.sum",
"numpy.empty",
"numpy.cross",
"numpy.cos",
"numpy.abs",
"numpy.sqrt",
"numpy.sin",
"numpy.nonzero"
]
] |
naganandy/G-MPNN-R | [
"04564c059e6e8cfc08edb27403dfe6bb89ba8bab"
] | [
"MPNNR/model/utils.py"
] | [
"import torch, numpy as np, scipy.sparse as sp\nfrom torch.nn import functional as F\nfrom tqdm import tqdm\n\n\n\ndef adjacency(H):\n \"\"\"\n construct adjacency for recursive hypergraph\n arguments:\n H: recursive hypergraph\n \"\"\"\n A = np.eye(H['n'])\n E = H['D0']\n \n for k in tqd... | [
[
"numpy.vstack",
"numpy.eye",
"torch.Size",
"numpy.isinf",
"scipy.sparse.csr_matrix",
"scipy.sparse.diags",
"torch.from_numpy",
"torch.sparse.FloatTensor",
"numpy.power"
]
] |
quantumiracle/robolite | [
"b3166a1c51a1118706177f4a4e7401e7c2c6c404"
] | [
"robosuite/models/grippers/panda_gripper.py"
] | [
"\"\"\"\nGripper for Franka's Panda (has two fingers).\n\"\"\"\nimport numpy as np\nfrom robosuite.utils.mjcf_utils import xml_path_completion\nfrom robosuite.models.grippers.gripper import Gripper\n\n\nclass PandaGripperBase(Gripper):\n \"\"\"\n Gripper for Franka's Panda (has two fingers).\n \"\"\"\n\n ... | [
[
"numpy.array"
]
] |
kalyanramu/WeedDetection | [
"ab8c94391a6faddccfa8760837745f9dcb20a8b8"
] | [
"train.py"
] | [
"#! /usr/bin/env python\n\nimport argparse\nimport os\nimport numpy as np\nimport json\nfrom voc import parse_voc_annotation\nfrom yolo import create_yolov3_model, dummy_loss\nfrom generator import BatchGenerator\nfrom utils.utils import normalize, evaluate, makedirs\nfrom keras.callbacks import EarlyStopping, Redu... | [
[
"tensorflow.device",
"numpy.random.shuffle",
"numpy.random.seed"
]
] |
plarr2020-team1/mannequinchallenge | [
"4aff68aedad8619a2ec557f9162cc9692181318c"
] | [
"mannequinchallenge/infer.py"
] | [
"import torch\nimport numpy as np\nfrom mannequinchallenge.options.train_options import TrainOptions\nfrom mannequinchallenge.loaders import aligned_data_loader\nfrom mannequinchallenge.models import pix2pix_model\n\nmodel = None\n\nclass DictX(dict):\n def __getattr__(self, key):\n try:\n retu... | [
[
"numpy.array",
"torch.cuda.is_available"
]
] |
KISMED-TUDa/ECG_Classification | [
"7df7b6d28287f592536cdbf01b6aec73e7b045ef"
] | [
"scripts/spectrogram_example.py"
] | [
"from scipy.signal import spectrogram\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torch\nimport torchaudio\n\nfrom wettbewerb import load_references\n\nif __name__ == '__main__':\n ecg_leads = load_references(\"../data/training/\")[0]\n for ecg_lead_ in ecg_leads:\n if ecg_lead_.shape[... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show",
"torch.from_numpy"
]
] |
nstfk/SentEval | [
"2bd42ae700fcfc4fb11b0ad55988ac95742d5334"
] | [
"examples/infersent.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\n\"\"\"\nInferSent models. See https://github.com/facebookresearch/InferSent.\n\"\"\"\n\nfrom __future__ import abso... | [
[
"torch.load"
]
] |
oscarkey/safe-exploration | [
"32f0582a7b54ab7d4c1d415afbcf5e9554e8bcec"
] | [
"safe_exploration/episode_runner.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Sep 29 11:11:23 2017\n\n@author: tkoller\n\"\"\"\nimport time\nimport warnings\n\nimport numpy as np\nfrom scipy.spatial.qhull import ConvexHull\n\nfrom . import utils_ellipsoid\nfrom .safempc_cem import MpcResult\nfrom .sampling_models import MonteCarloSafetyVerific... | [
[
"numpy.vstack",
"numpy.save",
"matplotlib.pyplot.pause",
"scipy.spatial.qhull.ConvexHull",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"numpy.savez",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.axes",
"numpy.hstack",
"matplotlib.pyplot.show"... |
norton-chris/MARS-Net | [
"6f671837d0629422680c78adf9b643894debae70"
] | [
"models/debug_utils.py"
] | [
"'''\r\nAuthor Junbong Jang\r\nDate 9/2/2020\r\n\r\nContains debugging functions useful for deep learning research\r\n\r\n'''\r\nimport sys\r\nsys.path.append('..')\r\nsys.path.append('../data_handle')\r\nfrom UserParams import UserParams\r\nfrom data_processor import get_std_mean_from_images\r\n\r\nimport math\r\n... | [
[
"tensorflow.compat.v1.profiler.profile",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.profiler.ProfileOptionBuilder.float_operation",
"numpy.asarray",
"tensorflow.compat.v1.get_default_graph",
"tensorflow.compat.v1.RunMetadata"
]
] |
grasswolfs/Paddle | [
"0c2fff447c7d5b0bbad473a1590872c5343e1e56"
] | [
"python/paddle/fluid/tests/unittests/dist_fleet_ctr.py"
] | [
"# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"numpy.mean"
]
] |
launis/areadata | [
"8cf0e30ec489ce9655fcd9829284d1ec70e7360d"
] | [
"create_neuro_prediction.py"
] | [
"def plot_history(hist):\r\n import matplotlib.pyplot as plt\r\n\r\n plt.figure()\r\n plt.xlabel('Epoch')\r\n plt.ylabel('Mean Squared Error')\r\n plt.plot(hist['epoch'], hist['mean_squared_error'],\r\n label='Train Error')\r\n plt.plot(hist['epoch'], hist['val_mean_squared_error'],\r\n ... | [
[
"matplotlib.pyplot.legend",
"sklearn.metrics.mean_squared_error",
"matplotlib.pyplot.figure",
"pandas.DataFrame",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.plot",
"tensorflow.data.Dataset.from_tensor_sli... |
gregordecristoforo/3ppy | [
"6a86152746d4ac8a707273cc100239b9fe004a54"
] | [
"model/point_model.py"
] | [
"from typing import Callable, Tuple, Union\n\nimport numpy as np\nfrom tqdm import tqdm\nfrom model.forcing import (\n Forcing,\n StandardForcingGenerator,\n ForcingGenerator,\n PulseParameters,\n)\nfrom model.pulse_shape import (\n ShortPulseGenerator,\n ExponentialShortPulseGenerator,\n Pulse... | [
[
"scipy.signal.fftconvolve",
"numpy.ones",
"numpy.random.default_rng",
"numpy.arange",
"numpy.random.RandomState",
"numpy.all",
"numpy.sqrt"
]
] |
sondisonda/camera_calibration | [
"92cc1c97c2c2960f1e265342884c3dac8d063708"
] | [
"projections/lidar_camera_projection/lidar_camera_project.py"
] | [
"import os\n\nimport matplotlib.pyplot as plt\nimport open3d\n\nfrom utils import *\n\n\ndef render_image_with_boxes(img, objects, calib):\n \"\"\"\n Show image with 3D boxes\n \"\"\"\n # projection matrix\n P_rect2cam2 = calib['P2'].reshape((3, 4))\n\n img1 = np.copy(img)\n for obj in objects:... | [
[
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.cm.get_cmap",
"matplotlib.pyplot.show",
"matplotlib.pyplot.yticks"
]
] |
naviocean/SimpleCVReproduction | [
"9939f8340c54dbd69b0017cecad875dccf428f26",
"9939f8340c54dbd69b0017cecad875dccf428f26"
] | [
"NAS/AngleNAS/DARTS/shrinking/shrinking.py",
"NAS/AngleNAS/NAS-Bench-201/exps/algos/SPOS.py"
] | [
"import os\nimport time\nimport numpy as np\nimport pickle\nimport torch\nimport torch.nn as nn\nfrom super_model import Network_ImageNet\nfrom torch.autograd import Variable\nfrom config import config\nimport sys\nsys.setrecursionlimit(10000)\nimport functools\nimport copy\nprint=functools.partial(print,flush=True... | [
[
"numpy.reshape"
],
[
"torch.load",
"torch.nn.functional.softmax",
"torch.no_grad",
"numpy.argmax",
"torch.set_num_threads",
"torch.cuda.is_available",
"torch.nn.DataParallel"
]
] |
bnelo12/wavenet_vocoder | [
"68de8b8abf37fb3eec41817704f06c859925f7a5"
] | [
"train.py"
] | [
"\"\"\"Trainining script for WaveNet vocoder\n\nusage: train.py [options]\n\noptions:\n --dump-root=<dir> Directory contains preprocessed features.\n --checkpoint-dir=<dir> Directory where to save model checkpoints [default: checkpoints].\n --hparams=<parmas> Hyper parameters [de... | [
[
"torch.utils.data.DataLoader",
"torch.nn.parallel.parallel_apply",
"torch.nn.functional.softmax",
"matplotlib.pyplot.tight_layout",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.stack",
"torch.nn.parallel.scatter",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig... |
echaussidon/LSS | [
"205ce48a288acacbd41358e6d0215f4aff355049"
] | [
"scripts/SV1/gatherSV_zinfo_alltiles_denali_inpar.py"
] | [
"'''\ngather redshift info across all observations for a given target type\n'''\n\n#standard python\nimport sys\nimport os\nimport shutil\nimport unittest\nfrom datetime import datetime\nimport json\nimport numpy as np\nimport fitsio\nimport glob\nimport argparse\nfrom astropy.table import Table,join,unique,vstack\... | [
[
"numpy.isin",
"numpy.log2",
"numpy.unique"
]
] |
danielzlarson/WishBuilder | [
"201bd1ebdb6299fde36e762bb112a8546f15dc00"
] | [
"GDSC_Expression/parse.py"
] | [
"import pandas as pd\nimport sys, re, math, gzip \nimport numpy as np\n\ncellLine = sys.argv[1]\ndoseResponse = sys.argv[2]\nscreenedComponents = sys.argv[3]\nRACS = sys.argv[4]\nvariants = sys.argv[5]\nexpressionIn = sys.argv[6]\nclinicalOut = sys.argv[7]\ntmpExpression = sys.argv[8]\nfinalExpression = sys.argv[9]... | [
[
"pandas.ExcelFile",
"numpy.genfromtxt"
]
] |
zqirui/MLinPractice | [
"70c054903a5238725e802fa887862c35a8253cc3"
] | [
"code/preprocessing/split_data.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nSplits the preprocessed data into training, validation, and test set.\n\nCreated on Tue Sep 28 16:45:51 2021\n\n@author: lbechberger\n\"\"\"\n\nfrom code.util import COLUMN_LABEL\nimport os, argparse, csv\nimport pandas as pd\nfrom sklearn.model_selection im... | [
[
"pandas.read_csv",
"sklearn.model_selection.train_test_split"
]
] |
hirowgit/2B0_python_optmization_course | [
"e1890a41d0daf9a44a4d1e0a6c5d775f8ab7691b"
] | [
"1_SVG_converter_Copper.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[5]:\n\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom svg.path import parse_path\nfrom svg.path.path import Line\nfrom xml.dom import minidom\n\ndef line_splitter(start, end):\n return (lambda t: (1-t)*start+t*end)\n\ndef cubic_bezier_converter(start... | [
[
"numpy.append",
"numpy.empty",
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.pyplot.plot",
"numpy.linspace",
"numpy.linalg.norm"
]
] |
koukyo1994/atmaCup5 | [
"69ee97a3ad6758af27279cc75fcd9f94325eb0e8"
] | [
"src/core/callbacks/feature_loading.py"
] | [
"import pandas as pd\n\nimport src.utils as utils\n\nfrom scipy.sparse import hstack, csr_matrix\n\nfrom src.core.callbacks import Callback, CallbackOrder\nfrom src.core.states import RunningState\n\n\nclass SortColumnsCallback(Callback):\n signature = \"feature_loading\"\n callback_order = CallbackOrder.MIDD... | [
[
"scipy.sparse.hstack",
"scipy.sparse.csr_matrix",
"pandas.concat"
]
] |
lmc00/tfg_en_desarrollo | [
"30e61f4bb3f060f7468b1bb94930fcbe0d0f92ae"
] | [
"scripts/distribucion.py"
] | [
"#Importamos todo lo necesario como en el jupyter 1.0 de Ignacio\nimport os\n\nimport matplotlib.pylab as plt\nimport numpy as np\nfrom tqdm import tqdm\n\nimport imgclas\nfrom imgclas import paths, config\nfrom imgclas.data_utils import load_image, load_data_splits, augment, load_class_names\n\n#Comenzamos a prepa... | [
[
"matplotlib.pylab.savefig",
"numpy.median",
"matplotlib.pylab.subplots",
"numpy.amin",
"numpy.amax",
"numpy.mean"
]
] |
sshojiro/malspy | [
"d28932053541f4d2097a1e6feb9fedfe051d5b24"
] | [
"malspy/matrix_factorization.py"
] | [
"\"\"\" Matrix Factorization for Spectrum Imaging Data Analysis\n\"\"\"\n# Author: Motoki Shiga, Gifu University <shiga_m@gifu-u.ac.jp>\n# License: MIT\n#\n\nimport numpy as np\nimport scipy\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\nclass RandomMF(object):\n \"\"\"Random Matrix Factorization\n ... | [
[
"numpy.sum",
"numpy.diag",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"numpy.reshape",
"numpy.abs",
"scipy.linalg.eigh",
"matplotlib.pyplot.xlim",
"matplotlib.pyp... |
klo9klo9kloi/win_det_heatmaps | [
"fc427bcd593831d627698455b8917eb37add3f6e"
] | [
"common/utility/augment.py"
] | [
"import random\nimport numpy as np\nfrom easydict import EasyDict as edict\n\ndef get_default_augment_config():\n config = edict()\n config.do_aug = True\n\n config.scale_factor = 0.25\n config.rot_factor = 15\n config.center_factor = 0.10 # 15% relative to the patch size\n config.color_factor = 0... | [
[
"numpy.array",
"numpy.random.randn"
]
] |
dongxulee/lifeCycleRefine | [
"6ca9670dea50150aabe31f86578323cec0ab018c"
] | [
"20211025/shutDownBoth/solveMDP_poorHigh.py"
] | [
"import numpy as np\nimport jax.numpy as jnp\nfrom jax.numpy import interp\nfrom jax import jit, partial, random, vmap\nfrom tqdm import tqdm\nimport warnings\nwarnings.filterwarnings(\"ignore\")\nnp.printoptions(precision=2)\n\n\n'''\n Constants \n'''\n# time line, starts at 20 ends at 80\nT_min = 0\nT_max = 60... | [
[
"numpy.load",
"numpy.sum",
"numpy.save",
"numpy.zeros",
"numpy.printoptions",
"numpy.power",
"numpy.prod",
"numpy.genfromtxt",
"numpy.linspace"
]
] |
SharpKoi/Kashgari | [
"ef8c4b4d17dbd69616b9cc744489181909e313c3"
] | [
"kashgari/embeddings/abc_embedding.py"
] | [
"# encoding: utf-8\n\n# author: BrikerMan\n# contact: eliyar917@gmail.com\n# blog: https://eliyar.biz\n\n# file: abc_embedding.py\n# time: 2:43 下午\n\nimport json\nfrom typing import Dict, List, Any, Optional, Union\n\nimport numpy as np\nimport tensorflow as tf\nimport tqdm\n\nimport kashgari\nfrom kashgari.generat... | [
[
"tensorflow.keras.models.model_from_json"
]
] |
neutrinoceros2/yt | [
"8cabf6091414e4d9a5037c4ff49199adf0ae64d6"
] | [
"yt/visualization/tests/test_plotwindow.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nimport shutil\nimport tempfile\nimport unittest\nfrom collections import OrderedDict\nfrom distutils.version import LooseVersion\n\nimport matplotlib\nimport numpy as np\nfrom nose.tools import assert_true\n\nfrom yt.frontends.stream.api import load_unifor... | [
[
"numpy.array",
"numpy.arange",
"numpy.random.random"
]
] |
ekoly/lambdata-1 | [
"55e0238cf06ff09c5f4d246c5d96b8d446c5237f"
] | [
"lambdata_ethanmjansen/__init__.py"
] | [
"'''\nlambdata - a collection of data science helper functions\n'''\n\nimport numpy as np\nimport pandas as pd\n\n# sample code\nONES = pd.DataFrame(np.ones(10))\nZEROS = pd.DataFrame(np.zeros(50))\n"
] | [
[
"numpy.ones",
"numpy.zeros"
]
] |
matwilso/relation-networks | [
"66c67b342a90ae3699e576dcec883c329905b2e0"
] | [
"rns/util.py"
] | [
"import tensorflow as tf\n\ndef merge_summaries(sd, id):\n summaries = []\n for key in sd.keys():\n summaries.append(tf.summary.scalar(key, sd[key]))\n for key in id.keys():\n summaries.append(tf.summary.image(key, id[key]))\n return tf.summary.merge(summaries)\n\ndef pack_images(images, r... | [
[
"tensorflow.summary.scalar",
"tensorflow.minimum",
"tensorflow.shape",
"tensorflow.reshape",
"tensorflow.summary.image",
"tensorflow.zeros_like",
"tensorflow.summary.merge",
"tensorflow.transpose"
]
] |
Channingss/PaddleX | [
"f001960b7359f3a88b7dd96e1f34500b90566ceb"
] | [
"paddlex/interpret/core/_session_preparation.py"
] | [
"#copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.\n#\n#Licensed under the Apache License, Version 2.0 (the \"License\");\n#you may not use this file except in compliance with the License.\n#You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n#Unless required ... | [
[
"numpy.array"
]
] |
tonymackinnon/ray | [
"14a1419682bdba40d2c8bf226e1727cf44abcaa4"
] | [
"python/ray/tests/test_basic.py"
] | [
"# coding: utf-8\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport collections\nfrom concurrent.futures import ThreadPoolExecutor\nimport json\nimport logging\nfrom multiprocessing import Process\nimport os\nimport random\nimport re\nimport set... | [
[
"numpy.random.uniform",
"numpy.ones",
"numpy.int8",
"numpy.zeros",
"numpy.random.permutation",
"numpy.testing.assert_equal",
"pandas.DataFrame",
"numpy.random.normal",
"numpy.float32",
"numpy.int64",
"numpy.arange",
"numpy.int32",
"numpy.uint32",
"numpy.uint... |
rosequ/pytorch-examples | [
"659a73cc68fc9d2d68d0c43fb33ff446a2b86c06"
] | [
"nn/two_layer_net_nn.py"
] | [
"import torch\nfrom torch.autograd import Variable\n\n\"\"\"\nA fully-connected ReLU network with one hidden layer, trained to predict y from x\nby minimizing squared Euclidean distance.\n\nThis implementation uses the nn package from PyTorch to build the network.\nPyTorch autograd makes it easy to define computati... | [
[
"torch.randn",
"torch.nn.ReLU",
"torch.nn.Linear",
"torch.nn.MSELoss"
]
] |
daili0015/ModelFeast | [
"03afca0b129532135910ee2ac72a3b85be795289"
] | [
"models/StereoCNN/Resnet_module.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Author: zcy\n# @Date: 2019-02-14 19:29:27\n# @Last Modified by: zcy\n# @Last Modified time: 2019-02-15 15:06:31\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math\nfrom functools import partial\n\n__all__ = ['ResNet', 'BasicBloc... | [
[
"torch.nn.init.kaiming_normal_",
"torch.nn.MaxPool3d",
"torch.nn.BatchNorm3d",
"torch.nn.Linear",
"torch.randn",
"torch.nn.functional.adaptive_avg_pool3d",
"torch.nn.ReLU",
"torch.nn.Sequential",
"torch.nn.functional.avg_pool3d",
"torch.cat",
"torch.nn.Conv3d"
]
] |
Johnson-yue/stylegan2encoder | [
"709ccb52fe9a1b4dfdc367f0390cf419f2c3e972"
] | [
"encoder/generator_model.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport dnnlib.tflib as tflib\nfrom functools import partial\n\n\ndef create_stub(name, batch_size):\n return tf.constant(0, dtype='float32', shape=(batch_size, 0))\n\n\ndef create_variable_for_generator(name, batch_size):\n return tf.get_variable('learnable_dlaten... | [
[
"numpy.zeros",
"tensorflow.get_default_session",
"tensorflow.global_variables",
"tensorflow.initializers.random_normal",
"tensorflow.saturate_cast",
"tensorflow.assign",
"tensorflow.get_default_graph",
"tensorflow.constant"
]
] |
Ciaran-Carroll/college | [
"46052aa177280f7900e04e0e828247d7097eb07b"
] | [
"Project/Project 2/Harris_Corner_Detection.py"
] | [
"'''\n25th April 2018\nGroup Members: Kevin Burke (14155893)\n\t\t\t\tPaul Lynch (16123778)\n\t\t\t\tCiaran Carroll (13113259)\n Qicong Zhang (16069978)\n\n\nProject 2:\nResearch and Implement Harris Corner Detection using Python/Numpy Investigating\nthe behaviour of the algorithm.\n\nAims:\n - F... | [
[
"numpy.vstack",
"numpy.sum",
"numpy.zeros",
"matplotlib.pylab.figure",
"numpy.argsort",
"matplotlib.pylab.show",
"numpy.std",
"numpy.where",
"matplotlib.pylab.axis",
"matplotlib.pylab.imshow",
"scipy.ndimage.filters.gaussian_filter",
"numpy.concatenate",
"matplo... |
Daipuwei/Introduction-to-Machine-Learning-Based-on-Mathematical-Principles-with-Python | [
"625675ce514e461ce74cf30586d241cbcb1e4848"
] | [
"Chapter4/Other.py"
] | [
"#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n# @Time : 2018/11/4 18:48\r\n# @Author : DaiPuWei\r\n# E-Mail : 771830171@qq.com\r\n# blog : https://blog.csdn.net/qq_30091945\r\n# @Site : 中国民航大学北教25实验室506\r\n# @File : Other.py\r\n# @Software: PyCharm\r\n\r\nimport pandas as pd\r\nimport numpy a... | [
[
"numpy.sum",
"pandas.DataFrame",
"numpy.argmax",
"numpy.sort",
"numpy.array"
]
] |
retwal/Predictive | [
"57c3cb64901b7a0629b70053ecf01dac5be66d6f"
] | [
"Chapter11/contextual_bandit_agent.py"
] | [
"import tensorflow as tf\nimport tensorflow.contrib.slim as slim\nimport numpy as np\nimport os\n\nfrom tensorflow.python.framework import ops\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\nops.reset_default_graph()\n\nclass contextualBandit():\n def __init__(s... | [
[
"tensorflow.reshape",
"tensorflow.slice",
"tensorflow.contrib.slim.one_hot_encoding",
"tensorflow.global_variables_initializer",
"numpy.argmin",
"tensorflow.python.framework.ops.reset_default_graph",
"tensorflow.ones_initializer",
"numpy.random.rand",
"numpy.mean",
"numpy.z... |
openwfm/wrfxpy | [
"7f7feba97baa6cd85134185520559028d2b5464e"
] | [
"src/fmda/fuel_moisture_da.py"
] | [
"# Copyright (C) 2013-2016 Martin Vejmelka, UC Denver\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,... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.diag",
"numpy.any",
"numpy.ones_like",
"numpy.amin",
"numpy.log",
"numpy.amax",
"numpy.array",
"numpy.mean"
]
] |
aijdissanayake/request-management | [
"a88a2ce35a7a1a98630ffd14c1a31a5173b662c8"
] | [
"backend/src/reporting/views.py"
] | [
"from rest_framework.views import APIView\nfrom rest_framework import status\nfrom rest_framework.response import Response\nfrom django.http import HttpResponse\nfrom xhtml2pdf import pisa\nimport datetime\nfrom django.db import connection\nimport pandas as pd\nimport requests\nimport json\nfrom django.conf import ... | [
[
"pandas.read_sql_query"
]
] |
steven0129/TinyNeuralNetwork | [
"2ffa5a806cade1d1ebd2aa54c5697d3ad131d22f"
] | [
"examples/converter/convert_from_json.py"
] | [
"import argparse\nimport os\n\nimport torch\nfrom tinynn.converter import TFLiteConverter\nfrom tinynn.util.converter_util import export_converter_files, parse_config\n\nCURRENT_PATH = os.path.abspath(os.path.dirname(__file__))\n\n\ndef export_files():\n from models.cifar10.mobilenet import DEFAULT_STATE_DICT, M... | [
[
"torch.jit.load",
"torch.rand",
"torch.no_grad",
"torch.load"
]
] |
NigeloYang/tensorflow-practice | [
"0778f3751512773504eb6c685dfb138aa8e43d40"
] | [
"pre_data/matplotlib/demo/add_axes.py"
] | [
"import matplotlib.pyplot as plt\nimport matplotlib\n\nmatplotlib.rcParams['font.sans-serif'] = ['SimHei']\nmatplotlib.rcParams['axes.unicode_minus'] = False\n\nfig = plt.figure()\n\n# 模拟数据\nx = [1, 2, 3, 4, 5, 6, 7, 8]\ny = [1, 2, 3, 1, 6, 3, 5, 9]\n\nleft, bottom, width, height = 0.1, 0.1, 0.8, 0.8\nx1 = fig.add_... | [
[
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
]
] |
aleksandrina-streltsova/lidar-global-registration | [
"00cc919f17fe5b6854b575ca0aea3712ce034df6"
] | [
"global_registration.py"
] | [
"import time\nimport os\nimport sys\n\nimport pyntcloud\nimport yaml\nimport copy\n\nfrom open3d.cuda.pybind.geometry import PointCloud\nfrom open3d.cuda.pybind.pipelines.registration import Feature, RegistrationResult\nfrom typing import NamedTuple, List, Tuple, Optional\nfrom tqdm import tqdm\n\nimport numpy as n... | [
[
"numpy.eye",
"pandas.read_csv",
"numpy.linalg.inv",
"pandas.DataFrame",
"numpy.asarray",
"numpy.count_nonzero",
"numpy.random.rand",
"numpy.linalg.norm"
]
] |
avdarekar/color-mag-diagram | [
"4d96df646dd909ac631c627a52696ae6c4034f39"
] | [
"Colormag.py"
] | [
"#import xlrd, matplotlib.pyplot, and math libraries\nimport xlrd\nimport matplotlib.pyplot as plt\nimport math \nfrom xlrd import open_workbook\n\n#open Gaia data .xlsx file from computer\nbench = open_workbook('/Users/adbreeze13/Desktop/UNCResearch/Test/finaldata.xlsx',on_demand=True)\n\n#declare arrays for appar... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.scatter"
]
] |
IrvingShu/batch-feature-erasing-network | [
"534616c09dade92561a0203797892a63a072b1b4"
] | [
"utils/loss.py"
] | [
"# encoding: utf-8\nimport random\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\n\ndef topk_mask(input, dim, K = 10, **kwargs):\n index = input.topk(max(1, min(K, input.size(dim))), dim = dim, **kwargs)[1]\n return torch.autograd.Variable(torch.zeros_like(input.data)).scatter(dim, index... | [
[
"torch.nn.MarginRankingLoss",
"torch.nn.functional.normalize",
"torch.set_printoptions",
"torch.zeros_like",
"torch.nn.LogSoftmax",
"torch.nn.functional.relu",
"torch.norm",
"torch.arange",
"torch.nn.SoftMarginLoss",
"torch.pow"
]
] |
failure-to-thrive/addons | [
"63c82e318e68b07eb1162d1ff247fe9f4d3194fc"
] | [
"tensorflow_addons/optimizers/cyclical_learning_rate.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.cast",
"tensorflow.name_scope",
"tensorflow.keras.utils.register_keras_serializable",
"tensorflow.abs",
"tensorflow.convert_to_tensor",
"tensorflow.floor"
]
] |
apprenticeadi/gbs | [
"642d6a3abdc2a698c3bb7bca46c86afd858855f9"
] | [
"loop_hafnian_batch.py"
] | [
"import numpy as np \nimport numba \nfrom _loop_hafnian_subroutines import (\n precompute_binoms,\n nb_ix,\n matched_reps,\n find_kept_edges,\n f_loop,\n f_loop_odd,\n get_submatrices,\n get_submatrix_batch_odd0,\n eigvals\n )\n\n@numba.jit(nopython=True, parallel=True, cache=True)\nde... | [
[
"numpy.ones",
"numpy.allclose",
"numpy.ix_",
"numpy.zeros",
"numpy.asarray",
"numpy.prod",
"numpy.array"
]
] |
mayou36/probability | [
"f185c852146894af6dc02223020413bf26ecdd5c"
] | [
"tensorflow_probability/python/internal/nest_util.py"
] | [
"# Copyright 2018 The TensorFlow Probability Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a... | [
[
"tensorflow.compat.v2.name_scope",
"tensorflow.compat.v2.is_tensor",
"tensorflow.compat.v2.convert_to_tensor",
"tensorflow.python.util.nest.flatten",
"tensorflow.compat.v2.nest.flatten",
"tensorflow.python.util.nest.get_traverse_shallow_structure",
"tensorflow.python.util.nest.is_neste... |
sacherjj/python-ivi | [
"6dd1ba93d65dc30a652a3a1b34c66921d94315e8"
] | [
"ivi/ivi.py"
] | [
"\"\"\"\n\nPython Interchangeable Virtual Instrument Library\n\nCopyright (c) 2012-2017 Alex Forencich\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 with... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.sqrt"
]
] |
pantheon5100/DeACL | [
"32cf8182f2ef271fab7453bc5cc1ddea6dfa3c22"
] | [
"solo/methods/mocov2_distillation_AT_dual_bn.py"
] | [
"# Copyright 2021 solo-learn development team.\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including without limitation the rights to use,\n# copy, modify,... | [
[
"torch.max",
"torch.autograd.grad",
"torch.nn.Linear",
"torch.randn",
"torch.nn.functional.normalize",
"torch.zeros_like",
"torch.no_grad",
"torch.enable_grad",
"torch.nn.functional.cross_entropy",
"torch.nn.Identity",
"torch.zeros",
"torch.nn.ReLU",
"torch.clam... |
abdouaziz/wolof-translation | [
"505324f8a7c5a91a42e2c775495fc3bdebc8f761"
] | [
"src/t5.py"
] | [
"import torch\nimport torch.nn as nn \nimport argparse\nimport numpy as np\nfrom torch.utils.data import DataLoader , Dataset\nimport pandas as pd \nfrom tqdm import tqdm \nfrom transformers import ( \n BertTokenizer,\n AdamW , \n get_linear_schedule_with_warmup ,\n T5Tokenizer,\n T5ForConditionalG... | [
[
"torch.utils.data.DataLoader",
"pandas.read_csv",
"torch.tensor",
"torch.cuda.is_available",
"numpy.mean"
]
] |
TWJianNuo/detectron2 | [
"091bc43e85b8f7cefdccebf8d85afb7cfff2a3f0"
] | [
"kitti2cityscapesScripts/preparation/createPanopticImgs.py"
] | [
"#!/usr/bin/python\n#\n# Converts the *instanceIds.png annotations of the Cityscapes dataset\n# to COCO-style panoptic segmentation format (http://cocodataset.org/#format-data).\n# The convertion is working for 'fine' set of the annotations.\n#\n# By default with this tool uses IDs specified in labels.py. You can u... | [
[
"numpy.sum",
"numpy.nonzero",
"numpy.unique",
"numpy.zeros"
]
] |
dankernel/mnist-qnn | [
"a8b9bfc0689625ee593d990be70e8b375f233d26"
] | [
"qnn_utils.py"
] | [
"\nimport os\nimport numpy as np\nfrom termcolor import colored\n\ndef ndarray_to_bin(ndarray, out_path: str):\n \"\"\"\n ndarray to bin file\n (4byte) dim\n (4byte) shape x dim\n\n :param ndarray: target numpy ndarrat\n :param str out_path: output path\n :return: None\n \"\"\"\n\n with o... | [
[
"numpy.load",
"numpy.random.randint"
]
] |
sunilmallya/gym-duckietown | [
"d915bbe0317ee355f82a7b22d3314fbab8563187",
"d915bbe0317ee355f82a7b22d3314fbab8563187"
] | [
"pytorch_rl/main.py",
"standalone.py"
] | [
"import copy\nimport glob\nimport os\nimport time\nimport operator\nfrom functools import reduce\n\nimport gym\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.autograd import Variable\n\nfrom arguments import get_args\nfrom vec_env.d... | [
[
"torch.FloatTensor",
"torch.min",
"torch.cuda.manual_seed",
"numpy.stack",
"torch.manual_seed",
"torch.autograd.Variable",
"torch.from_numpy",
"numpy.clip",
"torch.zeros",
"torch.clamp"
],
[
"numpy.array",
"numpy.ascontiguousarray",
"numpy.flip"
]
] |
ntropy-network/ntropy-sdk | [
"7fa1c1e90be64f27f5f5034f804b1eb04e78ad78"
] | [
"tests/test_benchmark.py"
] | [
"import sys\nimport tempfile\nimport pytest\nimport csv\nimport pandas as pd\n\nfrom tests import API_KEY\n\nfrom ntropy_sdk import SDK\nfrom ntropy_sdk.benchmark import main\n\n\nTRANSACTIONS = [\n {\n \"\": \"0\",\n \"account_id\": \"6039c4ac1c63e9c7\",\n \"description\": \"AMAZON WEB SERV... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
PDR-benchmark-standardization-committee/LTS-benchmark-tool | [
"007da9bd3fb48996c0b97ad1e61549cb2ebb479e"
] | [
"dataloader.py"
] | [
"# coding: utf-8\nimport os\nimport sys\n\nimport cv2\nimport pandas as pd\nimport numpy as np\nfrom configparser import ConfigParser\nfrom logging import getLogger\n\n\nlogger = getLogger(\"__main__\").getChild(\"dataloader\")\n\n\ndef config(track, base_dname, config_file='config.ini'):\n '''\n Load ground_... | [
[
"pandas.read_csv",
"numpy.where"
]
] |
paulroujansky/mne-python | [
"6c36f8806dffe48bd82e461ad6cc8aad782e5f43"
] | [
"tutorials/intro/plot_10_overview.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n.. _tut-overview:\n\nOverview of MEG/EEG analysis with MNE-Python\n============================================\n\nThis tutorial covers the basic EEG/MEG pipeline for event-related analysis:\nloading data, epoching, averaging, plotting, and estimating cortical activity\nfrom sensor... | [
[
"numpy.arange"
]
] |
ilanbiala/16720-project | [
"08c9c898549fd42c60a3d5d21192ea6c7662aaa8"
] | [
"ibiala-code/helper.py"
] | [
"\"\"\"\nHomework4.\nHelper functions.\n\nWritten by Chen Kong, 2018.\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy.optimize\nimport submission as sub\n\ndef _epipoles(E):\n U, S, V = np.linalg.svd(E)\n e1 = V[-1, :]\n U, S, V = np.linalg.svd(E.T)\n e2 = V[-1, :]\n return... | [
[
"numpy.sqrt",
"matplotlib.pyplot.ginput",
"numpy.ones",
"matplotlib.pyplot.draw",
"numpy.zeros",
"numpy.diag",
"matplotlib.pyplot.subplots",
"numpy.linalg.svd",
"matplotlib.pyplot.sca",
"numpy.array"
]
] |
joshloyal/fully-differentiable-deep-ndf-tf | [
"b049ca86c7e0065af373c110d8bb8b5721fb25d1"
] | [
"test_ndf.py"
] | [
"import numpy as np\nimport skflow\nfrom sklearn import datasets\nfrom sklearn import metrics\nfrom sklearn.tree import DecisionTreeClassifier\nimport tensorflow as tf\n\nimport ndf\n\nDEPTH = 4 # Depth of a tree (this includes the leaf probabilities)\nN_LEAF = 2 ** (DEPTH - 1) # Number of leaf nodes\nN_DECISION_... | [
[
"tensorflow.initialize_all_variables",
"numpy.eye",
"tensorflow.placeholder",
"numpy.random.shuffle",
"sklearn.tree.DecisionTreeClassifier",
"pandas.read_csv",
"numpy.random.seed",
"numpy.random.RandomState",
"numpy.arange",
"numpy.all",
"tensorflow.constant",
"tens... |
Holmes-Alan/Photo2Sketch | [
"43a0ca6bb8a8e645b35a2ab23d11ed5efe117e09"
] | [
"network.py"
] | [
"import torch\nfrom torch import nn, einsum\nimport torch.nn.functional as F\nimport torchvision.models as models\n\n\ndef exists(val):\n return val is not None\n\n# classes\n\n\nclass Inverse(nn.Module):\n def __init__(self):\n super(Inverse, self).__init__()\n\n self.E = Encoder()\n sel... | [
[
"torch.sum",
"torch.nn.MaxPool2d",
"torch.nn.MultiheadAttention",
"torch.Tensor",
"torch.sort",
"torch.nn.Softmax",
"torch.nn.Conv1d",
"torch.nn.Conv2d",
"torch.nn.ReflectionPad2d",
"torch.nn.InstanceNorm2d",
"torch.nn.Sequential",
"torch.nn.UpsamplingBilinear2d",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.