repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
bpbpublications/Neural-Network-for-Beginners
[ "aa04574e2990920e5e0a65ed5af674adc61388c1", "aa04574e2990920e5e0a65ed5af674adc61388c1" ]
[ "Chapter 03/NeuralNetwork_MNIST.py", "Chapter 01/ImgDisplay.py" ]
[ "import sys, os\nsys.path.append(os.pardir)\nimport numpy as np\nimport pickle\nfrom dataset.mnist import load_mnist\nfrom common.functions import sigmoid, softmax\n\n\ndef get_data():\n (a_train, b_train), (a_test, b_test) = load_mnist(normalize=True, flatten=True, one_hot_label=False)\n return a_test, b_tes...
[ [ "numpy.dot", "numpy.argmax" ], [ "matplotlib.image.imread", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show" ] ]
vrince/tensorflow_addons
[ "12c3de4d78fb799ff229fe413356d06b8dfc9beb", "12c3de4d78fb799ff229fe413356d06b8dfc9beb", "12c3de4d78fb799ff229fe413356d06b8dfc9beb" ]
[ "tensorflow_addons/image/transform_ops_test.py", "tensorflow_addons/optimizers/rectified_adam.py", "tensorflow_addons/layers/maxout.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.constant", "tensorflow.range", "tensorflow.zeros", "numpy.asarray", "tensorflow.cast", "tensorflow.linalg.diag", "tensorflow.test.main", "tensorflow.random.uniform", "tensorflow.ones", "tensorflow.math.cumprod", "tensorflow.tile", "tensorflow.test.comput...
magic-alt/gym-electric-motor
[ "39b63e2de79840528c24515703777a92e95edd40" ]
[ "tests/test_visualizations/human_visual_tests.py" ]
[ "from gym_electric_motor.envs.gym_pmsm import *\nimport numpy as np\n\n\n\"\"\"\ntun this script to see if the visualization looks as expected\n\"\"\"\nenv = ContPermanentMagnetSynchronousMotorEnvironment(visualization='MotorDashboard',\n plotted_variables=['omega...
[ [ "numpy.sin" ] ]
weituo12321/PREVALENT_HANNA
[ "8b3e9b591f3b002c019d5202f04dc45d186808a5" ]
[ "code/tasks/HANNA/newmodel.py" ]
[ "import sys\nimport math\nimport copy\nimport functools\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\n\nfrom ask_agent import AskAgent\nfrom verbal_ask_agent ...
[ [ "torch.nn.Dropout", "torch.norm", "torch.ones", "torch.max", "torch.zeros", "torch.cat", "torch.nn.Embedding", "torch.nn.LayerNorm", "torch.nn.Sigmoid", "torch.nn.Linear", "torch.arange", "torch.stack", "torch.nn.ReLU" ] ]
QLSong/RANSAC-Flow
[ "66d05cd25be7faf0b201a5e9c6562a9c3beb4e13" ]
[ "evaluation/evalCorr/getResults.py" ]
[ "import numpy as np\nimport torch\nimport kornia.geometry as tgm\nimport pickle\nimport os\nfrom PIL import Image\nfrom torchvision import transforms\nfrom torch.nn import functional as F\nimport cv2\nfrom pathlib import Path\nfrom tqdm import tqdm\nimport argparse \nimport pandas as pd \n\ndef alignmentError(wB, h...
[ [ "torch.linspace", "pandas.read_csv", "numpy.sum", "torch.ones", "torch.cat", "torch.from_numpy", "numpy.log10", "torch.nn.functional.interpolate", "torch.clamp", "numpy.zeros", "numpy.where" ] ]
Privacy-Police/Differential-Privacy
[ "c9ac91bf478c00af2ac732bc815ba1ee2fa7e6e5" ]
[ "patch_opacus.py" ]
[ "from typing import Union, Tuple\nfrom functools import partial\nimport numpy as np\nimport torch\nfrom opacus.layers.dp_lstm import LSTMLinear\nfrom opacus.layers.dp_multihead_attention import SequenceBias\nfrom torch import nn\nfrom torch.functional import F\n\nfrom opacus.supported_layers_grad_samplers import _s...
[ [ "torch.einsum" ] ]
alecsaunders/great_expectations
[ "e4964894fb97b933cac713ef1f1a78e33d362ff3" ]
[ "great_expectations/expectations/expectation.py" ]
[ "import logging\nimport re\nimport traceback\nimport warnings\nfrom abc import ABC, ABCMeta, abstractmethod\nfrom collections import Counter\nfrom copy import deepcopy\nfrom inspect import isabstract\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nimport pandas as pd\nfrom dateutil.parser import pars...
[ [ "pandas.DataFrame" ] ]
reyuwei/deeplab-pytorch
[ "f4e241c83be5f85f0f2e1be5d76160b8c2d7ec9a" ]
[ "libs/datasets/cocostuff.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n#\n# Author: Kazuto Nakashima\n# URL: http://kazuto1011.github.io\n# Created: 2017-10-30\n\nimport glob\nimport os.path as osp\nimport random\nfrom collections import Counter, defaultdict\n\nimport cv2\nimport h5py\nimport numpy as np\nimport scipy.io as sio\nimport ...
[ [ "numpy.hstack", "matplotlib.pyplot.imshow", "matplotlib.pyplot.tight_layout", "torch.utils.data.DataLoader", "scipy.io.loadmat", "matplotlib.pyplot.savefig", "numpy.transpose", "matplotlib.pyplot.axis", "numpy.array", "numpy.flip", "matplotlib.cm.jet", "matplotlib.p...
cyrf0006/echopype
[ "54d385b896ef9d54f7daa1d107c6719ab1fa14c5" ]
[ "echopype/model/echo_data.py" ]
[ "\"\"\"\nechopype data model that keeps tracks of echo data and\nits connection to data files.\n\"\"\"\n\nimport os\nimport datetime as dt\nimport numpy as np\nimport xarray as xr\n\n\nclass EchoData(object):\n \"\"\"Class for manipulating echo data that is already converted to netCDF.\"\"\"\n\n def __init__(...
[ [ "numpy.arange", "numpy.ones", "numpy.round", "numpy.ceil", "numpy.mod" ] ]
lotusxai/LAN-Workshops
[ "e795e87021642bb54cf5328d3589d438ccad266b" ]
[ "LAN2018Oct10/train_simple_nn.py" ]
[ "# USAGE\n# python train_simple_nn.py --dataset animals --model output/simple_nn.model --label-bin output/simple_nn_lb.pickle --plot output/simple_nn_plot.png\n\n# set the matplotlib backend so figures can be saved in the background\nimport matplotlib\nmatplotlib.use(\"Agg\")\n\n# import the necessary packages\nfro...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.use", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "sklearn.preprocessing.LabelBinarizer", "matplotlib.pyplot...
rafaelbou/pixel2style2pixel
[ "85d8dabcafed2ecd582a67775affc63d3bc78f0b" ]
[ "models/fingergen.py" ]
[ "\"\"\"\nThis file defines the core research contribution\n\"\"\"\nimport matplotlib\n\nmatplotlib.use('Agg')\nimport torch\nfrom torch import nn\nfrom models.encoders import encoders\nfrom models.stylegan2.model import Generator\nfrom configs.paths_config import model_paths\n\n\ndef get_keys(d, name):\n if 'sta...
[ [ "matplotlib.use", "torch.nn.AdaptiveAvgPool2d", "torch.load" ] ]
ma-sadeghi/OpenPNM
[ "5ddd7f7317dd9c6d82e6db5256ec1800dd6eef5d", "5ddd7f7317dd9c6d82e6db5256ec1800dd6eef5d" ]
[ "tests/unit/algorithms/MultiphysicsNernstPlanckSolverTest.py", "openpnm/core/_subdomain.py" ]
[ "import numpy as np\nimport openpnm as op\nfrom openpnm.phases import mixtures\nfrom numpy.testing import assert_allclose\nimport pytest\n\n\n@pytest.mark.skip(reason=\"Needs to be refactored using Integrators\")\nclass MultiphysicsNernstPlanckSolverTest:\n\n def setup_class(self):\n # Create network\n ...
[ [ "numpy.linalg.norm", "numpy.random.seed", "numpy.testing.assert_allclose" ], [ "numpy.ones_like", "numpy.copy", "numpy.where", "numpy.any" ] ]
meder411/MappedConvolutions
[ "55c1dffd8f04f67544560e1d425efa318350fe3a" ]
[ "package/setup.py" ]
[ "import torch\nimport os.path as osp\nfrom setuptools import setup\nfrom torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension\n\ncompute_arch = 'compute_61'\ninclude_dir = 'ext_modules/include'\nnn_src = 'ext_modules/src/nn/cpp'\nnn_src_cuda = 'ext_modules/src/nn/cuda'\nutil_src = 'ext_modul...
[ [ "torch.cuda.is_available" ] ]
matthewygf/automl
[ "799ccded69e902ece7630790d754637c427ed6cd" ]
[ "efficientdet/dataloader_test.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 a...
[ [ "tensorflow.data.TFRecordDataset", "tensorflow.test.main", "tensorflow.random.set_seed" ] ]
RunpeiDong/DGMS
[ "1f6a7ca9f39a2bc31cfade1e45967b006ea6532d" ]
[ "main.py" ]
[ "# Copyright (c) Runpei Dong, ArChip Lab.\n# This source code is licensed under the Apache 2.0 license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport torch\n\nimport argparse\nimport time\nimport os\nimport sys\nimport math\n\nimport torch.nn as nn\nimport config as cfg\n\nfrom tq...
[ [ "torch.nn.CrossEntropyLoss", "torch.nn.parallel.DataParallel", "torch.manual_seed", "torch.no_grad", "torch.cuda.is_available" ] ]
KevinHuang8/CEMGD
[ "9c7668264e40904d679e4f22f214a4d7951ce3a4" ]
[ "mbrl/util/common.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\nimport pathlib\nfrom typing import Callable, Dict, List, Optional, Tuple, Union\n\nimport gym.wrappers\nimport hy...
[ [ "numpy.concatenate", "numpy.array", "numpy.tile", "numpy.stack" ] ]
NikV-JS/DualVPRUtil
[ "6533e21641faa9156db6e8d95bb5c51cc4b7d377" ]
[ "superglue_match_pairs.py" ]
[ "from pathlib import Path\nimport argparse\nimport random\nimport os\n\nimport torch\nimport numpy as np\nimport matplotlib.cm as cm\nfrom sklearn.neighbors import NearestNeighbors\n\nfrom SuperGlue.models.matching import Matching\nfrom SuperGlue.models.utils import make_matching_plot, AverageTimer, read_image\n\nf...
[ [ "numpy.sum", "numpy.in1d", "numpy.load", "torch.set_grad_enabled", "torch.cuda.is_available", "numpy.argsort", "sklearn.neighbors.NearestNeighbors", "numpy.zeros", "matplotlib.cm.jet" ] ]
surfriderfoundationeurope/surfnet
[ "ddbfa3e1b4e156febedc71992fe9a049c04504be" ]
[ "tests/test_plasticorigins/detection/test_transforms.py" ]
[ "import numpy as np\nfrom PIL import Image\n\nfrom plasticorigins.detection.transforms import TrainTransforms, ValTransforms\n\nimage = np.array(Image.open(\"tests/ressources/test_image.jpeg\"))\ntarget = {\"bboxes\": [[100, 100, 20, 20]], \"cats\": [1]}\n\n\ndef test_train_transforms():\n trtf = TrainTransforms...
[ [ "numpy.array_equal" ] ]
tjczec01/symbolgen
[ "e360810e872bb0041407d6d2f252683ea3b0c52d" ]
[ "chemsys.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Feb 24 01:14:06 2020\r\n\r\nGithub: https://github.com/tjczec01\r\n\r\n@author: Travis J Czechorski\r\n\r\nE-mail: tjczec01@gmail.com\r\n\r\n\"\"\"\r\nimport sympy as sp\r\nfrom sympy import diff, Matrix, symbols, Add, Mul, Pow, Symbol, Integer, latex, exp, simpl...
[ [ "matplotlib.pyplot.close", "matplotlib.pyplot.figure" ] ]
Techtonique/nnetsauce
[ "edd5344598877bd8017db0d8889de5a0f970d2ec", "edd5344598877bd8017db0d8889de5a0f970d2ec" ]
[ "nnetsauce/rvfl/bayesianrvfl2Regressor.py", "nnetsauce/utils/misc.py" ]
[ "# Authors: Thierry Moudiki\n#\n# License: BSD 3\n\nimport numpy as np\nimport sklearn.metrics as skm2\nfrom ..base import Base\nfrom ..utils import misc as mx\nfrom ..utils import matrixops as mo\nfrom ..utils import lmfuncs as lmf\nfrom sklearn.base import RegressorMixin\n\n\nclass BayesianRVFL2Regressor(Base, Re...
[ [ "numpy.eye", "numpy.zeros", "numpy.ones" ], [ "numpy.mod" ] ]
Navaneeth-K-P/Visualize_on_Livefeed
[ "0f6381d67e846e9447ecfc62566e18aadc7738e0" ]
[ "test.py" ]
[ "#############################################################################################################\n##\n## Source code for testing\n##\n#############################################################################################################\n\nimport cv2\nimport json\nimport torch\nimport agent\ni...
[ [ "numpy.rollaxis", "numpy.take_along_axis", "numpy.linalg.norm", "torch.cuda.is_available", "numpy.argsort", "numpy.array", "numpy.sum" ] ]
ReproLight/GazeML
[ "60dc06f76640d6e62cea5f12ee79cc7bf9463869" ]
[ "src/elg_demo.py" ]
[ "#!/usr/bin/env python3\n\"\"\"Main script for gaze direction inference from webcam feed.\"\"\"\nimport argparse\nimport os\nimport queue\nimport threading\nimport time\n\nimport coloredlogs\nimport cv2 as cv\nimport numpy as np\nimport tensorflow as tf\n\nfrom datasources import Video, Webcam\nfrom models import E...
[ [ "numpy.pad", "tensorflow.python.client.device_lib.list_local_devices", "numpy.unique", "numpy.asarray", "numpy.fliplr", "numpy.clip", "numpy.linalg.norm", "numpy.cos", "numpy.all", "numpy.concatenate", "numpy.copy", "numpy.round", "tensorflow.GPUOptions", "t...
fishjojo/properties
[ "6eb98707e0c681f182deefbedf800911feaa7d1f" ]
[ "pyscf/prop/polarizability/rks.py" ]
[ "#!/usr/bin/env python\n# Copyright 2014-2019 The PySCF Developers. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LIC...
[ [ "numpy.einsum" ] ]
argoneuscze/AudioNMF
[ "04f360653bb0df3d5ed19bf2eb1459bff16a944c" ]
[ "audionmf/nmfcompression/nmfcompressor_stft.py" ]
[ "import struct\n\nimport numpy\nimport scipy.signal\n\nfrom audionmf.audio.channel import Channel\nfrom audionmf.transforms.huffman import HuffmanCoder\nfrom audionmf.transforms.quantization import scale_val, mu_law_compand, mu_law_expand, UniformQuantizer\nfrom audionmf.util.matrix_util import serialize_matrix, de...
[ [ "numpy.amax", "numpy.absolute", "numpy.amin", "numpy.cos", "numpy.sin", "numpy.concatenate", "numpy.vectorize", "numpy.transpose", "numpy.angle" ] ]
harsh-kashyap0201/machine_learning_algos
[ "7c58abad2a8f1b06122c5e82006d0f164e920ca1" ]
[ "classification/knn(scratch).py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # knn hard code (20bkt0039)\n\n# ## importing libraries and dataset\n\n# In[57]:\n\n\nimport math\nimport pandas as pd\n#importing dataset\ndataset = pd.read_csv('D:\\Downloads\\speed_agitality.csv')\ndataset \n\n\n# ## knn algorithm\n\n# In[58]:\n\n\n#splitting datas...
[ [ "pandas.read_csv" ] ]
dreyk/DAGAN
[ "a1f953b218c26b3d8cf09afd5ffa66f4f3c8b63f" ]
[ "dagan_networks_wgan.py" ]
[ "import tensorflow as tf\nfrom dagan_architectures import UResNetGenerator, Discriminator\n\n\nclass DAGAN:\n def __init__(self, input_x_i, input_x_j, dropout_rate, generator_layer_sizes,\n discriminator_layer_sizes, generator_layer_padding, z_inputs, batch_size=100, z_dim=100,\n ...
[ [ "tensorflow.concat", "tensorflow.summary.scalar", "tensorflow.unstack", "tensorflow.reduce_mean", "tensorflow.get_collection", "tensorflow.stack", "tensorflow.control_dependencies", "tensorflow.equal", "tensorflow.reshape", "tensorflow.expand_dims", "tensorflow.gradient...
fluffynukeit/mdsplus
[ "a204d2e9d26554bb035945595210f2a57d187250", "a204d2e9d26554bb035945595210f2a57d187250" ]
[ "pydevices/RfxDevices/PTGREY.py", "pydevices/RfxDevices/BASLERACA.py" ]
[ "#\n# Copyright (c) 2017, Massachusetts Institute of Technology All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# Redistributions of source code must retain the above copyright notice, th...
[ [ "numpy.array" ], [ "numpy.array" ] ]
arjunsinghrathore/brain-score
[ "4cacdc38d30fc41580d364059e6ae26fb21020e4" ]
[ "tests/test_metrics/test_transformations.py" ]
[ "import numpy as np\r\n\r\nfrom brainio_base.assemblies import NeuroidAssembly, DataAssembly\r\nfrom brainscore.metrics import Metric, Score\r\nfrom brainscore.metrics.transformations import CartesianProduct, CrossValidation, \\\r\n CrossValidationSingle\r\n\r\n\r\nclass TestCrossValidationSingle:\r\n class M...
[ [ "numpy.testing.assert_array_equal", "numpy.random.rand" ] ]
M4tr1xVyron/idshwk7
[ "a5b6db42b4d72be8e33f4a8a1a40511f4f73906b" ]
[ "decode.py" ]
[ "# coding=utf-8\r\nimport cv2\r\nimport numpy as np\r\nimport random\r\nimport os\r\nfrom argparse import ArgumentParser\r\nALPHA = 5\r\n\r\n\r\ndef build_parser():\r\n parser = ArgumentParser()\r\n parser.add_argument('--original', dest='ori', required=True)\r\n parser.add_argument('--image', dest='img', ...
[ [ "numpy.fft.fft2", "numpy.real", "numpy.zeros" ] ]
khodabande/Distributional-Signatures
[ "6ae44af73ec978623510d92464e25675945f56a0" ]
[ "src/build_graph.py" ]
[ "import os\nimport sys\nimport random\nimport numpy as np\nimport pickle as pkl\nimport networkx as nx\nimport scipy.sparse as sp\nfrom itertools import product\nfrom utils import loadWord2Vec, clean_str\nfrom math import log\nfrom sklearn import svm\nfrom nltk.corpus import wordnet as wn\nfrom sklearn.feature_extr...
[ [ "numpy.matrix", "scipy.sparse.coo_matrix", "scipy.sparse.diags", "scipy.sparse.vstack", "numpy.array", "sklearn.feature_extraction.text.TfidfVectorizer" ] ]
Khlelifi-Assil/Robot
[ "37865176923246a182bb40a3ea55b28f92e472cc" ]
[ "Training/classifier.py" ]
[ "import numpy as np\nfrom glob import glob\nfrom os.path import basename\n\ndef load_features(folder):\n dataset = None\n classmap = {}\n for class_idx, filename in enumerate(glob('%s/*.csv' % folder)):\n class_name = basename(filename)[:-4]\n classmap[class_idx] = class_name\n samples...
[ [ "numpy.hstack", "numpy.vstack", "numpy.loadtxt" ] ]
IGLICT/OctField
[ "3038686d77873c3bd2340953c8936448d2aaa09e" ]
[ "preprocess/voxelize_tool.py" ]
[ "import os\nimport argparse\nimport multiprocessing\nfrom multiprocessing import Pool\nfrom contextlib import contextmanager\nimport trimesh\nimport numpy as np\n\nfrom utils import config\nfrom utils.util import genSamples\n\n\n@contextmanager\ndef poolcontext(*args, **kwargs):\n pool = multiprocessing.Pool(*ar...
[ [ "numpy.concatenate", "numpy.load", "numpy.zeros", "numpy.save" ] ]
naoe1999/PACS_DCM
[ "37846561ed54115cd67a81535b76670efaad968a" ]
[ "main.py" ]
[ "import argparse\nimport os\nimport cv2\nimport pandas as pd\nimport numpy as np\nimport pydicom\nfrom tqdm import tqdm\nfrom glob import glob\n\n\n### KEY MAPPING\n### Mac\n# ARROW_LEFT = 63234\n# ARROW_RIGHT = 63235\n# ARROW_UP = 63232\n# ARROW_DOWN = 63233\n# TAB = 9\n# SPACE = 32\n### Windows\nARROW_LEFT = 2424...
[ [ "pandas.read_csv", "numpy.expand_dims", "numpy.min", "numpy.asarray", "numpy.max" ] ]
myhugong/probing-TTS-models
[ "c476fcfd1f5d92e8401448f82a060066c2cf5181" ]
[ "infer_griffinLim.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Sep 28 16:39:47 2019\n\n@author: lukeum\n\"\"\"\n\nimport sys\nimport numpy as np\nimport torch\nimport os\nimport argparse\n\nfrom hparams import create_hparams\nfrom model import Tacotron2\nfrom layers import TacotronSTFT, STFT\n#from stft i...
[ [ "matplotlib.pyplot.tight_layout", "torch.mm", "scipy.io.wavfile.write", "torch.load", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "torch.from_numpy", "torch.autograd.Variable", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
itsme3d/HRNet-Semantic-Segmentation
[ "a531dd22031611c6f412b6906ba32690215a6adc" ]
[ "lib/core/function.py" ]
[ "# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Ke Sun (sunk@mail.ustc.edu.cn)\n# ------------------------------------------------------------------------------\n\nimport logging\nimport os\nimport time\n\n...
[ [ "numpy.diag", "torch.nn.functional.upsample", "numpy.maximum", "torch.no_grad", "numpy.zeros" ] ]
renier/qiskit-ibm
[ "ca5a035dd6e79872ab45cffe539d505541803e47" ]
[ "test/ibm/runtime/test_runtime.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 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 modifications or ...
[ [ "numpy.array", "numpy.sqrt", "numpy.ones" ] ]
thedekel/fast-bird-part-localization
[ "5ff6061684335447c282653de90b7aabb2dbf51f" ]
[ "fast_bird_part_localization/cnn_utils.py" ]
[ "import settings\nimport sys\nimport os\nimport numpy as np\nimport cv2\nimport geometry_utils\nsys.path.append(settings.CAFFE_PYTHON_PATH)\nimport caffe\n\nDEFAULT_MODEL_FILE = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'models', 'caffenet_no_fc.prototxt')\nIMAGENET_MEAN = np.array(...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros" ] ]
physimals/fslpy
[ "10dd3f996c79d402c65cf0af724b8b00082d5176" ]
[ "fsl/wrappers/wrapperutils.py" ]
[ "#!/usr/bin/env python\n#\n# wrapperutils.py - Functions and decorators used by the FSL wrapper\n# functions.\n#\n# Author: Paul McCarthy <pauldmccarthy@gmail.com>\n# Author: Martin Craig <martin.craig@eng.ox.ac.uk>\n#\n\"\"\"This module contains functions and decorators used by the FSL wrapper\nfunctions.\n\n\nThe...
[ [ "numpy.savetxt", "numpy.asanyarray", "numpy.loadtxt" ] ]
oxon-612/BDSR
[ "c468061ed9e139be96d9da91c1b5419b122eeb4f" ]
[ "Random_downsampling.py" ]
[ "#第一次降采样用的代码\r\nimport numpy as np\r\nimport random\r\n\r\n\r\nif __name__ == '__main__':\r\n # folder = \"1\" # '1' is the '1' in 'Result_BDSR1' folder\r\n path_1 = \"D:/MengjieXu/Science/BDSR2019-2020/test202009/BDSR/\"\r\n path_2 = \"D:/MengjieXu/Science/BDSR2019-2020/test202009/\"\r\n\r\n dataset = ...
[ [ "numpy.savetxt", "numpy.average", "numpy.loadtxt" ] ]
luyuliu/CSE-5194
[ "52970106c21b30e64d4cf1df26bec09929494060" ]
[ "labs/lab2/train_2.py" ]
[ "import collections\nimport random, time, os\n\nimport torch\nimport torch.nn as nn\n\nfrom utils import read_words, create_batches, to_var\nfrom gated_cnn import GatedCNN\n\nimport torch.nn.functional as F\nfrom torch.utils.data import DistributedSampler, DataLoader\nfrom torch.nn.parallel import DistributedDataPa...
[ [ "torch.nn.NLLLoss", "torch.LongTensor", "torch.max", "torch.nn.parallel.DataParallel", "torch.nn.parallel.DistributedDataParallelCPU", "torch.sum", "torch.nn.DataParallel", "torch.cuda.is_available", "torch.cuda.device_count" ] ]
kingspp/differentiable_learning
[ "d1b23b490f6dcef1ebb1d6818c8cda33e70f6a2f", "d1b23b490f6dcef1ebb1d6818c8cda33e70f6a2f", "d1b23b490f6dcef1ebb1d6818c8cda33e70f6a2f" ]
[ "difflr/utils/early_stopping.py", "difflr/experiments/hpt_experiments/gsc_ffn_hpt_mnist.py", "difflr/experiments/ffn/gsc_ffn/cifar_ffn.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n@created on: 5/10/20,\n@version: v0.0.1\nDescription: Taken from https://gist.github.com/stefanonardo/693d96ceb2f531fa05db530f3e21517d\n\n..todo::\n\n\"\"\"\nimport torch\n\n\nclass EarlyStopping(object):\n def __init__(self, mode='min', min_delta=0, patience=10, percentage=Fals...
[ [ "torch.tensor" ], [ "torch.manual_seed" ], [ "torch.manual_seed" ] ]
pranavj1001/MachineLearningRecipes
[ "513e24ba0b5a8994158131cb0c84e779eee78c68" ]
[ "Pokemon/LegendaryPokemonSVM.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Nov 26 00:01:26 2017\n\n@author: pranavjain\n\nThis model classifies a pokemon as legendary or not-legendary.\nRequired Data to predict Hit Points, Attack Points, Defence Points, Special Attack Points, Special Defence Points, Speed Points\n\n\...
[ [ "numpy.matrix", "pandas.read_csv", "sklearn.cross_validation.train_test_split", "sklearn.metrics.confusion_matrix", "sklearn.svm.SVC", "sklearn.preprocessing.StandardScaler", "sklearn.preprocessing.LabelEncoder" ] ]
ardmn9/artist2wordcloud
[ "4e060b6890093c8690c9b1d342225decc3b1dc79" ]
[ "scrape.py" ]
[ "import requests\nimport matplotlib.pyplot as plt\nfrom wordcloud import WordCloud\nfrom bs4 import BeautifulSoup\nfrom urllib.parse import urljoin\n\n# this makes the host think the requests are coming from a browser\nheaders = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) Gecko/20100101 Firefox/24....
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure" ] ]
vishalbelsare/neworder
[ "38635fca64f239a9e8eb1a671872c174e1814678" ]
[ "examples/wolf-sheep/wolf_sheep.py" ]
[ "\nfrom neworder.domain import Domain\nimport numpy as np\nimport pandas as pd\nimport neworder as no\n\nimport matplotlib.pyplot as plt\n\nWOLF_COLOUR = \"black\"\nSHEEP_COLOUR = \"red\"\nGRASS_COLOUR = \"green\"\n\nclass WolfSheep(no.Model):\n\n def __init__(self, params):\n\n super().__init__(no.LinearTimeli...
[ [ "matplotlib.pyplot.tight_layout", "numpy.sqrt", "numpy.linspace", "numpy.clip", "numpy.arange", "numpy.array", "matplotlib.pyplot.ion", "numpy.histogram", "matplotlib.pyplot.figure" ] ]
adujardin/CenterNet-TensorRT
[ "00c43711293433fe9ad2abc3459425befd1bebbf" ]
[ "plugins_py/DCNv2/test_onnx.py" ]
[ "\nfrom dcn_v2 import DCN\nimport torch\n\nx = torch.randn(5, 3, 40, 40).cuda()\nnet = DCN(x.shape[1], 6, (3,3), 1, 1).cuda()\ny = net(x)\nprint(\"y.shape:\", y.shape)\ntorch.onnx.export(net, x, 'dcn.onnx', verbose=False, opset_version=9)\n\n\nx_ = x.view(-1)\nx_str =\"\"\n\nfor i in range(x_.shape[0]):\n x_str ...
[ [ "torch.randn", "torch.onnx.export" ] ]
neo4reo/minigo
[ "57354e14b2b6b4aacb6863e47836bb475e1b724d" ]
[ "main.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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.gfile.GFile", "tensorflow.gfile.ListDirectory" ] ]
hatrungduc/spark-nlp-workshop
[ "4a4ec0195d1d3d847261df9ef2df7aa5f95bbaec" ]
[ "tutorials/streamlit_notebooks/healthcare/sparknlp_ner_playground.py" ]
[ "\nimport streamlit as st\nimport pandas as pd\nimport base64\n\nfrom sparknlp_display import NerVisualizer\n\nst.sidebar.image('https://nlp.johnsnowlabs.com/assets/images/logo.png', use_column_width=True)\n\nHTML_WRAPPER = \"\"\"<div style=\"overflow-x: auto; border: 1px solid #e6e9ef; border-radius: 0.25rem; padd...
[ [ "pandas.DataFrame" ] ]
ericmjl/polcart
[ "1d003987f269c14884726205f871dd91de8610ce" ]
[ "polcart/test_polcart.py" ]
[ "from hypothesis import assume, given\nfrom hypothesis.strategies import floats\n\nimport numpy as np\n\nfrom .polcart import (to_cartesian, to_degrees, to_polar, to_proper_degrees,\n to_proper_radians, to_radians)\n\n\n@given(floats(), floats())\ndef test_convert_xy(x, y):\n assume(x != 0 a...
[ [ "numpy.allclose", "numpy.isfinite" ] ]
YohannFaure/recnn
[ "9d7e9df9c3bdcdac3369f20178f98f59a05773a6" ]
[ "Legacy_code/train_event.py" ]
[ "import autograd as ag\nimport click\nimport copy\nimport numpy as np\nimport logging\nimport pickle\n\nfrom sklearn.cross_validation import train_test_split\nfrom sklearn.metrics import roc_auc_score\nfrom sklearn.preprocessing import RobustScaler\nfrom sklearn.utils import check_random_state\n\nfrom recnn.preproc...
[ [ "sklearn.cross_validation.train_test_split", "sklearn.preprocessing.RobustScaler", "numpy.array", "sklearn.utils.check_random_state", "numpy.vstack" ] ]
AybukeYALCINER/image_classification
[ "cfe1f753f31b736a90bee9ef0ae23b5bc923a1f8" ]
[ "part3.py" ]
[ "from __future__ import print_function\r\nfrom __future__ import division\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.optim as optim\r\nimport numpy as np\r\nimport torchvision\r\nfrom torchvision import datasets, models, transforms\r\nfrom torch.autograd import Variable\r\nimport matplotlib.pyplot as ...
[ [ "torch.nn.CrossEntropyLoss", "torch.max", "numpy.arange", "torch.utils.data.DataLoader", "matplotlib.pyplot.subplots", "sklearn.metrics.confusion_matrix", "torch.sum", "torch.nn.Linear", "torch.set_grad_enabled", "sklearn.svm.LinearSVC", "torch.cuda.is_available", "...
ladoramkershner/ale
[ "7bd25687480f8e6b60319026ef0982ae41ef027e" ]
[ "tests/pytests/test_rotation.py" ]
[ "import pytest\n\nimport numpy as np\nfrom scipy.spatial.transform import Rotation\nfrom ale.rotation import ConstantRotation, TimeDependentRotation\n\ndef test_constant_constant_composition():\n rot1_2 = ConstantRotation([1.0/np.sqrt(2), 0, 0, 1.0/np.sqrt(2)], 1, 2)\n rot2_3 = ConstantRotation([0, 1.0/np.sqr...
[ [ "numpy.testing.assert_equal", "numpy.sqrt", "numpy.asarray", "numpy.arange", "numpy.degrees", "numpy.testing.assert_almost_equal", "scipy.spatial.transform.Rotation.from_euler", "numpy.repeat", "numpy.array" ] ]
cici-ai-club/3M
[ "d9caaaba014ab7d18dfc74dde2661a2e497bd58f" ]
[ "misc/rewards.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport time\nimport misc.utils as utils\nfrom collections import OrderedDict\nimport torch\nimport math\nimport sys\nsys.path.append(\"cider\")\nfrom pyciderevalcap.ciderD.ciderD im...
[ [ "numpy.repeat", "numpy.array" ] ]
duttashi/applied-machine-learning
[ "ff3267b97d9dd7122400754798e06fb493daa40a", "ff3267b97d9dd7122400754798e06fb493daa40a" ]
[ "python_3/experiments/expr_get_unique_factor_level.py", "python_3/experiments/expr_simple_pipeline_example.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Oct 8 11:02:08 2021\nObjective: Given a dataframe, Get a list of categories for categorical variable\n@author: Ashish\n\"\"\"\n\n# load required libraries\nimport pandas as pd\nimport numpy as np\n\n# create some fake data\na = ['arrived','departed','delayed']\ndf =...
[ [ "pandas.Categorical", "numpy.random.choice" ], [ "sklearn.datasets.make_classification", "sklearn.linear_model.LogisticRegression", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.LabelBinarizer", "sklearn.svm.SVC", "sklearn.preprocessing.StandardScaler", ...
jspieler/reinforcement-learning
[ "b99a450ea4c4c3869a328e75c8a8ffd4f1e72aaa" ]
[ "TensorFlow2/utils/buffer.py" ]
[ "import numpy as np\nimport tensorflow as tf\n\n\nclass Buffer:\n def __init__(self, num_actions, num_states, buffer_capacity=100000, batch_size=64):\n self.buffer_capacity = buffer_capacity\n self.batch_size = batch_size\n\n self.buffer_counter = 0\n\n self.state_buffer = np.zeros((s...
[ [ "tensorflow.convert_to_tensor", "numpy.zeros", "numpy.random.choice" ] ]
ddavid/SPFN
[ "c7d4bc352ca19a83800d0301197a480f1e2452c3" ]
[ "spfn/lib/network.py" ]
[ "import os, sys\nBASE_DIR = os.path.dirname(__file__)\nsys.path.append(BASE_DIR)\nsys.path.append(os.path.join(BASE_DIR, '..'))\n\nimport architecture\nimport evaluation\nimport fitter_factory\nimport prediction_io\n\nimport time\nimport numpy as np\nimport tensorflow as tf\nimport re\nimport subprocess\nimport pic...
[ [ "numpy.expand_dims", "tensorflow.control_dependencies", "tensorflow.zeros", "tensorflow.is_finite", "tensorflow.minimum", "tensorflow.train.AdamOptimizer", "tensorflow.summary.scalar", "tensorflow.Graph", "tensorflow.Variable", "tensorflow.get_collection", "tensorflow.t...
SemMT-ICSE21/SemMT
[ "0d8a6b4a95d2b6023d51ed7b17fe32502e9649c7" ]
[ "code_book/DrawTools.py" ]
[ "# coding: utf-8\r\nfrom itertools import chain\r\nfrom collections import Iterable\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.patches as patches\r\nfrom matplotlib import colors\r\nimport matplotlib.patheffects as path_effects\r\nimport matplotlib\r\nimport numpy as np\r\nimport math\r\nimport venn\r\...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.rc", "matplotlib.pyplot.subplot", "matplotlib.pyplot.grid", "matplotlib.cm.get_cmap", "matplotlib.colors.rgb2hex", "matplotlib.pyplot.figure" ] ]
jdrusso/westpa_test
[ "3383b59a5a6ec5401415e74eb5a7fc61e4b3abbc", "c91711bf8f1f75359c0d4d28765a6d587dfd6adc" ]
[ "src/westpa/westext/weed/weed_driver.py", "tests/test_functional/test_mclib.py" ]
[ "import logging\nimport operator\n\nimport numpy as np\n\nimport westpa\nfrom westpa.yamlcfg import check_bool\nfrom westpa.kinetics import RateAverager\nfrom westext.weed.ProbAdjustEquil import probAdjustEquil\n\nEPS = np.finfo(np.float64).eps\n\nlog = logging.getLogger(__name__)\n\n\nclass WEEDDriver:\n def __...
[ [ "numpy.arange", "numpy.finfo" ], [ "numpy.loadtxt" ] ]
zahrag/GAIN
[ "5188a1a60b23aadad02369166630d30c286dd837" ]
[ "codes/supervised_train.py" ]
[ "from __future__ import division\nfrom __future__ import print_function\n\nimport time\nimport tensorflow as tf\nimport numpy as np\n# import sklearn\nfrom sklearn import metrics\nfrom sklearn.preprocessing import OrdinalEncoder\n\nfrom codes.supervised_models import SupervisedGraphsage\nfrom codes.models import SA...
[ [ "tensorflow.summary.FileWriter", "tensorflow.Variable", "tensorflow.placeholder_with_default", "tensorflow.assign", "tensorflow.placeholder", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "numpy.argmax", "tensorflow.summary.merge_all", "numpy.mean", ...
avandekleut/sdmlib
[ "d77c606a484deed6b0f5660f10c85a9fb1c27b3d" ]
[ "sdmlib.py" ]
[ "import scipy.stats as st\nimport numpy as np\n\nclass Memory:\n def __init__(self, N, M, U, d, T=None, seed=None):\n \"\"\"\n |Parameter|Description|\n |:-:|:-:|\n |`N`|Length of addresses in bits|\n |`M`|Number of hard addresses|\n |`U`|Length of data in bits|\n ...
[ [ "scipy.stats.norm.ppf", "numpy.logical_xor", "numpy.random.seed", "numpy.zeros", "numpy.where", "numpy.random.randint" ] ]
LuckyDC/human_body_prior
[ "6a46613b4cbd9c62d888359f1435cec501643af3" ]
[ "human_body_prior/train/vposer_smpl.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG),\n# acting on behalf of its Max Planck Institute for Intelligent Systems and the\n# Max Planck Institute for Biological Cybernetics. All rights reserved.\n#\n# Max-Planck-Gesellschaft zur Förderung ...
[ [ "torch.abs", "numpy.radians", "torch.load", "torch.cat", "torch.sum", "torch.utils.data.DataLoader", "torch.tanh", "torch.no_grad", "torch.cuda.is_available", "torch.distributions.normal.Normal", "torch.pow", "torch.nn.Dropout", "numpy.zeros", "torch.optim.A...
canavandl/colour
[ "a453cd37b6135a9092d5ea5b2aafb8d19134bdff" ]
[ "colour/plotting/models.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nColour Models Plotting\n======================\n\nDefines the colour models plotting objects:\n\n- :func:`colourspaces_CIE_1931_chromaticity_diagram_plot`\n- :func:`single_transfer_function_plot`\n- :func:`multi_transfer_function_plot`\n\"\"\"\n\nfrom...
[ [ "numpy.amin", "numpy.amax", "numpy.linspace" ] ]
353622088/CapsNet
[ "04408978dfccd9a6545fc250648fd2f600974a95" ]
[ "examples/5_DataManagement/tensorflow_dataset_api.py" ]
[ "\"\"\" TensorFlow Dataset API.\n\nIn this example, we will show how to load numpy array data into the new \nTensorFlow 'Dataset' API. The Dataset API implements an optimized data pipeline\nwith queues, that make data processing and training faster (especially on GPU).\n\nAuthor: Aymeric Damien\nProject: https://gi...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.layers.conv2d", "tensorflow.nn.softmax", "tensorflow.layers.dropout", "tensorflow.cast", "tensorflow.reshape", "tensorflow.placeholder", "tensorflow.layers.max_pooling2d", "tensorflow.layers.dense", "tensorflow....
jessevig/robustness-gym
[ "37fa9f04dc62638b78cf05b930c8034eb7dcb3e7" ]
[ "robustnessgym/slicebuilders/subpopulation.py" ]
[ "from typing import List, Optional, Tuple\n\nimport cytoolz as tz\nimport numpy as np\nfrom meerkat.provenance import capture_provenance\n\nfrom robustnessgym.core.constants import SUBPOPULATION\nfrom robustnessgym.core.identifier import Identifier\nfrom robustnessgym.core.slice import SliceDataPanel as DataPanel\n...
[ [ "numpy.concatenate", "numpy.all", "numpy.any", "numpy.where", "numpy.zeros" ] ]
littletomatodonkey/HRNet_Paddle
[ "2b2896975c28e8b4d273abc6a65f2747a7b8c4df", "2b2896975c28e8b4d273abc6a65f2747a7b8c4df" ]
[ "deploy/preprocess.py", "lib/dataset/transform/keypoint_operators.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.min", "numpy.cos", "numpy.sin", "numpy.round", "numpy.frombuffer", "numpy.deg2rad", "numpy.max", "numpy.ceil", "numpy.float32", "numpy.array", "numpy.zeros" ], [ "numpy.amax", "numpy.random.random", "numpy.amin", "numpy.arange", "numpy.one...
rgiordan/LinearResponseVariationalBayes.py
[ "5305d7e204481e518c5ef82bbed065ec627a4a9e" ]
[ "LinearResponseVariationalBayes/ProjectionParams.py" ]
[ "import math\nimport copy\n\nimport autograd\nimport autograd.numpy as np\nimport autograd.scipy as sp\n\nimport scipy as osp\nfrom scipy.sparse import coo_matrix, csr_matrix, block_diag\n\n# Get a matrix of vectors spanning the space perpendicular to the rows of x.\n# The columns of the returned proj_basis are the...
[ [ "scipy.sparse.coo_matrix" ] ]
noaeilat14/mindspore
[ "3fa5dd4495f4071b701e7ff490b7085b8824aaaa" ]
[ "mindspore/mindrecord/tools/cifar10_to_mr.py" ]
[ "# Copyright 2019 Huawei Technologies Co., Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l...
[ [ "numpy.int" ] ]
JiayiGuo821/product-image-retrieval
[ "1d5fb5b793025a94941d04fd3f5bd5659713e19c" ]
[ "train_pca.py" ]
[ "import torch\n\nfrom sklearn.decomposition import IncrementalPCA\nfrom torchvision import transforms\nimport pandas as pd\nimport numpy as np\nimport argparse\nimport pickle\nimport sys\nimport os \n\nimport models\nimport datasets\n\ndef parse_args():\n model_names = ['PCA_Matcher']\n dataset_names=['Shopee...
[ [ "torch.utils.data.DataLoader", "sklearn.decomposition.IncrementalPCA" ] ]
rh01/pytorch_tutorials
[ "ca3466187d1bb2dd2e8af35694a5ccc04e327e60" ]
[ "activation_torch.py" ]
[ "import torch\nimport numpy as np\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport matplotlib.pyplot as plt\n\n# fake data\nx = torch.linspace(-5, 5, 200) # x_data(tensor), shape()\nx = Variable(x)\nx_np = x.data.numpy()\n\ny_relu = F.relu(x).data.numpy()\ny_sigmoid = F.sigmoid(x).data....
[ [ "matplotlib.pyplot.legend", "torch.linspace", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "torch.autograd.Variable", "torch.nn.functional.sigmoid", "matplotlib.pyplot.subplot", "torch.nn.functional.relu", "torch.nn.functional.tanh", "matplotlib.pyplot.show", "to...
henrique/horovod
[ "3108a242e7a5403335ec0e0c4fff757d26fc3add" ]
[ "setup.py" ]
[ "# Copyright 2019 Uber Technologies, Inc. All Rights Reserved.\n# Modifications copyright Microsoft\n# Modifications copyright (C) 2020, NVIDIA CORPORATION. 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...
[ [ "tensorflow.python.framework.load_library.load_op_library", "torch.compiled_with_cxx11_abi", "torch.utils.cpp_extension.include_paths", "tensorflow.sysconfig.get_link_flags", "torch.utils.cpp_extension.CppExtension", "tensorflow.sysconfig.get_lib", "torch.utils.hipify.hipify_python.hip...
danguetta/xlwings
[ "93c5dcc853751447f8bea5f2d14cdf0505b7c968" ]
[ "xlwings/_xlwindows.py" ]
[ "import os\nimport sys\n\n# Hack to find pythoncom.dll - needed for some distribution/setups (includes seemingly unused import win32api)\n# E.g. if python is started with the full path outside of the python path, then it almost certainly fails\ncwd = os.getcwd()\nif not hasattr(sys, 'frozen'):\n # cx_Freeze etc....
[ [ "numpy.isnan" ] ]
niall-twomey/har_datasets
[ "68f142ba613ce26f67cdd6b871117f4c24ea603f" ]
[ "src/transformers/source_selector.py" ]
[ "from loguru import logger\nfrom numpy import concatenate\n\nfrom src.base import get_ancestral_metadata\nfrom src.keys import Key\n\n__all__ = [\n \"source_selector\",\n]\n\n\ndef do_select_feats(**nodes):\n keys = sorted(nodes.keys())\n return concatenate([nodes[key] for key in keys], axis=1)\n\n\ndef so...
[ [ "numpy.concatenate" ] ]
tmilliman/python-vegindex
[ "5cf6e42b35d91d8a1451863c19022a39f3c76f0d" ]
[ "src/vegindex/update_roi_ir_timeseries.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\nUpdate an ROI IR timeseries CSV file.\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\nimport argparse\nimport os\nimport sys\nfrom datetime import timedelta\n\n# try python3 import then python2 import\ntry:\n from configparser import C...
[ [ "numpy.asarray" ] ]
v1ruso/BachelorProject
[ "c64ee1256b49373c96525b9d03cadc6b773809ca" ]
[ "Generation/cs_corrected.py" ]
[ "from collections import Counter\nimport re\nimport os.path as op\n\nimport pandas as pd\nfrom tqdm import tqdm\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\nimport config\n\ndef evaluate_cs(original, generated):\n '''Given a original and generated events, calculate precision, recall, and\n F1 of...
[ [ "pandas.concat", "matplotlib.pyplot.savefig", "pandas.DataFrame", "matplotlib.pyplot.figure" ] ]
JiaheXu/CS285_2020_pytorch
[ "9117ff281e7379ae576d0e8aefeee50c7567372b" ]
[ "hw5/cs285/envs/pointmass/pointmass.py" ]
[ "import networkx as nx\nimport scipy.sparse.csgraph\nimport numpy as np\nimport gym\nimport pickle\n\nWALLS = {\n 'Small':\n np.array([[0, 0, 0, 0],\n [0, 0, 0, 0],\n [0, 0, 0, 0],\n [0, 0, 0, 0]]),\n 'Cross':\n np.array([[0, 0, 0, 0, 0, 0, 0],\...
[ [ "numpy.random.seed", "numpy.linspace", "numpy.random.choice", "matplotlib.use", "numpy.linalg.norm", "numpy.random.normal", "numpy.random.rand", "numpy.floor", "numpy.random.uniform", "numpy.array", "numpy.where", "numpy.float", "numpy.random.randint" ] ]
cordeirojoao/auto-sklearn
[ "c7775dc7072a15cfdd00dd85fbc5737f41ea4146" ]
[ "test/test_automl/test_automl.py" ]
[ "# -*- encoding: utf-8 -*-\nimport os\nimport pickle\nimport sys\nimport time\nimport glob\nimport unittest\nimport unittest.mock\n\nimport numpy as np\nimport pandas as pd\nimport sklearn.datasets\nfrom smac.scenario.scenario import Scenario\nfrom smac.facade.roar_facade import ROAR\n\nfrom autosklearn.util.backen...
[ [ "numpy.array", "numpy.allclose", "pandas.DataFrame", "numpy.random.randint" ] ]
AlwaysLearningDeeper/OpenAI_Challenges
[ "576732fd3f1fd24afc4bdfb4920c1da8caae12ea" ]
[ "src/Old files/randomGame.py" ]
[ "import gym,time\nimport numpy as np\nimport random\nfrom statistics import median, mean\nfrom collections import Counter\nimport sys\nimport pickle\nfrom matplotlib import pyplot as plt\n\n#1 NO Op, 2-3 Either Right or Left\n\nenv = gym.make('Breakout-v0')\nenv.reset()\ngoal_steps=50000000000000000000000000000000\...
[ [ "numpy.reshape" ] ]
quantww/qlib
[ "fe155703b0bc1192e7f9afed98af225e3a91da33" ]
[ "setup.py" ]
[ "# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\nimport io\nimport os\nimport numpy\n\nfrom setuptools import find_packages, setup, Extension\n\n\ndef read(rel_path: str) -> str:\n here = os.path.abspath(os.path.dirname(__file__))\n with open(os.path.join(here, rel_path), encoding=\...
[ [ "numpy.get_include" ] ]
canerozer/explainable-iqa
[ "66046c1b15bd487ec495bf1f526bd16ea72eb010" ]
[ "run_gradcam.py" ]
[ "\"\"\"\nCreated on Thu Oct 26 11:06:51 2017\n\n@author: Utku Ozbulak - github.com/utkuozbulak\n@editor: Caner Ozer - github.com/canerozer\n\"\"\"\nimport argparse\nimport yaml\nimport os\nimport tqdm\nimport numpy as np\nimport pandas as pd\nfrom PIL import Image\n\nimport torch\n\nfrom src.misc_functions import (...
[ [ "numpy.set_printoptions", "pandas.DataFrame", "torch.load" ] ]
tomMoral/cyanure
[ "5c4666d7500fa5ef8fbb9677e56ad786691a5341" ]
[ "cyanure.py" ]
[ "# Author: Julien Mairal <julien.mairal@inria.fr>\n#\n# License: BSD 3 clause\n\nfrom abc import abstractmethod\nimport numpy as np\nimport scipy.sparse\nimport cyanure_wrap \n\ndef preprocess(X,centering=False,normalize=True,columns=False):\n \"\"\" Perform in-place centering or normalization, either of columns...
[ [ "numpy.logical_not", "numpy.unique", "numpy.arange", "numpy.asfortranarray", "numpy.squeeze", "numpy.int32", "numpy.sign", "numpy.all", "numpy.copy", "numpy.argmax", "numpy.max", "numpy.any", "numpy.zeros" ] ]
babupreetham/databricks
[ "ae797faf6a7cfa6df0a110c3e17c034ec4f95cee" ]
[ "ex2.py" ]
[ "import matplotlib.pyplot as plt\nimport pandas as pd\n \n#### ----- Step 1 (Download data)----\nURL_DATASET = r'https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv'\ndf1 = pd.read_csv(URL_DATASET)\n# print(df1.head(3)) # Uncomment to see the dataframe\n \n#### ----- Step 2 (Se...
[ [ "matplotlib.pyplot.gca", "pandas.read_csv", "matplotlib.pyplot.show" ] ]
morffis/Portguese-Word-Embedding
[ "1eb2c84ad37d41ddb865e1f161fbc489982fdf51" ]
[ "word_embedding_training.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\n#DATA MANIPULATION\nimport pandas as pd\nimport numpy as np\n\n#EMBEDDING AND PREPROCESSING\nfrom gensim.models import KeyedVectors\nimport re\nimport nltk\nimport gensim\nimport multiprocessing\nimport spacy\nfrom sklearn.preprocessing import LabelBinarizer\...
[ [ "tensorflow.keras.preprocessing.text.Tokenizer", "matplotlib.pyplot.legend", "pandas.concat", "pandas.read_csv", "tensorflow.keras.layers.Embedding", "numpy.asarray", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.MaxPooling1D", "pandas.DataFrame", "matplotlib.py...
cleuton/FaceGuard
[ "5b3d91f2b824d23a1ca58c19ff233412c8e941e7" ]
[ "FaceRec/predict.py" ]
[ "# coding=utf-8\n# Predict Face using CNN\n# Copyright 2018 Cleuton Sampaio\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# U...
[ [ "numpy.expand_dims" ] ]
jkim1014/tfx
[ "5a4229639343a373fe4da9295b1ee5113912a902" ]
[ "tfx/components/example_gen/component_test.py" ]
[ "# Lint as: python2, python3\n# Copyright 2019 Google LLC. 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\...
[ [ "tensorflow.test.main" ] ]
eharkavy/DeepSolar
[ "8c154c6b49d2d8b11c335c5b3442b78aa84cf1b6" ]
[ "test_segmentation.py" ]
[ "\"\"\"Generate Class Activation Map for positive samples in \"\"\"\nimport sys\n#sys.path.append('/home/ubuntu/vgg_data/code')\n\nimport copy\nimport os.path\nimport re\nimport numpy as np\nimport tensorflow as tf\nimport skimage\nimport skimage.io\nimport skimage.transform\nimport pickle\nimport csv\nfrom collect...
[ [ "tensorflow.app.flags.DEFINE_string", "numpy.exp", "tensorflow.nn.conv2d", "tensorflow.Graph", "tensorflow.get_collection", "numpy.reshape", "tensorflow.name_scope", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.random_normal_initializer", "tensorflow.imag...
1ncend1ary/wwa
[ "b97371793312639a98e588267cc84a4fb8910673" ]
[ "web/word2vec.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nPre-trained word2vec model to compute distance between vectorised words.\n\n__author__ = \"Aleksei Seliverstov\"\n__license__ = \"MIT\"\n__email__ = \"alexseliverstov@yahoo.com\"\n\"\"\"\nimport gensim\nimport numpy\nimport math\nfrom web import logger\nfrom ...
[ [ "numpy.add" ] ]
OlivierNV/cudf
[ "7aa3799e73948899a85e70bc73d3cea50b65dff1" ]
[ "python/cudf/tests/test_dataframe.py" ]
[ "# Copyright (c) 2018, NVIDIA CORPORATION.\n\nimport pytest\n\nimport numpy as np\nimport pandas as pd\nimport pyarrow as pa\nimport array as arr\n\nfrom librmm_cffi import librmm as rmm\n\nimport cudf as gd\nfrom cudf.dataframe.dataframe import Series, DataFrame\nfrom cudf.dataframe.buffer import Buffer\nfrom cudf...
[ [ "pandas.Series", "numpy.asarray", "pandas.DataFrame", "numpy.dtype", "numpy.random.randn", "pandas.testing.assert_frame_equal", "numpy.random.randint", "numpy.hstack", "numpy.testing.assert_equal", "numpy.arange", "numpy.zeros", "pandas.Categorical", "numpy.arra...
liuxinhai/L2G-AE
[ "613edbbd2460516c5cec4a4a178b8c3319f1e62d" ]
[ "models/generators_discriminators.py" ]
[ "'''\n\nCreate on December 4, 2018\n\n@author: Xinhai Liu\n\n'''\n\nimport tensorflow as tf\nimport numpy as np\nimport os\nimport sys\n\nBASE_DIR = os.path.dirname(__file__)\nsys.path.append(BASE_DIR)\nsys.path.append(os.path.join(BASE_DIR, '../../utils'))\nimport tf_util\nfrom pointnet_util import pointnet_sa_mod...
[ [ "tensorflow.concat", "tensorflow.reshape", "tensorflow.nn.sigmoid", "numpy.prod" ] ]
dcp5/reappraisal-model
[ "7e2de54bb9a128a196497d4bf3ca9c52f6c4b032" ]
[ "reappraisalmodel/.ipynb_checkpoints/lightningreapp-checkpoint.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/LightningReapp.ipynb (unless otherwise specified).\n\n__all__ = ['LightningReapp', 'get_avg_masked_encoding', 'default_model_name']\n\n# Cell\nimport pickle\nimport pandas as pd\nimport pytorch_lightning as lit\nimport torch\nfrom pytorch_lightning.metrics.functional...
[ [ "torch.abs", "torch.mean", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.cat", "torch.nn.Linear", "torch.stack", "torch.nn.ReLU" ] ]
razajafri/cudf
[ "fab0b5ad0342a6478aa48d7c2ff3eae87ecf1c0b" ]
[ "python/cudf/cudf/utils/cudautils.py" ]
[ "# Copyright (c) 2018, NVIDIA CORPORATION.\n\nfrom functools import lru_cache\nfrom math import fmod\n\nimport numpy as np\nfrom numba import cuda, int32, numpy_support\n\nimport nvstrings\nfrom librmm_cffi import librmm as rmm\n\nfrom cudf.utils.utils import (\n check_equals_float,\n check_equals_int,\n m...
[ [ "numpy.dtype" ] ]
Guigui14460/neural-network-from-scratch
[ "ce26d9a0943637688dae9c0eeeeb608156a52460" ]
[ "src/neural_networks/optimizers/adaptive_gradient.py" ]
[ "import numpy as np\n\nfrom neural_networks.layers import Layer\nfrom .optimizer import Optimizer\n\n\nclass AdaGradient(Optimizer):\n def __init__(self, learning_rate: float = 1., decay: float = 0., epsilon: float = 1e-7) -> None:\n Optimizer.__init__(self, learning_rate=learning_rate, decay=decay)\n ...
[ [ "numpy.zeros_like", "numpy.sqrt" ] ]
GreenRodger8/LimeRecommends
[ "5f65eb949500f503c8cad8031c32d2196ca0e092" ]
[ "implicit_grant/storeLibrary.py" ]
[ "import sys\nimport json\nimport os\nfrom sklearn import preprocessing\nimport numpy as np\n\nimport jsonTools\n\nLOG_PATH = \"./log.txt\"\nFEATURE_FILE = \"songFeatures\"\n#ID_FILE = \"songID\"\nwith open(LOG_PATH, \"w\") as logStream:\n #Gets path for user's song features from command line argument\n filePa...
[ [ "numpy.array", "numpy.save" ] ]
BagrovAndrey/nqs-playground
[ "e2834e8d340c06468687944516a2858bb754cbfe" ]
[ "nqs_playground/sr.py" ]
[ "# Copyright Tom Westerhout (c) 2019\n#\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Redistributions of source code must retain the above copyright\n# notice, this lis...
[ [ "numpy.dot", "torch.max", "numpy.abs", "torch.zeros", "numpy.ascontiguousarray", "torch.cat", "numpy.eye", "numpy.linalg.norm", "torch.from_numpy", "torch.no_grad", "torch.utils.tensorboard.SummaryWriter", "torch.rand", "numpy.mean", "numpy.var", "scipy....
sushilshah/ml_a-z_template
[ "952b20c317d280d5faa9e6674117e44d3c93e625" ]
[ "Part 9 - Dimensionality Reduction/Section 43 - Principal Component Analysis (PCA)/PCA/pca.py" ]
[ "# PCA\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the dataset\ndataset = pd.read_csv('Wine.csv')\nX = dataset.iloc[:, 0:13].values\ny = dataset.iloc[:, 13].values\n\n# Splitting the dataset into the Training set and Test set\nfrom sklearn.mo...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "sklearn.linear_model.LogisticRegression", "matplotlib.pyplot.title", "numpy.unique", "sklearn.model_selection.train_test_split", "sklearn.metrics.confusion_matrix", "matplotlib.colors.ListedColormap", "matplotlib.pyplot.xlabel", ...
ajhodges/sportsreference
[ "8cb38db3ff2c38806cb4a68482208fd5e0f3084a", "8cb38db3ff2c38806cb4a68482208fd5e0f3084a" ]
[ "sportsreference/nba/teams.py", "tests/integration/schedule/test_ncaaf_schedule.py" ]
[ "import pandas as pd\nimport re\nfrom .constants import PARSING_SCHEME, SEASON_PAGE_URL\nfrom pyquery import PyQuery as pq\nfrom ..decorators import float_property_decorator, int_property_decorator\nfrom .. import utils\nfrom .roster import Roster\nfrom .schedule import Schedule\n\n\nclass Team:\n \"\"\"\n An...
[ [ "pandas.concat", "pandas.DataFrame" ], [ "pandas.concat", "pandas.DataFrame" ] ]
ingmarschuster/kameleon_rks
[ "129b8ee4151d310dd7a1bdf454eb58bb80c43435" ]
[ "kameleon_rks/tools/convergence_stats.py" ]
[ "from rpy2 import robjects\n\nimport numpy as np\n\n\ndef avg_ess(X):\n return np.mean(ess_coda(X))\n\ndef min_ess(X):\n return np.min(ess_coda(X))\n\ndef ess_coda(X):\n \"\"\"\n Computes the effective samples size for each column of a 2d-array using R-coda via\n an external R call. The p...
[ [ "numpy.shape", "numpy.mean", "numpy.correlate", "numpy.zeros", "numpy.sum" ] ]
ZENGXH/NPDRAW
[ "339d1d9b4880cce891cafe7c20198ef7c121a29e" ]
[ "runner/classifier.py" ]
[ "import os\nfrom comet_ml import Experiment\nimport torch \nimport time\nfrom tqdm import tqdm\nimport numpy as np\nfrom loguru import logger\nfrom runner.vae_runner import Runner \nfrom scipy.optimize import linear_sum_assignment\nfrom torchvision.utils import save_image, make_grid\nimport torch.nn.functional as F...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.gca", "matplotlib.pyplot.title", "torch.cat", "numpy.save", "sklearn.manifold.TSNE", "torch.unique", "torch.no_grad", "torch.nn.functional.interpolate", "numpy.zeros", "matplotlib.pyplot.figure" ] ]
lschw/rl-experiments
[ "8b911b5d655288a60b12ffbacc123e3a3c78638c" ]
[ "experiments/frozenlake/frozenlake4x4_td.py" ]
[ "import sys\nsys.path.insert(0, \"../../\")\nimport numpy as np\nimport gym\nimport algorithms as alg\nfrom evaluate import *\n\nenv = gym.make(\"FrozenLake-v0\")\n\nprint(\"\\nSARSA\")\nalg.utils.random_seed(env, 1)\nQ,history_sarsa = alg.sarsa(\n env, alpha=0.1, gamma=1, epsilon=0.4, N_episodes=10000,\n eps...
[ [ "numpy.argmax" ] ]
kdergachev/yfinance
[ "12ab9eb6fe077706e0c6032f5446ed6dfcbe69cf" ]
[ "yfinance/base.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Yahoo! Finance market data downloader (+fix for Pandas Datareader)\n# https://github.com/ranaroussi/yfinance\n#\n# Copyright 2017-2019 Ran Aroussi\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in comp...
[ [ "pandas.concat", "pandas.to_datetime", "pandas.read_html", "pandas.DataFrame", "numpy.round" ] ]
panfengfeng/pycarbon
[ "811efef52aad0d987d9518b2d167b8a9d32f33f9" ]
[ "examples/mnist/pycarbon_dataset/pytorch_example_carbon.py" ]
[ "# Copyright (c) 2018-2019 Huawei Technologies, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a...
[ [ "torch.nn.Dropout2d", "torch.nn.functional.log_softmax", "torch.nn.functional.dropout", "torch.nn.functional.nll_loss", "torch.manual_seed", "torch.nn.Conv2d", "torch.nn.Linear", "torch.no_grad", "torch.cuda.is_available", "torch.device" ] ]
gcsimon/otimizacao-finaltrab
[ "db77ecbf8e051127521d944e37843cabad1b8724" ]
[ "file.py" ]
[ "import numpy as np\nimport copy\n\nfrom numpy import random\n\n# FLAGS\ndebug_prints = False\nusar_shake = True\nvnd = True\nprint_a_cada_n_iteracoes = 10\nmax_iteracoes = 999999999\nfile_name = 'instancias\\instancias\\induced_50_122.dat'\n\n# Implementação do VNS\ndef VNS(solucao, num_vizinhancas):\n print(\"...
[ [ "numpy.random.randint", "numpy.zeros", "numpy.full" ] ]