repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
KaiyuYue/resnext-wsl-caffe
[ "222de80aae6bd423535d8d680ca03943d4424e09" ]
[ "converter/models/resnet.py" ]
[ "import torch.nn as nn\n\n\n__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',\n 'resnet152', 'resnext50_32x4d', 'resnext101_32x8d']\n\n\nmodel_urls = {\n 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',\n 'resnet34': 'https://download.pytorch.org/models/re...
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ] ]
oke-aditya/Machine_Learning
[ "3dd40ae2b9cba1890e7060448e75c14194b27775" ]
[ "Learning_RL/Q_Learning/Q_learning_intro.py" ]
[ "# Q-Learning is a model-free form of machine learning,\n# in the sense that the AI \"agent\" does not need to know or have a model of the environment that it will be in. \n# The same algorithm can be used across a variety of environments.\n# For a given environment, everything is broken down into \"states\" and \"...
[ [ "numpy.max", "numpy.random.uniform", "numpy.random.randint", "numpy.argmax", "numpy.random.random" ] ]
ChutianShen/pointnet_kitti
[ "6ebd2c7c203c4fcc8172f306c85e55ea06429ba5" ]
[ "sem_seg/model.py" ]
[ "import tensorflow as tf\nimport math\nimport time\nimport numpy as np\nimport os\nimport sys\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nROOT_DIR = os.path.dirname(BASE_DIR)\nsys.path.append(os.path.join(ROOT_DIR, 'utils'))\nimport tf_util\n\ndef placeholder_inputs(batch_size, num_point):\n pointclo...
[ [ "numpy.random.rand", "tensorflow.concat", "tensorflow.expand_dims", "tensorflow.Graph", "tensorflow.Session", "tensorflow.reshape", "tensorflow.constant", "tensorflow.squeeze", "tensorflow.placeholder", "tensorflow.reduce_mean", "tensorflow.global_variables_initializer"...
luyufan498/Vitis-AI-ZH
[ "f61061eef7550d98bf02a171604c9a9f283a7c47" ]
[ "tools/Vitis-AI-Runtime/VART/vart/rnn-runner/apps/customer_satisfaction/run_dpu_e2e.py" ]
[ "\"\"\"\nCopyright 2021 Xilinx Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in w...
[ [ "tensorflow.python.keras.preprocessing.text.Tokenizer", "numpy.clip", "numpy.empty", "numpy.zeros", "tensorflow.python.keras.layers.Embedding", "tensorflow.python.keras.layers.MaxPooling1D", "tensorflow.python.keras.layers.LSTM", "tensorflow.python.keras.preprocessing.sequence.pad_...
weiplanet/ColossalAI
[ "ab962b9735ea323eb84c5bc4bce534bf2376960e" ]
[ "colossalai/gemini/tensor/_ops/linear.py" ]
[ "import torch\nfrom colossalai.gemini.tensor import stateful_op_impl\nfrom ..stateful_tensor import StatefulTensorV2\nfrom packaging import version\n\n\n@stateful_op_impl(torch.nn.functional.linear)\ndef stateful_linear(types, args, kwargs, pg):\n \"\"\"Handles ``__torch_function__`` dispatch for ``torch.nn.func...
[ [ "torch.nn.functional.linear" ] ]
yangshao/vcr
[ "88513d6958d93bd7845d532d5b83744a678fc980", "88513d6958d93bd7845d532d5b83744a678fc980" ]
[ "dataloaders/vcr_test.py", "models/multiatt/CRF_Concept.py" ]
[ "\"\"\"\r\nDataloaders for VCR\r\n\"\"\"\r\nimport json\r\nimport os\r\n\r\nimport numpy as np\r\nimport torch\r\nfrom allennlp.data.dataset import Batch\r\nfrom allennlp.data.fields import TextField, ListField, LabelField, SequenceLabelField, ArrayField\r\nfrom allennlp.data.instance import Instance\r\nfrom allenn...
[ [ "numpy.array", "torch.stack", "numpy.ones", "numpy.where", "torch.all", "numpy.arange", "numpy.all", "numpy.row_stack" ], [ "numpy.sqrt" ] ]
frycast/allshapley
[ "4bebdffe0bee006625281b02161a3da0a844dbac" ]
[ "generative.py" ]
[ "\"\"\"\nThis is just me working my way through the keras tutorial\nfor researchers: \nhttps://keras.io/getting_started/intro_to_keras_for_researchers/\n\nI've read up to the heading 'Layer gradients'\n\"\"\"\n\n# conda create -n tf tensorflow\n# conda activate tf #(or switch to interpreter in env tf)\n\n# %%\nimpo...
[ [ "tensorflow.exp", "tensorflow.zeros", "tensorflow.GradientTape", "tensorflow.random.normal", "tensorflow.ones", "tensorflow.Variable", "tensorflow.random.uniform", "tensorflow.constant", "tensorflow.square" ] ]
mhd53/retinanet-from-torch
[ "656afde34c5a281a10160151c9e036718eb4a716", "656afde34c5a281a10160151c9e036718eb4a716" ]
[ "tests/model/obj_utils/test_matcher.py", "model/obj_utils/box_regression.py" ]
[ "import random\nimport pytest\nimport torch\n\nfrom model.backbone.resnet import resnet50\nfrom model.backbone.fpn import retinanet_fpn_resnet\nfrom model.obj_utils.anchor_generator import AnchorBoxGenerator\nfrom model.obj_utils.matcher import Matcher\nfrom utils.box_utils import cat_boxes, pairwise_iou\n\nBATCH_S...
[ [ "torch.allclose", "torch.tensor", "torch.randn" ], [ "torch.stack", "torch.clamp", "torch.zeros_like", "torch.log", "torch.exp" ] ]
agnim25/models
[ "56fb88ac4de29d0e8eb6762bffc8bf4f83ae56d6" ]
[ "orbit/standard_runner.py" ]
[ "# Copyright 2020 The Orbit 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 ...
[ [ "tensorflow.function", "tensorflow.nest.map_structure" ] ]
zhqu1148980644/hictools
[ "ad9ad76e3ad00691e0fc9786fc10787450686e55" ]
[ "hictools/tad.py" ]
[ "\"\"\"Tools for topological associated domain analysis.\"\"\"\n\nfrom copy import copy\nfrom functools import total_ordering\nfrom typing import Union, Tuple, List, Optional\n\nimport numpy as np\nfrom scipy import sparse\n\nfrom .utils.numtools import mask_array, get_diag, cumsum2d\nfrom .utils.utils import suppr...
[ [ "numpy.concatenate", "numpy.full", "numpy.square", "numpy.array", "numpy.isnan", "numpy.zeros", "numpy.triu", "numpy.mean", "numpy.sign", "numpy.nanmean", "numpy.arange", "scipy.ndimage.gaussian_filter1d", "numpy.sqrt", "numpy.isfinite", "numpy.hstack" ...
RakhithJK/pandas
[ "0eeda645212c240d6cbdef8e3ba4834c3763553b", "0eeda645212c240d6cbdef8e3ba4834c3763553b", "0eeda645212c240d6cbdef8e3ba4834c3763553b" ]
[ "pandas/io/parsers/c_parser_wrapper.py", "pandas/tests/indexes/object/test_indexing.py", "pandas/core/util/numba_.py" ]
[ "from __future__ import annotations\n\nimport warnings\n\nimport numpy as np\n\nimport pandas._libs.parsers as parsers\nfrom pandas._typing import (\n ArrayLike,\n FilePathOrBuffer,\n)\nfrom pandas.errors import DtypeWarning\n\nfrom pandas.core.dtypes.common import (\n is_categorical_dtype,\n pandas_dty...
[ [ "numpy.concatenate", "pandas.core.dtypes.concat.union_categoricals", "numpy.find_common_type", "pandas.io.parsers.base_parser.ParserBase.__init__", "pandas.io.parsers.base_parser.is_index_col", "pandas.core.dtypes.common.pandas_dtype", "pandas._libs.parsers.TextReader", "pandas.cor...
deepdad/NASLib-1
[ "6c93788f145187fe8cda446531f5b9f98e4ab48b" ]
[ "naslib/search_spaces/core/primitives.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\n\nfrom abc import ABCMeta, abstractmethod\n\nclass AbstractPrimitive(nn.Module, metaclass=ABCMeta):\n \"\"\"\n Use this class when creating new operations for edges.\n\n This is required because we are agnostic to operations\n at...
[ [ "torch.cat", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
def670/lfd
[ "ecc6b934db098c0b1af9946454917b6dc911cb74" ]
[ "lfd/tpsopt/transformations.py" ]
[ "import numpy as np\nimport pycuda.gpuarray as gpuarray\nimport pycuda.driver as drv\nimport scipy.linalg\n\nimport tps\nfrom lfd.tpsopt.culinalg_exts import gemm, get_gpu_ptrs, dot_batch_nocheck\n\n\nclass NoGPUTPSSolver(object):\n \"\"\"\n class to fit a thin plate spline to data using precomputed\n matr...
[ [ "numpy.asfarray", "numpy.array", "numpy.zeros", "numpy.ones", "numpy.eye", "numpy.allclose", "numpy.linalg.svd", "numpy.diag", "numpy.empty_like" ] ]
thangbk2209/mfea_autoscaling
[ "5b9425331734a93a38b4f73cafd11456c5e1fcf7" ]
[ "mutitask_gaussion_process_draf2.py" ]
[ "# example of bayesian optimization for a 1d function from scratch\nimport math\nfrom math import pi\nfrom operator import indexOf\n\nfrom mpl_toolkits.mplot3d import Axes3D\nimport numpy as np\nfrom numpy import arange\nfrom numpy import vstack\nfrom numpy import argmax, argmin\nfrom numpy import asarray\nfrom num...
[ [ "numpy.array", "numpy.random.choice", "numpy.random.rand", "numpy.core.fromnumeric.argmin", "sklearn.gaussian_process.GaussianProcessRegressor", "scipy.stats.norm.cdf", "numpy.vstack" ] ]
Lincoln-Zhou/U-Net-TensorFlow
[ "370e6dfe3c26483b43c65076b38f02db39375d6a" ]
[ "train.py" ]
[ "\"\"\"\r\nCopyright 2022 Lincoln Zhou, zhoulang731@gmail.com\r\n\r\nThis script demonstrates training multi-class semantic segmentation model on custom dataset, using U-Net architecture.\r\n\r\nPlease refer to U-Net paper: https://arxiv.org/abs/1505.04597\r\n\r\nThe scripts in this repo partially use code from: ht...
[ [ "tensorflow.keras.utils.to_categorical", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.load", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "tensorflow.keras.callbacks.ModelCheckpoint", "matplotlib.pyplot.ylabel", "sklearn.model_selection.train_test_spli...
emajidev/simple-python-neural-network
[ "9d69f19f84601161757164ffe4759feefeeef98f" ]
[ "neuNetwork.py" ]
[ "import numpy as np\n\nfrom data_prep import features, targets, features_test, targets_test\nfrom colors import Color\n\ndef sigmoid(x):\n return 1/(1+np.exp(-x))\n\n\n# hyperparameters\nn_hidden = 2 # number of unity hide layer\nn_trining_test = 1000 # number of interactions on training test\nalpha = 0.05 # ...
[ [ "numpy.random.normal", "numpy.dot", "numpy.matmul", "numpy.zeros", "numpy.exp", "numpy.mean" ] ]
xcjthu/DisputeMJJD
[ "bfc33da517e472ff7b8d58c8fd3ffbf5d71388a4" ]
[ "train.py" ]
[ "import argparse\r\nimport os\r\nimport torch\r\nimport logging\r\n\r\nfrom tools.init_tool import init_all\r\nfrom config_parser import create_config\r\nfrom tools.train_tool import train\r\n\r\nlogging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s',\r\n datefmt='%m/...
[ [ "torch.cuda.set_device", "torch.cuda.is_available" ] ]
liyuan9988/DeepFeatureIV
[ "54b04e9e9e4c88d4859ea65d34ceb69dd1b58bc2" ]
[ "src/models/DeepGMM/model.py" ]
[ "from typing import List, Optional\nimport torch\nfrom torch import nn\nimport numpy as np\nimport logging\n\nfrom src.utils.pytorch_linear_reg_utils import fit_linear, linear_reg_pred, outer_prod, add_const_col\nfrom src.data.data_class import TrainDataSet, TestDataSet, TrainDataSetTorch, TestDataSetTorch\n\nlogge...
[ [ "torch.norm", "torch.no_grad", "torch.tensor" ] ]
bot-motion/gap_sdk
[ "bd117a8a4b5384b2b889f72effbfed4f7f938a88", "bd117a8a4b5384b2b889f72effbfed4f7f938a88" ]
[ "examples/nntool/kws/model/training/input_data.py", "tools/nntool/importer/onnx/handlers/backend/expand.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.io_ops.read_file", "tensorflow.clip_by_value", "tensorflow.contrib.framework.python.ops.audio_ops.encode_wav", "tensorflow.logging.info", "tensorflow.python.ops.io_ops.write_file", "numpy.random.randint", "tensorflow.pad", "tensorflow.add", "numpy.reshape...
ink1/stylegan2-ada
[ "9405b644a4c7df034f9351ca1f42921ab0596997" ]
[ "dnnlib/tflib/ops/fused_bias_act.py" ]
[ "# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# NVIDIA CORPORATION and its licensors retain all intellectual property\n# and proprietary rights in and to this software, related documentation\n# and any modifications thereto. Any use, reproduction, disclosure or\n# distribution of this softwa...
[ [ "tensorflow.convert_to_tensor", "numpy.asarray", "tensorflow.nn.relu", "tensorflow.nn.leaky_relu", "tensorflow.constant", "tensorflow.nn.selu", "tensorflow.clip_by_value", "tensorflow.nn.softplus", "numpy.sqrt", "tensorflow.nn.elu", "tensorflow.nn.tanh", "tensorflow...
rimmartin/cctbx_project
[ "644090f9432d9afc22cfb542fc3ab78ca8e15e5d", "644090f9432d9afc22cfb542fc3ab78ca8e15e5d", "644090f9432d9afc22cfb542fc3ab78ca8e15e5d" ]
[ "mmtbx/ions/svm/utils.py", "iota/components/iota_ui_frames.py", "xfel/cxi/cspad_ana/cspad_tbx.py" ]
[ "# -*- coding: utf-8; py-indent-offset: 2 -*-\n\"\"\"\nUtility functions used within this module.\n\"\"\"\nfrom __future__ import division\n\ntry : # XXX required third-party dependencies\n import numpy as np\nexcept ImportError :\n np = None\n\nfrom libtbx import Auto\nfrom mmtbx.ions import server\nfrom mmtbx.i...
[ [ "numpy.array" ], [ "numpy.max", "numpy.ceil", "numpy.isnan", "numpy.array", "numpy.zeros", "numpy.round", "numpy.sum", "numpy.median", "matplotlib.backends.backend_wxagg.FigureCanvasWxAgg", "numpy.mean", "matplotlib.rc", "numpy.nanmin", "matplotlib.color...
MightyErnie/jax
[ "86232d33fd8cf454e8cfe550ab7cad977dab33d0" ]
[ "jax/experimental/host_callback.py" ]
[ "# Copyright 2020 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 ...
[ [ "numpy.array2string" ] ]
xiaohu2015/Deep-Learning-TensorFlow
[ "ae0a9c00bc0a12e4a797e3965573e7c35c5fb72f" ]
[ "command_line/run_dbn.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport os\n\nimport config\n\nfrom yadlt.models.rbm_models import dbn\nfrom yadlt.utils import datasets, utilities\n\n# #################### #\n# Flags definition #\n# #################### #\nflags = tf.app.flags\nFLAGS = flags.FLAGS\n\n# Global configuration\nflags...
[ [ "numpy.load" ] ]
yasin-gh/Deep-Learning-for-Computer-Vision
[ "d5b3e153369018029270a6a47349ee8ce7c7641e" ]
[ "Chapter05/1_segnet.py" ]
[ "import tensorflow as tf\n\ninput_height = 360\ninput_width = 480\nkernel = 3\nfilter_size = 64\npad = 1\npool_size = 2\n\nmodel = tf.keras.models.Sequential()\nmodel.add(tf.keras.layers.Layer(input_shape=(3, input_height, input_width)))\n\n# encoder\nmodel.add(tf.keras.layers.ZeroPadding2D(padding=(pad, pad)))\nmo...
[ [ "tensorflow.keras.layers.Permute", "tensorflow.keras.layers.Layer", "tensorflow.keras.layers.UpSampling2D", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.Ze...
turanoo/q2-feature-table
[ "477006030e4339b2a70198cb661e5ddb8e8f1a60" ]
[ "q2_feature_table/_core_features/_visualizer.py" ]
[ "# ----------------------------------------------------------------------------\n# Copyright (c) 2016-2018, QIIME 2 development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file LICENSE, distributed with this software.\n# -------------------------------------...
[ [ "pandas.DataFrame", "numpy.linspace", "numpy.count_nonzero", "pandas.Series" ] ]
paprocki-r/spotlight
[ "a7dd31bf5e225b9e8ec8dc6ffcd0f2093d43336c" ]
[ "spotlight/losses.py" ]
[ "\"\"\"\nLoss functions for recommender models.\n\nThe pointwise, BPR, and hinge losses are a good fit for\nimplicit feedback models trained through negative sampling.\n\nThe regression and Poisson losses are used for explicit feedback\nmodels.\n\"\"\"\n\nimport torch\n\nimport torch.nn.functional as F\n\nfrom spot...
[ [ "torch.nn.functional.binary_cross_entropy_with_logits", "torch.nn.functional.sigmoid", "torch.max", "torch.clamp", "torch.log" ] ]
mozanunal/SparseCT
[ "97d7f06c0414f934c7fa36023adcf9fe4c071eaf" ]
[ "sparse_ct/reconstructor_2d/iterative.py" ]
[ "\n\nfrom tqdm import tqdm\nimport matplotlib.pyplot as plt\nfrom skimage.transform import iradon, iradon_sart\nfrom skimage.restoration import denoise_tv_bregman\nfrom bm3d import bm3d\n\nfrom sparse_ct.loss.tv import tv_2d_l2\nfrom .base import Reconstructor\n\n\nclass SartReconstructor(Reconstructor):\n def _...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.figure" ] ]
saahiluppal/image_captioning
[ "fac82f9b4004b1dd39ccf89760b758ad19a2dbee" ]
[ "models/backbone.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nfrom collections import OrderedDict\n\nimport torch\nimport torch.nn.functional as F\nimport torchvision\nfrom torch import nn\nfrom torchvision.models._utils import IntermediateLayerGetter\nfrom typing import Dict, List\n\nfrom .utils import ...
[ [ "torch.zeros", "torch.ones" ] ]
jzenn/probnum
[ "cb9e5ec07384913049a312ac62cfec88970f1c8d", "cb9e5ec07384913049a312ac62cfec88970f1c8d" ]
[ "src/probnum/filtsmooth/gaussfiltsmooth/iterated_component.py", "src/probnum/linalg/linearsolvers/matrixbased.py" ]
[ "import numpy as np\n\nimport probnum.statespace as pnss\n\nfrom .stoppingcriterion import StoppingCriterion\n\n\nclass IteratedDiscreteComponent(pnss.Transition):\n \"\"\"Iterated updates.\n\n Examples\n --------\n >>> from probnum.filtsmooth import DiscreteEKFComponent, StoppingCriterion\n >>> from...
[ [ "numpy.ones" ], [ "numpy.zeros_like", "numpy.linalg.norm", "numpy.trace", "numpy.log", "numpy.linalg.inv", "numpy.exp", "numpy.mean", "numpy.arange", "numpy.einsum", "numpy.sqrt", "numpy.linalg.solve", "numpy.repeat", "numpy.hstack", "numpy.squeeze",...
z422684562/pytorch-pretrained-BERT
[ "5cd0a3db927b3b9232187674aad98d04f505cece" ]
[ "tests/modeling_test.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl...
[ [ "torch.tensor" ] ]
mehdirezaie/FFTLog-and-beyond
[ "91d40fb616d9e4e43365044f597345316ecf63da" ]
[ "notebook/test.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\nfrom modules import init_cosmology, init_sample, Model\n\ndef test_cl_rsd():\n ell = np.arange(2, 500) \n \n # Anna Porredon\n cl_anna = np.loadtxt('C_ells_bin1_1_linear.txt')\n\n # Mehdi Rezaie\n cosmo = init_cosmology() \n z, b, dN...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "numpy.loadtxt", "numpy.arange", "matplotlib.pyplot.loglog" ] ]
bark-simulator/rl
[ "84f9c74b60becbc4bc758e19b201d85a21880717" ]
[ "bark_ml/library_wrappers/lib_tf_agents/agents/ppo_agent.py" ]
[ "# Copyright (c) 2020 fortiss GmbH\n#\n# Authors: Patrick Hart\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 tensorflow as tf\n\n# tfa\nfrom tf_agents.networks import actor_distribution_network\nfrom tf_agents.networks import valu...
[ [ "tensorflow.compat.v1.train.AdamOptimizer" ] ]
jdehotin/Theano
[ "0477d6356e4c5ceb5c3c03585e59d2e85abfcd02" ]
[ "theano/gpuarray/dnn.py" ]
[ "from __future__ import absolute_import, print_function, division\nimport ctypes\nimport os\nimport sys\nimport warnings\n\nimport numpy\nfrom six import integer_types\n\nimport theano\nfrom theano import Op, Apply, tensor, config, Variable\nfrom theano.scalar import as_scalar, constant, Log, get_scalar_type\nfrom ...
[ [ "numpy.asarray", "numpy.dtype" ] ]
MattHJensen/Tax-Brain
[ "a467ccd21350cfcd0a67514f2f37adbc5565e19e" ]
[ "taxbrain/utils.py" ]
[ "\"\"\"\nHelper functions for the various taxbrain modules\n\"\"\"\nimport pandas as pd\nimport numpy as np\nfrom bokeh.plotting import figure\nfrom bokeh.models import ColumnDataSource, NumeralTickFormatter\nfrom bokeh.palettes import GnBu5\nfrom collections import defaultdict\n\n\ndef weighted_sum(df, var, wt=\"s...
[ [ "pandas.DataFrame", "numpy.where" ] ]
sarambl/OAS-ERF
[ "7510c21a630748eda2961608166227ad77935a67" ]
[ "oas_erf/util/slice_average/one_val_tab.py" ]
[ "import sys\nfrom pathlib import Path\n\nfrom matplotlib import pyplot\n\nfrom oas_erf.constants import path_data_info\nfrom oas_erf.util.slice_average.avg_pkg import yearly_mean_dic\nimport pandas as pd\nfrom oas_erf.data_info import get_nice_name_case, simulation_types\nfrom oas_erf.util.naming_conventions.var_in...
[ [ "pandas.DataFrame" ] ]
pphilio/facenet
[ "09e31850ab4fa93284dc386ce67e1c95c7ffde10" ]
[ "src/align/detect_face.py" ]
[ "\"\"\" Tensorflow implementation of the face detection / alignment algorithm found at\nhttps://github.com/kpzhang93/MTCNN_face_detection_alignment\n\"\"\"\n# MIT License\n# \n# Copyright (c) 2016 David Sandberg\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software ...
[ [ "tensorflow.exp", "tensorflow.nn.conv2d", "numpy.minimum", "numpy.tile", "numpy.load", "tensorflow.reshape", "numpy.where", "numpy.zeros_like", "numpy.empty", "numpy.flipud", "tensorflow.variable_scope", "numpy.transpose", "numpy.append", "tensorflow.nn.bias...
Zeroto521/compress
[ "88776f1757116d9e1ebac244e5ccf66c3b711268" ]
[ "compress.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCompress\n=====\nThe extreme value is obtained at the interval endpoint for convex function,\nand therefore the endpoint degree of a sample is measured by making\nthe unstable cuts of all attributes according to the basic property.\n\nExample\n----------------------------\n >>> ...
[ [ "numpy.stack", "numpy.apply_along_axis", "numpy.argsort" ] ]
FahadMostafa91/gradient_descent
[ "e2114b1ac40ceaa71c2d7098c1d0275ad1e1978b" ]
[ "Gradient_Descent.py" ]
[ "# -*- coding: utf-8 -*-\r\n# gradient descent without tuning, no epsilon in the gamma = float(np.matmul((x-xprev).T,(d-dprev)))/den**2\r\n# gamma = float(np.matmul((x-xprev).T,(d-dprev)))/den**2 + epsilon; if we add epsilon then it will tune\r\n# Gradient descent for minimizing a function - Barzilai-Borwein method...
[ [ "numpy.linalg.norm", "numpy.matmul", "numpy.zeros", "numpy.copy", "numpy.absolute" ] ]
sorooshafiee/Regularization-via-Transportation
[ "dda94ff3496000bc2d77fdcb2c352cbecea3dcc0" ]
[ "PASCAL VOC/config.py" ]
[ "import numpy as np\r\nfrom scipy.io import loadmat\r\nfrom collections import namedtuple\r\n\r\nDIR_IMDB = './imdb/'\r\nDIR_DATA = '/home/shafieez/data/'\r\nDATASET = ['train', 'val', 'test']\r\nBATCH_SIZE = 10\r\nNUM_CLASSES = 20\r\n\r\n\r\n############################# IMDB file #############################\r\n...
[ [ "numpy.concatenate", "scipy.io.loadmat", "numpy.squeeze" ] ]
certiware/posemaro
[ "3f9bed71dd4a1053ea27bed1a85f2ff01fdcf800" ]
[ "tests/test_widerface_format.py" ]
[ "from unittest import TestCase\nimport os.path as osp\n\nimport numpy as np\n\nfrom datumaro.components.dataset import Dataset\nfrom datumaro.components.extractor import Bbox, DatasetItem, Label\nfrom datumaro.plugins.widerface_format import (\n WiderFaceConverter, WiderFaceImporter,\n)\nfrom datumaro.util.image...
[ [ "numpy.ones", "numpy.zeros" ] ]
swight-prc/TimeSynth
[ "9b10a276e90fee145c9f69c15195d028c78214bf" ]
[ "timesynth/signals/pseudoperiodic.py" ]
[ "import numpy as np\nfrom .base_signal import BaseSignal\n\n__all__ = ['PseudoPeriodic']\n\n\nclass PseudoPeriodic(BaseSignal):\n \"\"\"Signal generator for pseudoeriodic waves. \n \n The wave's amplitude and frequency have some stochasticity that \n can be set manually.\n\n Parameters\n ---------...
[ [ "numpy.multiply", "numpy.random.normal", "numpy.sin" ] ]
jlee24/live_mapillary
[ "d2960e6c2149d371b11fc132ecc16fd110e95be4" ]
[ "models/graphcnn/layers.py" ]
[ "from graphcnn.helper import *\nimport tensorflow.compat.v1 as tf\nimport numpy as np\nimport math\nimport sys\n#from tensorflow.contrib.layers.python.layers import utils\ntf.disable_v2_behavior()\n \ndef make_variable(name, shape, initializer=tf.compat.v1.truncated_normal_initializer(), regularizer=None):\...
[ [ "tensorflow.compat.v1.nn.moments", "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.shape", "tensorflow.compat.v1.matmul", "tensorflow.compat.v1.identity", "tensorflow.compat.v1.reduce_sum", "tensorflow.compat.v1.constant_initializer", "tensorflow.compat.v1.reshape...
bdvllrs/curiosity-driven-rl-agents
[ "d9158a67813bef871f6389f3f59f9c5e94a3d419" ]
[ "main.py" ]
[ "import os\nfrom datetime import datetime\nimport numpy as np\nimport torch\nfrom tqdm import tqdm\nfrom sim import Env, ACAgent, CuriousACAgent, DQNAgent, CuriousDQNAgent\nfrom utils import config, Memory, Metrics, save_figs, logger\n\ndevice = torch.device(\"cpu\")\nif config().learning.cuda and torch.cuda.is_ava...
[ [ "torch.device", "torch.FloatTensor", "torch.cuda.is_available", "numpy.save" ] ]
seo3650/video-question-answering
[ "fd796a5b470bb1303ebeb3d8de957451ec83700d" ]
[ "run_esa.py" ]
[ "\"\"\"Evaluate E-SA.\"\"\"\r\nimport os\r\nimport argparse\r\n\r\nimport numpy as np\r\nimport tensorflow as tf\r\nimport pandas as pd\r\nfrom pandas import Series, DataFrame\r\n\r\nfrom model.esa import ESA\r\nimport config as cfg\r\nimport util.dataset as dt\r\n\r\n\r\ndef train(epoch, dataset, config, log_dir):...
[ [ "tensorflow.Summary", "numpy.add", "tensorflow.train.latest_checkpoint", "numpy.sum", "pandas.DataFrame", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.Graph", "pandas.read_json", "pandas.Series", "tensorflow.summary.FileWriter", "tensorflow.global_var...
spencerjolly/RPLB-acc
[ "98d240586c7417f5818b8dc1282ed9628645b5f9" ]
[ "RPLB_acc_LC_2D.py" ]
[ "import numpy as np\nfrom numba import jit\n\n@jit(nopython=True)\ndef RPLB_acc_LC_2D(lambda_0, tau_0, w_0, P, Psi_0, phi_2, phi_3, z_0, r_0, beta_0, tau_p):\n # initialize constants (SI units)\n c = 2.99792458e8 #speed of light\n m_e = 9.10938356e-31\n q_e = 1.60217662e-19\n e_0 = 8.85418782e-12\n ...
[ [ "numpy.round", "numpy.sum", "numpy.exp", "numpy.real", "numpy.arctan", "numpy.sqrt", "numpy.linspace" ] ]
williamhyin/nikzak_test
[ "7d6b964ca4f19b5ef0e8f21e8ff2365cb21a8ecb" ]
[ "efficientdet/keras/train_lib.py" ]
[ "# Copyright 2020 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.keras.callbacks.TensorBoard", "tensorflow.keras.optimizers.SGD", "tensorflow.io.read_file", "tensorflow.reshape", "tensorflow.tile", "tensorflow.one_hot", "tensorflow.image.decode_jpeg", "tensorflow.cast", "tensorflow.shape", "tensorflow.GradientTape", "tens...
lidongyv/PSSM
[ "61ef78bc465fd53fb128d0aa1b913f787c8c7f74" ]
[ "back of PSSM/PSSM/pre_matching-20180827182637.py" ]
[ "# -*- coding: utf-8 -*-\n# @Author: yulidong\n# @Date: 2018-07-18 18:49:15\n# @Last Modified by: yulidong\n# @Last Modified time: 2018-08-27 16:51:53\nimport numpy as np\nimport os\nimport time\nimport matplotlib.pyplot as plt\nfrom multiprocessing import Process,Lock\nfrom multiprocessing import Pool\nthread_...
[ [ "numpy.max", "numpy.array", "numpy.zeros_like", "numpy.ones_like", "numpy.sum", "numpy.min", "numpy.where", "numpy.argmax", "numpy.floor" ] ]
florianfelice/pleas
[ "c25374f36b781ac726bbbc6da21a559499844594" ]
[ "statinf/stats/tests.py" ]
[ "import numpy as np\nimport math\nimport warnings\nfrom scipy import stats as scp\n\nfrom . import descriptive as desc\nfrom ..misc import test_summary, format_object\n\n\n# One sample Student test\ndef ttest(x, mu=0, alpha=0.05, is_bernoulli=False, two_sided=True, return_tuple=False):\n \"\"\"One sample Student...
[ [ "numpy.random.chisquare", "numpy.random.exponential", "numpy.sort", "scipy.stats.kstwobign.ppf", "scipy.stats.t.ppf", "numpy.concatenate", "numpy.random.normal", "numpy.random.poisson", "scipy.stats.find_repeats", "numpy.sqrt", "scipy.stats.norm.sf", "scipy.stats.no...
ufukkurt/Federated-Learning-PyTorch
[ "5b3502715cda9b08722bbdd664d89baf7d44c928" ]
[ "src/update.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Python version: 3.6\n\nimport torch\nfrom torch import nn\nfrom torch.utils.data import DataLoader, Dataset\n\nclass DatasetSplit(Dataset):\n \"\"\"An abstract Dataset class wrapped around Pytorch Dataset class.\n \"\"\"\n\n def __init__(self, dataset, idx...
[ [ "torch.nn.NLLLoss", "torch.eq", "torch.max", "torch.tensor", "torch.utils.data.DataLoader", "torch.nn.CrossEntropyLoss" ] ]
maxiuw/FcmBci
[ "718047cddf796c41ac77b55905a5d1bfcd966d0f" ]
[ "fcmpy/expert_fcm/expert_based_fcm.py" ]
[ "import numpy as np \nimport pandas as pd\nimport functools\nimport collections\nfrom abc import ABC, abstractmethod\nfrom fcmpy.expert_fcm.input_validator import type_check\nfrom fcmpy.store.methodsStore import EntropyStore\nfrom fcmpy.store.methodsStore import ReaderStore\nfrom fcmpy.store.methodsStore import Mem...
[ [ "pandas.DataFrame" ] ]
HitkoDev/facenet
[ "c13a49b53ec6ba5673be76ae51c162ea79c2d702" ]
[ "tmp/network.py" ]
[ "\"\"\"Functions for building the face recognition network.\n\"\"\"\n# MIT License\n# \n# Copyright (c) 2016 David Sandberg\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 withou...
[ [ "tensorflow.nn.conv2d", "tensorflow.compat.v1.nn.relu_layer", "tensorflow.nn.moments", "tensorflow.sqrt", "tensorflow.nn.max_pool2d", "tensorflow.control_dependencies", "tensorflow.compat.v1.constant_initializer", "tensorflow.identity", "tensorflow.compat.v1.name_scope", "t...
luzpaz/pyNastran
[ "939e9eefdc87a3bf67939a23dc09f155b93969a0", "939e9eefdc87a3bf67939a23dc09f155b93969a0", "939e9eefdc87a3bf67939a23dc09f155b93969a0", "939e9eefdc87a3bf67939a23dc09f155b93969a0" ]
[ "pyNastran/op2/tables/geom/subcase.py", "pyNastran/op2/tables/oes_stressStrain/real/oes_solids.py", "pyNastran/dev/bdf_vectorized/bdf_interface2/write_mesh.py", "pyNastran/op2/tables/geom/contact.py" ]
[ "import numpy as np\nfrom pyNastran.bdf.subcase import Subcase\nfrom pyNastran.op2.op2_interface.op2_reader import reshape_bytes_block # , reshape_bytes_block_size\n\n\ndef set_casecc(self, data: bytes, idtype: str, fdtype: str, size: int=4,\n nastran_format: str='nx'):\n \"\"\"\n Word Name Type...
[ [ "numpy.frombuffer" ], [ "numpy.full", "numpy.empty", "numpy.array_equal", "numpy.zeros", "pandas.DataFrame", "numpy.linalg.eigh", "pandas.MultiIndex.from_arrays", "numpy.float32", "numpy.where", "numpy.linalg.eigvalsh", "numpy.sqrt", "numpy.searchsorted", ...
ishine/efficient-knnlm
[ "e614f1e2e7da9c83994e99c82fd10f054fa08b4b" ]
[ "moe_modules/lstm.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom .mlp import LeakyReLUNet\n\n\nclass LSTMMOE(nn.Module):\n def __init__(self,\n feature_size=None,\n hidden_units=32,\n nlayers=3,\n dropout=0,\n non_ctxt_dim=1024,\n cuda=T...
[ [ "torch.nn.Linear", "torch.device", "torch.nn.LogSoftmax", "torch.zeros", "torch.nn.LSTM", "torch.cat", "torch.nn.ModuleDict" ] ]
miaohanwen/3D-ResNets-PyTorch
[ "722222c407bfa6b2446237376cd0001743ac8ea7" ]
[ "datasets/videodataset.py" ]
[ "import json\nfrom pathlib import Path\n\nimport torch\nimport torch.utils.data as data\n\nfrom .loader import VideoLoader\nimport os\n\n\ndef get_database(root_path, video_path_formatter):\n video_paths = []\n video_list = os.listdir(root_path)\n for video in video_list:\n video_paths.append(video_...
[ [ "torch.stack" ] ]
ntkhoa95/Self-Supervised-Label-Generator
[ "32c0a913242fb3371ec4eb08ce384cbc8a70a60c" ]
[ "SSLG_original.py" ]
[ "import os, cv2, timeit\r\nfrom utils import *\r\nimport matplotlib.pyplot as plt\r\n\r\n### Setting folder and image path\r\ndata_path = \"datasets\"\r\nimage_name = \"example04.png\"\r\n\r\nprint(f\"[INFO]...Processing image [{image_name}]\")\r\ntic = timeit.default_timer()\r\n### Reading RGB Image\r\nrgb_image =...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.title", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
mnichol3/glm-cases
[ "73b936b3a4f640ecfa8a762ba0f6afc4521c30bb" ]
[ "src/plotting_utils.py" ]
[ "import numpy as np\nfrom os.path import join, isdir, isfile\nfrom os import mkdir\nimport re\nfrom pyproj import Geod\nfrom math import sin, cos, sqrt, atan2, radians\nfrom sys import exit\nfrom functools import partial\nfrom shapely.geometry import Point, LineString\nfrom shapely.ops import transform\nimport pypr...
[ [ "numpy.array", "numpy.savetxt", "numpy.memmap", "numpy.loadtxt", "numpy.vstack", "numpy.linspace", "numpy.meshgrid", "numpy.empty_like" ] ]
jinyeom/ga-plastic-models
[ "e38b245ae51c35a5f32679cc9f215463a3d58f1a" ]
[ "main.py" ]
[ "# xvfb-run -a -s \"-screen 0 1400x900x24 +extension RANDR\" -- python main.py\n\nfrom multiprocessing import set_start_method\nimport random\nimport numpy as np\nimport torch\nimport gym\nfrom utils import Arguments, Experiment\nfrom ga import ga_run\n\ntorch.set_num_threads(1)\n\n# disable OpenAI Gym logger\ngym....
[ [ "numpy.random.seed", "torch.manual_seed", "torch.set_num_threads" ] ]
eladnoor/small-molecule-regulation
[ "83127f20859093a06ee493128d672ac7428cec83" ]
[ "python/settings.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Mar 23 16:36:02 2016\n\n@author: noore\n\"\"\"\n\nimport os, sys\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport imp\nimport json\nimport inspect\nimport urllib\nfrom contextlib import closing\n\nSCRIPT_DIR = os.path.dirname(os.path....
[ [ "numpy.max", "pandas.DataFrame", "pandas.read_excel", "numpy.min", "pandas.read_csv" ] ]
mattinjersey/ml-agents
[ "7dcf947f541d661cc4a94b0e7758e1b12c6be078" ]
[ "ml-agents/mlagents/trainers/torch/utils.py" ]
[ "from typing import List, Optional, Tuple\nfrom mlagents.torch_utils import torch, nn\nimport numpy as np\n\nfrom mlagents.trainers.torch.encoders import (\n SimpleVisualEncoder,\n ResNetVisualEncoder,\n NatureVisualEncoder,\n SmallVisualEncoder,\n VectorInput,\n)\nfrom mlagents.trainers.settings imp...
[ [ "numpy.asanyarray", "numpy.cumsum" ] ]
mapbox/nodata
[ "fa5fd9354ae1e301c39557fd5562071f8ad546e7" ]
[ "tests/test_scripts_alpha.py" ]
[ "import glob\nimport zlib\n\nimport numpy\nimport pytest\nimport rasterio\nfrom rasterio.windows import Window\n\nfrom nodata.scripts.alpha import (\n all_valid, init_worker, finalize_worker, compute_window_mask,\n NodataPoolMan)\n\n\ndef test_all_valid():\n assert (\n all_valid(numpy.empty((2, 2), ...
[ [ "numpy.empty" ] ]
konstin/bio_embeddings
[ "a7de49fd8e152f8e735283818e6f2e2de7b824c8" ]
[ "bio_embeddings/embed/prottrans_bert_base_embedder.py" ]
[ "import logging\nimport re\nfrom itertools import zip_longest\nfrom typing import List, Generator, TypeVar, Union\n\nimport torch\nfrom numpy import ndarray\nfrom transformers import BertTokenizer, AlbertTokenizer, BertModel, AlbertModel\n\nfrom bio_embeddings.embed.embedder_interfaces import EmbedderWithFallback\n...
[ [ "torch.no_grad", "torch.tensor" ] ]
rinceyuan/WeFe
[ "8482cb737cb7ba37b2856d184cd42c1bd35a6318", "8482cb737cb7ba37b2856d184cd42c1bd35a6318" ]
[ "kernel/components/lr/test/local_baseline_test.py", "kernel/components/boosting/core/feature_histogram.py" ]
[ "# Copyright 2021 Tianmian Tech. 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...
[ [ "sklearn.linear_model.LogisticRegression", "numpy.testing.assert_array_equal", "numpy.random.randint" ], [ "numpy.array", "scipy.sparse.csc_matrix", "numpy.equal.outer", "numpy.argsort", "numpy.cumsum" ] ]
minhncedutw/pointcloud-robot-grasp
[ "bb8e0109cde14081b6fe21852127d8a073ca5bc2" ]
[ "Released2019June06/GeneralUtils.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n''' Description\n'''\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\n__author__ = \"CONG-MINH NGUYEN\"\n__copyright__ = \"Copyright (C) 2019, HANDBOOK\"\n__credits__ = [\"CONG-MINH NGUYEN\"]\n__licens...
[ [ "numpy.random.random_integers", "numpy.random.choice", "numpy.asarray", "numpy.hstack", "numpy.identity", "numpy.unique", "numpy.random.random", "numpy.vstack" ] ]
bendavies99/LedFx
[ "d2b5bf3412fecb67c4e2858f83caea402a29d589" ]
[ "ledfx/devices/__init__.py" ]
[ "from ledfx.utils import BaseRegistry, RegistryLoader\nfrom abc import abstractmethod\nfrom threading import Thread\nfrom ledfx.events import DeviceUpdateEvent, Event\nimport voluptuous as vol\nimport numpy as np\nimport importlib\nimport pkgutil\nimport logging\nimport time\nimport os\nimport re\n\n_LOGGER = loggi...
[ [ "numpy.roll", "numpy.zeros", "numpy.clip" ] ]
ID3LT/cudf
[ "83ec0af4e02c4ff87ead5d943e6dd83cdd4174bd" ]
[ "python/cudf/cudf/core/column/column.py" ]
[ "# Copyright (c) 2018-2022, NVIDIA CORPORATION.\n\nfrom __future__ import annotations\n\nimport builtins\nimport pickle\nimport warnings\nfrom types import SimpleNamespace\nfrom typing import (\n Any,\n Dict,\n List,\n MutableSequence,\n Optional,\n Sequence,\n Tuple,\n TypeVar,\n Union,\...
[ [ "numpy.ceil", "numpy.array", "numpy.find_common_type", "numpy.isnan", "numpy.asarray", "pandas.StringDtype", "numpy.ascontiguousarray", "numpy.isscalar", "numpy.timedelta64", "pandas.Series", "numpy.int32", "numpy.issubdtype", "numpy.dtype", "numpy.datetime6...
tchittesh/zsl-project
[ "bfc99ccc0106ca5eebb5b674abf6fce793b26c12" ]
[ "pytorch/sje_cos_emb.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom utils import normalizeFeaturesL2\n\n\nclass SJE_CosEmb(nn.Module):\n\n def __init__(self, class_attribute_emb, img_feature_size, num_attributes, margin):\n super(SJE_CosEmb, self).__init__()\n self.margin = margin\n\n # copying initialization tech...
[ [ "torch.rand", "torch.nn.Parameter" ] ]
danielwe/numba
[ "102f177903ab8187400092dfdf5b81fa6590b239" ]
[ "numba/tests/test_inlining.py" ]
[ "from __future__ import print_function, absolute_import\n\nimport re\nimport numpy as np\n\nfrom .support import TestCase, override_config, captured_stdout\nimport numba\nfrom numba import unittest_support as unittest\nfrom numba import jit, njit, types\nfrom numba.ir_utils import guard, find_callname\nfrom numba.i...
[ [ "numpy.arange" ] ]
mmphego/aipnd-project
[ "ca59d14ff97e2d60b8a10d02cf7b3083d269e04b" ]
[ "utils.py" ]
[ "import signal\nimport sys\n\nimport json\n\nfrom contextlib import contextmanager\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport requests\n\n\nDELAY = INTERVAL = 4 * 60 # interval time in seconds\nMIN_DELAY = MIN_INTERVAL = 2 * 60\nKEEPALIVE_URL = \"https://nebula.udacity.com/api/v1/remote/keep-al...
[ [ "numpy.array", "matplotlib.pyplot.subplots", "numpy.clip" ] ]
paulmueller/nrefocus
[ "4405513fd4cd4340b507be0ba0e33f9dfc556249" ]
[ "tests/test_refocus_numpy.py" ]
[ "import pathlib\n\nimport numpy as np\n\nimport nrefocus\n\n\ndata_path = pathlib.Path(__file__).parent / \"data\"\n\n\ndef test_2d_refocus1():\n pixel_size = 1e-6\n rf = nrefocus.RefocusNumpy(field=np.arange(256).reshape(16, 16),\n wavelength=8.25*pixel_size,\n ...
[ [ "numpy.array", "numpy.loadtxt", "numpy.arange" ] ]
ktanishqk/py-earth
[ "1d8b7f76d4af873cce03772daace2254a9313871" ]
[ "examples/plot_sine_wave.py" ]
[ "\"\"\"\n=============================\nPlotting simple sine function\n=============================\n\nA simple example plotting a fit of the sine function.\n\"\"\"\nimport numpy\nimport matplotlib.pyplot as plt\n\nfrom pyearth import Earth\n\n# Create some fake data\nnumpy.random.seed(2)\nm = 10000\nn = 10\nX = 8...
[ [ "numpy.random.normal", "numpy.sin", "numpy.random.seed", "matplotlib.pyplot.plot", "numpy.random.uniform", "matplotlib.pyplot.show" ] ]
ncsu-geoforall-lab/rapid-dem-binder
[ "d420933f3c5251aafa00236e2a835f748accce07" ]
[ "rapid_dem.py" ]
[ "\"\"\"\nrapid_dem\n\"\"\"\n\n# ============ Packages ================\nimport matplotlib.pyplot as plt\nimport matplotlib.lines as mlines\nimport pandas as pd\nimport seaborn as sns\nimport numpy as np\nimport grass.script as gs\nimport grass.jupyter as gj\n\n# ============ Functions ===============\n\n\ndef u16bi...
[ [ "matplotlib.lines.Line2D", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.axvline", "pandas.read_csv", "matplotlib.pyplot.imshow" ] ]
Tensorflow-Devs/mesh
[ "8853284735ed5812dd3038cfa3d52017b42e06ca" ]
[ "mesh_tensorflow/simd_mesh_impl.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Mesh TensorFlow Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v1.zeros", "tensorflow.compat.v1.logging.info", "tensorflow.compat.v1.assign", "tensorflow.compat.v1.get_default_graph", "tensorflow.compat.v1.to_bfloat16", "tensorflow.compat.v1.get_variable_scope", "tensorflow.compat.v1.device", "tensorflow.compat.v1.reshape", ...
DevconX/Malaya
[ "a2e7030f0911d65c9c1c72d38bc3e7c53b8e06fc" ]
[ "pretrained-model/fastformer/fast_transformer.py" ]
[ "import tensorflow as tf\nimport numpy as np\nfrom einops import rearrange\nfrom einops.layers.tensorflow import Rearrange\nfrom rotary_embedding_tensorflow import RotaryEmbedding\n\nfrom fast_attention import FastAttention\n\n\ndef gelu(x):\n cdf = 0.5 * (1.0 + tf.tanh(\n (np.sqrt(2 / np.pi) * (x + 0.044...
[ [ "tensorflow.shape", "tensorflow.range", "tensorflow.keras.layers.LayerNormalization", "tensorflow.keras.layers.Embedding", "tensorflow.keras.layers.Dense", "tensorflow.squeeze", "numpy.sqrt", "tensorflow.pow" ] ]
tensor-tang/paddle-models
[ "b9c32c7774ded988377c3e0ec0101ddfdcc0218b" ]
[ "fluid/PaddleCV/deeplabv3+/train.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport os\nif 'FLAGS_fraction_of_gpu_memory_to_use' not in os.environ:\n os.environ['FLAGS_fraction_of_gpu_memory_to_use'] = '0.98'\n\nimport paddle\nimport paddle.fluid as fluid\nimport numpy as np\n...
[ [ "numpy.array", "numpy.mean" ] ]
Creling/FGCN
[ "49c5133afabb3385c07507dee8babf675eb8bb0a" ]
[ "DualGCN/data_utils.py" ]
[ "'''\nDescription: \nversion: \nAuthor: chenhao\nDate: 2021-06-09 14:17:37\n'''\nimport os\nimport sys\nsys.path.append(r'./LAL-Parser/src_joint')\nimport re\nimport json\nimport pickle\nimport numpy as np\nfrom tqdm import tqdm\nfrom transformers import BertTokenizer\nfrom torch.utils.data import Dataset\nimport r...
[ [ "numpy.max", "numpy.pad", "numpy.delete", "numpy.asarray", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.exp", "numpy.eye", "numpy.random.uniform", "numpy.diag" ] ]
stuffgora/tf-2-keras-enet-with-watercolor
[ "3d46306c3f79dfda34a92e4c6fbe104752711490" ]
[ "src/camvid_dataset_load.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Oct 14 18:23:18 2019\n\n@author: ddd\n\"\"\"\n\nimport tensorflow as tf\n#tf.enable_eager_execution()\nAUTOTUNE = tf.data.experimental.AUTOTUNE\n\nfrom pycocotools.coco import COCO\n\n#import IPython.display as display\n#from PIL import Image\...
[ [ "tensorflow.data.Dataset.from_tensor_slices", "numpy.median", "tensorflow.io.read_file", "tensorflow.reshape", "tensorflow.reverse", "tensorflow.one_hot", "tensorflow.image.decode_jpeg", "tensorflow.math.argmax", "matplotlib.pyplot.axis", "matplotlib.pyplot.subplot", "n...
stembl/vibproc
[ "2588ad7fad5309a0a56fe5ea3d0a0f4affd10911" ]
[ "src/tools/import_vib_data.py" ]
[ "## Import data with Pandas\nimport time\nimport scipy as sp\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\ndef toWindow(data):\n '''\n Asks user if the data needs to be windowed and what the window size\n should be.\n '''\n\n ncols = data.shape[1] - 1\n fig = plt.figure()\n for i in ...
[ [ "pandas.isnull", "scipy.floor", "scipy.nan_to_num", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "pandas.Panel", "scipy.mean", "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.subplot" ] ]
NOAA-GSL/adb_graphics
[ "b9a3d567efa0de5a175be8404f351b901a8f382f" ]
[ "adb_graphics/specs.py" ]
[ "# pylint: disable=too-many-public-methods\n'''\nThis module sets the specifications for certain atmospheric variables. Typically\nthis is related to a spec that needs some level of computation, i.e. a set of\ncolors from a color map.\n'''\n\nimport abc\nfrom itertools import chain\nfrom matplotlib import cm\nfrom ...
[ [ "numpy.concatenate", "numpy.full", "matplotlib.colors.to_rgba", "matplotlib.cm.get_cmap" ] ]
zyedManai/Image-search-engine
[ "0eb3c84817b324e3584326b47659a8fdcb42548e" ]
[ "searchEngine/dbIndexer.py" ]
[ "# import the necessary packages\nimport glob\nimport os\nfrom cv2 import cv2\nfrom skimage.io import imread, imshow\nfrom skimage.feature import hog\nfrom skimage.transform import resize\nimport descriptor\nimport searcher\nimport psycopg2\nimport numpy as np\nfrom pymongo import MongoClient\nfrom bson.objectid im...
[ [ "pandas.read_csv", "sklearn.cluster.KMeans" ] ]
DaphneO/stabilitylabelalgorithm
[ "a163eaede3a4fa544ef8840079db64c0f8cd7015" ]
[ "experiments/computation_time_dependent_on_l_and_r_size_layered_graphs.py" ]
[ "import itertools\nimport math\nimport multiprocessing as mp\nimport pathlib\nimport time\n\nimport matplotlib as ml\nimport matplotlib.pyplot as plt\nimport pandas\n\nfrom stability_label_algorithm.modules.argumentation.argumentation_theory.argumentation_theory import ArgumentationTheory\nfrom stability_label_algo...
[ [ "matplotlib.use", "matplotlib.pyplot.savefig", "matplotlib.pyplot.suptitle", "matplotlib.rcParams.update", "matplotlib.pyplot.tight_layout", "pandas.read_csv" ] ]
RaunakRahi/pytorch-metric-learning
[ "1525e5b7bd840967b344b3da5667297295042361" ]
[ "tests/losses/test_multi_similarity_loss.py" ]
[ "import unittest\nfrom .. import TEST_DTYPES, TEST_DEVICE\nimport torch\nfrom pytorch_metric_learning.losses import MultiSimilarityLoss\nfrom pytorch_metric_learning.utils import common_functions as c_f\n\n\nclass TestMultiSimilarityLoss(unittest.TestCase):\n def test_multi_similarity_loss(self):\n for dt...
[ [ "torch.log", "torch.isclose", "torch.matmul", "torch.LongTensor" ] ]
norikinishida/treetk
[ "bed04915c4c59492980c3b5fbd398f15c8b1ec0d" ]
[ "treetk/dtree.py" ]
[ "from collections import defaultdict\n\nimport numpy as np\n\nfrom . import treetk\n\n\nclass DependencyTree(object):\n\n def __init__(self, arcs, tokens):\n \"\"\"\n Parameters\n ----------\n arcs: list[(int, int, str)]\n tokens: list[str]\n \"\"\"\n # NOTE that ...
[ [ "numpy.abs" ] ]
echoix/pyro
[ "787920cb14e3669bc65c530fd8f91d4277a24279" ]
[ "examples/double_pendulum/double_pendulum_with_trajectory_following_sliding_mode_controller.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Nov 16 12:05:08 2018\n\n@author: Alexandre\n\"\"\"\n###############################################################################\nfrom pathlib import Path\nimport numpy as np\n###############################################################################\nfrom py...
[ [ "numpy.array" ] ]
ilkcan/search_with_machine_learning_course
[ "bbfa1aaccbda6666aae163002a572843ee1c4eeb" ]
[ "week3/createContentTrainingData.py" ]
[ "import argparse\nimport os\nimport random\nimport xml.etree.ElementTree as ET\nimport string\nfrom pathlib import Path\nfrom nltk.stem.snowball import SnowballStemmer\nimport pandas as pd\nimport sys\n\ndef getCategoryHierarchy():\n # Location for category data\n categoriesFilename = '/workspace/datasets/pro...
[ [ "pandas.DataFrame", "pandas.merge" ] ]
lithomas1/moonlight
[ "cd22d6f47bbcf043a0027e91d342ae25dfc8a30a" ]
[ "moonlight/structure/barlines_test.py" ]
[ "# Copyright 2018 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 ...
[ [ "numpy.zeros" ] ]
mcreng/cs231n
[ "60b07e6a55b4cb239931daad5e0c8c8eeed46c1f" ]
[ "PA1/cs231n/classifiers/linear_svm.py" ]
[ "import numpy as np\nfrom random import shuffle\nfrom past.builtins import xrange\n\ndef svm_loss_naive(W, X, y, reg):\n \"\"\"\n Structured SVM loss function, naive implementation (with loops).\n\n Inputs have dimension D, there are C classes, and we operate on minibatches\n of N examples.\n\n Inputs:\n - W:...
[ [ "numpy.sum", "numpy.arange", "numpy.zeros" ] ]
kailiu77/zfit
[ "00eed81fb34e0eb2e4bae5ddc9ebf38699e107ca" ]
[ "zfit/ztf/random.py" ]
[ "# Copyright (c) 2019 zfit\n\nfrom typing import Union, Iterable, Sized\n\nimport tensorflow_probability as tfp\nimport tensorflow as tf\n\n\n\nfrom .wrapping_tf import convert_to_tensor\nfrom ..util.container import convert_to_container\n\n__all__ = [\"counts_multinomial\"]\n\n\ndef counts_multinomial(total_count...
[ [ "tensorflow.convert_to_tensor", "tensorflow.cast", "tensorflow.control_dependencies" ] ]
ATestGroup233/mindspore
[ "5d81221b5896cf7d7c6adb44daef28d92cb43352" ]
[ "mindspore/compression/quant/quant_utils.py" ]
[ "# Copyright 2020 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.concatenate", "numpy.zeros", "numpy.minimum", "numpy.round", "numpy.sum", "numpy.copy", "numpy.ones", "numpy.argmin", "numpy.interp", "numpy.sqrt", "numpy.maximum", "numpy.cumsum", "numpy.abs", "numpy.linspace", "numpy.log2", "numpy.floor" ]...
muronglengjing/sound-wave
[ "b6d75f11f015bc422460be1df79a36234a64afb1" ]
[ "New function/new function wave 1.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\n# var\nL = 5\nW = 5\n\n# const var\npi = 3.1415926\n\n# wave\nA = 0.6\nu = 343\nv = 40000\n_lambda = u / v\nw = 2 * pi * v\nk = 2 * pi / _lambda\nT = 2 * pi / w\nrho = 1.293\n\n\n# translate into real distance\ndef r(x0, y0, x1=0, y1=0):\n return np.sqrt((x...
[ [ "matplotlib.pyplot.colorbar", "matplotlib.pyplot.contourf", "numpy.zeros", "numpy.log", "matplotlib.pyplot.title", "numpy.sqrt", "numpy.abs", "matplotlib.pyplot.show", "numpy.maximum" ] ]
LennartKoe/oggm
[ "4228340db0bd9e96667738dcbb9f29ef840940de" ]
[ "oggm/tests/test_prepro.py" ]
[ "import unittest\nimport os\nimport shutil\nfrom packaging.version import Version\nimport pytest\nimport warnings\n\nimport shapely.geometry as shpg\nimport numpy as np\nimport pandas as pd\nimport xarray as xr\n\nsalem = pytest.importorskip('salem')\nrasterio = pytest.importorskip('rasterio')\ngpd = pytest.importo...
[ [ "numpy.testing.assert_allclose", "numpy.argmin", "numpy.rint", "scipy.stats.linregress", "numpy.min", "numpy.mean", "numpy.where", "numpy.deg2rad", "numpy.gradient", "numpy.max", "numpy.histogram", "pandas.DataFrame", "numpy.nonzero", "numpy.arange", "nu...
shivp950/InnerEye-DeepLearning
[ "12b496093097ef48d5ac8880985c04918d7f76fe" ]
[ "Tests/ML/configs/ClassificationModelForTesting.py" ]
[ "# ------------------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.\n# -----------------------------------------------------------...
[ [ "torch.nn.Sigmoid" ] ]
Sahar2/qiskit-aqua
[ "a228fbe6b9613cff43e47796a7e4843deba2b051", "a228fbe6b9613cff43e47796a7e4843deba2b051" ]
[ "qiskit/aqua/algorithms/classical/svm/_svm_classical_binary.py", "qiskit/aqua/operators/matrix_operator.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2019.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE...
[ [ "numpy.array", "numpy.int", "numpy.zeros", "sklearn.metrics.pairwise.rbf_kernel", "numpy.load", "numpy.sign", "numpy.savez", "numpy.vstack" ], [ "scipy.sparse.issparse", "scipy.sparse.isspmatrix_csr", "numpy.absolute", "numpy.all", "scipy.sparse.csr_matrix",...
graphbuilder/BNN
[ "d99eb5c7ef19f8b0c14a135d40a489f154a3c894" ]
[ "train/main_mask_prune_v1.py" ]
[ "\n'''\nprune: \nckp-prune-v1/\nAcc:81% \nSparsity:55%\n\nAcc:82%\nSparsity:60%\n\n'''\n\nfrom __future__ import print_function\nimport argparse\nimport os\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\nfrom torch.aut...
[ [ "torch.cuda.manual_seed", "torch.autograd.Variable", "torch.no_grad", "torch.std", "torch.manual_seed", "torch.cuda.set_device", "torch.abs", "torch.cuda.is_available", "torch.utils.data.DataLoader", "numpy.argwhere", "torch.nn.CrossEntropyLoss" ] ]
GeertLitjens/advent-of-code-2021
[ "4a4f2cfddbd7aeb839498fb4e7a916e1b429b590" ]
[ "day22/solution.py" ]
[ "\"\"\"\n\"\"\"\n\nfrom utils import Solution\nfrom typing import Any\nimport numpy as np\nfrom collections import Counter\n\n\nclass DaySolution(Solution):\n def __init__(self, day: int = 22, year: int = 2021) -> None:\n super().__init__(day, year)\n\n def _parse_data(self, input_data: str) -> Any:\n ...
[ [ "numpy.zeros" ] ]
luolovehk/UpdateNetFunds
[ "911892b05b2eac08ee4a284920dea448b166dd42" ]
[ "draw_bar.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport csv\n\n\ndef draw_bar(filename=\"FUNDS.csv\"):\n # 从文件里获取记录,日期,现价和投入\n # filename = 'myFundTotal.csv' #统计信息存到这个文件啦\n with open(filename, 'r') as f:\n reader = csv.reader(f)\n header_row = next(reader) # 获取每一行文件的数据\n\n funds,...
[ [ "matplotlib.pyplot.rcdefaults", "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
tantara/tpu
[ "18bfb21486ea1ad3ac5ff89ede42a248e371ce82" ]
[ "models/official/mnasnet/mnasnet_models.py" ]
[ "# Copyright 2018 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.variable_scope", "tensorflow.identity", "tensorflow.expand_dims" ] ]
ashishpatel26/finch
[ "bf2958c0f268575e5d51ad08fbc08b151cbea962", "bf2958c0f268575e5d51ad08fbc08b151cbea962" ]
[ "src_nlp/tensorflow/depreciated/concat_conv_1d_text_clf.py", "src_nlp/tensorflow/toward_control/mains/train.py" ]
[ "from base_text_clf import BaseTextClassifier\n\nimport tensorflow as tf\n\n\nclass Conv1DClassifier(BaseTextClassifier):\n def __init__(self, seq_len, vocab_size, n_out, sess=tf.Session(),\n n_filters=250, embedding_dims=50):\n self.seq_len = seq_len\n self.vocab_size = vocab_size\...
[ [ "tensorflow.train.AdamOptimizer", "tensorflow.concat", "tensorflow.argmax", "tensorflow.Session", "tensorflow.layers.conv1d", "tensorflow.placeholder", "tensorflow.get_variable", "tensorflow.nn.embedding_lookup", "tensorflow.layers.dense", "tensorflow.nn.dropout", "tens...
Mckysse/AGAN
[ "67dd049828681a1ea6acb6bf3e7247651109c17b" ]
[ "GAIN/model/ner_model.py" ]
[ "from typing import List, Any\n\nimport pytorch_lightning.core.lightning as pl\n\nimport torch\nimport torch.nn.functional as F\nimport numpy as np\n\nfrom allennlp.modules import ConditionalRandomField\nfrom allennlp.modules.conditional_random_field import allowed_transitions\nfrom torch import nn\nfrom torch.util...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.optim.AdamW", "torch.nn.LSTM", "torch.cat", "torch.nn.functional.log_softmax", "torch.utils.data.DataLoader", "torch.nn.functional.softmax", "torch.nn.functional.leaky_relu" ] ]
hex-plex/Light-Gun.apk
[ "1187b2504bab33a646e93e0ae8ad16489f2b4e7a" ]
[ "Win-py/thres.py" ]
[ "import cv2\nimport numpy as np\n\ncam = cv2.VideoCapture(\"http://192.168.43.1:8080/video\")\n\nlow=np.array([149,20,150])## This detects the ir led found in my tv remote but can t be used to do so any setup\nhigh=np.array([151,50,255])\n\nwhile True:\n frame = cam.read()[1]\n frame=cv2.cvtColor(frame,cv2.CO...
[ [ "numpy.array" ] ]
boldjoel/tensorlayer
[ "bb52f4fc40ec88b55fcfcea38a3d4f36a5573541" ]
[ "tensorlayer/layers/core.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport time\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.util.deprecation import deprecated\n\nfrom .. import _logging as logging\nfrom .. import files, iterate, utils, visualize\n\nfrom ..deprecation import deprecated_alias\n\n__all__ = [\n 'LayersConfig',\n...
[ [ "tensorflow.constant_initializer", "numpy.median", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.nn.embedding_lookup", "tensorflow.one_hot", "tensorflow.global_variables_initializer", "tensorflow.nn.nce_loss", "tensorflow.divide", "tensorflow.trainable_variables", ...