repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
INM-6/SPADE_surrogates
[ "580fc50d521a0687dcd9ae45a6b01d84879ad32b" ]
[ "SPADE_surrogates/fig_artificial_data.py" ]
[ "\"\"\"\nScript to create the figure that shows the statistics of artificial data and\nthe false positives when analyzing these data with SPADE.\n\"\"\"\nimport itertools\nimport os\n\nimport numpy as np\nimport quantities as pq\nimport elephant\n\nfrom matplotlib import pyplot as plt\nimport matplotlib.gridspec as...
[ [ "numpy.histogram", "matplotlib.pylab.rcParams.update", "numpy.array", "matplotlib.gridspec.GridSpecFromSubplotSpec", "matplotlib.pyplot.text", "matplotlib.pyplot.savefig", "numpy.load", "numpy.mean", "matplotlib.pyplot.figure", "numpy.diff", "numpy.std", "numpy.aran...
limuhit/pseudocylindrical_convolution
[ "8af02a2d8f018177efdf7e73edffde87b7efdafe" ]
[ "PCONV_operator/pytorch_ssim.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\nfrom math import exp\n\ndef gaussian(window_size, sigma):\n gauss = torch.Tensor([exp(-(x - window_size//2)**2/float(2*sigma**2)) for x in range(window_size)])\n return gauss/gauss.sum()\n\ndef create_wind...
[ [ "torch.nn.functional.conv2d" ] ]
tudor-berariu/lifelong-learning
[ "35041e0e466dd165bd112d65a571e38518a49783" ]
[ "utils/util.py" ]
[ "from typing import List, Tuple\nimport torch\nfrom torch import Tensor\nimport torch.nn as nn\nimport torch.nn.functional as functional\nfrom typing import List, Tuple, Union, Iterator\nimport numpy as np\n\nfrom multi_task import TaskDataLoader, Batch\n\n\nclass AverageMeter(object):\n \"\"\"Computes and store...
[ [ "numpy.sum", "torch.no_grad", "torch.nn.functional.cross_entropy" ] ]
pinjutien/shap
[ "aa8fb5dd5bac3c8cbf9c9c275408da0ca7e21d47" ]
[ "shap/maskers/_text.py" ]
[ "import numpy as np\nfrom ._masker import Masker\n\nclass Text(Masker):\n \"\"\" This masks out tokens according to the given tokenizer.\n\n The masked variables are \n \n output_type : \"string\" (default) or \"token_ids\"\n \n \"\"\"\n def __init__(self, tokenizer, mask_token=\"auto\", ou...
[ [ "numpy.all", "numpy.array", "numpy.argmax", "numpy.zeros" ] ]
freddyaboulton/flax
[ "05f512db95aeab6e9e8efd563d095a08a94ae504" ]
[ "tests/core/design/core_big_resnets_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 a...
[ [ "numpy.prod" ] ]
9autumn5/knet
[ "1ef066cadfaebcda63309658b43c204608ec6c35" ]
[ "src/run.py" ]
[ "import sys\nimport numpy as np\nimport argparse\nfrom KNET.src import model\nfrom KNET.src import util\nimport tensorflow as tf\n\n\n\n####### parse arguments\n\nparser = argparse.ArgumentParser()\n\ngroup = parser.add_mutually_exclusive_group()\ngroup.add_argument(\"--train\", action=\"store_true\")\ngroup.add_ar...
[ [ "tensorflow.Session", "numpy.load" ] ]
aishwaryaprabhat/BRIDGE-Tabular-Semantic-Parsing
[ "640858024df444006dfae106a28fdb58f36f687e" ]
[ "src/semantic_parser/learn_framework.py" ]
[ "#-*- coding: utf-8 -*-\n\n\"\"\"\n Copyright (c) 2020, salesforce.com, inc.\n All rights reserved.\n SPDX-License-Identifier: BSD-3-Clause\n For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause\n\n Encoder-decoder learning framework.\n\"\"\"\n\nimport random\...
[ [ "torch.cat" ] ]
dblandan/OpenNMT-tf
[ "52538d992abcce044911ee945ffaabd1d12ffe9d", "89714f3e79fbc9deb7ea5d2f42a88f0df6d84ae3" ]
[ "opennmt/inputters/inputter.py", "opennmt/encoders/encoder.py" ]
[ "\"\"\"Define generic inputters.\"\"\"\n\nimport abc\nimport six\n\nimport tensorflow as tf\n\nfrom opennmt.layers.reducer import ConcatReducer\nfrom opennmt.utils.misc import extract_prefixed_keys\n\n\n@six.add_metaclass(abc.ABCMeta)\nclass Inputter(object):\n \"\"\"Base class for inputters.\"\"\"\n\n def __init...
[ [ "tensorflow.layers.dropout", "tensorflow.estimator.export.ServingInputReceiver" ], [ "tensorflow.contrib.framework.nest.is_sequence" ] ]
aryavohra/muzero-reference
[ "19d2ab7a6fb8ca93da5cf0df7c6780fdb28b6ee8" ]
[ "games/breakout_ramstate.py" ]
[ "import datetime\nimport os\n\nimport gym\nimport numpy\nimport torch\n\nfrom .abstract_game import AbstractGame\n\ntry:\n import cv2\nexcept ModuleNotFoundError:\n raise ModuleNotFoundError('Please run \"pip install gym[atari]\"')\n\n\nclass MuZeroConfig:\n def __init__(self):\n # More information ...
[ [ "torch.cuda.is_available", "numpy.reshape" ] ]
PTNobel/cvxpy
[ "dc0e88c9f7a7d12a6021e6accd742fc9b0fa7d94" ]
[ "cvxpy/reductions/solvers/conic_solvers/cvxopt_conif.py" ]
[ "\"\"\"\nCopyright 2013 Steven Diamond, 2017 Robin Verschueren\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 appli...
[ [ "numpy.linalg.norm", "numpy.zeros", "scipy.sparse.vstack", "numpy.hstack", "scipy.sparse.linalg.eigsh" ] ]
tomerk/models
[ "656360998ea54a73bc9ffc127c0cb4fc322b9fa9" ]
[ "official/resnet/ctl/ctl_imagenet_main.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.keras.metrics.Mean", "tensorflow.keras.optimizers.SGD", "tensorflow.GradientTape", "tensorflow.keras.backend.set_image_data_format", "tensorflow.distribute.get_strategy", "tensorflow.test.is_built_with_cuda", "tensorflow.function", "tensorflow.reshape", "tensorflow....
edesz/predict-loan-defaults
[ "04af0b98d54a0488c27a171a0bf0c6179e25e886" ]
[ "src/ml_helpers.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\nimport pandas as pd\nimport sklearn.metrics as mr\nfrom imblearn.over_sampling import SMOTE, RandomOverSampler\nfrom imblearn.under_sampling import RandomUnderSampler\nfrom sklearn.model_selection import GridSearchCV, StratifiedKFold\nfrom sklearn.pipeline impor...
[ [ "sklearn.model_selection.StratifiedKFold", "sklearn.model_selection.GridSearchCV", "pandas.DataFrame", "pandas.concat", "sklearn.metrics.make_scorer", "sklearn.pipeline.Pipeline" ] ]
bolaurent/python-cmdline-zoql
[ "94acfd0bcb358bdf922fe1fddedb8f6d2236e20d" ]
[ "zoql/zoql.py" ]
[ "# -*- coding: utf-8 -*-\n\n\n__version__ = \"0.1.0-dev\"\n\n\n\n\"\"\"zoql.zoql: provides entry point main().\n\nA command line loop that interprets Zuora Object Query Language\n\nResults are either displayed on the console or pushed to Excel \n\nIf a query includes a period in the field names, the zuora data expo...
[ [ "pandas.DataFrame" ] ]
alexeip0/spambayes
[ "0c7d12cf4702ef82974ab16d2a36fa9ccedf185a" ]
[ "spambayes/spambayes/optimize.py" ]
[ "#\n__version__ = '$Id$'\n#\n# Optimize any parametric function.\n#\nimport copy\n\ndef SimplexMaximize(var, err, func, convcrit = 0.001, minerr = 0.001):\n import numpy\n var = numpy.array(var)\n simplex = [var]\n for i in range(len(var)):\n var2 = copy.copy(var)\n var2[i] = var[i] + err[...
[ [ "numpy.array", "numpy.absolute" ] ]
Maclory/Deep-Iterative-Collaboration
[ "3ff19f1e4232e11b33fcd4c035aadaadf9d445f0" ]
[ "code/train.py" ]
[ "import argparse, random, os, math, time\nfrom tqdm import tqdm\nimport options.options as option\n\n\ndef main():\n parser = argparse.ArgumentParser(\n description='Train Super Resolution Models')\n parser.add_argument(\n '-opt', type=str, required=True, help='Path to options JSON file.')\n ...
[ [ "torch.manual_seed" ] ]
mayankb2103/matrixcaps_point
[ "ead464f6d0d5a573035c0f1ed0affd37f60ee486" ]
[ "modelnet40_provider.py" ]
[ "import numpy as np\nimport h5py\n\n#parser for hdf5 files and function for data augmentation\n\ndef shuffle_data(data, labels):\n \"\"\" Shuffle data and labels.\n Input:\n data: B,N,... numpy array\n label: B,... numpy array\n Return:\n shuffled data, label and shuffle ...
[ [ "numpy.array", "numpy.sin", "numpy.zeros", "numpy.random.randn", "numpy.random.shuffle", "numpy.random.uniform", "numpy.cos" ] ]
s-bl/ALLogger
[ "03850a2423cffcc6e77de90f9430db9098fd01fc" ]
[ "allogger/api/hdf.py" ]
[ "from glob import glob\nimport os\nimport numpy as np\nimport h5py\n\ndef list_keys(path):\n keys = []\n\n def get_flat_keys(name, obj):\n if isinstance(obj, h5py.Dataset):\n keys.append(name)\n\n file = sorted(glob(os.path.join(path, '*.h5')))[0]\n with h5py.File(file, 'r') as hdf:\n ...
[ [ "numpy.concatenate", "numpy.asarray" ] ]
cybergla/datamart
[ "ba377b2d2a25acb8efe8e636b2c6579d3863713f" ]
[ "datamart/unit_tests/test_joiner_base.py" ]
[ "import unittest\nfrom datamart.joiners.joiner_base import DefaultJoiner, JoinerType, JoinerPrepare\nimport pandas as pd\nfrom pandas.testing import assert_frame_equal\nfrom datamart.utils import Utils\n\n\nclass TestJoinerBase(unittest.TestCase):\n def setUp(self):\n self.joiner = DefaultJoiner()\n\n ...
[ [ "pandas.DataFrame" ] ]
ManasGupta93/Breast-Cancer-DataSet
[ "0413c1697a95a18416f70ac5ed087312b301e849" ]
[ "Breast Cancer/breastCancer.py" ]
[ "#from http://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/breast-cancer-wisconsin.data\n\nimport pandas as pd\nfrom sklearn.utils import shuffle\n\nnp.random.seed(42)\n\ncolumns = ['ID','1', '2', '3', '4', '5', '6', '7', '8','9','class']\ndata = pd.read_csv('breast-cancer-wisconsin.dat...
[ [ "pandas.read_csv", "sklearn.utils.shuffle" ] ]
idiap/cbi_toolbox
[ "01e1f4ebc0a4156cfc5bbf65da9d932906b304d8" ]
[ "cbi_toolbox/simu/imaging.py" ]
[ "\"\"\"\nThe imaging module provides simulations of different imaging systems\nand acquisition techniques for microscopy.\n\n**Conventions:**\n\narrays follow the ZXY convention, with\n\n - Z : depth axis (axial, focus axis)\n - X : horizontal axis (lateral)\n - Y : vertical axis (lateral, rotation axis wh...
[ [ "numpy.pad", "numpy.empty", "scipy.signal.fftconvolve", "numpy.zeros", "scipy.ndimage.rotate", "numpy.sum", "scipy.ndimage.spline_filter1d", "numpy.random.default_rng", "numpy.arange", "numpy.sqrt", "numpy.flip" ] ]
gecko-robotics/pygecko
[ "a809593a894d8e591e992455a01aa73d8f7b7981" ]
[ "pygecko/transport/protocols.py" ]
[ "# -*- coding: utf-8 -*-\n##############################################\n# The MIT License (MIT)\n# Copyright (c) 2014 Kevin Walchko\n# see LICENSE for full details\n##############################################\n#\n\nimport pickle\n# from collections import OrderedDict\nfrom pygecko.messages import vec_t, quater...
[ [ "numpy.array" ] ]
Stubatiger/jina
[ "721b179bf30bc2cc03e2f7a61243663e92e7439e" ]
[ "tests/unit/types/arrays/mixins/test_embed.py" ]
[ "import os\n\nimport numpy as np\nimport onnxruntime\nimport paddle\nimport pytest\nimport tensorflow as tf\nimport torch\n\nfrom jina import DocumentArray, DocumentArrayMemmap\n\nrandom_embed_models = {\n 'keras': lambda: tf.keras.Sequential(\n [tf.keras.layers.Dropout(0.5), tf.keras.layers.BatchNormaliz...
[ [ "torch.rand", "torch.nn.Dropout", "numpy.testing.assert_array_almost_equal", "tensorflow.keras.layers.Dropout", "torch.nn.BatchNorm1d", "numpy.random.random", "tensorflow.keras.layers.BatchNormalization" ] ]
manhntm3/FaceShifter-Pytorch
[ "a9988eaca7fc729a8e97eab0b3fa441d52ef0492" ]
[ "data/preprocess/preprocess_parallel.py" ]
[ "\n\nimport os\nimport PIL\nimport dlib\nimport random\nimport argparse\nimport numpy as np\nimport scipy.ndimage\nfrom PIL import Image\nfrom tqdm import tqdm\n\nimport torch\n\n# python preprocess_parallel.py --root /vinai/manhnt21/datasets/FaceDataset/celeba_hq/data256x256 --output_dir ~/Dataset/celeba_hq/data25...
[ [ "numpy.empty", "numpy.median", "numpy.rint", "numpy.mean", "numpy.flipud", "numpy.float32", "numpy.stack", "numpy.hypot", "numpy.clip", "numpy.floor" ] ]
anotherTK/segmentation.pytorch
[ "36b6b412ee5561745fd9a67e4b6e28c0b9f58d68" ]
[ "segm_benchmark/data/datasets/ade20k.py" ]
[ "\nimport os\nimport numpy as np\nimport torch\nfrom PIL import Image\nfrom .segm import SegmentationDataset\n\nclass ADE20KDataset(SegmentationDataset):\n NUM_CLASS = 150\n def __init__(self, cfg, stage, transform=None):\n super(ADEDataset, self).__init__(cfg, stage, transform)\n\n self.images ...
[ [ "numpy.array", "torch.from_numpy" ] ]
rnowling/pop-gen-models
[ "308079909c49a478787c103f2d2b8ee037ac6952" ]
[ "bamova/predict_loci.py" ]
[ "import sys\n\nimport numpy as np\n\ndef predict_loci(phi_values, cutoff_percent):\n\taverage_phi_values = np.mean(phi_values, axis=0)\n\n\tsortable = []\n\tfor loci, phi in enumerate(average_phi_values):\n\t\tsortable.append((phi, loci))\n\tsortable.sort()\n\tsortable.reverse()\n\n\tcutoff_idx = int(len(sortable) ...
[ [ "numpy.load", "numpy.mean" ] ]
reegis/berlin_hp
[ "a15fbdf675ff1459b2ac71b50105d3d270219a19" ]
[ "berlin_hp/feedin.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Aggregating feed-in time series for the model regions.\n\nSPDX-FileCopyrightText: 2016-2019 Uwe Krien <krien@uni-bremen.de>\n\nSPDX-License-Identifier: MIT\n\"\"\"\n__copyright__ = \"Uwe Krien <krien@uni-bremen.de>\"\n__license__ = \"MIT\"\n\n\n# Python libraries\nimport logging\n\...
[ [ "matplotlib.pyplot.show" ] ]
PawelRosikiewicz/MachineLearning
[ "a119ff3327f77937101a70ea12a66652b9f42f2a" ]
[ "MachineLearning_code_examples/src/utils/.ipynb_checkpoints/DataFrameExplorer_distribusion-checkpoint.py" ]
[ "# ********************************************************************************** #\n# #\n# Project: Data Frame Explorer # \n# Author: Pawel Rosikiew...
[ [ "pandas.isnull", "scipy.stats.normaltest", "scipy.stats.shapiro", "numpy.round", "pandas.DataFrame", "matplotlib.pyplot.MaxNLocator", "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "scipy.stats.probplot", "numpy.std", "numpy.mean", "matplotlib.pyplot.tigh...
prediksicovidjatim/prediksicovidjatim-core
[ "e0be4b86d98e1f628852ec627bb1a5b406efb923" ]
[ "prediksicovidjatim/modeling/seicrd_rl.py" ]
[ "import numpy as np\nfrom scipy.integrate import odeint\nimport lmfit\nfrom .. import util\nfrom .base_model import BaseModel\n\nclass SeicrdRlModel(BaseModel):\n params = [\"incubation_period\",\n \"critical_chance\", \"critical_time\", \n \"recovery_time_normal\", \"recove...
[ [ "numpy.linspace", "scipy.integrate.odeint" ] ]
peterbell10/mkl_fft
[ "4d8cc2a07778ae8bac04d0af3c1079921b2115b2" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\n# Copyright (c) 2017-2020, Intel Corporation\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,\n# thi...
[ [ "numpy.distutils.core.setup", "numpy.distutils.misc_util.Configuration" ] ]
geosrs/Dimensionality-reduction-and-classification-on-Hyperspectral-Images-Using-Python
[ "309bd1b3adcba398cb1e8abcd3464dfc965ca7da" ]
[ "Indian_pines_knnc.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n\nfrom sklearn import decomposition\nfrom sklearn import datasets\n\n# load dataset into Pandas DataFrame\ndf = pd.read_csv(\"D:\\Python_programs\\ML\\Complete_Data_.csv\")\n\nfrom sklearn.preprocessing import StandardScaler\nn=[]\nind=[]\...
[ [ "sklearn.model_selection.train_test_split", "pandas.read_csv", "sklearn.neighbors.KNeighborsClassifier", "sklearn.metrics.accuracy_score" ] ]
kethan1/Scipy-Python
[ "1f260ed12f0923dc044ee74a28d35cc1e6f6f821" ]
[ "csv_pie_chart_plotter.py" ]
[ "import ast\nimport matplotlib.pyplot as plt\n\n\nclass InvalidConfig(Exception):\n pass\n\n\nfilename = input(\"CSV file: \")\nwith open(filename) as input_file:\n headers = input_file.readline().strip().split(\",\")\n category_value = list(map(int, input_file.readline().strip().split(\",\")))\n config...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.pie", "matplotlib.pyplot.legend" ] ]
ISE-DeepLearning/CoverageDNN
[ "a3674caadb545e40641608874714f03fbcf74eed" ]
[ "process/optimizer/three_layers_rq1_optimizer.py" ]
[ "import os\nimport numpy as np\nimport gc\nimport json\nimport time\n\n\ndef check_dir(dir_path):\n if not os.path.exists(dir_path):\n os.makedirs(dir_path)\n\n\ndef gc_collect(datas):\n del datas\n gc.collect()\n\n\n# 接下来这两个方法,硬编码,不是很好,有机会改一下……\ndef get_value_for_three_layer_data(type=0):\n acti...
[ [ "numpy.concatenate", "numpy.bitwise_or", "numpy.zeros", "numpy.sum", "numpy.percentile", "numpy.multiply" ] ]
UMN-RXInformatics/deepspeech.pytorch
[ "462d87432122760f1279481e10ac3364d1c5822d" ]
[ "transcribe.py" ]
[ "import argparse\nimport warnings\nimport sys\nimport re\n\nfrom opts import add_decoder_args, add_inference_args\nfrom utils import load_model\n\nwarnings.simplefilter('ignore')\n\nfrom decoder import GreedyDecoder\n\nimport torch\n\nfrom data.data_loader import SpectrogramParser\nfrom model import DeepSpeech\nimp...
[ [ "torch.device" ] ]
joannezhouyi/visual_textual_cross_retrieval
[ "6d5c55a475af74bba63887fff0774d5597830a2b" ]
[ "evaluation.py" ]
[ "from __future__ import print_function\nimport os\nimport pickle\n\nimport numpy\nfrom data import get_test_loader\nimport time\nimport numpy as np\nfrom vocab import Vocabulary # NOQA\nimport torch\nfrom model import XRN, order_sim\nfrom collections import OrderedDict\n\n\nclass AverageMeter(object):\n \"\"\"C...
[ [ "numpy.array", "numpy.dot", "numpy.zeros", "numpy.median", "torch.save", "numpy.where", "torch.load", "numpy.argsort", "torch.Tensor" ] ]
roarmstrong/datacube-core
[ "5e38638dabd9e5112e92b503fae6a83c8dcc4902" ]
[ "tests/storage/test_netcdfwriter.py" ]
[ "from __future__ import print_function, absolute_import\n\nimport netCDF4\nimport numpy\nimport xarray as xr\nimport pytest\nfrom hypothesis import given\nfrom hypothesis.strategies import text\nfrom tests.conftest import tmpnetcdf_filename as get_tmpnetcdf_filename\nimport string\n\nfrom datacube.model import Vari...
[ [ "numpy.array", "numpy.dtype" ] ]
quan70636/donkeycar
[ "a524a854c08406df0ef8f6fa623824b1c7f1a77f" ]
[ "donkeycar/templates/complete.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nScripts to drive a donkey 2 car\n\nUsage:\n manage.py (drive) [--model=<model>] [--js] [--type=(linear|categorical)] [--camera=(single|stereo)] [--meta=<key:value> ...] [--myconfig=<filename>]\n manage.py (train) [--tubs=tubs] (--model=<model>) [--type=(linear|inferred|tensorr...
[ [ "tensorflow.python.keras.models.model_from_json" ] ]
nautilusPrime/facerec_dml
[ "ad163e58f194db61892a4744eed05c87b68807eb" ]
[ "face_trigger/model/deep/FaceRecognizer.py" ]
[ "\"\"\"\nDeep Learning based face recognition module.\n\n.. moduleauthor:: Ankur Roy Chowdhury <ankurrc@softura.com>\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport logging\n\nimport os\nimport tqdm\nimport numpy as np\nimport dlib\...
[ [ "numpy.max", "numpy.array", "sklearn.externals.joblib.dump", "numpy.nonzero", "sklearn.externals.joblib.load", "numpy.argmax" ] ]
TeamJumpstart/InformatiCup2021
[ "a4d07992f772d3a1e9ef715fa8e9ce2234cd47a4" ]
[ "main.py" ]
[ "import argparse\r\nimport logging\r\nimport multiprocessing as mp\r\nimport os\r\nimport time\r\nfrom pathlib import Path\r\n\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom tqdm import tqdm\r\n\r\nfrom environments import SimulatedSpe_edEnv, WebsocketEnv\r\nfrom environments.logging import CloudU...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.axes", "matplotlib.pyplot.pause", "matplotlib.pyplot.show", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.subplot" ] ]
arnaudvl/firedup
[ "9629fffc8af7d9607025d82ad757a67baa805285" ]
[ "fireup/algos/ppo/mdrnn.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as f\nfrom torch.distributions.normal import Normal\n\n\ndef gmm_loss(batch, mus, sigmas, logpi, reduce=True):\n \"\"\" Computes the gmm loss.\n Compute minus the log probability of batch under the GMM model described\n by mus, sigmas, pi. Pr...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.LSTM", "torch.max", "torch.distributions.normal.Normal", "torch.nn.functional.log_softmax", "torch.log", "torch.exp", "torch.mean", "torch.sum" ] ]
antonior92/sysid-neuralnet
[ "4ab4be97d37345e858807d9ff37c94a148530ba6" ]
[ "python-scripts/validate/chen.py" ]
[ "# %% Prepare\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport xarray as xr\nfrom utils import show_fig\n\n# %% Read file\ndf1 = pd.read_csv('validate/code.csv')\ndf2 = pd.read_csv('validate/hydra8.csv')\n\ndf = pd.concat([df1, df2], axis=0, ignore_index=True,...
[ [ "numpy.zeros", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tight_layout", "numpy.sqrt", "pandas.concat", "pandas.read_csv" ] ]
avulaankith/Streamlit-Data-Visualization
[ "cf99973174194c23247f70f4992dcd772b98199d" ]
[ "streamlit/app_final.py" ]
[ "import streamlit as st\nimport pandas as pd\nimport numpy as np\nimport pydeck as pdk\nimport plotly.express as px\n\n# st.title(\"Hello World!\")\n# st.markdown(\"### My First Streamlit Dashboard!\")\n\nDATA_URL = (\n\"Motor_Vehicle_Collisions_-_Crashes.csv\"\n)\n\nst.title(\"Motor Vehicle Collisions in New York ...
[ [ "numpy.average", "numpy.histogram", "pandas.read_csv" ] ]
ajbouh/transformers
[ "adcdbe95930272abdb305e95b3794672f992d5f8" ]
[ "transformers/file_utils.py" ]
[ "\"\"\"\nUtilities for working with the local dataset cache.\nThis file is adapted from the AllenNLP library at https://github.com/allenai/allennlp\nCopyright by the AllenNLP authors.\n\"\"\"\nfrom __future__ import (absolute_import, division, print_function, unicode_literals)\n\nimport sys\nimport json\nimport log...
[ [ "torch.hub._get_torch_home" ] ]
thepolicylab/COVID-SMSExperiment
[ "2eb41a2fea4858b7e794bb7a6af396f66d41f1a6" ]
[ "src/thompson/codered.py" ]
[ "\"\"\"\nFunctions and classes for interacting with the CodeRED data format\n\"\"\"\nfrom dataclasses import dataclass\nfrom typing import List, Optional, Union\n\nimport pandas as pd\n\nfrom .types import FilenameType\n\n# The required headers for CodeRED\nEXCEL_HEADERS = (\n \"Command\",\n \"CustomKey\",\n ...
[ [ "pandas.DataFrame.from_records", "pandas.ExcelWriter" ] ]
federicoruggeri/argscichat_project
[ "ad4680ec5ce5f274b3ddec05a237e39b33dc1bd5" ]
[ "collection_tool/run.py" ]
[ "# !/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\nimport collection_tool.const_define as cd\nimport os\nfrom mephisto.operations.operator import Operator\nf...
[ [ "pandas.read_csv" ] ]
liuqiangh/bert-chinese-ner-pos
[ "14cc4faaa32b2bec06a475288c8b5e901b409b94" ]
[ "lstm_crf_layer.py" ]
[ "# encoding=utf-8\n\n\"\"\"\nbert-blstm-crf layer\n@Author:Macan\n\"\"\"\n\nimport tensorflow as tf\nfrom tensorflow.contrib import rnn\nfrom tensorflow.contrib import crf\n\n\nclass BLSTM_CRF(object):\n def __init__(self, embedded_chars, hidden_unit, cell_type, num_layers, dropout_rate,\n initia...
[ [ "tensorflow.contrib.rnn.DropoutWrapper", "tensorflow.contrib.crf.crf_decode", "tensorflow.contrib.crf.crf_log_likelihood", "tensorflow.contrib.rnn.LSTMCell", "tensorflow.zeros_initializer", "tensorflow.concat", "tensorflow.nn.bidirectional_dynamic_rnn", "tensorflow.reshape", "t...
DeepFD/DeepFD
[ "d84268142abc3d58ef5513644d5d308443afa1d1" ]
[ "Benchmark/Subjects/59282996/epoch_30/origin.py" ]
[ "# from Utils.utils import save_pkl, pack_train_config\r\nimport pandas as pd\r\nfrom pandas import *\r\nfrom keras.models import Sequential\r\nfrom keras.layers import LSTM, Dense, TimeDistributed, Bidirectional, Dropout, Masking\r\nfrom keras import optimizers\r\nimport numpy as np\r\n\r\nX_batches_train = [np.ar...
[ [ "numpy.array" ] ]
AritzMar/amfearl
[ "1f7e3a05bce4c247dd5b4063bfec1a31373cda18" ]
[ "analyzer/Analyzer.py" ]
[ "# -*- coding:utf-8 -*-\nimport numpy as np\n\n\nclass Layer():\n def __init__(self, ltype, lkeras_config, w_size,\n w_shape, b_size, b_shape, trainable):\n self.type = ltype\n self.keras_config = lkeras_config\n self.w_size = w_size\n self.b_size = b_size\n sel...
[ [ "numpy.sqrt" ] ]
WEYAI/PhoNLP
[ "8fefe49965dc6346c224a5636d9333a7ddf55a2c" ]
[ "phonlp/models/jointmodel/trainer.py" ]
[ "\"\"\"\nA trainer class to handle training and testing of models.\n\"\"\"\n\nimport sys\nimport torch\nfrom phonlp.models.common import utils as util\nfrom phonlp.models.common.chuliu_edmonds import chuliu_edmonds_one_root\nfrom phonlp.models.common.crf import viterbi_decode\nfrom phonlp.models.common.trainer impo...
[ [ "torch.save", "torch.load" ] ]
gregjauvion/BasicSR
[ "59df46d88486ec0913e6d74fa40b4d645e282cf9" ]
[ "test_models.py" ]
[ "import logging\nimport torch\nfrom os import path as osp\n\nfrom basicsr.data import create_dataloader, create_dataset\nfrom basicsr.models import create_model\nfrom basicsr.train import parse_options\nfrom basicsr.utils import (get_env_info, get_root_logger, get_time_str,\n make_exp_dirs...
[ [ "numpy.rollaxis", "torch.from_numpy" ] ]
ttm/musicLegacy
[ "106c0d55657c703a7afa42e230c645fb9a2874fe" ]
[ "musicLegacy/utils.py" ]
[ "import numpy as n\nfrom scipy.io import wavfile as w\n\nclass LPFilter:\n pass\nclass Notch:\n pass\nclass Notch:\n pass\nclass Utils:\n def __init__(self):\n pass\n def normalize(self, vector):\n return -1+2*(vector-vector.min())/(vector.max()-vector.min())\n def normalizeRows(self...
[ [ "numpy.zeros", "scipy.io.wavfile.write" ] ]
EdwardJTL/Edit3D
[ "bbb6364aeb5ea17c12c0c23578268641c066ebca" ]
[ "generators/generators.py" ]
[ "\"\"\"Implicit generator for 3D volumes\"\"\"\n\nimport random\nimport torch.nn as nn\nimport torch\nimport time\n\nimport tqdm\nfrom einops import repeat, rearrange\n\nimport curriculums\nfrom torch.cuda.amp import autocast\n\nfrom .volumetric_rendering import *\nfrom .partial_grad_utils import *\nfrom siren impo...
[ [ "torch.zeros", "torch.nn.Linear", "torch.cat", "torch.nn.Identity", "torch.rand", "torch.gather", "torch.nn.Tanh", "torch.no_grad", "torch.randperm", "torch.unsqueeze", "torch.sort", "torch.zeros_like", "torch.randn" ] ]
rmkujala/ptn_temporal_distances-
[ "c719d6cc3dc3625060fefc04294f2f9ca5014dc4" ]
[ "scripts/analyze_all_to_all_stats.py" ]
[ "import fnmatch\nimport pickle\nimport os\n\nimport matplotlib\nimport numpy\nimport matplotlib.pyplot as plt\nfrom matplotlib.ticker import ScalarFormatter\nfrom scipy.stats import binned_statistic\n\nfrom util import get_data_or_compute\n\nimport settings\nfrom gtfspy.routing.node_profile_analyzer_time_and_veh_le...
[ [ "numpy.logical_not", "numpy.histogram2d", "numpy.array", "numpy.histogram", "matplotlib.cm.get_cmap", "numpy.random.seed", "numpy.percentile", "matplotlib.pyplot.sca", "numpy.sum", "matplotlib.pyplot.locator_params", "matplotlib.rc", "matplotlib.pyplot.figure", ...
lyeoni/pytorch-nlp-tutorial
[ "6e4c74e103f4cdc5e0559d987ae6e41c40e17a5a" ]
[ "translation-transformer/inference.py" ]
[ "import argparse\nimport torch\n\nfrom tokenization import Tokenizer, PretrainedTokenizer\n\ndef main(args):\n print(args)\n \n # Load tokenizer\n tokenizer_src = PretrainedTokenizer(pretrained_model = args.pretrained_model_src, vocab_file = args.vocab_file_src)\n tokenizer_tgt = PretrainedTokenizer(...
[ [ "torch.cuda.is_available", "torch.tensor", "torch.load" ] ]
StanfordGeometryLab/artemis
[ "e4938ef79b504e810e4d3634eab23781b06a926e" ]
[ "artemis/utils/other_datasets/flickr30K_entities.py" ]
[ "\"\"\"\nMinimal operations for loading flickr30K_entities dataset.\n\nVerbatim copy for get_sentence_data() & get_annotations() from:\nhttps://github.com/BryanPlummer/flickr30k_entities/blob/master/flickr30k_entities_utils.py\n\nThe MIT License (MIT)\nOriginally created in mid 2020, for Python 3.x\nCopyright (c) 2...
[ [ "pandas.Series" ] ]
roachsinai/pytorch-cnn-visualizations
[ "ec24bf3583139369482bfafc681bc5c62315e448" ]
[ "src/cnn_layer_visualization.py" ]
[ "\"\"\"\nCreated on Sat Nov 18 23:12:08 2017\n\n@author: Utku Ozbulak - github.com/utkuozbulak\n\"\"\"\nimport os\nimport cv2\nimport numpy as np\n\nimport torch\nfrom torch.optim import Adam\nfrom torchvision import models\n\nfrom misc_functions import preprocess_image, recreate_image\n\n\nclass CNNLayerVisualizat...
[ [ "torch.optim.Adam", "torch.mean", "numpy.random.uniform" ] ]
FermentAI/Fermentation-Station
[ "35ceb8579880bdf32e5f48b90401664b2e55697a" ]
[ "rms/models/jckantor_complex/model.py" ]
[ "from engine import Subroutine\nfrom pyfoomb import BioprocessModel\nimport numpy as np\n\nclass MyModel(BioprocessModel):\n \"\"\"\n Defines the model class. Always named MyModel. Always inherits from BioprocessModel\n \n Must define rhs(self,t,y) as a system of ODEs.\n \"\"\"\n def rhs(self, t, ...
[ [ "numpy.exp" ] ]
610yilingliu/excel-like-python-curve-fitter
[ "5a55ea3479296ff9dcf258ec55ec40f450b2606b" ]
[ "pygrapher/grapher.py" ]
[ "from scipy import optimize\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport re\nimport pandas as pd\nfrom numpy import exp, log10\n\n\ndef fit_draw_poly(n, x_array, y_origin, point_range, label, color, show_params, show_digit):\n '''\n use numpy.polyfit to fit polynominal functions\n '''\n ...
[ [ "numpy.array", "scipy.optimize.curve_fit", "numpy.random.rand", "pandas.DataFrame", "matplotlib.pyplot.plot", "numpy.polyval", "numpy.arange", "numpy.polyfit", "matplotlib.pyplot.scatter" ] ]
yudasong/pytorch_sac_ae
[ "9cc2dc526ab582fd8f7c2e78263ff18f595d3cf8" ]
[ "subproc_vec_env.py" ]
[ "import multiprocessing as mp\nfrom collections import OrderedDict\nfrom typing import Any, Callable, List, Optional, Sequence, Tuple, Type, Union\n\nimport gym\nimport numpy as np\n\nfrom stable_baselines3.common.vec_env.base_vec_env import (\n CloudpickleWrapper,\n VecEnv,\n VecEnvIndices,\n VecEnvObs...
[ [ "numpy.stack" ] ]
skywalk163/mindspore
[ "028ae212624164044cfaa84f347fc502cb7fcb0f" ]
[ "tests/ut/python/pynative_mode/test_training.py" ]
[ "# Copyright 2020 Huawei Technologies Co., Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l...
[ [ "numpy.ones" ] ]
oganesManasian/pytorch-deeplab-xception
[ "83c042e18b06ced544acb0da66f04e6dc2280d94" ]
[ "evaluate.py" ]
[ "import argparse\nimport os\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom mypath import Path\nfrom dataloaders import make_data_loader\nfrom modeling.sync_batchnorm.replicate import patch_replication_callback\nfrom modeling.deeplab import *\nfrom utils.loss import SegmentationLosses\nfrom utils.calculate_weigh...
[ [ "numpy.diag", "numpy.argmax", "numpy.load" ] ]
akey7/WISDEM
[ "29c5abbdfdc8800cfd18237e8e0edf0d10c7e02c" ]
[ "wisdem/aeroelasticse/CaseGen_General.py" ]
[ "import os, itertools\nimport numpy as np\n\ndef save_case_matrix_direct(case_list, dir_matrix):\n ### assumes all elements of the list are dict for that case that has the same keys!\n if not os.path.exists(dir_matrix):\n os.makedirs(dir_matrix)\n ofh = open(os.path.join(dir_matrix,'case_matrix....
[ [ "numpy.where", "numpy.asarray", "numpy.shape" ] ]
SnailTowardThesun/Paddle
[ "7a5f3f750bcbe084796f7840ae2937925432b413" ]
[ "python/paddle/fluid/tests/unittests/test_scale_op.py" ]
[ "# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "numpy.random.random", "numpy.array" ] ]
grahamgower/moments
[ "54d2c58d91a231303fb361258e24b41b23f50661" ]
[ "moments/Inference.py" ]
[ "\"\"\"\nComparison and optimization of model spectra to data.\n\"\"\"\nimport logging\nlogger = logging.getLogger('Inference')\n\nimport os,sys\n\nimport numpy\nfrom numpy import logical_and, logical_not\n\nfrom . import Misc, Numerics\nfrom scipy.special import gammaln\nimport scipy.optimize\n\n#: Stores thetas\n...
[ [ "numpy.logical_not", "numpy.logical_or", "numpy.array", "numpy.isnan", "scipy.special.gammaln", "numpy.ma.sqrt", "numpy.log", "numpy.zeros", "numpy.ndenumerate", "numpy.exp", "numpy.logical_and", "numpy.any", "numpy.isscalar", "numpy.all", "numpy.ma.powe...
giulio93/anticipating-activities
[ "32f707914417db2d0f8ef79036784d8c98c19ff0" ]
[ "Salad/eval.py" ]
[ "#!/usr/bin/python2.7\n\nimport numpy as np\nimport argparse\nimport glob\nimport re\nfrom sklearn.metrics import accuracy_score,recall_score,precision_score,f1_score\nfrom sklearn.metrics import classification_report\nfrom collections import defaultdict\nfrom utils.helper_functions import separator\nimport os\nimp...
[ [ "numpy.unique" ] ]
anva-kn/ramanflow
[ "0a8852a0a8d57d97e5ccd011bc6bc8659ecd666c" ]
[ "tests/test_peak_assymetry.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib\nmatplotlib.use('Qt5Agg')\nimport matplotlib.pyplot as plt\nfrom importance_functions import Importance as im\nfrom Synthetic_Signal import Synthetic_Signal\nfrom scipy import signal\n\nsynthetic_sig = Synthetic_Signal()\n\nsynthetic_sig.generate_random_wa...
[ [ "matplotlib.use", "numpy.array", "matplotlib.pyplot.plot", "numpy.arange", "numpy.argmax", "scipy.signal.gaussian", "matplotlib.pyplot.show" ] ]
YamingPeng100/cuBERT
[ "0c73e22f26b418ac36208a25f19cc34328ac8d7a" ]
[ "python/setup.py" ]
[ "import setuptools\nimport sys\nfrom distutils.core import setup\nfrom distutils.extension import Extension\nfrom Cython.Build import cythonize\n\nimport numpy as np\nimport platform\nimport shutil\n\nextra_compile_args = ['-std=c++11']\nextra_link_args = []\nlibname = 'libcuBERT.so'\nif platform.system() == 'Darwi...
[ [ "numpy.get_include" ] ]
rearwist3/cookiecutter-tensorflow-project
[ "d1544004ef48b95de0cd6cf650eac6cc9d7efd0e" ]
[ "{{cookiecutter.repo_name}}/{{cookiecutter.source}}/data_loaders/data_generator.py" ]
[ "import numpy as np\n\n### generate synthetic samples\n\n# WIP\nclass DataGenerator:\n def __init__(self, config):\n self.config = config\n # load data here\n self.input = np.ones((500, 784))\n self.y = np.ones((500, 10))\n\n def next_batch(self, batch_size):\n idx = np.rand...
[ [ "numpy.ones", "numpy.random.choice" ] ]
Hiusam/deit
[ "9bb6aef943d93a7d00a5cff28e910c062c94d7ea" ]
[ "engine.py" ]
[ "# Copyright (c) 2015-present, Facebook, Inc.\n# All rights reserved.\n\"\"\"\nTrain and eval functions used in main.py\n\"\"\"\nimport math\nimport sys\nfrom typing import Iterable, Optional\n\nimport torch\n\nfrom timm.data import Mixup\nfrom timm.utils import accuracy, ModelEma\n\nfrom losses import Distillation...
[ [ "torch.nn.functional.fold", "torch.cuda.amp.autocast", "torch.cuda.synchronize", "torch.min", "torch.no_grad", "torch.tensor", "torch.nn.CrossEntropyLoss" ] ]
sgrams/ci
[ "fbbfdb7b8401991e132d757fd1539957c240cc74" ]
[ "04-classifiers_and_decision_trees/01-classifier.py" ]
[ "#!/bin/env python\n# 2019/11/29\n# classifier example\n# Stanislaw Grams <sjg@fmdx.pl>\n# 04-classifiers_and_decision_trees/01-classifier.py\nimport numpy as np\nimport pandas as pd\n\ndef myPredictRow (df):\n if (df[\"petalwidth\"] <= 0.6):\n return 'Iris-setosa'\n else:\n if (df[\"petalwidth...
[ [ "pandas.read_csv" ] ]
firmamentqj/bodyemotion
[ "d1e83ee6043e1ff50a2e37b5d17c2dbccc4ca688" ]
[ "extract_joints_IIAI_Pose.py" ]
[ "import argparse\nimport logging\nimport sys\nimport time\nimport os\n\nfrom tf_pose import common\nimport cv2\nimport numpy as np\nfrom tf_pose.estimator import TfPoseEstimator\nfrom tf_pose.networks import get_graph_path, model_wh\nimport matplotlib.pyplot as plt\n\nlogger = logging.getLogger('TfPoseEstimator')\n...
[ [ "numpy.max", "numpy.array", "numpy.zeros", "numpy.nonzero" ] ]
kaiwen-kakuiii/metadetect-sims
[ "a0fd133ca5bc946c6ce769e8657ef2ce10226953" ]
[ "mdetsims/end2end_sim_utils.py" ]
[ "import logging\nimport os\nimport functools\n\nimport numpy as np\n\nimport ngmix\nimport galsim\nimport fitsio\n\nfrom .ps_psf import PowerSpectrumPSF\nfrom .masking import generate_bad_columns, generate_cosmic_rays\nfrom .interp import interpolate_image_and_noise\nfrom .cs_interp import interpolate_image_and_noi...
[ [ "numpy.zeros_like", "numpy.array", "numpy.ceil", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.unravel_index", "numpy.sqrt", "numpy.var" ] ]
ustc-wudiymy/Deepfake-Detection
[ "bb14cb907cfbfe488a0d1c82f79c07721638dbe9" ]
[ "detect_from_video.py" ]
[ "\"\"\"\nEvaluates a folder of video files or a single file with a xception binary\nclassification network.\n\nUsage:\npython detect_from_video.py\n -i <folder with video files or path to video file>\n -m <path to model file>\n -o <path to output folder, will write one or multiple output videos there>\n\nA...
[ [ "torch.load", "torch.nn.Softmax", "torch.max" ] ]
rondelion/CBT1CA
[ "c632a39e79dbbaba932d3d9b93c78454c8f5548d" ]
[ "CBT1cCA_1.py" ]
[ "#!/usr/bin/env python\n\nimport sys\nimport argparse\nfrom collections import deque\nimport json\nimport ast\n\n# from gym import wrappers\n\nimport logging\nimport numpy as np\n\nimport brica1\nimport brica1.brica_gym\n\nimport torch\nimport torch.utils.data\nimport torch.nn as nn\n# from torch.utils.tensorboard ...
[ [ "torch.nn.Linear", "numpy.max", "numpy.array", "numpy.random.binomial", "numpy.random.rand", "numpy.zeros", "torch.nn.Sigmoid", "numpy.where", "numpy.random.randint", "torch.utils.data.DataLoader", "torch.nn.BCELoss", "numpy.append", "torch.tensor", "numpy.r...
knaresh/sagemaker-python-sdk
[ "11b544207c19e320a2da92bedb668bb1a0a5f975" ]
[ "tests/integ/test_tf_cifar.py" ]
[ "# Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in th...
[ [ "numpy.random.randn" ] ]
linhthi/pipgcn
[ "a835106e31165123f4dcc19fbbdde23770682a3c" ]
[ "train_test.py" ]
[ "import numpy as np\nfrom configuration import printt\n\n\nclass TrainTest:\n def __init__(self, results_processor=None):\n self.results_processor = results_processor\n\n def fit_model(self, exp_specs, data, model):\n \"\"\"\n trains model by iterating minibatches for specified number of ...
[ [ "numpy.arange" ] ]
Sai-Venky/FasterRCNN
[ "1e04cc3f78cf0ca4c85820802d03498ad223c6ce" ]
[ "src/models/faster_rcnn.py" ]
[ "from __future__ import absolute_import\nimport os\nimport time\nfrom collections import namedtuple\n\nimport numpy as np\nimport torch as t\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torchvision.ops import nms\nfrom torchnet.meter import ConfusionMeter, AverageValueMeter\n\nfrom models.head...
[ [ "torch.zeros", "numpy.concatenate", "torch.device", "torch.arange", "torch.save", "torch.no_grad", "torch.optim.SGD", "torch.cuda.is_available", "torch.Tensor", "torch.nn.CrossEntropyLoss" ] ]
catwhiskers/Stocks
[ "daba7fa366c9432a96ec415aeaf850aef917588b" ]
[ "evalPortfolio/evalPortfolio/strategyFairValue.py" ]
[ "# Ng Yibin, Dec 2017\r\n\r\nimport argparse\r\nimport numpy as np\r\nimport pandas as pd\r\nimport utilities as ut\r\n\r\nfrom datetime import datetime, timedelta\r\nfrom tabulate import tabulate\r\nfrom xlrd import open_workbook\r\n\r\n# Inputs\r\n# yr : list of years\r\n# eps : list of eps\r\n# per ...
[ [ "pandas.DataFrame", "numpy.array", "numpy.mean" ] ]
tzshi/nob-naacl21
[ "d6a9d9a5bd37dc02bf773350db7e74dd9144d56d" ]
[ "nob/modules.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\nfrom .attention import BilinearMatrixAttention\nfrom .algorithm import parse_cky\n\n\nclass ChartParser(nn.Module):\n\n name = \"Chart\"\n\n def __init__(self, parser, hidden_size, dropout=0...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "numpy.zeros", "torch.max", "torch.nn.LeakyReLU" ] ]
michaelbornholdt/cytominer-eval
[ "97b471dd4141d29bfcb06921cb1e294596c39ecf" ]
[ "cytominer_eval/operations/precision_recall.py" ]
[ "\"\"\"\nFunctions to calculate precision and recall at a given k\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom typing import List, Union\n\nfrom cytominer_eval.utils.precisionrecall_utils import calculate_precision_recall\nfrom cytominer_eval.utils.operation_utils import assign_replicates\nfrom cytomine...
[ [ "pandas.DataFrame" ] ]
adimaini/WEAT-WEFAT
[ "a32cc63ec8c715947b06aabb33704b884139f09c", "a32cc63ec8c715947b06aabb33704b884139f09c" ]
[ "src/lib/weat.py", "DeepSpeech/bin/graphdef_binary_to_text.py" ]
[ "import numpy as np\nimport itertools\nfrom scipy import stats\nfrom scipy.stats.stats import zscore\nimport statistics\n\nclass Weat:\n\n def cos_similarity(self, tar, att): \n '''\n Calculates the cosine similarity of the target variable vs the attribute\n '''\n score = np.dot(tar, ...
[ [ "numpy.concatenate", "numpy.array", "numpy.dot", "numpy.random.choice", "numpy.linalg.norm", "scipy.stats.norm", "numpy.random.permutation", "numpy.mean", "numpy.random.shuffle", "numpy.std", "numpy.array_split" ], [ "tensorflow.compat.v1.gfile.FastGFile", "...
chulminkw/keras-yolo3
[ "bae367fa1ddf26c0ff8ba20ddc0b141f852e6e82" ]
[ "keras-yolo3/yolo.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nClass definition of YOLO_v3 style detection model on image and video\r\n\"\"\"\r\n\r\nimport colorsys\r\nimport os\r\nfrom timeit import default_timer as timer\r\n\r\nimport numpy as np\r\nfrom tensorflow.keras import backend as K\r\nfrom tensorflow.keras.models import load_mod...
[ [ "numpy.array", "tensorflow.keras.layers.Input", "numpy.random.seed", "numpy.random.shuffle", "tensorflow.keras.backend.get_session", "tensorflow.keras.models.load_model", "tensorflow.keras.backend.placeholder" ] ]
GeoTrouvetout/miscellaneous
[ "88dedd8dacba9215bba050ce4294601ed4878f38" ]
[ "game3D.py" ]
[ "import curses\nfrom curses import textpad\nimport numpy as np\n\ndef update_player_appearance(d):\n if d == curses.KEY_RIGHT:\n p = \">o>\"\n elif d == curses.KEY_LEFT:\n p = \"<o<\"\n elif d == curses.KEY_DOWN:\n p = \"/o\\\\\"\n elif d == curses.KEY_UP:\n p = \"\\o/\"\n ...
[ [ "numpy.sin", "numpy.round", "numpy.arange", "numpy.power", "numpy.cos", "numpy.clip" ] ]
hsuanguo/tvm
[ "0b2f30aef2c1c1ed4ec504157b54ceaab182e9ab" ]
[ "tests/python/topi/python/test_topi_unique.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.array", "numpy.zeros", "numpy.random.randint", "numpy.argsort", "numpy.unique" ] ]
nisha1729/lstm-math
[ "6e7d8b95c5d01fc61ff4eeffc63de2ae7fccbcf6" ]
[ "encode.py" ]
[ "import numpy as np\n\n\nclass OneHotEncoder:\n \"\"\"\n Convert characters and strings to one hot vectors and back.\n Uses argmax, so you can also pass softmax one-hot vectors and it will\n return the value with the highest probability.\n \"\"\"\n\n def __init__(self, operations, decimals=False):...
[ [ "numpy.argmax", "numpy.zeros" ] ]
markdunning/bcbio-nextgen
[ "37b69efcc5b2b3713b8d5cd207cece4cb343380d", "37b69efcc5b2b3713b8d5cd207cece4cb343380d" ]
[ "bcbio/install.py", "bcbio/bam/__init__.py" ]
[ "\"\"\"Handle installation and updates of bcbio-nextgen, third party software and data.\n\nEnables automated installation tool and in-place updates to install additional\ndata and software.\n\"\"\"\nfrom __future__ import print_function\nimport argparse\nimport collections\nimport contextlib\nimport datetime\nimpor...
[ [ "matplotlib.use", "matplotlib.matplotlib_fname" ], [ "numpy.median" ] ]
ElSabio97/traffic
[ "8f65a97fe8f6f7ba0ddfabfc2f69fda3f6faf14b" ]
[ "traffic/core/flight.py" ]
[ "# fmt: off\n\nimport logging\nimport warnings\nfrom datetime import datetime, timedelta, timezone\nfrom operator import attrgetter\nfrom pathlib import Path\nfrom typing import (\n TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List,\n Optional, Set, Tuple, Type, TypeVar, Union, cast, overload\n)\n\...
[ [ "pandas.to_datetime", "numpy.pad", "pandas.Timedelta", "numpy.ones", "numpy.where", "numpy.radians", "numpy.stack", "numpy.timedelta64", "pandas.Series", "numpy.nanmax" ] ]
quetric/finn-base-1
[ "1494a13a430c784683c2c33288823f83d1cd6fed" ]
[ "src/finn/util/data_packing.py" ]
[ "# Copyright (c) 2020 Xilinx, Inc.\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 notice, this\n# list of conditio...
[ [ "numpy.asarray", "numpy.set_printoptions", "numpy.load", "numpy.save", "numpy.get_printoptions", "numpy.apply_along_axis", "numpy.asscalar", "numpy.flip", "numpy.array2string" ] ]
panjea/fourier_neural_operator
[ "8986f8ef0a9f1981d68cfc3bed77606066d40ef5" ]
[ "scripts/eval.py" ]
[ "#!/usr/bin/python3\nimport os, sys\nsys.path.append('..')\nimport torch\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport matplotlib.pyplot as plt\nfrom utilities3 import *\nimport operator\nfrom functools import reduce\nfrom functools import partial\n\nfrom timeit import default_...
[ [ "torch.zeros", "torch.device", "torch.rfft", "torch.nn.Linear", "torch.rand", "torch.nn.Conv1d", "numpy.random.seed", "torch.no_grad", "torch.manual_seed", "torch.load", "torch.nn.functional.relu", "numpy.linspace", "torch.nn.BatchNorm3d", "torch.utils.data....
saransh738/ELL409-SVM-CLASSIFIER-FROM-SCRATCH
[ "16dc8c2f57f23cdea712fbce127d7b18f779754a" ]
[ "Part_2.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[3]:\n\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom libsvm.svmutil import *\nfrom sklearn import svm\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.preprocessing...
[ [ "numpy.array", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "sklearn.svm.SVC", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "pandas.read_csv", "numpy....
MedadRufus/MastersProject
[ "b2e498e14e1e8b9bcae29c4236522f65711f685b" ]
[ "Bike_logger/Data_analysis/Battery_Kalman/battery.py" ]
[ "import math as m\n\nfrom .utils import Polynomial\nimport matplotlib.pyplot as plt\n\n\nclass Battery:\n # capacity in Ah\n def __init__(self, total_capacity, R0, R1, C1):\n # capacity in As\n self.total_capacity = total_capacity * 3600\n self.actual_capacity = self.total_capacity\n\n ...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
abbie0214/google-research
[ "d154ffb7a92f7899807496cb8cb665fb5a01e65c" ]
[ "scalable_shampoo/jax/shampoo.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.array", "numpy.random.uniform", "numpy.arange", "numpy.ones" ] ]
buiksat/Learn-Algorithmic-Trading
[ "e938502980d3bf8d560f260437b4bb162e1b1bfd" ]
[ "Chapter4/ch4_pairs_correlation_real_symbol.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom statsmodels.tsa.stattools import coint\nimport matplotlib.pyplot as plt\n# Set a seed value to make the experience reproducible\nnp.random.seed(123)\n\n\nimport pandas as pd\npd.set_option('display.max_rows', 500)\npd.set_option('display.max_columns', 500)\npd.set_opti...
[ [ "pandas.read_pickle", "pandas.set_option", "numpy.random.seed", "matplotlib.pyplot.axhline", "pandas.DataFrame", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "numpy.std", "matplotlib.pyplot.show", "matplotlib.pyplot.axis" ] ]
clvrai/leaps
[ "d04ea06a6d16fefbbd4a86d6fd9cb394fe6328d9" ]
[ "rl/algo/reinforce.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nimport time\n\nclass REINFORCE:\n def __init__(self,\n actor_critic,\n clip_param,\n ppo_epoch,\n num_mini_batch,\n entropy_coef,\n...
[ [ "torch.tensor", "torch.mean" ] ]
SyifaDestiana/UAS-12220120
[ "d04f2a0c916af2bbe2b9e59821d8de2c9cdf6db6" ]
[ "UAS12220120.py" ]
[ "# UAS dan TUBES IF2112 Pemprograman Komputer\r\n# Nama : Syifa Destiana\r\n# NIM : 12220120 \r\n \r\n #Import DataFrame yang Dibutuhkan\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport json\r\nimport streamlit as st\r\n\r\n\r\n#Tampilan Configurasi \r\nst.set_page_config(...
[ [ "pandas.DataFrame.from_dict", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
afourtassi/change
[ "a926bd9f4edd4c59bd2a155477f33597df1f95d7" ]
[ "preprocess.py" ]
[ "\"\"\"Divide corpus of one language to N epochs (parts) with similar sizes\n\nAuthor: Hang Jiang (hjian42@icloud.com)\n\"\"\"\nimport sys\nimport os\nimport argparse\nimport glob\nimport gensim\nimport random\nimport pickle\nfrom tqdm import tqdm\nimport numpy as np\nimport pandas as pd\nfrom gensim.models import ...
[ [ "numpy.array", "pandas.read_csv" ] ]
anish9/keras-io
[ "cb9766d1d24bb2c9a9831fffcee02edb74d89129", "cb9766d1d24bb2c9a9831fffcee02edb74d89129" ]
[ "examples/vision/mobilevit.py", "guides/understanding_masking_and_padding.py" ]
[ "\"\"\"\nTitle: MobileViT: A mobile-friendly Transformer-based model for image classification\nAuthor: [Sayak Paul](https://twitter.com/RisingSayak)\nDate created: 2021/10/20\nLast modified: 2021/10/20\nDescription: MobileViT for image classification with combined benefits of convolutions and Transformers.\n\"\"\"\...
[ [ "tensorflow.nn.swish", "tensorflow.keras.layers.Add", "tensorflow.image.random_flip_left_right", "tensorflow.lite.TFLiteConverter.from_saved_model", "tensorflow.keras.layers.GlobalAvgPool2D", "tensorflow.keras.layers.Reshape", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorfl...
rklymentiev/py-for-neuro
[ "6bb163347483642c79eac429e5a9289edff7ce09" ]
[ "exercises/solution_03_05.py" ]
[ "import pandas as pd\n\ntable_1 = pd.read_json(\"exercises/data/table1.json\")\ntable_2 = pd.read_json(\"exercises/data/table2.json\")\n\njoined_table = pd.merge(left=table_1, right=table_2, how=\"inner\",\n left_on=\"id\", right_on=\"ID\")\n\nradius_mean_benign = joined_table[joined_table['d...
[ [ "pandas.read_json", "pandas.merge" ] ]
luzhcs/mc-wowza
[ "43f2287503f157a9d6e2e1726aec266103618dd1" ]
[ "inference-engine/handler/image_handler.py" ]
[ "import numpy as np\nimport cv2\nimport io\nimport json\n\nfrom aiohttp import web\nfrom aiohttp import MultipartReader\nfrom ml import opencvdnn\n\nofd = opencvdnn.OpencvFaceDetector()\n\nclass ImageHandler:\n def __init__(self):\n pass\n\n def json_error(self, message):\n return web.Response(\...
[ [ "numpy.asarray" ] ]
osh/keras
[ "a44d5a7dfb3a4de36b113c0d2d059000bf084482" ]
[ "keras/callbacks.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import print_function\nimport theano\nimport theano.tensor as T\nimport numpy as np\nimport warnings\nimport time\nfrom collections import deque\n\nfrom .utils.generic_utils import Progbar\n\nclass CallbackList(object):\n\n def __init__(self, callbacks, qu...
[ [ "numpy.median" ] ]
neurospin/pynet
[ "28eb248a04b40d180677e8fa20f2297c6967da0b" ]
[ "pynet/models/vae/moevae.py" ]
[ "# -*- coding: utf-8 -*-\n##########################################################################\n# NSAp - Copyright (C) CEA, 2021\n# Distributed under the terms of the CeCILL-B license, as published by\n# the CEA-CNRS-INRIA. Refer to the LICENSE file or to\n# http://www.cecill.info/licences/Licence_CeCILL-B_V1...
[ [ "torch.nn.Sequential", "torch.nn.functional.softmax" ] ]