repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
coolzhangfeng/lidar_dynamic_objects_detection
[ "8d64cc75202208549adef6c854bbb03c2b3c465a" ]
[ "detection_3d/validation_inferece.py" ]
[ "#!/usr/bin/env python\n__copyright__ = \"\"\"\nCopyright (c) 2020 Tananaev Denis\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the ri...
[ [ "tensorflow.keras.models.load_model", "numpy.asarray", "numpy.argmax", "numpy.array", "numpy.vstack" ] ]
MatthewMasters/GWD
[ "fcaf2ae376104fb79911ed1db86a98c0ee2f5587" ]
[ "FasterRCNN/train.py" ]
[ "import cv2\nimport torch\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\nfrom sklearn.model_selection import StratifiedKFold\nfrom os.path import exists, join\nfrom torchvision.models.detection.faster_rcnn import FastRCNNPredictor\nfrom Mark_I.data import get_datal...
[ [ "numpy.min", "sklearn.model_selection.StratifiedKFold", "numpy.max", "numpy.mean", "numpy.argsort" ] ]
PanggNOTlovebean/keras-attention-mechanism
[ "7e4aeccba0f51c98acfc2eac5053e1b67af61053" ]
[ "examples/DataLoader.py" ]
[ "import pandas as pd\nimport numpy as np\n\n\ndef make_timeseries_data():\n \n train_test_split=0.7\n timesteps=128\n\n data=pd.read_csv('./examples/sh.000001.csv')\n data.set_index('Date',inplace=True)\n data=data['2010':]\n split_position=int(len(data)*train_test_split)\n print(data)\n\n ...
[ [ "numpy.arange", "numpy.array", "pandas.read_csv" ] ]
lvcarlosja/pymap3d
[ "4a20f1e269dd748eb55c47dae2ed1a9d0c5c6cd7" ]
[ "src/pymap3d/enu.py" ]
[ "\"\"\" transforms involving ENU East North Up \"\"\"\nimport typing\n\ntry:\n from numpy import radians, sin, cos, hypot, arctan2 as atan2, degrees, pi, vectorize\nexcept ImportError:\n from math import radians, sin, cos, hypot, atan2, degrees, pi\n\n vectorize = None\n\nfrom .ecef import geodetic2ecef, e...
[ [ "numpy.vectorize" ] ]
Tenvence/blend-mask
[ "3e1eaa6749ea8a09c9903d4654683090df01368f" ]
[ "model/blend_mask.py" ]
[ "import torch\nimport torch.nn as nn\n\nimport model.modules as modules\nimport utils.bbox_ops as bbox_ops\n\n\nclass BlendMask(nn.Module):\n def __init__(self, num_classes, fpn_channels, bases_module_channels, num_basis, atten_size, pooler_size):\n super(BlendMask, self).__init__()\n\n self.num_cl...
[ [ "torch.exp", "torch.tensor", "torch.cat" ] ]
sunil-dhaka/automate-stuff-with-python
[ "19e841e3ed89788c2c2e0bb4bb6a9ee0e0314ca3" ]
[ "simpleAutomationTasks/cloud.py" ]
[ "from PIL import Image\nimport matplotlib.pyplot as plt\nfrom wordcloud import WordCloud, wordcloud\nimport numpy as np\nimport requests\nimport string\nfrom nltk import corpus\nimport sys\nimport os\n\nstopwords=corpus.stopwords.words('english')\n\ndef wordCloud(fileName,maskImage=None):\n name='-'.join(fileNam...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.savefig", "matplotlib.pyplot.axis", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
imitevski/COMS4995_apam
[ "a1490a9d8452d1509185094b5c4ba3313a224458" ]
[ "jupyter_notebooks/mglearn/plot_pca.py" ]
[ "from sklearn.decomposition import PCA\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nfrom joblib import Memory\r\n\r\nmemory = Memory(cachedir=\"cache\")\r\n\r\n\r\ndef plot_pca_illustration():\r\n rnd = np.random.RandomState(5)\r\n X_ = rnd.normal(size=(300, 2))\r\n X_blob = np.dot(X_, r...
[ [ "matplotlib.pyplot.subplots", "numpy.random.RandomState", "numpy.zeros", "sklearn.decomposition.PCA" ] ]
lethaiq/e-SNLI
[ "f50bcd12112f831c66b1c2d6c250bc6c35d4e208" ]
[ "seq2seq/train_label_in_expl.py" ]
[ "from __future__ import print_function\nimport os\nimport sys\nimport time\nimport argparse\nimport glob\nimport math\nimport csv\nimport numpy as np\nimport random\nfrom shutil import copy2\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\n\nimport streamtologger\n\nimport matplotlib\nmatp...
[ [ "matplotlib.pyplot.legend", "numpy.sqrt", "torch.max", "torch.load", "matplotlib.pyplot.plot", "numpy.mean", "torch.autograd.Variable", "torch.save", "torch.nn.CrossEntropyLoss", "torch.equal", "matplotlib.pyplot.close", "torch.LongTensor", "matplotlib.pyplot.sa...
Frog-Analysis/Project_FrogLossFunctionCNN
[ "c2a1d440d5eb45577f5e3b28b3d29ab42eb606df" ]
[ "Project_FrogLossFunctionCNN_Aus/Aus_1D_2D_frog_noise.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Feb 2 17:12:34 2021\n\n@author: arnou\n\"\"\"\n\nfrom __future__ import print_function\nimport numpy as np\nimport os\nimport pandas as pd\nimport librosa\nimport tensorflow as tf\n\n# import tensorflow.compat.v1 as tf\n# tf.disable_v2_behavior() #disable for tenso...
[ [ "tensorflow.convert_to_tensor", "tensorflow.math.add", "tensorflow.python.client.device_lib.list_local_devices", "numpy.hstack", "pandas.read_csv", "numpy.unique", "numpy.arange", "tensorflow.subtract", "numpy.argmax", "numpy.ravel", "numpy.asfortranarray", "sklearn...
csster/csst
[ "127b8098acac2a8d8098145ce38494952f310ff4" ]
[ "csst/msc/calib_pos.py" ]
[ "import os\nimport time\nfrom functools import partial\nfrom multiprocessing import Pool\nfrom subprocess import Popen\n\nimport healpy as hp\nimport numpy as np\nfrom astropy import table\nfrom astropy import units as u\nfrom astropy.coordinates import SkyCoord\nfrom astropy.io import fits\nfrom astropy.wcs import...
[ [ "numpy.hstack", "numpy.radians", "numpy.unique", "numpy.cos", "numpy.dtype", "numpy.savetxt", "numpy.array" ] ]
Carmigna/mobile_activity
[ "f04da3e15b17cc02b44290a06f782af34a92b71c" ]
[ "training/predict_video.py" ]
[ "#!/usr/bin/env python\n\n# USAGE\n# python predict_video.py --model model/activity.model --label-bin model/lb.pickle --input example_clips/activity.mp4 --output output/activity_128avg.avi --size 128\n\n# import the necessary packages\nfrom keras.models import load_model\nfrom collections import deque\nimport numpy...
[ [ "numpy.array", "numpy.expand_dims", "numpy.argmax" ] ]
ivandorte/covid_vaccini_monitoraggio
[ "8276397526028768234ad1186d437961294a29f2" ]
[ "scripts/confronti_europei.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport locale\nfrom datetime import date\nfrom os import chdir, path\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom adjustText import adjust_text\nfrom matplotlib.ticker import PercentFormatter\nfrom mpl_toolkits.axes_grid1.ins...
[ [ "numpy.polyfit", "matplotlib.rc_context", "pandas.to_datetime", "pandas.read_csv", "sklearn.metrics.r2_score", "numpy.arange", "matplotlib.pyplot.subplots", "pandas.DataFrame", "matplotlib.pyplot.get_cmap", "numpy.transpose", "numpy.corrcoef", "numpy.array", "ma...
ndalsanto/pyorb
[ "b3d14aded0573ddebcf62e312304a10d6f128c60" ]
[ "pyorb_core/pde_problem/fom_problem.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Oct 11 12:02:21 2018\n\n@author: Niccolo' Dal Santo\n@email : niccolo.dalsanto@epfl.ch\n\"\"\"\n\nimport pyorb_core.error_manager as em\nimport numpy as np\nimport pyorb_core.algebraic_utils as alg_ut\n\ndef default_theta_function( _param, _q ...
[ [ "numpy.zeros", "numpy.sqrt" ] ]
pswapnesh/CodeLib
[ "c54f354fb92ce4453e0b62996540a5d77026bc58" ]
[ "Segmentation/Pix2Pix.py" ]
[ "from IPython import display\nimport tensorflow.keras.backend as K\nclass Pix2Pix():\n def __init__(self,input_channels=1,output_channels=2):\n self.im_size = 256\n self.input_channels = input_channels\n self.output_channels = output_channels\n self.generator = self.Generator()\n ...
[ [ "tensorflow.keras.backend.sum", "tensorflow.keras.backend.epsilon", "tensorflow.keras.backend.log" ] ]
ChrisBeaumont/brut
[ "f4223b84448d1db1b0e98e043dc6670adf05ee5d" ]
[ "bubbly/cascade.py" ]
[ "from math import ceil\nfrom warnings import warn\nfrom functools import wraps\n\nimport numpy as np\n\nfrom sklearn.base import BaseEstimator, ClassifierMixin\nfrom sklearn.ensemble import GradientBoostingClassifier\nfrom sklearn.ensemble import gradient_boosting as gb\nfrom sklearn.base import clone\n\n\ndef _rec...
[ [ "numpy.unique", "numpy.ones", "sklearn.base.clone", "sklearn.ensemble.GradientBoostingClassifier", "numpy.zeros" ] ]
vianasw/fashion-classifier
[ "3114a4463584e81c92ff245b957b7f2d0798f275" ]
[ "classifier/fashion_classifier.py" ]
[ "#!/usr/bin/python3\n\nfrom utils.dataset import load_dataset, shuffle_dataset\nfrom utils.data_augmentation import augment_data\nfrom utils.visualization import create_sprite_image, invert_grayscale\nfrom models.lenet import LeNet\nfrom models.vgg import VGG\nfrom tensorflow.contrib.tensorboard.plugins import proj...
[ [ "tensorflow.train.get_checkpoint_state", "tensorflow.summary.FileWriter", "tensorflow.local_variables_initializer", "tensorflow.Variable", "tensorflow.zeros", "tensorflow.assign", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.contrib.tensorboa...
SamShowalter/CS272-NLP
[ "6914064018fbcd416c2f9b24ee105319d02b3cb2" ]
[ "hw1/unsupervised_experiments.py" ]
[ "#################################################################################\n#\n# Project Title: Unsupervised Experiments Class: CS272\n# Author: Sam Showalter\n# Date: 2021-04-04\n#\n#########################################################...
[ [ "numpy.hstack", "numpy.zeros", "sklearn.metrics.accuracy_score" ] ]
AzucenaMV/Face-Recognition-Project
[ "859ba5c754d5da4d5aecd97ee7a34959c837c302" ]
[ "model/model.py" ]
[ "import argparse\nimport pandas as pd\nimport os\nimport pickle as pkl \nimport numpy as np\nfrom sklearn.svm import SVC\nfrom sklearn.externals import joblib\nimport sklearn\n\n#from six import BytesIO\n\n\nif __name__ == '__main__':\n \n parser = argparse.ArgumentParser()\n\n # Hyperparameters are descri...
[ [ "sklearn.svm.SVC" ] ]
jsyoo61/PyTorch-GAN
[ "2d528c5f9818b0d1110c33808947643f81a75bbb", "2d528c5f9818b0d1110c33808947643f81a75bbb" ]
[ "implementations/srgan/aggregation.py", "implementations/srgan/srgan_pl.py" ]
[ "# %%\nimport torch\nimport torch.nn as nn\n\n# %%\ndef aggregate(model_source, model_target, weight = None):\n '''\n model_source: List of nn.Model instances\n model_target: Single nn.Model instance\n weights: default = None\n List of numbers. Must match the number of model_source.\n If N...
[ [ "torch.softmax", "torch.as_tensor" ], [ "numpy.log2", "torch.cat", "torch.cuda.is_available", "torch.nn.L1Loss", "torch.nn.functional.interpolate", "torch.cuda.device_count", "torch.cuda.device", "torch.nn.MSELoss" ] ]
stevenruidigao/bwsiuassar2019
[ "25e267d2c9d96c767f7f9ea168a27bcad56690b7" ]
[ "raw_code/common/helper_functions.py" ]
[ "#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n\"\"\"Helper functions for UAS-SAR.\"\"\"\r\n\r\n__author__ = \"Ramamurthy Bhagavatula\"\r\n__version__ = \"1.0\"\r\n__maintainer__ = \"Ramamurthy Bhagavatula\"\r\n__email__ = \"ramamurthy.bhagavatula@ll.mit.edu\"\r\n\r\n# Import required modules and methods\r\ni...
[ [ "numpy.isnan", "numpy.arange", "numpy.squeeze", "numpy.reshape", "numpy.asarray", "numpy.all", "numpy.copy", "numpy.interp", "numpy.any", "numpy.transpose" ] ]
npodewitz/airflow
[ "511ea702d5f732582d018dad79754b54d5e53f9d" ]
[ "tests/providers/amazon/aws/transfers/test_sql_to_s3.py" ]
[ "#\n# 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\")...
[ [ "pandas.DataFrame" ] ]
yihong0618/taichi
[ "1ff57c080edd0366a3cfb5174af131b6d94a2adc" ]
[ "python/taichi/lang/__init__.py" ]
[ "import atexit\nimport functools\nimport os\nimport shutil\nimport tempfile\nimport time\nfrom contextlib import contextmanager\nfrom copy import deepcopy as _deepcopy\n\nimport taichi.lang.linalg_impl\nimport taichi.lang.meta\nfrom taichi.core.util import locale_encode\nfrom taichi.core.util import ti_core as _ti_...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.gcf" ] ]
Kami/raspberry-pi-ham-radio
[ "7ff9180e3a4d645b92e07ce92cbcbf73c7a0a628" ]
[ "radio_bridge/radio_bridge/dtmf.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright 2020 Tomaz Muraus\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...
[ [ "numpy.where", "scipy.io.wavfile.read", "numpy.fft.fft", "numpy.fft.fftfreq" ] ]
TheRealAakash/TheLifeCycle
[ "288a28acf244d6edde95760c08cb1ccb7609422c" ]
[ "TheTrashCycle/main/TrashInference/getTrash.py" ]
[ "import os\n\nimport cv2\nimport imageio\nimport numpy as np\n\nfrom .mrcnn import model as modellib\nfrom .trash import trash\nimport tensorflow.compat.v1 as tf\n\ntf.disable_v2_behavior()\n\nTRASH_WEIGHTS_PATH = \"weights/mask_rcnn_trash_0200_030519_large.h5\" # the best\nprint('Weights being used: ', TRASH_WEIG...
[ [ "tensorflow.compat.v1.device", "tensorflow.compat.v1.disable_v2_behavior" ] ]
njcuk9999/theoretical_low_mass_companion_plot
[ "c995fd686c8df85a623b901bca47e285f27eea0f" ]
[ "theory_plot_mass_vs_sep_combined.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on 2016-11-08\n\n@author: Neil Cook\n\nProduces a plot in primary mass vs separation space for defined surveys/\ntelescopes\n\nVersion 0.0.001\n\"\"\"\n\nimport numpy as np\nfrom astropy.io import fits\nimport matplotlib.pyplot as plt\nfrom matplotli...
[ [ "matplotlib.patches.Patch", "numpy.linspace", "numpy.min", "matplotlib.path.Path", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.max", "numpy.append", "matplotlib.pyplot.close", "numpy.array" ] ]
OmriBenbenisty/IML.HUJI
[ "18ca1b8086b8aaa149dca95f96de26750ea0497f" ]
[ "IMLearn/learners/gaussian_estimators.py" ]
[ "from __future__ import annotations\n\nimport numpy as np\n\n\nclass UnivariateGaussian:\n \"\"\"\n Class for univariate Gaussian Distribution Estimator\n \"\"\"\n\n def __init__(self, biased_var: bool = False):\n \"\"\"\n Estimator for univariate Gaussian mean and variance parameters\n\n ...
[ [ "numpy.log", "numpy.sqrt", "numpy.linalg.inv", "numpy.linalg.det", "numpy.inv", "numpy.cov", "numpy.exp", "numpy.sum" ] ]
yingtchen/pyro2
[ "6c078a92ba026547307a74a3f2e74aff721a75e0", "6c078a92ba026547307a74a3f2e74aff721a75e0" ]
[ "pyro.py", "changed_files/pngs/crop_pngs.py" ]
[ "#!/usr/bin/env python3\n\nfrom __future__ import print_function\n\nimport argparse\nimport importlib\nimport os\n\nimport matplotlib.pyplot as plt\n\nimport compare\nfrom util import msg, profile, runparams, io\n\n\ndef doit(solver_name, problem_name, param_file,\n other_commands=None,\n comp_bench...
[ [ "matplotlib.pyplot.ion", "matplotlib.pyplot.figure" ], [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.axis", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure" ] ]
AshwinAmbal/MC-Assignment-2
[ "a02b55ee09979e8a15b6b64cfa9be6e565f5d392" ]
[ "notebook/feature_vector_communicate.py" ]
[ "import os\nimport pandas as pd\nimport numpy as np\n\nimport tsfresh.feature_extraction.feature_calculators as fc\n\nfrom scipy.fftpack import fft\nfrom notebook.pca_reduction import PCAReduction\nfrom notebook.utils import general_normalization, universal_normalization, trim_or_pad_data,\tfeature_matrix_extractor...
[ [ "sklearn.neural_network.MLPClassifier", "pandas.concat", "numpy.amax", "numpy.maximum", "numpy.pad", "numpy.amin", "pandas.DataFrame", "scipy.fftpack.fft", "numpy.append", "numpy.diff", "numpy.argsort", "numpy.array", "sklearn.metrics.classification_report" ] ...
kmoskovtsev/Electrons-on-Helium-Scripts
[ "b7325c64a62def9b963b66bfb078ee82553c2ed4" ]
[ "test_diff_anstr.py" ]
[ "from __future__ import division\r\nimport matplotlib as mpl\r\nmpl.use('Agg')\r\nimport matplotlib.pyplot as plt\r\n\r\nimport hoomd\r\nimport hoomd.md\r\n#import matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom scipy.special import erf as erf\r\nimport os\r\nimport sys\r\nimport datetime\r\nimport ewald_mod...
[ [ "numpy.sqrt", "numpy.linspace", "matplotlib.use", "matplotlib.pyplot.subplots", "numpy.array", "numpy.zeros" ] ]
mhilmiasyrofi/EAD-Attack
[ "a5bd90f8d2a096098759deb3c3dfeca26c689e4e" ]
[ "test_attack.py" ]
[ "## test_attack.py -- sample code to test attack procedure\n##\n## Copyright (C) 2017, Yash Sharma <ysharma1126@gmail.com>.\n## Copyright (C) 2016, Nicholas Carlini <nicholas@carlini.com>.\n##\n## This program is licenced under the BSD 2-Clause licence,\n## contained in the LICENCE file in this directory.\n\nimport...
[ [ "numpy.abs", "numpy.reshape", "numpy.eye", "numpy.argmax", "numpy.mean", "tensorflow.Session", "numpy.array", "numpy.sum", "numpy.random.randint" ] ]
bentay85/machine_learning
[ "87485829d79af483a4e0e28754287a0ba386b21e" ]
[ "reinforcement_learning/1_play_cartpole.py" ]
[ "#run python play_game.py\n#you must click on the prompt once the window pops up for your keayboard commands to be read\n#press a to move left, by default, you will be moving right\n\nimport gym\nfrom stable_baselines3.common.vec_env import DummyVecEnv\nfrom time import sleep\nimport keyboard\nimport numpy as np\n\...
[ [ "numpy.array" ] ]
wgurecky/pyReactor
[ "0f3993bc8739d2b5ca7f5a031b7f70c8b1bd91cc" ]
[ "legoReactor.py" ]
[ "#!/usr/bin/python\n\n# LEGO REACTOR GUI\n# Using wxPython and matplotlib for live plot updating.\n#\n# William Gurecky\n#\n# changelog\n# ----------\n#\n# 1/27/2015 Creation.\n#\n\nimport time\nimport sys\nfrom distutils.version import LooseVersion\nimport numpy as np\nimport wx\nimport reactor as rct\nfrom re...
[ [ "matplotlib.use", "matplotlib.figure.Figure", "matplotlib.backends.backend_wxagg.FigureCanvasWxAgg" ] ]
ngocphucck/tf-tutorial
[ "3f96755a671d77b3a1addaefe7e596a7b991775f" ]
[ "saving.py" ]
[ "import os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nfrom tensorflow.keras.datasets import mnist\n\n\n# Load a dataset\n(x_train, y_train), (x_test, y_test) = mnist.load_data()\nx_train = x_train.astype('float') / 255\nx_train = x_train.reshape(-...
[ [ "tensorflow.keras.layers.ReLU", "tensorflow.keras.Input", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.keras.layers.Dense", "tensorflow.keras.Model", "tensorflow.keras.datasets.mnist.load_data", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.layers.Fl...
yuichiroaoki/mlflow
[ "429a84c6d844113411f96e1d3dcb05fc85e83b3a" ]
[ "mlflow/keras.py" ]
[ "\"\"\"\nThe ``mlflow.keras`` module provides an API for logging and loading Keras models. This module\nexports Keras models with the following flavors:\n\nKeras (native) format\n This is the main flavor that can be loaded back into Keras.\n:py:mod:`mlflow.pyfunc`\n Produced for use by generic pyfunc-based de...
[ [ "tensorflow.Graph", "tensorflow.Session" ] ]
LSSTDESC/Twinkles
[ "86d6caebde7f965b76ded80df0a1b66254f2a866" ]
[ "bin/generatePhosimInput.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nScript to run the generation of phoSim instance catalogs\n\"\"\"\nfrom __future__ import with_statement, absolute_import, division, print_function\nimport time\nimport os\nimport argparse\nimport pandas as pd\nfrom sqlalchemy import create_engine\nfrom lsst.utils import getPackageDir...
[ [ "pandas.read_sql_query" ] ]
mikiec84/dream-go
[ "d5aa2914734dae31bf19f90dfb81b707f5e1f3f8" ]
[ "contrib/trainer/dream_tf/layers/batch_norm.py" ]
[ "# Copyright (c) 2019 Karl Sundequist Blomdahl <karl.sundequist.blomdahl@gmail.com>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitati...
[ [ "tensorflow.nn.fused_batch_norm", "tensorflow.get_variable", "tensorflow.device", "tensorflow.transpose", "tensorflow.zeros_initializer", "tensorflow.reshape", "tensorflow.assign_sub", "tensorflow.ones_initializer", "tensorflow.sqrt", "tensorflow.add_to_collection" ] ]
Quansight/datashader
[ "3670f6dbc7f4ed0ca00816336435290df70c6a9b" ]
[ "datashader/glyphs/points.py" ]
[ "from __future__ import absolute_import, division\nimport numpy as np\nfrom toolz import memoize\n\nfrom datashader.glyphs.glyph import Glyph\nfrom datashader.utils import isreal, ngjit\n\nfrom numba import cuda\n\ntry:\n import cudf\n from ..transfer_functions._cuda_utils import cuda_args\nexcept ImportError...
[ [ "numpy.nanmax", "numpy.nanmin" ] ]
mwojcik96/image-search-engine
[ "3e0e3fc2e5cdca0986d7342c6ef5e1d24bf41120" ]
[ "main.py" ]
[ "import os\nimport numpy as np\nfrom image import Image\n\n\ndef prepare_dataset():\n images_dir = './images'\n features_dir = './features'\n image_list = list()\n name_list = list()\n inv_std_devs = dict()\n for filename in os.listdir(images_dir):\n if filename.endswith(\".jpeg\") or filen...
[ [ "numpy.append", "numpy.array" ] ]
sarkarchandan/nn-binary-classification
[ "c8a0a865d1775d0d988d3cad52ab0ede5be7d03f" ]
[ "dl/tests/test_layer.py" ]
[ "# pylint: disable=missing-module-docstring\n# pylint: disable=missing-class-docstring\n# pylint: disable=missing-function-docstring\n# pylint: disable=protected-access\n\nimport unittest\nfrom unittest import mock\nimport numpy as np\nfrom ..nn import Dense\nfrom ..act import TanH\n\nnp.seterr(all='raise')\n\n\ncl...
[ [ "numpy.testing.assert_equal", "numpy.sqrt", "numpy.random.seed", "numpy.seterr", "numpy.random.randn", "numpy.zeros", "numpy.divide" ] ]
harttu/keras-bert-ner
[ "5fcf682ea02fd042a2df06df63d877d14fdc8d16" ]
[ "predict.py" ]
[ "import os\nimport sys\n\nimport numpy as np\n\nfrom logging import error\n\nfrom common import read_conll, process_sentences, load_ner_model\nfrom common import load_viterbi_probabilities, viterbi_path\nfrom common import encode, write_result\nfrom common import argument_parser\n\n\ndef main(argv):\n argparser ...
[ [ "numpy.argmax" ] ]
xutianming/DALI
[ "7aaa543709c2db653c5af977774538829fb00ada" ]
[ "dali_tf_plugin/dali_tf_plugin_utils.py" ]
[ "# Copyright (c) 2019, 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.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless req...
[ [ "tensorflow.sysconfig.get_compile_flags", "tensorflow.sysconfig.get_link_flags" ] ]
arpitmisraw/dataviz-gallery
[ "16eaa9bdd9dd270997db7ee458174835344cea47" ]
[ "treemaps/billionaires.py" ]
[ "# Data Manipulation\nimport pandas as pd\n# Treemap Ploting\nimport squarify\n# Matplotlib and Seaborn imports\nimport matplotlib\nfrom matplotlib import style\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n# Activate Seaborn\nsns.set()\n# Large Plot\nmatplotlib.rcParams['figure.figsize'] = (16.0, 9.0)\n...
[ [ "matplotlib.pyplot.gca", "pandas.read_csv", "matplotlib.pyplot.title", "matplotlib.style.use", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.axis" ] ]
rdp-studio/mace
[ "0945e49804861e7584d7543aa6ce9823c206e209" ]
[ "tools/python/transform/transformer.py" ]
[ "# Copyright 2018 The MACE Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b...
[ [ "numpy.array", "numpy.prod" ] ]
quentin-burthier/Dendritic_OT
[ "8c9d75981eecb6372df661664a5b881d10befe77" ]
[ "balanced_ot.py" ]
[ "\"\"\"Balanced Optimal Transport methods for roots.\"\"\"\n\nimport ot\nimport numpy as np\nfrom scipy.spatial import distance_matrix\n\nfrom root import Root\n\n\ndef wasserstein(root_1: Root, root_2: Root):\n \"\"\"Wasserstein distance between two roots.\"\"\"\n sq_dist_matrix = distance_matrix(root_1.node...
[ [ "numpy.sqrt", "scipy.spatial.distance_matrix" ] ]
Aditya-aot/ION
[ "4789bb2e05fae48414eb829c3607c13a24349cd7" ]
[ "stock/views.py" ]
[ "from django.shortcuts import render\nfrom datetime import timedelta, date\n\n\nfrom .forms import search_from ,search_day\n\n\n# Create your views here.\nimport yfinance as yf\nfrom datetime import timedelta, date\n\nfrom json import dumps\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.ensem...
[ [ "sklearn.ensemble.RandomForestRegressor", "sklearn.model_selection.train_test_split" ] ]
crsmi/audl-elo
[ "3787baaf2359fb2645bc265555bc92e16ed44625" ]
[ "2015/get_elo_2015.py" ]
[ "import pandas as pd\nimport datetime\nimport math\n\ndef four_pad(s):\n if len(s) < 4:\n return four_pad(\"0\" + s)\n return s\n\ndef fill(teams,games):\n num_games = len(games)\n games[\"gameorder\"] = pd.Series(range(1,num_games+1))\n game_ids = []\n game_result = []\n\n for i,row in ...
[ [ "pandas.concat", "pandas.read_csv", "pandas.Series" ] ]
driver005/tello
[ "fdb67fa4c4c24f6b9dbaacdc22b8f0681b677b7f" ]
[ "dji-tello-collision-avoidance-pydnet/layers.py" ]
[ "#\n# MIT License\n#\n# Copyright (c) 2018 Matteo Poggi m.poggi@unibo.it\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the righ...
[ [ "tensorflow.nn.bias_add", "tensorflow.compat.v1.truncated_normal_initializer", "tensorflow.shape", "tensorflow.maximum", "tensorflow.compat.v1.get_variable", "tensorflow.nn.conv2d_transpose", "tensorflow.nn.conv2d" ] ]
sngweicong/multiagent-particle-envs
[ "9a1946983c97193351f3a97114afc070eb1babe3" ]
[ "multiagent/scenarios/custom_spread_2_sparse.py" ]
[ "import numpy as np\nfrom multiagent.core import World, Agent, Landmark\nfrom multiagent.scenario import BaseScenario\n\n\nclass Scenario(BaseScenario):\n def make_world(self):\n world = World()\n # set any world properties first\n world.dim_c = 2\n world.num_agents = 2\n world...
[ [ "numpy.square", "numpy.concatenate", "numpy.random.uniform", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
saarahrasheed/tsa
[ "e4460f707eeecb737663c48d8fc3245f0acb124c" ]
[ "src/main/python/thalesians/tsa/simulation.py" ]
[ "import datetime as dt\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\nimport thalesians.tsa.checks as checks\r\nimport thalesians.tsa.numpyutils as npu\r\nimport thalesians.tsa.processes as proc\r\nimport thalesians.tsa.randomness as rnd\r\n\r\ndef xtimes(start, stop=None, step=None):\r\n checks.check_n...
[ [ "numpy.copy", "numpy.sqrt", "pandas.DataFrame" ] ]
cassianobecker/tgcn
[ "622ae6519abc364f092da47c9aa908eb67e25010" ]
[ "examples/default_examples/py_geo_mnist.py" ]
[ "import os.path as osp\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch_geometric.datasets import MNISTSuperpixels\nimport torch_geometric.transforms as T\nfrom torch_geometric.data import DataLoader\nfrom torch_geometric.utils import normalized_cut\nfrom torch_geometric.nn import...
[ [ "torch.norm", "torch.nn.functional.dropout", "torch.nn.Linear", "torch.cuda.is_available", "torch.nn.ReLU" ] ]
Irio/truth-or-dare
[ "8b84ba1df33d1d873719cda1e913ad438c54aa79" ]
[ "google_news/tests/test_headlines.py" ]
[ "import itertools\nimport json\nfrom unittest import TestCase\nfrom unittest.mock import MagicMock\n\nfrom google_news.headlines import Headlines as subject_class\nimport pandas as pd\nimport vcr\n\n\nclass TestHeadlines(TestCase):\n def setUp(self):\n self.datastore_client = MagicMock()\n self.sub...
[ [ "pandas.Timestamp" ] ]
swabhs/allennlp
[ "7d05f7df81f71e05aa9c4f8bdc9059bd88c6c9fe", "7d05f7df81f71e05aa9c4f8bdc9059bd88c6c9fe" ]
[ "bin/average_random_seeds.py", "allennlp/models/segmental_language_model.py" ]
[ "\nimport glob\nimport os\nimport argparse\nimport json\nimport numpy as np\n\nif __name__ == '__main__':\n\n parser = argparse.ArgumentParser()\n parser.add_argument(\n '--save_root', help='Description of language model', default=''\n )\n\n args = parser.parse_args()\n save_root = args.save_r...
[ [ "numpy.min", "numpy.max", "numpy.std", "numpy.mean", "numpy.array" ], [ "torch.tensor", "torch.nn.modules.linear.Linear", "torch.zeros_like", "torch.cat" ] ]
gazay/TensorNetwork
[ "1564a24d6fef6d6ecd90dc01b55a5aa3f5d71b8e", "1564a24d6fef6d6ecd90dc01b55a5aa3f5d71b8e" ]
[ "tensornetwork/visualization/graphviz_test.py", "tensornetwork/contractors/opt_einsum_paths/path_calculation_test.py" ]
[ "# Copyright 2019 The TensorNetwork 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...
[ [ "numpy.eye" ], [ "numpy.ones" ] ]
Yuyoo/Septic-shock
[ "15c6af7673dee9feec9450cf05914910344bf178" ]
[ "code/evaluation.py" ]
[ "# -*- coding: utf-8 -*-\n# @Time : 2017/12/17 12:47\n# @Author : Xiaofeifei\n# @File : evaluation.py\n\nfrom sklearn.metrics import roc_auc_score, average_precision_score, roc_curve, confusion_matrix, precision_recall_curve\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport itertools\n\n\ndef auc(...
[ [ "sklearn.metrics.roc_auc_score", "matplotlib.pyplot.legend", "matplotlib.pyplot.imshow", "matplotlib.pyplot.step", "sklearn.metrics.confusion_matrix", "matplotlib.pyplot.plot", "matplotlib.pyplot.tight_layout", "numpy.reshape", "sklearn.metrics.precision_recall_curve", "mat...
abdulwahabamin/keras-yolo3-attention
[ "2ca53ea34284414f430a6c53ac3fbe9850e10f72" ]
[ "save_model.py" ]
[ "from yolo3.model import yolo_body\nimport keras\nfrom keras.layers import Input\nimport numpy as np\n\n\ndef get_anchors(anchors_path):\n '''loads the anchors from a file'''\n with open(anchors_path) as f:\n anchors = f.readline()\n anchors = [float(x) for x in anchors.split(',')]\n return np.ar...
[ [ "numpy.array" ] ]
isuckatdrifting/FusionAccel
[ "7f23a61bf4399574c2aa9ad0616329ff4bbc8422" ]
[ "scripts/infer.py" ]
[ "import numpy as np\nimport sys\nimport caffe\nimport struct\nimport time\n\nnp.set_printoptions(suppress=True, precision=4, threshold=np.inf)\n\n#######################Inference###########################\nstart_0 = time.clock()\ncaffe.set_mode_cpu()\nmodel_def = '/mnt/c/Users/shish/source/repos/SqueezeNet/Squeeze...
[ [ "numpy.load", "numpy.set_printoptions", "numpy.loadtxt" ] ]
thbuerg/simplimic
[ "5d4bcff89966c19a03b33cf1921c571e60ad4fcf" ]
[ "preprocessing/data_sanity.py" ]
[ "\"\"\"\nScript that evaluates the events.csv and the admissions.csv files:\n\nBasically performs the data cleaning steps proposed by:\nhttps://github.com/YerevaNN/mimic3-benchmarks\n\n\"\"\"\nimport os\nimport pandas as pd\nimport numpy as np\nfrom shutil import copyfile\n\n\nMIMIC_DIR = '/nfs/research1/birney/pro...
[ [ "numpy.isnan", "pandas.to_datetime", "pandas.Interval" ] ]
athindran/ProBF
[ "a7961dd88568615f363fb264bc89ec526d8c1b28" ]
[ "quadrotor_gp.py" ]
[ "from core.dynamics import AffineDynamics, ConfigurationDynamics, LearnedDynamics, PDDynamics, ScalarDynamics\nfrom core.systems import Segway\nfrom core.controllers import Controller, FBLinController, LQRController, FilterController, PDController, QPController\nfrom core.util import differentiate\nimport matplotli...
[ [ "numpy.dot", "matplotlib.pyplot.legend", "numpy.sqrt", "numpy.linspace", "numpy.concatenate", "matplotlib.pyplot.plot", "numpy.mean", "numpy.any", "numpy.random.randn", "numpy.reshape", "numpy.eye", "torch.from_numpy", "matplotlib.pyplot.gcf", "numpy.std", ...
bsulman/CORPSE-dormancy
[ "b70f137b3f66c4e12e284cbd3b3b9a68cf7a9c41" ]
[ "run_experiment.py" ]
[ "\nimport CORPSE\nimport numpy\nfrom pylab import *\n\nfrom dormancy_params import params,params_nodormant\n\n# In case you want to run without cluttering things up with all the csv files\nsave_csv=False\n\n############### initial biomass values based on our observations #######################\n# With a bulk densi...
[ [ "numpy.savetxt" ] ]
lyhangustc/e2p
[ "e6394060426e3d750a09303551131b2caa17db1e" ]
[ "old/pix2pix_resnet.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\nimport numpy as np\nimport argparse\nimport os\nimport json\nimport glob\nimport random\nimport collections\nimport math\nimport time\n\n\nimport warnings\nfrom functools impor...
[ [ "tensorflow.concat", "tensorflow.FixedLenFeature", "tensorflow.control_dependencies", "tensorflow.stack", "tensorflow.image.decode_png", "tensorflow.encode_base64", "tensorflow.RunMetadata", "tensorflow.train.ExponentialMovingAverage", "tensorflow.tanh", "tensorflow.map_fn"...
nnguyen19/ECNet
[ "27fcdd04c5bf2e36361608c53bc859821045ad09" ]
[ "ecnet/model.py" ]
[ "import math\nimport collections\nimport torch\nimport torch.nn as nn\n\nclass PositionalEmbedding(nn.Module):\n '''\n Modified from Annotated Transformer\n http://nlp.seas.harvard.edu/2018/04/03/attention.html\n '''\n def __init__(self, d_model, max_len=1024):\n super(PositionalEmbedding, sel...
[ [ "torch.nn.Softmax", "torch.nn.Dropout", "torch.nn.BatchNorm1d", "torch.randint", "torch.sin", "torch.nn.LSTM", "torch.cat", "torch.zeros", "torch.nn.Embedding", "torch.nn.LayerNorm", "torch.nn.Tanh", "torch.nn.Linear", "torch.nn.Identity", "torch.rand", ...
ShivaShankerReddy/extract_margin_value_zerodha
[ "8d532b40869d7b7c8d2e58d0b901207c9505fea6" ]
[ "main.py" ]
[ "# @Author: Shiva\r\n# @Date: 25th Sep 2019\r\n\r\nimport requests\r\nfrom bs4 import BeautifulSoup\r\nimport pandas as pd\r\n\r\n\r\nurl = \"https://zerodha.com/margin-calculator/Equity/\"\r\n\r\nheaders = {\r\n 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) \\\r\n AppleWebKit...
[ [ "pandas.DataFrame" ] ]
CnybTseng/LPRNet
[ "5983ae3e3445d121c2ac31ac396287aa134545ab" ]
[ "train.py" ]
[ "from __future__ import print_function\nimport argparse\nimport torch\nimport torch.utils.data\nimport multiprocessing as mp\nfrom progressbar import *\nimport lprnet as net\nimport dataset as ds\nfrom clpc import CHARS\n\ndef warmup_lr_scheduler(optimizer, warmup_iters, warmup_factor):\n def lr_lambda(x):\n ...
[ [ "torch.optim.lr_scheduler.MultiStepLR", "torch.optim.lr_scheduler.LambdaLR", "torch.cat", "torch.load", "torch.utils.data.DataLoader", "torch.cuda.is_available", "torch.optim.SGD", "torch.utils.data.Subset" ] ]
aescen/PantauTambak
[ "d0077c3d0ee9ef051b96a7e93752eea0fbd9ce1c" ]
[ "motion/rt_ObjectDetection_people.py" ]
[ "# USAGE\n# python real_time_object_detection.py --prototxt MobileNetSSD_deploy.prototxt.txt --model MobileNetSSD_deploy.caffemodel\n\n# import the necessary packages\nfrom imutils.video import FileVideoStream\nfrom imutils.video import VideoStream\nfrom imutils.video import FPS\nimport numpy as np\nimport argparse...
[ [ "numpy.arange", "numpy.array" ] ]
atiqm/adapt
[ "af9833cb7e698bdcb722941622d67c06f04822f7" ]
[ "tests/test_nnw.py" ]
[ "import numpy as np\n\nfrom adapt.instance_based import NearestNeighborsWeighting\n\nnp.random.seed(0)\nn = 50\nm = 50\np = 6\n\nXs = np.concatenate((np.random.randn(int(m/2), p)*0.1,\n 2+np.random.randn(int(m/2), p)*0.1))\nXt = np.random.randn(n, p)*0.1\n\n\ndef test_nnw():\n nnw = NearestNe...
[ [ "numpy.random.randn", "numpy.random.seed" ] ]
Socrats/EvoCRD
[ "437dc4c73f20c684300968caf25c74a409d8080f" ]
[ "estimate_payoff.py" ]
[ "\"\"\"\nCopyright 2020 Elias Fernández Domingos\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 appl...
[ [ "numpy.asarray", "numpy.array", "numpy.random.geometric" ] ]
darothen/py-mie
[ "63b3c52caf92a04a10ad4b2debe53ce3c12f847a" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\n\nimport os\nfrom numpy.distutils.core import setup, Extension\n\nVERSION = '0.4.2.post1'\n\nsrc_dir = \"src\"\npkg_dir = \"mie\"\n\nDESCRIPTION = \"Python wrapper for Mie theory calculators\"\nLONG_DESCRIPTION = \"\"\"\nThis package wraps several widely-used and vetted Mie theory calculator...
[ [ "numpy.distutils.core.Extension", "numpy.distutils.core.setup" ] ]
minssoj/Learning_cnn
[ "db966eba24199685a7750d94a6a1998ad326ae6c", "db966eba24199685a7750d94a6a1998ad326ae6c" ]
[ "day3/CNNEx.2.py", "day2/CNNEx.1.py" ]
[ "import tensorflow as tf\nimport matplotlib.pyplot as plt\nfashion_mnist = tf.keras.datasets.fashion_mnist\n(x_train, y_train), (x_test, y_test) = fashion_mnist.load_data()\n\nprint(x_train.shape, y_train.shape)\n\nx_train = x_train.reshape(-1, 28, 28, 1)\nx_test = x_test.reshape(-1, 28, 28, 1)\n\nfrom tensorflow.k...
[ [ "matplotlib.pyplot.legend", "tensorflow.keras.layers.Dropout", "matplotlib.pyplot.ylim", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPool2D", "matplotlib.pyplot.plot", "matplotlib.pyplot.subplot", "tensorflow.keras.optimizers.A...
pmolfese/AppleSiliconForNeuroimaging
[ "6d259ef2473d1a1e9077e078544ffc8a4f3c8664" ]
[ "nibabel_graph.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n#plot geometric mean for \n# load/init/minmax/rgba processing of DigiMorph Desert Iguana\n\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n#MacBook i5-8259U\n#Ubuntu i7-8700K\n#Ubuntu 3900X\ndf = pd.DataFrame({'CPU': ['8259U','3900X...
[ [ "matplotlib.pyplot.savefig", "pandas.DataFrame" ] ]
adsharma/quoracle
[ "9e32c2668c9898d73d28404aff1cfc7936977d53" ]
[ "examples/plot_load_distribution.py" ]
[ "from quoracle import *\nimport argparse\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport os.path\n\n\ndef main(output_directory: str):\n a = Node('a', capacity=100)\n b = Node('b', capacity=200)\n c = Node('c', capacity=100)\n d = Node('d', capacity=200)\n e = Node('e', capacity=100)\n ...
[ [ "matplotlib.pyplot.subplots" ] ]
noamholz/PSPNet-Keras-tensorflow
[ "48ab6972228776183d76565842adf429ad420522" ]
[ "utils/preprocessing.py" ]
[ "import os\nimport random\nimport numpy as np\n# from scipy.misc import imread, imresize\nfrom cv2 import resize as imresize\nfrom cv2 import imread\nfrom scipy.ndimage import zoom\nfrom collections import defaultdict\n\nDATA_MEAN = np.array([[[123.68, 116.779, 103.939]]])\n\ndef preprocess_img(img, input_shape):\n...
[ [ "numpy.arange", "scipy.ndimage.zoom", "numpy.array", "numpy.zeros" ] ]
cdalsoniii/brightforest_dash
[ "b4ad7a681e9a5e4ed41a12ad98e91e55e0e6ef88" ]
[ "communicate_with_parent.py" ]
[ "import dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output\nimport pandas as pd\nimport plotly.graph_objs as go\n\n# external JavaScript files\nexternal_scripts = [\n {'src': 'https://cdn.plot.ly/plotly-latest.min.js'}\n]\n\nexternal_stylesh...
[ [ "pandas.read_csv" ] ]
wangxu19920419/TorchSeg
[ "c5d370778349d9438ed8c854f267d3ba11ffd72f" ]
[ "model/bisenet/cityscapes.bisenet.R18/eval.py" ]
[ "#!/usr/bin/env python3\n# encoding: utf-8\nimport os\nimport cv2\nimport argparse\nimport numpy as np\n\nimport torch\nimport torch.multiprocessing as mp\n\nfrom config import config\nfrom utils.pyt_utils import ensure_dir, link_file, load_model, parse_devices\nfrom utils.visualize import print_iou, show_img\nfrom...
[ [ "torch.no_grad", "numpy.zeros" ] ]
MartinaGaravaglia/BayesianOptimization
[ "2c6d12da7666d3f38fa73975a3584a5dcacaf510" ]
[ "examples/plot_gp_function.py" ]
[ "import numpy as np\n\nimport matplotlib.pyplot as plt\nfrom matplotlib import gridspec\nimport sys\nimport os \npath = os.getcwd()\nparent = os.path.join(path, os.pardir)\nsys.path.append(os.path.abspath(parent))\nfrom bayes_opt1 import BayesianOptimization\nfrom bayes_opt1 import UtilityFunction\nsys.path.append(...
[ [ "matplotlib.pyplot.cm.get_cmap", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.subplot", "numpy.argmax", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "numpy.zeros", "matplotlib.pyplot.figure" ] ]
helq/pytropos
[ "497ed5902e6e4912249ca0a46b477f9bfa6ae80a" ]
[ "tests/inputs/numpy-lib/46-numpy-typehints.py" ]
[ "import numpy as np\nimport somelib\n\nfrom pytropos.hints.numpy import NdArray\n\na: NdArray[2,3,4] = np.array(somelib.val) # a should be array(shape=(2,3,4))\nb: NdArray[1,2] = somelib.numpyval() # b should be array(shape=(1,2))\nc = [[6], [8]]\nc = np.array(c) # c should be arra...
[ [ "numpy.array" ] ]
BenKarcher/Computer_Physik
[ "26b3a73c6d5d6e5e6bdd4a79cfdb248f80d28503" ]
[ "5/plot.py" ]
[ "import PyGnuplot as gp\nimport numpy as np\nX = np.arange(42)\nY = np.zeros(42)\n# Load file\nfile1 = open('plots/plot00', 'r')\nLines = file1.readlines()\n\ni=0\nfor line in Lines:\n nums = line.split(' ')\n for i in range(len(nums)):\n Y[i] = nums[i]\ngp.s([X, Y])\ngp.c('set terminal pngcairo size 1...
[ [ "numpy.arange", "numpy.zeros" ] ]
hiyongz/uiautomator2
[ "8a92edd1c2c4398719d1f19168ed1199c6fe399b" ]
[ "uiautomator2/ext-archived/aircv/__init__.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport cv2\nimport numpy as np\nimport time\n\nimport requests\nimport websocket\nimport threading\n\n__version__ = \"0.0.1\"\n\n\nclass CVHandler(object):\n template_threshold = 0.95 # 模板匹配的阈值\n\n def show(self, img):\n ''' 显示一个图片 '''\n cv2.im...
[ [ "numpy.append", "numpy.ndarray", "numpy.float32" ] ]
andresgmz/Scripts-Python
[ "1f56e5790dc9c38d9bbf5dc040ead45a8f3ca937" ]
[ "Entregacuatro.py" ]
[ "###Librerias\r\nimport logging\r\nimport numpy as np\r\nimport cv2\r\n \r\nfrom tkinter import filedialog\r\nfrom tkinter import *\r\n# Homomorphic filter class\r\nclass HomomorphicFilter:\r\n \r\n\r\n def __init__(self, a = 0.5, b = 1.5):\r\n self.a = float(a)\r\n self.b = float(b)\r\n\r\n ...
[ [ "numpy.fft.fft2", "numpy.hstack", "numpy.fft.ifft2", "numpy.uint8", "numpy.fft.fftshift", "numpy.real", "numpy.array", "numpy.exp", "numpy.zeros" ] ]
guillaumejaume/gnn-min-example
[ "bcae8a333b79b20f6426223566201d3faf0b429f" ]
[ "core/model.py" ]
[ "import torch\nimport torch.nn as nn\nimport dgl\n\nfrom core.layers.gnn import GINLayer\nfrom core.layers.mlp import MLP\nfrom core.layers.constants import GNN_NODE_FEAT_IN\n\n\nclass Model(nn.Module):\n\n def __init__(self, config, verbose=False, cuda=False):\n \"\"\"\n Model Constructor\n ...
[ [ "torch.nn.ModuleList" ] ]
thw1021/p4pdes
[ "421fd3d809b1e23e5a6f3c3e51252cb275a76140" ]
[ "c/ch10/genstructured.py" ]
[ "#!/usr/bin/env python3\n#\n# (C) 2014-2020 Ed Bueler\n\nimport sys, argparse\nimport numpy as np\nimport PetscBinaryIO # may use link\n\npetsc = PetscBinaryIO.PetscBinaryIO()\n\nparser = argparse.ArgumentParser(description='Generate a structured grid on the unit square in PETSc binary format (.vec,.is), readable ...
[ [ "numpy.array", "numpy.zeros" ] ]
IITJ-RCAI/AGD
[ "e51d9aa320d0cdb010820cc745b8b54aa51fd397" ]
[ "AGD_ST/search/train.py" ]
[ "from __future__ import division\r\nimport os\r\nimport sys\r\n\r\n# import time\r\nimport glob\r\nimport logging\r\nfrom tqdm import tqdm\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.utils\r\n\r\n# import torch.nn.functional as F\r\n# import torch.backends.cudnn as cudnn\r\nimport torchvision.trans...
[ [ "torch.optim.Adam", "torch.optim.lr_scheduler.MultiStepLR", "numpy.random.seed", "torch.cuda.manual_seed", "torch.load", "matplotlib.use", "torch.manual_seed", "torch.randn", "torch.cuda.empty_cache", "torch.optim.lr_scheduler.ExponentialLR", "torch.no_grad", "torch...
mnpinto/banet
[ "80da08fc4dbd6760ef453db1448e32dfa3587df9" ]
[ "banet/web.py" ]
[ "# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/07_web.ipynb (unless otherwise specified).\n\n__all__ = ['ba_split', 'fires2raster', 'process_last']\n\n# Cell\nfrom pathlib import Path\nimport scipy.io as sio\nimport pandas as pd\nimport geopandas as gp\nimport numpy as np\nimport rasterio\nimport rasterio.feature...
[ [ "numpy.nanmax", "pandas.concat", "numpy.isnan", "numpy.nanmin", "scipy.io.loadmat", "numpy.argwhere", "numpy.array" ] ]
mhgcmcc/Bambi_Bayesian-mixed-fit-model
[ "7473e7e524f9ab647a6e52aac38d7749ccb3303e" ]
[ "bambi/backends/pymc.py" ]
[ "import numpy as np\nimport pymc3 as pm\nimport theano\nfrom arviz import from_pymc3\n\nfrom bambi.priors import Prior\n\nfrom .base import BackEnd\n\n\nclass PyMC3BackEnd(BackEnd):\n \"\"\"PyMC3 model-fitting back-end.\"\"\"\n\n # Available link functions\n links = {\n \"identity\": lambda x: x,\n ...
[ [ "numpy.linalg.inv", "numpy.reshape", "numpy.linalg.det", "numpy.atleast_1d", "numpy.linalg.LinAlgError" ] ]
imperial-qore/GON
[ "08743504f3a0d86b7bbef77e363eb9a04ffe9242" ]
[ "src/gen.py" ]
[ "import torch\nfrom copy import deepcopy\n\ndef scale(data):\n return torch.max(torch.tensor(0), torch.min(data, torch.tensor(1)))\n\ndef gen(model, init_vec, real_label, loss, epsilon=1e-4, num_examples=1):\n lr = 0.01\n iteration = 0; equal = 0\n dim = (model.n_window)\n init = deepcopy(init_vec)\n...
[ [ "torch.optim.Adam", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.tensor" ] ]
doiken23/mccformers.pytorch
[ "678bd9448e3a2f35bd408e8c8e510e0ea1f9a19f" ]
[ "datasets.py" ]
[ "import json\nimport random\nfrom pathlib import Path\nfrom typing import Tuple, Union\n\nimport h5py\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader, Dataset\nfrom torch.utils.data.dataloader import default_collate\n\n\nclass RCCDataset(Dataset):\n\n shapes = set(['ball', 'block', 'cu...
[ [ "numpy.zeros_like", "torch.utils.data.dataloader.default_collate", "torch.arange", "numpy.load", "numpy.zeros", "torch.as_tensor" ] ]
tizianoGuadagnino/lidar-bonnetal
[ "b6d918412cd161e0551fdef48bd4ec069140da0e" ]
[ "train/tasks/mask_regression/modules/trainer.py" ]
[ "#!/usr/bin/env python3\n# This file is covered by the LICENSE file in the root of this project.\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\nimport torchvision.transforms as transforms\nimport imp\nimport yaml\nimport time\nfrom PIL import Image\nimport...
[ [ "torch.sigmoid", "torch.ones", "numpy.linspace", "torch.zeros", "torch.cuda.device_count", "matplotlib.pyplot.get_cmap", "torch.cuda.empty_cache", "numpy.concatenate", "torch.nn.BCEWithLogitsLoss", "torch.no_grad", "torch.cuda.is_available", "torch.optim.SGD", "...
miccio-dk/itsadive_hybrid_structural_model
[ "d58a0a90d67d19eb0fafacdfa5b32053c19756f0" ]
[ "python/models/utils.py" ]
[ "import io\nimport librosa as lr\nimport torch\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nfrom torchvision.transforms import ToTensor\n\n# convert matplotlib figure to tensor\ndef figure_to_tensor(fig):\n # Save the plot to a PNG in memory.\n buf = io.BytesIO()\n plt.savefig(buf, format='jpeg...
[ [ "matplotlib.pyplot.close", "torch.no_grad", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ] ]
craymichael/exputils
[ "cd9cf08e6556104e4be10f1765d41fc9717a8f82" ]
[ "exputils/data/labels.py" ]
[ "\"\"\"Useful label management classes and functions.\"\"\"\nimport logging\n\nfrom bidict import OrderedBidict, MutableBidict\nimport numpy as np\nfrom sklearn.utils import validation\nfrom sklearn.preprocessing import label_binarize\nfrom sortedcollections import SortedDict, ValueSortedDict\n\n\ndef load_label_se...
[ [ "sklearn.utils.validation._num_samples", "numpy.unique", "sklearn.utils.validation.column_or_1d", "numpy.delete", "numpy.searchsorted", "numpy.argsort", "numpy.array", "numpy.where" ] ]
Andresfgomez970/Machine-Learning-Music_Project-
[ "2220e2d50aec35e7e5d9fca23afc636b2c567bde" ]
[ "testing.py" ]
[ "# Impor modules for training\r\nimport torch\r\nimport model as m\r\nimport multi_training\r\nfrom midi_to_statematrix import *\r\nimport numpy as np\r\n\r\n\r\ndef test_time_model():\r\n time_model = m.TimeModel(80, [300, 300])\r\n print(time_model)\r\n\r\n data = torch.randn(127, 780, 80)\r\n\r\n out...
[ [ "torch.randn", "numpy.array", "numpy.argmax", "torch.Tensor" ] ]
bagashvilit/facial_recognition_bias
[ "abe87302b1d452cbd9100773a16c127f4d2ab546" ]
[ "src/RandomForest/classify.py" ]
[ "from __future__ import print_function\n\nimport argparse\nimport glob\nimport os\nimport random\n\nimport cv2\nimport numpy as np\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.metrics import classification_report\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing...
[ [ "sklearn.ensemble.RandomForestClassifier", "numpy.unique", "sklearn.model_selection.train_test_split", "numpy.concatenate", "sklearn.preprocessing.LabelEncoder" ] ]
dhufe/python
[ "e1f3de7826bcc391ee968f2d6ea9af1c24f3da17" ]
[ "Helper/HelpersFiltering.py" ]
[ "import scipy.signal as sp\n\ndef butter_lowpass(cutoff, fs, order=5):\n nyq = 0.5 * fs\n normal_cutoff = cutoff / nyq\n b, a = sp.butter(order, normal_cutoff, btype='low')\n return b, a\n\ndef butter_highpass(cutoff, fs, order=5):\n nyq = 0.5 * fs\n normal_cutoff = cutoff / nyq\n b, a = sp.but...
[ [ "scipy.signal.butter" ] ]
tberriel/MONet-pytorch
[ "4aac0ecca5ec9779849212db7fbcac17f194ff35" ]
[ "external/genesis/utils_misc.py" ]
[ "# =========================== A2I Copyright Header ===========================\n#\n# Copyright (c) 2003-2021 University of Oxford. All rights reserved.\n# Authors: Applied AI Lab, Oxford Robotics Institute, University of Oxford\n# https://ori.ox.ac.uk/labs/a2i/\n#\n# This file is the property of the Unive...
[ [ "numpy.ones_like", "torch.cat", "numpy.isnan", "torch.distributions.kl.kl_divergence", "torch.zeros_like", "torch.tensor", "numpy.argmax", "torch.no_grad", "torch.unique", "torch.where", "torch.split", "torch.stack", "sklearn.metrics.adjusted_rand_score", "n...
yz-cnsdqz/PLACE
[ "0cf72576b1f31d80be43b057b81df42190a3c72b" ]
[ "preprocess/bps_encoding.py" ]
[ "import numpy as np\nfrom sklearn.neighbors import NearestNeighbors\n\n\n########################### bps encoding ############################\n# Sample uniformly in the unit ball (random)\ndef bps_gen_ball_inside(n_bps=1000, random_seed=100):\n np.random.seed(random_seed)\n x = np.random.normal(size=[n_bps,...
[ [ "numpy.square", "numpy.random.seed", "numpy.power", "numpy.squeeze", "numpy.random.normal", "numpy.random.uniform", "sklearn.neighbors.NearestNeighbors" ] ]
cavalcantigor/coco
[ "32e4435add65bbba4a63b459685dc4f48d72f839", "32e4435add65bbba4a63b459685dc4f48d72f839" ]
[ "code-postprocessing/cocopp/comp2/ppscatter.py", "code-experiments/build/python/example_experiment_for_beginners.py" ]
[ "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Scatter Plots.\n\nFor two algorithms, this generates the scatter plot of log(ERT1(df)) vs.\nlog(ERT0(df)), where ERT0(df) is the ERT of the reference algorithm,\nERT1(df) is the ERT of the algorithm of concern, both for target\nprecision df.\n\nDifferent symbo...
[ [ "matplotlib.pyplot.gca", "numpy.sum", "matplotlib.pyplot.title", "matplotlib.transforms.blend_xy_sep_transform", "numpy.isfinite", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "numpy.log10", "matplotlib.pyplot.grid", "matplotlib.pyplot.c...
mtreinish/qiskit-dynamics
[ "1c2abca01e4f1bf4c66431103340ecd6c5f67817" ]
[ "qiskit_dynamics/models/generator_models.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2020.\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.tensordot", "numpy.allclose" ] ]
aliquantus/swimlog
[ "bd85eb4bf613397a4125b29a4d19aae2f1257e4f" ]
[ "plot.py" ]
[ "from models import *\nfrom queries import *\nimport matplotlib.pyplot as plt\n\n\ndef plotMonthly(datum1, datum2):\n dates, lengths, sessions = monthly(datum1, datum2)\n plt.plot(dates, lengths)\n plt.show()\n\n plt.savefig(\"./output/figures/monthly_{}to{}\".format(datum1, datum2))\n\n\ndef plot(datum...
[ [ "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
c1b3r3y3/DeepMindBreak
[ "b268ca816dcd70b0c120ba036ea811e5fb3d26f5" ]
[ "poisson_blend.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport scipy.sparse\nimport PIL.Image\nimport pyamg\nimport copy\n\n# pre-process the mask array so that uint64 types from opencv.imread can be adapted\ndef prepare_mask(mask):\n result = np.ndarray((mask.shape[0], mask.shape[1]), dtype=np.ui...
[ [ "numpy.reshape", "numpy.uint8", "numpy.ndarray", "numpy.prod", "numpy.array" ] ]
igherzog/hawc_hal
[ "d76b8d3361c4a6f301487cc86d921c65bed93351" ]
[ "scripts/hal_hdf5_to_fits.py" ]
[ "from __future__ import print_function\nfrom builtins import range\nfrom hawc_hal.maptree import map_tree_factory\nfrom astropy.io import fits\n\nfrom IPython import embed\n\nimport healpy as hp\nimport numpy as np\n\nimport argparse\nimport os\nfrom datetime import datetime\n\n\nparser = argparse.ArgumentParser(de...
[ [ "numpy.empty" ] ]
VoteNet-Torch/votenet
[ "b3018f1f1c1ac94043366a9d1896b7b3985cacce" ]
[ "models/proposal_module.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\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.\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nimport os\nimport sys\nBASE_DIR = os.path...
[ [ "torch.nn.BatchNorm1d", "torch.randint", "torch.rand", "torch.nn.Conv1d" ] ]
olivares-j/emcee
[ "e46c3788a06469a56c3f3a07f4857c43bf83469b" ]
[ "src/emcee/backends/hdf.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import division, print_function\n\n__all__ = [\"HDFBackend\", \"TempHDFBackend\"]\n\nimport os\nfrom tempfile import NamedTemporaryFile\n\nimport numpy as np\n\nfrom .. import __version__\nfrom .backend import Backend\n\n\ntry:\n import h5py\nexcept ImportError:\n h...
[ [ "numpy.dtype", "numpy.zeros", "numpy.prod" ] ]