repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
yulongtzzz/Stealthy-Backdoors-as-Compression-Artifacts | [
"f8f4da6613a655c65050818ef97866accc085928"
] | [
"train_baseline_models/auto_compress_for_clean_models.py"
] | [
"## This file is adapted from NNI project: https://github.com/microsoft/nni\n''' For extracting pruning rates for model training'''\n\nimport argparse\nimport os\nimport json\nimport torch\nfrom torchvision import datasets, transforms\nimport random\nimport pickle\n\nfrom nni.compression.torch import SimulatedAnnea... | [
[
"torch.nn.CrossEntropyLoss",
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.load",
"torch.manual_seed",
"torch.randn",
"torch.utils.data.DataLoader",
"torch.full_like",
"torch.no_grad",
"torch.cuda.is_available",
"torch.utils.data.Subset"
]
] |
sunjiahao1999/gorilla-core | [
"bf43e3a49c7f79834ae969db38edd50f17ef5288"
] | [
"gorilla/solver/hook/optimizer.py"
] | [
"# Copyright (c) Open-MMLab. All rights reserved.\nimport copy\n\nfrom torch.nn.utils import clip_grad\n\nfrom .hook import Hook\nfrom ...core import HOOKS\n\n\n@HOOKS.register()\nclass OptimizerHook(Hook):\n # TODO: add comment\n def __init__(self, grad_clip=None):\n self.grad_clip = grad_clip\n ... | [
[
"torch.nn.utils.clip_grad.clip_grad_norm_"
]
] |
afrendeiro/seaborn | [
"b9abf7569a7a5955ae4aa163296edce2ec682ddf"
] | [
"seaborn/relational.py"
] | [
"import warnings\n\nimport numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\n\nfrom ._core import (\n VectorPlotter,\n)\nfrom .utils import (\n locator_to_legend_entries,\n adjust_legend_subtitles,\n _deprecate_ci,\n)\nfrom ._statistics import EstimateAggregator\nfrom .axisgrid imp... | [
[
"numpy.square",
"matplotlib.pyplot.gca",
"numpy.power",
"numpy.asarray",
"numpy.percentile",
"numpy.full",
"matplotlib.ticker.LogLocator",
"matplotlib.ticker.MaxNLocator"
]
] |
SR42-dev/AI-ML-Course | [
"125fa09a40bf171a9d93805bc6b73d65bc5d3da7"
] | [
"chapter2 - dataClassification/SupportVectorMachine (SVM)/source.py"
] | [
"# Support Vector Machine (SVM)\r\n\r\n# Importing the libraries\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\n# Importing the dataset\r\ndataset = pd.read_csv('social_network_ads.csv')\r\nX = dataset.iloc[:, [2, 3]].values # age, salary\r\ny = dataset.iloc[:, 4].values # whether or not purchased\r\n\r\n# Spl... | [
[
"pandas.read_csv",
"sklearn.metrics.confusion_matrix",
"sklearn.model_selection.train_test_split",
"sklearn.svm.SVC",
"sklearn.preprocessing.StandardScaler"
]
] |
ajmalkurnia/id-postagger | [
"d488f03e96c4135ad1378f1def52ad533a163803"
] | [
"model/tf_model_crf.py"
] | [
"\"\"\"\nWrapping model that has CRF layer to compute crf_loss\nsource @jaspersjsun https://github.com/tensorflow/addons/pull/1999/files\n\"\"\"\nimport tensorflow as tf\nfrom tensorflow_addons.text.crf import crf_log_likelihood\n\n\ndef unpack_data(data):\n if len(data) == 2:\n return data[0], data[1], N... | [
[
"tensorflow.reduce_sum",
"tensorflow.GradientTape",
"tensorflow.reduce_mean"
]
] |
landegt/pylabel | [
"9d0079a1f61eb84ec9cd10fb202a9246a08576fa"
] | [
"pylabel/exporter.py"
] | [
"import json\nfrom typing import List\nimport pandas as pd\nimport numpy as np\nimport xml.etree.ElementTree as ET\nimport xml.dom.minidom\nimport os \nimport yaml\nimport shutil\n\nfrom pathlib import PurePath, Path\n\nclass Export():\n def __init__(self, dataset=None):\n self.dataset = dataset\n\n d... | [
[
"numpy.isnan",
"pandas.concat",
"pandas.DataFrame"
]
] |
lovish1234/TPC | [
"10e93eeb0e22e411579cfb9f94fac7870f6e2039"
] | [
"backbone/resnet_2d3d.py"
] | [
"# modified from https://github.com/kenshohara/3D-ResNets-PyTorch\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport math\n\n# last two blocks are 3-D for this resnet\n__all__ = [\n 'ResNet2d3d_full', 'resnet18_2d3d_full', 'resnet34_2d3d_full', 'res... | [
[
"torch.nn.Sequential",
"torch.nn.init.uniform_",
"torch.cat",
"torch.nn.MaxPool3d",
"torch.nn.Conv3d",
"torch.FloatTensor",
"torch.nn.functional.avg_pool3d",
"torch.nn.init.normal_",
"torch.nn.ReLU",
"torch.nn.BatchNorm3d",
"torch.nn.init.kaiming_normal_"
]
] |
floodcaptain/pandas | [
"014d2dbc2155e926aac04c79fc6c593239c1f669"
] | [
"pandas/core/indexes/interval.py"
] | [
"\"\"\" define the IntervalIndex \"\"\"\nfrom operator import le, lt\nimport textwrap\nfrom typing import Any, Optional, Tuple, Union\n\nimport numpy as np\n\nfrom pandas._config import get_option\n\nfrom pandas._libs import Timedelta, Timestamp, lib\nfrom pandas._libs.interval import Interval, IntervalMixin, Inter... | [
[
"pandas.tseries.frequencies.to_offset",
"numpy.linspace",
"pandas.core.dtypes.common.is_dtype_equal",
"pandas.core.indexes.base.Index.__le__",
"pandas.core.accessor.delegate_names",
"pandas.core.dtypes.common.is_datetime64tz_dtype",
"pandas._libs.interval.IntervalTree",
"pandas.cor... |
jcoheur/pybitup-examples | [
"83bdb2a85f8bdeed7199feaf70fa17fc68263256"
] | [
"pyrolysis/check.py"
] | [
"import sys\nsys.path.append('../../')\nimport numpy as np\nfrom matplotlib import pyplot as plt\nimport pickle\nimport pandas as pd \n\n# %% Initialisation\n\nmodel_name = \"6.1_K_per_Min\" \n\nf = open(\"output/propagation/pce_model_\"+model_name+\".pickle\",\"rb\")\nmodel = pickle.load(f)\nf.close()\n\nf = open(... | [
[
"matplotlib.pyplot.legend",
"pandas.read_csv",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"numpy.mean",
"matplotlib.pyplot.grid",
"numpy.var",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.rcParams.update",
"numpy.array",
"numpy... |
thanusiv/Open-Source-License-Validator | [
"2e69ddae15976ea25ec1e2cc1dbced31ff5aec7c"
] | [
"get_best_model/unsupervised/autoencoder/run_model.py"
] | [
"#!/usr/bin/python3\nimport os\nimport pickle\nfrom scipy import sparse\nimport pandas as pd\nimport numpy as np\nfrom sklearn.neural_network import MLPRegressor\nfrom sklearn.metrics.pairwise import cosine_similarity\n\n\ndef main():\n \"\"\"\n An attempt to use an autoencoder to predict licenses.\n \"\"\... | [
[
"pandas.Series",
"sklearn.metrics.pairwise.cosine_similarity",
"scipy.sparse.vstack",
"numpy.array",
"sklearn.neural_network.MLPRegressor"
]
] |
minjiedeng/NumEcon | [
"ff021e765344db93eed7ff0002dbdf3e50e528e9"
] | [
"numecon/course_micro1/firm.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nclass FirmClass1D():\n\n def __init__(self,**kwargs):\n\n # a. baseline setup\n\n # technology\n self.technology = 'baseline'\n self.A = 1\n self.gamma = 0.5\n \n # prices\n self.w = 1\n self.p ... | [
[
"numpy.array",
"numpy.linspace"
]
] |
bouzaghrane/pylogit | [
"f83b0fd6debaa7358d87c3828428f6d4ead71357"
] | [
"tests/test_choice_calcs.py"
] | [
"\"\"\"\nTests for the choice_calcs.py file.\n\"\"\"\nimport unittest\nimport warnings\nfrom collections import OrderedDict\n\nimport numpy as np\nimport numpy.testing as npt\nimport pandas as pd\nfrom scipy.sparse import csr_matrix\nfrom scipy.sparse import diags\nfrom scipy.sparse import block_diag\n\nimport pylo... | [
[
"numpy.diag",
"numpy.dot",
"numpy.log",
"numpy.arange",
"scipy.sparse.block_diag",
"numpy.ones",
"numpy.concatenate",
"numpy.seterr",
"numpy.testing.assert_allclose",
"numpy.exp",
"numpy.outer",
"numpy.array",
"numpy.zeros",
"numpy.where"
]
] |
shenlong95/fseval | [
"4d2e6618b8838f9e52fe60621b08595dc4c5b4fb"
] | [
"fseval/pipelines/rank_and_validate/_dataset_validator.py"
] | [
"from dataclasses import dataclass\nfrom typing import Dict, List, Union, cast\n\nimport numpy as np\nimport pandas as pd\nfrom omegaconf import MISSING\nfrom sklearn.base import clone\n\nfrom fseval.pipeline.estimator import Estimator\n\nfrom .._experiment import Experiment\nfrom ._config import RankAndValidatePip... | [
[
"sklearn.base.clone"
]
] |
pranjaldatta/metrics | [
"078671fa0b28d7d0a9c505b077d9acc8ac28a69d"
] | [
"torchmetrics/classification/accuracy.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.tensor"
]
] |
AgilePlaya/Image-Processing-Basics | [
"34c3ecf42a4589b95787fb66c19ffd21bbaf3ee3"
] | [
"Codes/Sobel-Edge/sobel.py"
] | [
"from scipy import *\nfrom scipy import signal\nfrom PIL import Image\nimport cv2\nimport numpy\nimport math\nimport imageio\n\n# Locating the image. If the image is not same then change to relative address.\nusedImage = '../../Images/2.jpg'\n\n# Opening the image into an array\nimg = numpy.array(Image.open(usedIma... | [
[
"scipy.signal.convolve",
"numpy.lib.scimath.sqrt"
]
] |
avcopan/KinBot | [
"847e430fb1ee15b5c16ce095bdf7a07087ec9b0a"
] | [
"kinbot/irc.py"
] | [
"###################################################\n## ##\n## This file is part of the KinBot code v2.0 ##\n## ##\n## The contents are covered by the terms of the ##\n## BSD 3-clause license included in the LICENSE #... | [
[
"numpy.linalg.norm"
]
] |
antoneri/mapping-hypergraphs | [
"f81425c6bbd45b0537f8a0da2ddc24ec79730593"
] | [
"analysis/stats.py"
] | [
"import os\nfrom collections import defaultdict\nfrom itertools import takewhile, dropwhile\nfrom statistics import mean, variance\nfrom typing import Sequence\n\nimport pandas as pd\n\nfrom hypergraph.network import Tree\n\n\ndef summarize(networks: Sequence[Tree]) -> pd.DataFrame:\n summary = defaultdict(list)... | [
[
"pandas.DataFrame"
]
] |
kykosic/machine-learning | [
"57f7bd016761baf80af812b91d456aef63b8de08"
] | [
"explore/pca-visualization/PCA_Visualization.py"
] | [
"\n# coding: utf-8\n\n# # Using Principal Component Analysis (PCA) to reduce the dimensionality of the TCGA gene expression data\n# \n\n# What does the gene expression data _look_ like when its dimensionality is reduced by PCA? Considering that disease alone appears to be on par with the expression data at predicti... | [
[
"matplotlib.pyplot.legend",
"pandas.concat",
"matplotlib.pyplot.title",
"numpy.unique",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.axes",
"pandas.read_table",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.xlabel",
"sklearn.... |
relh/keras-retinanet | [
"6ccf6bf3d03a1b5ea1d59fa8dac8dfcb3545a11b"
] | [
"keras_retinanet/utils/image.py"
] | [
"\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable la... | [
[
"numpy.moveaxis"
]
] |
d-li14/HBONet | [
"e9a76c15e3847b0f032a7000fe0c8138d6f2eb10"
] | [
"models/imagenet/hbonet.py"
] | [
"\nimport torch\nimport torch.nn as nn\nimport math\n\n__all__ = ['hbonet']\n\n\ndef _make_divisible(v, divisor, min_value=None):\n \"\"\"\n This function is taken from the original tf repo.\n It ensures that all layers have a channel number that is divisible by 8\n It can be seen here:\n https://git... | [
[
"torch.nn.Sequential",
"torch.nn.ReLU6",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.AvgPool2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Upsample",
"torch.nn.BatchNorm2d"
]
] |
adamszequi/Constructing-an-N-Stock-Portfolio | [
"497a16dbb30ed9ebe1a04c6d7dc944d9f73197be"
] | [
"Constructing an N-stock portfolio.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Jan 21 11:31:50 2020\r\n\r\n@author: Dell\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport yfinance as yf\r\nimport os\r\nimport scipy as sp\r\n\r\n#function for downloading indicators\r\ndef downloadTickerData(tickers,startDate,endDate):\r\n ... | [
[
"pandas.merge",
"scipy.random.seed",
"scipy.unique",
"pandas.DataFrame",
"scipy.arange",
"pandas.read_pickle"
]
] |
DanielMagro97/Single-Word-Speech-Recogniser | [
"dd9bb40b8a745202ae2c1f38af6fa29f99e7354c"
] | [
"VI_Testing.py"
] | [
"import scipy.io.wavfile # for reading wav file\r\nfrom Assignment.IV_ExtractMFCCs import mfcc_extract # for MFCC extraction\r\nfrom sklearn.externals import joblib # for loading the GMMs\r\nimport os # for file functions\r\n\r\n\r\n# Loading the GMMs from disk\r\ngmm_bass = joblib.load('training//bass/... | [
[
"sklearn.externals.joblib.load"
]
] |
ThomIves/LeastSquaresPolyFitPurePy | [
"6ad8b070b01e5ec8cee810f4c9d208b8e25f5dac"
] | [
"LeastSquaresPolyPractice_2a.py"
] | [
"import LinearAlgebraPurePython as la \nimport MachineLearningPurePy as ml\n\nfrom sklearn.linear_model import LinearRegression\nfrom sklearn.preprocessing import PolynomialFeatures\nimport numpy as np\n\nimport matplotlib.pyplot as plt\n\nimport random\nimport sys\n\n\n# Section 1: Fake data preparation \n# and ... | [
[
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"sklearn.preprocessing.PolynomialFeatures",
"matplotlib.pyplot.plot",
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
liqing-ustc/ANS | [
"0c7fb789333adf0e9ba5cf4dd7cbb6b8f350846d"
] | [
"baselines/train.py"
] | [
"from baseline_utils import *\nimport time\nfrom tqdm import tqdm\nfrom collections import Counter\n\nfrom sklearn.metrics import classification_report, confusion_matrix\nimport pandas as pd\npd.set_option('display.max_rows', 500)\npd.set_option('display.max_columns', 500)\npd.set_option('display.width', 1000)\n\nf... | [
[
"numpy.random.seed",
"torch.load",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.tensor",
"numpy.concatenate",
"torch.no_grad",
"numpy.mean",
"pandas.set_option",
"numpy.array",
"torch.multiprocessing.set_sharing_strategy",
"torch.argmax"
]
] |
ravikant95/PW_from_GPS | [
"0aab3ad51ef2ba09dd1dac9b83c29dfbbf6e7009"
] | [
"generate_pw_shell_script.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Oct 18 15:21:21 2019\n\n@author: shlomi\n\"\"\"\n# TODO: add backup option depending on task. use tarfile to compress\n\ndef check_python_version(min_major=3, min_minor=6):\n import sys\n major = sys.version_info[0]\n minor = sys.vers... | [
[
"pandas.to_datetime",
"pandas.read_csv",
"pandas.Timedelta",
"pandas.Timestamp.today"
]
] |
Khev/graph_star | [
"4ac9cf09d77fc11dbbb07c9b2715c4ef1a5f3597"
] | [
"module/graph_star_conv_multi_rel.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom torch.nn import Parameter\nfrom torch_geometric.nn.conv import MessagePassing\nfrom torch_geometric.utils import add_self_loops, softmax\n\nfrom torch_geometric.utils import scatter_\nimport math\nimport torch.nn.init as init\n\n\nclass GraphStarConv(MessagePassi... | [
[
"torch.mean",
"torch.nn.functional.dropout",
"torch.cat",
"torch.nn.LayerNorm",
"torch.nn.Linear",
"torch.stack",
"torch.index_select"
]
] |
bubbliiiing/classification-tf2 | [
"10704d8e1073364eaee76a9f60aed73ca7e7b554"
] | [
"utils/utils.py"
] | [
"import math\r\nfrom functools import partial\r\n\r\nimport numpy as np\r\nfrom PIL import Image\r\n\r\nfrom .utils_aug import resize, center_crop\r\n\r\n\r\n#---------------------------------------------------------#\r\n# 将图像转换成RGB图像,防止灰度图在预测时报错。\r\n# 代码仅仅支持RGB图像的预测,所有其它类型的图像都会转化成RGB\r\n#----------------------... | [
[
"numpy.shape"
]
] |
Praneet460/dtreeviz | [
"0c4996cca436f7f5136e1ea43dfd241b3bce1e97"
] | [
"dtreeviz/trees.py"
] | [
"from dtreeviz.utils import *\n\nimport numpy as np\nimport pandas as pd\nimport graphviz\nfrom pathlib import Path\nfrom sklearn import tree\nfrom graphviz.backend import run, view\nimport matplotlib.pyplot as plt\nfrom dtreeviz.shadow import *\nfrom numbers import Number\nimport matplotlib.patches as patches\nimp... | [
[
"numpy.log",
"matplotlib.pyplot.tight_layout",
"numpy.nonzero",
"numpy.arange",
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"numpy.mean",
"numpy.count_nonzero",
"matplotlib.pyplot.close",
"numpy.array",
"matplotlib.patc... |
dkogan/mrcal | [
"ca4678e1171841fd9cd158b87ee460163647b495"
] | [
"mrcal/stereo.py"
] | [
"#!/usr/bin/python3\n\n'''Routines for stereo processing: rectification and ranging\n\nAll functions are exported into the mrcal module. So you can call these via\nmrcal.stereo.fff() or mrcal.fff(). The latter is preferred.\n'''\n\nimport sys\nimport numpy as np\nimport numpysane as nps\nimport mrcal\n\ndef rectifi... | [
[
"numpy.sqrt",
"numpy.round",
"numpy.max",
"numpy.cross",
"numpy.trace",
"numpy.arange",
"numpy.sin",
"numpy.roots",
"numpy.real",
"numpy.argmax",
"numpy.unravel_index",
"numpy.zeros",
"numpy.min",
"numpy.linalg.inv",
"numpy.tan",
"numpy.linalg.lstsq"... |
BoiseState/NAM | [
"816b5d7e4d1adfd95a56f6494a12856f08a38bee"
] | [
"localization_preprocessing/dnam_mixed_origami_process.py"
] | [
"from matplotlib import pyplot as plt\n\nimport numpy as np\nimport os.path as _ospath\n\nfrom scipy import spatial\nfrom scipy.optimize import minimize\n\nfrom multiprocessing import Pool, cpu_count\nimport csv\n\nimport picasso_utils as picasso\n\nimport argparse\n\nimport numba as _numba\nimport gc\nimport sys\n... | [
[
"numpy.dot",
"matplotlib.pyplot.imshow",
"numpy.sqrt",
"numpy.random.sample",
"numpy.exp",
"numpy.roll",
"scipy.spatial.cKDTree",
"numpy.sin",
"numpy.copy",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.log",
"numpy.multiply",
"numpy.rec.array",
"sci... |
0xLeo/generative-art | [
"29cfabd0cd1d7dd72bfcdfb96ed3bbf86e5196f0"
] | [
"beziers_aquarium/src/fish.py"
] | [
"#!/usr/bin/env python3\nfrom PIL import Image\nimport aggdraw\nimport numpy as np\nimport doctest\nfrom typing import List, Tuple, Union\nfrom collections import namedtuple\nfrom numpy import round\nfrom numpy.random import randint\nimport numpy as np\nfrom canvas import Canvas\nimport itertools as it\n\nRect = na... | [
[
"numpy.random.random",
"numpy.round",
"numpy.random.normal",
"numpy.random.uniform",
"numpy.array",
"numpy.random.randint"
]
] |
pientist/socceraction | [
"7f8e666ee5da7c1890c72a2c72042d4c73b90fda"
] | [
"socceraction/spadl/base.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Utility functions for all event stream to SPADL converters.\n\nA converter should implement 'convert_to_actions' to convert the events to the\nSPADL format.\n\n\"\"\"\nimport pandas as pd # type: ignore\n\nfrom . import config as spadlconfig\n\n\ndef _fix_clearances(actions: pd.Data... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
eduardojdiniz/DeepBrainNet | [
"38fd6916d35f2cf5f1a99dd36ddbfc3d6f929d99"
] | [
"example/scripts/slicer.py"
] | [
"from sklearn.preprocessing import StandardScaler\nfrom sklearn.preprocessing import Normalizer\nimport nibabel as nib\n# from nilearn import plotting\nimport re\nimport numpy as np\nimport pandas as pd\nimport os\nfrom os import listdir, fsencode\nimport math\nfrom PIL import Image\nimport sys\nimport os\n\nin_dat... | [
[
"sklearn.preprocessing.StandardScaler",
"numpy.percentile"
]
] |
prinse1545/DeepCovidXR | [
"0bc2db133f8caaddf22a6a67fd413af6fb82198e"
] | [
"kaggle/object_detection/evaluate_model.py"
] | [
"# Filename: evaluate_model.py\n# Description: This file evaluates \n# pytorch faster rcnn models\n# \n# 2021-08-12\n\n# importing tools\nfrom matplotlib import cm\nimport matplotlib.pyplot as plt;\nfrom matplotlib.ticker import LinearLocator\nimport torch\nfrom torchvision.ops.boxes import box_iou\nfrom PIL import... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.title",
"numpy.matmul",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"numpy.cos",
"numpy.sin",
"matplotlib.pyplot.hot",
"matplotlib.pyplot.xlabel",
"nu... |
Yangzhengtang/mspass | [
"7ac6db4afa7577f0e67981490fd89d50e35bf4c7"
] | [
"python/tests/test_ccore.py"
] | [
"import array\nimport copy\nimport pickle\n\nimport numpy as np\nimport pytest\n\nfrom mspasspy.ccore.seismic import (_CoreSeismogram,\n _CoreTimeSeries,\n Seismogram,\n SeismogramEnsemble,\n ... | [
[
"numpy.allclose",
"numpy.linspace",
"numpy.sqrt",
"numpy.random.rand",
"numpy.equal",
"numpy.float_",
"numpy.array",
"numpy.zeros",
"numpy.isclose"
]
] |
ytakano3/MPAS-Analysis | [
"fbb1f5189782b9abe9ff368f7c96484fd4832937"
] | [
"mpas_analysis/shared/plot/ticks.py"
] | [
"# This software is open source software available under the BSD-3 license.\n#\n# Copyright (c) 2020 Triad National Security, LLC. All rights reserved.\n# Copyright (c) 2020 Lawrence Livermore National Security, LLC. All rights\n# reserved.\n# Copyright (c) 2020 UT-Battelle, LLC. All rights reserved.\n#\n# Addition... | [
[
"matplotlib.pyplot.gca",
"numpy.amax",
"numpy.maximum",
"matplotlib.pyplot.autoscale",
"numpy.amin",
"numpy.arange",
"matplotlib.ticker.FuncFormatter",
"matplotlib.ticker.FixedLocator"
]
] |
majingliang/machine_learning | [
"54471182ac21ef0eee26557a7bd6f3a3dc3a09bd"
] | [
"Tsnewp/examples/examples.py"
] | [
"from Tsnewp import Tsnewp\nimport numpy as np\n\ndata = np.random.random((1000,100))\ntsne = Tsnewp()\nnew_data = tsne.transform(data)\n\n"
] | [
[
"numpy.random.random"
]
] |
immanuelweber/glimmer-utils | [
"4cb1d03aee712795810f09a62df517fce76a5ed1"
] | [
"glimmer/lightning/progressplotter.py"
] | [
"# Copyright (c) 2021 Immanuel Weber. Licensed under the MIT license (see LICENSE).\n\nimport random\nfrom collections import defaultdict\nfrom typing import Any\n\nimport numpy as np\nimport torch\nfrom IPython.display import display\nfrom matplotlib import pyplot as plt\nfrom pytorch_lightning import LightningMod... | [
[
"matplotlib.pyplot.cm.viridis",
"numpy.argmin",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.close"
]
] |
qianrenjian/hy_learn | [
"bd8927b21a62d4bb77fc14f85871b2c4530007ba"
] | [
"pytorch_fm/torchfm/layer.py"
] | [
"# -*- coding:utf-8 -*-\n# -*- @author:hanyan5\n# -*- @date:2020/10/22 19:11\n# -*- python3.6\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass FeaturesLinear(nn.Module):\n def __init__(self, field_dims, output_dim=1):\n super().__init__()\n self.fc ... | [
[
"numpy.cumsum",
"torch.zeros"
]
] |
gitwithmch/opencv | [
"a8844de7b5ffad08b4463536d21aadd6c0d1f3b3"
] | [
"samples/python/mouse_and_match.py"
] | [
"#!/usr/bin/env python\n'''\nmouse_and_match.py [-i path | --input path: default ../data/]\n\nDemonstrate using a mouse to interact with an image:\n Read in the images in a directory one by one\n Allow the user to select parts of an image with a mouse\n When they let go of the mouse, it correlates (using matchTempl... | [
[
"numpy.abs"
]
] |
AFRL-RY/Explore-Coarse-3D-Reconstruction-Path-Planning-Summer-2017 | [
"6c76e09f4fc2026d6b3efb421b7a56b480f5696b"
] | [
"initCameras.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Nov 26 22:56:36 2016\n\n@author: oacom\n\"\"\"\nimport numpy as np\nimport pandas as pd\n\ndef generateCameras(terrain, normals, cfg):\n '''\n Calculates positions and orientations of initial population of cameras\n based off of the surface normals\n \n ... | [
[
"numpy.ravel",
"numpy.zeros",
"pandas.DataFrame",
"numpy.ones"
]
] |
iamsmkr/Raphtory | [
"8b5a65748e71bd1914b7fbacac48d925e15c9d67"
] | [
"python/raphtoryclient/client.py"
] | [
"\"\"\"\nThe Raphtory Python client library to interact with Raphtory from Python.\n\nCurrently, the supported Python versions are 3.\n\n## Install from PyPI\n\n #!shell\n $ sudo pip install raphtory-client\n\n## Examples\n\nExample jupyter notebooks can be found at https://www.github.com/raphtory/examples\n\... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
tapika/OpenNMT-py | [
"b21f8036a10c2839e278b0b4eb297f0d08213437"
] | [
"onmt/utils/statistics.py"
] | [
"\"\"\" Statistics calculation utility \"\"\"\nfrom __future__ import division\nimport time\nimport math\nimport sys\n\nfrom onmt.utils.logging import logger\n\n\nclass Statistics(object):\n \"\"\"\n Accumulator for loss statistics.\n Currently calculates:\n\n * accuracy\n * perplexity\n * elapsed... | [
[
"torch.distributed.get_rank"
]
] |
huyuanfeng2018/flink | [
"b3a9dcbd65719c742fe4907ec17de396b188d378"
] | [
"flink-python/pyflink/table/tests/test_row_based_operation.py"
] | [
"################################################################################\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF lice... | [
[
"pandas.concat",
"pandas.DataFrame",
"pandas.b.max",
"pandas.b.mean",
"pandas.a.max"
]
] |
shyustc/dgl | [
"bdf1bb52e6cb7514e57d648bcba8ed660c11ca9c"
] | [
"python/dgl/backend/mxnet/tensor.py"
] | [
"from __future__ import absolute_import\n\nfrom distutils.version import LooseVersion\n\nimport os\nimport numpy as np\nimport mxnet as mx\nimport mxnet.ndarray as nd\nimport numbers\nimport builtins\nfrom ... import ndarray as dglnd\nfrom ... import kernel as K\nfrom ...function.base import TargetCode \n\nMX_VERSI... | [
[
"numpy.split",
"numpy.nonzero",
"numpy.unique",
"numpy.asarray",
"numpy.cumsum"
]
] |
cdfassnacht/cdfutils | [
"511c228787b3394415b9f5e3387e569419badb6f"
] | [
"cdfutils/datafuncs.py"
] | [
"\"\"\"\nA collection of fairly generic code for handling data\n\"\"\"\n\nimport numpy as np\nfrom scipy import interpolate, optimize\nfrom scipy.ndimage import filters\nfrom matplotlib import pyplot as plt\nfrom astropy.table import Table\nfrom astropy.modeling import models, fitting\n\n# -------------------------... | [
[
"numpy.polyfit",
"numpy.sqrt",
"numpy.linspace",
"numpy.asarray",
"matplotlib.pyplot.plot",
"numpy.argmin",
"numpy.exp",
"numpy.polyval",
"numpy.arange",
"numpy.atleast_1d",
"scipy.optimize.leastsq",
"numpy.argmax",
"matplotlib.pyplot.errorbar",
"numpy.zeros... |
Midnighter/pyorganism | [
"9459b51bb6f33c7d3c644cd95a9d72a0862470e6"
] | [
"scripts/construct_trn.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nimport sys\nimport os\nimport logging\n\nimport numpy\nimport networkx as nx\n\nimport pyorganism\nimport pyorganism.regulation as pyreg\n\n\nLOGGER = logging.getLogger()\nLOGGER.addHandler(logging.StreamHandler())\nLOGGER.setLevel(logging.INFO)\n\n\nclass NodeCo... | [
[
"numpy.array"
]
] |
dangeles/tissue_enrichment_tool_hypergeometric_test | [
"534dc40ff5f31e83845ae96c951cb8469730a5a2"
] | [
"tissue_enrichment_analysis/hypergeometricTests.py"
] | [
"\"\"\"\nA script to implement a hypergeometric test procedure.\n\nAuthor: David Angeles\nDate: May 26, 2015\nRequires Python > 3.5\nNeeds:\nA tissue dictionary\nA control list of gene names\nAn experimental list of gene names\n\"\"\"\n# -*- coding: utf-8 -*-\nimport pandas as pd\nfrom scipy import stats\nimport nu... | [
[
"matplotlib.pyplot.tight_layout",
"pandas.read_csv",
"numpy.sum",
"matplotlib.use",
"matplotlib.pyplot.subplots",
"scipy.stats.hypergeom.sf",
"scipy.stats.hypergeom.mean",
"pandas.DataFrame.from_dict",
"numpy.where",
"pandas.melt"
]
] |
KeksimusPrime/SentEval | [
"2d87214e6242ab8fd70ad1158d13adb483dee03a"
] | [
"similarity/gaussian_utils.py"
] | [
"import numpy as np\n\n\ndef fit_covariance(X, reg_cov=1e-10):\n variances = np.var(X, axis=0, ddof=0) + reg_cov\n return variances\n\n\ndef fit_mean(X):\n mean = np.mean(X, axis=0)\n return mean\n\n\ndef get_score(X, mu, var_diag):\n N, D = X.shape\n log_prob = np.sum((X - mu) ** 2 / var_diag)\n ... | [
[
"numpy.log",
"numpy.mean",
"numpy.var",
"numpy.zeros",
"numpy.sum"
]
] |
cheesama/nlflow | [
"5c504fc4bfc5aa0ca3892af7b01b2eb46f5edfbb"
] | [
"nlu_flow/response_generation/chitchat_response_generation/torch_transformer_model/inferencer.py"
] | [
"from fastapi import FastAPI\n\nfrom embedding_transformer import EmbeddingTransformer\n\nfrom nlu_flow.preprocessor.text_preprocessor import normalize\nfrom nlu_flow.utils.kor_char_tokenizer import KorCharTokenizer\n\nimport torch\n\napp = FastAPI()\nis_ready = False\n\n# load chitchat_response_model\nmodel = None... | [
[
"torch.LongTensor",
"torch.load"
]
] |
ASGuard-UCI/DRP-attack | [
"6987183c3de36095c0764a865bcfa1d695b7c46c"
] | [
"car_motion_attack/load_sensor_data.py"
] | [
"import numpy as np\nimport pandas as pd\nimport cv2\nfrom logging import getLogger\nimport pymap3d as pm\n\n\nimport comma2k19.orientation as orient\n\nfrom car_motion_attack.polyfuzz.polyfuzz import VehicleState\nfrom car_motion_attack.utils import ecef2geodetic\nfrom car_motion_attack.polyfuzz.utils.vehicle_cont... | [
[
"numpy.dot",
"pandas.DataFrame",
"numpy.interp",
"numpy.load",
"numpy.array"
]
] |
KirillErofeev/gudhi-devel | [
"e2c58a7cf912281e1d4befba74b66b43f4923f18"
] | [
"src/python/example/plot_rips_complex.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\nimport gudhi\npoints = np.array(gudhi.read_off('../../data/points/Kl.off'))\nrc = gudhi.RipsComplex(points=points, max_edge_length=.2)\nst = rc.create_simplex_tree(max_dimension=2)\n# We are only going to plot the triangles\ntriangles = np.array([s[0] for s in st.get_sk... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
comjoueur/cesi | [
"39058d307473cd112f5b1aafbf56d9a728b601dd"
] | [
"src/skge/actfun.py"
] | [
"import numpy as np\nimport sys\nimport inspect\n\n# NOTE: ALL STATIC CLASSES HERE:\n\nclass ActivationFunction(object):\n\n\t@classmethod\n\tdef key(cls):\n\t\treturn cls.__name__.lower()\n\n# g_given_f -> gradient given function value\n\nclass Linear(ActivationFunction):\n\n\t@staticmethod\n\tdef f(x):\n\t\tretur... | [
[
"numpy.maximum",
"numpy.int_",
"numpy.ones",
"numpy.tanh",
"numpy.exp"
]
] |
z1021190674/GMAUResNeXt_RS | [
"a8a7444bf30e509cefc01b3be4b0587d367cda2e"
] | [
"model/DANet/danet.py"
] | [
"\"\"\"Dual Attention Network\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom model.DANet.backbone import ResNet50\n\nclass DANet(ResNet50):\n r\"\"\"Pyramid Scene Parsing Network\n\n Parameters\n ----------\n nclass : int\n Number of categories for the training ... | [
[
"torch.nn.Softmax",
"torch.nn.Dropout",
"torch.max",
"torch.zeros",
"torch.randn",
"torch.nn.Conv2d",
"torch.bmm",
"torch.nn.functional.interpolate",
"torch.nn.ReLU"
]
] |
AkinoriTanaka-phys/DOT | [
"d06f4346776535562fe3bda8a0950bd6b2cdc040"
] | [
"evaluation.py"
] | [
"import numpy as np\nimport scipy\n\n\nimport chainer\nfrom chainer import cuda\nfrom chainer import datasets\nfrom chainer import serializers\nfrom chainer import Variable\nimport chainer.functions as F\n\nfrom inception_score import Inception\nfrom inception_score import inception_score\n\nimport math\n\nimport c... | [
[
"numpy.dot",
"numpy.clip",
"numpy.concatenate",
"numpy.real",
"numpy.sum"
]
] |
appleparan/mise.py | [
"a77ea51be37a739928600c66d168d69b78bc0c4b"
] | [
"mise/data.py"
] | [
"import copy\nimport datetime as dt\nimport string\nfrom pathlib import Path\n\nimport bokeh\nimport matplotlib.dates as mdates\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport statsmodels.api as sm\nimport statsmodels.graphics.tsaplots as tpl\nimport statsmod... | [
[
"numpy.squeeze",
"pandas.DataFrame",
"matplotlib.dates.HourLocator",
"sklearn.preprocessing.PowerTransformer",
"pandas.melt",
"sklearn.compose.ColumnTransformer",
"pandas.reset_option",
"pandas.read_csv",
"matplotlib.pyplot.close",
"pandas.set_option",
"matplotlib.dates... |
statisticalbiotechnology/viewST | [
"9562bcb9bdd039f6e9ba32792432f361fedc5a5a"
] | [
"Experiment/hierarchical_view/Sunburst/hierarchical_generator.py"
] | [
"import pandas as pd\r\nimport numpy as np\r\nimport networkx as nx\r\nfrom networkx.readwrite import json_graph #key package\r\nimport json\r\nimport simplejson\r\n\r\ndata_path=\"C:/Users/Riley/Downloads/Databases\"\r\nrelation_file = data_path + \"/ReactomePathwaysRelation.txt\" #import realtion file\r\ninfile= ... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
stanleyu911/zipline | [
"93c1a15e7b0269f6b32f54b56982ffb973a5feb3"
] | [
"zipline/utils/run_algo.py"
] | [
"import click\nfrom datetime import datetime\n\nimport os\nimport sys\nimport warnings\n\ntry:\n from pygments import highlight\n from pygments.lexers import PythonLexer\n from pygments.formatters import TerminalFormatter\n\n PYGMENTS = True\nexcept ImportError:\n PYGMENTS = False\nimport logbook\nim... | [
[
"pandas.Timestamp",
"pandas.DataFrame",
"pandas.date_range"
]
] |
shouwangzhe134/Decoupled-R-CNN | [
"7fee5bef6c52a79636f61cfe48babfaf3e4fc088"
] | [
"mmdet/models/roi_heads/bbox_heads/bbox_head.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.modules.utils import _pair\n\nfrom mmdet.core import (auto_fp16, build_bbox_coder, force_fp32, multi_apply,\n multiclass_nms)\nfrom mmdet.models.builder import HEADS, build_loss\nfrom mmdet.models.losses impo... | [
[
"torch.nn.functional.softmax",
"torch.cat",
"torch.nn.init.constant_",
"torch.gather",
"torch.sum",
"torch.nn.Linear",
"torch.nn.AvgPool2d",
"torch.nn.init.normal_",
"torch.nonzero",
"torch.nn.modules.utils._pair",
"torch.stack"
]
] |
ignaciochr/purchase_optimizer | [
"be582430461e5071e7a451e7edfbc5d666eb50b1"
] | [
"YaEsta.com+optimizer.py"
] | [
"# coding: utf-8\n# YaEsta.com purchase optimizer\n\nimport requests\nimport bs4\nSoup = bs4.BeautifulSoup\nimport csv\nimport re\nimport pandas as pd\nimport numpy as np\nimport math\nfrom itertools import combinations\n\n# Importing website HTML data to be parsed\n# To parse local HTML files\nwith open(r'C:/Users... | [
[
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"sklearn.utils.shuffle",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"numpy.std",
"matplotlib.pyplot.subplot",
"numpy.mean",
"matplotlib.pyplot.rcParams.update",
"matplotlib.... |
RosieLiu/federated | [
"04d460feb39df0b9bccce4214c631b3f39957846"
] | [
"tensorflow_federated/python/simulation/hdf5_client_data.py"
] | [
"# Copyright 2019, The TensorFlow Federated 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.Graph"
]
] |
JacksonKaunismaa/neural-music | [
"0848044180792e317639a69569d84c654ad98860"
] | [
"model.py"
] | [
"# PyTorch Implementation of https://arxiv.org/pdf/1906.01083.pdf\n# TAKEN FROM https://github.com/resemble-ai/MelNet/blob/master/model.py, with heavy modification\n# added FeatureExtraction, MelNetTier, and the overall multi-scale architecture\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F... | [
[
"torch.nn.Softmax",
"torch.norm",
"torch.cat",
"torch.load",
"torch.nn.ModuleList",
"torch.nn.GRU",
"torch.reshape",
"torch.nn.Embedding",
"torch.nn.Linear",
"torch.repeat_interleave",
"torch.arange",
"torch.stack",
"torch.nn.functional.pad"
]
] |
fossabot/TFkit | [
"aade08634171eaee41e3d687b0f65259bef8fe43"
] | [
"tfkit/model/clas/model.py"
] | [
"import sys\nimport os\n\nimport torch\nfrom torch import nn\n\ndir_path = os.path.dirname(os.path.realpath(__file__))\nsys.path.append(os.path.abspath(os.path.join(dir_path, os.pardir)))\n\nfrom torch import softmax, sigmoid\nfrom tfkit.model.clas.dataloader import get_feature_from_data\nfrom tfkit.utility.loss im... | [
[
"torch.nn.Dropout",
"torch.sigmoid",
"torch.softmax",
"torch.nn.ModuleList",
"torch.sum",
"torch.tensor",
"torch.no_grad",
"torch.cuda.is_available",
"torch.as_tensor"
]
] |
ruancomelli/keras | [
"f1e9c76675981ee6683f54a3ce569212d551d12d"
] | [
"keras/layers/core/reshape.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.compat.v2.executing_eagerly",
"tensorflow.python.util.tf_export.keras_export",
"tensorflow.compat.v2.shape",
"numpy.prod",
"tensorflow.compat.v2.TensorShape"
]
] |
yonghanzhang94/A-Single-View-3D-Object-Point-Cloud-Reconstruction | [
"3a71910278a2915374e38baf6af3a81e21148795"
] | [
"save_pix3d_img.py"
] | [
"from __future__ import print_function\nimport argparse\nfrom os.path import join, exists, isdir, dirname, abspath, basename\nimport json\nimport numpy as np\nfrom datasets import GetPix3dDataset\nimport torch\nimport torch.backends.cudnn as cudnn\nfrom model import generator\nfrom torch.autograd import Variable\ni... | [
[
"torch.load",
"matplotlib.pylab.figure",
"torch.no_grad",
"matplotlib.pylab.savefig",
"matplotlib.pylab.close"
]
] |
twylie/viromatch | [
"44edca07c44308b17b9f19174c08175736fff53f"
] | [
"bin/merge_read_counts.py"
] | [
"#! /usr/bin/python3.7\n\nimport argparse\nimport pandas as pd\nimport os\nimport sys\n\nversion = '1.0'\n\n\ndef eval_cli_arguments():\n\n parser = argparse.ArgumentParser(\n description='Merge multiple ViroMatch read count files.',\n prog='merge_read_counts.py',\n add_help=False\n )\n\n... | [
[
"pandas.concat",
"pandas.read_csv",
"pandas.DataFrame.from_dict"
]
] |
granttremblay/GuiPy | [
"cedb4fac175fae5c46f1b1dc1b013c9859b3dcd2"
] | [
"guipy/widgets/style.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\nStyles\n======\n\n\"\"\"\n\n\n# %% IMPORTS\n# Package imports\nfrom matplotlib import rcParams\nfrom matplotlib.lines import lineMarkers, lineStyles\nfrom qtpy import QtCore as QC, QtGui as QG, QtWidgets as QW\n\n# GuiPy imports\nfrom guipy import widgets as GW\nfrom guipy.widget... | [
[
"matplotlib.lines.lineMarkers.items",
"matplotlib.lines.lineStyles.items"
]
] |
Qingtian-Zou/AIX360 | [
"cf25f58077ae002fb4542b680fd98db47758dae5"
] | [
"aix360/data/ted_data/GenerateData.py"
] | [
"# This file will generate a synthetic dataset to predict employee attrition\r\n# Like most datasets it will have a feature vector and a Y label for each instance.\r\n# However, unlike most datasets it will also have an Explanation (E) for each instance, encoded as an non-negative integer.\r\n# This is motivated by... | [
[
"pandas.DataFrame"
]
] |
yuyan110nan/federated-learning-master-CJC | [
"96f3b316704f2a182ed3998ff432123d190f7482"
] | [
"main_fed_poison_attack_fedavg.py"
] | [
"#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n# Python version: 3.6\r\n\r\nimport matplotlib\r\nimport pandas as pd\r\n\r\nmatplotlib.use('Agg')\r\nimport matplotlib.pyplot as plt\r\nimport copy\r\nimport numpy as np\r\nfrom torchvision import datasets, transforms\r\nimport torch\r\n\r\nfrom utils.sampling i... | [
[
"matplotlib.use",
"torch.cuda.is_available",
"pandas.DataFrame"
]
] |
vanvalenlab/deepcell-data-engineering | [
"a0dca3839f341841cb4a983923fd0eac21225736"
] | [
"caliban_toolbox/utils/plot_utils.py"
] | [
"# Copyright 2016-2020 The Van Valen Lab at the California Institute of\n# Technology (Caltech), with support from the Paul Allen Family Foundation,\n# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.\n# All rights reserved.\n#\n# Licensed under a modified Apache License, Version 2.0 (the \... | [
[
"numpy.max",
"numpy.array",
"numpy.isin"
]
] |
tomwhite/pynndescent | [
"0b65db53c9ebe44797cb8bb8136e3aa3fcf96681"
] | [
"pynndescent/distances.py"
] | [
"# Author: Leland McInnes <leland.mcinnes@gmail.com>\n#\n# License: BSD 3 clause\nimport numpy as np\nimport numba\n\n_mock_identity = np.eye(2, dtype=np.float32)\n_mock_ones = np.ones(2, dtype=np.float32)\n\n\n@numba.njit(fastmath=True)\ndef euclidean(x, y):\n \"\"\"Standard euclidean distance.\n\n ..math::\... | [
[
"numpy.sqrt",
"numpy.abs",
"numpy.arcsin",
"numpy.eye",
"numpy.cos",
"numpy.sin",
"numpy.ones",
"numpy.sum",
"numpy.empty"
]
] |
610265158/shufflenetv2-series-tensorflow | [
"970e228e252a2aac1b8e05d151858d46b1443c70"
] | [
"tmp.py"
] | [
"import torch\nimport tensorflow as tf\nimport numpy as np\n\nfrom train_config import config as cfg\n\nparams_dict=np.load(cfg.MODEL.pretrained_model,allow_pickle=True).item()\n\n\n\ny = np.random.rand(1,224,224,3).astype(np.float32)\nfilterx = params_dict['ShuffleNetV2_Plus/first_conv/0/weights:0']\n\nfilterx=np.... | [
[
"numpy.abs",
"torch.nn.Conv2d",
"torch.from_numpy",
"numpy.random.rand",
"tensorflow.pad",
"numpy.transpose",
"tensorflow.Session",
"numpy.load",
"numpy.array",
"tensorflow.nn.conv2d"
]
] |
mierzejk/shapenet | [
"fe7a6caf726b34e3bce7d696b846b8df446ba998"
] | [
"shapenet/layer/homogeneous_transform_layer.py"
] | [
"# author: Justus Schock (justus.schock@rwth-aachen.de)\n\nimport torch\nimport os\nfrom torch.utils.cpp_extension import load as load_cpp\n\n\nclass HomogeneousTransformationLayer(torch.nn.Module):\n \"\"\"\n Wrapper Class to Wrap the Python and C++ API into a combined python API\n\n \"\"\"\n def __ini... | [
[
"torch.arange",
"torch.rand",
"torch.zeros"
]
] |
soranjh/pennylane | [
"deffcee1615687d74a25f4385dd1f097d0d7e9cd"
] | [
"pennylane/devices/default_qubit.py"
] | [
"# Copyright 2018-2021 Xanadu Quantum Technologies Inc.\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 ap... | [
[
"numpy.sqrt",
"numpy.argmax",
"numpy.ravel_multi_index",
"numpy.argsort",
"numpy.array",
"numpy.exp",
"numpy.zeros"
]
] |
JoshuaPiinRueyPan/StatoilCompetition | [
"9e0f9ac868e9eaf648a4e71e97de000229cd3a6a"
] | [
"src/net/ResnetFat.py"
] | [
"import tensorflow as tf\nfrom src.net.SubnetBase import SubnetBase\nfrom src.layers.BasicLayers import *\nfrom src.layers.ResidualLayers import *\nimport settings.OutputSettings as outSettings\n\nclass ResnetFat(SubnetBase):\n\tdef __init__(self, isTraining_, trainingStep_, inputImage_, inputAngle_, groundTruth_):... | [
[
"tensorflow.group",
"tensorflow.name_scope"
]
] |
zaneoliver6/char-rnn-lstm-receipts | [
"f2a54a6eacae50209c47d1ac5246cfc616b53b11"
] | [
"train.py"
] | [
"from __future__ import print_function\nimport tensorflow as tf\n\nimport argparse\nimport time\nimport os\nfrom six.moves import cPickle\n\nfrom utils import TextLoader\nfrom model import Model\n\n\ndef main():\n parser = argparse.ArgumentParser(\n formatter_class=argparse.ArgumentDefault... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.global_variables",
"tensorflow.assign",
"tensorflow.global_variables_initializer",
"tensorflow.summary.merge_all",
"tensorflow.Session",
"tensorflow.train.write_graph"
]
] |
sinaghassemi/semanticSegmentation | [
"ec4cd8aeb92dc5dde80ae21f874a3a6a74bde108"
] | [
"cnn/main.py"
] | [
"# Copyright 2018 Telecom Italia S.p.A.\n\n# Redistribution and use in source and binary forms,\n# with or without modification, are permitted provided that the following conditions are met:\n\n# Redistributions of source code must retain the above copyright notice,\n# this list of conditions and the following disc... | [
[
"torch.initial_seed",
"numpy.random.seed",
"torch.load",
"torch.cat",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.nn.BCELoss",
"torch.exp",
"torch.nn.NLLLoss2d",
"torch.no_grad",
"numpy.zeros",
"torch.nn.MSELoss",
"torch.multiprocessing.set_sharin... |
mtlazul/computer-vision | [
"94871a92bdf0b8a90a41b6d074988a9dbf91f8ba"
] | [
"tarea02/segmentation.py"
] | [
"#!/usr/bin/env python3\n\nimport numpy as np\nimport argparse\nimport cv2\nfrom scipy import ndimage as ndi\nfrom skimage.util import img_as_float\nfrom skimage.segmentation import slic\nfrom skimage.filters import rank\nfrom skimage.segmentation import watershed\nfrom skimage.morphology import disk\nfrom sklearn... | [
[
"sklearn.cluster.estimate_bandwidth",
"sklearn.cluster.MeanShift",
"numpy.reshape",
"scipy.ndimage.label",
"numpy.max",
"numpy.array"
]
] |
gwjknvwjn/catboost | [
"de75c6af12cf490700e76c22072fbdc15b35d679"
] | [
"catboost/libs/model/model_export/ut/test.py"
] | [
"import numpy as np\nimport os\nimport pytest\nimport re\nimport yatest\n\nfrom catboost import Pool, CatBoost, CatBoostClassifier\nfrom catboost_pytest_lib import data_file, load_pool_features_as_df\n\nCATBOOST_APP_PATH = yatest.common.binary_path('catboost/app/catboost')\nAPPROXIMATE_DIFF_PATH = yatest.common.bin... | [
[
"numpy.isclose"
]
] |
Koravit-Kaewlek/detect-banknote | [
"27e76c3e8c0567516b1ec71dc46252d50e753180"
] | [
"detect_video.py"
] | [
"import os\n# comment out below line to enable tensorflow outputs\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\nimport time\nimport tensorflow as tf\nphysical_devices = tf.config.experimental.list_physical_devices('GPU')\nif len(physical_devices) > 0:\n tf.config.experimental.set_memory_growth(physical_devices[0], ... | [
[
"tensorflow.compat.v1.ConfigProto",
"tensorflow.constant",
"tensorflow.saved_model.load",
"tensorflow.config.experimental.set_memory_growth",
"numpy.asarray",
"tensorflow.lite.Interpreter",
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.shape",
"tensorflow.... |
sisl/delsmm | [
"11f2750356a7c7d8b196a67af747a9bc5f39b479",
"11f2750356a7c7d8b196a67af747a9bc5f39b479"
] | [
"tests/test_barriercrit.py",
"delsmm/utils.py"
] | [
"#\n# test_barriercrit.py\n#\n\nfrom delsmm.barriercrit import MxNormBarrierCriterion\nfrom delsmm.smm import StructuredMechanicalModel\nfrom delsmm.lagcrit import DELCriterion\nfrom ceem.opt_criteria import GroupCriterion\nimport torch \n\ndef test():\n\n\tqdim = 2\n\tB = 2\n\tT = 10\n\n\tt = torch.arange(T).unsqu... | [
[
"torch.randn",
"torch.arange"
],
[
"numpy.diag",
"scipy.interpolate.UnivariateSpline",
"torch.lstsq",
"torch.cat",
"torch.autograd.functional.jacobian",
"torch.zeros",
"numpy.arange",
"torch.randn",
"torch.zeros_like",
"torch.typename",
"scipy.linalg.expm",
... |
UPRMG/Classification_Airbnb | [
"2113199fd37c798bdec49402cef9238821168f33"
] | [
"Data_setting & Analysis/Final_Presentation/airpy/agd.py"
] | [
"\n# coding: utf-8\n\n# ### Import\n\n# In[5]:\n\n\nimport numpy as np\nimport pandas as pd\nimport xgboost\nimport xgboost as xgb\nfrom xgboost.sklearn import XGBClassifier\nfrom sklearn.metrics import *\nfrom IPython.core.display import Image \nfrom sklearn.datasets import make_classification\nfrom sklearn.ensemb... | [
[
"pandas.concat",
"pandas.read_csv",
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.cut",
"pandas.get_dummies"
]
] |
whelan9453/incubator-superset | [
"4e3cea45a5136a28442eea50fddc6cf423a9ddd5"
] | [
"superset/examples/unicode_test_data.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"pandas.read_csv"
]
] |
jacektl/calamari | [
"980477aefe4e56f7fc373119c1b38649798d8686"
] | [
"calamari_ocr/ocr/model/graph.py"
] | [
"from functools import partial\n\nimport tensorflow as tf\nfrom tensorflow.python.ops import array_ops\nfrom tensorflow.python.ops import ctc_ops as ctc\nfrom tfaip.model.graphbase import GraphBase\n\nfrom calamari_ocr.ocr.model.layers.concat import ConcatLayerParams\nfrom calamari_ocr.ocr.model.layers.toinputdims ... | [
[
"tensorflow.python.ops.array_ops.transpose",
"tensorflow.nn.softmax",
"tensorflow.sparse.to_dense",
"tensorflow.roll",
"tensorflow.cast"
]
] |
son-n-pham/Youtube-View-Bot | [
"e7f7779b88ce451b454253cd156d8eb6624a4fa4"
] | [
"proxy.py"
] | [
"# This is to replace the manual download of ChromeDriver by using webdriver_manager\n# selenium.webdriver.chrome.service is used as the previous version of directly referring ChromeDriver is depreciated\nfrom selenium import webdriver\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver.chrome.ser... | [
[
"pandas.read_csv",
"pandas.DataFrame.from_dict"
]
] |
vinferrer/aroma | [
"7b25510cfc7c655513ac72dc6cff22546f46dd16"
] | [
"aroma/plotting.py"
] | [
"\"\"\"Plotting functions for ICA-AROMA.\"\"\"\nimport logging\nimport os\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nfrom matplotlib import gridspec\n\nmpl.use('Agg')\nLGR = logging.getLogger(__name__)\n\n\ndef classification_plot(in... | [
[
"matplotlib.gridspec.GridSpecFromSubplotSpec",
"numpy.linspace",
"matplotlib.use",
"numpy.arange",
"pandas.DataFrame",
"pandas.read_table",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.suptitle",
"numpy.array",
"matplotlib.pyplot.figure"
]
] |
vargacypher/EfficienzaDecompac | [
"bd9ae5b692114ed77af01458622d484468681e2b"
] | [
"descompact.py"
] | [
"import numpy as np\r\nimport pandas as pd \r\nimport xml.etree.ElementTree as et \r\nfrom os import listdir\r\nfrom datetime import datetime\r\nimport os, zipfile\r\nimport shutil,glob\r\nimport regex as re \r\nimport pyodbc\r\nfrom os.path import isfile, join, basename\r\nimport warnings\r\nfrom pandas.core.commo... | [
[
"pandas.read_sql",
"pandas.merge",
"pandas.read_csv",
"pandas.DataFrame"
]
] |
cirosantilli/vaex | [
"0247f0673c5c0473001b0b66adcbc716560536aa"
] | [
"packages/vaex-jupyter/vaex/jupyter/bqplot.py"
] | [
"from __future__ import absolute_import\nimport copy\nimport logging\nimport bqplot.marks\nimport bqplot as bq\nimport bqplot.interacts\nimport ipywidgets as widgets\nimport ipyvuetify as v\n\nimport vaex\nimport bqplot.pyplot as plt\nimport numpy as np\nimport vaex.events\nfrom .plot import BackendBase\nfrom .util... | [
[
"numpy.arange",
"numpy.array"
]
] |
IBM/pddlrl | [
"e057cc67426c91c9180286a67acad5b9a1ba7fc6"
] | [
"pddlrl/wrappers/integer_action.py"
] | [
"# This file is a part of PDDLRL project.\n# Copyright (c) 2020 Clement Gehring (clement@gehring.io)\n# Copyright (c) 2021 Masataro Asai (guicho2.71828@gmail.com, masataro.asai@ibm.com), IBM Corporation\n\nimport itertools\nimport operator\n\nimport numpy as np\n\nfrom acme.wrappers import base\n\nimport pddlenv\n\... | [
[
"numpy.array",
"numpy.zeros"
]
] |
Koen-Git/ColorSymDetect | [
"5d6bb6734063f4a09c9a153527a446ce5c02a5b0"
] | [
"preprocess.py"
] | [
"import util\nimport numpy as np\n\ndef preproccesData(data):\n def isIntersecting(data):\n if util.line_intersect(data['line1x1'],data['line1y1'],data['line1x2'],data['line1y2'],data['line2x1'],data['line2y1'],data['line2x2'],data['line2y2']) == None:\n return False\n return True\n\n ... | [
[
"numpy.sqrt"
]
] |
kuevpr/particles | [
"c1d0e68c193b17aecd76c9e5aced75ba41dc3295"
] | [
"particles/kalman.py"
] | [
"# -*- coding: utf-8 -*-\n\nr\"\"\"\nBasic implementation of the Kalman filter (and smoother).\n\nOverview\n=========\n\nThe Kalman filter/smoother is a well-known algorithm for computing recursively\nthe filtering/smoothing distributions of a linear Gaussian model, i.e. a model\nof the form:\n\n.. math::\n X_0 ... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.eye",
"numpy.matmul",
"numpy.atleast_2d",
"numpy.zeros",
"numpy.empty"
]
] |
vamsikrishnabodaballa/Path-Finding-Robot | [
"7e94dce95d58085b7f87fef8ce5de63c31fef75a"
] | [
"Codes 9x9/Graph_gen.py"
] | [
"import numpy as np\r\n\r\n\r\ndef baap_baap(n, index):\r\n print(\"Running Graph_Gen.baap_baap\")\r\n true_hoc = np.load(\"true_hoc.npy\")\r\n weapons = np.load(\"weapons.npy\")\r\n death_e = np.load(\"death_e.npy\")\r\n jail = np.load(\"jail.npy\")\r\n graph = np.zeros([n**2, n**2], dtype=int)\r... | [
[
"numpy.load",
"numpy.zeros"
]
] |
pvtodorov/novosparc | [
"fbc2aa79f22fc49401f19f5136aa5ef21a2f1eb7"
] | [
"novosparc/plotting/_plotting.py"
] | [
"from __future__ import print_function\n\n###########\n# imports #\n###########\n\nimport matplotlib as mpl\nmpl.use('agg')\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\n\n#############\n# functions #\n#############\n\ndef plot_mapped_cells(locations,... | [
[
"numpy.mean",
"numpy.where",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"numpy.argsort",... |
beyretb/baselines | [
"0c86af78f3c7b7fd13979cce6270411e60d788af"
] | [
"baselines/herSimple/replay_buffer.py"
] | [
"import threading\n\nimport numpy as np\n\n\nclass ReplayBuffer:\n def __init__(self, buffer_shapes, size_in_transitions, T, sample_transitions):\n \"\"\"Creates a replay buffer.\n\n Args:\n buffer_shapes (dict of ints): the shape for all buffers that are used in the replay\n ... | [
[
"numpy.arange",
"numpy.concatenate",
"numpy.array",
"numpy.empty",
"numpy.random.randint"
]
] |
kant/GRAFIMO | [
"65400d7a9a45b4a54492bfa069890ad354974615"
] | [
"src/grafimo/motif.py"
] | [
"\"\"\"\n\n@author: Manuel Tognon\n\n@email: manu.tognon@gmail.com\n@email: manuel.tognon@studenti.univr.it\n\nThe file contains the definition of the Motif class, that represent\nthe motif that will be searched on the genome.\n\n\"\"\"\n\n\nfrom grafimo.GRAFIMOException import NoDataFrameException, WrongMotifWidth... | [
[
"numpy.round",
"numpy.double",
"numpy.floor",
"pandas.DataFrame"
]
] |
feicccccccc/Neural-ODE-Ex | [
"63aa60e9a67f0030c2a9ed802627f1c59fc5d553"
] | [
"Adjoint.py"
] | [
"import torch\nfrom NeuralODE import ODEfunc\nfrom ODE_solver import ode_solve\nimport numpy as np\n\n\nclass ODEAdjoint(torch.autograd.Function):\n \"\"\"\n Custom made autograd function to perform continuous backpropgation\n define by forward and backward static method\n \"\"\"\n @staticmethod\n ... | [
[
"torch.zeros",
"torch.cat",
"torch.set_grad_enabled",
"torch.no_grad",
"numpy.prod"
]
] |
JulienL3vesque/amazon-sagemaker-aws-greengrass-custom-object-detection-model | [
"4b45f34b4c92cbfc3633938136366ac729155396"
] | [
"data-prep/01_video_to_frame_utils.py"
] | [
"from __future__ import (absolute_import, division,\n print_function, unicode_literals)\n\nimport os\nimport cv2\nimport logging\nimport skimage\nimport skimage.io as io\nimport skimage.transform\nimport numpy as np\nimport torchvision\nimport torch\nimport time\nimport boto3\nimport shutil\n... | [
[
"numpy.array",
"torch.from_numpy",
"numpy.empty"
]
] |
wsyjwps1983/TensorFlow-Tutorials-2 | [
"4dfabcb5cf14f99622dbe5f9f12f0539821c169c"
] | [
"python/04_logistic_regression.py"
] | [
"\"\"\"Simple tutorial using code from the TensorFlow example for Regression.\n\nParag K. Mital, Jan. 2016\"\"\"\n# pip3 install --upgrade\n# https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py3-none-any.whl\n# %%\nimport tensorflow as tf\nimport tensorflow.examples.tutorials.mnist.input_data as input... | [
[
"tensorflow.matmul",
"numpy.min",
"numpy.reshape",
"tensorflow.zeros",
"tensorflow.cast",
"tensorflow.placeholder",
"numpy.max",
"tensorflow.global_variables_initializer",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.log",
"tensorflow.Session",
"tensorfl... |
erickingxu/pyBridge | [
"25f661ff7fc5806e86d1f9c87bd82541329709ac"
] | [
"torchLayer_ncnn.py"
] | [
"\r\nimport os\r\nimport fileinput\r\n\r\ntry:\r\n import numpy as np\r\nexcept:\r\n os.system('conda install numpy')\r\n import numpy as np\r\n\r\nclass NCNN_FRAMEWORK_FACTORY(object):\r\n def __init__(self, outDir = ''):\r\n self.paramFilePath = outDir + 'ncnn.param'\r\n self.binF... | [
[
"numpy.int32",
"numpy.uint32"
]
] |
WK-Heisenberg/detectron2 | [
"927b3be8b5898e2008a28b6c2adade76eeb8aa93"
] | [
"detectron2/structures/boxes.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport math\nimport numpy as np\nfrom enum import IntEnum, unique\nfrom typing import Iterator, List, Tuple, Union\nimport torch\n\n_RawBoxType = Union[List[float], Tuple[float, ...], torch.Tensor, np.ndarray]\n\n\n@unique\nclass BoxMode(IntEn... | [
[
"torch.max",
"torch.empty",
"torch.zeros",
"torch.cat",
"torch.sin",
"torch.min",
"numpy.asarray",
"torch.tensor",
"torch.isfinite",
"torch.device",
"torch.cos",
"torch.as_tensor"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.