repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
BobbleMLTeam/DeepSpeech_Paddle | [
"d04525093eb40c801bb6bcfe7bf763366e2b221f"
] | [
"python/paddle/fluid/tests/unittests/test_imperative_resnet.py"
] | [
"# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.array",
"numpy.allclose",
"numpy.random.seed"
]
] |
ual/DOE-repo-deliverable | [
"4bafdd9a702a9a6466dd32ae62f440644d735d3c",
"4bafdd9a702a9a6466dd32ae62f440644d735d3c"
] | [
"bayarea_urbansim/data_regeneration/counties/cnc.py",
"activitysim/activitysim/core/random.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom spandex import TableLoader, TableFrame\nfrom spandex.io import df_to_db\nimport urbansim.sim.simulation as sim\n\nimport utils\n\n\nloader = TableLoader()\nstaging = loader.tables.staging\n\n\n## Assumptions.\n\n\n# Use codes were classified manually because the assess... | [
[
"pandas.concat",
"pandas.Series",
"pandas.DataFrame"
],
[
"pandas.concat",
"numpy.random.RandomState",
"pandas.DataFrame"
]
] |
sourcery-ai-bot/mljar-supervised | [
"f60f4ac65516ac759e4b84a198205480a56ada64"
] | [
"supervised/model_framework.py"
] | [
"import uuid\nimport numpy as np\nimport pandas as pd\nimport time\nimport zipfile\nimport os\nimport copy\nimport logging\nimport json\n\nfrom supervised.callbacks.callback_list import CallbackList\nfrom supervised.validation.validation_step import ValidationStep\nfrom supervised.algorithms.factory import Algorith... | [
[
"numpy.round",
"numpy.array",
"pandas.read_csv",
"numpy.random.seed"
]
] |
dbstein/flexmm | [
"82493b11c9f0629939d4fb5be0383eaf9dc3de56"
] | [
"examples/pure_kifmm_modified_helmholtz_gradient.py"
] | [
"from kifmm2d.scalar.fmm import FMM as KI_FMM\nfrom flexmm2d.misc.utils import random2\nimport numpy as np\nimport numba\nimport time\nimport os\nfrom function_generator import FunctionGenerator\nimport scipy.special\n\n\"\"\"\nDemonstration of the FMM for the Laplace Kernel\n\nIf N <= 50000, will do a direct sum a... | [
[
"numpy.abs",
"numpy.sqrt",
"numpy.cos",
"numpy.sin",
"numpy.row_stack",
"numpy.random.rand",
"numpy.repeat",
"numpy.array",
"numpy.zeros"
]
] |
HMUNACHI/Frozen-Lake-Reinforcement-Learning-Algorithms | [
"f308d063a35376c30db9422249c6de50b8f63f74"
] | [
"main.py"
] | [
"import environment_ljh as en_ljh\nfrom tabular import *\nimport numpy as np\n\n\n# =====================================\ndef testMovement(env):\n actions = ['w', 's', 'a', 'd'] # Numpad directions\n\n env.render()\n done = False\n while not done:\n c = input( '\\nMove: ')\n if c == 'q':... | [
[
"numpy.zeros",
"numpy.ones"
]
] |
sepideh-srj/flashNoflash | [
"8233e8bb03e5e696e5101584fa854476c33a7e60"
] | [
"depthmerge/models/pix2pix4depth_model.py"
] | [
"import torch\nfrom .base_model import BaseModel\nfrom . import networks\n\n\nclass Pix2Pix4DepthModel(BaseModel):\n \"\"\" This class implements the pix2pix model, for learning a mapping from input images to output images given paired data.\n\n The model training requires '--dataset_mode aligned' dataset.\n ... | [
[
"torch.min",
"torch.from_numpy",
"torch.max",
"torch.cat"
]
] |
gdmcbain/gdspy | [
"704610ae51edc729da4213a455a8286ef93a3f32"
] | [
"gdspy/operation.py"
] | [
"######################################################################\n# #\n# Copyright 2009 Lucas Heitzmann Gabrielli. #\n# This file is part of gdspy, distributed under the terms of the #\n# Boost Software License -... | [
[
"numpy.isscalar"
]
] |
zhiyun/ray | [
"99d0d96aeff5a6c0756e63562b2d61606c75c536"
] | [
"python/ray/rllib/evaluation/policy_evaluator.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport gym\nimport pickle\nimport tensorflow as tf\n\nimport ray\nfrom ray.rllib.models import ModelCatalog\nfrom ray.rllib.env.async_vector_env import AsyncVectorEnv\nfrom ray.rllib.env.atari_wrappers... | [
[
"tensorflow.variable_scope",
"tensorflow.Graph",
"tensorflow.GPUOptions"
]
] |
ignacio-gallego/tbcnn_skill_pill | [
"66c3939e2944160c864b61495ac4c7aaa56acd18"
] | [
"sets/generator/nopattern/output.py"
] | [
"import base64\nimport simplejson as json\nimport os\nimport pprint\nfrom io import BytesIO\n\nfrom IPython.core.display import display, HTML\nfrom matplotlib import pyplot as plt\n\nfrom optimus.infer import is_str\n\n\ndef output_image(fig, path):\n \"\"\"\n Output a png file\n :param fig:\n :param pa... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close"
]
] |
PokhodenkoSA/dpctl | [
"9b8644b167a2bc9d1067e5c0d13d3abef0bff82b"
] | [
"setup.py"
] | [
"# Data Parallel Control Library (dpctl)\n#\n# Copyright 2020-2021 Intel Corporation\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/lic... | [
[
"numpy.get_include"
]
] |
stheid/tensorforce | [
"c4cce421be650d7500125b793b59aaeb92ffdf51",
"c4cce421be650d7500125b793b59aaeb92ffdf51",
"c4cce421be650d7500125b793b59aaeb92ffdf51"
] | [
"tensorforce/core/networks/network.py",
"tensorforce/core/layers/layer.py",
"tensorforce/core/models/random.py"
] | [
"# Copyright 2018 Tensorforce Team. 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 b... | [
[
"tensorflow.stack"
],
[
"tensorflow.nn.bias_add",
"tensorflow.concat",
"tensorflow.control_dependencies",
"tensorflow.shape",
"tensorflow.math.reduce_max",
"tensorflow.maximum",
"tensorflow.squeeze",
"tensorflow.expand_dims",
"tensorflow.gather",
"tensorflow.math.eq... |
ndzamela/ga-learner-dsmp-repo | [
"7667fc0aec735bc1500359ea5272fcab1a6ca76d"
] | [
"Moving-to-Melbourne---Housing-Again/code.py"
] | [
"# --------------\nimport numpy as np\r\nimport pandas as pd\r\nfrom sklearn.model_selection import train_test_split\r\n\r\n# path- variable storing file path\r\ndf = pd.read_csv(path)\r\n\r\nprint(df.head())\r\n\r\nX= df.drop('Price', axis =1)\r\n\r\ny = df['Price']\r\n\r\nX_train, X_test, y_train, y_test = train_... | [
[
"pandas.read_csv",
"sklearn.metrics.r2_score",
"sklearn.model_selection.cross_val_score",
"sklearn.model_selection.train_test_split",
"sklearn.preprocessing.PolynomialFeatures",
"sklearn.linear_model.Lasso",
"sklearn.linear_model.Ridge",
"numpy.mean",
"sklearn.linear_model.Line... |
dung98pt/chemical_vae-branch | [
"a1d64ad9177902eff8903bf74f6c2cc1251ef333"
] | [
"chemvae/VAE.py"
] | [
"\"\"\"\nahihi do ngoc\nThis version of autoencoder is able to save weights and load weights for the\nencoder and decoder portions of the network\n\n\"\"\"\n\n# from gpu_utils import pick_gpu_lowest_memory\n# gpu_free_number = str(pick_gpu_lowest_memory())\n#\n# import os\n# os.environ['CUDA_VISIBLE_DEVICES'] = '{}... | [
[
"pandas.read_csv",
"tensorflow.ConfigProto",
"numpy.shape",
"tensorflow.split",
"numpy.array"
]
] |
ssoonan/keras-retinanet | [
"aa2254f3e4b6f7f789597d91f0874f797192e386"
] | [
"keras_retinanet/bin/train.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\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 ... | [
[
"tensorflow.ConfigProto",
"tensorflow.device",
"tensorflow.Session"
]
] |
PredectiveAI/desktopapp | [
"21f54ef6fff47060d396a48606b4dfbd6f0de489"
] | [
"storykey.py"
] | [
"from os import curdir\nfrom tkinter import *\nimport os\nimport tkinter.filedialog\nimport numpy as np\nfrom styleframe import StyleFrame, utils\nimport math\nimport pandas as pd\nimport numpy as np\n\nimport csv\nimport matplotlib\nfrom tkmagicgrid import *\nfrom PIL import ImageTk, Image\nfrom tkinter import ttk... | [
[
"pandas.read_excel",
"numpy.where"
]
] |
weka511/rsna | [
"3414137e8373d8e1614921e2e1f416aaec8abd82"
] | [
"consistent.py"
] | [
"# MIT License\n\n# Copyright (c) 2021 Simon Crase -- simon@greenweaves.nz\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rig... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.axes",
"numpy.sign",
"matplotlib.pyplot.close",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
Dashhh/tensorflow | [
"4ac9c09d5ca57a03b8daa5fb9e295947b1619854"
] | [
"tensorflow/python/ops/session_ops.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.python.util.compat.as_str_any",
"tensorflow.python.framework.ops.colocate_with",
"tensorflow.python.ops.array_ops.placeholder",
"tensorflow.python.ops.gen_data_flow_ops._get_session_handle",
"tensorflow.python.framework.ops.device",
"tensorflow.python.ops.gen_data_flow_ops._del... |
fearghus-moloco/probability | [
"deac4562cbc1056e6abebc7450218d38444fe65d",
"deac4562cbc1056e6abebc7450218d38444fe65d"
] | [
"tensorflow_probability/python/experimental/mcmc/initialization.py",
"tensorflow_probability/python/math/psd_kernels/psd_kernel_properties_test.py"
] | [
"# Copyright 2020 The TensorFlow Probability Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a... | [
[
"tensorflow.compat.v2.nest.map_structure",
"tensorflow.compat.v2.ones_like",
"tensorflow.compat.v2.size",
"tensorflow.compat.v2.name_scope",
"tensorflow.python.util.nest.map_structure_up_to",
"tensorflow.compat.v2.cast",
"tensorflow.compat.v2.math.is_finite",
"tensorflow.compat.v2.... |
sspasweden/pysim | [
"474e71933e7e639e9aff68844ae27e7c7ab5aa01"
] | [
"pysim/tests/input_ouput_test.py"
] | [
"\"\"\"This module contains tests for the setting and reading of inputs and outputs\n\"\"\"\nimport re\n\nimport pytest\nimport numpy as np\n\nfrom pysim.simulation import Sim\n\nimport pysim.cythonsystem\n\nfrom pysim.systems import Adder3D\nfrom pysim.systems import Adder\nfrom pysim.systems import VanDerPol\nfro... | [
[
"numpy.allclose",
"numpy.array_equal",
"numpy.all",
"numpy.array",
"numpy.zeros"
]
] |
unitedroguegg/carball | [
"4767f2c5d195b7d5d60e6a5575415262803acef7"
] | [
"carball/tests/tiles_test.py"
] | [
"import numpy as np\nfrom ..analysis.utils.split_location import LocationSplitManager, STANDARD_MIN_VALUES, STANDARD_MAX_VALUES\n\n\nclass Test_TileCreation():\n\n def test_location_split(self):\n split_manager = LocationSplitManager(3, np.array([7, 7, 5]), STANDARD_MIN_VALUES, STANDARD_MAX_VALUES)\n ... | [
[
"numpy.testing.assert_equal",
"numpy.array"
]
] |
luohaohao33/buidingdataluo | [
"cf5cc8edd6bf755988948c0da7873e432c8c3b08",
"cf5cc8edd6bf755988948c0da7873e432c8c3b08"
] | [
"lstm1.py",
"software2/util.py"
] | [
"import pandas as pd\nfrom datetime import datetime\nfrom matplotlib import pyplot\nfrom sklearn.preprocessing import LabelEncoder, MinMaxScaler\nfrom sklearn.metrics import mean_squared_error\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.layers import LSTM\nfrom numpy import conc... | [
[
"matplotlib.pyplot.legend",
"pandas.concat",
"pandas.read_csv",
"matplotlib.pyplot.title",
"pandas.DataFrame",
"sklearn.metrics.mean_squared_error",
"sklearn.preprocessing.LabelEncoder",
"matplotlib.pyplot.plot",
"numpy.concatenate",
"matplotlib.pyplot.show",
"sklearn.p... |
Lyken17/pytorch-faster-rcnn | [
"16bf971d769027ecefd4b86804e53fdeaf35c225"
] | [
"lib/nets/modules/utils.py"
] | [
"import numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.optim\n\n\ndef flat_entropy(n):\n\tprobs = np.array([1 / n] * n)\n\tlog_probs = np.log(probs)\n\tentropy = - np.sum(probs * log_probs)\n\treturn entropy\n\n\ndef modulo_n(val: int, n: int, bits: int):\n\tres = []\n\tfor i in range(1, bits + 1)... | [
[
"numpy.log",
"numpy.array",
"torch.transpose",
"numpy.sum"
]
] |
SkuaD01/scikit-learn | [
"bea07c0f02d79d7cc28d1903dcd72221a8dd5a4f"
] | [
"sklearn/preprocessing/tests/test_data.py"
] | [
"# Authors:\n#\n# Giorgio Patrini\n#\n# License: BSD 3 clause\n\nimport warnings\nimport itertools\n\nimport numpy as np\nimport numpy.linalg as la\nfrom scipy import sparse, stats\nfrom scipy.sparse import random as sparse_random\n\nimport pytest\n\nfrom sklearn.utils import gen_batches\n\nfrom sklearn.ut... | [
[
"sklearn.preprocessing.QuantileTransformer",
"sklearn.preprocessing.MaxAbsScaler",
"sklearn.utils._testing.assert_array_less",
"sklearn.utils._testing.assert_almost_equal",
"sklearn.preprocessing.MinMaxScaler",
"scipy.sparse.isspmatrix_csc",
"sklearn.utils._testing.assert_allclose",
... |
Daniil-Osokin/coremltools | [
"e960a957505fed2b1294605813c5117902895700"
] | [
"coremltools/converters/mil/frontend/tensorflow/test/test_load.py"
] | [
"# Copyright (c) 2020, Apple Inc. All rights reserved.\n#\n# Use of this source code is governed by a BSD-3-clause license that can be\n# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause\n\nimport numpy as np\nimport os\nimport six\nimport pytest\nimport shutil\nimport tempfile\ni... | [
[
"numpy.maximum"
]
] |
teodorToshkov/neuralquestiongenerator | [
"5b21cbb0f97efdf84fb3f39ff6a9876ca1bf5736"
] | [
"onmt/ModelConstructor.py"
] | [
"\"\"\"\nThis file is for models creation, which consults options\nand creates each encoder and decoder accordingly.\n\"\"\"\nimport torch.nn as nn\n\nimport onmt\nimport onmt.io\nimport onmt.Models\nimport onmt.modules\nfrom onmt.Models import NMTModel, MeanEncoder, RNNEncoder, \\\n StdRNNDe... | [
[
"torch.nn.LogSoftmax"
]
] |
tobecrazy/RaspberryMaterial | [
"d1bdb900881350b69f0a70ec97d19e8e048b00b1"
] | [
"opencv/opencv_example/findPartPictures.py"
] | [
"import cv2\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n# Read image\r\nimg = cv2.imread(\"../../images/limeng.jpeg\").astype(np.float32)\r\nH, W, C = img.shape\r\n\r\n# Read templete image\r\ntemp = cv2.imread(\"../../images/limeng_part.jpeg\").astype(np.float32)\r\nHt, Wt, Ct = temp.shape\r\n\... | [
[
"numpy.sum"
]
] |
tahsinac/ENEL645 | [
"4cd1d52f461368f272f7e4b82ec6c3392e24900b",
"4cd1d52f461368f272f7e4b82ec6c3392e24900b"
] | [
"SLURM/unet-segmentation/models.py",
"SLURM/unet-segmentation/utils.py"
] | [
"import tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import backend as K\n\n\n# TensorFLow\ndef dice_coef(y_true, y_pred):\n ''' Metric used for CNN training'''\n smooth = 1.0 #CNN dice coefficient smooth\n y_true_f = K.flatten(y_true)\n y_pred_f = K.flatten(y_pred)\n interse... | [
[
"tensorflow.keras.layers.Activation",
"tensorflow.keras.backend.sum",
"tensorflow.keras.layers.UpSampling2D",
"tensorflow.keras.layers.concatenate",
"tensorflow.keras.Model",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.backend.flatten",
"tensorflow.keras.layers.BatchNormali... |
elejke/doctr | [
"1d62d3f2b1e9a60560af0685fe882a69826503a7",
"1d62d3f2b1e9a60560af0685fe882a69826503a7"
] | [
"references/recognition/train_tensorflow.py",
"doctr/models/detection/predictor/pytorch.py"
] | [
"# Copyright (C) 2021, Mindee.\n\n# This program is licensed under the Apache License version 2.\n# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.\n\nimport os\n\nos.environ['USE_TF'] = '1'\nos.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"2\"\n\nimport datetime\nimport has... | [
[
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.keras.optimizers.Adam",
"tensorflow.GradientTape",
"tensorflow.config.experimental.set_memory_growth"
],
[
"torch.no_grad"
]
] |
saic-vul/cloud_transformers | [
"88943e8262af3e0a609fc63f09bec805b0a31f87"
] | [
"layers/v2v_groups.py"
] | [
"# Reference: https://github.com/dragonbook/V2V-PoseNet-pytorch\n\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass Basic3DBlock(nn.Module):\n def __init__(self, in_planes, out_planes, kernel_size, groups=1):\n super(Basic3DBlock, self).__init__()\n self.block = nn.Sequential(\n ... | [
[
"torch.nn.Sequential",
"torch.nn.functional.max_pool3d",
"torch.nn.ConvTranspose3d",
"torch.nn.Conv3d",
"torch.nn.functional.relu",
"torch.nn.ReLU",
"torch.nn.BatchNorm3d"
]
] |
Reslix/Lohbot | [
"4920c0d0fcda64ec7b6438dd848c789e4fd15cc4"
] | [
"jetson/deprecated/person.py"
] | [
"\"\"\"\nThis model is still ambiguous, but we want to identify individuals as well as their poses. We are most interested in\nour primary target's pose and location, of course. The\n\"\"\"\nimport cv2\nimport imutils\nfrom imutils.object_detection import non_max_suppression\nimport numpy as np\n\n\nclass PersonDet... | [
[
"numpy.array"
]
] |
ktzr/battleSnake | [
"68460c66f95ca8c2a20017a3121d27c4644e3ffc"
] | [
"gameboard.py"
] | [
"from typing import Dict\n\nimport numpy as np\n\nimport util\nfrom constants import PREDICTION_DEPTH, ENEMY_TAIL, MY_TAIL, ENEMY_NEXT_MOVE, FOOD, MY_BODY, ENEMY_BODY, ENEMY_HEAD, FREE_SPACE\nfrom util import get_pos, distance\n\n\nclass GameBoard:\n def __init__(self, data):\n self.data = data\n s... | [
[
"numpy.zeros"
]
] |
AI-Swasthyam/fixMyPose | [
"1b31c7f9e25ade6ee929cbbdc56d50162a8c2218",
"1b31c7f9e25ade6ee929cbbdc56d50162a8c2218"
] | [
"src_retrieval_hindi/speaker.py",
"src_retrieval/tok.py"
] | [
"import torch\nimport json\nimport os\nfrom torch.distributions import Categorical\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom model import Encoder\nfrom decoders import Decoder\nfrom tensorboardX import SummaryWriter\nfrom param import args\nimport numpy as np\nfrom evaluate import LangEvaluator\... | [
[
"torch.nn.CrossEntropyLoss",
"torch.max",
"torch.load"
],
[
"numpy.array"
]
] |
joshua-wx/openradartools | [
"b37724b2bd862772dbc0b0a55b694d1aadc0e3fa"
] | [
"openradartools/file.py"
] | [
"import os\nimport glob\nimport zipfile\nimport tempfile\nfrom datetime import datetime\n\n#Other libs\nimport h5py\nimport pandas\nimport pyart\nimport numpy as np\n\nimport openradartools as ort\n\ndef get_wavelength(h5_ffn):\n hfile = h5py.File(h5_ffn, 'r')\n global_how = hfile['how'].attrs\n return glo... | [
[
"numpy.argsort",
"numpy.ma.fix_invalid",
"numpy.array",
"pandas.read_csv"
]
] |
pdnooteboom/PO_res_error | [
"2c0e1f12203585e2ca3f9a5e686b4e8004052884",
"2c0e1f12203585e2ca3f9a5e686b4e8004052884"
] | [
"parcels/tests/test_scripts.py",
"low_spatial_res/atsf_cart_POP_smagorinski.py"
] | [
"from parcels import (FieldSet, ParticleSet, JITParticle, AdvectionRK4,\n plotTrajectoriesFile)\nfrom datetime import timedelta as delta\nimport numpy as np\nimport pytest\nfrom os import path\nfrom parcels.tools.loggers import logger\nimport sys\n\n\ndef create_outputfiles(dir):\n datafile =... | [
[
"numpy.linspace"
],
[
"numpy.arange",
"numpy.empty",
"numpy.ones",
"numpy.append",
"numpy.array",
"numpy.float"
]
] |
Kormap/Side-Projects | [
"9e61d5b062cc6823cfebc18370f7caae622ea571",
"9e61d5b062cc6823cfebc18370f7caae622ea571"
] | [
"Smart-Home-IoT-Platform/web_server/kospeech/utils.py",
"Smart-Home-IoT-Platform/web_server/kospeech/decode/ensemble.py"
] | [
"import sys\nimport logging\nimport torch\nimport platform\nfrom kospeech.data.label_loader import load_label\n\n\nclass Logger(object):\n \"\"\"\n Print log message in format.\n FORMAT: [%(asctime)s %(filename)s:%(lineno)s - %(funcName)s()] %(message)s\n \"\"\"\n def __init__(self):\n self.lo... | [
[
"torch.device",
"torch.cuda.device_count",
"torch.cuda.is_available",
"torch.cuda.get_device_name"
],
[
"torch.nn.Linear",
"torch.no_grad",
"torch.nn.ELU",
"torch.FloatTensor"
]
] |
ikoryakovskiy/bullet3 | [
"f4943c3ed5e6f3205055eeba2da6c20d3b777fc2",
"f4943c3ed5e6f3205055eeba2da6c20d3b777fc2"
] | [
"examples/pybullet/gym/minitaurGymEnvTest.py",
"examples/pybullet/gym/agents/simpleAgent.py"
] | [
"'''\nA test for minitaurGymEnv\n'''\n\nimport gym\nimport numpy as np\nimport math\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom envs.bullet.minitaurGymEnv import MinitaurGymEnv\nfrom agents import simpleAgent\n\ndef testSinePolicy():\n \"\"\"Tests sine policy\n \"\"\"\n np.random.seed(47)\n\n envir... | [
[
"tensorflow.Session",
"tensorflow.reset_default_graph",
"numpy.random.seed"
],
[
"tensorflow.train.Saver",
"tensorflow.expand_dims",
"tensorflow.placeholder",
"tensorflow.name_scope"
]
] |
kim-younghan/RandAugment3D | [
"5c977db1a7bd95c6858b64506d9c5b76eea434a5"
] | [
"PointNet/dataset.py"
] | [
"from __future__ import print_function\nimport torch.utils.data as data\nimport os\nimport os.path\nimport torch\nimport numpy as np\nimport sys\nfrom tqdm import tqdm \nimport json\nfrom plyfile import PlyData, PlyElement\nfrom PointNet.transform import preprocessing\nfrom torchvision.transforms import transforms\... | [
[
"numpy.unique",
"torch.from_numpy",
"numpy.cos",
"numpy.sin",
"numpy.random.normal",
"numpy.mean",
"numpy.random.uniform",
"numpy.array",
"numpy.sum",
"numpy.loadtxt"
]
] |
SthPhoenix/InsightFace-REST | [
"700402d1360af823ddbd6bdb60990fb0fa9fe387"
] | [
"src/api_trt/modules/processing.py"
] | [
"from typing import Dict, List, Optional, Union\nimport traceback\nimport io\nimport base64\nimport time\nimport os\nimport logging\nimport httpx\n\nimport numpy as np\nimport cv2\nfrom turbojpeg import TurboJPEG\n\nfrom .face_model import FaceAnalysis, Face\n\njpeg = TurboJPEG()\n\nheaders = {\n 'User-Agent': '... | [
[
"numpy.asarray",
"numpy.fromstring"
]
] |
mrakitin/scikit-beam | [
"89fe81486431b72df4dc497564867b9b3a26ee26",
"89fe81486431b72df4dc497564867b9b3a26ee26"
] | [
"skbeam/core/smoothing.py",
"doc/sphinxext/plot_generator.py"
] | [
"# ######################################################################\n# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #\n# National Laboratory. All rights reserved. #\n# #\n# Redistribution an... | [
[
"scipy.signal.fftconvolve",
"numpy.fliplr",
"numpy.arange",
"numpy.flipud",
"numpy.tile",
"numpy.linalg.pinv",
"numpy.repeat",
"numpy.zeros"
],
[
"matplotlib.use",
"matplotlib.pyplot.gcf",
"matplotlib.image.imread",
"matplotlib.pyplot.close",
"matplotlib.pyp... |
CTinRay/ADL-Final | [
"111029d66ddf5beba175efd5569cd986f4cea827"
] | [
"src/train.py"
] | [
"import logging\nhandler = logging.StreamHandler()\nformatter = logging.Formatter(\n '%(levelname).1s %(asctime)s [%(name)s] %(message)s', '%H:%M:%S'\n)\nhandler.setFormatter(formatter)\nlogging.basicConfig(level=logging.DEBUG, handlers=[handler])\nlogger = logging.getLogger(__name__)\n\nimport argparse\nimport ... | [
[
"numpy.max"
]
] |
climateengine/rio-tiler | [
"86635f5610c5d0b0486ba2a06d4d90ba2731436e"
] | [
"rio_tiler/mosaic/methods/base.py"
] | [
"\"\"\"rio-tiler.mosaic.methods abc class.\"\"\"\n\nimport abc\n\nimport numpy\n\n\nclass MosaicMethodBase(abc.ABC):\n \"\"\"Abstract base class for rio-tiler-mosaic methods objects.\"\"\"\n\n def __init__(self):\n \"\"\"Init backend.\"\"\"\n self.tile = None\n self.exit_when_filled = Fal... | [
[
"numpy.ma.is_masked"
]
] |
SamuelSandoval/openpilot | [
"9c60d8a7cb95adf81b3abcd839ae7427a7d2ac4f"
] | [
"tools/replay/ui.py"
] | [
"#!/usr/bin/env python3\nimport argparse\nimport os\nimport sys\n\nos.environ[\"OMP_NUM_THREADS\"] = \"1\"\n\nimport cv2 # pylint: disable=import-error\nimport numpy as np\nimport pygame # pylint: disable=import-error\n\nimport cereal.messaging as messaging\nfrom common.basedir import BASEDIR\nfrom selfdrive.conf... | [
[
"numpy.asarray",
"numpy.frombuffer",
"numpy.eye",
"numpy.zeros"
]
] |
jianboy/ServerManager | [
"da3e81c30591770927f2cbfe56797732a488446d"
] | [
"test/t2.py"
] | [
"import pandas as pd\n\nletter = ['B', 'A', 'C', 'D', 'A', 'C', 'D', 'A']\n\ndf = pd.Series(letter)\nct = df.value_counts()\nprint(ct.index)\nfor k, v in ct.items():\n # print(k, v)\n pass\nprint(\"B\", ct[\"B\"])\n\nprint(\"B\" in ct.index)\n"
] | [
[
"pandas.Series"
]
] |
cane11/scvi-tools | [
"c8b23393a2469516e360d7350391cbe8ed211f65",
"c8b23393a2469516e360d7350391cbe8ed211f65"
] | [
"tests/dataset/utils.py",
"scvi/model/base/_pyromixin.py"
] | [
"from typing import List, Optional\n\nimport torch\nfrom anndata import AnnData\n\nfrom scvi import REGISTRY_KEYS\nfrom scvi.data import AnnDataManager\nfrom scvi.data._constants import _MODEL_NAME_KEY, _SETUP_ARGS_KEY\nfrom scvi.data.fields import (\n CategoricalJointObsField,\n CategoricalObsField,\n Lay... | [
[
"torch.cuda.is_available"
],
[
"numpy.quantile",
"numpy.concatenate",
"torch.no_grad",
"numpy.array",
"numpy.isin"
]
] |
ColumbiaDVMM/Heated_Up_Softmax_Embedding | [
"cb62d28e5faaf7fdb134b31c461125e3fef50d06"
] | [
"dataset/car196.py"
] | [
"#!/usr/bin/python\n#-*- coding: utf-8 -*- \n#===========================================================\n# File Name: car196.py\n# Author: Xu Zhang, Columbia University\n# Creation Date: 09-07-2018\n# Last Modified: Fri Sep 7 14:48:41 2018\n#\n# Usage: python car196.py -h\n# Description:\n#\n# Copyright (... | [
[
"numpy.repeat",
"numpy.array",
"scipy.io.loadmat",
"numpy.save"
]
] |
dlee992/sdc | [
"1ebf55c00ef38dfbd401a70b3945e352a5a38b87"
] | [
"examples/series/series_notna.py"
] | [
"# *****************************************************************************\n# Copyright (c) 2020, Intel Corporation All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# Redistribut... | [
[
"pandas.Series"
]
] |
peterdors/hand_gesture_recognition | [
"714679dc03d35f7c2fc1dff0f9dbb74017567fe7"
] | [
"main.py"
] | [
"# Peter Dorsaneo\n\n# main.py\n# ========\n# Python script for simple hand gesture recognition. This doesn't necessarily \n# recognize if a hand is in the image or not. It is just for determining on \n# images of hands if they are holding either 0, 1, 2, 3, 4, or 5 fingers up. \n\n# USAGE: python main.py -i path/... | [
[
"numpy.array"
]
] |
tguillemLSST/eochar | [
"a1b924c9f65c7434b5d5d497fa6c2436abebfcce"
] | [
"notebooks/SigCor/Bot_SigCovFluxSflatAndBias.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# Study of signal cavariance between channels in raft \n# Goal : This Notebook will generate plots allowing to perform a diagnostic on the signal covariance between channels inside a raft in BOT data .\n# Author : P.Antilogus\n# Version : 21st January 2021 \n# New : Trying... | [
[
"numpy.diag",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.yticks",
"numpy.abs",
"numpy.min",
"numpy.median",
"numpy.max",
"matplotlib.pyplot.colorbar",
"numpy.std",
"numpy.mean",
"matplotlib.pyplot.close",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.xticks... |
christiandumasrobo/garage | [
"1c81210bd53dd3c968e0e67f0fe76a876ad47a21"
] | [
"src/garage/examples/tf/plot_run.py"
] | [
"import csv\nimport sys\nimport matplotlib.pyplot as plt\nfrom pandas import read_csv\nimport os\n\ndef plot_run(progress_file):\n total_episodes = 0\n episodes = []\n total_reward = 0\n rewards = []\n with open(progress_file, 'r') as csv_file:\n csv_data = read_csv(csv_file)\n first_ro... | [
[
"pandas.read_csv",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
dmacd/deep-neuroevolution | [
"47f98d4c71ea6be0c63b2ab78c0814da137800d2"
] | [
"multiplai/structural_plasticity/clique/eval.py"
] | [
"from typing import List, Optional, Tuple, Callable, Union\nimport mxnet as mx\nimport mxnet.ndarray as nd\nimport numpy as np\nfrom tqdm import tqdm\nfrom multiplai.structural_plasticity.clique import clique as c\n\nDEFAULT_RNG = np.random.RandomState(0)\n\n\n# generate M distinct random patterns with N clusters a... | [
[
"numpy.random.RandomState",
"numpy.cos",
"numpy.prod",
"numpy.sin"
]
] |
stfnrpplngr/IntracranialNeurophysDL | [
"4b7fa22823738d46f79779fb6ea11d33c5fa9d48"
] | [
"indl/lfads/lfads.py"
] | [
"import jax.numpy as np\nfrom jax import jit, random, vmap, grad, lax\nfrom jax.experimental import optimizers, stax\n\nimport indl.lfads.distributions as dists\nimport indl.lfads.utils as utils\nimport numpy as onp # original CPU-backed NumPy\n\n\ndef sigmoid(x):\n return 0.5 * (np.tanh(x / 2.) + 1)\n\n\ndef g... | [
[
"numpy.arange",
"sklearn.model_selection.train_test_split",
"numpy.mean",
"numpy.array",
"matplotlib.pyplot.show",
"numpy.random.randint"
]
] |
ethanmoyer/20200504_subsequence_matching | [
"751b2e4142123f3094c31ffe339e6cdf59dc97d2"
] | [
"SubseqCNNReg.py"
] | [
"import pandas as pd\nimport numpy as np\n\nimport tensorflow as tf\nfrom tensorflow.keras.callbacks import EarlyStopping\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Dense, Flatten, Conv1D, MaxPooling1D, Dropout, BatchNormalization\n\n\nfrom sklearn.model_selection import tr... | [
[
"matplotlib.pyplot.legend",
"pandas.Series",
"tensorflow.keras.layers.MaxPooling1D",
"sklearn.model_selection.KFold",
"sklearn.metrics.mean_squared_error",
"numpy.concatenate",
"matplotlib.pyplot.plot",
"pandas.DataFrame",
"tensorflow.keras.layers.Dropout",
"pandas.read_csv... |
ggzhang0071/PaDiM-Anomaly-Detection-Localization-master | [
"823404d45be078348328c7c6cd16e8ac11a51587"
] | [
"image_classification_model_training-master/loss/reverse_cross_entropy.py"
] | [
"import torch\nimport torch.nn as nn\n\nclass rev_cross_entropy(nn.Module):\n def __init__(self, class_num):\n super(rev_cross_entropy, self).__init__()\n self.class_num = class_num\n \n def forward(self, y_pred, y):\n batch_size = y.shape[0]\n ry = torch.ones(batch_size, self.c... | [
[
"torch.randint",
"torch.ones",
"torch.matmul",
"torch.log",
"torch.rand"
]
] |
calmisential/CRNN_TensorFlow2 | [
"87723ff90d79674d674282d2dadf5ff518d98b3d"
] | [
"test_on_single_picture.py"
] | [
"import tensorflow as tf\nfrom configuration import Config\nfrom core.crnn import CRNN\nfrom core.predict import predict_text\nfrom core.utils import get_num_classes_and_blank_index, index_to_char\n\n\ndef get_final_output_string(output, blank_index):\n decoded_text = tf.cast(x=output, dtype=tf.int32)\n decod... | [
[
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.cast",
"tensorflow.io.decode_image",
"tensorflow.expand_dims",
"tensorflow.image.resize",
"tensorflow.config.list_physical_devices",
"tensorflow.io.read_file"
]
] |
temibabs/MPHRL | [
"6fa458fe269f2040eee8a99ecbd0ccd5cff20779",
"6fa458fe269f2040eee8a99ecbd0ccd5cff20779"
] | [
"config_ppo_8pp.py",
"algorithms/pg.py"
] | [
"import socket\n\nimport numpy as np\nimport tensorflow as tf\n\n\ndef value(dict, k):\n for key in dict:\n if k == key or k in key:\n return dict[key]\n raise NotImplementedError\n\n\ndef n(c, seed):\n if c.env_type == 'mujoco':\n return 'rrw-%s-%s-bs=%s-c=%s-%s-up' \\\n ... | [
[
"numpy.array",
"numpy.ones"
],
[
"tensorflow.contrib.distributions.MultivariateNormalDiag"
]
] |
CuriBio/mantarray-desktop-app | [
"e00ace0e8c04eca3ae79826c59a878b59e15f6ff"
] | [
"tests/mc_comm/test_stimulation.py"
] | [
"# -*- coding: utf-8 -*-\nimport copy\nimport datetime\nfrom random import randint\n\nfrom freezegun import freeze_time\nfrom mantarray_desktop_app import create_data_packet\nfrom mantarray_desktop_app import handle_data_packets\nfrom mantarray_desktop_app import mc_simulator\nfrom mantarray_desktop_app import MICR... | [
[
"numpy.testing.assert_array_equal",
"numpy.array"
]
] |
yamacrypt/nfnets-keras | [
"6a4995b3f5da699e2ca2e7a99b2611ed65fce2d4"
] | [
"nfnets_keras/nfnet.py"
] | [
"\n\nimport tensorflow as tf\nfrom keras import backend as K\nfrom .nfnet_layers import WSConv2D, SqueezeExcite, StochasticDepth\n\n\ndef GLU(inputs):\n y = None\n if type(inputs) is list:\n x, g = inputs\n d_x = K.int_shape(x)[-1]\n d_g = K.int_shape(g)[-1]\n if d_g // 2 == d_x: y... | [
[
"tensorflow.nn.crelu",
"tensorflow.math.reduce_variance",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.activations.gelu",
"tensorflow.nn.softsign",
"tensorflow.keras.activations.relu",
"tensorflow.keras.activations.selu",
"tensorflow.keras.layers.AveragePooling2D",
"tens... |
SpirinEgor/HSE.optimization | [
"8af02f1a3763db68573bff60986840689847bd0c"
] | [
"assignment_2_3_4/optimizers/lasso_optimizer.py"
] | [
"from time import time\nfrom typing import List\n\nimport numpy\n\nfrom assignment_2_3_4.line_searches import AbstractLineSearch\nfrom assignment_2_3_4.optimizers import AbstractOptimizer, OptimizationStep\nfrom assignment_2_3_4.oracles import AbstractOracle\n\n\nclass LassoOptimizer(AbstractOptimizer):\n name: ... | [
[
"numpy.sign",
"numpy.abs"
]
] |
akloss/differentiable_filters | [
"7ae1f5022a9f5cf9485cb7748cadf0f0d65c01bd"
] | [
"differentiable_filters/paper_training_code/train.py"
] | [
"\"\"\"\nTraining and validation of a differentiable filter\n\"\"\"\n\n# this code only works with tensorflow 1\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\n\nimport numpy as np\nimport os\nimport time\nimport csv\nimport yaml\nfrom collections import OrderedDict\nimport sys\n\nfrom differentiable_... | [
[
"tensorflow.compat.v1.data.TFRecordDataset",
"tensorflow.compat.v1.math.is_finite",
"tensorflow.compat.v1.compat.v1.ConfigProto",
"tensorflow.compat.v1.no_op",
"tensorflow.compat.v1.train.Checkpoint",
"numpy.mean",
"tensorflow.compat.v1.compat.v1.initializers.global_variables",
"te... |
rodrigodelazcano/PettingZoo | [
"41fe43c7da2fd92fa8c6aa5a5a28083664092aa5",
"41fe43c7da2fd92fa8c6aa5a5a28083664092aa5"
] | [
"pettingzoo/magent/gather_v3.py",
"pettingzoo/classic/rlcard_envs/dou_dizhu.py"
] | [
"import math\nimport warnings\n\nimport magent\nimport numpy as np\nfrom gym.spaces import Box, Discrete\nfrom gym.utils import EzPickle\n\nfrom pettingzoo import AECEnv\nfrom pettingzoo.magent.render import Renderer\nfrom pettingzoo.utils import agent_selector\nfrom pettingzoo.utils.conversions import from_paralle... | [
[
"numpy.maximum",
"numpy.minimum"
],
[
"numpy.zeros"
]
] |
ANFANGERMI/Seq2Seq-chatbot | [
"15b9cbffdb08c42dd4ce07cb691d1167030caf67"
] | [
"train.py"
] | [
"from model import AlignModel, Seq2Seq, EncoderLSTM, Decoder\r\nfrom settings import batch_size, epochs, LOG_PATH\r\nfrom data_gen import train_iter, dev_iter, vocab\r\nfrom torch.utils.tensorboard import SummaryWriter\r\nfrom tqdm import tqdm\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.optim as optim\... | [
[
"torch.nn.CrossEntropyLoss",
"torch.max",
"torch.nn.init.constant_",
"torch.no_grad",
"torch.nn.init.normal_",
"torch.cuda.is_available",
"torch.device"
]
] |
reza-amd/jax | [
"62c7744e68c66fae9faf9d8d00fea8aad4418cf3"
] | [
"jax/experimental/jax2tf/shape_poly.py"
] | [
"# Copyright 2021 Google LLC\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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"tensorflow.math.floordiv",
"numpy.shape",
"numpy.prod",
"tensorflow.math.floormod"
]
] |
PennBBL/bids-on-flywheel | [
"23e423cc9f78e6fbac3a1fb054db6fade9657896"
] | [
"testing/test_tools.py"
] | [
"import os\nimport sys\nimport pytest\nimport warnings\nimport flywheel\nsys.path.append(\"..\")\nfrom flywheel_bids_tools import utils, query_bids, upload_bids\nfrom tqdm import tqdm\nimport pandas as pd\n\n'''\n==========={flywheel-bids-tools testing suite}===========\n============================================... | [
[
"pandas.api.types.infer_dtype",
"pandas.concat",
"pandas.merge"
]
] |
dexterurbane/SmartGridToolbox | [
"ff2eb98e28b0c0ea9690ec6f522ccf1c306f79b7"
] | [
"tests/plot_benchmark_matpower.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nfig = plt.figure()\nax = plt.gca()\n\nax.hold(True)\nax.set_yscale('log')\nax.set_xscale('log')\n\ndat = np.loadtxt('benchmark.txt', usecols=(1,2,3,4,5,6,7))\n\nn = dat[:, 0]\n\nok_mp = dat[:, 1]\nok_pol = dat[:, 2]\nok_rect = dat[:, 3]\n\nt_mp = dat[:, 4]\nt_... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.show",
"numpy.loadtxt",
"matplotlib.pyplot.figure"
]
] |
jody3t/ray | [
"6a78ba9752dc7f17b0e4b7423898c0facf777d3d"
] | [
"python/ray/tune/utils/util.py"
] | [
"import copy\nimport logging\nimport inspect\nimport threading\nimport time\nfrom collections import defaultdict, deque, Mapping, Sequence\nfrom threading import Thread\n\nimport numpy as np\nimport ray\nimport psutil\n\nlogger = logging.getLogger(__name__)\n\ntry:\n import GPUtil\nexcept ImportError:\n GPUti... | [
[
"numpy.zeros",
"numpy.mean"
]
] |
kdalkafoukis/quantum_computing | [
"713909d5f5e0ba1e7a0137ff3ed764ab82e83f2b"
] | [
"random_walks_on_the_cube.py"
] | [
"# https://en.wikipedia.org/wiki/Quantum_walk\n\n# author: Konstantinos Dalkafoukis\n# random walks on the cube\nfrom pyquil import get_qc, Program\nfrom pyquil.quil import DefGate\nfrom pyquil.gates import *\nfrom pyquil.api import WavefunctionSimulator\nimport numpy as np\nimport sys\n\n\ndef parseNumOfIterations... | [
[
"numpy.sqrt",
"numpy.identity",
"numpy.transpose",
"numpy.array",
"numpy.zeros"
]
] |
TatsuyaHaga/preplaymodel_codes | [
"548df9ef5f85358fb03ed5f7f4cdc9e03a04bbf3",
"548df9ef5f85358fb03ed5f7f4cdc9e03a04bbf3"
] | [
"Fig6_replay/secondrun/simRNN.py",
"Fig3_inhfeedback/2cell_separation_inhON/plot_activity.py"
] | [
"#!/usr/bin/env python3\n\nfrom shared_setting import *\nimport sys\nimport csv\nimport numpy\n\nthreshold=5.0\ndef sigmoid(x):\n return 1.0/(1.0+numpy.exp(-(x-threshold)))\n\n#parameters\nsave_pitch=10.0 #ms\nsave_pitch_weight=60.0*1000.0 #ms\n\netaEsom=1.0\netaEdnd=1.0\netaIdnd=1.0e-2*Ndndinh\nthetainh=0.5\n\n... | [
[
"numpy.hstack",
"numpy.eye",
"numpy.ones",
"numpy.zeros_like",
"numpy.mean",
"numpy.savetxt",
"numpy.outer",
"numpy.exp",
"numpy.zeros",
"numpy.loadtxt"
],
[
"numpy.loadtxt"
]
] |
octraits/music_recomend_using_face_emotions | [
"9142400c228c469a62c019447f547ae08a18a53b"
] | [
"utils/preprocessor.py"
] | [
"import numpy as np\nimport cv2\n\n# from scipy.misc import imread, imresize\n\n\ndef preprocess_input(x, v2=True):\n x = x.astype('float32')\n x = x / 255.0\n if v2:\n x = x - 0.5\n x = x * 2.0\n return x\n\ndef _imread(image_name):\n return cv2.imread(image_name)\n\ndef _imresize(... | [
[
"numpy.asarray",
"numpy.arange",
"numpy.zeros"
]
] |
glassnotes/NN_QTomo | [
"1af3861ab115e3ef2243843632c859e61026a758"
] | [
"src/quinton/tomoneuralnetwork.py"
] | [
"#!/usr/bin/python \n# -*- coding: utf-8 -*- \n# \n# tomonn.py: Class for the tomography neural network. \n# ... | [
[
"numpy.dot",
"numpy.eye",
"numpy.linalg.norm"
]
] |
troyliu0105/yolov3-tf2 | [
"cf5f5626d553de96dcb06d84f50bbdefd3bbffee"
] | [
"tools/export_tfserving.py"
] | [
"import time\n\nimport tensorflow as tf\nfrom absl import app, flags, logging\nfrom absl.flags import FLAGS\n\nfrom yolov3_tf2.dataset import transform_images\nfrom yolov3_tf2.models import (\n yolo_v3, yolo_v3_tiny\n)\n\nflags.DEFINE_string('weights', './checkpoints/yolov3.tf',\n 'path to wei... | [
[
"tensorflow.saved_model.save",
"tensorflow.expand_dims",
"tensorflow.saved_model.load"
]
] |
miguelvr/ignite | [
"11928a3b02eacaed1f312c225434195adf9e5082",
"fe3106399c58bf5eb8024ac359334f56978d5fc8"
] | [
"ignite/handlers/terminate_on_nan.py",
"tests/ignite/metrics/test_categorical_accuracy.py"
] | [
"import logging\nimport numbers\n\nimport torch\n\nfrom ignite._utils import apply_to_type\n\n\nclass TerminateOnNan(object):\n \"\"\"TerminateOnNan handler can be used to stop the training if the `process_function`'s output\n contains a NaN or infinite number or `torch.tensor`.\n The output can be of type... | [
[
"torch.isfinite",
"torch.tensor"
],
[
"torch.LongTensor",
"torch.eye",
"torch.ones",
"torch.zeros"
]
] |
piotr-rarus/evobench | [
"e3221e03b6cfac597b4cf2c3f725a266eaf7b083"
] | [
"evobench/continuous/cec2013lsgo/f15.py"
] | [
"import numpy as np\nfrom lazy import lazy\n\nfrom .cec2013lsgo import CEC2013LSGO\n\n\nclass F15(CEC2013LSGO):\n \"\"\"\n 7-nonseparable, 1-separable Shifted and Rotated Elliptic Function\n \"\"\"\n\n def __init__(\n self,\n *,\n rng_seed: int = 42,\n use_shuffle: bool = Fal... | [
[
"numpy.array",
"numpy.any"
]
] |
rebelosa/random-subgroups | [
"5fa795d0251e2d5dfac678729d091ddf5c34f82e"
] | [
"randomsubgroups/subgroup.py"
] | [
"import numpy as np\nfrom pysubgroup import ps\nfrom pysubgroup.subgroup_description import Conjunction\n\n\ndef encode_subgroup(decoded_subgroup):\n\n conjunction = []\n for attribute_name, cond in decoded_subgroup['conditions'].items():\n\n selector_type = cond['selector_type']\n if selector_t... | [
[
"numpy.array"
]
] |
PogChamper/torch2trt | [
"311f328cd45799ad8d72f1bebcc818d71c301f62"
] | [
"examples/contrib/quantization_aware_training/utils/utilities.py"
] | [
"import torch\nimport torch.nn as nn\nimport numpy as np\nimport collections\nfrom pytorch_quantization import tensor_quant\nfrom torch2trt.contrib.qat.layers.quant_conv import QuantConvBN2d,QuantConv2d,IQuantConv2d, IQuantConvBN2d\nfrom torch2trt.contrib.qat.layers.quant_activation import QuantReLU, IQuantReLU\nim... | [
[
"torch.nn.Sequential",
"torch.cuda.synchronize",
"torch.ones",
"torch.max",
"numpy.median",
"torch.nn.Conv2d",
"numpy.percentile",
"torch.tensor",
"torch.nn.Linear",
"numpy.std",
"numpy.mean",
"torch.no_grad",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"nu... |
kkonevets/deepmatcher | [
"6af3083ba200051075987b160e0b62505bce4768"
] | [
"deepmatcher/batch.py"
] | [
"from collections import namedtuple\n\nimport torch\n\nAttrTensor_ = namedtuple('AttrTensor', ['data', 'lengths', 'word_probs', 'pc'])\n\n\nclass AttrTensor(AttrTensor_):\n \"\"\"A wrapper around the batch tensor for a specific attribute.\n\n The purpose of having a wrapper around the tensor is to include att... | [
[
"torch.Tensor"
]
] |
wphicks/server | [
"84be5b1feb41d23a4630e254eae92ef55f8812cc"
] | [
"qa/common/infer_util.py"
] | [
"# Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n# notice, this list... | [
[
"numpy.array_equal",
"numpy.random.choice",
"numpy.asarray",
"numpy.dtype",
"numpy.ndarray.copy",
"numpy.iinfo",
"numpy.random.randint"
]
] |
o-kei/design-computing-aij | [
"954b46fb5f2192ab79fc003a2ca3a259e41dc7a4",
"954b46fb5f2192ab79fc003a2ca3a259e41dc7a4"
] | [
"ch5/truss_SQP.py",
"ch7_1/graph.py"
] | [
"import numpy as np\nimport csv\nfrom scipy import optimize\nimport matplotlib.pyplot as plt\nfilename = 'out3'\nwriter = csv.writer(open(filename + '.csv', 'w'))\nwriter.writerow(['step', 'F(A)[mm2]', 'A1[mm2]', 'A2[mm2]',\n 'sigma1[N/mm2]', 'sigma2[N/mm2]', 'U2[mm]'])\nE = 205000.0\nL = 2.0 * 1.0e... | [
[
"numpy.array",
"scipy.optimize.fmin_slsqp"
],
[
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
AnaCast97/Mens-Sprint_Data-Analysis | [
"39981f94a21fb11536d7f96bfb4d3686c500d904"
] | [
"main.py"
] | [
"#https://docs.google.com/document/d/1Y31Nt05peNIPwLo9O_TsTRAcy0GbDqGvRcHvJ4qtgzk/edit\r\n###################### Indíce ####################### \r\n#---- Instruções\r\n#---- Imports\r\n#---- Funções\r\n#---- Leitura de Ficheiros\r\n#---- Correcções à Base de Dados\r\n#---- Tabelas Descritivas\r\n# ---- Nrº Cicl... | [
[
"pandas.read_csv",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"pandas.NamedAgg",
"matplotlib.pyplot.pie",
"numpy.array",
"pandas.to_numeric"
]
] |
jshilong/PAA | [
"80bca60fa0302e43330b0a2850e89dd252e4579c"
] | [
"paa_core/layers/sigmoid_focal_loss.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.autograd import Function\nfrom torch.autograd.function import once_differentiable\n\nfrom paa_core import _C\n\n# TODO: Use JIT to replace CUDA implementation in the future.\nclass _SigmoidFocalLoss(Function):\n @staticmethod\n def forward(ctx, logits, targets, ... | [
[
"torch.sigmoid",
"torch.log",
"torch.arange"
]
] |
kiranscaria/structure_knowledge_distillation | [
"73a266fe44bc7fc3a110d3ed07dee2374ea953c6"
] | [
"try1/utils/psp_block.py"
] | [
"##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n## Created by: speedinghzl02\n## updated by: RainbowSecret\n## Microsoft Research\n## yuyua@microsoft.com\n## Copyright (c) 2018\n##\n## This source code is licensed under the MIT-style license found in the\n## LICENSE file in the root di... | [
[
"torch.nn.Sequential",
"torch.nn.Dropout2d",
"torch.cat",
"torch.randn",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
morefreeze/scrapy_projects | [
"033b071b8c809d0b26aa4357712970dcba2e4bc0"
] | [
"small/noticable_tpl/notice_dag.py"
] | [
"# coding: utf-8\nfrom os import path, environ\nfrom StringIO import StringIO\nfrom airflow import DAG\nfrom airflow.operators import BashOperator, BranchPythonOperator, PythonOperator, SlackAPIPostOperator\nfrom utils import period2timedelta, money2float\nfrom filter import Filter\nimport datetime\nimport pandas a... | [
[
"pandas.read_csv"
]
] |
minhngh/SegCaps | [
"99194da427d9a07a005b7e1de1bd8d539ee39732"
] | [
"capsnet.py"
] | [
"'''\nCapsules for Object Segmentation (SegCaps)\nOriginal Paper by Rodney LaLonde and Ulas Bagci (https://arxiv.org/abs/1804.04241)\nCode written by: Rodney LaLonde\nIf you use significant portions of this code or the ideas from our paper, please cite it :)\nIf you have any questions, please email me at lalonde@kn... | [
[
"tensorflow.keras.layers.Concatenate",
"tensorflow.norm",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Add",
"tensorflow.keras.backend.set_image_data_format",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Input"
]
] |
JacobDowns/filterpy | [
"abc0e32662a16ca854a5d37bac4eba1cbb9da41e"
] | [
"filterpy/kalman/tut/tut_normal.py"
] | [
"import numpy as np\n\nclass TutNormal(object):\n\n def __init__(self, u0, Pu):\n self.u0 = u0\n self.Pu = Pu\n\n\n def get_conditional(self, yo, Q):\n\n if np.isscalar(yo):\n yo = [yo]\n Q = np.atleast_2d(Q)\n m = 1\n else :\n m = len(yo... | [
[
"numpy.linalg.inv",
"numpy.atleast_2d",
"numpy.isscalar"
]
] |
ShantamShorewala/aizynthfinder | [
"6b15d5846558b14c4ce3c353727d9d676af7f6fb"
] | [
"tests/test_training.py"
] | [
"import os\n\nimport pytest\nimport pandas as pd\nimport numpy as np\nfrom scipy import sparse\n\nfrom aizynthfinder.training.utils import (\n Config,\n create_reactants_molecules,\n reverse_template,\n reaction_hash,\n split_and_save_data,\n smiles_to_fingerprint,\n is_sanitizable,\n reacti... | [
[
"pandas.read_csv",
"numpy.asarray",
"numpy.ones",
"numpy.load",
"numpy.zeros"
]
] |
JaturongKongmanee/semisup-adv | [
"474d549aa402b4cdd5e3629d23d035c31b60a360"
] | [
"autoaugment.py"
] | [
"\"\"\"\nAutoAugment implementation from https://github.com/DeepVoltaire/AutoAugment\n\"\"\"\n\nfrom PIL import Image, ImageEnhance, ImageOps\nimport numpy as np\nimport random\n\n# TODO: add credit\n\n\nclass ImageNetPolicy(object):\n \"\"\" Randomly choose one of the best 24 Sub-policies on ImageNet.\n\n ... | [
[
"numpy.linspace"
]
] |
paw-lu/pymc | [
"0a172c87e39ee64bf5101a5887281ad6548e6ea4"
] | [
"pymc/tests/test_model.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.log",
"numpy.array_equal",
"numpy.mod",
"numpy.arange",
"numpy.eye",
"numpy.ones",
"numpy.random.randn",
"numpy.ma.masked_values",
"numpy.testing.assert_allclose",
"numpy.random.binomial",
"numpy.array",
"numpy.zeros",
"numpy.random.RandomState"
]
] |
basicv8vc/Dive-into-DL-OneFlow | [
"8c8785e7642f27ca4f5d3ed59cccd7ef609ff84a"
] | [
"docs/chapter_linear-networks/utils.py"
] | [
"# encoding:utf-8\nfrom IPython import display\nimport time\nimport matplotlib.pyplot as plt\nimport oneflow as flow\nfrom oneflow.utils import data\nimport oneflow.utils.vision.transforms as transforms\nimport numpy as np\n\nrng = np.random.default_rng(123)\nflow.manual_seed(123)\n\nclass Timer:\n \"\"\"记录多次运行时... | [
[
"matplotlib.pyplot.gca",
"numpy.array",
"matplotlib.pyplot.subplots",
"numpy.random.default_rng"
]
] |
bmawji3/trading-assistant-public | [
"d2c299aaaae64302000d622036ec3f7884d48a7f"
] | [
"WebAPI/trading_assistant_app/app.py"
] | [
"import datetime as dt\nimport json\nimport os\nimport pandas as pd\nfrom sklearn import metrics\nfrom sklearn.ensemble import RandomForestClassifier\n\n# Statements with \".\" allows for relative path importing for WebApp and WebAPI\nfrom .ImportSecurities import *\nfrom .utils.aws_util import *\nfrom .utils.data_... | [
[
"pandas.concat",
"pandas.to_datetime",
"pandas.read_csv",
"pandas.merge",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.mean_absolute_error",
"pandas.DataFrame",
"sklearn.metrics.mean_squared_error",
"pandas.date_range"
]
] |
v-wewei/Relation-Shape-CNN | [
"04c114d6eaf981736721f0013dab4fc3c91ae05f"
] | [
"data/ShapeNetPartLoader.py"
] | [
"import os\nimport os.path\nimport torch\nimport json\nimport numpy as np\nimport sys\nimport torchvision.transforms as transforms\n\ndef pc_normalize(pc):\n l = pc.shape[0]\n centroid = np.mean(pc, axis=0)\n pc = pc - centroid\n m = np.max(np.sqrt(np.sum(pc**2, axis=1)))\n pc = pc / m\n return pc... | [
[
"torch.from_numpy",
"numpy.mean",
"numpy.array",
"numpy.sum",
"numpy.loadtxt"
]
] |
Arun-George-Zachariah/Hadamard-Matrix-for-hashing | [
"dbe25ffcc68a9542a4107fc7a0adc9682381c9dc"
] | [
"test.py"
] | [
"import numpy as np\nimport torchvision\nimport torch\nfrom options import parser\nfrom data_list import ImageList\nimport pre_process as prep\nfrom torch.autograd import Variable\n\n\ndef mean_average_precision(database_hash, test_hash, database_labels, test_labels, args): # R = 1000\n # binary the hash code\n... | [
[
"numpy.dot",
"torch.load",
"numpy.arange",
"torch.utils.data.DataLoader",
"numpy.cumsum",
"numpy.save",
"numpy.argsort",
"numpy.array",
"numpy.sum",
"numpy.float",
"torch.autograd.Variable"
]
] |
Orion34C/incubator-tvm | [
"27a02844cb52e883a4a66da68a527590d76f7d01"
] | [
"tests/python/unittest/test_runtime_rpc.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... | [
[
"numpy.random.uniform",
"numpy.ones",
"numpy.zeros",
"numpy.random.randint"
]
] |
lanl/scico | [
"976c9e5833f8f67eed2eaa43460d89fb09bb9f78"
] | [
"scico/test/test_denoiser.py"
] | [
"import numpy as np\n\nimport jax\n\nimport pytest\n\nfrom scico.denoiser import DnCNN, bm3d, bm4d, have_bm3d, have_bm4d\nfrom scico.random import randn\nfrom scico.test.osver import osx_ver_geq_than\n\n\n# bm3d is known to be broken on OSX 11.6.5. It may be broken on earlier versions too,\n# but this has not been ... | [
[
"numpy.testing.assert_allclose"
]
] |
shunsuke-sato/octopus | [
"dcf68a185cdb13708395546b1557ca46aed969f6"
] | [
"external_libs/spglib-1.9.9/python/spglib/spglib.py"
] | [
"# Copyright (C) 2015 Atsushi Togo\n# All rights reserved.\n#\n# This file is part of spglib.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# * Redistributions of source code must retain the above copyri... | [
[
"numpy.array",
"numpy.zeros",
"numpy.prod",
"numpy.transpose"
]
] |
modep-ai/automlbenchmark | [
"f7569d163cc079fc52176456f5f8c158c33f5b1e"
] | [
"frameworks/TunedRandomForest/exec.py"
] | [
"\"\"\"\nThis 'system' first determines the best value for `max_features` for the Random Forest,\nby trying up to 10 (uniformly distributed) values of 1..sqrt(p)...p. (p = number of features of the data).\nIt produces predictions based on a model trained with all of the data for the best found `max_features` value.... | [
[
"sklearn.model_selection.cross_val_score",
"sklearn.impute.SimpleImputer",
"sklearn.pipeline.Pipeline"
]
] |
zttofficial/neural-networks-and-deep-learning | [
"ac7b2eb1533422de80cf3680ec7e6718aac4c1eb"
] | [
"src/mnist_loader.py"
] | [
"\"\"\"\r\nmnist_loader\r\n~~~~~~~~~~~~\r\nA library to load the MNIST image data. For details of the data\r\nstructures that are returned, see the doc strings for ``load_data``\r\nand ``load_data_wrapper``. In practice, ``load_data_wrapper`` is the\r\nfunction usually called by our neural network code.\r\n\"\"\"... | [
[
"numpy.reshape",
"numpy.zeros"
]
] |
broadinstitute/deepometry | [
"8187133bb09e8a18d08151c779f48cc2e4976d06"
] | [
"tests/test_model.py"
] | [
"import csv\r\nimport os.path\r\n\r\nimport keras\r\nimport keras_resnet.models\r\nimport numpy\r\nimport pkg_resources\r\nimport pytest\r\n\r\nimport deepometry.image.iterator\r\nimport deepometry.model\r\n\r\n\r\n@pytest.fixture()\r\ndef data_dir(tmpdir):\r\n return tmpdir.mkdir(\"data\")\r\n\r\n\r\ndef test_i... | [
[
"numpy.random.seed",
"numpy.testing.assert_array_equal",
"numpy.random.randint",
"numpy.mean",
"numpy.empty",
"numpy.testing.assert_array_almost_equal"
]
] |
itrummer/WebChecker | [
"1cc9e1dcc2fff9dd25d13b51d5a182d127d0be2c"
] | [
"src/checker/rl.py"
] | [
"'''\nCreated on Jun 3, 2021\n\n@author: immanueltrummer\n'''\nimport checker.util\nimport gym\nimport numpy as np\nfrom gym import spaces \n\nclass TreeEnv(gym.Env):\n \"\"\" Environment for optimizing detection plans via search tree. \"\"\"\n \n def __init__(self, detector, nr_episodes, timeout_s, sta... | [
[
"numpy.zeros"
]
] |
skyatmoon/Detailed-Handwriting-detection | [
"1eb7ba8087290cbdd3fbc2c092fbdbc2b715fc9c"
] | [
"utilsCRAFT/box_util.py"
] | [
"# -*- coding: utf-8 -*-\r\n# @Author: Ruban\r\n# @License: Apache Licence\r\n# @File: box_util.py\r\n\r\nimport math\r\nimport numpy as np\r\n\r\n\r\ndef cal_slope(p1, p2):\r\n return (p2[1] - p1[1]) / (p2[0] - p1[0] + 1e-5)\r\n\r\n\r\ndef above_line(p, start_point, slope):\r\n y = (p[0] - start_point[0]) * ... | [
[
"numpy.min",
"numpy.int32",
"numpy.argmax",
"numpy.argmin",
"numpy.average",
"numpy.array",
"numpy.zeros"
]
] |
jamesanto/ray | [
"bc08c6cdcc7ddf4da751ca2a972defd3db509061"
] | [
"rllib/agents/dqn/dqn_tf_policy.py"
] | [
"\"\"\"TensorFlow policy class used for DQN\"\"\"\n\nfrom typing import Dict\n\nimport gym\nimport numpy as np\nimport ray\nfrom ray.rllib.agents.dqn.distributional_q_tf_model import \\\n DistributionalQTFModel\nfrom ray.rllib.agents.dqn.simple_q_tf_policy import TargetNetworkMixin\nfrom ray.rllib.models import ... | [
[
"numpy.ones_like"
]
] |
Steinbeck-Lab/DECIMER-Image_Transformer | [
"25262adda057e2a6c6d3a5438d4ae270935e130f"
] | [
"DECIMER/automl/efficientnetv2/hparams.py"
] | [
"# Copyright 2021 Google Research. 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... | [
[
"tensorflow.io.gfile.GFile"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.