repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
osin-vladimir/kaggle-hpa-image-classification
[ "8a6da80f875b7eb8d017667d76191f31cf2afeae" ]
[ "protein_get_data.py" ]
[ "import xml.etree.ElementTree as etree\nimport pandas as pd\nfrom collections import defaultdict\nfrom tqdm import tqdm\n\nPROTEINATLAS_XML_PATH = \"../../../../kaggle_protein_atlas/input_data/proteinatlas.xml\"\nTRAIN_EXTRA_PATH = \"../../../../kaggle_protein_atlas/input_data/hpa_website_set.csv\"\n\ncounter ...
[ [ "pandas.DataFrame" ] ]
zhawhjw/yolact-interpret
[ "c9cc6d2eca0c6920f7465a4dc585e8da226f5fa8" ]
[ "data/__init__.py" ]
[ "from .config import *\nfrom .coco import COCODetection, COCOAnnotationTransform, get_label_map\n\nimport torch\nimport cv2\nimport numpy as np\n\n\ndef detection_collate(batch):\n \"\"\"Custom collate fn for dealing with batches of images that have a different\n number of associated object annotations (bound...
[ [ "torch.stack", "torch.FloatTensor" ] ]
SushritPasupuleti/Braggi-A-Python-Based-Contextual-Chatbot-Framework
[ "c81fa4bb0551d2d32fedc5c5d5fbf17940f5d2b1" ]
[ "Text_Processing_Engine.py" ]
[ "#%%\nimport nltk\nfrom nltk.stem.lancaster import LancasterStemmer\nimport json\nimport numpy as np\nimport random\n\nstemmer = LancasterStemmer()\n\ndef intents_loader():\n '''Imports the Main \"intents.json\" File.'''\n with open('./Intent_Models/intents.json') as json_data:\n intents = json.load(js...
[ [ "numpy.array" ] ]
claforte/nevergrad
[ "a06ae7ccf312392a7de4e90f93084834a5a978f0" ]
[ "nevergrad/optimization/test_base.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport warnings\nfrom unittest import TestCase\nfrom typing import List, Tuple\nimport genty\nimport numpy as n...
[ [ "numpy.testing.assert_equal", "numpy.array", "numpy.testing.assert_almost_equal" ] ]
lsst-camera-dh/EO-utilities
[ "28418284fdaf2b2fb0afbeccd4324f7ad3e676c8" ]
[ "python/lsst/eo_utils/flat/flat_oscan.py" ]
[ "\"\"\"Class to analyze the FFT of the bias frames\"\"\"\n\nimport numpy as np\n\n#from lsst.eotest.sensor.overscan_fit import OverscanFit\n\nfrom lsst.eo_utils.base.config_utils import EOUtilOptions\n\nfrom lsst.eo_utils.base.data_utils import TableDict\n\nfrom lsst.eo_utils.base.butler_utils import make_file_dict...
[ [ "numpy.arange", "numpy.ones", "numpy.mean", "numpy.argsort", "numpy.sum" ] ]
nateagr/ml-hadoop-experiment
[ "a821199f5321019d6e2bcfb9c4979b66d2d14324" ]
[ "tests/tensorflow/test_numpy_to_sparse_tensors.py" ]
[ "import pytest\nimport numpy as np\n\nfrom ml_hadoop_experiment.tensorflow import (\n numpy_to_sparse_tensors\n)\n\n\n@pytest.mark.parametrize(\"sizes,expected\", [\n ([2, 3], [0, 1, 0, 1, 2]),\n ([2, 0, 3], [0, 1, 0, 1, 2]),\n ([2, 1, 0], [0, 1, 0]),\n ([0, 0, 0], [])\n])\ndef test_generate_incremen...
[ [ "numpy.empty", "numpy.array", "numpy.array_equal" ] ]
suranakritika/CarND-Capstone
[ "bed82dac5622f20ea00dd510afc6824b71ee7c0a" ]
[ "ros/src/tl_detector/tl_detector.py" ]
[ "#!/usr/bin/env python\nimport rospy\nfrom std_msgs.msg import Int32\nfrom geometry_msgs.msg import PoseStamped, Pose\nfrom styx_msgs.msg import TrafficLightArray, TrafficLight\nfrom styx_msgs.msg import Lane\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge\nfrom light_classification.tl_classifier...
[ [ "scipy.spatial.KDTree" ] ]
STNet-cvpr2022/STNet
[ "b6fb9db95af61c53e12fdb97883e8b9bc301d8e2" ]
[ "videoanalyst/model/backbone/backbone_impl/snn3.py" ]
[ "# -*- coding: utf-8 -*\n\nimport torch.nn as nn\nimport torch\n\nfrom videoanalyst.model.backbone.backbone_base import (TRACK_BACKBONES,\n VOS_BACKBONES)\nfrom videoanalyst.model.common_opr.common_block import conv_bn_relu\nfrom videoanalyst.model.module_base i...
[ [ "torch.mean", "torch.ones", "torch.max", "torch.histc", "torch.zeros", "torch.min", "torch.nn.Conv2d", "torch.nn.Sigmoid", "torch.nn.AdaptiveAvgPool2d", "torch.log", "torch.where", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.count_nonzero" ] ]
sweigart/pygama
[ "3c5fe4c69230814933b2de879b9a305ff0d4ad5e", "3c5fe4c69230814933b2de879b9a305ff0d4ad5e" ]
[ "experiments/hades/HADES_AoE.py", "experiments/hades_test/setup.py" ]
[ "## kinda preliminary version which summarises the results in a pdf in ./output/low_cut_results.pdf\n## doesn't overwrite if the folder already exists, instead makes a new folder\n\nimport pygama\nimport os, time, json\nimport numpy as np\nimport pandas as pd\nfrom pprint import pprint\nimport matplotlib as mpl\nim...
[ [ "numpy.amax", "numpy.sqrt", "numpy.linspace", "numpy.asarray", "pandas.DataFrame", "matplotlib.pyplot.plot", "numpy.exp", "numpy.histogram", "scipy.signal.savgol_filter", "scipy.optimize.curve_fit", "numpy.where", "matplotlib.backends.backend_pdf.PdfPages", "mat...
valentinp72/espresso
[ "84c0ce6e9f47dae9fcb3b731089d27f4aad5161d" ]
[ "fairseq/dataclass/configs.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 sys\nfrom dataclasses import _MISSING_TYPE, dataclass, field\nfrom typing import Any, List, Optional\n\nimport torch\n\nfrom ...
[ [ "torch.cuda.device_count" ] ]
rlowrance/mlpack
[ "4a09987fd5efb9736284c94d90aa51b34d4bce7f" ]
[ "module_linear_n.py" ]
[ "'''linear mode with 1 or more outputs'''\nimport numpy as np\nimport unittest\nimport pdb\n\n\ndef linear_n(num_inputs, num_outputs):\n assert num_inputs >= 1\n assert num_outputs >= 1\n\n def split(theta):\n '''bias vector and weight matrix'''\n b = theta[:num_outputs]\n w = theta[nu...
[ [ "numpy.hstack", "numpy.dot", "numpy.array", "numpy.linalg.norm" ] ]
matthiasdusch/phoeton
[ "9cff26121dc15e9455fbf514f60cc0123280f337" ]
[ "tests/test_tsplots.py" ]
[ "import pytest\nfrom unittest.mock import patch\nimport os\nimport pandas as pd\nfrom copy import deepcopy\nimport matplotlib.pyplot as plt\n\nfrom foehnix.analysis_plots import tsplot, TSControl, image\n\n\ndef test_tsplot_api_control(caplog, tyr_mod1):\n # Test some wrong inputs to the plot API\n with pytes...
[ [ "pandas.to_timedelta", "matplotlib.pyplot.gcf" ] ]
RWTH-EBC/X-HD
[ "55b9066e8fc1107f70c0a9cf49aa5ff4d812823c" ]
[ "HSM-Design/Functions_GUI/Functions.py" ]
[ "import json\nimport numpy as np\nimport os\nimport sys\nfrom teaser.project import Project\nimport DyMat\nfrom scipy.io import savemat, loadmat\nimport openpyxl as xl\nfrom pathlib import Path\n\n# paths\n# TODO: ask for paths in app once\nPATH_DYMOLA = r\"C:\\Program Files\\Dymola 2021\"\ncomp_path = r\"C:\\Progr...
[ [ "numpy.array", "numpy.mean", "scipy.io.savemat" ] ]
klayveR/python-poe-timeless-jewel
[ "5c766d83b3d8772ce507eda6a0b3bc2d93e87556" ]
[ "scripts/ocr.py" ]
[ "import cv2\nimport numpy as np\ntry:\n from PIL import Image\nexcept ImportError:\n import Image\nimport pytesseract\n\nclass OCR:\n @staticmethod\n def clahe(img, clip_limit = 2.0, grid_size = (8,8)):\n clahe = cv2.createCLAHE(clipLimit = clip_limit, tileGridSize = grid_size)\n return cl...
[ [ "numpy.array" ] ]
jackzhu727/deep-probability-estimation
[ "459deff626fd84ad253ded8ef40790dd0f513b98" ]
[ "datasets/simulated_face.py" ]
[ "import torch\nimport h5py\nfrom scipy.special import expit\nimport numpy as np\n\n\nclass FaceDataset(torch.utils.data.Dataset):\n def __init__(self, root, prob_type, mode='train'):\n with h5py.File(root + mode + '_im.h5', 'r') as f:\n self.keys = list(f.keys())\n self.prob_type = prob_...
[ [ "numpy.array", "scipy.special.expit", "torch.tensor" ] ]
PradeepKadubandi/fairo
[ "9bbe6254a7f49a6eedcccfd9c655e4bb2be4fd53" ]
[ "droidlet/lowlevel/minecraft/pyworld/physical_interfaces.py" ]
[ "import numpy as np\nimport logging\nfrom droidlet.perception.craftassist.rotation import look_vec\nfrom droidlet.shared_data_structs import TICKS_PER_SEC, Time\n\nHEAD_HEIGHT = 2\n# how many internal, non-world-interacting steps agent takes before world steps:\nWORLD_STEP = 10\nWORLD_STEPS_PER_DAY = 480\n\n\n\ncla...
[ [ "numpy.array" ] ]
lev1khachatryan/ASDS_DL
[ "ca00ce7b4cfb722f9bce545820cdb661ff8b643e" ]
[ "DL_FromScratch/unsupervised_learning/generative_adversarial_network.py" ]
[ "from __future__ import print_function, division\nfrom sklearn import datasets\nimport math\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport progressbar\n\nfrom sklearn.datasets import fetch_mldata\n\nfrom deep_learning.optimizers import Adam\nfrom deep_learning.loss_functions import CrossEntropy\nfrom ...
[ [ "matplotlib.pyplot.subplots", "numpy.ones", "numpy.random.normal", "sklearn.datasets.fetch_mldata", "matplotlib.pyplot.close", "matplotlib.pyplot.suptitle", "numpy.zeros", "numpy.random.randint" ] ]
AtousaTorabi/Theano_old
[ "ba2d2f74406243112e813df31429721c791a889a" ]
[ "theano/sandbox/cuda/tests/test_fftconv.py" ]
[ "import unittest\nimport numpy\n\nimport theano\nfrom theano.tests import unittest_tools as utt\n\n# Skip tests if cuda_ndarray is not available.\nfrom nose.plugins.skip import SkipTest\nimport theano.sandbox.cuda as cuda_ndarray\nif not cuda_ndarray.cuda_available:\n raise SkipTest('Optional package cuda not av...
[ [ "numpy.random.random", "numpy.zeros" ] ]
Sandsten/pixicasso
[ "b60343342c13fd2150fa4a364b51ff71b6f6329f" ]
[ "read_list.py" ]
[ "import numpy as np\nstyle_name_list = [\"kandinsky\", \"shipwreck\", \"the_scream\",\"seated-nude\", \"starry-night\", \"woman-with-hat-matisse\"]\nloss_types = ['total_loss', 'content_loss', 'style_loss', 'cross_loss']\nfor loss in loss_types:\n values = []\n for name in style_name_list:\n data = np.load(\"r...
[ [ "numpy.load" ] ]
cxqj/34-wtalc
[ "812c777f951966cee1a1f6bfe4e1855a5763faec" ]
[ "classificationMAP.py" ]
[ "import numpy as np\n\ndef getAP(conf,labels):\n assert len(conf)==len(labels)\n sortind = np.argsort(-conf)\n tp = labels[sortind]==1; fp = labels[sortind]!=1\n npos = np.sum(labels);\n\n fp = np.cumsum(fp).astype('float32'); tp = np.cumsum(tp).astype('float32')\n rec=tp/npos; prec=tp/(fp+tp)\n ...
[ [ "numpy.argsort", "numpy.cumsum", "numpy.shape", "numpy.sum" ] ]
susanbao/m3ddpg
[ "1a44a58b7a2ec56468ed34c69a11f0562be191d1" ]
[ "experiments/train_with_perturbed_network.py" ]
[ "import argparse\nimport numpy as np\nimport tensorflow as tf\nimport time\nimport pickle\nimport sys\nimport os\nimport re\n\nsys.path.append('../')\nsys.path.append('../../')\nsys.path.append('../../../')\n\nimport maddpg.common.tf_util as U\nfrom maddpg.trainer.m3ddpg import M3DDPGAgentTrainer\nfrom maddpg.train...
[ [ "numpy.random.seed", "tensorflow.contrib.layers.fully_connected", "numpy.mean", "tensorflow.variable_scope", "tensorflow.train.Saver", "tensorflow.contrib.framework.get_variables_to_restore" ] ]
NartayXD/scikit-learn
[ "86c62cff7121b218f7bd7007bd6880e206561019", "86c62cff7121b218f7bd7007bd6880e206561019" ]
[ "sklearn/utils/metaestimators.py", "sklearn/feature_selection/_from_model.py" ]
[ "\"\"\"Utilities for meta-estimators\"\"\"\n# Author: Joel Nothman\n# Andreas Mueller\n# License: BSD\nfrom typing import List, Any\nimport warnings\n\nfrom abc import ABCMeta, abstractmethod\nfrom operator import attrgetter\nfrom functools import update_wrapper\nimport numpy as np\nfrom contextlib import s...
[ [ "numpy.ix_" ], [ "numpy.ones_like", "numpy.median", "numpy.mean", "numpy.zeros_like", "numpy.argsort" ] ]
CodyJohnsonCHL/dfm_models
[ "50cd5e876d545f9aa677fcceee902687be2a97ee" ]
[ "dfm_models/utils/analysis.py" ]
[ "\"\"\"Analysis tools for comparing model results to observations\n\ncody.l.johnson@erdc.dren.mil\n\n\"\"\"\n\nimport pandas as pd\nimport pytide\nfrom numpy import abs, angle\n\nfrom dfm_models._internal import validate_harcon\n\n\ndef compute_harcon_error(Observations, Results):\n \"\"\"Calculate statistics be...
[ [ "numpy.angle", "numpy.abs", "pandas.Series" ] ]
TimeEscaper/rl_data_association
[ "fd7f7fb9d5d7aebfbb9729ddaf13b6287a8c11f6" ]
[ "tools/plot.py" ]
[ "\"\"\"\nSudhanva Sreesha\nssreesha@umich.edu\n24-Mar-2018\n\nGonzalo Ferrer\ng.ferrer@skoltech.ru\n26-Nov-2018\n\nThis file contains all utilities for plotting data.\n\"\"\"\n\nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom scipy.linalg import cholesky\n\n\ndef plot2dcov(mu, Sigma, color, nSigma=1,...
[ [ "numpy.linspace", "matplotlib.pyplot.scatter", "matplotlib.pyplot.figure", "numpy.cos", "numpy.stack", "numpy.sin", "matplotlib.pyplot.plot", "matplotlib.pyplot.Circle", "numpy.transpose", "scipy.linalg.cholesky", "matplotlib.pyplot.gcf", "matplotlib.pyplot.axis", ...
zhuzilin/PatrickStar
[ "72daf8dbded07e03d911db6369b075c9bfcd5245" ]
[ "setup.py" ]
[ "# BSD 3-Clause License\n#\n# Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification,\n# are permitted provided that the following conditions are met:\n#\n# * Redistributions of source code must retain the a...
[ [ "torch.utils.cpp_extension.BuildExtension.with_options" ] ]
nowireless/opencv
[ "1fcc4c74fefee4f845c0d57799163a1cbf36f654" ]
[ "modules/dnn/test/pascal_semsegm_test_fcn.py" ]
[ "from __future__ import print_function\nfrom abc import ABCMeta, abstractmethod\nimport numpy as np\nimport sys\nimport argparse\nimport time\n\nfrom imagenet_cls_test_alexnet import CaffeModel, DnnCaffeModel\ntry:\n import cv2 as cv\nexcept ImportError:\n raise ImportError('Can\\'t find OpenCV Python module....
[ [ "numpy.expand_dims", "numpy.sum", "numpy.abs", "numpy.multiply", "numpy.diagonal", "numpy.ones", "numpy.max", "numpy.argmax", "numpy.count_nonzero", "numpy.array", "numpy.zeros", "numpy.trace" ] ]
stephanecollot/lofo-importance
[ "ca9599f73c939621b3b247a0ccd38c28d23f9dee" ]
[ "tests/test_lofo_importance.py" ]
[ "from sklearn.linear_model import LogisticRegression\nfrom lofo.lofo_importance import LOFOImportance\nfrom data.test_data import generate_test_data\nfrom lightgbm import LGBMRegressor\nfrom sklearn.model_selection import KFold\n\n\ndef test_lofo_importance():\n df = generate_test_data(1000)\n\n features = [\...
[ [ "sklearn.linear_model.LogisticRegression", "sklearn.model_selection.KFold" ] ]
huy-ha/nerf
[ "413cf11dbf469b5cb3281306ed1c86b2a474b031" ]
[ "get_gt.py" ]
[ "import json\nimport imageio\nimport numpy as np\nimport tensorflow as tf\nimport os\n\ntf.compat.v1.enable_eager_execution()\n\n\ndef load_gt_data(basedir, timestep, testskip=1):\n with open(os.path.join(basedir, 'transforms.json'), 'r') as fp:\n meta = json.load(fp)\n\n all_imgs = []\n all_poses =...
[ [ "numpy.arange", "tensorflow.compat.v1.enable_eager_execution", "numpy.concatenate", "numpy.tan", "numpy.array" ] ]
DylanScotney/cryptocurrency_backtesting
[ "268931ad24f90df676193b15b8bfaa791de616d8" ]
[ "Lib/data_loading/file_loading_strategies.py" ]
[ "import json\nimport numpy as np\nfrom datetime import datetime\nimport pandas as pd\nfrom matplotlib import pyplot as plt\nfrom pandas.plotting import register_matplotlib_converters\n\nfrom .abstract_data_loading_strategy import dataLoadingStrat\n\n\nclass fileLoadingRaw(dataLoadingStrat):\n \"\"\"\n concret...
[ [ "pandas.read_csv", "pandas.DataFrame", "pandas.date_range" ] ]
Eren-Corn0712/Eren-Corn0712-EsVit_on_Tumor
[ "ceb1e76a795c3ad2aa3d576233fbf91c6a6399f6" ]
[ "models/vision_transformer.py" ]
[ "# Modified by Chunyuan Li (chunyl@microsoft.com)\r\n#\r\n# Copyright (c) Facebook, Inc. and its affiliates.\r\n# \r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n# \r\n# ...
[ [ "torch.nn.functional.normalize", "torch.nn.Sequential", "torch.nn.Dropout", "torch.linspace", "torch.mean", "torch.nn.GELU", "torch.nn.BatchNorm1d", "torch.cat", "torch.zeros", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.tensor", "torch.nn.Linear", ...
gurasog/cognigraph
[ "34a0f31376bc2cb1b04e45bb333a3437dd6e560a" ]
[ "bci/classifiers.py" ]
[ "from sklearn.naive_bayes import GaussianNB\nimport numpy as np\n\ndef prepare_data_with_window(data, window_shape):\n index_for_data = len(data) // window_shape\n print(index_for_data)\n cut_data = data[0:index_for_data * window_shape]\n print(len(cut_data))\n new_sample = np.empty(0)\n print(typ...
[ [ "numpy.append", "numpy.array", "sklearn.naive_bayes.GaussianNB", "numpy.empty" ] ]
Bibbidi-Babbidi-Boo/SDRE-based-Cooperative-UAV-Landing-on-High-speed-targets
[ "515fb38120990cb707521da1a5870721b0ee842a", "515fb38120990cb707521da1a5870721b0ee842a" ]
[ "quadcopter/script/extras/sdre_real.py", "quadcopter/script/extras/kalman_filter_cam.py" ]
[ "#!/usr/bin/env python\nimport rospy\nimport tf\nimport scipy.linalg as la\nimport numpy as np\nfrom math import *\nimport mavros_msgs.srv\nfrom mavros_msgs.msg import AttitudeTarget\nfrom nav_msgs.msg import Odometry\nfrom std_msgs.msg import *\nfrom geometry_msgs.msg import *\nfrom mavros_msgs.msg import *\nfrom ...
[ [ "numpy.linalg.inv", "numpy.dot", "numpy.array", "scipy.linalg.solve_continuous_are" ], [ "numpy.dot", "numpy.linalg.svd", "numpy.linalg.inv", "numpy.random.normal", "numpy.array" ] ]
panjiacheng/apollo
[ "d547687f8d1e6b37c97421923aa6f507dd6b9e1c" ]
[ "modules/tools/sensor_calibration/extract_data.py" ]
[ "#!/usr/bin/env python\n\n###############################################################################\n# Copyright 2019 The Apollo 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 ...
[ [ "numpy.float32", "numpy.floor", "numpy.finfo" ] ]
bicycle315/Qiskit-Metal
[ "41790052d79de0cad94e8c716e6ca1316164fa02" ]
[ "qiskit_metal/renderers/renderer_ansys/hfss_renderer.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE...
[ [ "pandas.read_csv", "numpy.abs", "matplotlib.pyplot.subplots", "pandas.DataFrame", "matplotlib.gridspec.GridSpec", "numpy.angle", "matplotlib.pyplot.figure" ] ]
mattrogers1124/fibonacci
[ "7606c9aa6c9837b6f5b6e936741241fb80659444" ]
[ "example.py" ]
[ "import matplotlib.pyplot as plt\nfrom fibonacci import unitdisk, unitsphere\n\n# Plot 1000 points on the unit disk\nfig1 = plt.figure()\nax1 = fig1.add_subplot()\nx1, y1 = unitdisk(1000).transpose()\nax1.scatter(x1, y1)\nax1.set_aspect(1)\nax1.set_title(\"Sample of 1,000 points from unit disk\")\n\n# Plot 1000 poi...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
Sy-Zhang/recurrent-transformer
[ "f66ba49a2c9ec42759d3d00d497b49ffe39e18de" ]
[ "src/rtransformer/recursive_caption_dataset.py" ]
[ "import copy\nimport torch\nimport logging\nimport math\nimport nltk\nimport numpy as np\nimport os\n\nfrom torch.utils.data import Dataset\nfrom torch.utils.data.dataloader import default_collate\nfrom tqdm import tqdm\n\nfrom src.utils import load_json, flat_list_of_lists\n\nlog_format = \"%(asctime)-10s: %(messa...
[ [ "numpy.linspace", "numpy.load", "numpy.array", "numpy.zeros", "torch.utils.data.dataloader.default_collate" ] ]
rcox771/mapgen
[ "036bf3fd42473a3bca58250ae9a6e1cce698c95d" ]
[ "mapgen/noise.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nfrom itertools import product, count\nfrom matplotlib.colors import LinearSegmentedColormap\nimport noise\nfrom .maths import *\n\n\n\ndef fbm(shape, p, lower=-np.inf, upper=np.inf):\n # Fourier-based power law noise with frequency...
[ [ "numpy.fft.fft2", "numpy.random.random", "numpy.power", "numpy.random.rand", "numpy.fft.fftfreq", "numpy.meshgrid", "numpy.zeros" ] ]
gyf135/Hands-On-GPU-Programming-with-Python-and-CUDA
[ "4fbd14d3a9fbc68305ffaa16490221b1ef49a934" ]
[ "Chapter11/dynamic_hello.py" ]
[ "from __future__ import division\nimport numpy as np\nfrom pycuda.compiler import DynamicSourceModule\nimport pycuda.autoinit\n\nDynamicParallelismCode='''\n__global__ void dynamic_hello_ker(int depth)\n{\n printf(\"Hello from thread %d, recursion depth %d!\\\\n\", threadIdx.x, depth);\n if (threadIdx.x == 0 && blo...
[ [ "numpy.int32" ] ]
mmakai/zeppelin
[ "1ec869f38deb79a9a7f8b10fb0ba2e00b4ac3abf" ]
[ "python/src/main/resources/python/backend_zinline.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you m...
[ [ "matplotlib._pylab_helpers.Gcf.get_active", "matplotlib.is_interactive", "matplotlib._pylab_helpers.Gcf.get_all_fig_managers", "matplotlib._pylab_helpers.Gcf.destroy_all", "matplotlib.backend_bases.FigureManagerBase.__init__" ] ]
RezaZeinali91/NUTLIS
[ "a521df21266913d482bad91490f236bc99193351" ]
[ "examples/adaptivity.py" ]
[ "#! /usr/bin/env python3\n#\n# In this script we solve the Laplace problem on a unit square that has the\n# bottom-right quadrant removed (a.k.a. an L-shaped domain) with Dirichlet\n# boundary conditions matching the harmonic function\n#\n# .. math:: \\sqrt[3]{x^2 + y^2} \\cos\\left(\\tfrac23 \\arctan\\frac{y+x}{y-...
[ [ "numpy.testing.assert_almost_equal", "numpy.log", "numpy.mean" ] ]
Aniket1313/ga-learner-dsmp-repo
[ "adc9f5310c8ad083efd2ebb06912ea8be818e373" ]
[ "Lego-toy-price-prediction-using-Linear-Regression-/code.py" ]
[ "# --------------\nimport pandas as pd\nimport numpy as np\nfrom sklearn.cross_validation import train_test_split\n\n# code starts here\n\ndf =pd.read_csv(path)\ndf.head(5)\n\nX = df[[\"ages\",\"num_reviews\",\"piece_count\",\"play_star_rating\",\"review_difficulty\",\"star_rating\",\"theme_name\",\"val_star_rating...
[ [ "sklearn.cross_validation.train_test_split", "pandas.read_csv", "sklearn.metrics.r2_score", "matplotlib.pyplot.subplots", "sklearn.metrics.mean_squared_error", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.show" ] ]
JakeColtman/SurPyval
[ "71ab77231ba39eccba165088689282b247c015f2" ]
[ "SurPyval/model/fitmodel.py" ]
[ "from typing import Dict, Any\n\nfrom SurPyval.node import NodeTree\nfrom SurPyval.samplers import EmceeSampler\n\n\nclass FitModel:\n \"\"\"\n A model that has a posterior sampler\n\n Parameters\n ----------\n node_tree: NodeTree\n The graphical structure of the mod...
[ [ "matplotlib.pyplot.plot" ] ]
CEfanmin/DataMiningProjects
[ "b6375f542c68c0001ae2971dd7e8046a0b4afc7a" ]
[ "GraphSAGE/graphsage/models.py" ]
[ "from collections import namedtuple\n\nimport tensorflow as tf\nimport math\n\nimport graphsage.layers as layers\nimport graphsage.metrics as metrics\n\nfrom .prediction import BipartiteEdgePredLayer\nfrom .aggregators import MeanAggregator, MaxPoolingAggregator, MeanPoolingAggregator, SeqAggregator, GCNAggregator\...
[ [ "tensorflow.concat", "tensorflow.zeros", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.nn.l2_loss", "tensorflow.train.AdamOptimizer", "tensorflow.summary.scalar", "tensorflow.get_collection", "tensorflow.nn.top_k", "tensorflow.train.Saver", "tensorflow.nn.l2_n...
kristianmeyerr/AMICI
[ "15f14c24b781daf5ceb3606d79edbbf57155a043" ]
[ "python/tests/test_heavisides.py" ]
[ "\"\"\"Tests for SBML events, including piecewise expressions.\"\"\"\nimport numpy as np\nimport pytest\n\n\nfrom util import (\n create_sbml_model,\n create_amici_model,\n check_trajectories_without_sensitivities,\n check_trajectories_with_forward_sensitivities,\n)\n\n@pytest.fixture(params=[\n 'sta...
[ [ "numpy.log", "numpy.linspace", "numpy.floor", "numpy.array", "numpy.exp" ] ]
yashraj02/incubator-mxnet
[ "91b8e575072b92c5bf1a6ad211249b3a9b528221" ]
[ "tests/python/unittest/test_symbol.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.random.permutation" ] ]
shuva10v/airflow
[ "caadbc1618d73e054de99138b0892cea3a9327c4" ]
[ "airflow/contrib/hooks/salesforce_hook.py" ]
[ "# -*- coding: utf-8 -*-\n#\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...
[ [ "pandas.DataFrame.from_records", "pandas.to_datetime", "pandas.Series" ] ]
ch-shin/nlp-tutorial
[ "8b05db81daa98fae519bbe652f4b4e6b8cb8777a" ]
[ "5-1.Transformer/Transformer(Greedy_decoder)-Torch.py" ]
[ "'''\n code by Tae Hwan Jung(Jeff Jung) @graykode, Derek Miller @dmmiller612\n Reference : https://github.com/jadore801120/attention-is-all-you-need-pytorch\n https://github.com/JayParks/transformer\n'''\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch...
[ [ "torch.nn.Softmax", "numpy.sqrt", "torch.nn.Embedding", "torch.FloatTensor", "torch.autograd.Variable", "torch.nn.CrossEntropyLoss", "torch.ones", "numpy.sin", "matplotlib.pyplot.figure", "torch.LongTensor", "numpy.power", "torch.nn.Linear", "torch.nn.Conv1d", ...
EmanueleGhelfi/tensorflow
[ "d4ddccd3cca4fc837c66ae1dfa190739420ad122" ]
[ "tensorflow/python/distribute/values.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.data.experimental.ops.batching.unbatch", "tensorflow.python.distribute.distribution_strategy_context.get_distribution_strategy", "tensorflow.python.data.ops.dataset_ops.make_one_shot_iterator", "tensorflow.python.framework.device.DeviceSpec.from_string", "tensorflow.python.f...
sigmaai/behavioral-cloning
[ "3e9c9fa638de78dbb7cf61d80cc53b275aa0d3e6" ]
[ "visualization.py" ]
[ "\n# Dataset visualization tool\n# Original By: Comma.ai and Chris Gundling\n# Revised and used by Neil Nie\n\n\nimport matplotlib.backends.backend_agg as agg\nfrom i3d import Inception3D\nimport pandas as pd\nfrom os import path\nimport numpy as np\nimport cv2\nimport pygame\nimport pylab\nimport helper\nimport co...
[ [ "pandas.read_csv", "numpy.clip", "matplotlib.backends.backend_agg.FigureCanvasAgg", "numpy.arange", "numpy.array" ] ]
Animadversio/FloodFillNetwork-Notes
[ "c4d207e53db1c2befc79fbc0ef0451d6f877c868" ]
[ "run_inference_script.py" ]
[ "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed...
[ [ "scipy.special.expit", "numpy.unique", "tensorflow.gfile.Exists", "tensorflow.gfile.MakeDirs", "numpy.sum" ] ]
yanghr/Hoyer_MNIST
[ "2a50da067ba10f2fc783624f448fb5ca91914ff6" ]
[ "mnist/CNN/prun_tune_T.py" ]
[ "import argparse\nimport os\n\nimport numpy as np\nimport scipy.io as sio\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\nfrom tqdm import tqdm\n\nfrom net.models import LeNet_5 as LeNet\nimport util\n\nos.makedirs('sa...
[ [ "torch.cuda.manual_seed", "torch.load", "torch.nn.functional.nll_loss", "torch.manual_seed", "torch.from_numpy", "torch.no_grad", "torch.cuda.is_available", "torch.device", "numpy.where" ] ]
MittalNeha/vision_pytorch
[ "886e4e19d2ddf0d03f5fefdfd001ff6dd67560ac" ]
[ "utils/gradcam.py" ]
[ "import matplotlib.cm as cm\r\nimport numpy as np\r\nimport torch\r\nimport torch.nn.functional as F\r\n\r\n\r\nclass GradCAM():\r\n '''Implementation for Grad-CAM\r\n Steps:\r\n - Load a pre-trained model\r\n - Load an image that can be processed by this model (224x224 for VGG16 why?)\r\n ...
[ [ "torch.nn.functional.adaptive_avg_pool2d", "torch.nn.functional.relu", "torch.mul", "torch.nn.functional.interpolate", "numpy.transpose", "matplotlib.cm.jet" ] ]
arjunsavel/astroML
[ "d378ca41565d1aa39997191d13d46d09d104ff1d" ]
[ "examples/datasets/plot_sdss_specgals.py" ]
[ "\"\"\"\nSDSS Spectroscopic Galaxy Sample\n--------------------------------\nThis figure shows photometric colors of the SDSS spectroscopic galaxy\nsample.\n\"\"\"\n# Author: Jake VanderPlas <vanderplas@astro.washington.edu>\n# License: BSD\n# The figure is an example from astroML: see http://astroML.github.com\n...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.scatter", "numpy.linspace", "matplotlib.pyplot.ylim", "matplotlib.pyplot.axes", "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
mikalst/MFClassifier
[ "f12dd17764817871cab0b34e309124a880475e2d" ]
[ "mfclassifier/utils/saving.py" ]
[ "import json\nimport numpy as np\nimport os\n\n\ndef save_ridge(\n parameters_simulate_ordinal,\n parameters_simulate_mask,\n parameters_algorithm,\n X_ordinal,\n X_float,\n X_masked,\n ridge,\n out\n):\n percentage_nonzero = X_masked.count_nonzero(\n ) / (X_masked.shape[0] * X_masked....
[ [ "numpy.sum", "numpy.abs", "numpy.save" ] ]
aliciawyy/notebooks
[ "7f9c73f39e86e2178a428de184c88b74d22bcf81" ]
[ "plot_compare_reduction.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\"\"\"\n=================================================================\nSelecting dimensionality reduction with Pipeline and GridSearchCV\n=================================================================\n\nThis example constructs a pipeline that does dimensionality\...
[ [ "matplotlib.pyplot.legend", "sklearn.model_selection.GridSearchCV", "sklearn.decomposition.NMF", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "sklearn.feature_selection.SelectKBest", "matplotlib.pyplot.ylabel", "sklearn.datasets.load_digits", "matplotlib.pyplot.bar", ...
Shengqiang-Zhang/self-attentive-parser
[ "493f74c7acab9824d593f55d231754c5ac7cbb26" ]
[ "src/main.py" ]
[ "import argparse\nimport itertools\nimport os.path\nimport time\n\nimport torch\nimport torch.optim.lr_scheduler\n\nimport numpy as np\n\nimport evaluate\nimport trees\nimport vocabulary\nimport nkutil\nimport parse_nk\n\ntokens = parse_nk\n\n\ndef torch_load(load_path):\n if parse_nk.use_cuda:\n return t...
[ [ "torch.optim.Adam", "torch.optim.lr_scheduler.ReduceLROnPlateau", "numpy.random.seed", "torch.load", "torch.manual_seed", "numpy.random.shuffle", "torch.nn.utils.clip_grad_norm_", "numpy.random.randint" ] ]
alawami/MARL
[ "bd0b9a1ebf660f4949825c3869b464255ce9d70f" ]
[ "MADDPG/maddpg.py" ]
[ "# main code that contains the neural network setup\n# policy + critic updates\n# see ddpg.py for other details in the network\n\nfrom ddpg import DDPGAgent\nimport torch\nfrom utilities import soft_update, transpose_to_tensor, transpose_list\nfrom utilities import to_tensor\nfrom utilities import print_variable\n\...
[ [ "torch.stack", "torch.clamp", "torch.no_grad", "torch.cat" ] ]
dschmitz89/simplenlopt
[ "238000f6f799a2275b1b155046b3740ab5f23014" ]
[ "simplenlopt/_Global_Optimization.py" ]
[ "from simplenlopt._Core import set_auto_maxeval, minimize, is_gradient_based, generate_nlopt_objective, setup_optimizer, normalize_bounds, execute_optimization\nimport numpy as np\n\ndef random_initial_point(lower, upper):\n '''\n Pick one random point from hyperrectangle with uniform probability\n '''\n ...
[ [ "numpy.asarray" ] ]
benwmcdowell/VASP_add_selective_dynamics
[ "bb4dfb5f72de51018e9a57f25a3441a3362a7799" ]
[ "add_seldyn.py" ]
[ "from numpy import array,dot\r\nfrom numpy.linalg import inv,norm\r\nfrom getopt import getopt\r\nimport sys\r\n\r\ndef add_seldyn(mode, ifile, ofile,reverse, **args):\r\n try:\r\n lv, coord, atomtypes, atomnums, seldyn = parse_poscar(ifile)\r\n except ValueError:\r\n lv, coord, atomtypes, atomn...
[ [ "numpy.linalg.inv", "numpy.dot", "numpy.array", "numpy.linalg.norm" ] ]
sushant-tech/ga-learner-dsmp-repo
[ "aa40705fd5ac079c656c7c1cb2853a541f7d0447" ]
[ "Topic-Modelling-with-News-headlines/code.py" ]
[ "# --------------\n# import libraries\nimport numpy as np\nimport pandas as pd\nimport re\n\n# Load data\ndata=pd.read_csv(path,parse_dates=[0],infer_datetime_format=True)\n\n# Sort headlines by date of publish\ndata.sort_values('publish_date',inplace=True)\n\n# Retain only alphabets\ndata['headline_text'].apply(la...
[ [ "sklearn.decomposition.TruncatedSVD", "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.pyplot.plot", "sklearn.feature_extraction.text.CountVectorizer", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "numpy.sum", "matplotlib.pyplo...
chinchay/graphene-oxide
[ "6da0cc8eb951415e71e8c169f868ee9141186c2e" ]
[ "mtp_2D_7l/randomsurface/r23.py" ]
[ "import generate as gn\nimport randomSurface as rs\nfrom timeit import default_timer as timer\n\n\nstart = timer()\n\nlistA, listE = rs.getCurvesNotHighlyOrdrd(xlim=[14.0, 20.0], nLines=17, nRepeat=51)\n\nend = timer()\n\n#print(end - start)\nf = open(\"timeittook2\", \"w\")\nf.write( \"time = \" + str( end - start...
[ [ "numpy.asarray", "numpy.savetxt" ] ]
iisadoramacedo/geofem-master
[ "cc5cf4ae660480dd4dc3d805310f7207fb28230e" ]
[ "geofem/emg3d/meshes.py" ]
[ "\"\"\"\n\n:mod:`meshes` -- Discretization\n===============================\n\nEverything related to meshes appropriate for the multigrid solver.\n\n\"\"\"\n# Copyright 2018-2020 The emg3d Developers.\n#\n# This file is part of emg3d.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may n...
[ [ "numpy.nanmax", "numpy.sqrt", "numpy.squeeze", "numpy.nanmin", "numpy.cumsum", "numpy.max", "numpy.argmin", "numpy.clip", "numpy.unique", "numpy.arange", "numpy.ceil", "numpy.diff", "numpy.zeros", "numpy.isclose", "scipy.optimize.fsolve", "numpy.floo...
jms0923/mmdet_tta
[ "8d4c298d615c07302ae668346c46c6bfd93a11bd" ]
[ "predict_utils.py" ]
[ " \nfrom abc import ABCMeta, abstractmethod\nfrom collections import OrderedDict\nfrom random import randint\n\nimport cv2\nimport mmcv\nimport numpy as np\nimport os\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\nfrom mmcv.runner import auto_fp16\nfrom mmcv.utils import print_log\nfrom mm...
[ [ "numpy.random.seed", "numpy.ascontiguousarray", "numpy.full", "numpy.concatenate", "numpy.delete", "numpy.where", "numpy.vstack", "numpy.random.randint" ] ]
1069066484/datasci_prj4
[ "8ff02e4b571bb3f166b2e94a7e4477afd8ac935c" ]
[ "HKMM.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon May 13 22:29:48 2019\n\n@author: 12709\n\n-- Zhixin Ling modified. 2019/5/17. \n Adding example codes to evaluate training and test accuracies and domain adaptation improvement.\n\"\"\"\n\nimport numpy as np\nimport sklearn.metrics\nfrom cvxopt import matrix, solv...
[ [ "numpy.sqrt", "numpy.asarray", "numpy.eye", "numpy.ones", "sklearn.svm.SVC", "sklearn.svm.LinearSVC", "numpy.array", "numpy.zeros" ] ]
zimmerman-cole/rbm-lai
[ "6bea9187988d99879d53ac3994d2efad1807eef4" ]
[ "src/lai.py" ]
[ "\"\"\"\nLocal ancestry inference.\n\"\"\"\nimport numpy as np\nimport itertools\nfrom collections import namedtuple\n\nimport matplotlib.pyplot as plt\n\ndef compute_window_accuracies(imputations, H_valid, window_size, save_path=None, hooks=list()):\n \"\"\"\n TODO: doc\n \n Args:\n ================...
[ [ "numpy.zeros", "numpy.where" ] ]
jonah-chen/alphazero-guerzhoy
[ "9e45994d8fc687001bb98caefa2f89a7b4707ea1" ]
[ "8x8/ai.py" ]
[ "\"\"\"Constructs the Neural Network described in D. Silver et. al. Mastering the game of Go without human knowldege, Nature 550, 354-359(2017) doi:10.1038/nature24270.\n\nAuthor(s): Jonah Chen, Muhammad Ahsan Kaleem\n\"\"\"\n\nfrom concurrent.futures import ProcessPoolExecutor\n\nimport numpy as np\nimport tensorf...
[ [ "tensorflow.keras.models.load_model", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.ReLU", "numpy.rot90", "tensorflow.keras.regularizers.l2", "tensorflow.keras.optimizers.SGD", "tensorflow.keras.Model", "tensorflow.keras...
archaeo-pteryx/montepython_public
[ "6fbcaa3266fd3a10a8e3ed4190dc65e6f29f1a37" ]
[ "montepython/likelihoods/Pantheon/__init__.py" ]
[ "\"\"\"\n.. module:: Pantheon\n :synopsis: Pantheon likelihood from Jones et al. 2018 and Scolnic et al. 2018\n\n.. moduleauthor:: Rodrigo von Marttens <rodrigovonmarttens@gmail.com> and Antonella Cid <antonellacidm@gmail.com>\n\nBased on the previous JLA likelihood writted by Benjamin Audren\n\n.. code::\n\n ...
[ [ "numpy.diag", "numpy.log10", "scipy.linalg.cholesky", "scipy.linalg.solve_triangular", "numpy.empty" ] ]
haven-ai/optimization-benchmark
[ "7dd7c01b7e39d1ae4bcd365c6f854598d32867da" ]
[ "src/optimizers/__init__.py" ]
[ "import numpy as np\n# from . import sls\nfrom . import others\nfrom . import adaptive_first, adaptive_second\nimport torch\nfrom src.optimizers import sls, sps, ssn, sls_acc, sls_eg\n\n\ndef get_optimizer(opt, params, train_loader, exp_dict):\n \"\"\"\n opt: name or dict\n params: model parameters\n n_...
[ [ "torch.optim.RMSprop", "torch.optim.Adam", "torch.optim.Adagrad", "torch.optim.SGD" ] ]
jrcyyzb/yolox-
[ "46d7656874daf4121552a1d1d925c827f27e598a" ]
[ "RoYOLOX/mmdet/datasets/pipelines/loading.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport os.path as osp\n\nimport mmcv\nimport numpy as np\nimport pycocotools.mask as maskUtils\n\nfrom mmdet.core import BitmapMasks, PolygonMasks\nfrom ..builder import PIPELINES\n\ntry:\n from panopticapi.utils import rgb2id\nexcept ImportError:\n rgb2id = N...
[ [ "numpy.stack", "numpy.ones", "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.where" ] ]
tqtifnypmb/ML
[ "dfcc6f849b1d5ee2efd0faa0f585091fc7263a6c" ]
[ "rebuild_wheel/MLP/Gradient_Methods.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\nfrom sklearn import datasets\nfrom sklearn import metrics\nfrom sklearn import neural_network\nfrom sklearn import preprocessing\nfrom math import floor, sqrt\n\nclass MLP:\n def __init__(self, \n learning_rate,\n gradient_type, \n ...
[ [ "tensorflow.zeros", "tensorflow.reduce_sum", "numpy.max", "numpy.mean", "tensorflow.train.AdamOptimizer", "tensorflow.group", "numpy.hstack", "tensorflow.Variable", "tensorflow.gradients", "tensorflow.losses.softmax_cross_entropy", "numpy.argmax", "tensorflow.add", ...
Luigii1506/machine-learning-udemy-courses
[ "29ffde26ce1a17e37fe13cbea7ce9909ff4ca682" ]
[ "Classification/Naive-bayes/naive_bayes.py" ]
[ "# Classification template\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the dataset\ndataset = pd.read_csv('Social_Network_Ads.csv')\nX = dataset.iloc[:, [2, 3]].values\ny = dataset.iloc[:, 4].values\n\n# Splitting the dataset into the Trainin...
[ [ "matplotlib.pyplot.legend", "sklearn.cross_validation.train_test_split", "pandas.read_csv", "sklearn.naive_bayes.GaussianNB", "matplotlib.pyplot.title", "numpy.unique", "sklearn.metrics.confusion_matrix", "matplotlib.colors.ListedColormap", "matplotlib.pyplot.xlabel", "skle...
ranOutaNames/pandas
[ "fea6799dba6657393ff34deab21aae05538f4985" ]
[ "pandas/core/window/rolling.py" ]
[ "\"\"\"\nProvide a generic structure to support window functions,\nsimilar to how we have a Groupby object.\n\"\"\"\nfrom __future__ import annotations\n\nimport copy\nfrom datetime import timedelta\nfrom functools import partial\nimport inspect\nfrom textwrap import dedent\nfrom typing import (\n TYPE_CHECKING,...
[ [ "pandas.Series", "pandas.core.window.numba_.generate_numba_table_func", "pandas.core.window.indexers.FixedWindowIndexer", "pandas.core.dtypes.missing.notna", "numpy.concatenate", "pandas.compat.numpy.function.validate_rolling_func", "pandas.core.apply.ResamplerWindowApply", "pandas...
pgunn/ffn
[ "8d9e7a34feb3829338561b8875146b7308d3d793" ]
[ "ffn/utils/bounding_box.py" ]
[ "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed...
[ [ "numpy.maximum", "numpy.minimum", "numpy.all", "numpy.any", "numpy.ravel_multi_index", "numpy.array", "numpy.unravel_index" ] ]
justkj7/capstone
[ "f458b6624b8aa75961a0ab78e9847355022940d3" ]
[ "tapas/run_task_main.py" ]
[ "# coding=utf-8\n# Copyright 2019 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
[ [ "tensorflow.compat.v1.estimator.tpu.TPUEstimator", "tensorflow.compat.v1.io.gfile.exists", "tensorflow.compat.v1.config.experimental.list_physical_devices", "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.test.is_gpu_available", "tensorflow.compat.v1.estimator.tpu.TPUConf...
annierak/odor_tracking_sim
[ "4600a7be942666c3a5a0f366dab6d14838f332a0" ]
[ "odor_tracking_sim/simulation_running_tools.py" ]
[ "import time\nimport scipy\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animate\nimport matplotlib\n# matplotlib.use(\"Agg\")\nimport cPickle as pickle\nimport sys\nimport itertools\n\nimport odor_tracking_sim.wind_models as wind_models\nimport odor_tracking_sim.odor_models as odor_models\nimpor...
[ [ "matplotlib.pyplot.gca", "scipy.random.vonmises", "matplotlib.pyplot.scatter", "scipy.zeros", "scipy.radians", "scipy.full", "matplotlib.pyplot.subplot", "scipy.stats.uniform", "scipy.cos", "scipy.sin", "scipy.array", "scipy.stats.vonmises", "matplotlib.pyplot.i...
spencer-hong/unilm
[ "4f2b9016789217b565e5a4fd40f2e31dbe83623a" ]
[ "layoutlm/deprecated/layoutlm/modeling/layoutlm.py" ]
[ "import logging\n\nimport torch\nfrom torch import nn\nfrom torch.nn import CrossEntropyLoss, MSELoss\nfrom transformers import BertConfig, BertModel, BertPreTrainedModel\n# from transformers.modeling_bert import BertLayerNorm\n\nlogger = logging.getLogger(__name__)\n\nLAYOUTLM_PRETRAINED_MODEL_ARCHIVE_MAP = {}\n\n...
[ [ "torch.nn.MSELoss", "torch.nn.Dropout", "torch.nn.CrossEntropyLoss", "torch.zeros_like", "torch.nn.Embedding", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.arange", "torch.ones_like" ] ]
j-Myles/2300-LEED-Project
[ "c8a99c811c4c6e5f2b1b565e5b0d3e9721b70dd1" ]
[ "src/proj/usgbc/table.py" ]
[ "import matplotlib.pyplot as plt\nimport math\n\ndef show(dataframe):\n\n fig = plt.figure(figsize=(10, 5))\n ax = fig.add_subplot(111)\n\n ax.set_title('LEED Buildings by City')\n ax.xaxis.set_visible(False)\n ax.yaxis.set_visible(False)\n\n lbls = ('City', 'Count')\n\n cells = dataframe.value...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
lanl/PsDNS
[ "2fcb12d52e522906c93d7a28e5397cae81feb376" ]
[ "psdns/tests/test_dns.py" ]
[ "\"\"\"Tests of the DNS solver\n\nDirect-numerical simulation (DNS) of the incompressible Navier-Stokes\nequation is the key capability of PsDNS. This module contains tests\nof the DNS solver.\n\"\"\"\nimport numpy\nfrom numpy import testing as nptest\n\nfrom psdns import *\nfrom psdns.equations.navier_stokes impo...
[ [ "numpy.array", "numpy.interp" ] ]
VladimirYugay/PIFu
[ "8f80e7ee539098e53c419a518f6f180dbdec97c5" ]
[ "lib/colab_util.py" ]
[ "import io\nimport os\nimport torch\nfrom skimage.io import imread\nimport numpy as np\nimport cv2\nfrom tqdm import tqdm_notebook as tqdm\nimport base64\nfrom IPython.display import HTML\n\n# Util function for loading meshes\nfrom pytorch3d.io import load_objs_as_meshes\n\nfrom IPython.display import HTML\nfrom ba...
[ [ "torch.cuda.set_device", "torch.from_numpy", "numpy.concatenate", "torch.device", "numpy.array", "torch.ones_like" ] ]
alestolfo/jiant
[ "31efcd3b54ec4d84403854b1a4ce321a2792b503" ]
[ "jiant/tasks/evaluate/core.py" ]
[ "import itertools\nimport json\n\nfrom dataclasses import dataclass\n\nimport numpy as np\nimport pandas as pd\nimport seqeval.metrics as seqeval_metrics\nimport torch\n\nfrom scipy.stats import pearsonr\nfrom scipy.stats import spearmanr\nfrom sklearn.metrics import f1_score\nfrom sklearn.metrics import matthews_c...
[ [ "numpy.arange", "numpy.squeeze", "sklearn.metrics.matthews_corrcoef", "scipy.stats.pearsonr", "pandas.DataFrame", "numpy.stack", "numpy.concatenate", "numpy.argmax", "numpy.mean", "torch.cuda.is_available", "numpy.exp", "scipy.stats.spearmanr", "sklearn.metrics....
CODEJIN/PWGAN_for_HiFiSinger
[ "9c7b0b62e8624180897a791db1517676f2012c5d" ]
[ "Train.py" ]
[ "import os\nos.environ['FOR_DISABLE_CONSOLE_CTRL_HANDLER'] = 'T' # This is ot prevent to be called Fortran Ctrl+C crash in Windows.\nimport torch\nimport numpy as np\nimport logging, yaml, sys, argparse, math\nfrom tqdm import tqdm\nfrom collections import defaultdict\nimport matplotlib\nmatplotlib.use('agg')\ni...
[ [ "matplotlib.pyplot.imshow", "torch.load", "matplotlib.pyplot.plot", "torch.no_grad", "torch.cuda.is_available", "torch.device", "matplotlib.pyplot.subplot2grid", "matplotlib.pyplot.tight_layout", "torch.utils.data.DistributedSampler", "numpy.clip", "matplotlib.pyplot.cl...
rguo12/pytorch-ntm
[ "d08291fac4dccaa3c8d081bad06802d9e4d737ea" ]
[ "ntm/head.py" ]
[ "\"\"\"NTM Read/Write Head.\"\"\"\nimport torch\nfrom torch import nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport numpy as np\n\n\ndef _split_cols(mat, lengths):\n \"\"\"Split a 2D matrix to variable length columns.\"\"\"\n assert mat.size()[1] == sum(lengths), \"Lengths must...
[ [ "torch.zeros", "numpy.cumsum", "torch.nn.functional.sigmoid", "torch.nn.functional.relu", "torch.nn.init.xavier_uniform", "torch.nn.init.normal" ] ]
greycubesgav/tensorflow-2-style-transfer
[ "87d5b88543b68064c33a6411a42ae1fd84708394" ]
[ "utils.py" ]
[ "# MIT License\n#\n# Copyright (c) 2019 Drew Szurko\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 rights\n# to use, copy, m...
[ [ "tensorflow.shape", "tensorflow.cast", "tensorflow.image.resize", "tensorflow.image.decode_image", "tensorflow.image.convert_image_dtype", "tensorflow.io.read_file", "tensorflow.io.write_file" ] ]
freekang/m_hydra_nn
[ "7cbdb6f43fe1f02d712e6c803c770bd961140048" ]
[ "src/models/mnist_module.py" ]
[ "from typing import Any, List\n\nimport torch\nfrom pytorch_lightning import LightningModule\nfrom torchmetrics import MaxMetric\nfrom torchmetrics.classification.accuracy import Accuracy\n\nfrom src.models.components.simple_dense_net import SimpleDenseNet\n\n\nclass MNISTLitModule(LightningModule):\n \"\"\"\n ...
[ [ "torch.nn.CrossEntropyLoss", "torch.argmax" ] ]
PrivacyAmp/cardinality_estimation_evaluation_framework
[ "c6f16733f821bba99c1e5ca827025a063f5689ae" ]
[ "src/simulations/frequency_set_generator.py" ]
[ "# Copyright 2020 The Private Cardinality Estimation Framework 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# Un...
[ [ "numpy.arange", "numpy.log", "numpy.exp", "numpy.minimum" ] ]
aneeshnaik/HernquistFlows
[ "7f81f9b47297b115ae6b593593aac59afafc48b3" ]
[ "figures/fig2_derivs.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nFigure 2: Gradients of isotropic Hernquist DF and reconstructions.\n\nCreated: May 2021\nAuthor: A. P. Naik\n\"\"\"\nimport numpy as np\nimport sys\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import SymLogNorm\nfrom os.path import exists\n\nsys....
[ [ "numpy.savez", "numpy.sqrt", "numpy.linspace", "matplotlib.colors.SymLogNorm", "numpy.stack", "matplotlib.pyplot.colorbar", "numpy.zeros_like", "numpy.errstate", "numpy.load", "numpy.array", "numpy.meshgrid", "numpy.divide", "matplotlib.pyplot.figure" ] ]
theonov13/pyscf
[ "490a20d406b33c5d168ae4152d5422cff516b3ea" ]
[ "pyscf/lib/gto/test/test_gridao.py" ]
[ "#!/usr/bin/env python\n# Copyright 2014-2018 The PySCF Developers. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LIC...
[ [ "numpy.swapaxes", "numpy.random.random", "numpy.random.seed", "numpy.asarray", "numpy.ndarray", "numpy.ones", "numpy.zeros" ] ]
fabienbaradel/object_level_visual_reasoning
[ "f504715c2ea9464e8dd4076584c30ab34937de22" ]
[ "loader/videodataset.py" ]
[ "from __future__ import print_function\nimport torch\nimport torch.utils.data as data\nfrom torchvision import transforms\nimport os\nimport random\nfrom PIL import Image\nimport numpy as np\nimport ipdb\nimport pickle\nfrom pycocotools import mask as maskUtils\nimport lintel\nimport time\nfrom torch.utils.data.dat...
[ [ "numpy.clip", "numpy.asarray", "torch.from_numpy", "numpy.stack", "numpy.frombuffer", "numpy.float32", "numpy.array", "numpy.zeros", "numpy.sum", "torch.nn.functional.pad", "torch.utils.data.dataloader.default_collate" ] ]
hb-jones/rp1-ros
[ "afc2888f5da7a2b4cc6d9e07ce017f26996e58c3" ]
[ "src/ueye_sample.py" ]
[ "#===========================================================================#\r\n# #\r\n# Copyright (C) 2006 - 2018 #\r\n# IDS Imaging Development Systems GmbH ...
[ [ "numpy.reshape" ] ]
xiaoyu-liu/Titanic
[ "2551aa59ca8a46227aede777d31b70a0da962cbb" ]
[ "DataCleaning.py" ]
[ "##------------------- Import Packages -------------------------\n##-------------------------------------------------------------\n\n# Basic packages for database and for scientific computing\nimport os\nimport pandas as pd\nimport numpy as np\n# import random as rnd\n\n# Visualization tool\nimport seaborn as sns\n...
[ [ "pandas.read_csv", "pandas.qcut", "pandas.DataFrame" ] ]
checko/caffe-jacinto-models
[ "b224970200f36fc6d07d3f40348f2565bcb1b522" ]
[ "scripts/tools/utils/infer_segmentation.py" ]
[ "#!/usr/bin/env python\n\nfrom __future__ import print_function\n\nimport sys\nimport numpy as np\nimport os, glob\nimport cv2\nimport caffe\n#import lmdb\nfrom PIL import Image\nimport argparse\nimport random\nimport shutil\nimport imageio\nimport math\n\ndef get_arguments():\n parser = argparse.ArgumentParser(...
[ [ "numpy.uint8", "numpy.array", "numpy.where", "numpy.sum", "numpy.zeros" ] ]
seabay/fairseq-py-mine
[ "641f1d3a492164f07de66a0bc75abd4fdb2e71a0" ]
[ "fairseq/models/fconv.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n#\n\nimport math\nimport...
[ [ "torch.nn.functional.glu", "torch.nn.functional.dropout", "torch.nn.utils.weight_norm", "torch.nn.ModuleList", "torch.nn.Embedding", "torch.nn.Linear", "torch.arange" ] ]
StatNLP/discretezoo
[ "565552b894a5c9632ac7b949d61a6f71123031e4" ]
[ "textattack/constraints/grammaticality/language_models/google_language_model/alzantot_goog_lm.py" ]
[ "\"\"\"\n\nGoogle Language Models from Alzantot\n--------------------------------------\n\n Author: Moustafa Alzantot (malzantot@ucla.edu)\n All rights reserved.\n\"\"\"\n\nimport os\n\nimport lru\nimport numpy as np\n\nfrom textattack.shared import utils\n\nfrom . import lm_data_utils, lm_utils\n\ntf = utils...
[ [ "numpy.array", "numpy.zeros", "numpy.ones" ] ]
jayceyxc/YAD2K
[ "973cc74b0340f8ffa2d8e5c9d2c28700dddb15aa" ]
[ "train_overfit.py" ]
[ "#! /usr/bin/env python\n\"\"\"Overfit a YOLO_v2 model to a single image from the Pascal VOC dataset.\n\nThis is a sample training script used to test the implementation of the\nYOLO localization loss function.\n\"\"\"\nimport argparse\nimport io\nimport os\n\nimport h5py\nimport matplotlib.pyplot as plt\nimport nu...
[ [ "matplotlib.pyplot.imshow", "numpy.expand_dims", "tensorflow.device", "matplotlib.pyplot.savefig", "numpy.concatenate", "numpy.array", "numpy.where", "matplotlib.pyplot.show" ] ]
Mktan-18/collab
[ "6f0e3a0bf5b4be72985d02d33b15a23c685b963b" ]
[ "official/nlp/bert/run_squad.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.train.latest_checkpoint", "tensorflow.reduce_mean", "tensorflow.train.Checkpoint", "tensorflow.keras.mixed_precision.experimental.set_policy", "tensorflow.io.gfile.GFile", "tensorflow.keras.backend.sparse_categorical_crossentropy", "tensorflow.version.VERSION.startswith", ...
dianna-ai/dianna
[ "88bcaec001e640c35e5e1e08517ef1624fd661cb" ]
[ "dianna/methods/shap.py" ]
[ "import numpy as np\n\n\nclass SHAP:\n \"\"\"\n SHAP implementation based on captum https://github.com/pytorch/captum\n \"\"\"\n def __init__(self, shap_arg_1=0, shap_arg_2=0):\n \"\"\"\n Example constructor for testing.\n \"\"\"\n self.shap_arg_1 = shap_arg_1\n self.s...
[ [ "numpy.zeros" ] ]
RTXteam/kgx
[ "902ad8e9ac9069616ded61c8a5a7a61c4467335c" ]
[ "kgx/pandas_transformer.py" ]
[ "import logging\nimport tarfile\nfrom tempfile import TemporaryFile\nfrom typing import List, Dict\n\nimport numpy as np\nimport pandas as pd\n\nfrom kgx.transformer import Transformer\nfrom kgx.utils import make_path\n\nLIST_DELIMITER = '|'\n\n_column_types = {\n 'publications': list,\n 'qualifiers': list,\n...
[ [ "pandas.DataFrame.from_records", "pandas.read_csv" ] ]
bjodah/finitediff
[ "bfb1940cf5c7ce5c9a3b440d1efd8f8c4128fed8" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport io\nimport os\nimport pprint\nimport re\nimport shutil\nimport subprocess\nimport sys\nimport warnings\n\nfrom setuptools import setup\n\ntry:\n import cython\nexcept ImportError:\n _HAVE_CYTHON = False\nelse:\n _HAVE_CYTHON = True\n assert cytho...
[ [ "numpy.get_include" ] ]
WayneDW/Interacting-Contour-Stochastic-Gradient-Langevin-Dynamics
[ "ecc073572d283895cf2629faf5522d83b23da1e3" ]
[ "mnist_energy_exploration/tools/uncertainty_test.py" ]
[ "#!/usr/bin/python\n\nimport math\nimport copy\nimport sys\nimport os\nimport timeit\nimport csv\nimport argparse\nfrom tqdm import tqdm ## better progressbar\nfrom math import exp\nfrom sys import getsizeof\nimport numpy as np\nimport random\nimport pickle\n## import pytorch modules\nimport torch\nfrom torch.autog...
[ [ "torch.nn.Softmax", "torch.mean", "torch.cuda.set_device", "torch.load", "torch.set_printoptions", "torch.utils.data.DataLoader", "torch.log", "torch.nn.functional.one_hot", "torch.autograd.Variable" ] ]
prashantas/MyOwnR
[ "8db4f288b30840161c6422bde7c7a7770f85c09d" ]
[ "DeepNetwork/ImpNotes.py" ]
[ "#TO understand ImgeDataGenerator see https://www.youtube.com/watch?v=OUMDUq5OJLg&t=3297s from 25 mins\n\n#########################################################################################################################\n#### https://www.youtube.com/watch?v=yX8KuPZCAMo # Very Good Link from Edur...
[ [ "tensorflow.Variable", "tensorflow.reduce_sum", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.train.GradientDescentOptimizer", "tensorflow.square", "tensorflow.Session" ] ]