repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
kuolunwang/DoorGym | [
"d9fbb67382756e659025b640857ede3a3735fb1d"
] | [
"a2c_ppo_acktr/envs.py"
] | [
"import os\nimport sys\n\nimport gym\nimport numpy as np\nimport torch\nfrom gym.spaces.box import Box\n\nfrom baselines import bench\nfrom baselines.common.atari_wrappers import make_atari, wrap_deepmind\nfrom baselines.common.vec_env.vec_env import \\\n VecEnvWrapper, VecEnv, CloudpickleWrapper, clear_mpi_env_... | [
[
"numpy.sqrt",
"torch.zeros",
"numpy.repeat",
"torch.from_numpy",
"numpy.prod",
"numpy.array",
"torch.device"
]
] |
jakubzadrozny/pixelnerf | [
"989894044a7943c34ac0b29f431fc211d5837fd8"
] | [
"src/model/custom_encoder.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom .. import util\n\n\nclass ConvEncoder(nn.Module):\n \"\"\"\n Basic, extremely simple convolutional encoder\n \"\"\"\n\n def __init__(\n self,\n dim_in=3,\n norm_layer=util.get_norm_layer(\"group\"),\n ... | [
[
"torch.nn.Conv2d",
"torch.nn.ConvTranspose2d",
"torch.nn.ReLU",
"torch.cat",
"torch.nn.LeakyReLU"
]
] |
pjuangph/sagan-pytorch | [
"b766f0c53184cfc02b4220329585a4d59bbfb2c7"
] | [
"model.py"
] | [
"import torch\r\n\r\nfrom torch import nn\r\nfrom torch.nn import init\r\nfrom torch.nn import functional as F\r\n\r\nimport functools\r\nfrom torch.autograd import Variable\r\n\r\n\r\ndef init_linear(linear):\r\n init.xavier_uniform_(linear.weight)\r\n linear.bias.data.zero_()\r\n\r\n\r\ndef init_conv(conv, ... | [
[
"torch.nn.BatchNorm2d",
"torch.nn.init.xavier_uniform_",
"torch.nn.Linear",
"torch.nn.functional.softmax",
"torch.no_grad",
"torch.tensor",
"torch.nn.Embedding",
"torch.nn.functional.relu",
"torch.nn.Conv1d",
"torch.nn.Conv2d",
"torch.tanh",
"torch.nn.functional.lea... |
messwith/phazes | [
"34b67292e6feaa95428fe68a5ceb29c9862e21d4"
] | [
"prototype_test.py"
] | [
"import numpy\nfrom prototype import Changer\n\n\ndef test_changer():\n changer = Changer(0.5, 1, 1)\n matrix = numpy.array([[0, 0, 0]])\n changer.change(matrix)\n assert matrix[0, 2] == 0\n changer.change(matrix)\n assert matrix[0, 2] == -1\n changer.change(matrix)\n assert matrix[0, 2] == ... | [
[
"numpy.array"
]
] |
d04943016/ColorScience | [
"b874d70c217249ec47a6017b47c5e3ca2008a6a8"
] | [
"Help/myNumericalIntegration.py"
] | [
"#!/usr/bin/env python3\r\n# Copyright (c) 2018 Wei-Kai Lee. All rights reserved\r\n\r\n# coding=utf-8\r\n# -*- coding: utf8 -*-\r\n\r\n\r\nimport numpy as np\r\n\r\ndef dx(x):\r\n return x[1:]-x[0:x.size-1]\r\ndef yave(y):\r\n xszie = y.shape[-1]\r\n return ( y[...,1::]+y[...,0:(xszie-1):] )/2\r\ndef myNu... | [
[
"numpy.sum",
"numpy.append",
"numpy.zeros",
"numpy.abs",
"numpy.array"
]
] |
shettyprithvi/scattertext | [
"a15613b6feef3ddc56c03aadb8e1e629d28a427d"
] | [
"scattertext/termscoring/CohensDCalculator.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom scipy.stats import norm\n\n\nclass CohensDCalculator(object):\n def get_cohens_d_df(self, cat_X, ncat_X, correction_method=None):\n empty_cat_X_smoothing_doc = np.zeros((1, cat_X.shape[1]))\n empty_ncat_X_smoothing_doc = np.zeros((1, ncat_X.shape[1]))\... | [
[
"numpy.vstack",
"scipy.stats.norm.sf",
"numpy.zeros",
"pandas.DataFrame",
"numpy.sqrt",
"numpy.square",
"numpy.array"
]
] |
holman57/Lafite | [
"9e5981a666cd2dcd3ff2a7f38229d6b8678ce6bb"
] | [
"train.py"
] | [
"\nimport os\nimport click\nimport re\nimport json\nimport tempfile\nimport torch\nimport dnnlib\n\nfrom training import training_loop\nfrom metrics import metric_main\nfrom torch_utils import training_stats\nfrom torch_utils import custom_ops\n\n#--------------------------------------------------------------------... | [
[
"torch.distributed.init_process_group",
"torch.multiprocessing.set_start_method",
"torch.device",
"torch.multiprocessing.spawn"
]
] |
organic-chemistry/repli1D | [
"1cef3aa3ffd760f9b88d0831bf1dce92c819c949"
] | [
"src/repli1d/nn.py"
] | [
"import os\n\nimport numpy as np\nimport pandas as pd\n\nfrom repli1d.analyse_RFD import nan_polate, smooth\n\n\ndef normal_seq(signal, q=99, output_path='../data/'):\n \"\"\"\n normalization function that transforms each fature in range (0,1)\n and outputs the minimum and maximum of features in a csv file... | [
[
"numpy.sum",
"numpy.multiply",
"numpy.zeros",
"pandas.read_csv",
"pandas.DataFrame",
"numpy.abs",
"numpy.ones_like",
"numpy.hstack",
"numpy.max",
"numpy.min",
"numpy.random.rand",
"numpy.isnan",
"numpy.array",
"numpy.std",
"numpy.concatenate",
"numpy... |
koudyk/netneurotools | [
"7631cf8303f1a754dd4df0f209ce4cea50417714"
] | [
"netneurotools/networks.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nFunctions for generating group-level networks from individual measurements\n\"\"\"\n\nimport numpy as np\nfrom scipy.sparse import csgraph\nfrom sklearn.utils.validation import (check_random_state, check_array,\n check_consistent_length)\n\nfrom... | [
[
"numpy.sum",
"numpy.logical_or",
"sklearn.utils.validation.check_consistent_length",
"numpy.append",
"sklearn.utils.validation.check_random_state",
"numpy.logical_and",
"numpy.nonzero",
"numpy.unique",
"numpy.mean",
"numpy.corrcoef",
"numpy.round",
"numpy.triu_indic... |
dankiy/2019_IT | [
"21afdc44913dccf6746879fd075d20098db599cb"
] | [
"task4.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport math\nnp.random.seed(0)\n\nM, N = 10, 5\n\ndef is_pareto_efficient(X):\n is_efficient = np.ones(len(X), dtype = bool)\n for i, c in enumerate(X):\n if is_efficient[i]:\n is_efficient[is_efficient] = np.any(X[is_efficient] > c, axis... | [
[
"numpy.append",
"numpy.any",
"numpy.random.seed",
"numpy.arange",
"matplotlib.pyplot.subplot",
"numpy.random.sample"
]
] |
paulgowdy/l2m | [
"c1eb190a9117c249094c2ee8af74f7ee1b6e655f"
] | [
"collect_experience_2.py"
] | [
"from osim.env import L2M2019Env\nfrom osim.control.osim_loco_reflex_song2019 import OsimReflexCtrl\nimport numpy as np\nimport pickle\n\nmode = '2D'\ndifficulty = 1\nvisualize=False\nseed=None\nsim_dt = 0.01\nsim_t = 5\ntimstep_limit = int(round(sim_t/sim_dt))\n\n\nINIT_POSE = np.array([\n 1.699999999999999956e... | [
[
"numpy.array",
"numpy.loadtxt"
]
] |
Aerochip7/gan | [
"d3648c0f3996bd9e5564c05a44ff4215e5156cbd"
] | [
"tensorflow_gan/examples/mnist/conditional_eval.py"
] | [
"# coding=utf-8\n# Copyright 2022 The TensorFlow GAN 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 requi... | [
[
"tensorflow.compat.v1.disable_v2_behavior"
]
] |
fmitch/incubator-tvm | [
"67e3f437af90724a5af0bff67d033d47c8a2edf7"
] | [
"experiments/dv_search_matmul.py"
] | [
"import logging\nimport time\nimport sys\nimport os\nimport numpy as np\nfrom multiprocessing import Pool, cpu_count\nimport random\nimport string\nfrom tensors import *\n\nimport pickle\n\nimport tvm\nimport topi\nfrom topi.testing import conv2d_nchw_python\nfrom tvm import te\nfrom tvm import autotvm\nfrom tvm.au... | [
[
"numpy.random.uniform",
"numpy.ceil",
"numpy.zeros",
"numpy.floor",
"numpy.array"
]
] |
LeeElvis/OpenMDAO | [
"0ef1f0eeb934d8cd4ef0a02add6ba3c3a13e6150"
] | [
"openmdao/solvers/linear/tests/test_linear_block_gs.py"
] | [
"\"\"\"Test the LinearBlockGS linear solver class.\"\"\"\n\nimport unittest\n\nimport numpy as np\n\nimport openmdao.api as om\nfrom openmdao.solvers.linear.tests.linear_test_base import LinearSolverTests\nfrom openmdao.test_suite.components.sellar import SellarImplicitDis1, SellarImplicitDis2, \\\n SellarDis1wi... | [
[
"numpy.array"
]
] |
STScI-MIRI/miricoord | [
"d378c24f4b8d649fb15d557c6350ab5070afba66"
] | [
"miricoord/lrs/lrs_pipetools.py"
] | [
"#\n\"\"\"\nUseful python tools for working with the MIRI LRS; calls a specific version\nof the tools specified below.\n\nThis version of the tools hooks into the JWST Calibration\nPipeline code to do the heavy lifting. Note that this\nmeans performance may be affected by what version of\nthe pipeline you are runn... | [
[
"numpy.testing.assert_allclose"
]
] |
lylhw13/thread-pool | [
"e982392728dfabd50f5549e932b1b90f772d8d31"
] | [
"test/plot.py"
] | [
"str = '''\njobnum is 1, thread_num is 2\njobnum is 10, thread_num is 3\njobnum is 9, thread_num is 3\njobnum is 8, thread_num is 3\njobnum is 7, thread_num is 3\njobnum is 6, thread_num is 3\njobnum is 15, thread_num is 6\njobnum is 14, thread_num is 6\njobnum is 13, thread_num is 6\njobnum is 12, thread_num is 6\... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
cmougan/Novartis2020 | [
"390f34efa6bbc1e168f4e58d2d335c7cfa7d865e"
] | [
"pre-datathon/models/basic_mae_cb.py"
] | [
"\n\nimport numpy as np\nfrom catboost import CatBoostRegressor\nfrom sklearn.datasets import load_boston\nfrom sklearn.metrics import mean_absolute_error\n\nfrom tools.catboost_custom import MaeObjective\n\nnp.random.seed(42)\n\n\nif __name__ == \"__main__\":\n\n X, y = load_boston(return_X_y=True)\n # Using... | [
[
"sklearn.datasets.load_boston",
"numpy.random.seed"
]
] |
VietDunghacker/mmdetection | [
"9e97878b2c5247bebe8ec406752941ffc8083871"
] | [
"mmdet/models/dense_heads/embedding_rpn_head.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport torch\nimport torch.nn as nn\nfrom mmcv.runner import BaseModule\n\nfrom mmdet.models.builder import HEADS\nfrom ...core import bbox_cxcywh_to_xyxy\n\n\n@HEADS.register_module()\nclass EmbeddingRPNHead(BaseModule):\n\t\"\"\"RPNHead in the `Sparse R-CNN <https... | [
[
"torch.cat",
"torch.nn.Embedding",
"torch.nn.init.constant_"
]
] |
Shaviv-Hoffman-Lowitz/pylot | [
"d1295a42f0edd79670dc64053824a3e075d433e2"
] | [
"pylot/perception/detection/traffic_light_det_operator.py"
] | [
"\"\"\"Implements an operator that detects traffic lights.\"\"\"\nimport logging\n\nimport erdos\n\nimport numpy as np\n\nimport pylot.utils\nfrom pylot.perception.detection.traffic_light import TrafficLight, \\\n TrafficLightColor\nfrom pylot.perception.detection.utils import BoundingBox2D\nfrom pylot.perceptio... | [
[
"numpy.zeros",
"tensorflow.gfile.GFile",
"tensorflow.Graph",
"numpy.expand_dims",
"tensorflow.import_graph_def",
"tensorflow.ConfigProto",
"tensorflow.GraphDef"
]
] |
ymeng-git/tvm | [
"e53cbe48ca307d14a2359c1f6fe15f4ccfa87c8f"
] | [
"tests/python/contrib/test_ethosu/test_legalize.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.sum",
"numpy.ones",
"tensorflow.math.subtract",
"tensorflow.nn.avg_pool",
"tensorflow.math.tanh",
"tensorflow.math.sigmoid",
"tensorflow.concat",
"tensorflow.math.maximum",
"tensorflow.split",
"tensorflow.compat.v1.image.resize_nearest_neighbor",
"tensorflow.math... |
ischigal/gammapy | [
"c56ca1bb237d9eb4a7a3aed8eaf359206bf0e628"
] | [
"gammapy/modeling/tests/test_fit.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"Unit tests for the Fit class\"\"\"\nimport pytest\nfrom numpy.testing import assert_allclose\nfrom astropy.table import Table\nfrom gammapy.datasets import Dataset\nfrom gammapy.modeling import Fit, Parameter\nfrom gammapy.modeling.models impor... | [
[
"numpy.testing.assert_allclose"
]
] |
Lexelius/contrast | [
"ef7d6d8c51fb922e89c1c46db734e3c09f88a9fc"
] | [
"beamlines/nanomax/macro_attenuate.py"
] | [
"\"\"\"\nModule providing a macro to automatically absorb X percent of the\nbeam using the absorbers at the NanoMAX beamline\n\"\"\"\n\nimport os\nimport numpy as np\nfrom contrast.environment import env, macro, register_shortcut, runCommand\n\n# ToDo\n# - avoid elements with absorption edges close to the c... | [
[
"numpy.ones_like",
"numpy.asarray",
"numpy.exp",
"numpy.argsort",
"numpy.abs",
"numpy.log",
"numpy.array",
"numpy.loadtxt"
]
] |
martcous/dipy | [
"6bff5655f03db19bde5aa951ffb91987983a889b"
] | [
"dipy/reconst/tests/test_peak_finding.py"
] | [
"from __future__ import division, print_function, absolute_import\n\nimport numpy as np\nimport numpy.testing as npt\nfrom dipy.reconst.recspeed import (local_maxima, remove_similar_vertices,\n search_descending)\nfrom dipy.data import get_sphere, get_data\nfrom dipy.core.sphere im... | [
[
"numpy.testing.assert_raises",
"numpy.testing.assert_array_equal",
"numpy.array",
"numpy.linspace",
"numpy.testing.assert_"
]
] |
Prakhar-Bhartiya/SentimentAnalysis | [
"8fa2664a57b01e7303ef26d1226a81c0e25be4b7"
] | [
"preprocessing.py"
] | [
"\"\"\"\nDATA DESCRIPTION\n\nsentiment140 dataset. It contains 1,600,000 tweets extracted using the twitter api . The tweets have been annotated (0 = negative, 4 = positive) and they can be used to detect sentiment .\n\nIt contains the following 6 fields:\n\ntarget: the polarity of the tweet (0 = negative, 2 = neut... | [
[
"pandas.read_csv"
]
] |
chrisjonesBSU/fresnel | [
"92e17346899a78b68af9bc8006a6bec95e3476cc"
] | [
"fresnel/__init__.py"
] | [
"# Copyright (c) 2016-2021 The Regents of the University of Michigan\n# Part of fresnel, released under the BSD 3-Clause License.\n\n\"\"\"The fresnel ray tracing package.\"\"\"\n\nimport os\nimport numpy\n\nfrom . import geometry # noqa: F401 - ignore unused import\nfrom . import tracer\nfrom . import camera\nfro... | [
[
"numpy.array",
"numpy.max",
"numpy.min"
]
] |
brokenegg/transformer | [
"c402ccffd6be1e01c589ad2b9064a5837d4464c7"
] | [
"brokenegg_transformer/modeling/tf_utils.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.util.deprecation.deprecated",
"tensorflow.shape",
"tensorflow.nest.flatten",
"tensorflow.constant",
"tensorflow.keras.activations.get"
]
] |
TammoR/LogicalFactorisationMachines | [
"55bd94001f2852ea61f69cbb07a0cbdb41231028"
] | [
"lom/_numba/lom_outputs_fuzzy.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nOutput functions for logical operator machine products\n\"\"\"\n\nimport numpy as np\nfrom numba import jit, prange # int8, float64,\n\n# fuzzy output functions mapping from scalar vectors of probabilities to\n# to single data-point\n\n\n# OR-AND\n@jit('float64(float64[:], float64[:... | [
[
"numpy.float64",
"numpy.zeros"
]
] |
ipmach/Thesis2021 | [
"91dbb0eebba64f1fa2c18562e2c9f35f532ef7c0"
] | [
"src/python_code/Models/model_PAE_CNN.py"
] | [
"from Models.PAE_models.Encoder_CNN import EncoderCNN\nfrom Models.PAE_models.Decoder_CNN import DecoderCNN\nfrom Models.PAE_models.Bijecter import RealNVP\nfrom sklearn.preprocessing import MinMaxScaler\nfrom Models.AE_CNN_interface import AE_CNN\nimport joblib\n\n\nclass PAECNN(AE_CNN):\n\n def __init__(self, ... | [
[
"sklearn.preprocessing.MinMaxScaler"
]
] |
crougeux/-a-i_v1.6.3_modif | [
"b499a812e79f335d082d3f9b1070e0465ad67bab"
] | [
"build/numpy/numpy/distutils/misc_util.py"
] | [
"from __future__ import division, absolute_import, print_function\n\nimport os\nimport re\nimport sys\nimport imp\nimport copy\nimport glob\nimport atexit\nimport tempfile\nimport subprocess\nimport shutil\n\nimport distutils\nfrom distutils.errors import DistutilsError\n\ntry:\n set\nexcept NameError:\n from... | [
[
"numpy.distutils.system_info.system_info.saved_results.items",
"numpy.numarray.util.get_numarray_include_dirs",
"numpy.distutils.compat.get_exception",
"numpy.get_include",
"numpy.distutils.core.get_distribution",
"numpy.distutils.core.Extension",
"numpy.distutils.npy_pkg_config.read_c... |
VEDANTGHODKE/Swayatta-Autonomous-Driver-Assistance-System-ADAS-For-Indian-Environments | [
"7f0361c0f52e4e7623d975725497648cf582f36f"
] | [
"Swayatta - Autonomous Car Follower System/src/synchronous_mode.py"
] | [
"#!/usr/bin/env python\n\n# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de\n# Barcelona (UAB).\n#\n# This work is licensed under the terms of the MIT license.\n# For a copy, see <https://opensource.org/licenses/MIT>.\n\nimport glob\nimport os\nimport sys\nfrom CarDetector import CarD... | [
[
"numpy.array",
"numpy.dtype",
"numpy.reshape"
]
] |
lauromoraes/CapsNet-promoter | [
"9b08912648ff5d58a11ebb42225d9ad9851c61ac"
] | [
"teste_plot.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue May 1 19:35:08 2018\n\n@author: fnord\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n################################################################################# MCC\n\n#k = [0.8593737651, 0.8553389745, 0.7784318972, 0.91... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"numpy.array"
]
] |
unseenme/mindspore | [
"4ba052f0cd9146ac0ccc4880a778706f1b2d0af8"
] | [
"tests/ut/python/dataset/test_pyfunc.py"
] | [
"# Copyright 2019 Huawei Technologies Co., Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l... | [
[
"numpy.array",
"numpy.ones",
"numpy.array_equal"
]
] |
cimat/data-visualization-patterns | [
"7ca363ffd50d3d2d9da48b650588cd5503449cb3"
] | [
"display-patterns/Discrete Quantities/Pruebas/A36Span_Chart_Seaborn.py"
] | [
"import seaborn as sns\nimport matplotlib.pyplot as plt\nfrom datos import data\nimport pandas as pd\n\nsns.set(style=\"white\")\nf, ax = plt.subplots(figsize=(6, 15))\nd=data('mtcars')\nsubset1, subset2, subset3= d[d.cyl==4], d[d.cyl==6], d[d.cyl==8]\ndatos=pd.DataFrame ({'Max': [max(subset1.mpg), max(subset2.mpg)... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
rahulk29/sram22 | [
"9539f4bebd8577163fbab2181c1aef8f33e0ded4"
] | [
"sramgen/testbenches/column_mux_4/column_mux_4.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom collections import defaultdict\n\nsaved = [\n \"din0\",\n \"din1\",\n \"din2\",\n \"din3\",\n \"sel0\",\n \"sel1\",\n \"sel_b0\",\n \"sel_b1\",\n \"dout\",\n]\n\n\ndef read_data(f):\n data = defaultdict(lambda: [])\n for lin... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"numpy.array",
"matplotlib.pyplot.plot"
]
] |
comword/TCD20CS4CS7-MLFinal | [
"bb1b1cba25ce4c5cf0338b7b75af3b6f12931c96"
] | [
"src/bert/train_early_access.py"
] | [
"import numpy as np\nfrom keras_bert import load_trained_model_from_checkpoint\nimport os\n\nfrom dataloader import Tokeniser, load_data\nfrom sklearn.model_selection import train_test_split\n\nfrom keras.layers import *\nfrom keras.optimizers import Adam\nfrom keras.models import Model\nfrom keras.callbacks import... | [
[
"numpy.zeros_like",
"sklearn.model_selection.train_test_split"
]
] |
qing42102/deep_learning_examples | [
"d7695673e0c4bfe211f303ea5444765e8d4fe5f4"
] | [
"Logistic_Regression.py"
] | [
"# To add a new cell, type '# %%'\n# To add a new markdown cell, type '# %% [markdown]'\n# %%\nimport numpy as np\n# import tensorflow as tf\nfrom PIL import Image\nimport os\nimport matplotlib.pyplot as plt\nimport pickle\n\n# %%\ndef load_images(path: str) -> list:\n '''\n Load images from a directory. Norm... | [
[
"numpy.sum",
"numpy.ones",
"matplotlib.pyplot.legend",
"numpy.unique",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.exp",
"numpy.tensordot",
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.colorbar",
"numpy.sqrt",
... |
jzpang/forte | [
"489fb9cafba6faf5739bda935836b61b5e3d02b6"
] | [
"examples/data_augmentation/reinforcement/main.py"
] | [
"# Copyright 2020 The Forte 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 required... | [
[
"torch.no_grad",
"torch.cuda.is_available"
]
] |
ChristianFeldmann/PresentationMaterial | [
"a5182a5d50ed944fa7738f3919267ea056b72e63"
] | [
"VideoCodingBasics/Figures/Tnsformation/quantization.py"
] | [
"import numpy\n\ndata = numpy.array(\n [[968., 205.69, 120.6, -38.29, -81., -28.4, 33.12, 41.77],\n [89.13, 224.38, 132.1, -56.46, -102.6, -36.72, 39.05, 47.77],\n [-4.85, 58., 47.38, -62.13, -67.61, -21.83, 22.13, 23.34],\n [-111.6, -23.74, -2.54, -36.53, -19.46, -1.74, 0.23, -3.56],\... | [
[
"numpy.array",
"numpy.round"
]
] |
cics-nd/rans-uncertainty | [
"1ee554d64550377dfa4295bb05e61bab98e43ee4"
] | [
"training-data/periodic-hills/preProcess.py"
] | [
"\"\"\"\nA simple pre-processing file for converting raw OpenFOAM data to \nPyTorch tensors. This makes reading the data by the neural network\nsignifcantly faster. Additionally, depending on the flow, spacial\naverages can be taken to increase smoothness of R-S fields.\n===\nDistributed by: Notre Dame CICS (MIT Li... | [
[
"torch.sum",
"torch.FloatTensor",
"torch.stack",
"torch.DoubleTensor",
"numpy.all",
"numpy.array",
"numpy.unique"
]
] |
pyri-project/pyri-robotics | [
"c957b00bfef664519f49140d9dd65736cdc8b053"
] | [
"src/pyri/robotics/util/invkin.py"
] | [
"import numpy as np\nimport general_robotics_toolbox as rox\nfrom scipy.optimize import lsq_linear\n\ndef update_ik_info3(robot_rox, T_desired, q_current): # inverse kinematics that uses Least Square solver\n \n # R_d, p_d: Desired orientation and position\n R_d = T_desired.R\n p_d = T_desired.p\n d_... | [
[
"numpy.eye",
"numpy.ones",
"numpy.transpose",
"numpy.zeros",
"numpy.squeeze",
"numpy.finfo",
"scipy.optimize.lsq_linear",
"numpy.ndenumerate",
"numpy.hstack",
"numpy.array",
"numpy.sin",
"numpy.concatenate",
"numpy.nan_to_num",
"numpy.linalg.norm"
]
] |
BogdanMarghescu/Deep-Learning-Coursera | [
"af2c71c024f0ea911f89ed476686bd09ce37e87c"
] | [
"Sequence Models/Emojify/emo_utils.py"
] | [
"import csv\nimport emoji\nimport numpy as np\nemoji_dictionary = {\"0\": \"\\u2764\\uFE0F\", \"1\": \":baseball:\", \"2\": \":smile:\", \"3\": \":disappointed:\", \"4\": \":fork_and_knife:\"}\n\n\ndef read_glove_vecs(glove_file):\n with open(glove_file, encoding=\"utf8\") as f:\n words = set()\n w... | [
[
"numpy.eye",
"numpy.zeros",
"numpy.asarray",
"numpy.argmax",
"numpy.max",
"numpy.array"
]
] |
Prithwijit-Chak/simpeg | [
"d93145d768b5512621cdd75566b4a8175fee9ed3"
] | [
"tutorials/13-joint_inversion/plot_inv_1_joint_pf_pgi_full_info_tutorial.py"
] | [
"\"\"\"\nJoint PGI of Gravity + Magnetic on an Octree mesh using full petrophysical information\n======================================================================================\n\n\nThis tutorial shows through a joint inversion of Gravity and Magnetic data on an\nOctree mesh how to use the PGI framework intr... | [
[
"numpy.ones",
"numpy.sum",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.gca",
"numpy.random.seed",
"numpy.random.randn",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.show",
"numpy.max",
"nu... |
nicococo/ClusterSvdd | [
"2f61c187a3197c807b239202b72d9c84cb46400c"
] | [
"ClusterSVDD/svdd_primal_sgd.py"
] | [
"__author__ = 'nicococo'\nimport numpy as np\n\nfrom numba import autojit\n\n\nclass SvddPrimalSGD(object):\n \"\"\" Primal subgradient descent solver for the support vector data description (SVDD).\n Author: Nico Goernitz, TU Berlin, 2015\n \"\"\"\n PRECISION = 10**-3 # important: effects the thre... | [
[
"numpy.sum",
"numpy.sign",
"numpy.zeros",
"numpy.abs",
"numpy.argmax",
"numpy.float",
"numpy.max",
"numpy.sqrt",
"numpy.float64"
]
] |
jhhugo/DeepCTR | [
"12012b06097a4ad69d68e61989b16d2d6f02d741"
] | [
"deepctr/models/ccpm.py"
] | [
"# -*- coding:utf-8 -*-\n\"\"\"\n\nAuthor:\n Weichen Shen,wcshen1994@163.com\n\nReference:\n [1] Liu Q, Yu F, Wu S, et al. A convolutional click prediction model[C]//Proceedings of the 24th ACM International on Conference on Information and Knowledge Management. ACM, 2015: 1743-1746.\n (http://ir.ia.ac.cn/... | [
[
"tensorflow.keras.layers.Flatten",
"tensorflow.expand_dims",
"tensorflow.keras.initializers.glorot_normal",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Conv2D"
]
] |
UoA-eResearch/dynamic_network_graph | [
"350a22a40dd7425eb08a688651df13af8826ea52"
] | [
"stress_test.py"
] | [
"#!/usr/bin/env python3\n\nimport asyncio\nimport websockets\nimport json\nimport random\nimport time\nimport numpy as np\n\nURI = \"wss://api-proxy.auckland-cer.cloud.edu.au/dynamic_network_graph\"\n#URI = \"ws://api-proxy.auckland-cer.cloud.edu.au:6789\"\n#URI = \"ws://localhost:6789\"\nSESSION_ID = \"STRESS_TEST... | [
[
"numpy.mean"
]
] |
pfinashx/openvino | [
"1d417e888b508415510fb0a92e4a9264cf8bdef7"
] | [
"tests/layer_tests/onnx_tests/test_mean_variance_normalization.py"
] | [
"# Copyright (C) 2018-2022 Intel Corporation\n# SPDX-License-Identifier: Apache-2.0\n\nimport numpy as np\nimport pytest\n\nfrom common.onnx_layer_test_class import OnnxRuntimeLayerTest\n\n\nclass TestMeanVarianceNormalization(OnnxRuntimeLayerTest):\n def _prepare_input(self, inputs_dict):\n for input in ... | [
[
"numpy.random.randn"
]
] |
renyixiang/xmind_to_testcase | [
"25f3a5377e67138fc6707c0a14dcf6ed8501c845"
] | [
"webtool/tow_csvfile_compare.py"
] | [
"# _*_ coding:utf-8 _*_\n\n'''\ncsv文件的合并和去重\n主要是针对测试用例增加使用此脚本\n'''\nimport pandas as pd\nimport glob\n#输出文件\noutputfile = '/Users/huaan720/Downloads/百度网盘/xmind2testcase-master/docs/case_csvfile/new.csv'\n#合并csv的文件夹\ncsv_list = glob.glob('/Users/huaan720/Downloads/百度网盘/xmind2testcase-master/docs/case_csvfile/*.csv')... | [
[
"pandas.read_csv"
]
] |
mchapman87501/mars_perseverance_images | [
"9d138ffba25fcb039051cda724e15e994153d90c"
] | [
"tools/band_finder/src/band_finder/image_matcher.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nimage_matcher adjusts image contrast based on two image samples.\nCopyright 2021, Mitch Chapman All rights reserved\n\"\"\"\n\nimport numpy as np\n\n\nclass ChannelAdjuster:\n def __init__(self, src_sample, target_sample, channel, vmin, vmax):\n src = src_sample.astype(np... | [
[
"numpy.mean",
"numpy.interp"
]
] |
NeversayEverLin/PyOCT | [
"d2c221142ebc3c13050ad26ea09ad9d031ddab31"
] | [
"PyOCT/misc.py"
] | [
"import os\nfrom h5py._hl.files import File \nimport numpy as np \nimport xml.etree.ElementTree as ET\nimport time\nfrom scipy.linalg import dft\nimport numpy.matlib \nimport matplotlib.pyplot as plt \nimport matplotlib \nfrom PyOCT import CAO \nimport re \nimport h5py\nfrom scipy.linalg.misc import norm \nfrom sci... | [
[
"scipy.signal.fftconvolve",
"numpy.ones",
"numpy.sum",
"numpy.argsort",
"numpy.asarray",
"numpy.size",
"matplotlib.cm.ScalarMappable",
"numpy.amax",
"numpy.isfinite",
"matplotlib.pyplot.subplot2grid",
"matplotlib.colors.Normalize",
"matplotlib.pyplot.figure",
"n... |
stephane-eisen/pyleecan | [
"1faedde4b24acc6361fa1fdd4e980eaec4ca3a62"
] | [
"pyleecan/Methods/Machine/LamSlotMulti/plot.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom matplotlib.patches import Patch\nfrom matplotlib.pyplot import axis, legend\n\nfrom ....Functions.init_fig import init_fig\nfrom ....definitions import config_dict\n\nROTOR_COLOR = config_dict[\"PLOT\"][\"COLOR_DICT\"][\"ROTOR_COLOR\"]\nSTATOR_COLOR = config_dict[\"PLOT\"][\"COLOR_D... | [
[
"matplotlib.pyplot.legend",
"matplotlib.patches.Patch"
]
] |
charliememory/detectron2 | [
"a2a6220068e73c616ee4c84cb52ea023c0203fa0"
] | [
"projects/DensePose_wrong/densepose/modeling/condinst/iuv_head.py"
] | [
"from typing import Dict\nimport math\n\nimport torch\nfrom torch import nn\n\nfrom fvcore.nn import sigmoid_focal_loss_jit\nfrom detectron2.layers import ShapeSpec\n\n# from adet.layers import conv_with_kaiming_uniform\n# from adet.utils.comm import aligned_bilinear\nfrom densepose.layers import conv_with_kaiming_... | [
[
"torch.tensor",
"torch.nn.Sequential",
"torch.zeros",
"torch.cat",
"torch.mean"
]
] |
tpawlowski/image_analytics | [
"60445177a45c81a2c9c389b2f85f0d49d561c211"
] | [
"neuroscience/scidb/stream_mask.py"
] | [
"#!/usr/bin/python\n\n#\n#DFZ 11/15/2016: it's hard to control the chunk size read from the\n# stream() interface, see run_mri_stream.output for a concrete idea.\n#\n\n#the following import block is for testing only\nimport dipy.core.gradients as dpg\nimport os.path as op\nfrom dipy.segment.mask import median_otsu\... | [
[
"numpy.where",
"numpy.reshape",
"numpy.asarray"
]
] |
CyrilGarneau/COVID19-Model | [
"e8b7e459d0cfca580ded33fda05ebd6858e19c86"
] | [
"src/coronaHelper2.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Mar 18 11:01:22 2020\n\n@author: twallema\nCopyright (c) 2020 by T.W. Alleman, BIOMATH, Ghent University. All Rights Reserved.\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom random import choices\nimport scipy\nfrom scipy.integrate i... | [
[
"numpy.ones",
"scipy.interpolate.interp1d",
"numpy.array",
"numpy.zeros",
"numpy.mean",
"pandas.read_csv",
"numpy.append",
"scipy.optimize.differential_evolution",
"numpy.random.normal",
"numpy.linspace",
"numpy.loadtxt"
]
] |
manuelprogramming/OSA | [
"3a57ea944eef3e8680055a35e8cebd36b93dac51"
] | [
"handlers/plotting.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef format_plot(func):\n def func_wrapper(*args):\n func(*args)\n plt.ylabel(\"Intensity [dBm]\")\n plt.xlabel(\"Wavelength [nm]\")\n plt.tight_layout()\n plt.show()\n return func\n\n return func_wrapper\n\n\nd... | [
[
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.ioff",
"matplotlib.pyplot.tight_layout",
"numpy.random.random",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.xlabel"
]
] |
BesterRanX/BesterTF | [
"2e7e6938f74d027ebf9aee9b8af432a3e7b54519"
] | [
"BesterTF/Layers.py"
] | [
"import tensorflow as tf\n\n\nclass Layer():\n def __init__(self, output_dim, input_dim=0, activation=None):\n # cache parameters\n self.activation = activation\n self.input_dim = input_dim\n self.output_dim = output_dim\n\n\n\nclass Dense(Layer):\n def __init__(self, output_dim, i... | [
[
"tensorflow.random_uniform",
"tensorflow.zeros",
"tensorflow.matmul"
]
] |
strawsyz/straw | [
"db313c78c2e3c0355cd10c70ac25a15bb5632d41"
] | [
"study/dgl_study/02.py"
] | [
"import dgl\nimport networkx as nx\n\n# create a graph\ng_nx = nx.petersen_graph()\ng_dgl = dgl.DGLGraph(g_nx)\n\nimport matplotlib.pyplot as plt\n\nplt.subplot(121)\nnx.draw(g_nx, with_labels=True)\nplt.subplot(122)\nnx.draw(g_dgl.to_networkx(), with_labels=True)\n\nplt.show()\n\n# add edges and nodes into graph\n... | [
[
"torch.ones",
"torch.randn",
"matplotlib.pyplot.figure",
"torch.tensor",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"torch.zeros"
]
] |
FaustinCarter/lmfit-py | [
"7fbb75b2fd3f383e78692fd85c9a646793d4b071"
] | [
"tests/test_itercb.py"
] | [
"import numpy as np\nfrom lmfit import Parameters, minimize, report_fit\nfrom lmfit.models import LinearModel, GaussianModel\nfrom lmfit.lineshapes import gaussian\n\ndef per_iteration(pars, iter, resid, *args, **kws):\n \"\"\"iteration callback, will abort at iteration 23\n \"\"\"\n # print( iter, ', '.jo... | [
[
"numpy.linspace"
]
] |
JamesJeffryes/kb_phylogenomics | [
"133b7b7c4179b5fb1b51bade70069a545bca91fc"
] | [
"lib/kb_phylogenomics/kb_phylogenomicsImpl.py"
] | [
"# -*- coding: utf-8 -*-\n#BEGIN_HEADER\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport os\nimport sys\nimport shutil\nimport hashlib\nimport subprocess\nimport requests\nrequests.packages.urllib3.disable_warnings()\nimport re\nimport traceback\nimport uuid\nfrom datetime import da... | [
[
"matplotlib.patches.Arc",
"matplotlib.pyplot.figure",
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.subplot2grid"
]
] |
mbzhu1/ludwig | [
"13c35ec79f930e7dac295e642d92abe82f8c8046"
] | [
"tests/integration_tests/test_model_training_options.py"
] | [
"import json\nimport os.path\nimport re\nfrom collections import namedtuple\nimport logging\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nimport tensorflow as tf\nfrom sklearn.model_selection import train_test_split\n\nfrom ludwig import globals as global_vars\nfrom ludwig.api import LudwigModel\nfrom ... | [
[
"numpy.allclose",
"tensorflow.random.set_seed",
"numpy.argmin",
"numpy.random.seed",
"numpy.isclose",
"tensorflow.keras.backend.clear_session",
"numpy.random.normal",
"numpy.random.lognormal",
"numpy.array",
"numpy.concatenate",
"sklearn.model_selection.train_test_split... |
ous8292/arviz | [
"3d788cc7157b764130ee6f84bb2f42021e5ab258"
] | [
"arviz/plots/backends/bokeh/posteriorplot.py"
] | [
"\"\"\"Bokeh Plot posterior densities.\"\"\"\nfrom numbers import Number\nfrom typing import Optional\n\nimport numpy as np\nfrom bokeh.models.annotations import Title\n\nfrom ....stats import hdi\nfrom ....stats.density_utils import get_bins, histogram\nfrom ...kdeplot import plot_kde\nfrom ...plot_utils import (\... | [
[
"numpy.atleast_2d",
"numpy.isnan"
]
] |
ERhamat/opendrr-data-store | [
"34a737e8636707f85191e2f97a4ae78e8469e317"
] | [
"scripts/combines_all_csvs.py"
] | [
"#script found online to combine all csvs into one\nimport os\nimport glob\nimport pandas as pd\n#directory link\nos.chdir(\"C:/Workspace/eRisk_CA/PSRA_sample_data/baseline/c-damage\")\nextension = 'csv'\nall_filenames = [i for i in glob.glob('*.{}'.format(extension))]\n#combine all files in the list\ncombined_csv ... | [
[
"pandas.read_csv"
]
] |
yweweler/ctc-asr | [
"4b24c658b43a28a4f939c95041953ad7a283ff1b"
] | [
"python/dataset/sd_estimator.py"
] | [
"\"\"\"\nCalculate mean and standard deviation for a given training txt file.\n\"\"\"\n\nimport os\nimport sys\nimport random\n\nfrom multiprocessing import Pool, Lock, cpu_count\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom python.load_sample import load_sample\nfrom python.params import BASE_PATH\n\n\n__DATA... | [
[
"numpy.std",
"numpy.concatenate",
"numpy.mean"
]
] |
changhiskhan/virtual-background | [
"0002d85b0a329611926077633163b45e6668f673"
] | [
"fakecam/fake.py"
] | [
"import os\nimport cv2\nimport numpy as np\nimport requests\nimport pyfakewebcam\nimport traceback\nimport time\n\ndef get_mask(frame, bodypix_url=os.environ.get(\"BODYPIX_URL\",\"http://bodypix:9000\")):\n _, data = cv2.imencode(\".jpg\", frame)\n r = requests.post(\n url=bodypix_url,\n data=da... | [
[
"numpy.random.uniform",
"numpy.ones",
"numpy.roll",
"numpy.frombuffer"
]
] |
AloBer03/MA_Alo-sBerger | [
"93e72f7940a3ea8bab3c72e00c92091c01dc5324"
] | [
"NNFS/nnma.py"
] | [
"## nnma\r\n\r\n## code from NNFS\r\n## My own comments are marked with ##\r\n## My own code start with ##-- and ends with --##\r\n\r\n## Makig a file with only the classes\r\n## This will enable to import nnma and not copy all the function into the new file\r\n\r\nimport matplotlib.gridspec as gridspec\r\nimport m... | [
[
"numpy.sum",
"numpy.ones_like",
"numpy.log",
"numpy.vstack",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"numpy.abs",
"numpy.empty_like",
"matplotlib.pyplot.get_cmap",
"numpy.absolute",
"numpy.average",
"numpy.mean",
"numpy.sqrt",
"numpy.eye",
... |
amitkumarj441/hafnian | [
"3d0b79c77180db7e415b96826707f8049d690208"
] | [
"thewalrus/tests/test_hermite_multidimensional.py"
] | [
"# Copyright 2019 Xanadu Quantum Technologies Inc.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applica... | [
[
"numpy.allclose",
"numpy.ones",
"numpy.zeros",
"scipy.special.eval_hermitenorm",
"numpy.arange",
"numpy.random.rand",
"numpy.sqrt",
"numpy.array",
"scipy.special.eval_hermite"
]
] |
AdityaNG/cone-detector-tf | [
"f2eede83caf64753c7b70b3ce017a26d8903469c"
] | [
"cone_detector_lib.py"
] | [
"from __future__ import division\n\nimport argparse\nimport logging.config\nimport os\nimport time\n\nimport cv2\nimport numpy as np\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\n\nfrom utils import cv_utils\nfrom utils import operations as ops\nfrom utils import tf_utils\n\nlogging.config.fileConfi... | [
[
"numpy.vstack",
"tensorflow.compat.v1.Session",
"numpy.any",
"numpy.expand_dims",
"tensorflow.compat.v1.disable_v2_behavior",
"numpy.nonzero"
]
] |
MosyMosy/VDT | [
"e07f28d0cd6367ed30740c147ed2f270ead8fb63"
] | [
"models/resnet10_BITrans.py"
] | [
"import torch\n# from torch.autograd import Variable\nimport torch.nn as nn\nimport math\nimport numpy as np\nimport torch.nn.functional as F\nfrom torch.nn.utils.weight_norm import WeightNorm\nfrom Batchtransfer_EMA import BatchInstanceTransNorm as BIT2d\n\ndef init_layer(L):\n # Initialization using fan-in\n ... | [
[
"torch.nn.MaxPool2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.ReLU"
]
] |
AlkalineDevelopment/56openpilot | [
"fb9a557d77bc8409ff14261e4a05fcd2da709836"
] | [
"selfdrive/controls/lib/lateral_planner.py"
] | [
"import math\nimport numpy as np\nfrom common.realtime import sec_since_boot, DT_MDL\nfrom common.numpy_fast import interp\nfrom selfdrive.swaglog import cloudlog\nfrom selfdrive.controls.lib.lateral_mpc_lib.lat_mpc import LateralMpc\nfrom selfdrive.controls.lib.drive_helpers import CONTROL_N, MPC_COST_LAT, LAT_MPC... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.column_stack",
"numpy.arange",
"numpy.array",
"numpy.linalg.norm"
]
] |
n778509775/JDLBER | [
"20f209348f3aa10b85c61efd7253c94cd64a6a8a"
] | [
"network.py"
] | [
"#!/usr/bin/env python\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\ndef init_weights(m):\n \"\"\" initialize weights of fully connected layer\n \"\"\"\n if type(m) == nn.Linear:\n nn.init.orthogonal_(m.weight, gain=1)\n m.bias.data.zero_()\n elif type(m) == nn.B... | [
[
"torch.nn.Linear",
"torch.nn.init.constant_",
"torch.nn.BatchNorm1d",
"torch.nn.Sigmoid",
"torch.nn.init.orthogonal_",
"torch.nn.LeakyReLU"
]
] |
sowmyamanojna/BT3051-Data-Structures-and-Algorithms | [
"09c17e42c2e173a6ab10339f08fbc1505db8ea56"
] | [
"lab_session/calculate_pi.py"
] | [
"import random\nimport matplotlib.pyplot as plt\n\npi_vals = []\n\npi = 0\nn = 100\nm = 10**6\nfor i in range(m):\n\tfor j in range(n):\n\t\t[x, y] = [random.random(), random.random()]\n\t\tif x**2 + y**2 <= 1.0:\n\t\t\tpi += 1\n\tpi = (pi/n)*4\n\n\tpi_vals.append(pi)\n\nitern = [i for i in range(m)]\nplt.plot(iter... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
]
] |
bmu/pandas | [
"549b72f07ffdeb6d54b2865c90d95a256e4231ad"
] | [
"pandas/core/panel.py"
] | [
"\"\"\"\nContains data structures designed for manipulating panel (3-dimensional) data\n\"\"\"\n# pylint: disable=E1103,W0231,W0212,W0621\nfrom __future__ import division\nfrom pandas.compat import (map, zip, range, lrange, lmap, u, OrderedDict,\n OrderedDefaultdict)\nfrom pandas import co... | [
[
"pandas.core.groupby.PanelGroupBy",
"pandas.compat.iteritems",
"pandas.core.generic.NDFrame._set_item",
"pandas.compat.map",
"pandas.core.common._default_index",
"pandas.core.internals.create_block_manager_from_arrays",
"numpy.asarray",
"pandas.core.common._possibly_cast_item",
... |
DengSonic/PyFR | [
"dde524ed56f4a4feca376b51db4b21eb6fa4b113"
] | [
"pyfr/backends/openmp/base.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\n\nfrom pyfr.backends.base import BaseBackend\n\n\nclass OpenMPBackend(BaseBackend):\n name = 'openmp'\n\n def __init__(self, cfg):\n super().__init__(cfg)\n\n # Take the default alignment requirement to be 32-bytes\n self.alignb = cfg.getint... | [
[
"numpy.dtype",
"numpy.zeros"
]
] |
lartpang/ZoomNet | [
"1f329e80db5469eaf6a513ec384cd19bafdaece2"
] | [
"utils/pipeline/dataloader.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2021/5/29\n# @Author : Lart Pang\n# @GitHub : https://github.com/lartpang\n\nfrom functools import partial\n\nfrom torch.utils import data\n\nfrom utils import builder, misc\n\n\ndef get_tr_loader(cfg, shuffle=True, drop_last=True, pin_memory=True):\n dataset = builder.bu... | [
[
"torch.utils.data.distributed.DistributedSampler"
]
] |
luca-morreale/semantic-segmentation-pytorch | [
"d823fb4115a7ef5c8d47b3e5995a498bbcd9a9b6"
] | [
"visualization/kitti_visualizer.py"
] | [
"import os\nimport numpy as np\nfrom lib.utils.utils import unique\nfrom visualization.utils_name_generation import generate_image_name\nimport cv2\n\ncolormap = {\n 0: (128, 128, 128), # Sky\n 1: (128, 0, 0), # Building\n 2: (128, 64, 128), # Road\n 3: (0, 0, 192), # Sidewalk\n ... | [
[
"numpy.zeros",
"numpy.uint8"
]
] |
sofieditmer/deep_learning | [
"43f7f97f09aef1057e088356094d3e869cff5cba"
] | [
"utils/utils.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nThis script stores a plotting function.\n\"\"\"\n\n# Dependencies\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Function for plotting loss and accuracy learning curves.\ndef plot_history(H, epochs):\n \"\"\"\n Utility function for plotting model history using matplo... | [
[
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
]
] |
something678/TodKat | [
"b26d9c617684e60cd25ff225a71adb6bfa3b0a6c"
] | [
"sentence_transformers/SentenceTransformer.py"
] | [
"import json\nimport logging\nimport os\nimport shutil\nfrom collections import OrderedDict\nfrom typing import List, Dict, Tuple, Iterable, Type\nfrom zipfile import ZipFile\nimport sys\n\nimport numpy as np\nimport transformers\nimport torch\nfrom numpy import ndarray\nfrom torch import nn, Tensor\nfrom torch.opt... | [
[
"torch.hub._get_torch_home",
"torch.stack",
"torch.distributed.get_world_size",
"torch.no_grad",
"numpy.argsort",
"numpy.asarray",
"torch.cuda.is_available",
"torch.device"
]
] |
cnakhl/quimb | [
"482a21ebdaa0e8236924dbbdc435e8de68d86719"
] | [
"quimb/tensor/drawing.py"
] | [
"\"\"\"Functionailty for drawing tensor networks.\n\"\"\"\nimport textwrap\nimport importlib\nimport collections\n\nimport numpy as np\n\nfrom ..utils import valmap\n\n\nHAS_FA2 = importlib.util.find_spec('fa2') is not None\n\n\ndef parse_dict_to_tids_or_inds(spec, tn, default='__NONE__'):\n \"\"\"Parse a dictio... | [
[
"matplotlib.colors.rgb_to_hsv",
"matplotlib.colors.hsv_to_rgb",
"numpy.cos",
"matplotlib.pyplot.subplots",
"matplotlib.colors.LinearSegmentedColormap.from_list",
"numpy.empty_like",
"matplotlib.patches.ConnectionStyle.Arc3",
"matplotlib.pyplot.show",
"matplotlib.pyplot.close",
... |
mpsonntag/nixpy | [
"fd6addf137e22dad5fc1b1a95bfc4ca2bd84da5d"
] | [
"nixio/test/test_data_array.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright © 2014, German Neuroinformatics Node (G-Node)\n#\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted under the terms of the BSD License. See\n# LICENSE file in the root of the Project.\nimport os\nimpor... | [
[
"numpy.testing.assert_almost_equal",
"numpy.eye",
"numpy.random.random_sample",
"numpy.int8",
"numpy.zeros",
"numpy.dtype",
"numpy.int64",
"numpy.empty_like",
"numpy.int32",
"numpy.random.rand",
"numpy.array_equal",
"numpy.array",
"numpy.int16",
"numpy.linsp... |
iamsofancyyoualreadyknow/IHC-based-labels-generation-and-semantic-segmentation-for-lung-cancer | [
"57904544c6d6b43dcd5937afeb474c0a47456d98"
] | [
"models/model_unet.py"
] | [
"import tensorflow as tf\nfrom tensorflow.python.ops import control_flow_ops\nfrom six.moves import cPickle\nimport unet\nimport simplified_unet\n\narg_scope = tf.contrib.framework.arg_scope\n\n\nclass UnetModel(object):\n\n def __init__(self, number_class=3, is_training=True, is_simplified = False, dropout = Tr... | [
[
"tensorflow.shape",
"tensorflow.reshape",
"tensorflow.get_collection",
"tensorflow.expand_dims",
"tensorflow.reduce_mean",
"tensorflow.squeeze",
"tensorflow.cast",
"tensorflow.name_scope",
"tensorflow.losses.sparse_softmax_cross_entropy",
"tensorflow.one_hot",
"tensorfl... |
paolorampazzo/mypySOT | [
"c22a0f297576aa6db79c7f0752d97445195dd9b4"
] | [
"pySOT/experimental_design.py"
] | [
"\"\"\"\n.. module:: experimental_design\n :synopsis: Methods for generating an experimental design.\n\n.. moduleauthor:: David Eriksson <dme65@cornell.edu>,\n Yi Shen <ys623@cornell.edu>\n\n:Module: experimental_design\n:Author: David Eriksson <dme65@cornell.edu>\n Yi Shen <ys623@cornell.ed... | [
[
"numpy.random.shuffle",
"scipy.spatial.distance.cdist",
"numpy.zeros",
"numpy.arange",
"numpy.random.random",
"numpy.linalg.matrix_rank",
"numpy.fill_diagonal",
"numpy.array"
]
] |
aliborji/ShapeDefence | [
"92da19bb195b5161d997f6ee1cc777b07a714f6f"
] | [
"pix2pix-pytorch/networks.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport functools\nfrom torch.optim import lr_scheduler\n\n\ndef get_norm_layer(norm_type='instance'):\n if norm_type == 'batch':\n norm_layer = functools.partial(nn.BatchNorm2d, affine=True)\n elif norm_type == 'instance':\n norm_l... | [
[
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.nn.Conv2d",
"torch.nn.ReflectionPad2d",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.nn.Sigmoid",
"torch.nn.Dropout",
"torch.nn.ConvTranspose2d",
"torch.nn.init.kaiming_normal_",
"torch.nn.init.xavier_normal_",
"t... |
MaksSieve/CourseProject_2nd_Year | [
"ecbe77aa33d0e87231784cdc460c24ce99278928"
] | [
"engine_tests/PiImageSearch/ball_tracking69.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# import the necessary packages\nfrom collections import deque\nimport numpy as np\nimport argparse\nimport imutils\nimport cv2\nimport time\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport RPi.GPIO as GPIO\n\n# construct the argument parse and parse ... | [
[
"numpy.sign",
"matplotlib.pyplot.savefig",
"numpy.arctan",
"pandas.DataFrame",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel"
]
] |
NeveIsa/geneal | [
"064b0409912088886bf56fe9a729d74dac92a235"
] | [
"geneal/applications/fitness_functions/continuous.py"
] | [
"import numpy as np\n\n\ndef fitness_functions_continuous(function_number):\n\n if function_number == 1:\n return lambda chromosome: -(np.abs(chromosome[0]) + np.cos(chromosome[0]))\n elif function_number == 2:\n return lambda chromosome: -(np.abs(chromosome[0]) + np.sin(chromosome[0]))\n eli... | [
[
"numpy.sin",
"numpy.abs",
"numpy.cos"
]
] |
giorgiovaccarino/CSSR | [
"e62d936445abcd0e34844b93db6505e9a59bec04"
] | [
"model/modeling/resnet.py"
] | [
"# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Bin Xiao (Bin.Xiao@microsoft.com)\n# Modified by Dequan Wang and Xingyi Zhou\n# ------------------------------------------------------------------------------... | [
[
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.init.constant_",
"torch.nn.init.normal_",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.utils.model_zoo.load_url",
"torch.nn.ReLU",
"torch.nn.ConvTranspose2d"
]
] |
Ojas-Singh/oOo | [
"ef3be64693c7698d0d34022a1b93cb8dab5c766c"
] | [
"xemia.py"
] | [
"from threading import stack_size\nfrom ximea import xiapi\nfrom imutils.video import FPS\nimport cv2\nimport numpy as np\nimport time\nimport multiprocessing\nfrom multiprocessing import Pool, Queue\nimport sys,os\nimport pickle\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom scipy.optimize import leasts... | [
[
"numpy.fft.fftshift",
"matplotlib.pyplot.pause",
"numpy.array",
"numpy.fft.fft2",
"matplotlib.pyplot.figure",
"numpy.abs",
"scipy.optimize.leastsq",
"numpy.exp",
"numpy.asarray",
"matplotlib.pyplot.show",
"matplotlib.use",
"numpy.linspace"
]
] |
SiggiGue/sigfeat | [
"86bb94200dcd4b33c21de1abc01814bf85f97b38"
] | [
"examples/example2.py"
] | [
"from sigfeat import Extractor\nfrom sigfeat import feature as fts\n\n\nextractor = Extractor(\n fts.SpectralFlux(),\n fts.SpectralCentroid(),\n fts.SpectralFlatness(),\n fts.SpectralRolloff(),\n fts.SpectralCrestFactor(),\n fts.CrestFactor(),\n fts.ZeroCrossingRate(),\n fts.RootMeanSquare()... | [
[
"pandas.DataFrame",
"pandas.tools.plotting.scatter_matrix"
]
] |
bsburnham/striplog | [
"0c68f63d645c5bb7a5cc73b9bdaa197c4fb3cc33"
] | [
"striplog/striplog.py"
] | [
"\"\"\"\nA striplog is a sequence of intervals.\n\n:copyright: 2019 Agile Geoscience\n:license: Apache 2.0\n\"\"\"\nimport re\nfrom io import StringIO\nimport csv\nimport operator\nimport warnings\nfrom collections import defaultdict\nfrom collections import OrderedDict\nfrom functools import reduce\nfrom copy impo... | [
[
"numpy.zeros_like",
"numpy.ceil",
"numpy.diff",
"matplotlib.pyplot.figure",
"matplotlib.ticker.FormatStrFormatter",
"numpy.copy",
"matplotlib.collections.PatchCollection",
"matplotlib.pyplot.subplots",
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.text",
"numpy.isn... |
NLeSC/spreading_dye_sampler | [
"4282f7609959a31d1b2a4832f3ed643b15c46cb6"
] | [
"spreading_dye_sampler/test/test_dye_blot.py"
] | [
"import os\nimport sys\nsys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))\n\nimport spreading_dye_sampler.dye_blot\n\nimport numpy as np\nfrom numpy.random import random\nimport pytest\n\n@pytest.fixture\ndef blot():\n num_cells = 100\n grid_width = 100\n grid_height = 100\n\n blot = ... | [
[
"numpy.random.random",
"numpy.zeros"
]
] |
hrnciar/NiaPy | [
"d1e70924577cc90455c52701f2696bcb0a064438"
] | [
"examples/advanced_example_custom_pop.py"
] | [
"# encoding=utf8\n# This is temporary fix to import module from parent folder\n# It will be removed when package is published on PyPI\nimport sys\n\nsys.path.append('../')\n\nfrom niapy.task import StoppingTask, OptimizationType\nfrom niapy.benchmarks import Benchmark\nfrom niapy.algorithms.basic import GreyWolfOpt... | [
[
"numpy.apply_along_axis"
]
] |
hexylena/tools-iuc | [
"811337eaab815f54f0fd93a3dd23a1153993ea2a"
] | [
"tools/cwpair2/cwpair2_util.py"
] | [
"import bisect\nimport csv\nimport os\nimport sys\nimport traceback\n\nimport matplotlib\nmatplotlib.use('Agg') # noqa\nfrom matplotlib import pyplot\n\n# Data outputs\nDETAILS = 'D'\nMATCHED_PAIRS = 'MP'\nORPHANS = 'O'\n# Data output formats\nGFF_EXT = 'gff'\nTABULAR_EXT = 'tabular'\n# Statistics historgrams outp... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.ylim"... |
ExpectationMax/pymc3 | [
"7988d0bd023c8ba05a2d97bcbb563a67ed9ed82a"
] | [
"pymc3/step_methods/hmc/quadpotential.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.ones",
"numpy.multiply",
"numpy.eye",
"numpy.divide",
"numpy.zeros",
"numpy.diag",
"scipy.sparse.issparse",
"numpy.any",
"numpy.abs",
"numpy.asarray",
"numpy.random.normal",
"numpy.where",
"numpy.isnan",
"numpy.sqrt",
"numpy.dot",
"numpy.array... |
Vikicsizmadia/ctp | [
"d88fdfecf4b90ee42e6137a9767226c0d35b19a3"
] | [
"ctp/evaluation/slow.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\n# from tqdm import tqdm\n\nimport torch\nfrom torch import nn\n\nfrom ctp.util import make_batches\nfrom ctp.models import BaseLatentFeatureModel\n\nfrom typing import Tuple, Dict\n\n\ndef evaluate_slow(entity_embeddings: nn.Embedding,\n predicate_emb... | [
[
"torch.cuda.empty_cache",
"torch.no_grad",
"torch.tensor",
"numpy.argsort",
"torch.cuda.is_available"
]
] |
dataflowr/evaluating_bdl | [
"b7d7e3f2b8095a0ec43118d2b69b4b49e0b910f2"
] | [
"depthCompletion/mcdropout_eval_auce.py"
] | [
"# code-checked\r\n# server-checked\r\n\r\nimport os\r\n\r\nimport torch\r\nimport torch.nn.parallel\r\nimport torch.optim\r\nimport torch.utils.data\r\nfrom torch.autograd import Variable\r\n\r\nfrom model_mcdropout import DepthCompletionNet\r\n\r\nfrom datasets import DatasetKITTIVal\r\nfrom criterion import Mask... | [
[
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.sqrt",
"torch.log",
"matplotlib.pyplot.ylabel",
"numpy.trapz",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"numpy.logical_and",
"numpy.abs",
"matplotlib.pyplot.title",
... |
Classic-Daniel/gradient-video-delay | [
"a03e11a6b14e9e89198cf46e2b435cc1e9035d63"
] | [
"main.py"
] | [
"import numpy as np\nimport cv2\n\nBUFFER_SIZE = 30\n\nclass imageGenerator:\n def __init__(self, img):\n self.imgBuffer = [img] * BUFFER_SIZE\n self.currentIndex = 0\n print(f\"Image type: {type(img)}\")\n print(f\"buffer shape: {self.imgBuffer[0].shape}\")\n\n def addNewImage(sel... | [
[
"numpy.copy"
]
] |
mhilmiasyrofi/Once-for-All-Adversarial-Training | [
"c92bc88bdcf8bd531ca02017a4d2d1410899519c"
] | [
"models/svhn/wide_resnet.py"
] | [
"\"\"\"PyTorch implementation of Wide-ResNet taken from \nhttps://github.com/jeromerony/fast_adversarial/blob/master/fast_adv/models/cifar10/wide_resnet.py\"\"\"\n\nimport math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass BasicBlock(nn.Module):\n def __init__(self, in_planes, ... | [
[
"torch.nn.BatchNorm2d",
"torch.nn.Linear",
"torch.nn.functional.avg_pool2d",
"torch.nn.functional.dropout",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.ReLU"
]
] |
ducnx/TPC-LoS-prediction | [
"49713f5bd7e77c2adb1ff950c885d087a398a1ad"
] | [
"models/hyperparameter_scripts/eICU/tpc_stage2.py"
] | [
"from eICU_preprocessing.split_train_test import create_folder\nfrom models.run_tpc import TPC\nimport numpy as np\nimport random\nfrom models.final_experiment_scripts.best_hyperparameters import best_global\nfrom models.initialise_arguments import initialise_tpc_arguments\n\n\ndef get_hyperparam_config(dataset):\n... | [
[
"numpy.log2",
"numpy.log10"
]
] |
mchatton/pyroomacoustics | [
"913b45a311634283fe28dc5d133b27b8b610627b"
] | [
"pyroomacoustics/tests/test_build_rir.py"
] | [
"from __future__ import division, print_function\nimport pyroomacoustics as pra\nimport numpy as np\n\ntry:\n from pyroomacoustics import build_rir\n build_rir_available = True\nexcept:\n print('build_rir not available')\n build_rir_available = False\n\n# tolerance for test success (1%)\ntol = 0.01\n\nf... | [
[
"matplotlib.pyplot.legend",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.abs",
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.pyplot.plot",
"numpy.round"
]
] |
sarikayamehmet/Framework-for-Actor-Critic-deep-reinforcement-learning-algorithms | [
"a2902f903956427074769b71b41ddc81e10276c3"
] | [
"A3C/environment/car_controller_environment.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport matplotlib\nmatplotlib.use('Agg',force=True) # no display\nfrom matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas\nfrom matplotlib.figure import Fig... | [
[
"numpy.ceil",
"numpy.zeros",
"matplotlib.figure.Figure",
"numpy.arctan",
"matplotlib.collections.PatchCollection",
"numpy.cos",
"numpy.random.random",
"matplotlib.patches.Circle",
"numpy.clip",
"numpy.random.exponential",
"matplotlib.use",
"numpy.sin",
"matplotl... |
gimlidc/igre | [
"bf3425e838cca3d1fa8254a2550ecb44774ee0ef"
] | [
"src/tftools/idx2pixel_layer.py"
] | [
"import tensorflow as tf\n\nglobal_visible = None\n\n\nclass Idx2PixelLayer(tf.keras.layers.Layer):\n\n def __init__(self, visible, trainable=False, shift_multi=1, **kwargs):\n \"\"\"\n :param visible: one dimension of visible image (for this dimension [x,y] will be computed)\n \"\"\"\n ... | [
[
"tensorflow.stack",
"tensorflow.logical_or",
"tensorflow.shape",
"tensorflow.subtract",
"tensorflow.add",
"tensorflow.cast",
"tensorflow.einsum",
"tensorflow.floor",
"tensorflow.constant"
]
] |
alexlioralexli/diagnosing_qlearning | [
"20a4338a324c1bab79e6ca65937830529d941302"
] | [
"debugq/envs/env_suite.py"
] | [
"import numpy as np\nimport itertools\nimport random\nfrom debugq.envs import random_obs_wrapper, time_limit_wrapper, env_wrapper\nfrom rlutil.envs.tabular_cy import tabular_env\nfrom rlutil.envs.gridcraft import grid_env_cy\nfrom rlutil.envs.gridcraft import grid_spec_cy\nfrom rlutil.logging import log_utils\nfrom... | [
[
"numpy.array",
"numpy.argmax"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.