repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
donsheehy/VoronoiWall | [
"4d85dfa3c1b3ae302f841fb16204c15eaa8398e4"
] | [
"VoronoiWall/deprecated/model.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.spatial import Delaunay\nfrom scipy.spatial import Voronoi\nfrom scipy.spatial import ConvexHull\nfrom math import sqrt, ceil\nfrom matplotlib.widgets import Button\nfrom matplotlib.widgets import TextBox\nimport pickle\nfrom util.math_utils import ba... | [
[
"numpy.array",
"matplotlib.widgets.Button",
"numpy.delete",
"matplotlib.widgets.TextBox",
"numpy.zeros",
"scipy.spatial.Voronoi",
"numpy.dot",
"numpy.linalg.norm",
"numpy.asarray",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axes",
"numpy.append",
"numpy.inse... |
MoonBlvd/pytorch-i3d | [
"3804ab2e1df018619cd12342dff7976bb302058e"
] | [
"pytorch_c3d.py"
] | [
"import torch\nimport torch.nn as nn\n# from mypath import Path\nimport pdb\nclass C3D(nn.Module):\n \"\"\"\n The C3D network.\n \"\"\"\n\n def __init__(self, num_classes, pretrained=False):\n super(C3D, self).__init__()\n\n self.conv1 = nn.Conv3d(3, 64, kernel_size=(3, 3, 3), padding=(1, ... | [
[
"torch.nn.Linear",
"torch.rand",
"torch.nn.Dropout",
"torch.nn.MaxPool3d",
"torch.nn.init.kaiming_normal_",
"torch.nn.ReLU",
"torch.nn.Conv3d",
"torch.load"
]
] |
sefabolge/Clustering-of-Large-Unlabeled-Dataset | [
"c208993f7fe1a50f6758ed57141594cb54239a14"
] | [
"Plotting/willingness_plot.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib as mtl\ndata = [];\ncolorDict = {0: 'blue', 1: 'red', 2: 'green', 3: 'orange' }\nactivity = 0\nlang = 0\ncluster = 0\n\ndef return_colour( cluster ):\n ret = []\n for i in ... | [
[
"matplotlib.patches.Patch",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.subplots"
]
] |
nicolalandro/autovc | [
"3dd7489075c0f24400d188b689fe0b170e755e46"
] | [
"test_audio.py"
] | [
"import librosa\nimport numpy as np\nimport pyloudnorm as pyln\nfrom univoc import Vocoder\nimport torch\nimport soundfile as sf\nfrom librosa.filters import mel\nfrom scipy import signal\nfrom scipy.signal import get_window\nfrom numpy.random import RandomState\nfrom collections import OrderedDict\nfrom math impor... | [
[
"numpy.clip",
"numpy.lib.stride_tricks.as_strided",
"numpy.dot",
"numpy.fft.rfft",
"numpy.log",
"numpy.random.RandomState",
"numpy.pad",
"torch.no_grad",
"scipy.signal.butter",
"torch.from_numpy",
"scipy.signal.filtfilt",
"numpy.transpose",
"scipy.signal.get_win... |
Barry-lab/SpatialAutoDACQ | [
"f39341ea5c1a51c328ec43dba8e4d9a8f7d49a48"
] | [
"openEPhys_DACQ/NWBio.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport h5py\nimport numpy as np\nimport os\nimport sys\nfrom openEPhys_DACQ.HelperFunctions import tetrode_channels, channels_tetrode, closest_argmin\nfrom pprint import pprint\nfrom copy import copy\nimport argparse\nimport importlib\nfrom tqdm import tqdm\n\n\ndef OpenEphys_SamplingRat... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.float64",
"numpy.int64",
"numpy.mod",
"numpy.int16"
]
] |
wykjLDF/plato | [
"9978357a8cc285272596161ed7999d59b0308859"
] | [
"examples/custom_model.py"
] | [
"\"\"\"\nThis example uses a very simple model and the MNIST dataset to show how the model,\nthe training and validation datasets, as well as the training and testing loops can\nbe customized in Plato.\n\"\"\"\nimport os\n\nimport torch\nfrom torch import nn\nfrom torchvision.datasets import MNIST\nfrom torchvision... | [
[
"torch.nn.Linear",
"torch.max",
"torch.no_grad",
"torch.nn.ReLU",
"torch.utils.data.DataLoader",
"torch.nn.CrossEntropyLoss"
]
] |
Gscorreia89/pyChemometrics | [
"16f3b4a1af873cf7240230439b503c5aee751ce7"
] | [
"pyChemometrics/PCAPlotMixin.py"
] | [
"from abc import ABCMeta\nimport numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nimport seaborn as sns\nimport scipy.stats as st\nfrom sklearn.model_selection import KFold\nfrom copy import deepcopy\nfrom pyChemometrics.PlotMixin import PlotMixin\n\n\nclass PCAPlo... | [
[
"numpy.min",
"numpy.cos",
"numpy.max",
"numpy.sin",
"numpy.arange",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.hlines",
"numpy.array",
"numpy.zeros",
"matplotlib.cm.get_cmap",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
... |
ecmwf-lab/infero | [
"4fec006175af48cd0313b2f89722c01636e961db"
] | [
"src/infero/api/pyinfero/pyinfero/pyinfero.py"
] | [
"#\n# (C) Copyright 1996- ECMWF.\n#\n# This software is licensed under the terms of the Apache Licence Version 2.0\n# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.\n# In applying this licence, ECMWF does not waive the privileges and immunities\n# granted to it by virtue of its status as an in... | [
[
"numpy.array",
"numpy.zeros"
]
] |
ha2398/pln-tps | [
"700e4f0b706666de6e2bf5dbc96a8a092a87a9fa"
] | [
"tp2/src/tp2.py"
] | [
"#!/usr/bin/env python3\n\n'''\ntp2.py: Trabalho Prático II - Processamento de Linguagem Natural\n@author: Hugo Araujo de Sousa [2013007463]\n@email: hugosousa@dcc.ufmg.br\n@DCC030 - Processamento de Linguagem Natural - UFMG\n'''\n\n\nimport argparse as ap\nimport numpy as np\nfrom sklearn import svm\nfrom sklearn.... | [
[
"numpy.array",
"sklearn.feature_extraction.FeatureHasher",
"sklearn.naive_bayes.GaussianNB",
"sklearn.svm.SVC"
]
] |
mobiusklein/glycresoft | [
"60d6eddffc6d8c783f0fe470b5010d4f437c7e73"
] | [
"glycan_profiling/tandem/target_decoy.py"
] | [
"# -*- coding: utf-8 -*-\nimport logging\ntry:\n logger = logging.getLogger(\"target_decoy\")\nexcept Exception:\n pass\nimport math\n\nfrom collections import defaultdict, namedtuple\n\nimport numpy as np\ntry:\n from matplotlib import pyplot as plt\nexcept (ImportError, RuntimeError):\n plt = None\n\n... | [
[
"numpy.max",
"numpy.array",
"numpy.isnan",
"numpy.empty",
"numpy.log",
"numpy.round",
"matplotlib.pyplot.subplots",
"numpy.where",
"numpy.arange"
]
] |
bnovate/bactoml | [
"66c89e6db876c5fddca3b8c00e64ae68dc9940e2"
] | [
"bactoml/df_pipeline.py"
] | [
"\"\"\"\nThis module implements the classes needed to integrate sk-learn Pipeline and\nFeatureUnion with pandas DataFrame and FCMeasurment instances (see \nFlowCytometryTools library).\n\n\"\"\"\nimport numpy as np\nimport pandas as pd\n\nfrom types import LambdaType\nfrom itertools import product, chain\nfrom skle... | [
[
"pandas.DataFrame",
"sklearn.externals.joblib.Parallel",
"numpy.atleast_1d",
"sklearn.externals.joblib.delayed"
]
] |
Turing311/Data-Efficient-Model-Compression | [
"1519dbf35beca8d2f538533c92f0c07cf6343ae0"
] | [
"pu_compress/model.py"
] | [
"# 2019.12.05-Changed output of forward function, adding attention based model.\n# Huawei Technologies Co., Ltd. <foss@huawei.com>\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass BasicBlock(nn.Module):\n expansion = 1\n\n def __init__(self, in_planes, planes, stride... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.functional.avg_pool2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Sigmoid",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.functional.relu"
]
] |
iamgmujtaba/gif_acoustic | [
"96fd6d87329609b939f09e0a2bae69663d6b555f"
] | [
"utils/feature_extraction.py"
] | [
"from keras.utils import to_categorical\nimport numpy as np\n\nimport os\nimport librosa\n\n\n####################################################################\n####################################################################\n# description: Method to split a song into multiple songs using overlapping window... | [
[
"numpy.array"
]
] |
vavaroutsos/zipline | [
"f053bc56531b91c8936e6578f9d6ebab125c4328"
] | [
"tests/pipeline/test_column.py"
] | [
"\"\"\"\nTests BoundColumn attributes and methods.\n\"\"\"\nimport operator\nfrom unittest import skipIf\n\nfrom nose_parameterized import parameterized\nfrom pandas import Timestamp, DataFrame\nfrom pandas.util.testing import assert_frame_equal\n\nfrom zipline.lib.labelarray import LabelArray\nfrom zipline.pipelin... | [
[
"pandas.Timestamp",
"pandas.util.testing.assert_frame_equal"
]
] |
cleber-si/Buscando-Exoplanetas-com-IA | [
"56cccccaeb51982ee90ef51a22f3825a63503acc"
] | [
"treino/Floresta_Randomica.py"
] | [
"import numpy as np\nimport gerenciar_arqs as GA\nfrom joblib import dump\n\n\n# Carrega os dados para treino\ng_treino, l_treino = GA.carrega_treino()\nX_g_treino, X_l_treino, y_treino = GA.ajusta_dados(g_treino, l_treino)\n\nX_g_treino_np = np.array(X_g_treino)\nX_l_treino_np = np.array(X_l_treino)\ny_treino = np... | [
[
"sklearn.ensemble.RandomForestClassifier",
"numpy.array",
"numpy.concatenate"
]
] |
NathanDai5287/air-pollution-covid-19 | [
"dbf030bba7df22efc53d2262cea469309c884791"
] | [
"Data Collection/Apparatus/top_counties.py"
] | [
"import numpy as np\nimport requests\nimport datetime\nimport pandas as pd\nfrom io import StringIO\nimport csv\nimport sys\nimport os\n\nsys.path.append(os.path.join(os.path.dirname(__file__), '..'))\n\nimport zip_conversion\n\ndef most_infected(n: int, day: datetime.date, return_zip: bool) -> list:\n \"\"\"ret... | [
[
"pandas.read_csv",
"numpy.cumsum"
]
] |
seattleflu/id3c-customizations | [
"d1321d86777b6ecff9c6f502622c5d1bf9a2efda"
] | [
"lib/seattleflu/id3c/cli/command/clinical.py"
] | [
"\"\"\"\nParse and upload clinical data.\n\nClinical data will contain PII (personally identifiable information) and\nunnecessary information that does not need to be stored. This process will only\npull out specific columns of interest that will then be stored in the receiving\nschema of ID3C.\n\"\"\"\nimport clic... | [
[
"pandas.to_datetime",
"pandas.isna",
"pandas.DataFrame",
"pandas.wide_to_long",
"pandas.Int64Dtype",
"pandas.read_csv"
]
] |
jxy/tensorflow | [
"8275aa702f787341451b91cbc76f98b8b307c562"
] | [
"tensorflow/python/autograph/utils/testing.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.ops.variables.Variable",
"tensorflow.python.eager.def_function.function",
"tensorflow.python.framework.ops.init_scope",
"tensorflow.python.framework.op_callbacks.add_op_callback",
"tensorflow.python.framework.op_callbacks.remove_op_callback"
]
] |
ahmedengu/h2o-3 | [
"ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11"
] | [
"h2o-py/tests/testdir_jira/pyunit_pubdev_4723.py"
] | [
"#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport pandas\nimport h2o\nfrom tests import pyunit_utils\nfrom pandas.util.testing import assert_frame_equal\n\nTEST_DATASET = pyunit_utils.locate('smalldata/logreg/prostate_miss... | [
[
"pandas.read_csv"
]
] |
inuinana/MusicGenreClassifiaction | [
"0cdfcae8d296b0526fdefd8e9880b317361df99c"
] | [
"backend/src/feature_extraction/audio_feature_extraction.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Mar 23 02:01:21 2018\n@author: Akihiro Inui\n\"\"\"\n# Import libraries/modules\nimport os\nimport time\nimport numpy as np\nfrom tqdm import tqdm\nfrom backend.src.common.config_reader import ConfigReader\nfrom backend.src.preprocess.audio_pr... | [
[
"numpy.array",
"numpy.shape",
"numpy.mean",
"numpy.std",
"numpy.dstack"
]
] |
eaplatanios/nig | [
"c806e534ae3b79ddcdf4093383d73ecf59947044",
"c806e534ae3b79ddcdf4093383d73ecf59947044"
] | [
"src/experiment/nig/rcv1v2.py",
"src/nig/ops/variable_ops.py"
] | [
"import logging\nimport nig\nimport numpy as np\nimport os\nimport tensorflow as tf\n\nfrom collections import OrderedDict\nfrom functools import partial\nfrom nig.data import loaders\n\nfrom experiment.nig import experiments\n\n__author__ = 'eaplatanios'\n\nlogger = logging.getLogger(__name__)\n\n\nclass RCV1V2Exp... | [
[
"numpy.concatenate",
"numpy.arange",
"tensorflow.train.AdamOptimizer",
"numpy.random.RandomState"
],
[
"tensorflow.zeros"
]
] |
maxis1314/pyutils | [
"7e0666c650209155b3da186d09c54cf14825df1e"
] | [
"ml/svm/run.py"
] | [
"# -*- coding: utf-8 -*- \nimport numpy as np \nimport scipy as sp \nfrom sklearn import svm \nfrom sklearn.cross_validation import train_test_split \nimport matplotlib.pyplot as plt \n \ndata = [] \nlabels = [] \nwith open(\"1.txt\") as ifile: \n for line in ifile: \n tokens = line.s... | [
[
"numpy.array",
"matplotlib.pyplot.contourf",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.yticks",
"sklearn.svm.SVC",
"numpy.mean",
"numpy.arange",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplo... |
jklenzing/pysat | [
"e84002e57f8a808d35562f51ce957361d99c4070"
] | [
"pysat/tests/test_sw.py"
] | [
"import datetime as dt\nimport numpy as np\nimport os\n\nfrom nose.tools import assert_raises\nfrom nose.plugins import skip\nimport pandas as pds\n\nimport pysat\nfrom pysat.instruments import sw_kp, sw_f107\nfrom pysat.instruments.methods import sw as sw_meth\n\n\nclass TestSWKp():\n def setup(self):\n ... | [
[
"numpy.full",
"numpy.isnan",
"numpy.nanmin",
"pandas.DateOffset",
"numpy.arange",
"numpy.isfinite",
"numpy.linspace",
"numpy.nanmax",
"numpy.unique"
]
] |
jjc2718/generic-expression-patterns | [
"99961ac3647d2447268ca73a94cab8b09ee08237"
] | [
"new_experiment/nbconverted/find_specific_genes_in_new_experiment.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Application: new experiment\n# \n# This notebook allows users to find specific genes in their experiment of interest using an existing VAE model\n# \n# This notebook will generate a `generic_gene_summary_<experiment id>.tsv` file that contains a z-score per gene that i... | [
[
"pandas.read_csv"
]
] |
VanekPetr/investment-funnel | [
"5de73d92efb785fb3f38509af5d22fade0c18333"
] | [
"models/CVaRmodel.py"
] | [
"import pulp\nimport pandas as pd\n\n\n# ----------------------------------------------------------------------\n# MODEL FOR THE SECOND AND ONGOING PERIODS \n# ----------------------------------------------------------------------\ndef rebalancingModel(mu,scen,CVaR_target,cvar_alpha,x_old,trans_cost, max_weight):\n... | [
[
"pandas.DataFrame",
"pandas.Series"
]
] |
samuelwestlake/Multi-Tier-Robot-System | [
"93664413e68ac2080958527149729bd6b63429b5"
] | [
"catkin/src/distributed_robot_system/src/nodes/scripts/camera.py"
] | [
"#!/usr/bin/env python\n\nimport cv2\nimport rospy\nimport numpy as np\nfrom sensor_msgs.msg import CompressedImage\n\nfrom get_message import GetMessage\n\n\nclass Camera(object):\n\n def __init__(self, nb, buggy_nb):\n self.get_image = GetMessage()\n topic = \"buggy\" + str(buggy_nb) + \"/camera\... | [
[
"numpy.fromstring",
"numpy.stack"
]
] |
hanrui1sensetime/mmdeploy | [
"f2594c624b67910e55e24418832bd96685425b2f"
] | [
"mmdeploy/backend/onnxruntime/wrapper.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport logging\nimport os.path as osp\nfrom typing import Dict, Optional, Sequence\n\nimport numpy as np\nimport onnxruntime as ort\nimport torch\n\nfrom mmdeploy.utils import Backend, parse_device_id\nfrom mmdeploy.utils.timer import TimeCounter\nfrom ..base import... | [
[
"torch.from_numpy"
]
] |
vramesh/factor-graph-compute | [
"ea8b94b63a44c99aa279333444e4852ba7dca728"
] | [
"hmslearn/main.py"
] | [
"from factor_graph import FactorGraph\nfrom attrdict import AttrDict\nfrom collections import OrderedDict\nfrom functools import reduce\nimport numpy as np\nimport pdb\n\n\ndef normalize_message(message):\n return message/message.sum() if message.sum() > 0 else np.array([0.5, 0.5])\n\n\ndef sum_product_update_va... | [
[
"numpy.array"
]
] |
mikemhenry/openfe | [
"d4c78af62a7ae05b99eb95d173661ac134b7e7b9"
] | [
"openfe/setup/_rbfe_utils/relative.py"
] | [
"# This code is a slightly modified version of the HybridTopologyFactory code\n# from https://github.com/choderalab/perses\n# The eventual goal is to move a version of this towards openmmtools\n# LICENSE: MIT\n\nimport logging\nimport openmm\nfrom openmm import unit\nimport numpy as np\nimport copy\nimport itertool... | [
[
"numpy.zeros"
]
] |
axch/probability | [
"b112faafc593d18e6adf4c85fa8e0ce37b29f400"
] | [
"tensorflow_probability/python/vi/csiszar_divergence_test.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.nn.softplus",
"tensorflow.compat.v2.fill",
"numpy.exp",
"numpy.mean",
"numpy.sign",
"tensorflow.compat.v2.GradientTape",
"tensorflow.compat.v2.sqrt",
"tensorflow.compat.v2.tile",
"numpy.log",
"tensorflow.compat.v2.exp",
"numpy.log1p",
"numpy.fl... |
MattiasFredriksson/py-c3d | [
"36c377763edcfa348fb6e272a8455a69d63ef225"
] | [
"c3d/group.py"
] | [
"''' Classes used to represent the concept of parameter groups in a .c3d file.\n'''\nimport struct\nimport numpy as np\nfrom .parameter import ParamData, Param\nfrom .utils import Decorator\n\n\nclass GroupData(object):\n '''A group of parameters stored in a C3D file.\n\n In C3D files, parameters are organize... | [
[
"numpy.array"
]
] |
Plozano94/skforecast | [
"71b83a45ecde757fb24be58adf9c88d8066a4582"
] | [
"skforecast/model_selection_statsmodels.py"
] | [
"################################################################################\n# skforecast.model_selection #\n# #\n# This work by Joaquín Amat Rodrigo is licensed under a Creative Comm... | [
[
"numpy.concatenate",
"pandas.DataFrame",
"numpy.array",
"sklearn.model_selection.ParameterGrid"
]
] |
taku-y/pymc3 | [
"70e3ca5e137b67aac0390c7e3979ec16842c4aed"
] | [
"pymc3/distributions/continuous.py"
] | [
"\"\"\"\npymc3.distributions\n\nA collection of common probability distributions for stochastic\nnodes in PyMC.\n\n\"\"\"\nfrom __future__ import division\n\nimport numpy as np\nimport theano.tensor as tt\nfrom scipy import stats\nimport warnings\n\nfrom pymc3.theanof import floatX\nfrom . import transforms\n\nfrom... | [
[
"numpy.random.normal",
"numpy.random.exponential",
"numpy.tan",
"numpy.exp",
"numpy.any",
"numpy.random.uniform",
"numpy.sqrt",
"numpy.floor"
]
] |
richardliaw/airflow-provider-ray-1 | [
"4124afd884367a5ee611e74d828892af48bee922"
] | [
"ray_provider/example_dags/xgboost_pandas_tune_breast_cancer.py"
] | [
"import os\nimport json\nfrom airflow.decorators import dag, task\nfrom airflow.utils.dates import days_ago\nfrom airflow.operators.dummy_operator import DummyOperator\nimport ray\nfrom ray_provider.decorators.ray_decorators import ray_task\nimport numpy as np\nimport xgboost_ray as xgbr\nimport xgboost as xgb\nfro... | [
[
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"sklearn.datasets.load_breast_cancer"
]
] |
Asurada2015/pymoo | [
"023a787d0b78813e789f170a3e94b2de85605aff"
] | [
"pymoo/interface.py"
] | [
"\"\"\"\nThis class provide an interface for other libraries to specific modules. For example, the evolutionary operations\ncan be used easily just by calling a function and providing the lower and upper bounds of the problem.\n\n\"\"\"\nimport copy\nimport types\n\nimport numpy as np\n\nfrom pymoo.model.algorithm ... | [
[
"numpy.arange"
]
] |
tamirmal/tau_cv_proj | [
"dee83809e17c2e18c098ba1e9920e9fa785870d2"
] | [
"predict_svm_bbox.py"
] | [
"from sklearn.externals import joblib\nfrom optparse import OptionParser\nimport os\nfrom keras.applications.vgg16 import VGG16\nfrom keras.preprocessing import image\nimport numpy as np\nfrom VGG_feature_extract import vgg_features_extract\n\n\ndef predict_classes(arr_images_list, clf, vgg, visualize=False):\n ... | [
[
"numpy.array",
"matplotlib.pyplot.figure",
"sklearn.externals.joblib.load",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow"
]
] |
bbrito/BC-regularized-GAIL | [
"cdbe5ee662f7d3d068f3291a45e1a23ae7736ca5"
] | [
"a2c_ppo_acktr/algo/gail.py"
] | [
"import h5py\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.data\nfrom torch import autograd\nimport gym\nfrom baselines.common.running_mean_std import RunningMeanStd\n\n\nclass RED(nn.Module):\n def __init__(self, input_dim, hidden_dim, device, sigm... | [
[
"torch.zeros",
"torch.sigmoid",
"torch.cat",
"torch.nn.Linear",
"torch.stack",
"numpy.zeros",
"torch.nn.Tanh",
"torch.no_grad",
"torch.FloatTensor",
"numpy.load",
"torch.nn.ReLU",
"torch.autograd.grad",
"torch.randint",
"torch.nn.Conv2d",
"numpy.arange",... |
amg1998/BUSeniorDesign-Opticle-21-22 | [
"f550cd99852459d15ef60e4b2c4bc9bccd2d748b"
] | [
"examples/test/spatial_tiny_yolo.py"
] | [
"from pathlib import Path\nimport sys\nimport cv2\nimport depthai as dai\nimport numpy as np\nimport time\nfrom datetime import datetime\nimport open3d as o3d\n\nfrom subprocess import Popen\nfrom depthai_setup import DepthAi\nfrom projector_3d import PointCloudVisualizer\nfrom collections import deque\nimport spee... | [
[
"numpy.median",
"numpy.arctan",
"numpy.asarray"
]
] |
gisilvs/probability | [
"fd8be3ca1243f956578bf1b1280f9d3ed13541f0"
] | [
"tensorflow_probability/python/internal/auto_composite_tensor_test.py"
] | [
"# Copyright 2020 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.matmul",
"tensorflow.compat.v2.__internal__.saved_model.StructureCoder",
"tensorflow.compat.v2.TensorSpec",
"tensorflow.compat.v2.test.main",
"tensorflow.compat.v2.nest.flatten",
"tensorflow.compat.v2.name_scope",
"tensorflow.compat.v2.saved_model.load",
"tens... |
shingchuang/semseg | [
"86789dbb4fa481ac7be30ef6b052517bab360696"
] | [
"tool/demo.py"
] | [
"import os\nimport logging\nimport argparse\n\nimport cv2\nimport numpy as np\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.nn.functional as F\nimport torch.nn.parallel\nimport torch.utils.data\n\nfrom util import config\nfrom util.util import colorize\n\ncv2.ocl.setUseOpenCL(False)\n\n\ndef get... | [
[
"numpy.uint8",
"numpy.ceil",
"numpy.zeros",
"torch.nn.DataParallel",
"torch.no_grad",
"torch.nn.functional.interpolate",
"numpy.loadtxt",
"numpy.argmax",
"torch.load",
"torch.nn.functional.softmax",
"numpy.expand_dims"
]
] |
Mausy5043/kamstrupd | [
"b63043f68c8e084125f96359e3aab84611c270dc"
] | [
"bin/trend.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"Create trendbargraphs for various periods of electricity use and production.\"\"\"\n\nimport argparse\nfrom datetime import datetime as dt\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nimport constants\n# noinspection PyUnresolvedReferences\nimport libkamstrup as kl\n\nD... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.tight_layout",
"numpy.append",
"matplotlib.pyplot.xticks"
]
] |
RacleRay/Project-Practice | [
"78d8a31dc4f4ffdf620521d375a475b46ea79cf7"
] | [
"yolov3/slim_infer_only/run_test.py"
] | [
"import numpy as np\r\nimport tensorflow as tf\r\nfrom PIL import Image, ImageDraw\r\n\r\nfrom yolov3 import yolo_v3\r\nfrom nms import non_max_suppression, detections_boxes\r\n\r\n\r\n# 加载权重\r\ndef load_weights(var_list, weights_file):\r\n with open(weights_file, \"rb\") as fp:\r\n _ = np.fromfile(fp, dt... | [
[
"numpy.array",
"tensorflow.assign",
"tensorflow.Session",
"tensorflow.reset_default_graph",
"tensorflow.global_variables",
"tensorflow.variable_scope",
"numpy.prod",
"tensorflow.placeholder",
"numpy.transpose",
"numpy.fromfile",
"numpy.random.randint"
]
] |
SinestroEdmonce/tensorflow | [
"00befcdeb87f1fc490d247d127ee438f63fe3666"
] | [
"tensorflow/python/distribute/custom_training_loop_test.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.variables.Variable",
"numpy.random.rand",
"tensorflow.python.ops.math_ops.reduce_sum",
"tensorflow.python.tf2.enabled",
"tensorflow.python.keras.layers.Dense",
"numpy.random.random",
"tensorflow.python.framework.ops.control_dependencies",
"tensorflow.python.k... |
gate42qc/EM-and-DD | [
"2a37e5f9dbe59a7636c6876df88995f853fec941"
] | [
"helpers.py"
] | [
"from pyquil.noise import add_decoherence_noise\nfrom pyquil.gates import *\nfrom pyquil.quil import Program\nimport random\nrandom.seed()\nimport numpy as np\n\npi = np.pi\n\n\ndef get_one_q_circuit(q_index, depth):\n \"\"\"\n :param q_index: index of the qubit which the circuit acts on\n :depth: depth of... | [
[
"numpy.array",
"numpy.sum",
"numpy.mean",
"numpy.arange",
"numpy.linalg.solve"
]
] |
kubic71/RayS | [
"bc9836b4f4e15410368417e4754e5381067f145d"
] | [
"attack_natural.py"
] | [
"import argparse\nimport json\nimport numpy as np\nimport torch\nimport torchvision.models as models\n\nfrom dataset import load_mnist_test_data, load_cifar10_test_data, load_imagenet_test_data\nfrom general_torch_model import GeneralTorchModel\n\nfrom arch import mnist_model\nfrom arch import cifar_model\n\nfrom R... | [
[
"numpy.array",
"numpy.random.seed",
"torch.ones",
"numpy.random.randint",
"torch.load",
"torch.nn.DataParallel",
"torch.sum"
]
] |
jacobkimmel/non-parametric-transformers | [
"5c94a76e2006a4ae949dc337c0db808a234970c2"
] | [
"baselines/utils/baseline_hyper_tuner.py"
] | [
"import functools\nfrom copy import deepcopy\nfrom pprint import pprint\nfrom tempfile import TemporaryDirectory\n\nimport numpy as np\nimport wandb\nfrom numba import njit\nfrom scipy.stats import rankdata\nfrom sklearn.metrics import (\n make_scorer, r2_score, mean_squared_error, accuracy_score, log_loss)\nfro... | [
[
"numpy.asarray",
"numpy.argmin",
"numpy.sum",
"numpy.mean",
"numpy.std",
"numpy.argmax",
"numpy.sort",
"numpy.sqrt",
"sklearn.metrics.make_scorer",
"numpy.hstack",
"scipy.stats.rankdata",
"sklearn.pipeline.Pipeline",
"numpy.unique"
]
] |
zzyztyy/sami2py | [
"d36f7994ad0a7d2d01bd66f916697827ee380a9b"
] | [
"sami2py/utils.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Copyright (C) 2017, JK & JH\n# Full license can be found in License.md\n# -----------------------------------------------------------------------------\n\"\"\" Wrapper for running sami2 model\n\nFunctions\n-----------------------------------------------------------... | [
[
"numpy.reshape",
"numpy.fromfile"
]
] |
liangs6212/BigDL | [
"3c89ff7e8bbdc713110536c18099506811cd2b3a"
] | [
"python/nano/test/pytorch/tests/test_quantize_inference.py"
] | [
"#\n# Copyright 2016 The BigDL Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law ... | [
[
"torch.nn.Linear",
"torch.nn.Sequential",
"numpy.testing.assert_almost_equal",
"torch.no_grad",
"torch.nn.CrossEntropyLoss"
]
] |
fastestimator/fastestimator | [
"a8ea30c5da2d92ff8aa0de0084d10c86fb8dfd10"
] | [
"apphub/instance_segmentation/solov2/solov2_tf.py"
] | [
"# Copyright 2021 The FastEstimator 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 r... | [
[
"tensorflow.exp",
"tensorflow.keras.applications.ResNet50",
"tensorflow.losses.BinaryCrossentropy",
"tensorflow.nn.conv2d",
"tensorflow.matmul",
"tensorflow.ones_like",
"tensorflow.reshape",
"tensorflow.math.count_nonzero",
"numpy.where",
"tensorflow.keras.Model",
"tens... |
Baisal89/ds_8_lamdata | [
"67911b6f15ae6230a65c439a978303ac4b492075"
] | [
"lamdata_baisal89/__init__.py"
] | [
"\"\"\"\nlamdata - a collection of data science helper functions\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\n\n# sample code\nONES = pd.DataFrame(np.ones(10))\nZEROS = pd.DataFrame(np.zeros(50))\n\n#The reson that ONES and ZEROS are capitalized because python convetion\n# global variable are all caps\n"
] | [
[
"numpy.ones",
"numpy.zeros"
]
] |
YipengHu/MPHY0041 | [
"6e9706eba2b9f9a2449539d7dea5f91dde807584"
] | [
"tutorials/synthesis/visualise.py"
] | [
"# This is part of the tutorial materials in the UCL Module MPHY0041: Machine Learning in Medical Imaging\n# run train_*.py before visualise the results\nimport os\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\nPATH_TO_RESULT = 'result'\n\n# to plot example slices of segmentation results\nfor ext in [\... | [
[
"numpy.reshape",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.transpose",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
greatestgoat/kaggle_petfinder | [
"54ac4e43a3442cfec5a45a0eaced2e09738b08c0"
] | [
"kaggle_petfinder/main.py"
] | [
"from collections import Counter\nfrom functools import partial\nfrom math import sqrt\nfrom pathlib import Path\n\nimport lightgbm as lgb\nimport numpy as np\nimport pandas as pd\nimport scipy as sp\nfrom sklearn.decomposition import TruncatedSVD, NMF\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nf... | [
[
"numpy.array",
"sklearn.metrics.mean_squared_error",
"sklearn.model_selection.StratifiedKFold",
"numpy.zeros",
"pandas.merge",
"pandas.concat",
"pandas.DataFrame",
"numpy.random.seed",
"numpy.copy",
"pandas.factorize",
"sklearn.decomposition.NMF",
"sklearn.feature_e... |
maxim-borisyak/craynn | [
"fceabd33f5969033fb3605f894778c42c42f3e08"
] | [
"craynn/viz/img_watcher.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\n__all__ = [\n 'ImgWatcher', 'SImgWatcher'\n]\ntry:\n from IPython import display\nexcept ImportError:\n display = None\n\nclass ImgWatcher(object):\n def __init__(self,\n n_rows=3, img_size=(128, 128), cmap1=plt.cm.gray_r, cmap2=plt.cm.gray_r... | [
[
"numpy.max",
"numpy.random.uniform",
"numpy.min",
"matplotlib.pyplot.figure"
]
] |
lauracanalini/eddl | [
"c5efac642e8e1f99b31dfaaacd0a5a058b09923b"
] | [
"scripts/tests/py_onnx/pytorch/export_scripts/lstm_enc_dec_mnist_pytorch_export.py"
] | [
"from __future__ import print_function\nimport os\nimport argparse\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\n\nclass Net(nn.Module):\n def __init__(self):\n super(Net, self).__init__()\n # Enco... | [
[
"torch.nn.Linear",
"torch.device",
"torch.nn.LSTM",
"torch.onnx._export",
"torch.nn.Sigmoid",
"torch.no_grad",
"torch.manual_seed",
"torch.nn.functional.mse_loss",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.nn.functional.pad",
"torch.randn"
]... |
whatnick/datacube-wps | [
"753a8de5e3d16b9897adc3ace8deec985ca84448"
] | [
"datacube_wps/processes/fcdrill.py"
] | [
"from timeit import default_timer\nimport multiprocessing\n\nimport altair\nimport xarray\nimport numpy as np\n\nfrom dask.distributed import Client\n\nfrom datacube.storage.masking import make_mask\n\nfrom pywps import LiteralOutput, ComplexOutput\n\nfrom . import PolygonDrill, log_call, chart_dimensions, FORMATS\... | [
[
"numpy.isnan"
]
] |
Yacnnn/MVGCCA | [
"84df55790257a489a4370ac4ce4d64724f517462"
] | [
"models/algebraic.py"
] | [
"import numpy as np\n###################### Models GPCA ###################### \n#GPCA #PCA if beta = 0 #LC if beta = 1\ndef gpca(X,W,beta,n_components):\n X = X - np.mean(X,axis=0)\n X = np.transpose(X)\n k = n_components\n XtX = np.transpose(X) @ X\n I = np.eye(XtX.shape[0])\n L = np.diag(np.s... | [
[
"numpy.sum",
"numpy.linalg.eigh",
"numpy.real",
"numpy.mean",
"numpy.eye",
"numpy.linalg.eig",
"numpy.transpose",
"numpy.argsort",
"numpy.linalg.eigvals"
]
] |
b-sherson/hs-logger | [
"537865e44c93a4d234c9a96e9ad784a735869bcc"
] | [
"hs-logger/drivers/HP34420A_HP34970A.py"
] | [
"import pyvisa as visa\nimport numpy as np\nimport json\nimport time\n\n\nclass HP34420A_HP34970A(object):\n def __init__(self, spec):\n rm = visa.ResourceManager()\n self.spec = spec\n self.hp420A = rm.open_resource(spec['port_bridge'])\n self.hp970a = rm.open_resource(spec['port_sca... | [
[
"numpy.isinf",
"numpy.isnan",
"numpy.roots",
"numpy.real",
"numpy.float64",
"numpy.imag"
]
] |
babypandas-dev/babypandas | [
"a1de7f4bf8ead007b03150a4ad28edf6be4aa14a"
] | [
"tests/test_df.py"
] | [
"import pytest\nimport doctest\nimport re\nimport numpy as np\nfrom numpy.testing import assert_array_equal\nimport babypandas.bpd as bpd\nimport pandas as pd\n\n#########\n# Utils #\n#########\n\n@pytest.fixture(scope='function')\ndef dfs():\n inputs = []\n # df1 input: Strings and numbers DataFrame\n inp... | [
[
"numpy.array",
"numpy.count_nonzero",
"pandas.DataFrame",
"numpy.arange",
"numpy.all"
]
] |
heather999/gcr-catalogs | [
"4ca770e7e1b1bb846240b0ba2316ee0ebc4a65ab"
] | [
"GCRCatalogs/photoz_calibrate.py"
] | [
"\"\"\"\nPZCalibrate reference objects catalog reader\n\nThis reader was designed by Yao-Yuan Mao,\nbased a catalog of \"spectroscopic\" reference objects for use in cross-\ncorrelation redshifts provided by Chris Morrison, in Mar 2019.\n\"\"\"\n\nimport re\nimport os\n\nimport numpy as np\nfrom GCR import BaseGene... | [
[
"numpy.load"
]
] |
xiaxiaofu/PytorchToCaffe | [
"479a18308903e502f74dce6d2b4c8dede2ef62ee"
] | [
"pytorch_to_caffe.py"
] | [
"import torch\nimport torch.nn as nn\nfrom Caffe import caffe_net\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom Caffe import layer_param\nfrom torch.nn.modules.utils import _pair\nimport numpy as np\n\n\"\"\"\nHow to support a new layer type:\n layer_name=log.add_layer(layer_type_name)... | [
[
"numpy.array",
"torch.nn.modules.utils._pair"
]
] |
JayHeYang/hehuang_cup | [
"1941e351403f0f402b0bc69e2c3015cb59844834"
] | [
"utils/tools.py"
] | [
"\"\"\"\n一些工函数\n\"\"\"\nimport numpy as np\n\nimport torch as t\nimport torch.nn.functional as F\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n\n\n\ndef compute_batch_attributes_weights(Target):\n\n counts = t.sum(Target, dim=0)\n\n N = Target.size()[0] # batchsize 的大小\n zero_idx = counts == 0\n... | [
[
"numpy.array",
"torch.nn.functional.l1_loss",
"pandas.DataFrame",
"numpy.arange",
"pandas.read_csv",
"torch.sum"
]
] |
shashankcollab/Project3Group8Webpage | [
"890cd3bc06fb2d91823602ea8e652b730dbf53b8"
] | [
"render.py"
] | [
"from time import sleep, strftime, time\nimport matplotlib as mat\n#import matplotlib.animation as ani\nimport matplotlib.pyplot as plt\nfrom matplotlib.figure import Figure\nimport random\nfrom matplotlib import style\n\n \n\n\n#TEMPERATURE =20.0\n\n \n\n \n\n \n\n'''\ndef write_temp(temp):\n with open(\"temp_l... | [
[
"matplotlib.use",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.pause",
"matplotlib.figure.Figure",
"m... |
vishalbelsare/sporco | [
"afc3dae3ab81d84a23e8487812670ecb7457e869"
] | [
"tests/dictlrn/test_onlinecdl.py"
] | [
"from __future__ import division\nfrom builtins import object\n\nimport numpy as np\n\nfrom sporco.dictlrn import onlinecdl\n\n\n\nclass TestSet01(object):\n\n def setup_method(self, method):\n N = 16\n Nd = 5\n M = 4\n K = 3\n np.random.seed(12345)\n self.D0 = np.random... | [
[
"numpy.random.seed",
"numpy.random.randint",
"numpy.random.randn"
]
] |
showmonki/learn_notes | [
"8a416e0294170e242c40d16370e8f42ec9ae8582"
] | [
"CV/classification/COFFFEE_GROUP/Code/cnn_model.py"
] | [
"from tensorflow import keras\nfrom tensorflow.keras import backend as K\n\nclass t_model():\n\n def __init__(self,num_class,input_shape):\n self.input_shape = input_shape # xception at least 71x71\n self.num_cls = num_class\n # self.base_model = self.load_model()\n self.base_model1 =... | [
[
"tensorflow.keras.layers.GlobalMaxPool2D",
"tensorflow.keras.applications.InceptionResNetV2",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.applications.Xception",
"tensorflow.keras.Model",
"tensorflow.keras.Input",
"tensorflow.keras.backend.... |
jtang10/PyTorch-ENet | [
"d407eb6444e12ca5dd0fbe60145ed17440d31db2"
] | [
"profiling.py"
] | [
"import argparse\nimport math\nimport os\nimport time\nfrom collections import OrderedDict\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torchvision.transforms as transforms\nimport matplotlib.pyplot as plt\nfrom matplotlib.ticker import ScalarFormatter, MultipleLocator\nfrom PIL import Image\n... | [
[
"torch.device",
"matplotlib.ticker.MultipleLocator",
"torch.stack",
"numpy.zeros",
"torch.max",
"matplotlib.pyplot.savefig",
"torch.no_grad",
"numpy.mean",
"matplotlib.pyplot.figure",
"torch.unsqueeze",
"numpy.std",
"matplotlib.pyplot.show",
"torch.load",
"m... |
HughPaynter/PyGRB | [
"2eaf834cf3c62a639a056285ca9518456daa4b7c"
] | [
"PyGRB/postprocess/make_evidence_tables.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom abc import ABCMeta\n\nimport bilby\nfrom prettytable import PrettyTable\n\n\nfrom PyGRB.backend.makemodels import create_model_from_key\n\nclass EvidenceTables(object):\n \"\"\"\n Defines the :class:`~EvidenceTables` class of the *PyGRB* package.\n This is an ... | [
[
"pandas.DataFrame"
]
] |
gwdgithubnom/gjgr | [
"581957a296b13a4231ea1e67ec62083b7da445bf"
] | [
"content/test/faceswap/tools/sort.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nA tool that allows for sorting and grouping images in different ways.\n\"\"\"\nimport logging\nimport os\nimport sys\nimport operator\nfrom shutil import copyfile\n\nimport numpy as np\nimport cv2\nfrom tqdm import tqdm\n\n# faceswap imports\nfrom lib.cli import FullHelpArgumentPars... | [
[
"numpy.array",
"numpy.sqrt",
"numpy.zeros",
"numpy.var"
]
] |
Simardeep27/pan-tensor | [
"1719d82fdedb5c7882699de193e01aa78c0d9f91"
] | [
"models/ffm.py"
] | [
"'''\nThis code is for FFM model in PAN.\n'''\nimport tensorflow as tf\n\n__all__ = ['FFM']\n\nclass FFM(tf.keras.Model):\n def __init__(self):\n super(FFM, self).__init__()\n\n def _upsample(self, x, size, scale=1):\n _, Hout, Wout, _ = size\n _, Hx, Wx, _ = x.shape\n return tf.ke... | [
[
"tensorflow.concat",
"tensorflow.random.uniform",
"tensorflow.keras.layers.UpSampling2D"
]
] |
bernhardschaefer/yamlu | [
"14d621f9e17cdc7a652e0e5450eb4ce7b6b30f7c"
] | [
"tests/test_pytorch.py"
] | [
"import torch\n\nfrom yamlu.pytorch import isin, indices_to_mask\n\n\n# noinspection PyArgumentList\ndef test_indices_to_mask():\n indices = torch.LongTensor([0, 2, 3])\n mask_length = 5\n mask = indices_to_mask(indices, mask_length)\n assert torch.equal(mask, torch.BoolTensor([True, False, True, True, ... | [
[
"torch.LongTensor",
"torch.BoolTensor"
]
] |
Xtuden-com/tensor2robot | [
"a3674958a046de711e37445d39afd4e529d8dd09"
] | [
"preprocessors/abstract_preprocessor_test.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Tensor2Robot 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 require... | [
[
"tensorflow.compat.v1.test.main"
]
] |
ZigmundRat/MPMD-AutoBedLevel-Cal | [
"7e3e416df2b3b9d5b8911f8eed11d4ae7f355b92"
] | [
"auto_cal_p5.py"
] | [
"#!/usr/bin/python\r\n\r\n# Updated version of the original script\r\n\r\n# Original Project Found here:\r\n# https://github.com/TechnoSwiss/MPMD-AutoBedLevel-Cal\r\n# This version was made to be compatible with Dennis Brown's G29 P5 Spreadsheet:\r\n# https://www.facebook.com/groups/mpminideltaowners/permalink/2186... | [
[
"scipy.interpolate.griddata",
"numpy.array"
]
] |
bagustris/dimensional-ser | [
"ce9bfae1d962b3581dd7022e4f145429615e2771"
] | [
"code/speech-text/cnn_lstm.py"
] | [
"# lstm_lstm: emotion recognition from speech= lstm, text=lstm\n# created for ATSIT paper 2020\n# coded by Bagus Tris Atmaja (bagus@ep.its.ac.id)\n\nimport numpy as np\nimport pickle\nimport pandas as pd\n\nimport keras.backend as K\nfrom keras.models import Model, Sequential\nfrom keras.layers import Input, Dense,... | [
[
"tensorflow.set_random_seed",
"numpy.array",
"sklearn.preprocessing.StandardScaler",
"numpy.random.seed",
"numpy.load",
"numpy.where",
"sklearn.preprocessing.MinMaxScaler"
]
] |
BoyuanChen/neural-state-variables | [
"10483d93ac8c006f3786c434fb57d70d9ab465ec"
] | [
"analysis/intrinsic_dimension_estimation/__init__.py"
] | [
"import numpy as np\nfrom .methods import *\n\nclass ID_Estimator:\n def __init__(self, method='Levina_Bickel'):\n self.all_methods = ['Levina_Bickel', 'MiND_ML', 'MiND_KL', 'Hein', 'CD']\n self.set_method(method)\n \n def set_method(self, method='Levina_Bickel'):\n if method not in se... | [
[
"numpy.max",
"numpy.array",
"numpy.isscalar"
]
] |
interaction-lab/RE-BT-Espresso | [
"03ee50af3728a07ced5da00b38124e41994facbc"
] | [
"BehaviorTreeDev/2_UpsampleData.py"
] | [
"import pandas as pd\nimport argparse\nfrom imblearn.over_sampling import SVMSMOTE\nimport numpy as np\nimport os\nimport shutil\nimport argparse\nimport json\nfrom json_manager import JsonManager\nimport pipeline_constants as constants\n\n\ndef process_command_line_args():\n ap = argparse.ArgumentParser()\n ... | [
[
"pandas.read_csv",
"numpy.savetxt",
"numpy.append"
]
] |
HKUST-KnowComp/GeoAlign | [
"3f29cfb911476f1555b66d4d39561df29342895a"
] | [
"poincare-embeddings/hype/lorentz.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) 2018-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.\nimport logging\n\nimport torch as th\nfrom torch.autograd import Function\nfrom .common import a... | [
[
"torch.sqrt",
"torch.cosh",
"torch.clamp",
"torch.sum",
"torch.sinh",
"torch.addcmul",
"torch.pow"
]
] |
ipl31/fastparquet | [
"fe8dc1b05044f0608fd4fd87c60606b49a0c0e5f"
] | [
"fastparquet/test/test_api.py"
] | [
"# -*- coding: utf-8 -*-\nimport io\nimport os\nimport subprocess\nimport sys\nfrom distutils.version import LooseVersion\n\nimport numpy as np\nimport pandas as pd\ntry:\n from pandas.tslib import Timestamp\nexcept ImportError:\n from pandas import Timestamp\nimport pytest\n\nfrom fastparquet.test.util impor... | [
[
"pandas.to_datetime",
"pandas.testing.assert_frame_equal",
"numpy.array",
"numpy.random.rand",
"numpy.random.choice",
"pandas.DataFrame",
"pandas.util.testing.makeMixedDataFrame",
"pandas.Timestamp",
"numpy.arange",
"numpy.random.randint"
]
] |
missingdaysqxy/ordinal_clouds | [
"566d8ac22c54e8e7f2a0ad79a7da309205684543"
] | [
"makedataset.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2018/10/9 22:31\n# @Author : qxliu\n# @Email : qixuan.lqx@qq.com\n# @File : makedataset.py\n# @Software: PyCharm\n\nimport tensorflow as tf\nfrom datetime import datetime\nimport pandas as pd\nimport numpy as np\nfrom PIL import Image\nimport logging\nimport os\nimport s... | [
[
"tensorflow.train.start_queue_runners",
"tensorflow.train.Int64List",
"tensorflow.image.random_flip_left_right",
"tensorflow.image.random_flip_up_down",
"tensorflow.reshape",
"tensorflow.stack",
"tensorflow.local_variables_initializer",
"pandas.read_csv",
"tensorflow.global_var... |
RE-OWOD/RE-OWOD | [
"5f502491a29cb47fed56e2bbbf2b4122906b3e78"
] | [
"datasets/coco_utils/create_t3_imageset.py"
] | [
"from pycocotools.coco import COCO\nimport numpy as np\n\nT3_CLASS_NAMES = [\n \"frisbee\", \"skis\", \"snowboard\", \"sports ball\", \"kite\",\n \"baseball bat\", \"baseball glove\", \"skateboard\", \"surfboard\", \"tennis racket\",\n \"banana\", \"apple\", \"sandwich\", \"orange\", \"broccoli\",\n \"c... | [
[
"numpy.unique"
]
] |
wckdouglas/cfNA | [
"1e3d25bdb067b43d24c394bf586a33f372e3d4e2"
] | [
"peak_callings/EV_peaks.py"
] | [
"#!/usr/bin/env python\n\nimport pandas as pd\nimport pysam\nimport sys\n\nif len(sys.argv) != 3:\n sys.exit('python %s <peak_coor> <bed.gz file> ' %sys.argv[0])\n\nclass peak_count:\n '''\n parse peak coordinates (peak file),\n count tabix reads for each peak\n '''\n def __init__(self, peaks, tab... | [
[
"pandas.read_csv"
]
] |
MCZhi/nuplan-devkit | [
"3c4f5b8dcd517b27cfd258915ca5fe5c54e3cb0c"
] | [
"nuplan/planning/metrics/evaluation_metrics/common/ego_lon_jerk.py"
] | [
"from typing import List\n\nimport numpy as np\nfrom nuplan.planning.metrics.abstract_metric import AbstractMetricBuilder\nfrom nuplan.planning.metrics.metric_result import MetricStatistics, MetricStatisticsType, Statistic, TimeSeries\nfrom nuplan.planning.metrics.utils.state_extractors import extract_ego_jerk, ext... | [
[
"numpy.array",
"numpy.amax",
"numpy.abs",
"numpy.amin"
]
] |
MuZiGuYue/VideoSuperResolution | [
"dc8bf94aa65c1a4e92e6024ca77b402f5b252fcf"
] | [
"VSRTorch/Models/Vespcn.py"
] | [
"# Copyright (c): Wenyi Tang 2017-2019.\n# Author: Wenyi Tang\n# Email: wenyi.tang@intel.com\n# Update Date: 2019/4/3 下午5:10\n\nimport torch\nimport torch.nn.functional as F\n\nfrom .Model import SuperResolution\nfrom .vespcn import ops\nfrom ..Framework.Summary import get_writer\nfrom ..Util import Metrics\n\n... | [
[
"torch.nn.functional.mse_loss",
"torch.split",
"torch.squeeze"
]
] |
JoOkuma/torch-em | [
"68b723683f9013723a0e4fc8cfef1d6a2a9c9dff"
] | [
"torch_em/transform/raw.py"
] | [
"import numpy as np\n\n\n#\n# normalization functions\n#\n\n\ndef standardize(raw, mean=None, std=None, axis=None, eps=1e-7):\n raw = raw.astype('float32')\n\n mean = raw.mean(axis=axis, keepdims=True) if mean is None else mean\n raw -= mean\n\n std = raw.std(axis=axis, keepdims=True) if std is None els... | [
[
"numpy.percentile",
"numpy.random.rand"
]
] |
OOXXXXOO/WSNet | [
"b64aa7d80fe0a7aa8a440f2bb6df1f1e497a7620"
] | [
"Src/.ipynb_checkpoints/config-checkpoint.py"
] | [
"# **************************************************************************** #\n# #\n# ::: :::::::: #\n# config.py :+: :+: ... | [
[
"torch.device",
"torch.cuda.is_available",
"numpy.load"
]
] |
attardi/iwpt-shared-task-2020 | [
"3a70c42d53716678776afcccf02d896655777353"
] | [
"edparser/layers/embeddings/contextual_string_embedding.py"
] | [
"# -*- coding:utf-8 -*-\n# Author: hankcs\n# Date: 2019-12-19 03:24\nfrom typing import List\n\nimport tensorflow as tf\nimport numpy as np\nfrom edparser.components.rnn_language_model import RNNLanguageModel\nfrom edparser.common.constant import PAD\nfrom edparser.utils.io_util import get_resource\nfrom edparser.u... | [
[
"numpy.zeros_like",
"tensorflow.concat",
"tensorflow.not_equal",
"tensorflow.keras.Sequential",
"tensorflow.reverse",
"numpy.stack",
"tensorflow.stack"
]
] |
BonneelP/pyleecan | [
"29e6b4358420754993af1a43048aa12d1538774e"
] | [
"Tests/Validation/Simulation/test_EM_SPMSM_FL_002.py"
] | [
"# -*- coding: utf-8 -*-\n\n# External import\nimport pytest\nfrom numpy import array, ones, pi\nfrom os.path import join\n\n# Pyleecan import\nfrom pyleecan.Classes.ImportGenVectLin import ImportGenVectLin\nfrom pyleecan.Classes.ImportMatrixVal import ImportMatrixVal\nfrom pyleecan.Classes.Simu1 import Simu1\nfrom... | [
[
"numpy.array"
]
] |
zachbellay/pytorch-lightning | [
"479a35d94e0b83593414833c050de4065d3b6c8a"
] | [
"pytorch_lightning/loggers/neptune.py"
] | [
"\"\"\"\nLog using `neptune-logger <https://www.neptune.ml>`_\n\n.. _neptune:\n\nNeptuneLogger\n--------------\n\"\"\"\nimport argparse\nfrom logging import getLogger\nfrom typing import Optional, List, Dict, Any, Union, Iterable\n\ntry:\n import neptune\n from neptune.experiments import Experiment\nexcept Im... | [
[
"torch.is_tensor"
]
] |
deep-privacy/espnet | [
"48a25ef7b11e09a2221327d0319ca51a11d1ecc4"
] | [
"espnet2/utils/fileio.py"
] | [
"from __future__ import annotations\n\nimport collections.abc\nfrom io import StringIO\nimport logging\nfrom pathlib import Path\nfrom typing import Dict\nfrom typing import Union\nimport warnings\n\nimport numpy as np\nimport soundfile\nfrom typeguard import check_argument_types\nfrom typeguard import check_return... | [
[
"numpy.load"
]
] |
Lenaxiao/ToxNet-Project | [
"576a92ed825f9b511928bacbc578f9846d219695"
] | [
"modules/ToxNet_02_Internal_Test_Set.py"
] | [
"\n# coding: utf-8\n\n# In[15]:\n\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport os\n\nfrom rdkit import Chem\nget_ipython().run_line_magic('matplotlib', 'inline')\n\n\n# In[16]:\n\n\nhomedir = os.path.dirname(os.path.realpath('__file__'))\nhomedir = homed... | [
[
"numpy.random.seed",
"pandas.read_csv",
"matplotlib.pyplot.subplots"
]
] |
rystylee/pytorch-cppn-gan | [
"e02ffe26cc57807bc739e4d5806e25f11991e7ec"
] | [
"src/dcgan_cppn/trainer.py"
] | [
"import os\r\nfrom tqdm import tqdm\r\n\r\nimport torch\r\nimport torchvision\r\nfrom torch.utils.tensorboard import SummaryWriter\r\n\r\nfrom src.dcgan_cppn.models import Generator, Discriminator\r\nfrom losses import GANLoss\r\nfrom utils import get_coordinates, endless_dataloader\r\n\r\nfrom data_loader import D... | [
[
"torch.utils.tensorboard.SummaryWriter",
"torch.no_grad",
"torch.ones",
"torch.load",
"torch.randn"
]
] |
arnoldjulian/Interpretable-and-unsupervised-phase-classification | [
"5b10426f759c47779654ccd001aab06563ed30ee"
] | [
"prediction_based_method/DNNs/conf.py"
] | [
"import numpy as np\r\n\r\n# set a random seed\r\nseed = 222\r\n\r\n# dimension of parameter space under consideration, choose between 1 and 2\r\ndim_parameter_space = 1\r\n\r\n# set range of U under investigation. can be modified: 1 < U_min, U_max < 8 and U_min, U_max % 0.2 = 0\r\nU_min = 1.0\r\nU_max = 8.0\r\nU_s... | [
[
"numpy.arange"
]
] |
timgates42/netcdf4-python | [
"d8b1cb11454f9beec674a29904c91f48db608c2c"
] | [
"examples/bench_compress2.py"
] | [
"# benchmark reads and writes, with and without compression.\n# tests all four supported file formats.\nfrom numpy.random.mtrand import uniform\nimport netCDF4\nfrom timeit import Timer\nimport os, sys\n\n# create an n1dim by n2dim by n3dim random array.\nn1dim = 30\nn2dim = 15\nn3dim = 73\nn4dim = 144\nntrials = 1... | [
[
"numpy.random.mtrand.uniform"
]
] |
Pullabhatla/M3R | [
"50ccdd6d97d47cd20e575443b368c30c066ad85a"
] | [
"scripts/momentum1.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom Req import LeakyReLUSoftmaxCCE, load_data\n\n(x_train, y_train), (x_test, y_test) = load_data()\n\nscores = np.empty((20, 101))\nfor i in range(20):\n np.random.seed(1112001)\n mlp = LeakyReLUSoftmaxCCE((28, 28), 10, [16, 16, 16])\n scores[i] = mlp... | [
[
"matplotlib.pyplot.colorbar",
"numpy.empty",
"matplotlib.pyplot.contourf",
"numpy.random.seed",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"numpy.argmax",
"matplotlib.pyplot.ylabel"
]
] |
akbir/magi | [
"cff26ddb87165bb6e19796dc77521e3191afcffc"
] | [
"magi/agents/td3/networks.py"
] | [
"\"\"\"Default network architectures for TD3.\"\"\"\nfrom typing import Dict, Sequence\n\nfrom acme import specs\nfrom acme.jax import networks as networks_lib\nfrom acme.jax import utils\nimport haiku as hk\nimport jax\nimport jax.numpy as jnp\nimport numpy as np\n\n\ndef apply_policy_sample(networks, eval_mode: b... | [
[
"numpy.prod"
]
] |
csruiliu/tensorflow-cifar10 | [
"6180d425f319542f0af568acd71cc6503d080764"
] | [
"models/zfnet.py"
] | [
"import tensorflow as tf\n\n\nclass ZFNet:\n def __init__(self, num_classes=10):\n self.output_classes = num_classes\n\n @staticmethod\n def fc_layer(layer_input, output_unit):\n layer = tf.keras.layers.Flatten()(layer_input)\n layer = tf.keras.layers.Dense(units=output_unit)(layer)\n\... | [
[
"tensorflow.keras.activations.relu",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Dropout",
"tensorflow.variable_scope"
]
] |
ameilij/MDS | [
"3cb426b5de0e1f6bb8ad2229ee8ab9ecb750bc05"
] | [
"AMV/AMV-UNI5-CP1-MNIST.py"
] | [
"# LA CIENCIA DE DATOS\n# TECNICAS DE VISUALIZACION, MINERIA Y ANALISIS\n# UNIDAD 5 MODELOS\n# Caso Practico 1\n\n# Import relevant libraries\nimport pyarrow.parquet as pq\nimport numpy as np\nimport pandas as pd\nimport pyarrow as pa\nfrom numpy.core._multiarray_umath import ndarray\n\n# FUNCTION DEFINITION AREA\n... | [
[
"numpy.reshape",
"pandas.DataFrame",
"numpy.mean",
"numpy.std",
"pandas.to_numeric"
]
] |
dandyhug/kookey | [
"58ffb67e6d984e3067689277631be072beb8deb9"
] | [
"kookey/synonym_util/model.py"
] | [
"#-*-coding:utf-8-*-\r\n\r\nfrom gensim.models import fasttext\r\nfrom abc import abstractmethod\r\nimport numpy as np\r\nimport tensorflow as tf\r\nfrom tensorflow import keras\r\nfrom kookey.synonym_util import transform_data\r\nfrom kookey.tokenizer import Tokenizer\r\n\r\n\r\nclass Model:\r\n\r\n def __init_... | [
[
"numpy.array",
"numpy.dot",
"numpy.linalg.norm",
"tensorflow.keras.layers.GlobalAveragePooling1D",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.LSTM",
"numpy.random.seed",
"tensorflow.random.set_seed",
"numpy.zeros",
"tensorflow.keras.layers.Embedding",
"te... |
MattePalte/thinking-like-a-developer | [
"548f061992cd1f45dd9878d76559836940608769"
] | [
"utils/visualizer.py"
] | [
"\"\"\"\nIt compares human and machine attention weights.\n\"\"\"\n\nimport json\nimport logging\nimport os\nimport re\nfrom tqdm import tqdm\nimport abc\nfrom abc import ABCMeta\nimport pandas as pd\nimport numpy as np\nimport random\nfrom copy import deepcopy\n\nimport matplotlib.pyplot as plt\nimport seaborn as ... | [
[
"numpy.array",
"numpy.asarray",
"matplotlib.colors.to_rgb",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"numpy.where",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca"
]
] |
kbines/rl-baselines-zoo | [
"1cf77866344e15d5f66cd55318199f9ea7f72fd7"
] | [
"utils/record_video.py"
] | [
"import os\nimport argparse\n\nimport gym\nimport numpy as np\nfrom stable_baselines.common.vec_env import VecVideoRecorder, VecFrameStack, VecNormalize\n\nfrom .utils import ALGOS, create_test_env, get_saved_hyperparams, get_latest_run_id, find_saved_model\n\nif __name__ == '__main__':\n\n parser = argparse.Arg... | [
[
"numpy.clip"
]
] |
HindyDS/ParticleSwarmOptimization | [
"4a19514c01f7082645781408c24d4450530cf6dd"
] | [
"ParticleSwarmOptimization/ParticleSwarmOptimization/Particle.py"
] | [
"#!/usr/bin/env python\r\n# coding: utf-8\r\n\r\n# In[ ]:\r\n\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom sklearn.model_selection import GridSearchCV\r\nimport matplotlib.pyplot as plt\r\nimport seaborn as sns\r\n\r\nclass Particle:\r\n def __init__(self, estimator, X, y, cv, scoring, search_space):\r\n... | [
[
"sklearn.model_selection.GridSearchCV",
"numpy.random.choice"
]
] |
ashesh-0/MultiZoomGaze | [
"24494a1346d09e21e4b6d999a742b5d31bbbeff0"
] | [
"code/core/metadata_parser.py"
] | [
"from typing import Dict\n\nimport numpy as np\nfrom scipy.io import loadmat\n\n\ndef rescale_eye(eye: np.array, head_bbox: np.array) -> np.array:\n \"\"\"\n In metadata.mat, the person_eye_left_box or person_eye_left_box contains eye x,y,w,h data for both eyes.\n These coordinates are in normalized form w... | [
[
"numpy.concatenate",
"scipy.io.loadmat",
"numpy.any",
"numpy.unique",
"numpy.vstack"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.