repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
Torchflame20/hal9000 | [
"4feb7c0702f4af28d1f2ccf9b9a13d67f806999d"
] | [
"code/Lab_F/ex_mhe.py"
] | [
"import numpy as np\nimport time\nimport matplotlib.pyplot as plt\n# get gekko package with:\n# pip install gekko\nfrom gekko import GEKKO\n# get tclab package with:\n# pip install tclab\nfrom tclab import TCLab\n\n# Connect to Arduino\na = TCLab()\n\n# Final time\ntf = 10 # min\n# number of data points (1 pt e... | [
[
"matplotlib.pyplot.ion",
"numpy.zeros",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"numpy.ones",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.pause",... |
MrDredD/gan-gradient-visualisation | [
"6a4ad7b7689894efe8e3c9f0bb6c3b490da6201b"
] | [
"wgan-gp/models.py"
] | [
"# Import Modules\nimport torch\nimport torch.nn as nn\n\n\n# Generator Model Class\nclass Generator(nn.Module):\n def __init__(self, noise_channels, img_channels, features):\n super(Generator, self).__init__()\n self.net = nn.Sequential(\n self._block(noise_channels, features*16, 4, 1, ... | [
[
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.nn.ConvTranspose2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.init.normal_",
"torch.nn.InstanceNorm2d",
"torch.randn"
]
] |
jlln/GeneticKnapsack | [
"fed7578d25ae2c9d80d17e0dfaef5ee9b8bcb0ba"
] | [
"GeneticAlgorithms/test/IndividualSuite.py"
] | [
"import unittest\r\nimport numpy as np\r\nfrom src.KnapsackIndividual import KnapsackIndividual,KnapsackItem\r\n\r\nfrom src.FunctionOptimizerIndividual import FunctionMinimizer2DIndividual\r\n\r\nclass TestKnapsackIndividualMethods(unittest.TestCase):\r\n\r\n def setUp(self):\r\n self.items = list(set([(... | [
[
"numpy.random.randint",
"numpy.mean"
]
] |
b-riemann/cobea | [
"6b670358e0b1259732b8ffbc6f8ea4889aa7305d"
] | [
"testing/cobea_timing.py"
] | [
"from timeit import default_timer as timer\nfrom cobea import cobea, startvalue_layer, optimization_layer, pproc_layer\nfrom reference_tool import load_response\nfrom numpy import zeros, sum\n\n\ndef cobea_timing(response, trials):\n start = timer()\n for n in range(trials):\n result = cobea(response)\... | [
[
"numpy.sum",
"numpy.zeros"
]
] |
gentry-atkinson/tsar | [
"cb7ae0ef8e2d45169e6cdee7d941a08b694b6292"
] | [
"src/tsar_test.py"
] | [
"#Author: Gentry Atkinson\n#Organization: Texas University\n#Data: 10 December, 2020\n#Use tsar to test training on cleaned data\n\nimport sys\nimport os.path\nimport numpy as np\nfrom tsar import get_supervised_features, get_unsupervised_features, check_dataset, print_graph_for_instance_two_class, preprocess_raw_d... | [
[
"numpy.array",
"numpy.delete",
"numpy.genfromtxt",
"sklearn.manifold.TSNE",
"numpy.argmax",
"numpy.append",
"sklearn.model_selection.train_test_split",
"sklearn.svm.LinearSVC"
]
] |
RikusFourie/Image-Classifier-Project | [
"14a8de4628811260191d2393ed09f2b71fd42630"
] | [
"train.py"
] | [
"import matplotlib.pyplot as plt\nimport torch\nfrom torchvision import datasets, transforms, models\nfrom collections import OrderedDict\nfrom torch import nn\nfrom torch import optim\nimport torch.nn.functional as F\nimport time\nfrom workspace_utils import active_session\nimport numpy as np\nfrom PIL import Imag... | [
[
"torch.save"
]
] |
antongardi/abraia-multiple | [
"7c8a140bfc0d8eb08f4910486eccb08bcf534f50"
] | [
"multiple/hsi.py"
] | [
"import os\nimport spectral\nimport numpy as np\nimport scipy.ndimage as nd\nimport matplotlib.pyplot as plt\nfrom sklearn.utils import resample\nfrom sklearn.decomposition import PCA\nfrom PIL import Image\n\n\ncf = os.path.dirname(os.path.abspath(__file__))\n\ntry:\n BANDS_WLTH = np.array([463, 469, 478, 490, ... | [
[
"numpy.array",
"numpy.angle",
"numpy.zeros",
"numpy.absolute",
"scipy.ndimage.gaussian_filter",
"numpy.exp",
"numpy.where",
"scipy.ndimage.uniform_filter",
"numpy.random.randint",
"numpy.transpose",
"numpy.amax",
"numpy.amin",
"numpy.dstack",
"numpy.argmax",... |
manoreken2/FourPartHarmony2 | [
"01605dc00a0e53577f5f56d40e697f9414b6f52a"
] | [
"Learning/Predictor.py"
] | [
"#!/usr/bin/python\n# 日本語\n\n\nimport pickle\nfrom sklearn.svm import LinearSVC\nfrom sklearn.metrics import f1_score\n\nclass Predictor(object):\n def __init__(self):\n self.classifier = LinearSVC(C=1)\n\n def learn(self, X_train, y_train):\n self.classifier.fit(X_train, y_train)\n\n def pre... | [
[
"sklearn.svm.LinearSVC"
]
] |
pavelbrn/ml-classifier | [
"fe87558391fb15c06f57ac8937fd8cc45b1c7f9c"
] | [
"models/rf.py"
] | [
"'''\nCreates classification data and train a random forest model\n'''\n\n\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.datasets import make_classification\n\n\ndef load_data(num_samples, num_features):\n # create classification data and returns data \n # TODO add function argument for r... | [
[
"sklearn.ensemble.RandomForestClassifier",
"sklearn.datasets.make_classification"
]
] |
sshanuraj/facial_rec | [
"dcabbbe1be63dfae4a8d31e98cbda6db43d1154a"
] | [
"facial_rec.py"
] | [
"\r\nimport numpy as np\r\nimport cv2\r\nfrom nn import ANN\r\n\r\ndef init_train_data():\r\n X = []\r\n for i in range(12, 22):\r\n name = \"images/shubham\" + str(i) + \".jpg\"\r\n arr = cv2.imread(str(name)) # 640x480x3 array\r\n arr = np.reshape(arr,(1,480*640*3))/255\r\n X.app... | [
[
"numpy.array",
"numpy.amax",
"numpy.reshape"
]
] |
doyu/dlfs1 | [
"13fc400a6e810ec147f2e5934992556edda51c63"
] | [
"ch02/and_gate.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# coding: utf-8\nimport numpy as np\n\n\ndef AND(x1, x2):\n x = np.array([x1, x2])\n w = np.array([0.5, 0.5])\n b = -0.7\n tmp = np.sum(w*x) + b\n if tmp <= 0:\n return 0\n else:\n return 1\n\nif __name__ == '__main__':\n for xs in [(0, 0... | [
[
"numpy.sum",
"numpy.array"
]
] |
larry1995/U-Net-based-image-segmentation | [
"8a04de12bdf7ca324443072d37ebe6ee683cb12b"
] | [
"data.py"
] | [
"from __future__ import print_function\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\nimport numpy as np \nimport os\nimport glob\nimport skimage.io as io\nimport skimage.transform as trans\nfrom skimage import img_as_uint\nfrom skimage import img_as_ubyte\n\nfrom PIL import Image\nfrom skima... | [
[
"numpy.max",
"numpy.array",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"numpy.reshape",
"numpy.zeros",
"numpy.ma.masked_equal",
"numpy.ma.filled"
]
] |
manda-creator/datasets | [
"040bccda79b096dc428e66e7d0a6dece7b22b8eb"
] | [
"tensorflow_datasets/testing/starcraft.py"
] | [
"# coding=utf-8\n# Copyright 2019 The TensorFlow Datasets 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 ... | [
[
"tensorflow.compat.v2.train.Int64List",
"tensorflow.compat.v2.train.FeatureLists",
"tensorflow.compat.v2.train.Features",
"numpy.random.randint",
"tensorflow.compat.v2.io.TFRecordWriter",
"tensorflow.compat.v2.app.UsageError",
"tensorflow.compat.v2.train.FeatureList",
"tensorflow.c... |
jkaraguesian/NeuralForceField | [
"4ca4f4c7edc0ed1f70952db9e42d8ef9bbe109d8"
] | [
"tutorials/reactive/aRMSD/armsd/aRMSD.py"
] | [
"\"\"\"\r\naRMSD main routines\r\n(c) 2017 by Arne Wagner\r\n\"\"\"\r\n\r\n# Authors: Arne Wagner\r\n# License: MIT\r\n\r\n# IMPORTING ALL DEPENDENCIES HERE FIXES POTENTIAL PYINSTALLER ISSUES\r\nfrom __future__ import absolute_import\r\nfrom builtins import range, input\r\n\r\nimport acore as ac\r\nimport aplot as ... | [
[
"numpy.copy",
"numpy.hstack",
"numpy.arange",
"numpy.repeat",
"numpy.around",
"numpy.vstack"
]
] |
Fadope1/alpaca-SDK | [
"17a8eae0b261f88ed5700d6e828e746e2ae879b3"
] | [
"baseStrategy.py"
] | [
"import numpy as np\nimport requests\nimport talib\n\nclass stock_ins:\n BASE_URL = \"https://paper-api.alpaca.markets\"\n DATA_URL = \"https://data.alpaca.markets\"\n\n def __init__(self, stock_name, save_len, api_key, secret_key):\n self.stock_name = stock_name\n self.save_len = save_len\n ... | [
[
"numpy.array"
]
] |
asb219/pymc | [
"e1b90eb0590d216a2a1626d119e628f8ce9c71fc"
] | [
"pymc3/tests/test_ode.py"
] | [
"# Copyright 2020 The PyMC Developers\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 appli... | [
[
"numpy.concatenate",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.testing.assert_array_equal",
"numpy.exp",
"numpy.arange",
"numpy.ravel",
"numpy.linspace"
]
] |
lu-lab/mi-pi | [
"e78c1136643ac1d16cb999af83b4da65035dd16d"
] | [
"imageProcessing/image_processing.py"
] | [
"import cv2\nimport numpy as np\nimport threading\nimport queue\nimport io\nfrom kivy.logger import Logger\nimport time\n\nfrom statistics import mean\nfrom os.path import join\nfrom imageProcessing.CNN import CNN\n\nimport picamera\nimport picamera.array\n\n\ndef get_image_mask(img, imaging_parameters):\n\n img... | [
[
"numpy.any",
"numpy.sum",
"numpy.zeros",
"numpy.square"
]
] |
alt113/h-baselines | [
"67786876d7ee760477d5c5ccb0591fa90f6b7550"
] | [
"tests/fast_tests/test_replay_buffer.py"
] | [
"import unittest\nimport numpy as np\n\nfrom hbaselines.hiro.replay_buffer import ReplayBuffer, HierReplayBuffer\n\n\nclass TestReplayBuffer(unittest.TestCase):\n \"\"\"Tests for the ReplayBuffer object.\"\"\"\n\n def setUp(self):\n self.replay_buffer = ReplayBuffer(size=2)\n\n def tearDown(self):\n... | [
[
"numpy.testing.assert_array_almost_equal",
"numpy.array"
]
] |
chistopher/LAOG | [
"2dfdeb070aa38db3204131d7902caff825cc55b4"
] | [
"plot_metrics/plot.py"
] | [
"\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nfrom matplotlib.ticker import MaxNLocator, FuncFormatter, EngFormatter\nfrom statistics import mean, pstdev\nimport os.path\n\n\ndef plot(all_data, key_to_plot, directory=\".\", eng_fmt = False):\n list_of_n = sorted(all_data.keys())\n... | [
[
"matplotlib.use",
"matplotlib.ticker.EngFormatter",
"matplotlib.ticker.MaxNLocator",
"matplotlib.ticker.FuncFormatter",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.gca"
]
] |
ojus1/ludwig | [
"a5274f7d3f6763768b92318806e268f1b297116a",
"b9712572119ebe4d7a31e94641e189ee1bd462c1"
] | [
"ludwig/features/feature_utils.py",
"ludwig/utils/visualization_utils.py"
] | [
"#! /usr/bin/env python\n# coding=utf-8\n# Copyright (c) 2019 Uber 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/LICENS... | [
[
"numpy.array"
],
[
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.matshow",
"numpy.min",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.xticks",
"numpy.max",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
... |
gnibeil/pyscf | [
"aededeed48a2e2fada54d0cbd40afa1ae3f3389e"
] | [
"pyscf/dmrgscf/dmrgci.py"
] | [
"#!/usr/bin/env python\n# Copyright 2014-2019 The PySCF Developers. 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/LIC... | [
[
"numpy.asarray",
"numpy.zeros",
"numpy.reshape",
"numpy.identity",
"numpy.einsum",
"numpy.tril_indices",
"numpy.dtype"
]
] |
junyongyou/sca_iqa | [
"9353e3283c7513d859f38d66292dd408bdeaf2e7"
] | [
"src/image_quality/models/prediction_model_contrast_sensitivity.py"
] | [
"from tensorflow.keras.layers import GlobalAveragePooling2D, GlobalMaxPooling2D, Dense, Reshape, Average, \\\n multiply, Lambda, Conv2D, Concatenate\nfrom tensorflow.keras import backend as K\n\n\ndef channel_spatial_attention(input_feature, n_quality_levels, name, return_feature_map=False, return_features=False... | [
[
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Average",
"tensorflow.keras.layers.multiply",
"tensorflow.keras.backend.mean",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.layers.G... |
ashokdahal/RiskChangesDesktop | [
"e2ccd0c72f9199312c2d4d6ba36efd77aeff524c"
] | [
"RiskChangesDesktop/Exposure.py"
] | [
"import rasterio\nimport geopandas as gpd\nimport numpy\nimport os\nimport sys\nfrom osgeo import ogr\nfrom osgeo import gdal\nfrom osgeo import osr\nimport pandas as pd\nfrom rasterio.windows import Window\nfrom rasterio.windows import from_bounds\nfrom rasterio.mask import mask\nimport tqdm.notebook as tqdm\nimpo... | [
[
"numpy.logical_not",
"numpy.delete",
"numpy.asarray",
"pandas.DataFrame",
"numpy.ma.is_masked",
"numpy.where",
"numpy.ma.masked_array",
"numpy.unique"
]
] |
abhirajasp/CDCN | [
"b218247f4ac489a73ab8077f837a0e9e3ac57e67"
] | [
"FAS_challenge_CVPRW2020/Track2 Single-modal/model1_pytorch/Loadtemporal_BinaryMask_train.py"
] | [
"from __future__ import print_function, division\nimport os\nimport torch\nimport pandas as pd\n#from skimage import io, transform\nimport cv2\nimport numpy as np\nimport random\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms\nimport pdb\nimport math\nimport os \n... | [
[
"numpy.array",
"numpy.zeros",
"numpy.ones",
"torch.from_numpy",
"numpy.random.randint",
"numpy.clip",
"pandas.read_csv"
]
] |
TheJacksonLab/ECG_ActiveLearning | [
"131870c5804a022ee54274c9994663bb504c963e"
] | [
"ECGMOD/GPmodels.py"
] | [
"\"\"\"\n@author: gsivaraman@anl.gov\n\"\"\"\nimport gpytorch\nimport torch \n\nclass MultitaskGPModel(gpytorch.models.ExactGP):\n def __init__(self, train_x, train_y, likelihood,numy,kernel):\n super(MultitaskGPModel, self).__init__(train_x, train_y, likelihood)\n self.mean_module = gpytorch.means... | [
[
"torch.nn.Linear",
"sklearn.metrics.mean_squared_error",
"torch.no_grad",
"torch.from_numpy",
"torch.cuda.is_available",
"torch.nn.BatchNorm1d",
"numpy.sqrt",
"sklearn.metrics.r2_score",
"torch.nn.ELU"
]
] |
tu-dortmund-ls12-rt/end-to-end | [
"f9274da928da8a8e0d845a62173066f740840e48"
] | [
"utilities/generator_WATERS.py"
] | [
"\"\"\"Task set and cause-effect chain generation with WATERS benchmark.\n\nFrom the paper: 'Real world automotive benchmark for free' (WATERS 2015).\n\"\"\"\nfrom scipy import stats\nimport numpy as np\nimport random\nfrom scipy.stats import exponweib\nimport utilities.chain as c\n\n\n###\n# Task set generation.\n... | [
[
"scipy.stats.exponweib",
"numpy.random.shuffle",
"scipy.stats.rv_discrete",
"numpy.random.uniform",
"numpy.random.randint"
]
] |
mjsargent/cleanrl | [
"015522fba36beef5c87e1744ed17f65ce8dde46a"
] | [
"cleanrl/dqn_guided_levy_conditioned_minigrid.py"
] | [
"# https://github.com/facebookresearch/torchbeast/blob/master/torchbeast/core/environment.py\nimport numpy as np\nfrom collections import deque\nimport gym\nimport gym_minigrid\nfrom gym import spaces\nfrom gym_minigrid.wrappers import ImgObsWrapper, FullyObsWrapper\nimport cv2\ncv2.ocl.setUseOpenCL(False)\n\nclass... | [
[
"torch.nn.Linear",
"torch.cat",
"numpy.random.rand",
"torch.nn.init.constant",
"numpy.mean",
"numpy.sign",
"torch.cuda.is_available",
"torch.LongTensor",
"numpy.concatenate",
"torch.nn.MaxPool2d",
"torch.manual_seed",
"numpy.swapaxes",
"numpy.transpose",
"to... |
nsu-ai/ontonotes-5-parsing | [
"c1b1fd97e807cfb7a9b9b789f8039cc93868c74f"
] | [
"ontonotes5/utils.py"
] | [
"import codecs\nimport json\nimport os\nimport re\nfrom typing import Dict, Pattern, List, Tuple, Union\n\nfrom Levenshtein import distance\nfrom nltk import wordpunct_tokenize\nimport numpy as np\n\n\ndef tokenize_any_text(s: str) -> List[str]:\n re_for_cjk = re.compile(\n \"([\\uac00-\\ud7a3]+|[\\u3040-... | [
[
"numpy.zeros"
]
] |
mataach/adversarial_ml | [
"df3d91706abac8be313119eb1a02c1f37f26dc7a"
] | [
"model_quant/resnet_quant.py"
] | [
"'''\nresnet for cifar in pytorch\nReference:\n[1] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016.\n[2] K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. In ECCV, 2016.\n'''\n\nimport torch\nimport torch.nn as nn\nimport math\nfrom .q... | [
[
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
mpewsey/off_parser | [
"7649bfff6ed04167990679215633d4ab188a0d2c"
] | [
"off_parser/parser/off_parser.py"
] | [
"import csv\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d.art3d import Poly3DCollection\n\n__all__ = ['OffParser']\n\n\nclass OffParser():\n \"\"\"\n An object for parsing and storing data from OFF (Object File Format)\n files, which store 3D model data. See `wikipedia <ht... | [
[
"numpy.max",
"numpy.array",
"numpy.column_stack",
"matplotlib.pyplot.figure"
]
] |
salesforce/TransformerASR | [
"1de0c16573bc6f47c0b16d3f07af0f670db8f30f"
] | [
"espnet/asr/pytorch_backend/asr_dsl.py"
] | [
"#!/usr/bin/env python3\n# encoding: utf-8\n\n\"\"\"\nCopyright (c) 2021, salesforce.com, inc.\nAll rights reserved.\nSPDX-License-Identifier: BSD-3-Clause\nFor full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause\n\"\"\"\n\n# Copyright 2017 Johns Hopkins Universi... | [
[
"torch.distributed.get_world_size",
"torch.device",
"torch.is_tensor",
"torch.save",
"torch.no_grad",
"torch.from_numpy",
"torch.sum",
"torch.cuda.set_device",
"torch.cuda.is_available",
"numpy.random.randint",
"torch.tensor",
"torch.load",
"torch.distributed.ge... |
blackxer/AICamera | [
"4f0a6a09a2288da2ec7140744b5c2862df114c78",
"4f0a6a09a2288da2ec7140744b5c2862df114c78"
] | [
"AICamera/app/src/main/cpp/caffe2/python/operator_test/clip_op_test.py",
"AICamera/app/src/main/cpp/caffe2/python/operator_test/unique_ops_test.py"
] | [
"from __future__ import absolute_import\r\nfrom __future__ import division\r\nfrom __future__ import print_function\r\nfrom __future__ import unicode_literals\r\n\r\nimport numpy as np\r\n\r\nfrom hypothesis import given\r\nimport hypothesis.strategies as st\r\n\r\nfrom caffe2.python import core\r\nimport caffe2.py... | [
[
"numpy.sign",
"numpy.abs"
],
[
"numpy.sort",
"numpy.unique"
]
] |
jmalvinez/tensor2tensor | [
"2df12d5d2054178b18f6faabf7ebecd9a0177284"
] | [
"tensor2tensor/trax/rl/simple_test.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Tensor2Tensor 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 requir... | [
[
"numpy.full",
"numpy.array",
"tensorflow.io.gfile.GFile",
"numpy.zeros",
"numpy.testing.assert_array_equal",
"numpy.testing.assert_array_almost_equal",
"numpy.testing.assert_array_less",
"numpy.allclose",
"tensorflow.test.main"
]
] |
theBraindonor/adversarial-filters | [
"8500c1100e43d6b1bccd673230319c5ad0f53f94"
] | [
"utility/ExpectationOverTransformation.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n Expectation over Transformation scoring code.\n\"\"\"\n\n__author__ = \"John Hoff\"\n__email__ = \"john.hoff@braindonor.net\"\n__copyright__ = \"Copyright 2020, John Hoff\"\n__license__ = \"MIT License\"\n__version__ = \"1.0.0\"\n\n\nimport numpy as np\... | [
[
"numpy.max",
"numpy.array",
"numpy.log",
"numpy.mean",
"numpy.std",
"numpy.argmax"
]
] |
hongzhonglu/vivarium | [
"20f80f3ae317657c27a317b5093ea45d30355c05",
"20f80f3ae317657c27a317b5093ea45d30355c05"
] | [
"vivarium/processes/Kremling2007_transport.py",
"vivarium/parameters/parameters.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport os\nimport math\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.integrate import odeint\n\nfrom vivarium.compartment.process import Process\nfrom vivarium.utils.flux_conversion import millimolar_to_counts, counts_to_milli... | [
[
"scipy.integrate.odeint",
"numpy.zeros_like",
"matplotlib.pyplot.savefig",
"numpy.mean",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.GridSpec",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplot"
],
[
"numpy.array",
"matplotlib.pyplot... |
jlclemon/face-tracking-eye | [
"b8a3c4cf39fd1e40d8a2134b3c861855b76447b9"
] | [
"camera_test/main.py"
] | [
"from picamera import PiCamera\nfrom picamera.array import PiRGBArray\nimport time\nimport cv2\nimport numpy as np\nimport serial\nimport dlib\n\n\n\n \nclass Face_detector:\n def __init__(self, scale_factor, minNeighbors,cascade_path = cv2.data.haarcascades+'haarcascade_frontalface_default.xml'):\n pr... | [
[
"numpy.copy"
]
] |
chunyuema/jina | [
"e01e57df00deda8ea7bbda1f0a26ba25c60782a6",
"e01e57df00deda8ea7bbda1f0a26ba25c60782a6"
] | [
"jina/clients/sugary_io.py",
"jina/types/sets/document.py"
] | [
"\"\"\"A module for sugary API wrapper around the clients.\"\"\"\n__copyright__ = \"Copyright (c) 2020 Jina AI Limited. All rights reserved.\"\n__license__ = \"Apache-2.0\"\n\nimport csv\nimport glob\nimport itertools as it\nimport json\nimport os\nimport random\nfrom typing import List, Union, Iterator, Any, Itera... | [
[
"numpy.random.permutation"
],
[
"numpy.stack"
]
] |
IDLabResearch/seriesdistancematrix | [
"c0e666d036f24184511e766cee9fdfa55f41df97"
] | [
"distancematrix/tests/test_ostinato.py"
] | [
"from itertools import permutations\nfrom unittest import TestCase\n\nimport numpy as np\nimport numpy.testing as npt\n\nfrom distancematrix.generator import ZNormEuclidean\nfrom distancematrix.consumer import MatrixProfileLR\nfrom distancematrix.calculator import AnytimeCalculator\nfrom distancematrix.ostinato imp... | [
[
"numpy.array",
"numpy.argmin",
"numpy.testing.assert_equal",
"numpy.testing.assert_almost_equal",
"numpy.maximum"
]
] |
maciejwolczyk/garage-1 | [
"c78843115a51d63f86bca0f3518d8f68fb81bce3",
"c78843115a51d63f86bca0f3518d8f68fb81bce3"
] | [
"src/garage/torch/algos/vpg.py",
"tests/garage/torch/algos/test_bc.py"
] | [
"\"\"\"Vanilla Policy Gradient (REINFORCE).\"\"\"\nimport collections\nimport copy\n\nfrom dowel import tabular\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\n\nfrom garage import log_performance, TrajectoryBatch\nfrom garage.misc import tensor_utils as tu\nfrom garage.np.algos.rl_algorithm imp... | [
[
"torch.distributions.kl.kl_divergence",
"torch.no_grad",
"torch.nn.functional.softplus",
"numpy.mean"
],
[
"numpy.array"
]
] |
gaojiaxi/Coursera-Deep-Learning-deeplearning.ai | [
"75a2026f1241ec5e7d24583740dc2f9d4f307d41",
"75a2026f1241ec5e7d24583740dc2f9d4f307d41"
] | [
"05-Sequence Models/week3/Machine Translation/nmt_utils.py",
"02-Improving Deep Neural Networks Hyperparameter tuning, Regularization and Optimization/week1/gc_utils.py"
] | [
"import numpy as np\nfrom faker import Faker\nimport random\nfrom tqdm import tqdm\nfrom babel.dates import format_date\nfrom keras.utils import to_categorical\nimport keras.backend as K\nimport matplotlib.pyplot as plt\n\nfake = Faker()\nfake.seed(12345)\nrandom.seed(12345)\n\n# Define format of the data we would ... | [
[
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.argmax",
"matplotlib.pyplot.clf"
],
[
"numpy.concatenate",
"numpy.reshape",
"numpy.exp",
"numpy.maximum"
]
] |
lenbrocki/saliency | [
"a43d45fd38c12c9ceadc54c11df80ac2699843a7"
] | [
"saliency/tf1/base.py"
] | [
"# Copyright 2021 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli... | [
[
"numpy.max",
"numpy.random.normal",
"numpy.zeros_like",
"numpy.min"
]
] |
KooperAI/flower | [
"289090d2e2c4f76ec4976e7b14b7d047363b4f77"
] | [
"src/py/flwr/server/strategy/qffedavg.py"
] | [
"# Copyright 2020 Adap GmbH. 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 required by appli... | [
[
"numpy.square",
"numpy.float_power",
"numpy.append"
]
] |
data-sachez-2511/pl_classification | [
"637b85c58d723925ae4d3fce08db2842786c750a"
] | [
"src/losses/multilabel/assymetric_loss.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass AsymmetricLoss(nn.Module):\n def __init__(self, gamma_neg=4, gamma_pos=1, clip=0.05, eps=1e-8, disable_torch_grad_focal_loss=True):\n super(AsymmetricLoss, self).__init__()\n\n self.gamma_neg = gamma_neg\n self.gamma_pos = gamma_pos\n se... | [
[
"torch.nn.LogSoftmax",
"torch.sigmoid",
"torch.zeros_like",
"torch.exp",
"torch.set_grad_enabled",
"torch.pow"
]
] |
AkasDutta/veros | [
"9f530596a0148a398829050017de3e01a71261a0"
] | [
"test/pyom_consistency/tridiag_test.py"
] | [
"import pytest\nimport numpy as np\n\nfrom veros import runtime_settings\nfrom veros.pyom_compat import load_pyom\n\n\n@pytest.mark.skipif(runtime_settings.backend != \"jax\", reason=\"Must use JAX backend\")\n@pytest.mark.parametrize(\"use_ext\", [True, False])\ndef test_solve_tridiag_jax(pyom2_lib, use_ext):\n ... | [
[
"numpy.testing.assert_allclose",
"numpy.random.randn",
"numpy.random.randint",
"numpy.zeros"
]
] |
DavidSlayback/rl-parsers | [
"df33cd1814aaeac05b057330ccf742b3310f36df"
] | [
"tests/fsc/test_fsc.py"
] | [
"import unittest\n\nimport numpy as np\n\nfrom rl_parsers import FSC_Parser\n\n\nclass FSC_Test(unittest.TestCase):\n def test_tiger_optimal(self):\n parser = FSC_Parser(optimize=False)\n fsc = parser.parse_file('tests/fsc/tiger.optimal.fsc')\n\n self.assertListEqual(fsc.nodes, list(range(5)... | [
[
"numpy.array"
]
] |
fffasttime/cs_misc | [
"abff0dcaa840d07e2d948c50d9a9e53996c744fb"
] | [
"datam/dect.py"
] | [
"# a slow and poor decision tree\n\nimport numpy as np\nimport math\n\ndef infoEnpt(x):\n return -sum(map(lambda a:a*math.log2(a) if a else 0,x))\ndef infoEnpt2(x):\n if x==1 or x==0:\n return 0\n return -x*math.log2(x)-(1-x)*math.log2(1-x)\n\ndef gini(x):\n return 1-sum(map(lambda a:a*a,x))\ndef... | [
[
"numpy.array",
"numpy.ones",
"numpy.zeros"
]
] |
ThomasBury/scicomap | [
"959b2db38469f3b1c11bcf7e77a795acda300f67"
] | [
"scicomap/utils.py"
] | [
"import itertools\nimport numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\nfrom matplotlib.colors import ListedColormap\nfrom matplotlib.patches import Circle\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\nfrom os.path import dirname, join\n# inter... | [
[
"numpy.arccos",
"numpy.random.rand",
"numpy.exp",
"numpy.mean",
"numpy.cos",
"matplotlib.pyplot.colorbar",
"numpy.sin",
"numpy.angle",
"matplotlib.colors.CenteredNorm",
"numpy.random.randint",
"numpy.hypot",
"matplotlib.patches.Circle",
"matplotlib.pyplot.gca",
... |
zhangAlwin/tf_keras_models | [
"054c9e596325bcafd107c3f51abf018daab98a14"
] | [
"textcnn/model.py"
] | [
"# -*- coding: utf-8 -*-\n'''\n @CreateTime\t: 2021/12/07 12:43:25\n @Author\t: Alwin Zhang\n @Mail\t: zjfeng@homaytech.com\n'''\n\nimport tensorflow as tf\nfrom tensorflow.keras.layers import Embedding, Conv1D, GlobalAveragePooling1D, Dense, Concatenate, GlobalMaxPooling1D\nfrom tensorflow.keras import Model... | [
[
"tensorflow.keras.layers.Conv1D",
"tensorflow.keras.layers.GlobalMaxPooling1D",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Embedding",
"tensorflow.keras.Input",
"tensorflow.keras.layers.Concatenate"
]
] |
ksilo/LiuAlgoTrader | [
"90b3ffdf4fd61adf37880e7b01ca4137a013f79c"
] | [
"liualgotrader/trading/gemini.py"
] | [
"import asyncio\nimport base64\nimport hashlib\nimport hmac\nimport json\nimport os\nimport queue\nimport ssl\nimport time\nimport traceback\nfrom datetime import date, datetime, timedelta\nfrom threading import Thread\nfrom typing import Dict, List, Optional, Tuple\n\nimport pandas as pd\nimport requests\nimport w... | [
[
"pandas.Timestamp",
"pandas.date_range"
]
] |
ChenAo-Phys/netket | [
"df3735993962ca6318dee0b86a5d15a9d37c9881",
"df3735993962ca6318dee0b86a5d15a9d37c9881"
] | [
"netket/operator/local_liouvillian.py",
"netket/optimizer/numpy/stochastic_reconfiguration.py"
] | [
"from .abstract_operator import AbstractOperator\nfrom ..hilbert import DoubledHilbert\n\nimport numpy as _np\nfrom numba import jit\nfrom numba.typed import List\n\nimport numbers\n\n\nclass LocalLiouvillian(AbstractOperator):\n def __init__(self, ham, jump_ops=[]):\n self._H = ham\n self._jump_op... | [
[
"numpy.empty",
"numpy.zeros",
"numpy.copy",
"numpy.diff",
"numpy.conj"
],
[
"numpy.fill_diagonal",
"numpy.zeros",
"numpy.matmul",
"scipy.sparse.linalg.LinearOperator",
"scipy.linalg.lstsq",
"numpy.eye",
"numpy.atleast_1d",
"scipy.linalg.cho_solve",
"nump... |
snicholas/RandomForestDT | [
"f8fd1d181e27592f5b4d15c9906d250081b1fd02"
] | [
"utils.py"
] | [
"import matplotlib.pyplot as plt\nfrom matplotlib.colors import LinearSegmentedColormap, BoundaryNorm\nimport numpy as np\nfrom osgeo import gdal\n\ndef Setcmap(D, inv=1):\n cmap = plt.cm.jet\n cmaplist = [cmap(i) for i in range(cmap.N)]\n cmaplist[0] = (.0, .0, .0, 1.0)\n if inv:\n cmap = Linear... | [
[
"numpy.linalg.norm",
"matplotlib.pyplot.register_cmap",
"matplotlib.colors.BoundaryNorm",
"numpy.linspace",
"matplotlib.colors.LinearSegmentedColormap.from_list"
]
] |
napnel/UoA-thesis-s1260099 | [
"dce954b8795c24dc8fbbacb8b7ebdfe101fc01c6"
] | [
"src/envs/environment.py"
] | [
"import sys\nimport warnings\nfrom enum import IntEnum\nfrom math import copysign\nfrom typing import Callable, List, Optional\n\nimport gym\nimport numpy as np\nimport pandas as pd\nfrom gym import spaces\nfrom src.envs.actions import LongNeutralShort\nfrom src.envs.core import Order, Position, Trade\nfrom src.env... | [
[
"numpy.array",
"numpy.tile",
"numpy.append",
"numpy.hstack",
"numpy.vstack"
]
] |
muberraozmen/MrMP | [
"da6bcccbad85a682c848ff4aa1121c773d779e57"
] | [
"utils/metrics.py"
] | [
"from sklearn.metrics import accuracy_score, hamming_loss, f1_score\n\n__all__ = ['compute_metrics']\n\n\ndef compute_metrics(predictions, targets, totals, br_thresholds=None):\n\n targets = targets.cpu().numpy()\n predictions = predictions.cpu().numpy()\n loss = totals['loss']/len(predictions)\n bce = ... | [
[
"sklearn.metrics.hamming_loss",
"sklearn.metrics.f1_score",
"sklearn.metrics.accuracy_score"
]
] |
daturkel/zr-obp | [
"c870a20c3bb6f3a7d1b42bf1ebed01a5f2239aa6"
] | [
"examples/examples_with_obd/evaluate_off_policy_estimators.py"
] | [
"import argparse\nimport yaml\nfrom pathlib import Path\n\nimport numpy as np\nfrom pandas import DataFrame\nfrom joblib import Parallel, delayed\nfrom sklearn.experimental import enable_hist_gradient_boosting\nfrom sklearn.ensemble import HistGradientBoostingClassifier, RandomForestClassifier\nfrom sklearn.linear_... | [
[
"numpy.random.seed",
"pandas.DataFrame",
"numpy.arange",
"numpy.tile"
]
] |
delldu/EQFace | [
"a088e80709c1e31a57e302cabfa85ab96f2c0aa5"
] | [
"project/data.py"
] | [
"\"\"\"Data loader.\"\"\" # coding=utf-8\n#\n# /************************************************************************************\n# ***\n# *** Copyright Dell 2021, All Rights Reserved.\n# ***\n# *** File Author: Dell, 2021年 08月 05日 星期四 20:52:22 CST\n# ***\n# **********************************************... | [
[
"torch.utils.data.Subset",
"torch.cat",
"torch.utils.data.DataLoader",
"torch.utils.data.new_zeros"
]
] |
lockwo/quantum | [
"de57af9330ac7f5bf8298d202081c29fb2a956b8"
] | [
"tensorflow_quantum/core/ops/math_ops/simulate_mps.py"
] | [
"# Copyright 2020 The TensorFlow Quantum 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# Unl... | [
[
"tensorflow.cast"
]
] |
Benedict0819/pointrcnn_multiclass | [
"61781815920c0a5d44486ed25cf5bed805eb6b89"
] | [
"output/rcnn/default/backup_files/kitti_rcnn_dataset.py"
] | [
"import numpy as np\nimport os\nimport pickle\nimport torch\n\nfrom lib.datasets.kitti_dataset import KittiDataset\nimport lib.utils.kitti_utils as kitti_utils\nimport lib.utils.roipool3d.roipool3d_utils as roipool3d_utils\nfrom lib.config import cfg\n\n\nclass KittiRCNNDataset(KittiDataset):\n def __init__(self... | [
[
"numpy.random.choice",
"numpy.random.rand",
"numpy.copy",
"numpy.load",
"numpy.where",
"numpy.sign",
"numpy.concatenate",
"numpy.random.normal",
"numpy.linalg.norm",
"numpy.logical_and",
"numpy.nonzero",
"numpy.random.randint",
"numpy.arange",
"numpy.array",... |
puripant/pyvista | [
"3c539c1dcd0ff0207b09f24c273639fd912a5f83"
] | [
"pyvista/plotting/plotting.py"
] | [
"\"\"\"PyVista plotting module.\"\"\"\n\nimport platform\nimport ctypes\nimport sys\nimport pathlib\nimport collections.abc\nfrom typing import Sequence\nimport logging\nimport os\nimport textwrap\nimport time\nimport warnings\nimport weakref\nfrom functools import wraps\nfrom threading import Thread\nfrom typing i... | [
[
"numpy.max",
"numpy.array",
"numpy.isnan",
"numpy.sin",
"numpy.asarray",
"numpy.errstate",
"numpy.isclose",
"numpy.ascontiguousarray",
"numpy.round",
"numpy.min",
"numpy.nanmin",
"numpy.mean",
"numpy.linspace",
"numpy.any",
"numpy.cos",
"numpy.issubd... |
sariths/stadicViewer | [
"a8031bfd43ef5f1d91db66232442897fe9c5c004"
] | [
"StadicViewer/gui/timeSeries.py"
] | [
"\"\"\"This module enables the GUI, buttons and control logic for time-series based thermal plots.\"\"\"\n\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport bisect\nimport datetime\n\nfrom PyQt4 import QtGui\nfrom matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as Figure... | [
[
"matplotlib.figure.Figure",
"matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg",
"matplotlib.dates.DateFormatter",
"matplotlib.dates.MonthLocator"
]
] |
yangz10/TalkingData-AdTracking-Fraud-Detection | [
"274353280b136a635a74209f07abcf5e4d5f1c0a"
] | [
"script/main.py"
] | [
"import pandas as pd\nimport time\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nimport lightgbm as lgb\nimport gc\nimport matplotlib.pyplot as plt\nimport os\n\ndef do_count( df, group_cols, agg_name, agg_type='uint32', show_max=False, show_agg=True ):\n if show_agg:\n print( ... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.read_csv",
"matplotlib.pyplot.gcf"
]
] |
luis9614/CP_Basics | [
"2e27ed9b87e04d89e1c089921d5cae7c9ab16831"
] | [
"code/sieve.py"
] | [
"import numpy as np\nn=100\np = 2\nprimes = [True for i in range(n+1)] # All numbers are primes! At the beggining, at least!\nwhile(p*p <= n): #Search to the root of n\n if primes[p] == True: # if the current number is still marked as a prime, it is a prime\n for multiple in range(p * 2, n+1, p): # we get... | [
[
"numpy.sum",
"numpy.array"
]
] |
DBerke/DRAGONS | [
"cecf9a03970af95126bd17a227bd5214a5d6c64b"
] | [
"gempy/library/tests/test_tracing.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nTests for the :mod:`~gempy.library.tracing` module.\n\"\"\"\n\nimport numpy as np\nimport pytest\n\nfrom astropy.modeling import models\nfrom gempy.library import tracing\n\n\n@pytest.mark.parametrize(\"fwhm\", [2, 4, 6, 8, 12])\ndef test_estimate_peak_width(fwhm):\n n_peaks = 10\... | [
[
"numpy.testing.assert_allclose",
"numpy.zeros_like",
"numpy.ones_like",
"numpy.log",
"numpy.random.seed",
"numpy.exp",
"numpy.arange",
"numpy.random.random"
]
] |
BerlinUnited/NaoTH | [
"02848ac10c16a5349f1735da8122a64d601a5c75"
] | [
"Utils/py/ActionSelection/run_simulation_with_particleFilter.py"
] | [
"import math\nimport copy\nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom matplotlib.patches import Circle\nfrom tools import action as a\nfrom tools.action import Category\n\nfrom tools import Simulation as Sim\nfrom tools import potential_field as pf\nimport naoth.math as naoth_magic\nfrom tools i... | [
[
"numpy.min",
"numpy.radians",
"numpy.random.random",
"numpy.max",
"matplotlib.patches.Circle",
"numpy.append",
"matplotlib.pyplot.gca",
"numpy.array",
"numpy.zeros",
"numpy.std",
"numpy.arctan2",
"matplotlib.pyplot.show",
"matplotlib.pyplot.clf",
"numpy.sum"... |
abhiutd/pytorch-ssd | [
"9a72f9f3a07bcad74b2bdafecaa0f7f8b43ad8fc"
] | [
"vision/datasets/voc_dataset.py"
] | [
"import numpy as np\nimport pathlib\nimport xml.etree.ElementTree as ET\nimport cv2\n\n\nclass VOCDataset:\n\n def __init__(self, root, transform=None, target_transform=None, is_test=False, keep_difficult=False):\n \"\"\"Dataset for VOC data.\n Args:\n root: the root of the VOC2007 or VO... | [
[
"numpy.array"
]
] |
MBoustani/Geothon | [
"07a499d4ac0bb767677cd59b301022ad2ab16136"
] | [
"Conversion Tools/point_shp_to_geotiff.py"
] | [
"#!/usr/bin/env python\n\n'''\nProject: Geothon (https://github.com/MBoustani/Geothon)\nFile: Conversion Tools/point_shp_to_geotiff.py\nDescription: This code converts point Shapefile to GeoTIFF file.\nAuthor: Maziyar Boustani (github.com/MBoustani)\n'''\n\nimport numpy as np\n\ntry:\n im... | [
[
"numpy.abs",
"numpy.arange",
"numpy.zeros"
]
] |
brl0/dask | [
"df7f14b0b9da02c965a5a6da02de249531e06a7c"
] | [
"dask/base.py"
] | [
"import datetime\nimport inspect\nimport os\nimport pickle\nimport threading\nimport uuid\nfrom collections import OrderedDict\nfrom contextlib import contextmanager\nfrom dataclasses import fields, is_dataclass\nfrom functools import partial\nfrom hashlib import md5\nfrom numbers import Number\nfrom operator impor... | [
[
"numpy.asarray"
]
] |
JamesLim-sy/PaddleSeg | [
"f8cfb80f543a52599d1588026e71f069b702b781"
] | [
"contrib/PanopticDeepLab/utils/evaluation/semantic.py"
] | [
"# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless req... | [
[
"numpy.sum",
"numpy.zeros"
]
] |
geetickachauhan/lcgn | [
"167ef1dbd4d5471890e8540ee011075969bd3853"
] | [
"models_gqa/vis.py"
] | [
"import matplotlib; matplotlib.use('Agg') # NoQA\n\nimport os\nimport json\nimport skimage.io\nimport skimage.transform\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom .config import cfg\n\n\ndef _find_txt_segs(words, keep):\n segs = []\n current_seg = []\n for n, k in enumerate(keep):\n ... | [
[
"matplotlib.use",
"numpy.max",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"numpy.any",
"numpy.sort",... |
boyercb/g-net | [
"f51c16f48da00b9b86a94d6a1d9b69a003897d05"
] | [
"dvae/utils/loss.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nSoftware dvae-speech\nCopyright Inria\nYear 2020\nContact : xiaoyu.bie@inria.fr\nLicense agreement in LICENSE.txt\n\"\"\"\nimport torch\n\ndef loss_ISD(x, y):\n y = y + 1e-10\n ret = torch.sum( x/y - torch.log(x/y) - 1)\n return ret\n\ndef loss_KLD(... | [
[
"torch.norm",
"torch.log"
]
] |
rimon-safesitehq/polyaxon | [
"c456d5bec00b36d75feabdccffa45b2be9a6346e"
] | [
"core/tests/test_tracking/test_run_tracking.py"
] | [
"#!/usr/bin/python\n#\n# Copyright 2018-2021 Polyaxon, 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 requir... | [
[
"numpy.array",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"numpy.random.randn",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.fignum_exists",
"matplotlib.pyplot.figure",
"numpy.random.randint",
"matplotlib.pyplot.Circle",
"matplotlib.pyplot.tight_layout",
"matplot... |
Carayolj/NetworkAttackSimulator | [
"563fcca92543dc76dcd6850c7c4ad0950966dea9",
"563fcca92543dc76dcd6850c7c4ad0950966dea9"
] | [
"network_attack_simulator/envs/environment.py",
"network_attack_simulator/testDoormax.py"
] | [
"import numpy as np\nfrom network_attack_simulator.envs.network import Network\nfrom network_attack_simulator.envs.action import Action\nfrom network_attack_simulator.envs.state import State\nfrom network_attack_simulator.envs.render import Viewer\nimport network_attack_simulator.envs.loader as loader\nimport netwo... | [
[
"numpy.random.seed",
"numpy.random.rand"
],
[
"numpy.average",
"matplotlib.pyplot.show",
"numpy.cumsum",
"matplotlib.pyplot.figure"
]
] |
smile-care/utils-code | [
"41099a07a35df61c363a17e53fa2f2c7935ff84f"
] | [
"kmeans-anchor-boxes-master/anchor_extra.py"
] | [
"import pandas as pd\r\nimport os\r\nimport numpy as np\r\nimport csv\r\nimport re\r\nfrom kmeans import kmeans, avg_iou\r\n\r\ncsv_path = r'G:\\Deep_Learning\\kaggle\\global-wheat-detection\\dataset\\train.csv'\r\nCLUSTERS = 9\r\n\r\ndf = pd.read_csv(csv_path)\r\ndef process_bbox(df):\r\n ids = []\r\n values... | [
[
"numpy.array",
"pandas.read_csv",
"numpy.around",
"numpy.unique"
]
] |
ChristopherSD/dsr-minicomp | [
"5d19ef7ca4ec1d0700d504416be28583c93b8d2f"
] | [
"feature_engineering.py"
] | [
"import pandas as pd\nimport datetime as datetime\nimport numpy as np\nfrom dateutil.parser import parse\nfrom pathlib import Path\nfrom category_encoders.target_encoder import TargetEncoder\nfrom sklearn.preprocessing import OneHotEncoder\nfrom data_transformation import *\nimport tqdm\n\n\ndef generate_Competitio... | [
[
"pandas.to_datetime",
"numpy.sin",
"numpy.log",
"pandas.concat",
"numpy.cos",
"pandas.Series",
"sklearn.preprocessing.OneHotEncoder"
]
] |
SpiceGears/FRC-Robot-2021 | [
"2a5217ab0618fe9fb2aa72e167fb479f0cdbffe1"
] | [
"powercell_detection/power_cells_detecting.py"
] | [
"import cv2\nimport time\nimport numpy as np\nimport datetime\nimport logging\nimport json\nimport sys\n\nfrom networktables import NetworkTables\n\ndef nothing(something):\n pass\n\nnet = cv2.dnn.readNet(\"D:/Programowanie/Python/power_cells/power_cells_model/model.weights\",\n \"D:/Programowanie/Python/power_c... | [
[
"numpy.argmax"
]
] |
shchur/triangular-tpp | [
"19df15fb6f0701e0a2cb9f6afc8a5dfe87a80f40"
] | [
"ttpp/mmpp/utils.py"
] | [
"import matplotlib.pyplot as plt\nimport numbers\nimport numpy as np\nimport torch\nimport seaborn as sns\nsns.set_style('whitegrid', { 'axes.grid': False })\n\n\ndef plot_mmpp(events, states, durations, t_max):\n \"\"\"Plot MMPP observations + states of the latent MJP.\"\"\"\n\n plt.figure(figsize=[6, 2.5])\... | [
[
"matplotlib.pyplot.xlim",
"torch.eye",
"numpy.concatenate",
"torch.sigmoid",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.fill_between",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.gca",
"torch.zeros",
"numpy.array",
"matplotlib.pyplot.title",
"torch.lin... |
zt706/-mxnet_for_ssd | [
"cd1c21ffa30d8be6c7cb7909de8bec8a0fb7b71d"
] | [
"tests/python/unittest/test_ndarray.py"
] | [
"import os\nimport mxnet as mx\nimport numpy as np\nimport pickle as pkl\nfrom mxnet.test_utils import *\nfrom numpy.testing import assert_allclose\n\ndef check_with_uniform(uf, arg_shapes, dim=None, npuf=None, rmin=-10, type_list=[np.float32]):\n \"\"\"check function consistency with uniform random numbers\"\"\... | [
[
"numpy.concatenate",
"numpy.random.normal",
"numpy.square",
"numpy.dot",
"numpy.random.rand",
"numpy.zeros",
"numpy.random.seed",
"numpy.ones",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.arange",
"numpy.prod",
"numpy.sort"
]
] |
elangovana/object-tracking | [
"a9359ac3e3926102f9998eb20500746343e14826"
] | [
"src/models/faster_rcnn_factory.py"
] | [
"# *****************************************************************************\n# * Copyright 2019 Amazon.com, Inc. and its affiliates. All Rights Reserved. *\n# *\n# Licensed under the Amazon Software License (the \"License\"). ... | [
[
"torch.load"
]
] |
schen149/lasertagger | [
"3c4ecad69fa9c45f934f83a0db534490da702679"
] | [
"predict_main.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Google Research 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 requ... | [
[
"tensorflow.contrib.predictor.from_saved_model",
"tensorflow.gfile.Open"
]
] |
wong-ck/DeepSegment | [
"01c04b2d80355b97d3494e0073ba35ef9c98e546"
] | [
"utilities/io/reader.py"
] | [
"# Written by Chun Kit Wong and CIRC under MIT license:\n# https://github.com/wong-ck/DeepSegment/blob/master/LICENSE\n\nimport os\nimport sys\nimport random\n\nimport h5py\nimport numpy as np\nimport nibabel as nib\n\n# search for utilities module under root dir\nDIR_ROOT = os.path.join(os.path.dirname(__file__), ... | [
[
"numpy.array"
]
] |
innerlee/mmsegmentation | [
"f7a5d53a4b9860869dea07b2f3a7edb366feff89"
] | [
"mmseg/datasets/custom.py"
] | [
"import os\nimport os.path as osp\nfrom functools import reduce\n\nimport mmcv\nimport numpy as np\nfrom mmcv.utils import print_log\nfrom terminaltables import AsciiTable\nfrom torch.utils.data import Dataset\n\nfrom mmseg.core import eval_metrics\nfrom mmseg.utils import get_root_logger\nfrom .builder import DATA... | [
[
"numpy.round",
"numpy.nanmean",
"numpy.unique"
]
] |
jtaghia/MRGP | [
"92891dfb74e4322341ac3e7774d98eeb557ab215"
] | [
"scripts/tests/GPRBF_vs_ciMRGP_vs_fiMRGP.py"
] | [
"import numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import r2_score, mean_squared_error\n\nimport GPy\n\nfrom IndexSetGenerator import IndexSetUniform\nfrom KernelClass import LaplacianEigenpairs, MaternKernel\nfrom MRGP import MultiResolutionGaussianProcess\nfrom Basis... | [
[
"numpy.tan",
"numpy.min",
"numpy.mean",
"numpy.cos",
"sklearn.metrics.r2_score",
"numpy.random.random",
"matplotlib.pyplot.xticks",
"numpy.max",
"numpy.random.normal",
"numpy.sin",
"numpy.linalg.norm",
"numpy.log",
"matplotlib.pyplot.savefig",
"numpy.array",... |
MolSSI/dqm_compute | [
"c171e80c51afc5bc08ac8a84971b526fd33671d3"
] | [
"qcengine/programs/qchem.py"
] | [
"\"\"\"\nCalls the Q-Chem executable.\n\"\"\"\n\nimport os\nimport re\nimport tempfile\nimport warnings\nfrom collections import defaultdict\nfrom typing import Any, Dict, List, Optional, Tuple\n\nimport numpy as np\nfrom qcelemental import constants\nfrom qcelemental.models import AtomicInput, AtomicResult, Molecu... | [
[
"numpy.zeros",
"numpy.frombuffer"
]
] |
GracefulMan/drl | [
"b2b45ab961c873d8fe1272341a4750f2f124b9ea"
] | [
"elegantrl/AgentZoo/ElegantRL-MultiGPU/agent.py"
] | [
"import os\r\nimport torch\r\nimport numpy as np\r\nimport numpy.random as rd\r\nfrom copy import deepcopy\r\nfrom elegantrl.net import QNet, QNetDuel, QNetTwin, QNetTwinDuel\r\nfrom elegantrl.net import Actor, ActorSAC, ActorPPO\r\nfrom elegantrl.net import Critic, CriticAdv, CriticTwin\r\nfrom elegantrl.net impor... | [
[
"numpy.random.rand",
"numpy.random.choice",
"numpy.exp",
"torch.nn.SmoothL1Loss",
"torch.cuda.is_available",
"torch.load",
"numpy.random.normal",
"numpy.log",
"torch.nn.Softmax",
"numpy.tanh",
"torch.randint",
"torch.randn_like",
"numpy.random.randint",
"num... |
yoyoyoohh/SAR_build_extract_v2 | [
"7e2d21ead8e65b263d18d1059e5ce8ff2df4fbe6"
] | [
"mmseg/datasets/pipelines/loading_npy_pca.py"
] | [
"import os.path as osp\n\nimport mmcv\nimport numpy as np\n\nfrom ..builder import PIPELINES\n\n\n@PIPELINES.register_module()\nclass LoadNpyFromFilePCA(object):\n \"\"\"Load an image from file.\n\n Required keys are \"img_prefix\" and \"img_info\" (a dict that must contain the\n key \"filename\"). Added o... | [
[
"numpy.ones",
"numpy.load",
"numpy.zeros"
]
] |
kastnerkyle/kklib | [
"6e6c1dc7fc4f24f8c1017fdb6edaf27237165949"
] | [
"examples/char_rnn/sample_char_rnn.py"
] | [
"import torch\nimport numpy as np\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport argparse\nimport sys\n\nfrom kklib import get_saved_model_defs\nfrom kklib import get_saved_model_config\n\nuse_cuda = torch.cuda.is_available()\nif use_cuda:\n DEVICE = \"cuda\"\nelse:\n DEVICE = \... | [
[
"numpy.random.RandomState",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.load",
"torch.nn.functional.softmax"
]
] |
gillesdegottex/percival-tts | [
"b0cae5ff4fb58b9bc4964be8da5e5f9566abeec9"
] | [
"percivaltts/networktts.py"
] | [
"'''\nFunctions returning some outpout(s) given input(s), without extra objects created.\nIt is meant to be dedicated to TTS.\n\nCopyright(C) 2017 Engineering Department, University of Cambridge, UK.\n\nLicense\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file excep... | [
[
"tensorflow.keras.layers.Conv1D",
"tensorflow.keras.layers.Bidirectional",
"tensorflow.keras.backend.random_normal",
"tensorflow.keras.layers.CuDNNLSTM",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.backend.concatenate",
"tensorflow.keras.la... |
wx-b/lietorch | [
"0fa9ce8ffca86d985eca9e189a99690d6f3d4df6"
] | [
"lietorch/run_tests.py"
] | [
"import torch\nimport lietorch\n\nfrom lietorch import SO3, RxSO3, SE3, Sim3\nfrom gradcheck import gradcheck, get_analytical_jacobian\n\n\n### forward tests ###\n\ndef make_homogeneous(p):\n return torch.cat([p, torch.ones_like(p[...,:1])], dim=-1)\n\ndef matv(A, b):\n return torch.matmul(A, b[...,None])[...... | [
[
"torch.zeros",
"torch.rand",
"torch.cat",
"torch.eye",
"torch.ones_like",
"torch.zeros_like",
"torch.allclose",
"torch.matmul",
"torch.randn"
]
] |
pranoyr/Image-Recognition | [
"a6fced15c7711508d3fd6ba091b22f22f356d473"
] | [
"predict.py"
] | [
"import numpy as np\nimport os\nfrom scipy import misc\nfrom keras.models import model_from_json\nimport pickle\n\n# Loading int2word dict\nclassifier_f = open(\"int_to_word_out.pickle\", \"rb\")\nint_to_word_out = pickle.load(classifier_f)\nclassifier_f.close()\n\ndef load_model():\n \n # load json and crea... | [
[
"numpy.max",
"numpy.array",
"scipy.misc.imresize",
"scipy.misc.imread",
"numpy.argmax"
]
] |
ZhaofanQiu/Optimization-Planning-for-3D-ConvNets | [
"d9f1b777811ca0d8f462798ca2efcea39b96fcc5"
] | [
"model/c2d_vit.py"
] | [
"\"\"\"\nC2D-VIT: only change patch-embedding to tubelet-embedding\nThis implementation is based on https://github.com/rwightman/pytorch-image-models\nModified by Zhaofan Qiu\nzhaofanqiu@gmail.com\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport numpy as np\n\nfrom utils.vit_helpers import to_2tuple\n\nfrom .... | [
[
"numpy.reshape",
"torch.nn.Conv3d",
"numpy.zeros",
"torch.from_numpy"
]
] |
lorenzocerrone/ray-vs-multiprocessing | [
"f25ee0e9d13acf87d1a5de09cddc0f1a9d198122"
] | [
"plot_runtime.py"
] | [
"import h5py\nimport numpy as np\nimport time\nfrom mp_seg2mesh import sc_seg2mesh, mp_seg2mesh\nfrom ray_seg2mesh import ray_seg2mesh\nimport matplotlib.pyplot as plt\n\n\ndef make_runtime_plot(num_workers=(1, 2, 4), _step_size=1):\n\n timer = time.time()\n sc_seg2mesh(labels_idx, segmentation, step_size=_st... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"numpy.unique",
"matplotlib.pyplot.xticks"
]
] |
RenataDeLuna/HCAP2021 | [
"09c0d85a048ed669e06a852a5f87a087497e6498"
] | [
"convolucion.py"
] | [
"import numpy as np\nimport cv2\ndef convolucion(Ioriginal,Kernel):\n fr = len(Ioriginal) - (len(Kernel)-1)\n cr = len(Ioriginal[0]) - (len(Kernel[0])-1)\n Resultado = np.zeros((fr, cr),np.uint8)\n #For para recorrer las filas\n for i in range(len(Resultado)):\n #For para recorrer las columnas... | [
[
"numpy.array",
"numpy.zeros"
]
] |
kh1iu/vrl | [
"599caf942c3c5e1cbb131e17b83d54879742ec82"
] | [
"data/build_ravdess.py"
] | [
"import os\nimport glob\nimport math\nimport numpy as np\nimport pickle\nimport ipdb\nimport librosa\nimport librosa.display\nimport itertools\nimport scipy\nimport urllib.request\nimport zipfile\n\n\ndef build():\n \n data_dir = os.getenv('DATA_PATH')\n\n assert data_dir is not None\n\n data_path = os.... | [
[
"scipy.ndimage.zoom",
"numpy.pad",
"numpy.log",
"numpy.clip"
]
] |
4bian/pyroomacoustics | [
"a238bb04195eae87be8cb9c77e29cad83b5bcec3"
] | [
"pyroomacoustics/tests/tests_libroom/test_ray_energy.py"
] | [
"# Test of ray tracing energy\n# Copyright (C) 2019 Robin Scheibler, Cyril Cadoux\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitatio... | [
[
"numpy.allclose",
"numpy.array",
"numpy.sqrt"
]
] |
amollen/sfincs | [
"a529954fd36330e1b5c816612943f39829f3542f"
] | [
"fortran/version3/utils/ModelTest_AI/modelFunctions.py"
] | [
"#! \n# Description:\n#************* \n# Python script containing various functions used to calculate the sine and cosine parts of the perturbed \n# impurity density. All functions are based on the following paper\n# http://aip.scitation.org/doi/abs/10.1063/1.873593\n#\n# Created by: Aylwin Iantchenko (07-12-2017)... | [
[
"numpy.multiply"
]
] |
ahuard0/CIFAR10 | [
"f673a92db1d75b36fcbe9c6e71c995f3694ac1cb"
] | [
"DataLoader_TB.py"
] | [
"# -*- coding: utf-8 -*-\nr\"\"\"\nCreated on Mon Sep 6 19:55:13 2021\n\nTest Bench Function for the CIFAR10 dataloader.\n\nCIFAR-10 Dataset Implementation, Built from Scratch (Test Bench)\n CIFAR10 dataset downloaded locally to A:\\CIFAR\\cifar-10-batches-py\\\n from https://www.cs.toronto.edu/~kriz/cifar-1... | [
[
"torch.utils.data.DataLoader"
]
] |
SAGNIKMJR/move2hear-active-AV-separation | [
"3c6887aeb94b2a07983469bfd517ca277bd4124a"
] | [
"audio_separation/rl/ppo/ppo.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom audio_separation.rl.ppo.ddppo_utils import distributed_mean_and_var\n\nEPS_PPO = 1e-5\n\n\nclass PPO(nn.Module):\n def __init__(\n self,\n actor_critic,\n clip_param,\n ppo_epoch... | [
[
"torch.min",
"torch.nn.utils.clip_grad_norm_",
"torch.nn.functional.l1_loss",
"torch.max",
"torch.no_grad",
"torch.optim.Adam",
"torch.nn.parallel.DistributedDataParallel",
"torch.clamp",
"torch.cuda.is_available",
"torch.exp"
]
] |
mirzakhalov/fairseq | [
"8ca9a1a7d9fdd06a84c737c60af98cc0bf3d685c"
] | [
"fairseq/data/iterators.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport itertools\nimport logging\nimport math\nimport operator\nimport os\nimport queue\nimport time\nfrom threading import Thread\n... | [
[
"torch.utils.data.DataLoader",
"numpy.random.shuffle"
]
] |
brynemorgan/Dart_EnvGIS | [
"212143fe84438c41d7268223fbbaf19abd4d5e23"
] | [
"Week7-1_ImageProc.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#------------------------------------------------------------------------------\n__author__ = 'James T. Dietrich'\n__contact__ = 'james.t.dietrich@dartmouth.edu'\n__copyright__ = '(c) James Dietrich 2016'\n__license__ = 'MIT'\n__date__ = 'Wed Nov 16 11:33:39 2016'\n_... | [
[
"scipy.ndimage.laplace",
"scipy.ndimage.convolve",
"scipy.ndimage.minimum_filter",
"scipy.ndimage.imread",
"scipy.ndimage.rotate",
"scipy.misc.ascent",
"numpy.flipud",
"scipy.ndimage.sobel",
"numpy.hypot",
"scipy.ndimage.maximum_filter",
"scipy.misc.face",
"matplotl... |
Abhijit-21/ga-learner-dsmp-repo | [
"1da93b480573d031bfdf638b0df86a8a28015158"
] | [
"ML-High-Rated-Games-on-Google-Playstore/code.py"
] | [
"# --------------\n#Importing header files\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\ndata = pd.read_csv(path)\nplt.hist(data['Rating'].dropna(),bins=10)\nplt.xlabel('Rating of the Apps')\nplt.ylabel('Frequency')\nplt.title('Rating is more the five')\nplt.show()\n\ndata = data[d... | [
[
"pandas.to_datetime",
"sklearn.preprocessing.LabelEncoder",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"pandas.concat",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.xticks"
]
] |
ontocord/muliwai | [
"26f971e137e212c4a7a4237e2170ece171533629"
] | [
"process.py"
] | [
"\"\"\"\nCopyright, 2021-2022 Ontocord, LLC, All rights reserved.\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 http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicab... | [
[
"torch.cuda.current_device",
"torch.backends.cudnn.version",
"torch.cuda.device_count"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.