repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
MotasemAlfarra/Combating-Adversaries-with-Anti-Adversaries
[ "71d82c4274b9c03abbab0570bf2fccec6e7d124d" ]
[ "Anti_Adv.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass anti_adversary_wrapper(nn.Module):\n def __init__(self, model, mean=None, std=None, k=0, alpha=1, device='cuda'):\n super(anti_adversary_wrapper, self).__init__()\n self.model = model\n self.normalize = False\n ...
[ [ "torch.enable_grad", "torch.nn.Parameter", "torch.autograd.grad", "torch.tensor", "torch.zeros_like" ] ]
akshaybahadur21/MathEw
[ "15bd0ab11bdb3139b03ed8f7fdef8e16f43461a0" ]
[ "src/MathewApp.py" ]
[ "from collections import deque\n\nimport cv2\nimport mediapipe as mp\nimport numpy as np\n\nfrom src.MathewModel import MathewModel\nfrom src.utils.cv_utils import get_idx_to_coordinates, rescale_frame\nfrom src.utils.utils import solve_eqn\n\n\nclass MathewApp:\n def __init__(self):\n self.mp_drawing = m...
[ [ "numpy.zeros" ] ]
fargetan/manim
[ "6eed2763308955bdb9debff0d74ee48893ef8a69", "6eed2763308955bdb9debff0d74ee48893ef8a69" ]
[ "manim/mobject/opengl_mobject.py", "manim/animation/indication.py" ]
[ "import copy\nimport itertools as it\nimport random\nimport sys\nfrom functools import wraps\nfrom math import ceil\nfrom typing import Iterable, Optional, Tuple, Union\n\nimport moderngl\nimport numpy as np\nfrom colour import Color\n\nfrom .. import config\nfrom ..constants import *\nfrom ..utils.bezier import in...
[ [ "numpy.repeat", "numpy.array", "numpy.linalg.norm", "numpy.dot", "numpy.zeros", "numpy.eye", "numpy.identity", "numpy.sign", "numpy.transpose", "numpy.arange", "numpy.abs", "numpy.all", "numpy.linspace", "numpy.cross", "numpy.vstack" ], [ "numpy....
yx0123/monodepth-cpp
[ "cbaa711e1e7fa4cb5be49dcc49383f9df6e51831" ]
[ "freeze_graph/freeze_graph.py" ]
[ "\"\"\"\nThis file is part of monodepth-cpp\n\nMIT License\n\nCopyright (c) 2018 Shing Yan Loo (lsyan@ualberta.ca)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, in...
[ [ "tensorflow.get_default_graph", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.gfile.GFile", "tensorflow.ConfigProto", "tensorflow.placeholder", "tensorflow.local_variables_initializer", "tensorflow.global_variables_initializer", "tensorflow.graph_util.remove_train...
HamidL/stylegan2-ada-pytorch
[ "46aa027d72b305c8a2219ad4cfd2f6fd19fcf848" ]
[ "torch_utils/ops/bias_act.py" ]
[ "# Copyright (c) 2021, 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...
[ [ "torch.nn.functional.selu", "torch.sigmoid", "torch.nn.functional.softplus", "torch.tanh", "torch.nn.functional.elu", "numpy.sqrt", "torch.nn.functional.relu", "torch.empty", "torch.nn.functional.leaky_relu" ] ]
cwsmith/parseKokkosMemEvents
[ "8ae87ea1db5a1eb7304b704544e6717f0754b0bb" ]
[ "memEventParse.py" ]
[ "import pyparsing as pp\nimport sys\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nif len(sys.argv) is not 4:\n print(\"Usage:\", sys.argv[0],\n \"<mem-events file> <max regions> <output plot>\")\n sys.exit(1)\n\nfilepath = sys.argv[1]\nwith open(filepath) as f:\n lines = f.read()\n\ninteg...
[ [ "pandas.DataFrame", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure" ] ]
collinzrj/keras
[ "79e9e20d8b95f043cd8a3a240b70928d468a60ac", "79e9e20d8b95f043cd8a3a240b70928d468a60ac", "79e9e20d8b95f043cd8a3a240b70928d468a60ac" ]
[ "keras/losses_test.py", "keras/layers/preprocessing/category_encoding.py", "keras/saving/saving_utils.py" ]
[ "# Copyright 2016 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...
[ [ "numpy.minimum", "tensorflow.compat.v2.cast", "numpy.exp", "numpy.mean", "numpy.multiply", "numpy.random.random", "tensorflow.compat.v2.compat.v1.test.mock.patch.object", "tensorflow.compat.v2.test.main", "numpy.log", "numpy.random.randint", "numpy.square", "numpy.a...
RaoulMa/NeuralNets
[ "f49072ac88686f753f9b5815d6cc5e71d536c3d2", "f49072ac88686f753f9b5815d6cc5e71d536c3d2" ]
[ "temporal_difference/sarsamax.py", "rnn/recurrent.py" ]
[ "import sys\nimport gym\nimport numpy as np\nimport random\nimport math\nfrom collections import defaultdict, deque\nimport matplotlib.pyplot as plt\n\nfrom plot_utils import plot_values\n\ndef epsilon_greedy(Q, state, nA, eps):\n \"\"\"Selects epsilon-greedy action for supplied state.\n\n Params\n ======\...
[ [ "numpy.max", "numpy.asarray", "numpy.zeros", "matplotlib.pyplot.xlabel", "numpy.mean", "numpy.argmax", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ], [ "numpy.concatenate", "numpy.ndenumerate", "numpy.asarray", "numpy.zeros", "sc...
Project-Xtended/external_armnn
[ "c5e1bbf9fc8ecbb8c9eb073a1550d4c8c15fce94" ]
[ "python/pyarmnn/test/test_tf_parser.py" ]
[ "# Copyright © 2020 Arm Ltd. All rights reserved.\n# SPDX-License-Identifier: MIT\nimport os\n\nimport pytest\nimport pyarmnn as ann\nimport numpy as np\n\n\n@pytest.fixture()\ndef parser(shared_data_folder):\n \"\"\"\n Parse and setup the test network to be used for the tests below\n \"\"\"\n\n # creat...
[ [ "numpy.testing.assert_almost_equal" ] ]
rowetechinc/QRevPy
[ "d82e18bcd8183c16ed2a9f57639933fac133624b" ]
[ "Classes/RtbRowe.py" ]
[ "import os\nimport re\nimport logging\nimport numpy as np\nimport struct\nimport binascii\nimport math\n\n\nclass RtbRowe(object):\n \"\"\"\n Class to read data from RTB files\n\n Single file to read in RTB data, then create an list of objects. The lists will contain all the\n data from the file.\n\n ...
[ [ "numpy.full", "numpy.isnan", "numpy.empty", "numpy.reshape", "numpy.zeros", "numpy.tile", "numpy.floor" ] ]
trouleau/pypop
[ "a9b22ad02e890e250fb91a8dc32a9dfde3d4e3de" ]
[ "pypop/models/wold/_wold_var_fixed_beta.py" ]
[ "import math\nimport numba\nimport numpy as np\n\nfrom . import WoldModel\nfrom ...utils.decorators import enforce_observed\nfrom ...fitter import FitterIterativeNumpy\n\nPARALLEL = False\n\n\n@numba.jit(nopython=True, fastmath=True, parallel=PARALLEL)\ndef digamma(arr, eps=1e-8):\n \"\"\"Digamma function (arr i...
[ [ "numpy.zeros_like", "numpy.log", "numpy.zeros", "numpy.ones", "numpy.exp", "numpy.diff" ] ]
DouglasAbrams/remixt
[ "2ab9b034e6b4ff86cdfbc6272f9ce6b9a9311439" ]
[ "remixt/tests/test_model.py" ]
[ "import unittest\nimport itertools\nimport numpy as np\nimport scipy.misc\n\nimport remixt.tests.unopt.model\nimport remixt.vhmm\nimport remixt.model3\nimport remixt.tests.test_remixt\nimport remixt.likelihood\nimport remixt.cn_model\n\n\nnp.random.seed(2014)\n\n\ncn_max = 3\nnum_clones = 3\nnum_alleles = 2\n\n\nde...
[ [ "numpy.random.dirichlet", "numpy.square", "numpy.array", "numpy.empty", "numpy.random.choice", "numpy.zeros", "numpy.random.rand", "numpy.random.seed", "numpy.asarray", "numpy.random.poisson", "numpy.exp", "numpy.random.uniform", "numpy.random.randint", "num...
TolyaTalamanov/open_model_zoo
[ "2543996541346418919c5cddfb71e33e2cdef080", "2543996541346418919c5cddfb71e33e2cdef080" ]
[ "tools/accuracy_checker/openvino/tools/accuracy_checker/metrics/classification.py", "models/public/deblurgan-v2/model.py" ]
[ "\"\"\"\nCopyright (c) 2018-2022 Intel Corporation\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 ...
[ [ "numpy.mean", "numpy.where", "numpy.cumsum", "numpy.concatenate", "numpy.max", "numpy.zeros_like", "numpy.transpose", "numpy.trapz", "numpy.sqrt", "numpy.ndim", "numpy.array", "numpy.zeros", "numpy.round", "numpy.diff", "numpy.isscalar", "numpy.argso...
basnijholt/pyvista
[ "b1786b99217137e2c67566f5c09374c7a810f597" ]
[ "tests/utilities/test_common.py" ]
[ "\"\"\" Tests for pyvista.utilities.common.\"\"\"\n\nimport numpy as np\nimport pytest\n\nfrom pyvista.utilities.common import _coerce_pointslike_arg\n\n\ndef test_coerce_point_like_arg():\n # Test with Sequence\n point = [1.0, 2.0, 3.0]\n coerced_arg = _coerce_pointslike_arg(point)\n assert isinstance(...
[ [ "numpy.array", "numpy.empty" ] ]
martinruenz/pytorch3d
[ "7f1e63aed1252ba8145d4a66ce2272331d60cdae" ]
[ "pytorch3d/ops/graph_conv.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\n\nimport torch\nimport torch.nn as nn\nfrom pytorch3d import _C\nfrom torch.autograd import Function\nfrom torch.autograd.function import once_differentiable\n\n\nclass GraphConv(nn.Module):\n \"\"\"A single graph convolution layer.\"\"\...
[ [ "torch.zeros_like", "torch.nn.init.normal_", "torch.cuda.is_available", "torch.nn.Linear" ] ]
boada/ICD
[ "c1bfedf5f8e5b0e9f77c6d1194bf1e0266d7efd8" ]
[ "sandbox/legacy_plot_code/add_hist_lines.py" ]
[ "#!/usr/bin/env python\n# File: add_hist_lines.py\n# Created on: Mon Oct 22 14:56:24 2012\n# Last Change: Mon Oct 22 15:36:16 2012\n# Purpose of script: <+INSERT+>\n# Author: Steven Boada\n\nfrom hist_overlap import hist_overlap\nfrom mk_galaxy_struc import mk_galaxy_struc\nimport numpy as np\n\n# make some bins\ns...
[ [ "numpy.arange" ] ]
mattadendorff/prince
[ "6b83b51fe84dda59f4642b68e77559545dee3c70" ]
[ "prince/mfa.py" ]
[ "\"\"\"Multiple Factor Analysis (MFA)\"\"\"\nimport itertools\nimport numpy as np\nimport pandas as pd\nfrom sklearn import utils\n\nfrom . import mca\nfrom . import pca\n\n\nclass MFA(pca.PCA):\n\n def __init__(self, groups=None, rescale_with_mean=True, rescale_with_std=True, n_components=2,\n n...
[ [ "sklearn.utils.validation.check_is_fitted", "pandas.DataFrame", "pandas.api.types.is_numeric_dtype", "pandas.api.types.is_string_dtype", "sklearn.utils.check_array" ] ]
shreepads/numpy
[ "2f790d8768095a7c237794eaff31b8ae4a0411f9" ]
[ "numpy/distutils/fcompiler/gnu.py" ]
[ "import re\nimport os\nimport sys\nimport warnings\nimport platform\nimport tempfile\nimport hashlib\nimport base64\nimport subprocess\nfrom subprocess import Popen, PIPE, STDOUT\nfrom numpy.distutils.exec_command import filepath_from_subprocess_output\nfrom numpy.distutils.fcompiler import FCompiler\n\ncompilers =...
[ [ "numpy.distutils.exec_command.filepath_from_subprocess_output", "numpy.distutils.customized_fcompiler" ] ]
sunxb05/pyTS
[ "72246a997e1a20824809cfa46e943f18c0721924" ]
[ "pyts/tools/builders/rl_cartesian_builder.py" ]
[ "import tensorflow as tf\nfrom tensorflow.keras import Model\nfrom tensorflow.keras.layers import Input, Lambda, Add, Dense, Flatten\n\nfrom .rl_multi_trunk_builder import DualTrunkBuilder\nfrom ...layers.utility_layers import MaskedDistanceMatrix\n\n\nclass RlCartesianBuilder(DualTrunkBuilder):\n def __init__(s...
[ [ "tensorflow.keras.layers.Add", "tensorflow.keras.layers.Lambda", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Dense", "tensorflow.keras.Model", "tensorflow.squeeze", "tensorflow.linalg.band_part" ] ]
acdick/understanding_genetic_algorithms
[ "2609446dd7790287baf4e949d6c9407bca2391a3" ]
[ "src/battleship.py" ]
[ "import numpy as np\n\n# generate battleship board and solution\ndef new_board():\n \n # create a clear board\n dim = 10\n board = np.zeros((dim, dim), dtype=int)\n\n # randomly place ships on the board\n ship_lengths = [5, 4, 3, 3, 2]\n\n # for each ship\n for ship_length in ship_lengths:\n...
[ [ "numpy.random.randint", "numpy.zeros" ] ]
qibinc/CogQA
[ "d49c3b9ac93bad54d48c91e0aacb4d6f7f8b3791" ]
[ "dataset.py" ]
[ "import re\nimport json\nfrom tqdm import tqdm, trange\nimport pdb\nimport random\nfrom collections import namedtuple\nimport numpy as np\nimport copy\nimport traceback\nimport torch\nfrom torch.optim import Adam\nfrom torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler\nfrom pytorch...
[ [ "numpy.random.permutation", "torch.eye" ] ]
klemenkotar/dcrl
[ "457be7af1389db37ec12e165dfad646e17359162" ]
[ "allenact_plugins/minigrid_plugin/minigrid_sensors.py" ]
[ "from typing import Optional, Any, cast\n\nimport gym\nimport gym_minigrid.minigrid\nimport numpy as np\nimport torch\nfrom babyai.utils.format import InstructionsPreprocessor\nfrom gym_minigrid.minigrid import MiniGridEnv\n\nfrom allenact.base_abstractions.sensor import Sensor, prepare_locals_for_super\nfrom allen...
[ [ "torch.nn.functional.pad" ] ]
gyan42/spark-streaming-playground
[ "147ef9cbc31b7aed242663dee36143ebf0e8043f" ]
[ "src/ssp/ml/metrics.py" ]
[ "#!/usr/bin/env python\n\n__author__ = \"Mageswaran Dhandapani\"\n__copyright__ = \"Copyright 2020, The Spark Structured Playground Project\"\n__credits__ = []\n__license__ = \"Apache License\"\n__version__ = \"2.0\"\n__maintainer__ = \"Mageswaran Dhandapani\"\n__email__ = \"mageswaran1989@gmail.com\"\n__status__ =...
[ [ "sklearn.metrics.precision_score", "sklearn.metrics.f1_score", "sklearn.metrics.recall_score", "sklearn.metrics.accuracy_score" ] ]
HerrKevin/pyade
[ "d9ed64abefde4dbcf24a17fbd98bb1362881e06e" ]
[ "pyade/lshade.py" ]
[ "import pyade.commons\nimport numpy as np\nimport scipy.stats\nimport random\nfrom typing import Callable, Union, Dict, Any\n\n\ndef get_default_params(dim: int):\n \"\"\"\n Returns the default parameters of the L-SHADE Differential Evolution Algorithm.\n :param dim: Size of the problem (or individ...
[ [ "numpy.random.normal", "numpy.isnan", "numpy.random.choice", "numpy.argmin", "numpy.random.seed", "numpy.sum", "numpy.ones", "numpy.abs", "numpy.clip", "numpy.argsort" ] ]
mfuntowicz/flax
[ "385e9a41f483f6f4997c602ad570b2418e32568f" ]
[ "tests/nn_test.py" ]
[ "# Copyright 2020 The Flax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.full" ] ]
ramittal/MRTool
[ "d9e1557620ac740d758bb99b6c24e9f283354eef" ]
[ "src/mrtool/core/model.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n model\n ~~~~~\n\n Model module for mrtool package.\n\"\"\"\nfrom typing import List, Tuple, Union\nfrom copy import deepcopy\nimport numpy as np\nimport pandas as pd\nfrom .data import MRData\nfrom .cov_model import CovModel\nfrom . import utils\n\ntry:\n from limetr i...
[ [ "numpy.isposinf", "numpy.min", "numpy.max", "numpy.prod", "numpy.arange", "numpy.sqrt", "numpy.random.multinomial", "numpy.vstack", "numpy.array", "numpy.zeros", "numpy.percentile", "numpy.random.randn", "numpy.argsort", "numpy.hstack", "numpy.sum", ...
jamesrosstwo/DIF-Net
[ "bbde7030f8280a1f23af84ada07c31f5d7630b7d" ]
[ "train.py" ]
[ "# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n\n\"\"\"Training script for DIF-Net.\n\"\"\"\n\nimport sys\nimport os\n\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nimport yaml\nimport io\nimport numpy as np\nimport dataset, utils, training_loop, loss,...
[ [ "torch.utils.data.DataLoader", "torch.nn.DataParallel" ] ]
Hyunmok-Park/GNN_hyunmok
[ "86e722ab9754b64819a3016f2530e3629a160565", "86e722ab9754b64819a3016f2530e3629a160565" ]
[ "utils/hyper_grid.py", "dataset/gen_test_V.py" ]
[ "import numpy as np\nimport yaml\n\n\nclass HyperGrid(object):\n \"\"\" Generate Hyper-parameter Grid \"\"\"\n\n def __init__(self, key, val, bind_key=None):\n \"\"\"\n key: list, hyper-parameter name, e.g., [\"learning_rate\", \"momentum\"]\n val: list, hyper-parameter values, e.g., [[0.01, 0.001], ...
[ [ "numpy.concatenate", "numpy.expand_dims" ], [ "scipy.sparse.coo_matrix", "numpy.array", "numpy.random.RandomState", "numpy.nonzero", "numpy.sqrt" ] ]
Stillerman/MusicTransformer-pytorch
[ "73abb7cab271beba042b7b6fc06a6a9aaee82e8c" ]
[ "advanced/train/dpc.py" ]
[ "import sys\nimport os\nsys.path.append(os.path.abspath('.'))\n\nfrom model import MusicTransformer\nimport custom\nfrom custom.metrics import *\nfrom custom.criterion import SmoothCrossEntropyLoss, CustomSchedule, TransformerLoss\nfrom custom.config import config\nfrom custom.parallel import DataParallelModel, Dat...
[ [ "torch.device", "torch.cuda.is_available", "torch.from_numpy", "torch.cuda.device_count" ] ]
daip13/LPC_MOT
[ "2fb7657278b33eb82a537537c2534de68c3d0277" ]
[ "learnable_proposal_classifier/svonline/algorithms/simple_online_method.py" ]
[ "import os\nimport sys\nimport json\nimport numpy as np\nfrom abc import ABCMeta, abstractmethod\nfrom scipy.optimize import linear_sum_assignment\nsys.path.append(os.path.join(os.path.dirname(__file__), \"../\"))\nfrom core.graph import Graph, BipartiteMatchingGraph\nfrom core.node import nodes_in_time, split_node...
[ [ "numpy.where" ] ]
joequant/libact
[ "e37e9ed6c36febe701d84b2d495c958ab02f0bc8" ]
[ "libact/query_strategies/tests/test_uncertainty_sampling.py" ]
[ "import unittest\n\nimport numpy as np\nfrom numpy.testing import assert_array_equal\n\nfrom libact.base.dataset import Dataset\nfrom libact.models import LogisticRegression, SVM, Perceptron\nfrom libact.query_strategies import UncertaintySampling, QUIRE\nfrom libact.labelers import IdealLabeler\n\n\ndef init_toyex...
[ [ "numpy.concatenate", "numpy.array" ] ]
lennyvarghese/ANLffr
[ "a513713d672d57b8366ab7f1e3e6ea8aad0a064a" ]
[ "anlffr/tfr.py" ]
[ "\"\"\"A module which implements the time frequency estimation.\n\nAuthors : Hari Bharadwaj <hari@nmr.mgh.harvard.edu>\n\nLicense : BSD 3-clause\n\nMultitaper wavelet method\n\"\"\"\n\nimport warnings\nfrom math import sqrt\nimport numpy as np\nfrom scipy import linalg\nfrom scipy.fftpack import fftn, ifftn\n\nfrom...
[ [ "numpy.exp", "numpy.mean", "numpy.where", "matplotlib.pyplot.colorbar", "numpy.empty", "scipy.fftpack.fftn", "numpy.arange", "numpy.log10", "numpy.convolve", "numpy.array", "numpy.zeros", "numpy.float", "matplotlib.pyplot.title", "numpy.std", "numpy.log2...
doganjr/MarioDQN
[ "62daa390f8ee0b732275e71675a2b9eae85c43a4" ]
[ "agent_dqn.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport numpy as np\nfrom model_dqn import NetworkDQN\nfrom memory_agent import Memory\nimport os\n\nclass Agent():\n def __init__(self, gamma, eps, lr, tau, batch_size, max_mem, obs_dim, n_actions, frame_stack):\n self.device = torch.devic...
[ [ "numpy.random.choice", "torch.nn.MSELoss", "torch.cuda.is_available", "torch.tensor", "torch.load", "numpy.random.random", "torch.argmax" ] ]
meijianhan/FasterRCNNbyKeras
[ "5072561bf2d091aa0529e1c78a395f0bc2df63c5" ]
[ "lib/model/train_model.py" ]
[ "from __future__ import print_function\n#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\n# this files are temporary and need update\nimport keras\nimport keras.backend as K\nfrom keras.layers import Input\nfrom keras.models import Model\nfrom keras.utils import generic_utils\nfrom keras.optimizers import Adam, Ad...
[ [ "numpy.sum", "numpy.array", "numpy.zeros" ] ]
MONAI-Project/MONAI
[ "4c5c388e529ee45b417ee5f206041b8d0a864ab6" ]
[ "tests/test_convert_data_type.py" ]
[ "# Copyright (c) MONAI Consortium\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to in...
[ [ "numpy.array" ] ]
chenyangh/tensor2struct-public
[ "d3257cba6d76d3c658a58a78f687d986bdc755cf", "d3257cba6d76d3c658a58a78f687d986bdc755cf", "d3257cba6d76d3c658a58a78f687d986bdc755cf" ]
[ "third_party/spider/baselines/nl2code/nn/initializations.py", "tensor2struct/models/latper_encoder.py", "tensor2struct/models/spider/spider_enc_bert.py" ]
[ "import theano\nimport theano.tensor as T\nimport numpy as np\n\nfrom .utils.theano_utils import sharedX, shared_zeros, shared_ones\n\n\ndef get_fans(shape):\n fan_in = shape[0] if len(shape) == 2 else np.prod(shape[1:])\n fan_out = shape[1] if len(shape) == 2 else shape[0]\n return fan_in, fan_out\n\n\nde...
[ [ "numpy.random.normal", "numpy.random.randn", "numpy.identity", "numpy.prod", "numpy.random.uniform", "numpy.linalg.svd", "numpy.sqrt" ], [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.stack", "torch.einsum", "torch.bmm", "torch.logsumexp", "...
kvs11/GASP-python
[ "804cdfeb332020ba7b25d713477c7bffea71c6a2" ]
[ "gasp/variations.py" ]
[ "# coding: utf-8\n# Copyright (c) Henniggroup.\n# Distributed under the terms of the MIT License.\n\nfrom __future__ import division, unicode_literals, print_function\n\n\n\"\"\"\nVariations module:\n\nThis module contains the classes used to create offspring organisms from parent\norganisms. All variation classes ...
[ [ "numpy.array", "numpy.add", "numpy.cross", "numpy.abs" ] ]
chen0040/keras-recommender
[ "8d3f1b2aedfd89882190c3cd61e0f3efe6a05ecf" ]
[ "demo/temporal_content_based_filtering.py" ]
[ "import pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom keras_recommender.library.content_based_filtering import TemporalContentBasedFiltering\n\n\ndef main():\n data_dir_path = './data/ml-latest-small'\n output_dir_path = './models'\n\n records = pd.read_csv(data_dir_path + '/rati...
[ [ "sklearn.model_selection.train_test_split", "pandas.read_csv" ] ]
JiazeWang/PAConv
[ "c9c634dd5da972819656d1d2a9014145eadaf701" ]
[ "part_seg/eval_voting.py" ]
[ "from __future__ import print_function\nimport os\nimport argparse\nimport torch\nfrom util.data_util import PartNormalDataset\nfrom model.DGCNN_PAConv_vote import PAConv\nimport numpy as np\nfrom torch.utils.data import DataLoader\nfrom util.util import to_categorical, compute_overall_iou, load_cfg_from_cfg_file, ...
[ [ "torch.device", "torch.cuda.manual_seed", "numpy.zeros", "torch.no_grad", "numpy.mean", "torch.cuda.device_count", "torch.manual_seed", "torch.from_numpy", "torch.cuda.current_device", "torch.cuda.is_available", "numpy.random.uniform", "torch.utils.data.DataLoader" ...
CostasAK/cactbot-user
[ "2f9d55f660480eeeddd04ef6b172b1485ac07109" ]
[ "normalise-wav/normalise_sounds.py" ]
[ "import os\r\nimport re\r\nimport math\r\nimport numpy as np\r\nimport pyloudnorm as pyln\r\nfrom pathlib import Path\r\n\r\nfrom scipy.io import wavfile\r\n\r\n\r\nroot_path = Path(\"../wav/\")\r\nminimum_length = 712e-3\r\n\r\n\r\ndef makeWaveFloating(data):\r\n if data.dtype == np.dtype(\"uint8\"):\r\n ...
[ [ "numpy.max", "scipy.io.wavfile.read", "numpy.load", "numpy.mean", "scipy.io.wavfile.write", "numpy.dtype" ] ]
Bonjugal/keras
[ "8acde1e82e1572ff4d4ab86d10d6158bcfcc7e30" ]
[ "keras/engine/training.py" ]
[ "\"\"\"Training-related part of the Keras engine.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport warnings\nimport copy\nimport numpy as np\n\nfrom .network import Network\nfrom .base_layer import Layer\nfrom .training_utils import co...
[ [ "numpy.asarray", "numpy.expand_dims" ] ]
jacquesalice/notebooks-latest
[ "a24ff4357cc5b35e16a844a9d0fc5355957e4ca3" ]
[ "tests/testnotebooks.py" ]
[ "__version__ = '20200712'\n__author__ = 'Robert Nikutta <nikutta@noao.edu>'\n\n# imports\n\n# stdlib\nimport glob\nimport json\nimport os\nimport re\nimport time\nfrom getpass import getpass\nfrom pprint import PrettyPrinter\npp = PrettyPrinter()\npprint = pp.pprint\n\n# third party\nimport nbformat\nfrom nbconvert...
[ [ "pandas.DataFrame", "pandas.set_option" ] ]
waragai-katsunori/ColorHistogram
[ "f57c1115a94aa72387a6e40aef88b1861eb470ab" ]
[ "color_histogram/core/hist_3d.py" ]
[ "\n# -*- coding: utf-8 -*-\n## @package color_histogram.core.hist_3d\n#\n# Implementation of 3D color histograms.\n# @author tody\n# @date 2015/08/28\nfrom __future__ import division\n\nimport numpy as np\n\nfrom color_histogram.core.color_pixels import ColorPixels\nfrom color_histogram.core.hist_com...
[ [ "numpy.max", "numpy.array", "numpy.zeros", "numpy.min", "numpy.int32" ] ]
goldblum/AdversariallyRobustDistillation
[ "779ade36d612bddb0a5a705fdd74efe7571a1381" ]
[ "main.py" ]
[ "from __future__ import print_function\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.backends.cudnn as cudnn\nimport torchvision\nimport torchvision.transforms as transforms\nimport os\nimport argparse\nfrom tqdm import tqdm\nfrom models import *\n\...
[ [ "torch.nn.functional.softmax", "torch.max", "torch.no_grad", "torch.enable_grad", "torch.clamp", "torch.nn.functional.log_softmax", "torch.autograd.grad", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load", "torch.nn.KLDivLoss", "torch.zeros_like...
Yu-Yy/voxelpose-pytorch
[ "ff5ba08e88625b75f2e0b0454db4de67fb950f09" ]
[ "lib/models/cuboid_proposal_net.py" ]
[ "# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n# ------------------------------------------------------------------------------\n\nimport torch\nimport torch.nn as nn\n\nfrom models.v2...
[ [ "torch.zeros", "torch.tensor", "torch.min", "torch.sum" ] ]
BoettigerLab/scopeTest
[ "50c6601c952adf1d63c7f27b1aba8890e789c280" ]
[ "storm_control/sc_hardware/photometrics/pvcam.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nA ctypes based interface to the Photometrics PVCAM library.\n\nHazen 10/17, Alistair 10/20\n\"\"\"\nimport ctypes\nimport numpy\nimport sys\n\nimport storm_control.sc_library.halExceptions as halExceptions\nimport storm_control.sc_hardware.photometrics.pvcam_constants as pvc\n\npvcam...
[ [ "numpy.zeros" ] ]
fbi-octopus/biggles
[ "2dac4f1748ab87242951239caf274f302be1143a" ]
[ "python/biggles/random_partition.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreate random partitions\n\nCreated on Thu May 19 11:47:48 2016\n\n@author: vcn81216\n\"\"\"\n\nfrom _utilities import obs_dist\nimport numpy as np\n\nSPEED_OF_LIGHT = 3.0\n\ndef valid_link(o1, o2):\n '''Is the link between two observations valid?\n The spatial distance must ...
[ [ "numpy.array", "numpy.random.shuffle" ] ]
YuMS/tensorflow
[ "a4b352bfddd518b540c30e456f3bc0027ba9351f" ]
[ "tensorflow/python/ops/parsing_ops.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.gen_parsing_ops._parse_example", "tensorflow.python.framework.ops.NotDifferentiable", "tensorflow.python.ops.gen_parsing_ops._parse_single_sequence_example", "tensorflow.python.ops.array_ops.slice", "tensorflow.python.ops.sparse_ops.sparse_merge", "tensorflow.python....
agonopol/battleship-ai
[ "eef51e972b26e5454dfc0d3685d417cc429969b1" ]
[ "battleship/ai/dummy.py" ]
[ "from battleship.ship import Ship\nfrom battleship.grid import Grid\nfrom battleship.ai.player import Player, Outcome\nimport numpy as np\nimport random\n\n\nclass Dummy(Player):\n def __init__(self, size):\n super(Dummy, self).__init__()\n self.size = size\n self.grid = Grid(size)\n ...
[ [ "numpy.where", "numpy.zeros" ] ]
tehtea/dcscn-super-resolution
[ "c0fbbb73785a1361ef85a43ea829125d1558dbe8" ]
[ "DCSCN.py" ]
[ "\"\"\"\nPaper: \"Fast and Accurate Image Super Resolution by Deep CNN with Skip Connection and Network in Network\"\nVer: 2.0\n\nDCSCN model implementation (Transposed-CNN / Pixel Shuffler version)\nSee Detail: https://github.com/jiny2001/dcscn-super-resolution/\n\nPlease note this model is updated version of the ...
[ [ "tensorflow.train.AdagradOptimizer", "tensorflow.import_graph_def", "tensorflow.gradients", "numpy.multiply", "tensorflow.sqrt", "tensorflow.control_dependencies", "tensorflow.identity", "tensorflow.train.GradientDescentOptimizer", "tensorflow.python.client.timeline.Timeline", ...
charmerDark/qiskit-aqua
[ "c1564af8792c6664670807614a378147fd04d28f" ]
[ "qiskit/aqua/components/uncertainty_problems/multivariate_problem.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2019, 2021.\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-2.0.\n#\n# Any modificatio...
[ [ "numpy.cumsum" ] ]
CEMES-CNRS/pymodaq_plugins_amplitude
[ "cb1f5ae451bd16ebd6b0ce60b15ed8a44a7a2e2c" ]
[ "pymodaq_plugins_amplitude/daq_viewer_plugins/plugins_0D/daq_0Dviewer_AmplitudeSystemsCRC16.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jun 14 15:14:54 2018\n\n@author: Weber Sébastien\n@email: seba.weber@gmail.com\n\"\"\"\nfrom PyQt5.QtCore import pyqtSignal, QTimer, QThread\nfrom easydict import EasyDict as edict\nfrom pymodaq.daq_utils.daq_utils import ThreadCommand, getLineInfo, DataFromPlugins, ...
[ [ "numpy.array" ] ]
kapitsa2811/BTTR
[ "72a175ca927d05c7aeeec41a22c95117a0edc358" ]
[ "bttr/model/pos_enc.py" ]
[ "import math\n\nimport pytorch_lightning as pl\nimport torch\n\nTEMPERATURE = 10000.0\n\n\nclass WordPosEnc(pl.LightningModule):\n def __init__(self, d_model: int = 512, max_len=5000) -> None:\n super().__init__()\n self.d_model = d_model\n\n pe = torch.zeros(max_len, d_model)\n posit...
[ [ "torch.zeros", "torch.cos", "torch.cat", "torch.arange", "torch.sin" ] ]
wxhawkins/NestIQ
[ "3a004d330e2c68b0c7eb0b0676bc4d044e52cbe4" ]
[ "NIQ_uncompiled/source_code/niq_misc.py" ]
[ "import datetime\r\nimport json\r\nimport re\r\nimport time\r\nfrom pathlib import Path\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom bokeh.io import reset_output\r\nfrom bokeh.layouts import column, widgetbox\r\nfrom bokeh.models import HoverTool, PointDrawTool, Span\r\nfrom bokeh.models.widgets import ...
[ [ "numpy.vectorize" ] ]
Neil-Symington/AEM2SEG-Yy
[ "15f561361df12763bb7effce4ca063d89458f68f" ]
[ "src/python/aem2segy.py" ]
[ "import numpy as np\nimport segyio\nimport os\n\n# choose the vertical resampling interval\nyres = 4.0\nmax_depth = 400.\nscaling = 0.001 # convert from mS/m to S/m\n##\ninfile = r\"C:\\Users\\u77932\\Documents\\GAB\\data\\AEM\\2017_survey\\lci\\Injune_WB_MGA55.dat\"\noutdir = r\"C:\\Users\\u77932\\Documents\\GAB\\...
[ [ "numpy.max", "numpy.zeros", "numpy.min", "numpy.where", "numpy.loadtxt", "numpy.arange", "numpy.cumsum", "numpy.unique" ] ]
yakushechkin/scitldr
[ "c8090d0c8d62bafc878a0050dcfb7c33e3c54dc5" ]
[ "evaluate.py" ]
[ "import torch\nfrom fairseq.models.bart import BARTModel\nimport argparse\nfrom pprint import pprint\nfrom tqdm import tqdm\nimport os\nfrom os.path import join\nimport shutil\nimport logging\nimport numpy as np\nimport json \nimport random\nimport string\nimport files2rouge\nimport time\n\ndef test_rouge(cand, ref...
[ [ "torch.no_grad", "torch.cuda.is_available", "numpy.mean" ] ]
rknaebel/discopy-data
[ "f3713dbd770894ed9cb0889d2802f7d87c2c049c" ]
[ "discopy_data/nn/bert.py" ]
[ "from typing import List\n\nimport numpy as np\n\nfrom discopy_data.data.sentence import Sentence\nfrom discopy_data.data.token import Token\n\nsimple_map = {\n \"''\": '\"',\n \"``\": '\"',\n \"-LRB-\": \"(\",\n \"-RRB-\": \")\",\n \"-LCB-\": \"{\",\n \"-RCB-\": \"}\",\n \"n't\": \"not\"\n}\n\...
[ [ "numpy.concatenate", "numpy.array" ] ]
moneypi/model-optimization
[ "1408a1ae328304f3b5d238c41479382efb015869" ]
[ "tensorflow_model_optimization/python/core/clustering/keras/clustering_registry.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.abs", "tensorflow.reshape", "tensorflow.expand_dims" ] ]
artyompal/tpu_models
[ "639306f30e085bb1cdb5b1118a4c96a2dbe14e3e", "639306f30e085bb1cdb5b1118a4c96a2dbe14e3e" ]
[ "models/official/efficientnet/efficientnet_builder.py", "scripts/inference/inference.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.gfile.Exists", "tensorflow.logging.info", "tensorflow.gfile.GFile", "tensorflow.variable_scope", "tensorflow.gfile.MakeDirs", "tensorflow.identity" ], [ "tensorflow.saved_model.load_v2", "tensorflow.constant", "tensorflow.enable_eager_execution", "pandas.rea...
ChrisBarker-NOAA/tamoc
[ "c797cbb6fee28d788b76d21cc5b0cc0df5444ba8" ]
[ "bin/spm/spm_blowout_sim.py" ]
[ "\"\"\"\nStratified Plume Model: Blowout simulation\n===========================================\n\nUse the ``TAMOC`` `stratified_plume_model` to simulate a subsea accidental \noil spill plume. This script demonstrates the typical steps involved in \nrunning the single bubble model with petroleum fluids in the oce...
[ [ "numpy.array" ] ]
alexlib/pyImSegm
[ "eb75b48066047a9201ba45ad85f816995b35eef4" ]
[ "imsegm/utils/experiments.py" ]
[ "\"\"\"\nFramework for general experiments\n\nCopyright (C) 2014-2018 Jiri Borovec <jiri.borovec@fel.cvut.cz>\n\"\"\"\n\nimport os\nimport json\nimport copy\nimport time\nimport types\nimport logging\nimport traceback\nimport multiprocessing as mproc\n# from functools import partial\n\nimport tqdm\nimport numpy as ...
[ [ "sklearn.metrics.classification_report", "numpy.random.randint" ] ]
Cospel/BasicSR
[ "430dd1989f75b1400d77df97808b2c7896808a43" ]
[ "basicsr/models/video_recurrent_model.py" ]
[ "import torch\nfrom collections import Counter\nfrom os import path as osp\nfrom torch import distributed as dist\nfrom tqdm import tqdm\n\nfrom basicsr.metrics import calculate_metric\nfrom basicsr.utils import get_root_logger, imwrite, tensor2img\nfrom basicsr.utils.dist_util import get_dist_info\nfrom basicsr.ut...
[ [ "torch.cuda.empty_cache", "torch.distributed.barrier", "torch.no_grad", "torch.distributed.reduce" ] ]
baturaysaglam/AC-Off-POC
[ "0bf1b450190f0f16fd42423e303b0e558fd51015" ]
[ "DDPG & TD3/main.py" ]
[ "import argparse\nimport os\nimport socket\n\nimport gym\nimport numpy as np\nimport torch\n\nimport DDPG\nimport AC_Off_POC_DDPG\nimport TD3\nimport AC_Off_POC_TD3\nimport utils\n\n\n# Runs policy for X episodes and returns average reward\n# A fixed seed is used for the eval environment\ndef evaluate_policy(agent,...
[ [ "numpy.random.normal", "numpy.array", "numpy.random.seed", "torch.cuda.get_device_name", "numpy.save", "torch.manual_seed", "torch.cuda.is_available" ] ]
ZzzzzZXxxX/flask-pointnet
[ "184fde06ebc7ebf08211a997645d3c34db5ebad9" ]
[ "pointnet/data_loader.py" ]
[ "\"\"\"\r\nData generator for ModelNet40\r\nreference: https://github.com/garyli1019/pointnet-keras\r\nDate: 08/13/2018\r\nAuthor: Tianzhong\r\n\"\"\"\r\nimport numpy as np\r\nimport h5py\r\nimport random\r\nfrom keras.utils import np_utils\r\n\r\n\r\nclass DataGenerator:\r\n def __init__(self, file_name, batch_...
[ [ "numpy.array", "numpy.sin", "numpy.random.randn", "numpy.random.uniform", "numpy.cos" ] ]
kisekizzz/GraphGallery
[ "fd4a1f474c244f774397460ae95935638ef48f5b", "fd4a1f474c244f774397460ae95935638ef48f5b" ]
[ "graphgallery/nn/metrics/pytorch/accuracy.py", "graphgallery/functional/tensor/ops.py" ]
[ "import torch\r\nfrom torch import nn\r\nfrom .metric import Metric\r\n\r\n\r\nclass Accuracy(Metric):\r\n\r\n def __init__(self, name=\"accuracy\", dtype=None,\r\n reduction=\"sum\", **kwargs):\r\n super().__init__(name, dtype, **kwargs)\r\n assert reduction in {\"sum\", \"mean\", ...
[ [ "torch.tensor", "torch.sum" ], [ "numpy.asarray" ] ]
NoirChad/stylegan2-pytorch-add_profiling
[ "9adbec56872e38b6fc30ebf5827ace3e5fb691a2" ]
[ "closed_form_factorization.py" ]
[ "import argparse\nimport time\nimport torch\n\n\nif __name__ == \"__main__\":\n parser = argparse.ArgumentParser(\n description=\"Extract factor/eigenvectors of latent spaces using closed form factorization\"\n )\n\n parser.add_argument(\n \"--out\", type=str, default=\"factor.pt\", help=\"na...
[ [ "torch.cat", "torch.save", "torch.load", "torch.svd" ] ]
svlandeg/cupy
[ "484e007d5bf58a0445af2f6e7aa3fdfe0fcc2363", "484e007d5bf58a0445af2f6e7aa3fdfe0fcc2363" ]
[ "examples/gmm/gmm.py", "tests/cupyx_tests/scipy_tests/special_tests/test_gammaln.py" ]
[ "import argparse\nimport contextlib\nimport time\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy import stats\n\nimport cupy\n\n\n@contextlib.contextmanager\ndef timer(message):\n cupy.cuda.Stream.null.synchronize()\n start = time.time()\n yield\n cupy.cuda.Stream.null.synchronize()\n...
[ [ "numpy.random.normal", "numpy.random.rand", "numpy.zeros", "matplotlib.pyplot.savefig", "numpy.ones", "scipy.stats.multivariate_normal", "numpy.stack", "matplotlib.pyplot.scatter", "numpy.linspace", "matplotlib.pyplot.contour", "numpy.meshgrid" ], [ "numpy.array...
Giuseppecipolla95/landlab
[ "c59131a0c3595c9f1d42c6124b381b8892bed55d" ]
[ "landlab/components/erosion_deposition/erosion_deposition.py" ]
[ "import numpy as np\nfrom landlab import Component\nfrom .cfuncs import calculate_qs_in\n\nROOT2 = np.sqrt(2.0) # syntactic sugar for precalculated square root of 2\nTIME_STEP_FACTOR = 0.5 # factor used in simple subdivision solver\nDEFAULT_MINIMUM_TIME_STEP = 0.001 # default minimum time step duration\n\nclas...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.exp", "numpy.flipud", "numpy.where", "numpy.power", "numpy.sqrt", "numpy.amin" ] ]
yangzhou6666/authorship-detection
[ "f28701dea256da70eb8ba216c2572e1975c99b54" ]
[ "attribution/authorship_pipeline/run_preprocessing.py" ]
[ "from argparse import ArgumentParser\n\nimport numpy as np\n\nfrom preprocessing.compute_caliskan_features import compute_caliskan_features\nfrom preprocessing.compute_occurrences import compute_occurrences\nfrom preprocessing.context_split import context_split\nfrom preprocessing.merge_aliases_bipartite import mer...
[ [ "numpy.random.seed" ] ]
awesome-archive/sentence-space
[ "b986de7855527dfed639c2bd0b457f0c7c69d4ad" ]
[ "nn/scripts/plot_log.py" ]
[ "import argparse\nimport numpy\nimport matplotlib.pyplot as plt\n\n\ndef get_logs(exp, y_idx):\n train_log = numpy.loadtxt(exp + \"/log.train.csv\", delimiter=',')\n assert train_log.ndim == 2, '%d dims for train log, expected 2' % train_log.ndim\n train_x = train_log[:, 0]\n train_y = train_log[:, y_id...
[ [ "matplotlib.pyplot.show", "numpy.loadtxt", "matplotlib.pyplot.legend", "matplotlib.pyplot.plot" ] ]
spacetelescope/exovetter
[ "58786e78b7a6caf9e582ef9db5515e612166c02f" ]
[ "exovetter/modshift/modshift.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCompute Jeff Coughlin's Modshift metrics.\n\nCoughlin uses modshift to refer to both the transit significance tests, as\nwell as a suite of other, related, tests. This code only measures the\nmetrics for the transit significance measurements. So, for example,\nthe Odd Even test is ...
[ [ "numpy.argmin", "scipy.integrate.trapz", "numpy.min", "numpy.max", "numpy.concatenate", "numpy.histogram", "scipy.special.erfcinv", "numpy.arange", "numpy.argmax", "numpy.sqrt", "numpy.isfinite", "numpy.convolve", "numpy.zeros", "numpy.diff", "numpy.std"...
zacps/adversarial-robustness-toolbox
[ "9471b5f9fbca69521803244a0cf191d6b8e281b6" ]
[ "art/attacks/evasion/wasserstein.py" ]
[ "# MIT License\n#\n# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limita...
[ [ "numpy.minimum", "numpy.exp", "numpy.mean", "numpy.min", "numpy.sign", "scipy.special.lambertw", "numpy.linalg.norm", "numpy.log", "numpy.prod", "numpy.swapaxes", "numpy.argmax", "numpy.expand_dims", "numpy.square", "numpy.array", "numpy.matmul", "nu...
martinwimpff/stable-baselines3-hmlf
[ "6ffa947760f8c42a09f9ae42aa7485c608efc42d" ]
[ "stable_baselines3/common/envs/dummy_hybrid.py" ]
[ "from typing import Dict, List, Optional, Tuple\n\nimport gym\nimport numpy as np\nfrom gym.spaces import Box\n\nfrom stable_baselines3.common.spaces import SimpleHybrid\n\n\nclass DummyHybrid(gym.Env):\n \"\"\"\n Dummy environment for testing of with SimpleHybrid action spaces.\n The 'goal' of the env...
[ [ "numpy.random.normal", "numpy.zeros", "numpy.sum", "numpy.exp", "numpy.seterr", "numpy.abs" ] ]
fschmnn/pymuse
[ "91e97d03a3eb1ccc02131f4e731e6bb5df66772c", "d423fe87564115c2266389c9cae0c1fac274d091" ]
[ "src/pnlf/analyse.py", "scripts/plot_pnlf_paper.py" ]
[ "import logging # use instead of print for more control\nfrom pathlib import Path # filesystem related stuff\nimport numpy as np # numerical computations\nfrom matplotlib.pyplot import subplots, figure, savefig\nimport matplotlib.pyplot as plt\n\nfrom astropy.stats import sigma_clipped_stat...
[ [ "numpy.argmin", "numpy.exp", "numpy.mean", "numpy.where", "numpy.log", "numpy.interp", "matplotlib.pyplot.subplots", "numpy.argmax", "numpy.trapz", "numpy.sqrt", "numpy.log10", "matplotlib.pyplot.subplots_adjust", "scipy.optimize.minimize", "numpy.zeros", ...
sergiogcharles/Quant-Noisier
[ "3efbe4276999f973a7182c15daa06a5018e751a6" ]
[ "lyron-vis.py" ]
[ "import argparse\n\nfrom fairseq.models.roberta import RobertaModel\n\nimport plotly\nimport numpy as np\nimport plotly.graph_objs as go\nfrom sklearn.decomposition import PCA\n\nfrom tqdm import tqdm\n\ndef main():\n roberta_unquantized = RobertaModel.from_pretrained(\"checkpoints/roberta/rte-no-quant-noise\", ...
[ [ "sklearn.decomposition.PCA" ] ]
MartinHex/master-thesis
[ "b5077d9acce60fd42467f73df6e39c61fd3e19b2" ]
[ "Tester/MNIST_exploration.py" ]
[ "from Models.MNIST_Model import MNIST_Model as Model\nfrom Dataloaders.Mnist import Mnist as Dataloader\nfrom Clients.SGDClient import SGDClient as Client\nfrom Servers.FedKpServer import FedKpServer\nfrom Servers.FedAvgServer import FedAvgServer\nfrom Algorithms.FedAvg import FedAvg as Alg\nimport matplotlib.pyplo...
[ [ "numpy.min", "numpy.mean", "torch.cuda.current_device", "numpy.exp", "torch.cuda.is_available", "numpy.max", "pandas.DataFrame", "matplotlib.pyplot.subplots", "torch.manual_seed", "numpy.arange", "matplotlib.pyplot.tight_layout", "numpy.array", "numpy.zeros", ...
vishalbelsare/inventoryanalytics
[ "85feff8f1abaf2c29414e066eed096ac3a74973b" ]
[ "inventoryanalytics/forecasting/sma.py" ]
[ "'''\ninventoryanalytics: a Python library for Inventory Analytics\n\nAuthor: Roberto Rossi\n\nMIT License\n \nCopyright (c) 2018 Roberto Rossi\n'''\n\n# Importing everything from above\n\n#from sklearn.metrics import r2_score, median_absolute_error, mean_absolute_error\n#from sklearn.metrics import median_absolut...
[ [ "numpy.random.normal", "scipy.stats.norm.pdf", "matplotlib.pyplot.axvspan", "numpy.empty", "numpy.isnan", "numpy.random.seed", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.grid", "m...
benellis3/pymarl2
[ "0875995a0e0b9692ea64484478b369c7f6c0cf44", "0875995a0e0b9692ea64484478b369c7f6c0cf44", "0875995a0e0b9692ea64484478b369c7f6c0cf44", "0875995a0e0b9692ea64484478b369c7f6c0cf44" ]
[ "src/learners/coma_learner.py", "src/learners/max_q_learner.py", "src/modules/layer/self_atten.py", "src/learners/policy_gradient_v2.py" ]
[ "import copy\nfrom components.episode_buffer import EpisodeBatch\nfrom modules.critics.coma import COMACritic\nfrom utils.rl_utils import build_td_lambda_targets\nfrom torch.distributions import Categorical\nimport torch as th\nfrom torch.optim import Adam\n\n\nclass COMALearner:\n def __init__(self, mac, scheme...
[ [ "torch.distributions.Categorical", "torch.stack", "torch.nn.utils.clip_grad_norm_", "torch.gather", "torch.optim.Adam", "torch.zeros_like", "torch.log" ], [ "torch.stack", "torch.optim.RMSprop", "torch.gather", "torch.nn.utils.clip_grad_norm_", "torch.ones_like"...
MNBrod/KCWI_DRP
[ "9331a545879f647ed83ceb9c7d925770b254a8eb", "9331a545879f647ed83ceb9c7d925770b254a8eb" ]
[ "kcwidrp/primitives/ReadAtlas.py", "kcwidrp/core/bspline/median.py" ]
[ "from keckdrpframework.primitives.base_primitive import BasePrimitive\nfrom kcwidrp.core.bokeh_plotting import bokeh_plot\n\nfrom bokeh.plotting import figure\nfrom bokeh.models import Range1d\nimport pkg_resources\nimport os\nfrom astropy.io import fits as pf\nimport numpy as np\nfrom scipy.ndimage import gaussian...
[ [ "numpy.correlate", "scipy.interpolate.interpolate.interp1d", "numpy.arange", "scipy.ndimage.gaussian_filter1d", "numpy.nanmax" ], [ "numpy.median", "numpy.arange" ] ]
yashtailor/SALARY_PREDICTOR
[ "d0fa384400ee3d319d3cbfda8f714d6cd2ca7b69" ]
[ "SALARY_PREDICTOR.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Oct 21 14:23:40 2019\n\n@author: yash\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\ndataset = pd.read_csv('Salary_Data.csv')\nx = dataset.iloc[:,:-1].values\ny = dataset.iloc[:,1].values\n\nfrom sklearn.cross_validation import...
[ [ "pandas.read_csv", "sklearn.cross_validation.train_test_split", "sklearn.linear_model.LinearRegression" ] ]
WinstonLHS/tofu
[ "4a4e1f058bab8e7556ed9d518f90807cec605476", "4a4e1f058bab8e7556ed9d518f90807cec605476", "4a4e1f058bab8e7556ed9d518f90807cec605476", "4a4e1f058bab8e7556ed9d518f90807cec605476" ]
[ "tofu/data/_core.py", "tofu/data/_inversions_comp.py", "tofu/data/_DataCollection_class.py", "tofu/data/_spectrallines.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Built-in\nimport sys\nimport os\nimport itertools as itt\nimport copy\nimport warnings\nfrom abc import ABCMeta, abstractmethod\nimport inspect\n\n# Common\nimport numpy as np\nimport scipy.interpolate as scpinterp\nimport matplotlib.pyplot as plt\nfrom matplotlib.tri import Triangulat...
[ [ "numpy.repeat", "numpy.argmin", "numpy.tile", "numpy.min", "numpy.nanmean", "numpy.max", "numpy.full", "numpy.concatenate", "numpy.interp", "numpy.arange", "numpy.argmax", "numpy.vstack", "numpy.atleast_2d", "scipy.interpolate.interp1d", "numpy.array", ...
onlyrico/unif
[ "2732e5e4944b38ba39a9b5a14297cc91681fc4b2" ]
[ "uf/application/gpt2.py" ]
[ "# coding:=utf-8\n# Copyright 2021 Tencent. 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...
[ [ "numpy.sum", "numpy.array", "numpy.zeros", "numpy.mean" ] ]
cordercorder/NMT
[ "cbc5ad010ce04da7a82f05ad1a3b6c16f8467266" ]
[ "utils/Criterion.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass LabelSmoothingLoss(nn.Module):\n\n def __init__(self, eps: float, ignore_index: int, reduction: str = \"mean\" or \"sum\"):\n\n assert 0.0 < eps <= 1.0\n assert reduction == \"mean\" or reduction == \"sum\"\n\n super(LabelSmoothingLoss, self)._...
[ [ "torch.log_softmax" ] ]
datajoint-company/adamacs
[ "95b1d3bd928f321ad63d6e25ac4b16a0a0771c6b" ]
[ "adamacs/ingest/behavior.py" ]
[ "\"\"\"Ingest behavioral events from aux and bpod files.\nThe aux file is the only .h5 file in a scan directory.\nThe bpod file contains StimArenaMaster and is a .mat file.\"\"\"\n\nimport numpy as np\nimport h5py\nimport matplotlib.pyplot as plt\nfrom pywavesurfer import ws\nfrom ..paths import get_imaging_root_da...
[ [ "numpy.array", "numpy.arange", "numpy.argwhere", "numpy.diff" ] ]
Azureli/CompareNetwork_BIT
[ "ecea87890cc5b8316bead1d291c00a0a52d248e5" ]
[ "ucf101/ucf101_train_one_shot_vid_8frame_lian.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom torch.optim.lr_scheduler import StepLR\nimport numpy as np\nimport task_generator_vid_8lian as tg\nimport os\nimport math\nimport argparse\nimport scipy as sp\nimport scipy.stats\n\n\nimport datetime\npa...
[ [ "torch.nn.Linear", "torch.cat", "torch.optim.lr_scheduler.StepLR", "torch.nn.MaxPool3d", "torch.nn.BatchNorm2d", "numpy.mean", "torch.squeeze", "torch.transpose", "torch.nn.BatchNorm3d", "torch.nn.DataParallel", "torch.nn.MaxPool2d", "torch.autograd.Variable", "...
laisbsc/ada_chatbot
[ "d470299eff9247f9648338bfebcd4151514e47d8" ]
[ "chatbot_function.py" ]
[ "'''\r\n@author: Lauro Ribeiro\r\ndate: april | 2021\r\n'''\r\n\r\nimport nltk\r\nfrom nltk.stem import WordNetLemmatizer\r\n\r\nfrom nltk.tokenize import word_tokenize\r\n\r\nimport re\r\nimport keras\r\nimport pickle\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\nfrom keras.preprocessing.text import Tokenize...
[ [ "numpy.array", "pandas.read_csv", "numpy.argmax" ] ]
GiannisVagionakis/metrics
[ "12d0746e0e9ef9eeeca11cef1e118a156c1518ec" ]
[ "torchmetrics/functional/classification/kldivergence.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.log", "torch.clamp" ] ]
ijhan21/RAPA_ROS_PRJ
[ "ab73956bb8c0678ed53cfdd453a30ddc3a7fdece" ]
[ "src/jetbot_ros/jetbot_ros/lidar_control_img.py" ]
[ "from cv2 import threshold\nimport rclpy\nfrom rclpy.node import Node\nfrom rclpy.qos import qos_profile_sensor_data\nfrom sensor_msgs.msg import LaserScan\nimport cv2\nimport numpy as np\n\nMEAN_UNIT = 30\nTH_RANGE=50\n\nclass BasicSubscriber(Node): \n def __init__(self):\n super().__init__('lidar_sen...
[ [ "numpy.square", "numpy.uint8", "numpy.sin", "numpy.zeros", "numpy.cos" ] ]
yunyikristy/CM-ACC
[ "894b3c6874c7759d6e05418e1221f34ff5221f4a" ]
[ "main_pretrain_ori.py" ]
[ "import os\nimport sys\nimport json\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom torch import optim\nfrom torch.optim import lr_scheduler\n\nfrom opts import parse_opts\nfrom model import generate_model\nfrom mean import get_mean, get_std\nfrom spatial_transforms import (\n Compose, Normalize, S...
[ [ "torch.optim.Adam", "torch.manual_seed", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.utils.data.DataLoader", "torch.load", "torch.nn.CrossEntropyLoss" ] ]
BobLiu20/tensorflow-onnx
[ "bec7c1fd610c27d7cb22271c9fdf45d9f4ecee44" ]
[ "tools/tfgraph.py" ]
[ "# SPDX-License-Identifier: Apache-2.0\n\n\n\"\"\"Simple tool to guess inputs and outputs of a tensorflow model.\"\"\"\n\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nfrom collections import Counter\n\nimport tensorflow as tf\n\nIGNORE_INPUT = [\"Const\", \"ConstV2\", \...
[ [ "tensorflow.Graph", "tensorflow.GraphDef", "tensorflow.Session", "tensorflow.import_graph_def", "tensorflow.gfile.FastGFile" ] ]
DaitTan/PIRProjects
[ "84cc865645ecc507225575369867045c55d1997d" ]
[ "Project 3a/Source Code/proj3a_ws/src/world_simulation/scripts/turtlebot3_controller.py" ]
[ "#!/usr/bin/env python\n\n# this code is adapted from https://github.com/ROBOTIS-GIT/turtlebot3/blob/master/turtlebot3_example/nodes/turtlebot3_pointop_key\n# I was able to find the source code thanks to this thread https://answers.ros.org/question/154876/no-source-code-cpp-file-for-turtlebot/\n\nimport rospy\nfrom...
[ [ "numpy.deg2rad" ] ]
forest-snow/incremental-coref
[ "d993dccc6f6c637baba8c8848b7ddf435e5e5e49" ]
[ "simulation/active.py" ]
[ "import argparse\nimport torch\nimport numpy as np\nimport pathlib\nfrom train_active import finetune_on_queries\nfrom incremental import Incremental\nfrom inference import Predictor\nfrom score import Scorer\nimport util\nimport copy\nfrom collections import defaultdict\nimport logging\nimport json\nfrom eval_all ...
[ [ "torch.no_grad" ] ]
rui-mo/arrow-1
[ "5bea62493d919dcb97ca0f22bcb7ebfc239cee25" ]
[ "python/pyarrow/tests/test_dataset.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "pandas.testing.assert_frame_equal", "numpy.array", "pandas.DataFrame", "numpy.random.randn", "pandas.Timestamp", "numpy.repeat", "numpy.array_split" ] ]
krystianity/keras-serving
[ "553dfad47b751c0f4a38965c38d832eb58b58863" ]
[ "bigquery/train.py" ]
[ "from __future__ import print_function\n\nimport numpy as np\nimport os\nimport shutil\nimport sh\n\nfrom keras.models import Sequential\nfrom keras.layers.core import Dense, Dropout, Activation\nfrom keras.optimizers import SGD\n\nfrom google.cloud import bigquery\n\nfrom keras import backend as K\nK.set_learning_...
[ [ "numpy.array" ] ]
adamjhn/netpyne
[ "b9e104645f11fe6688496b22cd4183f463e11adc", "d5745015755855a1214e25d6033d3685cccace0d" ]
[ "netpyne/analysis/lfp.py", "examples/intervalSaving/init.py" ]
[ "\"\"\"\nModule for analyzing LFP-related results\n\n\"\"\"\n\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import unicode_literals\nfrom __future__ import absolute_import\n\nfrom builtins import range\nfrom builtins import round\nfrom builtins import str\ntry:\n basest...
[ [ "numpy.max", "numpy.array", "matplotlib.mlab.psd", "scipy.signal.spectrogram", "matplotlib.pyplot.pcolormesh", "matplotlib.pyplot.get_cmap", "numpy.mean", "numpy.arange", "numpy.amax", "numpy.amin", "numpy.log10", "numpy.meshgrid" ], [ "matplotlib.use" ] ]
orkiguazio/mlrun
[ "dea41441f77e47f87edf316e972b042e46bfa22c", "dea41441f77e47f87edf316e972b042e46bfa22c" ]
[ "mlrun/render.py", "mlrun/runtimes/utils.py" ]
[ "# Copyright 2018 Iguazio\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in ...
[ [ "pandas.DataFrame", "pandas.option_context" ], [ "pandas.io.json.json_normalize", "pandas.json_normalize" ] ]
farisachugthai/rtdpy
[ "ac5cd7100d4b8d256021acf4a358bd5c2c4c58ce" ]
[ "rtdpy/ad_oo.py" ]
[ "import numpy as np\nfrom rtdpy.rtd import RTD, RTDInputError\n\n\nclass AD_oo(RTD):\n \"\"\"\n Create Axial Dispersion with open-open boundary conditions\n Residence Time Distribution (RTD) model. [1]_\n\n .. math::\n\n E(t) = \\\\frac{\\\\sqrt{Pe}}{\\\\tau\\\\sqrt{4\\\\pi\\\\theta}}\n \\...
[ [ "numpy.finfo", "numpy.exp", "numpy.sqrt" ] ]
CORSMAL/Visual
[ "5dd86a0a6a9960da308341853caba37ada2ffc1a" ]
[ "Encoder/Dataset/generate_training_set.py" ]
[ "\"\"\" This script generates the dataset used to train the model which performs the final predictions.\nIn the following the steps:\n1. From every video, sample a frame every tot (based on the parameter).\n2. For every frame run instance segmentation model and retrieve bounding boxes, masks, scores for the selecte...
[ [ "numpy.sum", "numpy.count_nonzero", "torch.cuda.is_available" ] ]
teddyort/ros_tools
[ "2bd3865ba9011a994101f09f3fc52aef95fff0f7" ]
[ "conversions/test/path_converter_tester.py" ]
[ "#!/usr/bin/env python\nimport rosunit\nimport unittest\nimport numpy as np\nfrom geometry_msgs.msg import PoseStamped\nfrom nav_msgs.msg import Path\n\nfrom conversions import path_converter as pc\n\n\nclass PathConverterTester(unittest.TestCase):\n def setUp(self):\n # Define some default values for tes...
[ [ "numpy.random.seed", "numpy.random.rand" ] ]
jatinchowdhury18/AudioDSPy
[ "96ce0e223877cb5515f14da4f6d2ce8282d81f3c" ]
[ "audio_dspy/level_detector.py" ]
[ "import numpy as np\n\n\ndef _calc_coefs(tau_ms, fs):\n \"\"\"Calculate coefficients for exponential decay\n\n Parameters\n ----------\n tau_ms : float\n Time constant [ms]\n fs : float\n Sample rate [Hz]\n\n Returns\n -------\n b0, a1 : floats\n Coefficients\n \"\"\"...
[ [ "numpy.copy", "numpy.abs", "numpy.exp", "numpy.sqrt" ] ]