repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
stevenwudi/CarND-Traffic-Sign-Classifier-Project
[ "78d7392317b8d01b8ce968328960b269f64403c9" ]
[ "test_single.py" ]
[ "# The followings are the DenseNets module, the training was actually taken place in the `run_dense_net.py` file.\n# Sorry, I really like Pycharm (and to be fair, Pytorch is so much an easier language to debug)\nimport os\nos.environ['CUDA_VISIBLE_DEVICES'] = '2'\nfrom models import DenseNet\nfrom data_providers.ut...
[ [ "numpy.array", "numpy.zeros", "matplotlib.pyplot.Subplot", "tensorflow.reset_default_graph", "matplotlib.pyplot.figure", "numpy.argmax", "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.gridspec.GridSpec" ] ]
ianpan870102/neural-network-on-finance-data
[ "b032a869e9f6ea662c9e299259a200346eb76bb4" ]
[ "midprice_profit_label/profit_evaluate/data_generate.py" ]
[ "import psycopg2, psycopg2.extras\nimport time\nimport numpy as np\nimport pandas as pd\n\nfrom datetime import timedelta, date\n\n\ndef date_range(start_date, end_date):\n for n in range(int((end_date - start_date).days)):\n yield start_date + timedelta(n)\n\n\ndef generate_by_month():\n conn = psycopg2.conne...
[ [ "numpy.save" ] ]
lilohuang/TensorBox
[ "7c25a6db1a997ce072965488649b664bc4a4858c" ]
[ "evaluate.py" ]
[ "import tensorflow as tf\nimport os\nimport json\nimport subprocess\nfrom scipy.misc import imread, imresize\nfrom scipy import misc\n\nfrom train import build_forward\nfrom utils.annolist import AnnotationLib as al\nfrom utils.train_utils import add_rectangles, rescale_boxes\n\nimport cv2\nimport argparse\n\ndef g...
[ [ "tensorflow.expand_dims", "tensorflow.Session", "tensorflow.reset_default_graph", "tensorflow.train.Saver", "scipy.misc.imresize", "tensorflow.reshape", "scipy.misc.imread", "tensorflow.placeholder", "scipy.misc.imsave", "tensorflow.global_variables_initializer" ] ]
bill-teng/mxnet-test
[ "39a2c0cff1be8b8277b2e0a8c55214acc186a49c" ]
[ "example/warpctc/ocr_predict.py" ]
[ "#!/usr/bin/env python2.7\n# coding=utf-8\nfrom __future__ import print_function\nimport sys, os\ncurr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))\nsys.path.append(\"../../amalgamation/python/\")\nsys.path.append(\"../../python/\")\n\nfrom mxnet_predict import Predictor\nimport mxnet as mx...
[ [ "numpy.multiply", "numpy.argsort" ] ]
duncanmmacleod/nestcheck
[ "09dbaee638bd8689dfe64b438a36f7167fcf724c" ]
[ "nestcheck/estimators.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nFunctions for estimating quantities from nested sampling runs.\nEach estimator function should have arguments:\n\n.. code-block:: python\n\n def estimator_func(self, ns_run, logw=None, simulate=False):\n ...\n\nAny additional arguments required for the function should be ke...
[ [ "scipy.special.logsumexp", "numpy.sum", "numpy.interp", "numpy.argsort", "numpy.cumsum" ] ]
dukebw/rethinking-network-pruning
[ "5486af65530f61e6688e542f1f2f13dbebf88e69", "5486af65530f61e6688e542f1f2f13dbebf88e69" ]
[ "cifar/weight-level/utils/visualize.py", "cifar/l1-norm-pruning/res56prune.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torchvision\nimport torchvision.transforms as transforms\n\nfrom .misc import * \n\n\n__all__ = ['make_image', 'show_batch', 'show_mask', 'show_mask_single']\n\n# functions to show an image\ndef make_image(img, mea...
[ [ "torch.add", "torch.unsqueeze", "numpy.transpose", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow", "matplotlib.pyplot.axis", "matplotlib.pyplot.subplot" ], [ "torch.zeros", "numpy.sum", "torch.no_grad", "torch.ones", "numpy.resize", "torch.cuda.is_avai...
Toby-SZZ/STDC-Seg
[ "9273e03b02241fda107962bfc7bd366310a8d23b" ]
[ "train.py" ]
[ "#!/usr/bin/python\n# -*- encoding: utf-8 -*-\nfrom logger import setup_logger\nfrom models.model_stages import BiSeNet\nfrom cityscapes import CityScapes\nfrom loss.loss import OhemCELoss\nfrom loss.detail_loss import DetailAggregateLoss\nfrom evaluation import MscEvalV0\nfrom optimizer_loss import Optimizer\n\nim...
[ [ "torch.save", "torch.no_grad", "torch.nn.parallel.DistributedDataParallel", "torch.cuda.device_count", "torch.cuda.set_device", "torch.squeeze", "torch.utils.data.DataLoader", "torch.utils.data.distributed.DistributedSampler", "torch.load", "torch.distributed.get_rank" ] ...
Algorithmic-Alignment-Lab/openTAMP-legacy
[ "eecb950bd273da8cbed4394487630e8453f2c242", "eecb950bd273da8cbed4394487630e8453f2c242", "eecb950bd273da8cbed4394487630e8453f2c242" ]
[ "opentamp/src/core/util_classes/no_openrave_body.py", "opentamp/src/core/util_classes/backup_namo_predicates.py", "opentamp/src/policy_hooks/namo/spread_prob3.py" ]
[ "import numpy as np\nfrom math import cos, sin, atan2\nfrom errors_exceptions import OpenRAVEException\nfrom openravepy import quatFromAxisAngle, matrixFromPose, poseFromMatrix, \\\naxisAngleFromRotationMatrix, KinBody, GeometryType, RaveCreateRobot, \\\nRaveCreateKinBody, TriMesh, Environment, DOFAffine, IkParamet...
[ [ "numpy.array", "numpy.matrix", "numpy.dot", "numpy.isnan", "numpy.eye", "numpy.ndarray", "numpy.sqrt" ], [ "numpy.concatenate", "numpy.random.normal", "numpy.array", "numpy.linalg.norm", "numpy.random.choice", "numpy.random.rand", "numpy.zeros", "num...
jedgedrudd/PyBaMM
[ "79c9d34978382d50e09adaf8bf74c8fa4723f759" ]
[ "pybamm/spatial_methods/spatial_method.py" ]
[ "#\n# A general spatial method class\n#\nimport pybamm\nimport numpy as np\nfrom scipy.sparse import eye, kron, coo_matrix, csr_matrix\n\n\nclass SpatialMethod:\n \"\"\"\n A general spatial methods class, with default (trivial) behaviour for some spatial\n operations.\n All spatial methods will follow t...
[ [ "scipy.sparse.coo_matrix", "numpy.ones", "scipy.sparse.eye" ] ]
aragilar/astroML
[ "d3f6279eb632957662338761cb559a1dcd541fb0", "d3f6279eb632957662338761cb559a1dcd541fb0" ]
[ "astroML/density_estimation/tests/test_empirical.py", "astroML_fig_tests/test.py" ]
[ "import numpy as np\nfrom numpy.testing import assert_allclose\nfrom scipy.stats import norm\nfrom astroML.density_estimation import\\\n EmpiricalDistribution, FunctionDistribution\n\n\ndef test_empirical_distribution(N=1000, rseed=0):\n np.random.seed(rseed)\n X = norm.rvs(0, 1, size=N)\n dist = Empiri...
[ [ "numpy.random.seed", "scipy.stats.norm.rvs", "scipy.stats.norm", "numpy.sqrt" ], [ "matplotlib.use", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.rc", "matplotlib.pyplot.get_fignums", "matplotlib.testing.noseclasses.ImageComparisonFailure" ] ]
SuzukiDaichi-git/ai_edge_contest
[ "9fc62503dc755da33d7ffa6f85862964dba1c8d5" ]
[ "train/eval.py" ]
[ "#!/usr/bin/env python3\n# encoding: utf-8\nimport os\nimport cv2\ncv2.setNumThreads(0)\nimport numpy as np\n\nfrom utils.visualize import print_iou, show_img, show_prediction\nfrom engine.evaluator import Evaluator\nfrom engine.logger import get_logger\nfrom seg_opr.metric import hist_info, compute_score\n\nlogger...
[ [ "numpy.swapaxes", "numpy.zeros" ] ]
meyerd/brewPipe
[ "48f20ccd3ac7cefb899164407de3cd61ce17000a" ]
[ "brewPipe/preprocess/numpy_null.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport numpy as np\nfrom ..pipelineState import PipelineStateInterface\nfrom ..data import BrewPipeDataFrame\n\n__author__ = 'Dominik Meyer <meyerd@mytum.de>'\n\n\nclass NumpyNullPreprocessor(PipelineStateInterface):\n \"\"\"\n This is an example c...
[ [ "numpy.load", "numpy.save" ] ]
pcuenca/Real-ESRGAN
[ "9ff1944d06e9d7fe86c68bbf1a244cff403f064e" ]
[ "tests/test_utils.py" ]
[ "import numpy as np\nfrom basicsr.archs.rrdbnet_arch import RRDBNet\n\nfrom realesrgan.utils import RealESRGANer\n\n\ndef test_realesrganer():\n # initialize with default model\n restorer = RealESRGANer(\n scale=4,\n model_path='experiments/pretrained_models/RealESRGAN_x4plus.pth',\n mode...
[ [ "numpy.random.random" ] ]
AmineAitLemqeddem/sdia-python
[ "1990e6244b25a2204684e3498110cf54fa829a3e" ]
[ "src/lab2/box_window.py" ]
[ "import numpy as np\n\nfrom lab2.utils import get_random_number_generator\n\n\n# todo clean up the docstrings\nclass BoxWindow:\n \"\"\"[summary]BoxWindow class representing a virtual n-dimensional bounded Box\"\"\"\n\n def __init__(self, args):\n \"\"\"[summary]Initialization of Box's parameters\n\n ...
[ [ "numpy.linalg.norm", "numpy.sqrt", "numpy.mean" ] ]
anton-pershin/restools
[ "eb141f0989617db796d106de1b0824161ccaa0aa" ]
[ "papers/jfm2022_optimizing_control_bayesian_method/views/sketches.py" ]
[ "import os\nimport sys\nsys.path.append(os.getcwd())\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import beta\n\nfrom restools.plotting import rasterise_and_save\nfrom papers.jfm2020_probabilistic_protocol.data import Summary as SummaryProbProto\nfrom papers.jfm2020_probabilistic_protoco...
[ [ "scipy.stats.beta.pdf", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "scipy.stats.beta.mean", "scipy.stats.beta.ppf", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.style.use", "matplotlib.pyplot.show", "numpy.linspace", "matplotlib.pyplot.table" ] ]
Kleptobismol/scikit-bio
[ "3df95446558273034b884852f2b7bf6a1872f66d", "3df95446558273034b884852f2b7bf6a1872f66d" ]
[ "skbio/stats/ordination/_correspondence_analysis.py", "skbio/diversity/alpha/_lladser.py" ]
[ "# ----------------------------------------------------------------------------\n# Copyright (c) 2013--, scikit-bio development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n# ---------------------------------...
[ [ "numpy.outer", "numpy.sqrt", "numpy.asarray", "numpy.linalg.svd" ], [ "numpy.random.gamma", "numpy.arange", "numpy.random.shuffle" ] ]
nadiahpk/niche-neutral-riau-birds
[ "83eeba57973d6912ad354592c84a03b5c24b3363" ]
[ "scripts/summary_plots_stats/plot_tuned_area_v_m.py" ]
[ "# plot how the fitted m for the tuned model varies with island size\n\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n\n# parameters\n# ---\n\n# which parameter set and archipelagos to sample\nsubset_name = 'survey_only'\nsuffix = '_3'\nrho = 1700\n\n# where results are stored\ndir_plot = '../../results/s...
[ [ "matplotlib.pyplot.xscale", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter", "pandas.read_csv", "matplotlib.pyplot.yscale" ] ]
gwanglee/OpenUnReID
[ "fa12430c5a4020c3d065edde21c9d1986c77afe3" ]
[ "tools/UDA_TP/main.py" ]
[ "import argparse\nimport shutil\nimport sys\nimport time\nfrom datetime import timedelta\nfrom pathlib import Path\n\nimport torch\n\nfrom openunreid.apis import BaseRunner, test_reid\nfrom openunreid.core.solvers import build_lr_scheduler, build_optimizer\nfrom openunreid.data import build_test_dataloader, build_t...
[ [ "torch.nn.parallel.DistributedDataParallel", "torch.nn.DataParallel" ] ]
Saloed/PythonGenerator
[ "f567bbb007cc858d4e7be410d668fba680b07933" ]
[ "model/rnn_with_dropout.py" ]
[ "import tensorflow as tf\nfrom current_net_conf import *\n\n\nclass RnnDropoutPlaceholders:\n probability = tf.placeholder(tf.float32, [])\n\n @staticmethod\n def feed(prob=1.0):\n return {RnnDropoutPlaceholders.probability: prob}\n\n\nclass MultiRnnWithDropout(tf.nn.rnn_cell.DropoutWrapper):\n\n ...
[ [ "tensorflow.zeros", "tensorflow.nn.rnn_cell.GRUCell", "tensorflow.placeholder", "tensorflow.nn.rnn_cell.MultiRNNCell", "tensorflow.nn.rnn_cell.DropoutWrapper" ] ]
josh146/OpenFermion
[ "e64c17a8043b2ad0a60695b581293bf903ad91a3" ]
[ "src/openfermion/ops/_binary_code.py" ]
[ "# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software...
[ [ "scipy.sparse.bmat", "scipy.sparse.csc_matrix", "numpy.shape", "scipy.sparse.identity", "numpy.arange" ] ]
meteorspectroscopy/meteor-spectrum-calibration
[ "483335eda2776f73c95d08cfa40a63fafb037d5c" ]
[ "myselect.py" ]
[ "import numpy as np\r\nfrom skimage import io as ios\r\nimport PySimpleGUI as sg\r\nimport warnings\r\n\r\nimport m_specfun as m_fun\r\n\r\n\r\ndef select_lines(infile, contrast, lines, res_dict, fits_dict, wloc, outfil):\r\n \"\"\"\r\n displays new window with image infile + start + 'fit\r\n a rectangle a...
[ [ "numpy.max", "numpy.array", "numpy.float16", "numpy.log", "numpy.zeros", "numpy.sum", "numpy.flipud", "numpy.float32", "numpy.abs", "numpy.clip" ] ]
Carreau/phd-dissertation
[ "f283cf3819af019027a4e017141ec51029a0e46c", "f283cf3819af019027a4e017141ec51029a0e46c" ]
[ "src/systemidentification/control_parameters_vs_speed_plots.py", "src/control/publication_historgram.py" ]
[ "import numpy as np\nfrom scipy.optimize import curve_fit\nimport matplotlib.pyplot as plt\n\nfrom load_rider_id_results import df\n\n# Plot parameters for Latex output\nparams = {'backend': 'ps',\n 'axes.labelsize': 10,\n 'text.fontsize': 10,\n 'legend.fontsize': 8,\n 'xtick.lab...
[ [ "matplotlib.pyplot.rcParams.update", "numpy.isnan", "matplotlib.pyplot.subplots", "numpy.sqrt", "numpy.linspace" ], [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.hist", "matplotlib.pyplot.gcf", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
dmsm/DeepParametricShapes
[ "2e0de365191b29c61796f7cd6cbd2bdf631eae2c" ]
[ "dps_3d/interfaces.py" ]
[ "import string\n\nimport numpy as np\nimport torch as th\n\nfrom ttools.training import ModelInterface\n\nfrom . import utils\n\n\nclass VectorizerInterface(ModelInterface):\n def __init__(self, model, lr, n_primitives, canvas_size, w_surface, w_alignment, csg, rounded, cuda=True):\n self.model = model\n ...
[ [ "torch.sum", "torch.cat", "torch.mean", "torch.max" ] ]
raufbhat-dev/Deep-Neural-Net-Numpy
[ "db347057c0763945b5a4852128b99cc64cc562a4" ]
[ "neuralnetnumpy/neuralnet.py" ]
[ "import numpy as np\n\nfrom neuralnetnumpy import layer, optimiser, loss\n\nclass NeuralNet:\n def __init__(self, loss_func, optimiser_method, learning_rate, epoch, partition_size, mode, network_arch):\n self.loss_func = loss_func\n self.optimiser = optimiser_method\n self.epoch_count = epoc...
[ [ "numpy.multiply", "numpy.sum", "numpy.matmul", "numpy.array_split" ] ]
dineshsonachalam/deeplearning4nlp-tutorial
[ "2a36ecc39f13b683752483546441468fd7d734b3" ]
[ "2017-07_Seminar/Session 3 - Relation CNN/code/preprocess.py" ]
[ "\"\"\"\nThe file preprocesses the files/train.txt and files/test.txt files.\n\nI requires the dependency based embeddings by Levy et al.. Download them from his website and change \nthe embeddingsPath variable in the script to point to the unzipped deps.words file.\n\"\"\"\nfrom __future__ import print_function\ni...
[ [ "numpy.array", "numpy.zeros" ] ]
Houchaoqun/ALiPy
[ "93aff0379db2a1994803d19026c434c2b12a2485" ]
[ "alipy/query_strategy/noisy_oracles.py" ]
[ "\"\"\"\nPre-defined query strategy for noisy oracles.\n\nIn reality, the labels given by human is not always correct. For one hand,\nthere are some inevitable noise comes from the instrumentation of experimental\nsetting. On the other hand, people can become distracted or fatigued over time,\nintroducing variabili...
[ [ "numpy.max", "numpy.asarray", "numpy.sum", "numpy.shape", "numpy.mean", "numpy.nonzero", "numpy.std", "sklearn.linear_model.LogisticRegression", "numpy.argmax", "numpy.sqrt", "numpy.partition", "sklearn.neighbors.NearestNeighbors" ] ]
mattrogers1124/imagebot
[ "ed788c9dda85222b47e3b41ac2c4bfd50942cfd8" ]
[ "imagebot/imagebot.py" ]
[ "import os\nimport pandas\nimport numpy as np\nfrom numpy.random import default_rng\nimport cv2\nfrom time import time_ns\nfrom datetime import datetime, timedelta\nfrom PIL import Image\n\n\nclass Imagebot:\n\n def __init__(self, queue=\"./queue\", sourcedir=\"./source\", index=\"index.csv\",\n ...
[ [ "numpy.round", "pandas.read_csv", "numpy.arange", "numpy.random.default_rng" ] ]
gbzan/algotom
[ "314f05b6a226e666a8ae4417b151d896606e7db4", "314f05b6a226e666a8ae4417b151d896606e7db4" ]
[ "tests/test_prep/test_filtering.py", "tests/test_prep/test_calculation.py" ]
[ "# ============================================================================\n# ============================================================================\n# Copyright (c) 2021 Nghia T. Vo. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file...
[ [ "numpy.random.rand", "scipy.ndimage.rotate", "numpy.zeros", "scipy.ndimage.gaussian_filter", "numpy.mean", "numpy.float32", "numpy.abs" ], [ "numpy.max", "numpy.pad", "numpy.random.rand", "scipy.ndimage.rotate", "numpy.zeros", "scipy.ndimage.shift", "num...
mingyuan-zhang/mmhuman3d
[ "0cb3236af31f968115c4316ee15686269d0bfe6c", "0cb3236af31f968115c4316ee15686269d0bfe6c" ]
[ "mmhuman3d/core/visualization/renderer/torch3d_renderer/render_runner.py", "mmhuman3d/core/visualization/renderer/torch3d_renderer/segmentation_renderer.py" ]
[ "import math\nimport os\nfrom pathlib import Path\nfrom typing import Iterable, Union\n\nimport mmcv\nimport torch\nfrom pytorch3d.structures.meshes import Meshes\nfrom tqdm import trange\n\nimport mmhuman3d\nfrom mmhuman3d.core.cameras import compute_orbit_cameras\nfrom mmhuman3d.core.conventions.cameras import co...
[ [ "torch.cat", "torch.no_grad" ], [ "torch.zeros", "torch.cat" ] ]
voidrank/SaccadeNet
[ "b24266c15a4fe999a0f1447e2ada127fe0bc136f" ]
[ "src/compare_tool.py" ]
[ "import os\nimport pickle\nimport argparse\nimport numpy as np\nfrom numpy import array as npa\n\nfrom IPython import embed\n\ndef create_argparse():\n parser = argparse.ArgumentParser(description='compare')\n parser.add_argument('src', type=str)\n parser.add_argument('dst', type=str)\n parser.add_argum...
[ [ "numpy.array" ] ]
leaderj1001/Bag-of-MLP
[ "cfd9483245278a1814d55a4edc812663d436476e" ]
[ "model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass MLP(nn.Module):\n def __init__(self, dims, multiplxer=4):\n super(MLP, self).__init__()\n hidden = int(dims * multiplxer)\n\n self.out = nn.Sequential(\n nn.Linear(dims, hidden),\n nn.GELU(...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.LayerNorm", "torch.nn.ModuleList", "torch.nn.Softmax", "torch.nn.Conv1d", "torch.nn.functional.gelu", "torch.bmm", "torch.ones", "torch.nn.AdaptiveAvgPool1d", "torch.nn.Conv2d", "torch.nn.GELU", "torch.randn", "tor...
vkirilenko/FEDOT
[ "d287d899e47fe5aebf52c12733892e103b75842b" ]
[ "test/unit/data_operations/test_data_operation_params.py" ]
[ "import os\n\nimport numpy as np\nimport pandas as pd\n\nfrom fedot.core.data.data import InputData\nfrom fedot.core.pipelines.node import PrimaryNode, SecondaryNode\nfrom fedot.core.pipelines.pipeline import Pipeline\nfrom fedot.core.repository.dataset_types import DataTypesEnum\nfrom fedot.core.repository.tasks i...
[ [ "numpy.array", "pandas.read_csv" ] ]
michel4j/auto-process
[ "9c011cef3cdc2fc55df31f9cac88c3e1074aa366" ]
[ "autoprocess/utils/ellipse.py" ]
[ "# !/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Project: Azimuthal integration\n# https://github.com/silx-kit/pyFAI\n#\n# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France\n#\n# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)\n#\n# Permission is here...
[ [ "numpy.dot", "numpy.ones_like", "numpy.zeros", "numpy.arctan2", "numpy.abs", "numpy.sqrt", "numpy.linalg.inv" ] ]
anandsaha/cs231n.assignments
[ "d3a2d3a624bbc6335545a13508b28e977c8421c8" ]
[ "2016winter/assignment2/cs231n/fast_layers.py" ]
[ "import numpy as np\ntry:\n from cs231n.im2col_cython import col2im_cython, im2col_cython\n from cs231n.im2col_cython import col2im_6d_cython\nexcept ImportError:\n print ('run the following from the cs231n directory and try again:')\n print ('python setup.py build_ext --inplace')\n print ('You may also need t...
[ [ "numpy.pad", "numpy.lib.stride_tricks.as_strided", "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.broadcast_arrays", "numpy.ascontiguousarray", "numpy.sum", "numpy.argmax", "numpy.arange" ] ]
ZAKAUDD/Segmentation-Networks
[ "7e006809a7345819ebc50326175df156beeca618" ]
[ "model/FSSNet.py" ]
[ "######################################################################################\n#FSSNet: Fast Semantic Segmentation for Scene Perception\n#Paper-Link: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8392426\n######################################################################################\n\n...
[ [ "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.functional.interpolate", "torch.nn.ConvTranspose2d", "torch.add", "torch.nn.Conv2d", "torch.cuda.is_available", "torch.nn.Dropout2d" ] ]
princeward/faster_rcnn_pytorch
[ "7ffb31afc3de10085a655a03282ab7d1e6002d87" ]
[ "demo.py" ]
[ "import cv2\nimport numpy as np\nfrom faster_rcnn import network\nfrom faster_rcnn.faster_rcnn import FasterRCNN\nfrom faster_rcnn.utils.timer import Timer\n\n\ndef test():\n import os\n im_file = 'demo/004545.jpg'\n # im_file = 'data/VOCdevkit2007/VOC2007/JPEGImages/009036.jpg'\n # im_file = '/media/lo...
[ [ "numpy.copy" ] ]
MajesticKhan/Reinforcement-Learning
[ "c488e547afe571b47446be76abf6f5c80e8e6be5" ]
[ "Simulation/play.py" ]
[ "from env import lineFollower\nfrom stable_baselines import PPO2\nimport imageio\nimport numpy as np\n\n# Load separate environment for evaluation\nenv = lineFollower()\n\n# load model\nmodel = PPO2.load(\"model_final.zip\")\n\n# Store image\nimages = []\n\n# Set environment and get image\nobs = env.reset()\nima...
[ [ "numpy.array" ] ]
edwardyehuang/iDS
[ "36bde3a9e887eb7e1a8d88956cf041909ee84da4" ]
[ "cocostuff.py" ]
[ "# ================================================================\n# MIT License\n# Copyright (c) 2021 edwardyehuang (https://github.com/edwardyehuang)\n# ================================================================\n\nimport os\nimport tensorflow as tf\nimport numpy as np\nimport random\n\nINAGE_DIR = \"imag...
[ [ "numpy.array" ] ]
tginart/competing-ai
[ "75c456854e4770adf8be7cd56e58177d50f74a24" ]
[ "user.py" ]
[ "from abc import ABC, abstractmethod\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass mab_user(ABC):\n def __init__(self, n_arms, lamb=1):\n super(mab_user, self).__init__()\n self.t = torch.tensor(1.0)\n self.r = torch.zeros(n_arms)\n se...
[ [ "torch.zeros", "torch.ceil", "torch.tensor", "torch.log", "torch.randn" ] ]
dcf21/4most-4gp
[ "0421d76791315aa3ca8ff9e4bd2e37ad36c0141f" ]
[ "src/pythonModules/fourgp_rv/fourgp_rv/templates_resample.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\nCode to take template spectra, used for RV fitting, and pass them through 4FS to resample them to 4MOST's resolution.\nIt then further resamples each arm onto a fixed logarithmic stride.\n\"\"\"\n\nimport argparse\nimport hashlib\nimport logging\nimport numpy as np\nimport os\nfr...
[ [ "numpy.isnan", "numpy.isfinite", "numpy.log" ] ]
liz-is/clodius
[ "aa31b3d90a5a9fec883c20cab31ad4d347cd52cd" ]
[ "clodius/tiles/bigwig.py" ]
[ "import bbi\nimport clodius.tiles.format as hgfo\nimport functools as ft\nimport logging\nimport numpy as np\nimport pandas as pd\nimport re\n\nfrom concurrent.futures import ThreadPoolExecutor\n\nMAX_THREADS = 4\nTILE_SIZE = 1024\n\nlogger = logging.getLogger(__name__)\n\naggregation_modes = {}\naggregation_modes[...
[ [ "numpy.concatenate", "numpy.ceil", "numpy.zeros", "pandas.Series", "numpy.cumsum", "numpy.searchsorted", "numpy.log2" ] ]
dreiss/glow
[ "54c7625053bfb14955c4402ab8d9bca85195d53c", "54c7625053bfb14955c4402ab8d9bca85195d53c" ]
[ "torch_glow/tests/functionality/randomize_constants_test.py", "torch_glow/tests/nodes/upsample_test.py" ]
[ "# isort:skip_file\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport unittest\n\nimport torch_glow\nfrom torch_glow import InputMeta, CompilationOptions, GlowCompileSpec\nimport torch\n\n\nclass Model(torch.nn.Module):\n def __init__(self):\n super(Model, self)....
[ [ "torch.nn.Linear", "torch.allclose", "torch.randn", "torch.jit.trace" ], [ "torch.nn.Upsample", "torch.rand" ] ]
gbstack/PaddleDetection
[ "1a8dd826d7c35f2967ea04cf533d827cc9c80a42" ]
[ "ppdet/modeling/post_process.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.where", "numpy.array", "numpy.zeros" ] ]
kmwebnet/Audio-Effect-replicator-nnabla
[ "fc2724735f4d95b7d539e8035a698fa041695492" ]
[ "predict.py" ]
[ "import os\nfrom argparse import ArgumentParser\nfrom time import time\nimport yaml\nimport numpy as np\nfrom fx_replicator import (\n build_model, load_wave, save_wave, sliding_window, LossFunc\n)\nimport nnabla as nn\n#import nnabla_ext.cudnn\nimport nnabla.functions as F\nimport nnabla.parametric_functions as...
[ [ "numpy.zeros_like", "numpy.zeros" ] ]
congnb/mypython
[ "893b3390b8d6cf803b8ae15bf5331e74e6faf04a" ]
[ "ml.py" ]
[ "import numpy\nimport matplotlib.pyplot as plt\nimport threading\nimport multiprocessing\nfrom scipy import stats\n\nclass TestHist:\n def hist(self, parameter_list):\n x = numpy.random.uniform(0.0, 5.0, 100000)\n\n plt.hist(x, 100)\n plt.show()\n\n y = numpy.random.normal(0.0, 5.0, 1...
[ [ "numpy.random.normal", "matplotlib.pyplot.plot", "scipy.stats.linregress", "matplotlib.pyplot.hist", "numpy.random.uniform", "matplotlib.pyplot.scatter", "matplotlib.pyplot.show" ] ]
shaoxin0801/scVI
[ "f439eeb7b696b01a281af2f0e2f49592318614cb" ]
[ "tests/test_scvi.py" ]
[ "import numpy as np\nimport tempfile\nimport os\nimport pytest\nimport torch\n\nfrom anndata import AnnData\n\nfrom scvi.dataset import (\n AnnDatasetFromAnnData,\n CortexDataset,\n SyntheticDataset,\n GeneExpressionDataset,\n Dataset10X,\n)\nfrom scvi.inference import (\n JointSemiSupervisedTrain...
[ [ "torch.rand", "numpy.array", "numpy.array_equal", "torch.manual_seed", "torch.randn_like", "numpy.arange", "numpy.random.randint", "torch.ones_like", "torch.randint_like" ] ]
vcristiani/galaxy-chop
[ "6a854ee8701001ab0f15d6b0112401c123d0c6b2" ]
[ "tests/conftest.py" ]
[ "# This file is part of\n# the galxy-chop project (https://github.com/vcristiani/galaxy-chop)\n# Copyright (c) 2020, Valeria Cristiani\n# License: MIT\n# Full Text: https://github.com/vcristiani/galaxy-chop/blob/master/LICENSE.txt\n\n\"\"\"Fixtures input data.\"\"\"\n\n# ============================================...
[ [ "numpy.zeros_like", "numpy.ones_like", "numpy.sin", "numpy.array", "numpy.zeros", "numpy.random.RandomState", "numpy.sum", "numpy.random.default_rng", "numpy.loadtxt", "numpy.sqrt", "numpy.cos" ] ]
mathieu-le-brun/EA-elective-NEAT
[ "71653793683bd26901f639a45179e47bf2041c37" ]
[ "domain/hyperparameters.py" ]
[ "from pprint import pprint\n\nfrom .task_gym import GymTask\nfrom .config import games\nimport json\nimport numpy as np\n\n\ndef loadHyp(pFileName, printHyp=False):\n \"\"\"Loads hyperparameters from .json file\n Args:\n pFileName - (string) - file name of hyperparameter file\n printHyp - (bool...
[ [ "numpy.full_like" ] ]
ncolomer/airflow
[ "cb7c67dea9cd9b9c5de10e355b63039446003149" ]
[ "airflow/providers/amazon/aws/transfers/mysql_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.Int64Dtype" ] ]
alessandro-santini/Tensor-Network
[ "3f3c52d61a7ea3d2ceedb03d08f40ad4d153b56e" ]
[ "tebd_floquet.py" ]
[ "import MPS_class as MPS\nimport MPO_class as MPO\nfrom ncon import ncon\nimport numpy as np\nfrom scipy.linalg import expm\n#%%\ndef TEBD_evo(MPS_,Lx,Ly,J=1,epsilon=0.1,etrunc=0,chiMAX=256,chiMAXswap=256,info=True):\n L = Lx*Ly\n config = np.arange(0,L).reshape(Lx,Ly)\n \n theta = (np.pi+2*epsilon)\n ...
[ [ "numpy.max", "numpy.array", "numpy.linalg.norm", "numpy.sin", "numpy.vectorize", "numpy.zeros", "scipy.sparse.linalg.expm_multiply", "matplotlib.pyplot.plot", "scipy.sparse.eye", "numpy.eye", "numpy.where", "numpy.arange", "numpy.abs", "numpy.cos", "nump...
laurencejbelliott/Ensemble_DL_Ransomware_Detector
[ "0cae02c2425e787a810513537a47897f3a42e5b5" ]
[ "bin-utf8-vec/truncateCorpus.py" ]
[ "__author__ = \"Laurence Elliott - 16600748\"\n\nimport os, math\nimport numpy as np\n\n# sampleLens = []\n# count = 0\n# for file in os.listdir(\"corpus\"):\n# sample = np.load(\"corpus/\" + file)\n# zeroArr = [0]\n# try:\n# zerosInSample = np.isin(sample, zeroArr)\n# zerosIndexes = np....
[ [ "numpy.max", "numpy.load", "numpy.min", "numpy.save" ] ]
ALISCIFP/mmpose
[ "5c8ba2657b26ee9487451c45ba794823fa607cfd" ]
[ "mmpose/datasets/datasets/top_down/topdown_coco_wholebody_dataset.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport os\nimport warnings\n\nimport numpy as np\nfrom mmcv import Config\nfrom xtcocotools.cocoeval import COCOeval\n\nfrom ...builder import DATASETS\nfrom .topdown_coco_dataset import TopDownCocoDataset\n\n\n@DATASETS.register_module()\nclass TopDownCocoWholeBody...
[ [ "numpy.minimum", "numpy.array", "numpy.zeros", "numpy.cumsum" ] ]
GabrielTourinho/dlnd-teach-a-quadcopter-how-to-fly
[ "6af874491752cf7d7caf6d9a5421fdb090b006f2" ]
[ "home/agents/agent.py" ]
[ "# TODO: your agent here!\n\nimport numpy as np\n\nfrom agents.actor import Actor\nfrom agents.critic import Critic\nfrom agents.buffer import ReplayBuffer\nfrom agents.ou_noise import OUNoise\n\nclass DDPG():\n \"\"\"Reinforcement Learning agent that learns using DDPG.\"\"\"\n def __init__(self, task):\n ...
[ [ "numpy.array", "numpy.reshape", "numpy.vstack" ] ]
zhangfazhan/text_clustering
[ "e867887e87c41006c4828a1313d6154c448a164a" ]
[ "Single_Pass/single_pass_cluster.py" ]
[ "# -*- coding: UTF-8 -*-\n\nimport os\nimport sys\nimport jieba\nimport json\nimport numpy as np\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.metrics.pairwise import cosine_similarity\n\nclass SinglePassCluster():\n def __init__(self, stopWords_path=\"../data/stop_words.txt\", my_st...
[ [ "numpy.array", "numpy.argmax", "sklearn.feature_extraction.text.TfidfVectorizer" ] ]
yellowdolphin/SIIM-COVID19-Detection
[ "31e8653b467ac35a8b1d92330ad5f15a12622676" ]
[ "src/detection_efffdet/predict_test.py" ]
[ "import argparse\nimport pandas as pd\nfrom tqdm import tqdm\nimport torch\nimport torch.nn.parallel\nfrom contextlib import suppress\nimport os\n\nfrom effdet import create_model, create_loader\nfrom effdet.data import resolve_input_config\nfrom timm.utils import setup_default_logging\nfrom timm.models.layers impo...
[ [ "pandas.read_csv", "torch.flip", "torch.save", "torch.no_grad" ] ]
levindabhi/SieveNet
[ "a5e2263acf28b52a551d4e139328957cf454e7e8" ]
[ "gmm.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn import init\nfrom torchvision import models\n\nimport numpy as np\n\n\ndevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n\n\ndef weights_init_normal(m):\n classname = m.__class__.__name__\n if classname.f...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.inverse", "torch.bmm", "torch.cuda.is_available", "torch.mul", "torch.nn.init.constant_", "torch.FloatTensor", "torch.nn.init.normal_", "torch.div", "torch.nn.init.xa...
araffin/aae-train-donkeycar
[ "0fb11c558271be53f1b0b9d5c85625a933367faf" ]
[ "ae/enjoy_latent.py" ]
[ "# Original code from https://github.com/araffin/robotics-rl-srl\n# Authors: Antonin Raffin, René Traoré, Ashley Hill\nimport argparse\n\nimport cv2 # pytype: disable=import-error\nimport numpy as np\n\nfrom ae.autoencoder import Autoencoder\n\n\ndef create_figure_and_sliders(name, state_dim):\n \"\"\"\n Cre...
[ [ "numpy.array" ] ]
izaid/vispy
[ "402cf95bfef88d70c9c45bb27c532ed72944e14a" ]
[ "vispy/util/tests/test_transforms.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) 2014, Vispy Development Team.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\nimport numpy as np\nfrom numpy.testing import assert_allclose\n\nfrom vispy.util.transforms import (translate, scale, rotate, ortho, frustum,\n ...
[ [ "numpy.testing.assert_allclose", "numpy.random.randn" ] ]
Faizullah877/compression
[ "82111a7ec61c3478f38c152ae7ec3fa61b21a530" ]
[ "models/hific/archs.py" ]
[ "# Copyright 2020 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.compat.v1.log", "tensorflow.compat.v1.reduce_prod", "tensorflow.compat.v1.shape", "tensorflow.compat.v1.keras.layers.Conv2DTranspose", "tensorflow.compat.v1.reduce_sum", "tensorflow.compat.v1.constant", "tensorflow.compat.v1.reshape", "tensorflow.compat.v1.keras.layers....
hnlab/can-ai-do
[ "090cbb835bdaf4af33523bd11c3e73fc7f1ed954" ]
[ "pdbbind/props_random_forest.py" ]
[ "\"\"\"A fingerprint + random forest model.\nTry to generate independent and identically distributed figerprint as decoy.\n\"\"\"\nimport os\nimport sys\nimport json\nimport argparse\nimport numpy as np\nfrom pathlib import Path\nfrom tqdm import tqdm\n\nimport scipy.sparse as sp\nfrom scipy.spatial import distance...
[ [ "matplotlib.use", "numpy.zeros_like", "numpy.array", "numpy.random.seed", "numpy.random.permutation", "numpy.eye", "sklearn.ensemble.RandomForestRegressor", "numpy.corrcoef", "numpy.hstack" ] ]
pvsnp9/audio_classification_using_deep_learning
[ "e9c5e0c81a4b331483acb4b2508843c6d4acf247" ]
[ "predict.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Mar 23 18:18:48 2020\n\n@author: tsuyogbasnet\n\"\"\"\n\nimport os\nimport sys\nimport pickle\nfrom tqdm import tqdm\nfrom scipy.io import wavfile\nfrom python_speech_features import mfcc\nfrom keras.models import load_model\nimport pandas as ...
[ [ "numpy.mean", "sklearn.metrics.accuracy_score", "numpy.argmax", "numpy.expand_dims", "pandas.read_csv", "numpy.unique" ] ]
shensheng27/py-motmetrics
[ "5055bd3e1db5377c33706d2949fced39ecd4c3dc" ]
[ "motmetrics/tests/test_mot.py" ]
[ "# py-motmetrics - Metrics for multiple object tracker (MOT) benchmarking.\n# https://github.com/cheind/py-motmetrics/\n#\n# MIT License\n# Copyright (c) 2017-2020 Christoph Heindl, Jack Valmadre and others.\n# See LICENSE file for terms.\n\n\"\"\"Tests behavior of MOTAccumulator.\"\"\"\n\nfrom __future__ import ab...
[ [ "pandas.util.testing.assert_frame_equal" ] ]
Semere-Gr/PyTorchProjectFramework
[ "c2e2e9d391060a11f9151f021adc96c27ad8a894" ]
[ "models/segmentation_model.py" ]
[ "from collections import OrderedDict\nfrom models.base_model import BaseModel\nfrom optimizers.radam import RAdam\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom sklearn.metrics import accuracy_score\nimport sys\n\nclass double_conv(nn.Module):\n def __init__(self, in_c...
[ [ "torch.cat", "torch.flatten", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.functional.interpolate", "torch.nn.CrossEntropyLoss", "sklearn.metrics.accuracy_score", "torch.nn.ReLU", "torch.cuda.empty_cache", "torch.nn.Conv2d", "t...
Dqirvin/msticpy
[ "9c9f54b755bf4f2b917f30b41ab2336caf102f3e" ]
[ "msticpy/nbtools/timeline.py" ]
[ "# -------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n# --------------------------------------------------------------------------\n...
[ [ "pandas.Timestamp" ] ]
awsl-dbq/sqlflow
[ "6684ac4b4f26774bd10e437bc52080fdbae5ce49" ]
[ "python/runtime/step/xgboost/evaluate.py" ]
[ "# Copyright 2020 The SQLFlow Authors. All rights reserved.\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 ap...
[ [ "numpy.array" ] ]
fpernice-google/data
[ "049b6c0c42364aa59af1966bc270521208cfdab7" ]
[ "scripts/world_bank/worldbank.py" ]
[ "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agr...
[ [ "pandas.isna", "pandas.merge", "pandas.DataFrame", "pandas.read_csv", "pandas.to_numeric" ] ]
super-resolution/Locan
[ "94ed7759f7d7ceddee7c7feaabff80010cfedf30" ]
[ "locan/tests/data/test_alpha_shape_2d.py" ]
[ "import numpy as np\nimport pytest\nfrom scipy.spatial import Delaunay\n\nfrom locan.data.hulls.alpha_shape_2d import _circumcircle, _half_distance\n\n\ndef test__circumcircle_2d(locdata_2d):\n points = np.array([(0, 0), (1, 1 + np.sqrt(2)), (1 + np.sqrt(2), 1)])\n center, radius = _circumcircle(points, [2, 1...
[ [ "numpy.array", "numpy.array_equal", "scipy.spatial.Delaunay", "numpy.sqrt" ] ]
AndrewWilliams3142/cmip6_preprocessing
[ "8cdd02de9fa35b373be5a66da9bc481ca3a6aaa8" ]
[ "cmip6_preprocessing/preprocessing.py" ]
[ "# Preprocessing for CMIP6 models\nimport xarray as xr\nimport pandas as pd\nimport numpy as np\nimport warnings\n\n\ndef cmip6_renaming_dict():\n \"\"\"a universal renaming dict. Keys correspond to source id (model name)\n and valuse are a dict of target name (key) and a list of variables that\n should be...
[ [ "numpy.array", "numpy.interp", "numpy.argsort", "numpy.unique", "numpy.vstack" ] ]
quanvuong/domain_randomization
[ "c0b7fdb39f20af1de5e575fde7f0f4e668e02116" ]
[ "dr/experiment/ppo_pytorch.py" ]
[ "import os\nimport os.path as osp\nimport pickle\nimport random\nfrom collections import deque\nfrom datetime import datetime\n\nimport gym\nimport numpy as np\nimport scipy.stats as stats\nimport torch\nimport torch.optim as optim\nfrom mpi4py import MPI\n\nimport dr\nfrom dr.ppo.models import Policy, ValueNet\nfr...
[ [ "numpy.concatenate", "numpy.max", "numpy.zeros_like", "numpy.ones_like", "torch.cuda.manual_seed_all", "numpy.square", "numpy.random.seed", "numpy.min", "numpy.mean", "torch.manual_seed", "torch.cuda.is_available", "numpy.sqrt", "numpy.argsort", "numpy.var" ...
ElliottP-13/opfunu
[ "7f4de3c34a91bb37fd8784fd28dbcf550e06d8a7", "7f4de3c34a91bb37fd8784fd28dbcf550e06d8a7" ]
[ "opfunu/cec/cec2005/F8.py", "opfunu/dimension_based/benchmark1d.py" ]
[ "#!/usr/bin/env python\n# ------------------------------------------------------------------------------------------------------%\n# Created by \"Thieu Nguyen\" at 15:39, 20/04/2020 %\n# ...
[ [ "numpy.sum", "numpy.dot", "numpy.cos" ], [ "numpy.sin" ] ]
MachineLearningCommunity/ML-From-Scratch
[ "09ea418e77b70aa79917bfaaeb58054353d49c5b" ]
[ "mlfromscratch/utils/data_manipulation.py" ]
[ "from __future__ import division\nfrom itertools import combinations_with_replacement\nimport numpy as np\nimport math\nimport sys\n\n\ndef shuffle_data(X, y, seed=None):\n if seed:\n np.random.seed(seed)\n n_samples = X.shape[0]\n idx = np.arange(n_samples)\n np.random.shuffle(idx)\n X = X[id...
[ [ "numpy.concatenate", "numpy.array", "numpy.linalg.norm", "numpy.empty", "numpy.random.seed", "numpy.shape", "numpy.random.shuffle", "numpy.split", "numpy.where", "numpy.prod", "numpy.arange", "numpy.amax", "numpy.append", "numpy.expand_dims" ] ]
orsdanilo/ml_from_scratch
[ "eb045c2525e5b99c2b91b7f8e19ab08b0cee2d96" ]
[ "src/models/_linear.py" ]
[ "import pandas as pd\nimport numpy as np\nimport math\nimport matplotlib.pyplot as plt\nfrom .metrics import mse_score, rmse_score, r2_score, mae_score\nfrom ..features.build_features import StandardScaler, MinMaxScaler\n\nclass LinearRegressor():\n \"\"\"Linear regressor\"\"\"\n\n def __init__(self, method='...
[ [ "numpy.dot", "numpy.zeros", "numpy.round", "matplotlib.pyplot.xlabel", "numpy.ones", "matplotlib.pyplot.ylabel" ] ]
noah95/edison
[ "652af8ed4c99c11000a6c0136d770583a5318d8e", "652af8ed4c99c11000a6c0136d770583a5318d8e" ]
[ "audio/edison/audio/bit_depth_analyze.py", "audio/edison/mfcc/mfcc_utils.py" ]
[ "import numpy as np\nfrom time import sleep\nimport struct\nimport matplotlib.pyplot as plt\n\n\n# input raw samples from MCU\n# in_data = 'out/data_raw.txt'\nin_data = 'out/8bit.txt'\nfs = 5000\nin_bits = 8\n\n# load file\nraw = np.loadtxt(in_data)\n\n# Stats\nprint(\"Max=%d Min=%d Mean=%d swing=%d %.1fbits\" % \\...
[ [ "numpy.max", "numpy.min", "scipy.io.wavfile.write", "numpy.mean", "matplotlib.pyplot.subplots", "numpy.loadtxt", "numpy.abs", "matplotlib.pyplot.show" ], [ "numpy.dot", "numpy.minimum", "tensorflow.tensordot", "tensorflow.__version__.startswith", "tensorflow...
mlbench/mlbench-benchmarks
[ "625226ad1f00f6ba93568c33268a7da57e823115", "625226ad1f00f6ba93568c33268a7da57e823115" ]
[ "tensorflow/imagerecognition/openmpi-cifar10-resnet20-all-reduce/main.py", "pytorch/nlp/language-modeling/wikitext2-lstm-all-reduce/utils/utils.py" ]
[ "r\"\"\"Distributed TensorFlow with Monitored Training Session.\n\nThis implements the 1a image recognition benchmark task, see https://mlbench.readthedocs.io/en/latest/benchmark-tasks.html#a-image-classification-resnet-cifar-10\nfor more details\n\nAdapted from official tutorial::\n\n https://www.tensorflow.org...
[ [ "tensorflow.train.SyncReplicasOptimizer", "tensorflow.GPUOptions", "tensorflow.train.Server", "tensorflow.control_dependencies", "tensorflow.trainable_variables", "tensorflow.train.ClusterSpec", "tensorflow.get_default_graph", "tensorflow.train.MomentumOptimizer", "tensorflow.G...
Minaramzey/Sauti-Africa-Market-Monitoring-DS
[ "3b132e75565a5a4c1f6a131990d1b4371fecf7f6" ]
[ "routes.py" ]
[ "import datetime\nimport numpy as np\nimport os\nimport pandas as pd\nimport psycopg2\n\nfrom dotenv import load_dotenv, find_dotenv\nfrom flask import current_app as app\nfrom flask import json, jsonify, request\n\nload_dotenv()\n\n###################################################################################...
[ [ "pandas.DataFrame" ] ]
andrevitorelli/BlendHunter
[ "64e4c97e7e0995e2d3561300dff708ca86adb380" ]
[ "blendhunter/network.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\" NETWORK\n\nThis module defines the BlendHunter class which can be used to retrain the\nnetwork or use predefined weights to make predictions on unseen data.\n\n:Author: Samuel Farrens <samuel.farrens@cea.fr>\n\n\"\"\"\n\nimport os\nimport numpy as np\nimport matplotlib.pyplot as p...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.load", "matplotlib.pyplot.title", "numpy.save", "matplotlib.pyplot.figure", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.around", "matplotlib.pyplot.subplot" ] ]
hematthi/SysSim_Plotting
[ "bc8c4708e9242102f5790af004c8d19ef1191334", "bc8c4708e9242102f5790af004c8d19ef1191334" ]
[ "examples/plot_kepler_catalog/plot_observed_kepler.py", "src/functions_compute_RVs.py" ]
[ "# To import required modules:\nimport numpy as np\nimport time\nimport os\nimport sys\nimport matplotlib\nimport matplotlib.cm as cm #for color maps\nimport matplotlib.pyplot as plt\nfrom matplotlib.gridspec import GridSpec #for specifying plot attributes\nfrom matplotlib import ticker #for setting contour plots t...
[ [ "matplotlib.pyplot.xlim", "numpy.min", "matplotlib.pyplot.xticks", "matplotlib.pyplot.minorticks_off", "numpy.max", "matplotlib.pyplot.savefig", "numpy.sqrt", "matplotlib.pyplot.gca", "numpy.log10", "numpy.nanmedian", "matplotlib.pyplot.subplot", "numpy.array", ...
hassan-alhujhoj/ENEL420-GA-DSP
[ "e550300bc671950f27909b499d440446a325326d", "e550300bc671950f27909b499d440446a325326d", "e550300bc671950f27909b499d440446a325326d", "e550300bc671950f27909b499d440446a325326d" ]
[ "src/.history/DSP_main_20201014012000.py", "src/.history/DSP_main_20201015183927.py", "src/.history/DSP_main_20201013235435.py", "src/.history/DSP_main_20201015175156.py" ]
[ "\"\"\"\r\nGenetic Algorithms for Digital Signal Processing\r\nCreated on Mon Oct 05 20:01:05 2020\r\nLast Edited on Mon Oct 12 2020 by Luke Trenberth\r\nTODO tidy up this code and to finalise it. Add up the third FIR filter method in here too.\r\n\"\"\"\r\nfrom os import major\r\nimport numpy as np\r\nimport matp...
[ [ "numpy.max", "scipy.signal.firwin", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "scipy.signal.remez", "matplotlib.pyplot.figure", "scipy.fftpack.fft", "scipy.signal.lfilter", ...
kernelmachine/quality-filter
[ "a462657a0ae1cc04b38cea73cba58de1e79a9a42" ]
[ "lr/hyperparameters.py" ]
[ "from typing import Any, Dict, List, Union\nimport numpy as np\nimport logging\nimport os\n\n# Create a custom logger\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.DEBUG)\n\n\n\nclass RandomSearch:\n\n @staticmethod\n def random_choice(args: List[Any], n: int = 1):\n \"\"\"\n pi...
[ [ "numpy.random.randint", "numpy.random.uniform", "numpy.random.choice", "numpy.log" ] ]
SpikeyCNS/spikey
[ "03a49073491974eff01bc017fd8eadb822e13f0d" ]
[ "unit_tests/test_input.py" ]
[ "\"\"\"\nTests for snn.Input.\n\"\"\"\nimport unittest\nfrom unittest import mock\nfrom unit_tests import ModuleTest\nimport numpy as np\nfrom spikey.snn import input\n\n\nN_STATES = 10\nPROCESSING_TIME = 100\n\nstate_rate_map = np.arange(N_STATES) / N_STATES\nstate_spike_map = np.random.uniform(\n (N_STATES, PR...
[ [ "numpy.array", "numpy.random.uniform", "numpy.arange" ] ]
duennbart/masterthesis_VAE
[ "1a161bc5c234acc0a021d84cde8cd69e784174e1" ]
[ "general/utilTF1/dataset.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport multiprocessing\nfrom functools import partial\nimport tensorflow as tf\nimport tensorflow.contrib.eager as tfe\n\nfrom general.utilTF1.utils import session\nfrom general.kneeOsteoarthritisDatas...
[ [ "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.read_file", "tensorflow.executing_eagerly", "tensorflow.image.decode_png", "tensorflow.contrib.eager.Iterator", "tensorflow.contrib.data.batch_and_drop_remainder", "tensorflow.image.resize_images", "tensorflow.cast" ] ]
caiovini/Image_reader_api
[ "afc60aac989f1fed827e9cf8f7df0c0c05c67885" ]
[ "venv/Lib/site-packages/tensorflow/python/ops/gen_user_ops.py" ]
[ "\"\"\"Python wrappers around TensorFlow ops.\n\nThis file is MACHINE GENERATED! Do not edit.\n\"\"\"\n\nimport collections as _collections\nimport six as _six\n\nfrom tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow\nfrom tensorflow.python.eager import context as _context\nfrom tensorflow.python.ea...
[ [ "tensorflow.python.eager.context.context", "tensorflow.python.eager.execute.record_gradient", "tensorflow.python.eager.execute.execute", "tensorflow.core.framework.op_def_pb2.OpList", "tensorflow.python.pywrap_tensorflow.TFE_Py_FastPathExecute", "tensorflow.python.framework.op_def_library....
gagdiez/WPI_WMQL_t
[ "2dfcf37edaa579757d3cdca5357d5ee31c9fb1fc" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\nfrom distutils.core import setup\n\nDISTNAME = 'tract_querier'\nDESCRIPTION = \\\n 'WMQL: Query language for automatic tract extraction from '\\\n 'full-brain tractographies with '\\\n 'a registered template on top of them'\nLONG_DESCRIPTION = open('README.md').read()\nMAINTAINER = ...
[ [ "numpy.distutils.misc_util.Configuration" ] ]
nbei/mmgeneration
[ "12811a03ff2a77672b423e95b7a5180b6a4f5344" ]
[ "apps/stylegan_projector.py" ]
[ "r\"\"\"\n This app is used to invert the styleGAN series synthesis network. We find\n the matching latent vector w for given images so that we can manipulate\n images in the latent feature space.\n Ref: https://github.com/rosinality/stylegan2-pytorch/blob/master/projector.py # noqa\n\"\"\"\nimport argp...
[ [ "torch.roll", "torch.stack", "torch.no_grad", "torch.optim.Adam", "torch.nn.functional.mse_loss", "torch.randn_like", "numpy.cos", "torch.randn" ] ]
tak-ka3/radio-news-make
[ "c80e64d2c56b08136fa510b72be199de27b6cbbe" ]
[ "gpt2-transform.py" ]
[ "import json\nimport os\nimport numpy as np\nimport tensorflow.compat.v1 as tf\nimport argparse\nfrom tqdm import tqdm\nimport model\nfrom encode_bpe import BPEEncoder_ja\n\nif int(tf.__version__[0]) > 1:\n from model import HParams as HParams\nelse:\n from tensorflow.contrib.training import HParams\n\nparser...
[ [ "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.Graph", "tensorflow.compat.v1.train.Saver", "tensorflow.compat.v1.ConfigProto", "tensorflow.contrib.training.HParams", "tensorflow.compat.v1.train.latest_checkpoint" ] ]
mpolson64/Ax-1
[ "cf9e12cc1253efe0fc893f2620e99337e0927a26", "cf9e12cc1253efe0fc893f2620e99337e0927a26" ]
[ "ax/modelbridge/transforms/power_transform_y.py", "ax/core/tests/test_observation.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Meta Platforms, Inc. and 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\nfrom __future__ import annotations\n\nfrom collections import defaultdict\nfrom typing import TYPE_CHECKIN...
[ [ "numpy.array", "sklearn.preprocessing.PowerTransformer" ], [ "numpy.array", "numpy.array_equal", "numpy.set_printoptions", "pandas.DataFrame", "pandas.Timestamp", "numpy.diag", "numpy.datetime64" ] ]
simonjayhawkins/fletcher
[ "b8e541f2bfb8973c4290698f0c576d62980a0ce4", "b8e541f2bfb8973c4290698f0c576d62980a0ce4" ]
[ "tests/test_pandas_extension.py", "tests/test_numba_integration.py" ]
[ "import datetime\nimport string\nfrom collections import namedtuple\nfrom distutils.version import LooseVersion\nfrom random import choices\nfrom typing import Optional, Type\n\nimport numpy as np\nimport pandas as pd\nimport pyarrow as pa\nimport pytest\nfrom pandas.tests.extension.base import (\n BaseArithmeti...
[ [ "pandas.tests.extension.base.BaseMethodsTests.test_argmin_argmax", "pandas.tests.extension.base.BaseSetitemTests.test_setitem_slice", "pandas.tests.extension.base.BaseMethodsTests.test_combine_add", "pandas.tests.extension.base.BaseSetitemTests.test_setitem_mask_boolean_array_with_na", "pandas...
DariusTorabian/image-classifier
[ "9a19dd97ecd6c4c4b0d4c35317df0f5c377fb434" ]
[ "src/predict.py" ]
[ "'''\nThis module has all relevant functions to make predictions using a previously\ntrained model.\n'''\nimport os\nimport numpy as np\nimport tensorflow.keras as keras\nfrom tensorflow.keras.preprocessing import image\nfrom tensorflow.keras.models import load_model\nimport cv2\n\nmodel = load_model('../models/app...
[ [ "tensorflow.keras.models.load_model", "numpy.float32", "numpy.amax" ] ]
hit-thusz-RookieCJ/FullSubNet-plus
[ "a6c89083cd083e729ca3def9a291743e8c3b516b" ]
[ "speech_enhance/fullsubnet/inferencer/inferencer.py" ]
[ "import torch\nimport time\n\nfrom audio_zen.acoustics.feature import mag_phase\nfrom audio_zen.acoustics.mask import decompress_cIRM\nfrom audio_zen.inferencer.base_inferencer import BaseInferencer\n\n# for log\nfrom utils.logger import log\nprint=log\n\ndef cumulative_norm(input):\n eps = 1e-10\n device = i...
[ [ "torch.zeros", "torch.rand", "torch.cat", "torch.stack", "torch.arange", "torch.square", "torch.hann_window", "torch.no_grad", "torch.sum", "torch.abs", "torch.squeeze", "torch.tensor", "torch.log", "torch.cumsum" ] ]
ujwalk93/models
[ "c08fe7a6c4d58a536167d6e4e5dfb6875c7bd6b5" ]
[ "official/vision/image_classification/common.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.keras.callbacks.TensorBoard", "tensorflow.compat.v1.name_scope", "tensorflow.compat.v1.get_default_graph", "tensorflow.python.keras.optimizer_v2.gradient_descent.SGD", "tensorflow.random.uniform", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.executing_eagerly",...
V-ea/ssd.pytorch.v1
[ "00a706cc5172dd8af2a07d02d28dc1934b767035" ]
[ "ssd.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom layers import *\nfrom data import voc, coco, sixray\nimport os\n\n\nclass SSD(nn.Module):\n \"\"\"Single Shot Multibox Architecture\n The network is composed of a base VGG network followed by the\n...
[ [ "torch.nn.Softmax", "torch.nn.ModuleList", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.load" ] ]
hyqus/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020
[ "319eeed3c2608a24f367fc95d36e0099a41725c6" ]
[ "env/env_stocktrading.py" ]
[ "import os\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom gym.utils import seeding\r\nimport gym\r\nfrom gym import spaces\r\nimport matplotlib\r\nmatplotlib.use('Agg')\r\nimport matplotlib.pyplot as plt\r\nimport pickle\r\nfrom stable_baselines3.common.vec_env import DummyVecEnv, SubprocVecEnv\r\nfrom stable...
[ [ "matplotlib.use", "numpy.array", "pandas.DataFrame", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "numpy.where", "numpy.argsort" ] ]
chiffa/BioFlow
[ "2cfee5cc57ccfb75e13f73efd7835978c2fff8ea" ]
[ "bioflow/algorithms_bank/sampling_policies.py" ]
[ "\"\"\"\nThis module defines the policies that will be used in order to sample the information flow\npatterns to compare with.\n\nThe general approach is a function that takes in any eventual parameters and outputs a list of\npairs of DB_Ids for which the flow will be calculated.\n\"\"\"\nimport random\nimport hash...
[ [ "numpy.max", "numpy.histogram", "numpy.choice", "numpy.array", "numpy.ones_like", "numpy.log", "numpy.sum", "numpy.exp", "numpy.random.shuffle", "numpy.random.uniform", "numpy.arange", "numpy.linspace" ] ]
eublefar/flowtron
[ "fe14d3a725b68a22e8e431c6674b2a9cb78b87d6" ]
[ "inference.py" ]
[ "###############################################################################\n#\n# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\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...
[ [ "matplotlib.use", "torch.cat", "torch.cuda.manual_seed", "torch.no_grad", "matplotlib.pylab.close", "torch.manual_seed", "matplotlib.pylab.subplots", "torch.load", "numpy.abs", "torch.cuda.FloatTensor" ] ]
hhain/sdap17
[ "8bd0b4cb60d6140141c834ffcac8835a888a0949" ]
[ "notebooks/pawel_ueb2/utility.py" ]
[ "## utility functions\r\n## including: labelling, annotation, continuous borders\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n\r\n## create labels\r\ndef generate_class_label(data):\r\n \"\"\"\r\n generates class label on a copy of data using the columns\r\n State,...
[ [ "matplotlib.pyplot.annotate" ] ]
andrewnc/gretel-synthetics
[ "17762ca9060ee6dce2e6dc1c37c87ac5ea4211e7" ]
[ "src/gretel_synthetics/utils/header_clusters.py" ]
[ "\"\"\"\nThis module enables the clustering of DataFrame headers into\nlike clusters based on correlations between columns\n\"\"\"\nfrom typing import List\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport scipy.cluster.hierarchy as sch\n\nfrom gretel_synthetics.utils import stats\...
[ [ "scipy.cluster.hierarchy.dendrogram", "scipy.cluster.hierarchy.linkage", "scipy.cluster.hierarchy.optimal_leaf_ordering", "matplotlib.pyplot.title", "matplotlib.pyplot.figure" ] ]
ringw/vispy
[ "764d07018498966bcfb39341bd844caf2adb5526" ]
[ "examples/basics/visuals/image_transforms.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) 2014, Vispy Development Team.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n# vispy: gallery 2\n\n\"\"\"\nSimple demonstration of ImageVisual.\n\"\"\"\n\nimport numpy as np\nimport vispy.app\nfrom vispy import gloo\nfrom vispy import visuals\nf...
[ [ "numpy.random.normal", "numpy.sin" ] ]
sphanit/CoHAN
[ "e81893068f6b63280d245a2755e3ad30142dff6a" ]
[ "human_path_prediction/scripts/predict_goal.py" ]
[ "#!/usr/bin/env python\n\n# Brief: This node subscribes to /tracked_humans and publishes the predicted goal to humans based on their trajectory\n# Author: Phani Teja Singamaneni\n\nimport numpy as np\nimport rospy\nimport tf\nfrom geometry_msgs.msg import Point, PoseStamped\nfrom human_msgs.msg import TrackedHumans...
[ [ "numpy.max", "numpy.array", "numpy.linalg.norm", "numpy.sin", "numpy.dot", "numpy.exp", "numpy.min", "scipy.stats.multivariate_normal", "numpy.power", "numpy.cos" ] ]
burgreen/proteus
[ "033bbd3fd0ff11d53d8e85b2da1af49e10af9c5d" ]
[ "proteus/tests/HotStart_3P/test_HotStart_rans3p.py" ]
[ "\"\"\"Tests for 2d flow around a cylinder with a conforming mesh and rans3p\"\"\"\nfrom builtins import range\nfrom builtins import object\nfrom proteus.iproteus import *\nfrom proteus import Comm\nfrom proteus import Context\nimport tables\nimport importlib\n\ncomm = Comm.get()\nProfiling.logLevel = 7\nProfiling....
[ [ "numpy.allclose" ] ]
hhhaaahhhaa/s3prl
[ "a469787f05c42196c4d989555082f5fd9dcbe8a6" ]
[ "s3prl/preprocess/split_long_utter_to_short.py" ]
[ "# -*- coding: utf-8 -*- #\n\"\"\"*********************************************************************************************\"\"\"\n# FileName [ split_long_utter_to_short.py ]\n# Synopsis [ preprocess long audio / speech to shorter versions ]\n# Author [ Andy T. Liu (Andi611) ]\n# Copyright...
[ [ "torch.split" ] ]