repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
takuseno/nnabla-examples
[ "070d25078ad3d5458744dbfd390cdd926e20e573" ]
[ "semantic-segmentation/deeplabv3plus/train.py" ]
[ "# Copyright (c) 2017 Sony Corporation. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir...
[ [ "numpy.maximum", "numpy.random.seed", "numpy.arange", "numpy.logical_or", "numpy.max", "numpy.argmax", "numpy.mean", "numpy.transpose", "numpy.array", "numpy.logical_and", "numpy.zeros", "numpy.sum" ] ]
prasaddev97/Evol
[ "3eb8f3889b3321b2e900a00a405b1e3cf9c3b6f7" ]
[ "optimizers/FFA.py" ]
[ "\n#% ======================================================== %\n#% Files of the Matlab programs included in the book: %\n#% Xin-She Yang, Nature-Inspired Metaheuristic Algorithms, %\n#% Second Edition, Luniver Press, (2010). www.luniver.com %\n#% ======================================================== %...
[ [ "numpy.sort", "numpy.ones", "numpy.random.uniform", "numpy.random.rand", "numpy.argsort", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
ldr1997/Deutsch-Jozsa-Simulation
[ "a268bb2cf754ea2acb7c2a4342e31e8dea8381c5" ]
[ "deutsch_jozsa_simulator-user_input.py" ]
[ "\"\"\"\r\nAUTHOR: Luis Gabriel Q. del Rosario\r\nDATE: 01 MAY, 2019\r\nDESCRIPTION: Simulation of Deutsch-Jozsa algorithm using Linear Algebra\r\n - NOTE: FILENAME of input should be test_cases.txt\r\n - INPUT #1 is the number of qubits, INCLUDING the ancilla bit\r\n - INPUT #2 is the function mapping for...
[ [ "numpy.matrix", "numpy.sqrt", "numpy.eye", "numpy.kron", "matplotlib.pyplot.pie", "numpy.zeros", "matplotlib.pyplot.show" ] ]
Analytics-for-a-Better-World/GPBP_Analytics_Tools
[ "4774cb0f10ef2bfe71c2bc7b10f439764fb2aa20" ]
[ "Scripts/haversine_vectorize.py" ]
[ "def haversine_vectorize(lon1, lat1, lon2, lat2):\n \n import numpy as np\n \n lon1, lat1, lon2, lat2 = map(np.radians, [lon1, lat1, lon2, lat2])\n newlon = lon2 - lon1\n newlat = lat2 - lat1\n haver_formula = np.sin(newlat/2.0)**2 + np.cos(lat1) * np.cos(lat2) * np.sin(newlon/2.0)**2\n dist...
[ [ "numpy.cos", "numpy.sqrt", "numpy.sin" ] ]
Rafael-G-C/pyDFTD3
[ "d6560f45a1fbdb61a5b493b990a7c407edde7afb" ]
[ "tests/test_CO2H2_2.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# pyDFTD3 -- Python implementation of Grimme's D3 dispersion correction.\n# Copyright (C) 2020 Rob Paton and contributors.\n#\n# This file is part of pyDFTD3.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software an...
[ [ "numpy.array" ] ]
mattfoster/matplotlib
[ "0b47697b19b77226c633ec6a3d74a2199a153315", "0b47697b19b77226c633ec6a3d74a2199a153315" ]
[ "examples/pylab_examples/hline_demo.py", "examples/units/evans_test.py" ]
[ "#!/usr/bin/env python\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef f(t):\n s1 = np.sin(2*np.pi*t)\n e1 = np.exp(-t)\n return np.absolute((s1*e1))+.05\n\n\nt = np.arange(0.0, 5.0, 0.1)\ns = f(t)\nnse = np.random.normal(0.0, 0.3, t.shape) * s\n\n\nplt.plot(s+nse, t, 'b^')\nplt.hlines(t, [0], ...
[ [ "numpy.absolute", "matplotlib.pyplot.title", "numpy.arange", "matplotlib.pyplot.hlines", "matplotlib.pyplot.savefig", "numpy.sin", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "numpy.random.normal", "numpy.exp", "matplotlib.pyplot.xlabel", "matplotlib.pyplot....
botal9/naturalistic-image-embedder
[ "aae459528efd2442eebfb6b00637d7e9fc197093", "aae459528efd2442eebfb6b00637d7e9fc197093" ]
[ "naturalistic_image_embedder/common/conversions.py", "unet/data/emb_dataset.py" ]
[ "import numpy as np\n\n\ndef rgb_to_lms(image):\n conv_arr = np.array([[0.3811, 0.5783, 0.0402],\n [0.1967, 0.7244, 0.0782],\n [0.0241, 0.1288, 0.8444]])\n conv_arr_3d = np.tile(conv_arr, image.shape[:-1])\n res = conv_arr_3d * image.astype('float64')\n re...
[ [ "numpy.exp", "numpy.log", "numpy.array", "numpy.tile" ], [ "numpy.expand_dims" ] ]
fnc11/nball4tree
[ "ead18d0259b954a73b8a4da0fe521e96dff90fe2" ]
[ "nball4tree/main_training_process.py" ]
[ "import os\nimport copy\nimport time\nimport decimal\nimport operator\nimport numpy as np\nfrom distutils.dir_util import copy_tree\nfrom nball4tree.config import cgap, L0, R0, DIM, DECIMAL_PRECISION\nfrom nball4tree.util_train import get_children\nfrom nball4tree.util_vec import vec_norm, qsr_DC, qsr_DC_degree, qs...
[ [ "numpy.dot", "numpy.linalg.norm", "numpy.sqrt" ] ]
PlanetHunters/lcbuilder
[ "f7de6b0203673a73b44edf64fdadaa83e2710e01" ]
[ "lcbuilder/objectinfo/preparer/MissionInputLightcurveBuilder.py" ]
[ "import logging\nimport lightkurve as lk\n\nfrom lcbuilder.LcBuild import LcBuild\nfrom lcbuilder.star import starinfo\nfrom lcbuilder.objectinfo.MissionInputObjectInfo import MissionInputObjectInfo\nfrom lcbuilder.objectinfo.preparer.LightcurveBuilder import LightcurveBuilder\nimport pandas as pd\n\n\nclass Missio...
[ [ "pandas.read_csv" ] ]
Informationsfabrik/bayes-models
[ "ab20a5d2a9b471fa474918a60ace2e9a111d00fc" ]
[ "src/pymc3_stochastic_volatility.py" ]
[ "\"\"\"\nGetting started with pymc3.\nBased on https://docs.pymc.io/notebooks/getting_started.html\n\"\"\"\n\n# %%\nimport pandas as pd\nimport pymc3 as pm\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nreturns = pd.read_csv(\n pm.get_data(\"SP500.csv\"), parse_dates=True, index_col=0, usecols=[\"Date\"...
[ [ "numpy.exp", "matplotlib.pyplot.subplots", "matplotlib.pyplot.ylabel" ] ]
xiaokai01/pysoftNLP
[ "b1d7dc50a2c5a9d1efbc9ce6f497a768ae173a7f" ]
[ "pysoftNLP/kashgari/tasks/classification/models.py" ]
[ "# encoding: utf-8\n\n# author: BrikerMan\n# contact: eliyar917@gmail.com\n# blog: https://eliyar.biz\n\n# file: models.py\n# time: 2019-05-22 11:26\n\nimport logging\nimport tensorflow as tf\nfrom typing import Dict, Any\nfrom pysoftNLP.kashgari.layers import L, AttentionWeightedAverageLayer, KMaxPoolingLayer\nfro...
[ [ "tensorflow.keras.Model" ] ]
JoanFM/mmfashion
[ "260942fc80117b6c8eb76d6022d271397ee5a92c" ]
[ "mmfashion/models/losses/triplet_loss.py" ]
[ "import torch.nn as nn\nimport torch.nn.functional as F\n\nfrom ..registry import LOSSES\n\n\n@LOSSES.register_module\nclass TripletLoss(nn.Module):\n def __init__(self,\n method='cosine',\n ratio=1,\n margin=0.2,\n use_sigmoid=False,\n ...
[ [ "torch.nn.functional.sigmoid", "torch.nn.functional.cosine_embedding_loss", "torch.nn.functional.relu" ] ]
2019-Spring-Information-Retrieval/backend
[ "9a9f1a466a49b878c3be3859180e21720ff9f6d5" ]
[ "AdvancedSearch/rankWorker.py" ]
[ "from typing import List, Dict\nfrom sklearn.feature_extraction.text import TfidfTransformer\nfrom const import LIMIT_DOCS\nimport numpy as np\nfrom collections import defaultdict\nfrom functools import reduce\n#from scipy.special import softmax\nfrom pymongo import MongoClient\nimport bson.json_util\n\nINDEX_IDS =...
[ [ "numpy.square", "numpy.dot", "numpy.set_printoptions", "sklearn.feature_extraction.text.TfidfTransformer", "numpy.max", "numpy.argsort", "numpy.array", "numpy.sum" ] ]
walbermr/DESlib
[ "6ae0f5a8f837f1843ccf0a48ae89e911108aa3d2" ]
[ "deslib/dcs/a_posteriori.py" ]
[ "# coding=utf-8\n\n# Author: Rafael Menelau Oliveira e Cruz <rafaelmenelau@gmail.com>\n#\n# License: BSD 3 clause\n\nimport numpy as np\n\nfrom deslib.dcs.base import BaseDCS\n\n\nclass APosteriori(BaseDCS):\n \"\"\"A Posteriori Dynamic classifier selection.\n\n The A Posteriori method uses the probability of...
[ [ "numpy.ma.sum", "numpy.expand_dims", "numpy.ma.filled", "numpy.atleast_2d", "numpy.ma.MaskedArray" ] ]
Notenoughbananas/tlp2022
[ "b35ed3572f474cc0202e6431913a6230d4babc2a" ]
[ "experiment/run_exp.py" ]
[ "import sys\nimport requests\nimport os\n\n# Used for debugging gpu errors\n# os.environ['CUDA_LAUNCH_BLOCKING'] = '1'\n\nimport pandas as pd\nimport networkx as nx\nimport utils as u\nimport torch\nimport torch.distributed as dist\nimport numpy as np\nimport time\nimport datetime\nimport random\nfrom copy import d...
[ [ "torch.distributed.init_process_group", "torch.cuda.manual_seed", "numpy.random.seed", "torch.cuda.set_device", "torch.manual_seed", "numpy.random.choice", "torch.cuda.current_device", "torch.nn.RReLU", "numpy.log10", "torch.cuda.is_available", "torch.cuda.manual_seed_a...
s7015321/alife
[ "c178956bad7e9051023a2f1b965dc5b374436118" ]
[ "fori.py" ]
[ "import numpy as np\n\nN=1\n#A=np.random.random(N)\nA=0\nFIELD_WIDTH=600\nFIELD_HEIGHT=600\nsensor_th = np.linspace(0, 2*np.pi, 7, endpoint=False)\nSENSOR_POSITION = 1 * np.array([np.cos(sensor_th), np.sin(sensor_th)]).T\nagents_th = np.random.random(N).astype(np.float32) * np.pi * 2\nagents_pos = np.random.random(...
[ [ "numpy.random.random", "numpy.cos", "numpy.linspace", "numpy.sin" ] ]
marl0ny/grids-on-the-complex-plane
[ "7dfc635baad2c7cb13caf2b71055da18a57ea642" ]
[ "complex_graph/animator.py" ]
[ "\"\"\"\nAbstract animation class and constants.\n\"\"\"\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom matplotlib.lines import Line2D\nfrom matplotlib.text import Text\nfrom matplotlib.collections import Collection, PathCollection\nfrom matplotlib.quiver import QuiverKey, Quiver\nimport matplotlib.anima...
[ [ "matplotlib.__version__.split", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.figure" ] ]
felixwzh/SJTU-CS410-Project
[ "b6e90cb353af49f8f18b1bc368db00e9c8e6aab8" ]
[ "code/pre_train_felix.py" ]
[ "from __future__ import division, print_function\nimport tensorflow as tf\nimport numpy as np\nimport pandas as pd\n\nimport os\nimport pprint\nimport sys\n\nimport keras\nfrom keras.models import Sequential, Model\nfrom keras.layers import Dense, Activation, Dropout, Input\nfrom keras.utils import to_categorical\n...
[ [ "pandas.read_csv", "tensorflow.ConfigProto", "numpy.random.permutation", "tensorflow.Session", "numpy.load", "numpy.array" ] ]
jlmaccal/FrEIA
[ "64a04cb784e19bdff69546657f602fd31835c21f" ]
[ "experiments/mnist_cINN/eval.py" ]
[ "import sys\n\nimport numpy as np\n\nfrom sklearn.decomposition import PCA\nimport matplotlib.pyplot as plt\nimport torch\nfrom tqdm import tqdm\nfrom torch.nn.functional import avg_pool2d, interpolate\n\nimport config as c\nimport opts\nimport data\nopts.parse(sys.argv)\nprint('==='*30)\nprint('Config options:\\n'...
[ [ "matplotlib.pyplot.imshow", "numpy.linspace", "torch.zeros", "torch.cat", "numpy.squeeze", "torch.no_grad", "numpy.clip", "torch.randn", "numpy.ceil", "matplotlib.pyplot.subplot", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.imsave", "matplo...
trevorWieland/maxcutpy
[ "4d0ea07261073a77b81f7f3c0b6e6c405a7951fc" ]
[ "tests/basic_test.py" ]
[ "from maxcutpy import RandomMaxCut\nimport numpy as np\n\ndef test_basic_initialization():\n matrix = np.array([[0,1,1],[1,0,5],[1,5,0]])\n\n random_cut = RandomMaxCut(seed=12345, matrix=matrix)\n assert random_cut.batches_split == False\n assert random_cut.best_cut_vector is None\n assert random_cut...
[ [ "numpy.array" ] ]
STAR-Center/flipperplanning3DTerrain
[ "fcbe076446bbc6cb10da67b81c9a6349b4c51b66" ]
[ "25dflipper/flipper25d/exp/process/bag2mat.py" ]
[ "# -*- coding: utf-8 -*-\n#!/usr/bin/env python2 \n'''\n actually, when record the bag, I miss recog the node. \n the recorded [fl,fr,bl,br] should actually be [bl, fl, br, fr]\n'''\nimport rospy\nimport numpy as np\nfrom message_filters import Subscriber,ApproximateTimeSynchronizer\nfrom geometry_msgs.msg imp...
[ [ "numpy.array", "numpy.zeros", "numpy.stack" ] ]
vlomonaco/sparse-dynamic-synapses
[ "8ee2b3c7bc369cc9dafb9c8e3742509d1432fd24" ]
[ "benchmarks/ccifar.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n################################################################################\n# Copyright (c) 2019. Vincenzo Lomonaco. All rights reserved. #\n# Copyrights licensed under the CC BY 4.0 License. #\n# See the accompany...
[ [ "numpy.random.shuffle", "numpy.random.seed" ] ]
WebCampZg/conference-web
[ "76ccae83924fdcd040d9280db5cf3a249d668606" ]
[ "talks/chart.py" ]
[ "from io import BytesIO\nimport matplotlib.pyplot as plt\n\n\ndef generate_survey_score_chart(talk, format=\"png\"):\n ss = talk.surveyscore\n keys = [int(x) for x in ss.distribution.keys()]\n values = list(ss.distribution.values())\n subtitle = \"avg={:.2f} n={}\".format(ss.average, ss.count)\n titl...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "matplotlib.pyplot.clf", "matplotlib.pyplot.bar", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
FupingWu90/VarDA
[ "cfea269a4f608128bb5b13a778619b17d7123bfa" ]
[ "code/add_position_info/Adversarial_DA_seg_trainer.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.utils.data import Dataset\nimport os\nimport math\nimport SimpleITK as sitk\n#import nibabel as nib\nimport numpy as np\nimport glob\nfrom torch.utils.data import DataLoader\nfrom torch.nn import DataParallel\nimport torch.nn.functional as F\nfrom torch.backends impor...
[ [ "matplotlib.pyplot.legend", "numpy.expand_dims", "torch.max", "torch.utils.data.DataLoader", "numpy.concatenate", "sklearn.manifold.TSNE", "numpy.mean", "torch.nn.CrossEntropyLoss", "numpy.arange", "torch.from_numpy", "numpy.std", "matplotlib.pyplot.close", "num...
mattsmart/celltypes
[ "21d7fa18535033fc23be380dcee3660a814bb722" ]
[ "singlecell/celltype_similarity.py" ]
[ "import csv\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\n\nfrom singlecell.analysis_basin_plotting import plot_overlap_grid\nfrom singlecell.singlecell_constants import DATADIR, MEMORIESDIR\nfrom utils.file_io import RUNS_FOLDER\nfrom singlecell.singlecell_simsetup import singlecell_simsetup\nfr...
[ [ "numpy.dot", "numpy.array", "matplotlib.pyplot.show", "numpy.sqrt" ] ]
stxinsite/geomm
[ "05ce2404614e3a594c5d5e059b957140f4983bc3", "05ce2404614e3a594c5d5e059b957140f4983bc3" ]
[ "tests/misc/rmsd/theobald_qcp.py", "src/geomm/arrhenius.py" ]
[ "\"\"\"\nSample code to use the routine for fast RMSD & rotational matrix calculation.\nFor the example provided below, the minimum least-squares RMSD for the two\n7-atom fragments should be 0.719106 A.\n\n And the corresponding 3x3 rotation matrix is:\n\n [[ 0.72216358 -0.52038257 -0.45572112]\n [ 0.6911...
[ [ "numpy.dot", "numpy.array", "numpy.sum" ], [ "numpy.log", "numpy.exp" ] ]
msubedar/bayesian-torch
[ "0064df3aa7c7313d877703a087ccbd374611269d" ]
[ "bayesian_torch/layers/variational_layers/linear_variational.py" ]
[ "# Copyright (C) 2021 Intel Labs\n#\n# BSD-3-Clause License\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# 1. Redistributions of source code must retain the above copyright notice,\n# this list of conditio...
[ [ "torch.exp", "torch.nn.functional.linear", "torch.Tensor", "torch.tensor" ] ]
Zhiji022/Kelowna_cultural_plan_survey_analysis
[ "71de28c0ad8c69183a8eaf8039273dd92d5a73ce", "71de28c0ad8c69183a8eaf8039273dd92d5a73ce" ]
[ "dataloaders/CultureDefinition.py", "dataloaders/CultureCentreVisitors.py" ]
[ "# data loader for the CultureCentreDistances dataset\nimport pandas as pd\n\nculture_definition = pd.read_csv(\"datasets/CultureDefinition.csv\")\n", "# data loader for the howdoyou_topic dataset\nimport pandas as pd\n\ncul_topic = pd.read_csv(\"datasets/CulturalCentreVisitors.csv\")\n" ]
[ [ "pandas.read_csv" ], [ "pandas.read_csv" ] ]
Jman420/fractimation
[ "3b33958b76528a9c7f97af24818d7a1721b1201b", "3b33958b76528a9c7f97af24818d7a1721b1201b" ]
[ "fractimation/iterators/base/fractal_formula.py", "fractimation/renderers/cached_image_renderer.py" ]
[ "from abc import ABC, abstractclassmethod\nfrom collections.abc import Iterable, Iterator\n\nimport numpy\n\nfrom ...helpers.formula_tools import generate_complex_range\n\nclass FractalFormulaIterable(Iterable, ABC):\n \n _max_iterations = None\n _z_values_range_params = None\n _c_values_range_params = ...
[ [ "numpy.add", "numpy.complex" ], [ "numpy.add", "numpy.copy", "numpy.zeros" ] ]
machine-learning-airu-ozone/ChE_Utah_AirQuality_ML_Ozone
[ "f47f1bac223f18f24dfc0767a6ef3a0d19015914" ]
[ "Functions/Analyzer_Functions.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nTitle : Analyzer Function\n\nDescription : This the functions that help make it a bit easier to analyze and export \nresults generated from neural networks\n\nFunction Dependencies:\nkeras\nnumpy\nrandom\nmatplotlib\nTensorFlow\nos \ndatetime\npython\n \nCreated on Tue Jun 16 21...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.tight_layout", "numpy.linspace", "matplotlib.pyplot.scatter", "numpy.min", "matplotlib.pyplot.ylim", "numpy.ones", "matplotlib.pyplot.plot", "numpy.max", "scipy.stats.linregress", "matplotlib.pyplot.ylabel", "matplotlib...
LcDog/TaskGuidedGenDetection
[ "78c59e20880751ab972fde08a4bc22e704f9b955" ]
[ "train_ori.py" ]
[ "# --------------------------------------------------------\n# Pytorch multi-GPU Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick\n# --------------------------------------------------------\nfrom __future__ import absolu...
[ [ "torch.load", "torch.cat", "torch.randperm", "torch.utils.data.DataLoader", "torch.FloatTensor", "torch.cuda.manual_seed_all", "torch.cuda.is_available", "numpy.where", "torch.autograd.Variable", "numpy.copy", "torch.sort", "torch.nonzero", "torch.arange", "...
bolhuis/openpathsampling
[ "e8b091c92916561954542d40d17d7241b203d1ad" ]
[ "openpathsampling/experimental/simstore/storable_functions.py" ]
[ "import collections\nimport warnings\nimport inspect\nimport types\n\nimport numpy as np\n\nfrom .tools import none_to_default\nfrom .callable_codec import CallableCodec\nfrom .serialization_helpers import get_uuid, has_uuid, default_find_uuids\nfrom .class_info import ClassInfo\nfrom .serialization_helpers import ...
[ [ "numpy.array" ] ]
lukavuko/mortgage-filter-package
[ "187d771c441f93b6a5dd2c5bf67ee519d1888430" ]
[ "mortgage_filter/mortgage_filter.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # PRIMARY FILTER FUNCTION\n# ### Uses base functions to compute affordability metrics.\n\n# In[1]:\n\n\nfrom warnings import filterwarnings\nimport pandas as pd\nfrom mortgage_filter.mortgage_base import *\nfrom mortgage_filter.exceptions import *\n\n\n# In[4]:\n\n\ndef ...
[ [ "pandas.api.types.is_numeric_dtype" ] ]
simonr98/Reinforcement-Learning-with-Videos
[ "e40cec6b8d817276375e940696b290fc4e1e8bc7", "e40cec6b8d817276375e940696b290fc4e1e8bc7" ]
[ "scripts/cat_replay_pools.py", "RLV/torch_rlv/visualizer/plot.py" ]
[ "import gzip\nimport pickle\nimport numpy as np\nimport argparse\n\nfrom os.path import join\n\ndef combine_replay_pools(args):\n with gzip.open(args.path_1, 'rb') as f:\n data_1 = pickle.load(f)\n with gzip.open(args.path_2, 'rb') as f:\n data_2 = pickle.load(f)\n \n\n combined_data = {}\...
[ [ "numpy.concatenate" ], [ "matplotlib.backends.backend_pdf.PdfPages", "matplotlib.pyplot.imshow", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.animation.FuncAnimation", "matplotlib.pyplot.close", "numpy.array", "matplotlib...
neng668/Real-Time-Voice-Cloning
[ "01352a52ad6a5851bf01b4e1f8f4e121c9aa89dc" ]
[ "synthesize_cli.py" ]
[ "from encoder.params_model import model_embedding_size as speaker_embedding_size\nfrom utils.argutils import print_args\nfrom utils.modelutils import check_model_paths\nfrom synthesizer.inference import Synthesizer\nfrom encoder import inference as encoder\nfrom vocoder import inference as vocoder\nfrom pathlib imp...
[ [ "torch.manual_seed", "numpy.pad" ] ]
ubamba98/segmentation_models.pytorch
[ "148a3eff57dc1b22c69910c5dacc174b6aa954c9" ]
[ "tests/test_models.py" ]
[ "import os\nimport sys\nimport mock\nimport pytest\nimport torch\nimport random\nimport importlib\n\n# mock detection module \nsys.modules['torchvision._C'] = mock.Mock()\n\nimport segmentation_models_pytorch as smp\n\n\ndef get_encoder():\n is_travis = os.environ.get('TRAVIS', False)\n exclude = ['senet154']...
[ [ "torch.ones" ] ]
smallv0221/Paddle
[ "b6ecf35627d80e18470723a8d43c11826aabd6c8" ]
[ "python/paddle/fluid/tests/unittests/dist_fleet_simnet_bow.py" ]
[ "# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "numpy.random.random_integers", "numpy.mean" ] ]
CodeSopranos/VehicleRoutingProblem
[ "55efe52e76f45573cb9ec38dce3521a36807965d" ]
[ "utils/tools.py" ]
[ "import random\nimport numpy as np\nimport pandas as pd\n\nfrom copy import copy\nfrom datetime import datetime\nfrom itertools import combinations\nfrom tqdm import tqdm, tqdm_notebook\n\n\ndef get_problem(path) -> dict:\n\n with open(path, 'r') as f:\n file = f.read()\n file = file.split('\\n')\n...
[ [ "numpy.arange", "numpy.ones" ] ]
ryanapfel/clustering
[ "682bf22eeff2253acc0128323db97968a9a3b420", "682bf22eeff2253acc0128323db97968a9a3b420" ]
[ "src/utils/cluster.py", "src/utils/user.py" ]
[ "\nimport numpy as np\nfrom src.utils.scenes import Scenes\nfrom src.utils.correlation import CStruct\n\n\n\n\nclass Cluster:\n def __init__(self,_K, _emotions,_df, _users, _cluster):\n self.users = _users\n self.clusterId = _cluster\n self.sceneInfo = Scenes(_df, _users)\n self.struct = CStruct(_K, _e...
[ [ "numpy.hstack" ], [ "numpy.unique" ] ]
7cm-diameter/CDRL
[ "49fdc171f293643953df70450e7ff9e0c60cbfcb" ]
[ "cdrl/env.py" ]
[ "import numpy as np\n\nfrom cdrl.model import ArrayFloat, ArrayInt\n\n\nclass NArmBandit(object):\n def __init__(self, k: int):\n self._k = k\n self._probs: ArrayFloat = np.zeros(k)\n\n @property\n def probs(self) -> ArrayFloat:\n return self._probs\n\n def set_probs(self, probs: Ar...
[ [ "numpy.random.binomial", "numpy.zeros" ] ]
argrecsys/arg-classifier
[ "fc8ad68e486845cc4b466d5d43034fca61557dbe" ]
[ "code/DataProcessor/src/util/files.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n Created by: Andrés Segura-Tinoco\n Version: 1.3.0\n Created on: Oct 06, 2021\n Updated on: May 27, 2022\n Description: Files library with utility functions\n\"\"\"\n\n# Import Python base libraries\nimport os\nimport json\nimport yaml\nimport pandas as pd\n\n# Read ...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
vkinakh/scatsimclr
[ "7630b124fc644ae8362b90890c2b16e2c3bc0e40" ]
[ "src/evaluation/logistic_regression_evaluator.py" ]
[ "from typing import Tuple\n\nimport numpy as np\nfrom sklearn.preprocessing import StandardScaler\n\nimport torch\nfrom torch.utils.data import TensorDataset, DataLoader\n\nfrom src.models import LogisticRegression\n\n\nclass LogisticRegressionEvaluator:\n\n \"\"\"Logistic regression evaluator. Trains one-layer ...
[ [ "torch.nn.CrossEntropyLoss", "torch.utils.data.DataLoader", "torch.from_numpy", "torch.no_grad", "sklearn.preprocessing.StandardScaler", "torch.argmax" ] ]
fehiepsi/arviz
[ "d04d8da07f029fd2931f48d2f7f324cf393e5277" ]
[ "arviz/plots/plot_utils.py" ]
[ "\"\"\"Utilities for plotting.\"\"\"\nfrom itertools import product\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nimport xarray as xr\n\n\ndef make_2d(ary):\n \"\"\"Convert any array into a 2d numpy array.\n\n In case the array is already more than 2 dimensional, will ravel...
[ [ "numpy.log2", "numpy.clip", "numpy.arange", "matplotlib.pyplot.subplots", "numpy.percentile", "numpy.atleast_1d", "numpy.max", "numpy.ravel", "numpy.array" ] ]
mongmong/python-candy
[ "ead8b02cd8cf82314fec0c40aff7c8d32cf7c855" ]
[ "src/candy/indicators/price.py" ]
[ "import collections\nimport numpy as np\nimport pandas as pd\n\nfrom . import columns_to_transform, transform_ta\n\n#\n# indicators\n#\ndef log_return(df, columns, window = 1, append = False, trans_methods = None):\n columns = columns_to_transform(df, columns)\n\n tmp0 = df[columns]\n tmp = np.log(tmp0 / t...
[ [ "numpy.sum" ] ]
raja-marjieh/test-pkg
[ "88b4d92a238ffb74ec09dd3cf09c2a75c9b0c1c8" ]
[ "ddsp/training/data_preparation/prepare_tfrecord_lib.py" ]
[ "# Copyright 2020 The DDSP Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or a...
[ [ "tensorflow.io.gfile.GFile", "numpy.pad", "tensorflow.train.FloatList", "numpy.ones" ] ]
JaerongA/tweetynet
[ "a24843800e17a423949ca5437aae2160588b1ed1" ]
[ "src/article/plot.py" ]
[ "\"\"\"functions to create plots, basis for figures in article\"\"\"\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n\ndef frame_error(df, ax=None, figsize=(10, 3.75), legend=True, xlabel=False,\n save_as=None, transparent=True):\n \"\"\"plot frame error results from generating a learni...
[ [ "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ] ]
letmaik/onnxruntime
[ "f39a8d1f5904a15a809c21b45d27628bc3223ccc" ]
[ "onnxruntime/python/tools/gen_doc.py" ]
[ "#!/usr/bin/env python\n\n# This file is copied and adapted from https://github.com/onnx/onnx repository.\n# There was no copyright statement on the file at the time of copying.\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import un...
[ [ "numpy.round" ] ]
jsteggink/transformers
[ "90178b0cefe94fef258a39cff5019b5ec150597b" ]
[ "src/transformers/modeling_tf_utils.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may...
[ [ "tensorflow.convert_to_tensor", "numpy.asarray", "tensorflow.python.keras.backend.int_shape", "tensorflow.keras.utils.register_keras_serializable", "tensorflow.python.keras.saving.hdf5_format.load_attributes_from_hdf5_group", "tensorflow.rank", "tensorflow.math.reduce_any", "tensor...
jielyu/ml-models
[ "162f4dae2e4e66642c9cf995827c90cf0be0311e" ]
[ "src/dataset/mosaic_detection.py" ]
[ "#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Copyright (c) Megvii, Inc. and its affiliates.\n\nimport random\n\nimport cv2\nimport numpy as np\n\n# from yolox.utils import adjust_box_anns, get_local_rank\n\nfrom dataset.data_augment import random_affine\nfrom dataset.datasets_wrapper import Dataset\n\n\ndef a...
[ [ "numpy.hstack", "numpy.clip", "numpy.ones", "numpy.concatenate", "numpy.full", "numpy.vstack" ] ]
hebpmo/zipline
[ "396469b29e7e0daea4fe1e8a1c18f6c7eeb92780" ]
[ "zipline/utils/calendars/exchange_calendar_ice.py" ]
[ "from datetime import time\nfrom itertools import chain\n\nfrom pandas.tseries.holiday import (\n GoodFriday,\n USPresidentsDay,\n USLaborDay,\n USThanksgivingDay\n)\n# # from pandas.tslib import Timestamp\nimport pandas as pd\nfrom pytz import timezone\n\nfrom zipline.utils.calendars import TradingCale...
[ [ "pandas.Timestamp" ] ]
suryapa1/bqplot
[ "dd387f74be75685235c07dbf7a3d36edde5adecf" ]
[ "bqplot/traits.py" ]
[ "# Copyright 2015 Bloomberg Finance L.P.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "pandas.to_datetime", "pandas.Series", "numpy.ascontiguousarray", "numpy.issubdtype", "numpy.squeeze", "pandas.DataFrame", "numpy.dtype", "numpy.datetime64", "numpy.frombuffer", "numpy.shape", "numpy.array" ] ]
maleike/MITK
[ "c17a156480f5bddf84c340eac62415d46fcc01ab" ]
[ "Modules/Biophotonics/python/inverseMonteCarlo/lenstest.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Mar 1 15:24:48 2015\n\n@author: wirkert\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport helper.mieMonteCarlo as mmc\nimport helper.monteCarloHelper as mch\nfrom setup import simulation\nfrom csvImageReader import csvImageReader\n\nplt.close(...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.nonzero", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.close", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.figure" ] ]
pomberger/pyaec
[ "5b9c02c57075d790b7df8652884618189d49bbc4" ]
[ "frequency_domain_adaptive_filters/fdaf.py" ]
[ "# Copyright 2020 ewan xu<ewan_xu@outlook.com>\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 applicab...
[ [ "numpy.fft.irfft", "numpy.abs", "numpy.fft.rfft", "numpy.full", "numpy.concatenate", "numpy.hanning", "numpy.zeros" ] ]
ICB-DCM/lookahead-study
[ "b9849ce2b0cebbe55d6c9f7a248a5f4dff191007" ]
[ "pyABC/0.10.14/storage/history.py" ]
[ "import datetime\nimport os\nfrom typing import List, Union\nimport json\nimport numpy as np\nimport pandas as pd\nimport sqlalchemy as sa\nfrom sqlalchemy.orm import subqueryload\nfrom functools import wraps\nimport tempfile\nimport logging\n\nfrom .db_model import (Version, ABCSMC, Population, Model, Particle,\n ...
[ [ "pandas.read_sql_query", "numpy.array", "pandas.DataFrame" ] ]
SimonVoelker/carculator
[ "e40d664c9b5612250cf9ad2c6fa2a199b0bf88c5" ]
[ "carculator/noise_emissions.py" ]
[ "import numpy as np\nimport numexpr as ne\n\n\ndef pn(cycle, powertrain_type):\n cycle = np.array(cycle)\n\n # Noise sources are calculated for speeds above 20 km/h.\n if powertrain_type in (\"combustion\", \"electric\"):\n array = np.tile((cycle - 70) / 70, 8).reshape((8, -1))\n constants = ...
[ [ "numpy.tile", "numpy.zeros_like", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
LaurentAjdnik/qutip
[ "297776737cf91df0468022ba2b1a3090af0d6549" ]
[ "qutip/three_level_atom.py" ]
[ "# This file is part of QuTiP: Quantum Toolbox in Python.\n#\n# Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are...
[ [ "numpy.empty" ] ]
jessicalettes/nmd-exons
[ "2f014c952ec17b4b3936ff504b6406abc2cab4e4" ]
[ "test_nmd.py" ]
[ "import gffutils\nimport pandas.util.testing as pdt\nimport pandas as pd\nimport pytest\n\n\n@pytest.fixture\ndef database():\n return '/Users/rhythmicstar/projects/exon_evolution//gencode.v19.' \\\n 'annotation.outrigger.nmdtest.gtf.db'\n\n\n@pytest.fixture\ndef exon_ids():\n return ('exon:chr10:10...
[ [ "pandas.util.testing.assert_series_equal", "pandas.Series", "pandas.util.testing.assert_equal", "pandas.util.testing.assert_dict_equal" ] ]
akshit61/ga-learner-dsmp-repo
[ "729d1c032c8c786470ff20bfb22026189312b239" ]
[ "ENSEMBLE-METHODS/code.py" ]
[ "# --------------\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import MinMaxScaler\nimport pandas as pd\n\n# Code starts here\ndf = pd.read_csv(path)\nX = df.iloc[:,:-1]\ny = df.iloc[:,-1]\nX_train,X_test,y_train,y_test = train_test_split(X,y,random_state = 4, test_size = 0.3)\n...
[ [ "sklearn.metrics.roc_auc_score", "pandas.read_csv", "sklearn.linear_model.LogisticRegression", "sklearn.ensemble.RandomForestClassifier", "sklearn.model_selection.train_test_split", "sklearn.ensemble.VotingClassifier", "sklearn.tree.DecisionTreeClassifier", "sklearn.preprocessing.M...
tanyinghui/Minimal-Hand-pytorch
[ "12f2664e94b94c95196a4ad789077946350f5e7c", "12f2664e94b94c95196a4ad789077946350f5e7c", "12f2664e94b94c95196a4ad789077946350f5e7c" ]
[ "train_shape_net.py", "utils/eval/zimeval.py", "datasets/handataset.py" ]
[ "import argparse\nimport os\nimport time\n\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.nn.parallel\nimport torch.optim\nimport torch.utils.data\nfrom progress.bar import Bar\nfrom tensorboardX.writer import SummaryWriter\nfrom termcolor import cprint\n\nfrom model import shape_net\nfrom datase...
[ [ "torch.Tensor", "torch.cuda.device_count", "torch.utils.data.DataLoader", "numpy.save", "torch.no_grad", "torch.cuda.is_available", "torch.nn.DataParallel", "torch.optim.lr_scheduler.StepLR" ], [ "numpy.square", "numpy.ones_like", "numpy.linspace", "numpy.squeez...
ThibaultVlieghe/declarativeTask_Shuo
[ "dd8b26ecf26cfb4dbd19423464adf88a57d897c3" ]
[ "ld_runExperimentDayOne.py" ]
[ "from cursesmenu import *\nfrom cursesmenu.items import *\nimport sys\nimport os\nimport numpy as np\nfrom ast import literal_eval\n\nfrom datetime import datetime\nimport expyriment\nfrom dateutil.parser import parse\n\n\nrawFolder = os.getcwd() + os.path.sep\ndataFolder = rawFolder + 'data' + os.path.sep\nsounds ...
[ [ "numpy.random.choice" ] ]
EducationalTestingService/VAMP
[ "4dd18e12db8dc5d7211fed8f120e5a7059bebd87" ]
[ "bvh/bvh_parser.py" ]
[ "#!/usr/bin/env python\n# License: MIT\n\"\"\"\nRecursively parse a time-series motion trace file specified in Biovision\nHierarchical (BVH) format and extracts the time-series, Cartesian coordinated\ndata for a set of specified body parts.\n\n:author: Ben Leong (cleong@ets.org)\n\n\"\"\"\n\n\nimport ConfigParser\n...
[ [ "pandas.DataFrame" ] ]
davidbrochart/pyclk
[ "b1ff7ddfbd8077acca701a5533f9238d15d470b5" ]
[ "pyclk/trace.py" ]
[ "class Trace:\n def __init__(self, from_time=0, to_time=0):\n self._traces = []\n self._signals = []\n self.from_time = from_time\n self.to_time = to_time\n def add(self, sig):\n if id(sig) in [id(s) for s in self._signals]:\n i = self._signals.index(sig)\n ...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.style.use" ] ]
vadgama/MLW
[ "5ca2926aadc33d9a8a55cbf07faa472fa03e9f73" ]
[ "zmk/nyokaserver/nyokaUtilities.py" ]
[ "# nyokaUtilities.py\nimport numpy as np\nfrom random import choice\nfrom string import ascii_uppercase\nimport copy,json\nimport ast,pathlib\nimport traceback\nfrom nyoka import PMML43Ext as ny\nglobal MEMORY_DICT_ARCHITECTURE,MEMORY_OF_LAYERS\n\nsettingFilePath='./settingFiles/'\nsavedModels='./SavedModels/'\nMEM...
[ [ "numpy.prod" ] ]
nayopu/eyes2mouth
[ "ff72dab2becfcfb57c05874be0cdf76e3c4e3985" ]
[ "main.py" ]
[ "import argparse\nimport os\nimport scipy.misc\nimport numpy as np\n\nfrom model import pix2pix\nimport tensorflow as tf\n\nparser = argparse.ArgumentParser(description='')\nparser.add_argument('--dataset_name', dest='dataset_name', default='cropped_128', help='name of the dataset')\nparser.add_argument('--epoch', ...
[ [ "tensorflow.Session", "tensorflow.app.run" ] ]
grosheintz/lmmr
[ "b6b7dd26825d4ee89139f67d1093c11e91b0c627" ]
[ "src/lmmr/io/latex_tables.py" ]
[ "# SPDX-License-Identifier: MIT\n# Copyright (c) 2021 ETH Zurich, Luc Grosheintz-Laval\n\nimport itertools\nimport numpy as np\n\n\nclass LatexConvergenceTable(object):\n \"\"\"Format convergence data as LaTeX `tabular`.\"\"\"\n\n def __init__(self, all_errors, all_rates, resolutions, all_labels):\n \"...
[ [ "numpy.size" ] ]
tiagoaoa/num_gradient_descent
[ "93af93ccdca9ff056afea9c0da0232c54bb712f7" ]
[ "ngd_attacks.py" ]
[ "# -*- coding: utf-8 -*-\n#Functions for the implementation of Adversarial Attacks on Machine Learning Image Classifiers.\n# Tiago Alves <tiago@ime.uerj.br>\n\nimport numpy as np\nfrom numdifftools import Gradient as ndGradient\nimport random\nimport scipy.stats as stats\n\nexp_lambda = 30.0\n\ndef gray_to_rgb(heig...
[ [ "numpy.reshape", "numpy.copy", "numpy.zeros" ] ]
sunblaze-ucb/ensemble-detection-attacks
[ "ff3e85cc58addb8f2ad85eac97443136ba0e6f09" ]
[ "mnist_adv/lib/median.py" ]
[ "import tensorflow as tf\n\n# http://stackoverflow.com/a/43554072/1864688\n\ndef pad_amount(k):\n added = k - 1\n # note: this imitates scipy, which puts more at the beginning\n end = added // 2\n start = added - end\n return [start, end]\n\ndef neighborhood(x, kh, kw):\n # input: N, H, W, C\n ...
[ [ "tensorflow.transpose", "tensorflow.shape", "tensorflow.reshape", "tensorflow.extract_image_patches", "tensorflow.nn.top_k" ] ]
HARPLab/ada_teleoperation
[ "478842a447bbabc31181f76ce3b56aa02b5de298" ]
[ "src/ada_teleoperation/input_handlers/MouseJoystickListener.py" ]
[ "import rospy\nfrom sensor_msgs.msg import Joy\nimport numpy as np\n\nfrom UserInputListener import *\n\nrosmsg_topic = \"/ada/joy\"\n\n\nclass MouseJoystickListener(UserInputListener):\n def __init__(self):\n self.input_topic_name = \"/ada/joy\"\n self.input_message_type = Joy\n super(MouseJoystickListen...
[ [ "numpy.dot", "numpy.array" ] ]
liusida/thesis-bodies
[ "dceb8a36efd2cefc611f6749a52b56b9d3572f7a", "dceb8a36efd2cefc611f6749a52b56b9d3572f7a" ]
[ "cleaned_version/body-templates/walker2d.py", "dataset/walker2d_v6_default/env/walker2d.py" ]
[ "import numpy as np\n\nimport pybullet\nfrom pybullet_envs.gym_locomotion_envs import WalkerBaseBulletEnv\nfrom pybullet_envs.robot_locomotors import WalkerBase\n\nfrom stable_baselines3.common import logger\n\nfrom pybullet_envs.env_bases import Camera\n\nclass Walker2d(WalkerBase):\n foot_list = [\"foot\", \"f...
[ [ "numpy.square", "numpy.abs", "numpy.isfinite" ], [ "numpy.square", "numpy.abs", "numpy.isfinite" ] ]
aagnone3/edit-learn
[ "1e033e3e358510f5400f1c7cc5687cafdcef1a00" ]
[ "ielearn/predict/predict.py" ]
[ "import logging\nimport pickle\nimport numpy as np\nimport pandas as pd\nfrom argparse import ArgumentParser\nfrom os import path\nfrom sklearn.externals import joblib\nfrom ielearn.extract import extract\nfrom ielearn.extract.xmp import update_xmp_files\nfrom ielearn.predict.train import nmi, UniformPredictor\nfro...
[ [ "pandas.concat", "sklearn.externals.joblib.load", "numpy.setdiff1d", "pandas.DataFrame" ] ]
ddfabbro/ddfabbro.github.io
[ "dfbb09691ee2b72d6badb97d122022528569ab33" ]
[ "assets/create_favicon.py" ]
[ "import os\nimport numpy as np\nfrom PIL import Image\nimport matplotlib.pyplot as plt\nfrom scipy.spatial import Delaunay\n\ntemplate = np.float32([\n (0.0792396913815, 0.339223741112), (0.0829219487236, 0.456955367943),\n (0.0967927109165, 0.575648016728), (0.122141515615, 0.691921601066),\n (0.168687863...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.triplot", "scipy.spatial.Delaunay", "matplotlib.pyplot.savefig", "matplotlib.pyplot.axes", "numpy.float32", "matplotlib.pyplot.axis", "numpy.array", "numpy.where" ] ]
pattonw/Floodfill-Skeleton
[ "4a0bb1d61b41eef13658677e730a682e7f3e887d" ]
[ "tests/test_meshes.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nimport unittest\nimport numpy as np\n\nfrom sarbor.meshes import (\n octree_to_sparse_vtk_volume,\n contour_sparse_vtk_volume,\n write_to_stl,\n read_from_stl,\n decimate_mesh,\n # visualize_mesh,\n)\nfrom sarbor.octrees import OctreeVolume\n\nf...
[ [ "numpy.array" ] ]
allyLei/cmnmt
[ "b4310fb4fc9c022c4a94579d009f6243b7d21e82", "b4310fb4fc9c022c4a94579d009f6243b7d21e82" ]
[ "onmt/Beam.py", "onmt/Loss.py" ]
[ "from __future__ import division\nimport torch\nimport onmt\n\nimport pdb\n\n\"\"\"\n Class for managing the internals of the beam search process.\n\n\n hyp1-hyp1---hyp1 -hyp1\n \\ /\n hyp2 \\-hyp2 /-hyp2hyp2\n / \\\n hyp3-hyp3--...
[ [ "torch.stack", "torch.sort" ], [ "torch.nn.NLLLoss", "torch.ones", "torch.min", "torch.split", "torch.autograd.Variable" ] ]
MarkMa1990/scikit-learn
[ "39f37bb63d395dd2b97be7f8231ddd2113825c42" ]
[ "sklearn/utils/estimator_checks.py" ]
[ "import types\nimport warnings\nimport pickle\nimport re\nfrom copy import deepcopy\nfrom functools import partial, wraps\nfrom inspect import signature\n\nimport numpy as np\nfrom scipy import sparse\nfrom scipy.stats import rankdata\nimport joblib\n\nfrom . import IS_PYPY\nfrom .. import config_context\nfrom ._te...
[ [ "numpy.take", "pandas.Series", "numpy.asarray", "numpy.issubdtype", "numpy.dtype", "pandas.DataFrame", "numpy.mean", "numpy.where", "numpy.hstack", "scipy.sparse.issparse", "numpy.unique", "numpy.reshape", "numpy.arange", "numpy.full", "numpy.finfo", ...
PSSF23/progressive-learning
[ "894d25972636def6726e2c4219dc0dc99e1c5949" ]
[ "proglearn/progressive_learner.py" ]
[ "\"\"\"\nMain Author: Will LeVine \nCorresponding Email: levinewill@icloud.com\n\"\"\"\nimport numpy as np\nfrom .base import BaseClassificationProgressiveLearner, BaseProgressiveLearner\n\n\nclass ProgressiveLearner(BaseProgressiveLearner):\n \"\"\"\n A (mostly) internal class for progressive learning. Most ...
[ [ "numpy.concatenate", "numpy.delete", "numpy.array", "numpy.sum" ] ]
kant/Kite-Tracking
[ "3a3780bb21f4cbbcf09c242f0fd586752c96a497" ]
[ "fhog_utils.py" ]
[ "'''\nCode adapted from KCFnb, https://github.com/uoip/KCFnb\n\n'''\nimport numpy as np\nfrom numba.pycc import CC\nimport math\n\n\n# constant\nNUM_SECTOR = 9\nFLT_EPSILON = 1e-07\n\ncc = CC('fhog_utils')\n\n\n@cc.export('func1', '(f4[:,:,:], f4[:,:,:], f4[:], f4[:], f4[:,:], i8[:,:,:], i8,i8,i8)')\ndef func1(dx, ...
[ [ "numpy.sum" ] ]
TiKeil/Masterthesis-LOD
[ "03c1c6748a0464165a666bd9f4f933bc8e4f233b", "03c1c6748a0464165a666bd9f4f933bc8e4f233b" ]
[ "femsolverCoarse.py", "python_files/tests/results/VCLOD_Coefficient_2.py" ]
[ "# This file is part of the master thesis \"Variational crimes in the Localized orthogonal decomposition method\":\n# https://github.com/TiKeil/Masterthesis-LOD.git\n# Copyright holder: Tim Keil \n# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)\n# This file is motivated by gridlod: h...
[ [ "numpy.arange", "numpy.zeros", "numpy.prod" ], [ "numpy.append", "numpy.size", "numpy.prod", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
tatsubori/visual-hints-textworld-rl
[ "a2b4818f46bed10d08f1a0747ac548e6419f0b46" ]
[ "tw_cooking_game_puzzle/cooking_map_builder.py" ]
[ "from PIL import Image, ImageDraw, ImageFont\nimport numpy as np\nimport random\n\nfrom tw_cooking_game_puzzle.role_master_builder import write_clue\n\nfont = ImageFont.load_default()\n\ndef build_dict_rooms(infos):\n '''\n creat a dictionary of rooms rooms_dict\n each room is a key the value is a table 1*...
[ [ "numpy.asarray", "numpy.max", "numpy.zeros" ] ]
parthp08/Robot_Kinematics
[ "49ce354cba81dfc3a04a9a53760fc0b847fc880a" ]
[ "Forward_Kinematics.py" ]
[ "import numpy as np\nimport CoordinateTransformations as C\nfrom DH_transformation import DH_transformation\nfrom FK_plotter import FK_plotter\n \ndef Forward_Kinematics(a_arr, alpha_arr, d_arr, theta_arr, unit='rad', plotting=False):\n \"\"\"\n TODO\n \"\"\"\n n = len(a_arr)\n assert (len(alpha_a...
[ [ "numpy.zeros" ] ]
lyp2333/External-Attention-pytorch
[ "08be6baff82bf22d48b1746fd668446280365b9b", "08be6baff82bf22d48b1746fd668446280365b9b" ]
[ "model/rep/repvgg.py", "model/attention/ECAAttention.py" ]
[ "import torch\r\nfrom torch import mean, nn\r\nfrom collections import OrderedDict\r\nfrom torch.nn import functional as F\r\nimport numpy as np\r\nfrom numpy import random\r\n\r\ndef setup_seed(seed):\r\n torch.manual_seed(seed)\r\n torch.cuda.manual_seed_all(seed)\r\n np.random.seed(seed)\r\n rand...
[ [ "torch.nn.Sequential", "numpy.random.seed", "torch.manual_seed", "torch.randn", "torch.nn.Conv2d", "torch.from_numpy", "torch.cuda.manual_seed_all", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "numpy.zeros", "torch.nn.functional.pad" ], [ "torch.nn.init.constant_",...
JeremieMelo/L2ight
[ "67f93b66ddf8bb5a365834b84ed6acdbc4f48eaf" ]
[ "core/models/sparse_bp_resnet.py" ]
[ "\"\"\"\nDescription:\nAuthor: Jiaqi Gu (jqgu@utexas.edu)\nDate: 2021-10-24 16:24:50\nLastEditors: Jiaqi Gu (jqgu@utexas.edu)\nLastEditTime: 2021-10-24 16:24:50\n\"\"\"\nfrom typing import Callable, Dict, List, Optional, Tuple, Union\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom pyutils...
[ [ "torch.nn.Sequential", "torch.nn.modules.activation.ReLU", "torch.randn", "torch.nn.Conv2d", "torch.nn.functional.adaptive_avg_pool2d", "torch.flatten", "torch.nn.Identity", "torch.nn.BatchNorm2d", "torch.device", "torch.nn.functional.max_pool2d" ] ]
leonchen2012/movielens-recommender
[ "dd7e46993acbdea364893cf84be3dd17e1651106" ]
[ "cf.py" ]
[ "from sklearn.metrics.pairwise import pairwise_distances\nfrom sklearn.metrics import mean_squared_error\nfrom math import sqrt\nfrom mltools import *\n\n\ndef rmse(pred, ground_truth):\n pred = pred[ground_truth.nonzero()].flatten()\n idx = np.where(np.isnan(pred))\n pred[idx] = 5\n idx = np.where(np.i...
[ [ "sklearn.metrics.pairwise.pairwise_distances", "sklearn.metrics.mean_squared_error" ] ]
xtudbxk/fanet
[ "7bdea393166e7a2873ed8a82ce31c0ac14e8b69c" ]
[ "segmentron/models/model_zoo.py" ]
[ "import logging\nimport torch\n\nfrom collections import OrderedDict\nfrom segmentron.utils.registry import Registry\nfrom ..config import cfg\n\nMODEL_REGISTRY = Registry(\"MODEL\")\nMODEL_REGISTRY.__doc__ = \"\"\"\nRegistry for segment model, i.e. the whole model.\n\nThe registered object will be called with `obj...
[ [ "torch.load" ] ]
MarineRoboticsGroup/NF-iSAM
[ "52a09c72deda1043a2e8a2c93c34eb8e01f40ea4" ]
[ "src/flows/prior_dist.py" ]
[ "from torch.distributions import Normal, MultivariateNormal, VonMises\nimport torch\n\n\nclass CustomMultivariateNormal(MultivariateNormal):\n def __init__(self, dim: int, device: str = \"cpu\") -> None:\n self._dim = dim\n self._device = device\n self._loc = torch.zeros(dim).to(device)\n ...
[ [ "torch.empty", "torch.cat", "torch.zeros", "torch.eye", "torch.tensor" ] ]
sentinel-hub/hiector
[ "95102c1fcfa63d127a389262e9d569e3aa3495cc" ]
[ "tests/utils/test_metrics.py" ]
[ "import os\n\nimport geopandas as gpd\nimport pandas as pd\nimport pytest\n\nfrom sentinelhub import CRS, BBox\n\nfrom hiector.utils.metrics import dota_results_to_gdf, get_ap, get_error_matrix, iou\n\n\n@pytest.fixture(name=\"gdf_gt\", scope=\"module\")\ndef gdf_gt(input_folder):\n \"\"\"A pytest fixture to ret...
[ [ "pandas.concat", "pandas.testing.assert_frame_equal" ] ]
scorpionhiccup/Cats_Dogs_Classification
[ "885ac06d84ba84e53ecf416735f75873a3f26104" ]
[ "scripts/species/build_model.py" ]
[ "import copy\nimport time\nfrom torchvision.utils import make_grid\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport torchvision\nfrom torchnet import meter\nfrom torch.autograd import Variable\n\nimport sys\nsys.path.append('scripts')...
[ [ "matplotlib.pyplot.imshow", "torch.nn.functional.softmax", "torch.nn.Dropout2d", "torch.max", "torch.cuda.is_available", "torch.autograd.Variable", "torch.nn.Sigmoid", "matplotlib.pyplot.subplot", "matplotlib.pyplot.figure", "torch.nn.BatchNorm1d", "matplotlib.pyplot.ti...
ArvindSubramaniam/Pruning-Networks-using-Neuron2Neuron-Skip-Connections
[ "bbe402bbf4c5afb4ae712354e8fca5ce320501b8", "bbe402bbf4c5afb4ae712354e8fca5ce320501b8" ]
[ "code/models/MLP.py", "code/models/AlexNet.py" ]
[ "import torch\nimport torchvision\nfrom torch.utils.data import Dataset, DataLoader, ConcatDataset, random_split\nimport os\nfrom torchvision import transforms\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.autograd import Variable, Function\nimport time\nimport num...
[ [ "torch.nn.Linear", "numpy.floor", "torch.nn.functional.log_softmax" ], [ "torch.nn.Dropout", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.nn.ReLU" ] ]
pradeepkr12/auto-sklearn
[ "859fb993607bd5cfb881aca3b346cf4d1addf470", "859fb993607bd5cfb881aca3b346cf4d1addf470" ]
[ "examples/example_extending_preprocessor.py", "autosklearn/ensemble_builder.py" ]
[ "\"\"\"\n==================================================\nExtending Auto-Sklearn with Preprocessor Component\n==================================================\n\nThe following example demonstrates how to create a wrapper around the linear\ndiscriminant analysis (LDA) algorithm from sklearn and use it as a prep...
[ [ "sklearn.model_selection.train_test_split", "sklearn.datasets.load_breast_cancer" ], [ "numpy.load", "numpy.array", "numpy.argmax", "sklearn.utils.validation.check_random_state" ] ]
johnsmithm/caps-frcnn
[ "881eb01a331014d4a88c4e62a6ea4ebe994f62d1" ]
[ "lib/utils/spatial_transformer.py" ]
[ "# Copyright 2016 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.clip_by_value", "tensorflow.matmul", "tensorflow.concat", "tensorflow.range", "tensorflow.zeros", "tensorflow.slice", "tensorflow.shape", "tensorflow.stack", "tensorflow.reshape", "tensorflow.cast", "tensorflow.expand_dims", "tensorflow.ones_like", "...
felixmeyjr/explain-BERT-QA
[ "0b3599812d168d8efc4dd676ff3f1fbde67bc462" ]
[ "visualization/model_wrapper.py" ]
[ "from typing import Tuple, List\n\nimport os\nimport logging\nimport torch\nfrom transformers import BertForQuestionAnswering, BertTokenizer, BertConfig\n# from transformers import AutoModelForQuestionAnswering, AutoTokenizer\n\nfrom data_utils import QASample, SquadExample, QAInputFeatures, RawResult, read_squad_e...
[ [ "torch.device", "torch.no_grad", "torch.tensor" ] ]
suk-hyo-bin/detectron2
[ "67b7e0a3bd45fc1eb433ebeac9fedd1cd5f0a20c" ]
[ "tools/plain_train_net.py" ]
[ "#!/usr/bin/env python\n# Copyright (c) Facebook, Inc. and its affiliates.\n\"\"\"\nDetectron2 training script with a plain training loop.\n\nThis script reads a given config file and runs the training or evaluation.\nIt is an entry point that is able to train standard models in detectron2.\n\nIn order to let one s...
[ [ "torch.cuda.device_count", "torch.isfinite" ] ]
DennisSentler/e-stop-on-coral
[ "21c5c9a57a421c06b7e35ba71863aecb575a6bc6" ]
[ "audio_provider.py" ]
[ "from os import device_encoding\nimport pyaudio\nimport numpy as np\nimport threading\nimport measure\nimport python_speech_features as speech_features\n\nclass AudioProvider(threading.Thread):\n def __init__(\n self, \n device_index: int,\n sample_rate: int = 16000, \n ...
[ [ "numpy.frombuffer", "numpy.expand_dims", "numpy.zeros", "numpy.iinfo" ] ]
thomashopkins32/2048AI
[ "66aa8dccd08bd3aa8c7999dda0db6bdd597c9302" ]
[ "AI2048/agents.py" ]
[ "from abc import abstractmethod\nimport time\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom tqdm import tqdm\n\nfrom AI2048 import config\nfrom AI2048.game import Env2048\nfrom AI2048.model import DQN, ReplayMemory, Transition...
[ [ "numpy.random.random", "torch.zeros", "torch.cat", "torch.load", "torch.topk", "matplotlib.pyplot.subplots", "torch.equal", "torch.tensor", "torch.no_grad", "numpy.exp", "matplotlib.pyplot.show", "numpy.random.randint" ] ]
rvi008/toucan-connectors
[ "60a0e7febeaaf46f22cb94eeb28ac6cd3aefb5ad" ]
[ "tests/test_connector.py" ]
[ "from time import time\n\nimport pandas as pd\nimport pytest\nimport tenacity as tny\nfrom pydantic import create_model\n\nfrom toucan_connectors.toucan_connector import ToucanConnector, ToucanDataSource, strlist_to_enum\n\n\nclass DataSource(ToucanDataSource):\n query: str\n\n\nclass DataConnector(ToucanConnect...
[ [ "pandas.DataFrame" ] ]
camilos-ufm/OSPoolThreads
[ "fc8e182a0d2d37a90b71dd90ec0518a2f79029ac" ]
[ "test.py" ]
[ "import threading\nimport time\nimport pandas as pd\nimport numpy as np \n\nm = 3\nX = pd.read_csv(\"mA.csv\", sep=',', header=None).to_numpy()\nY = pd.read_csv(\"mB.csv\", sep=',', header=None).to_numpy()\n \nprint(len(X[0]))\nprint(len(Y))\n\ndef mult(X, Y):\n result = [[0]*m]\n for z in range(len(Y[0])):\n ...
[ [ "pandas.read_csv" ] ]
KirilBangachev/Python
[ "7ad45a46e02edda86a45969de8768f26ef44b306" ]
[ "digital_image_processing/filters/gaussian_filter.py" ]
[ "\"\"\"\nImplementation of gaussian filter algorithm\n\"\"\"\nfrom cv2 import imread, cvtColor, COLOR_BGR2GRAY, imshow, waitKey\nfrom numpy import pi, mgrid, exp, square, zeros, ravel, dot, uint8\n\n\ndef gen_gaussian_kernel(k_size, sigma):\n center = k_size // 2\n x, y = mgrid[0-center:k_size-center, 0-cente...
[ [ "numpy.square", "numpy.ravel", "numpy.dot", "numpy.zeros" ] ]
paulhenryyopa/nevergrad
[ "d0cf8008347390d3c69f090d6d98a6c74f870c3a" ]
[ "nevergrad/optimization/recastlib.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\n\nimport functools\nimport math\nimport warnings\nimport weakref\nimport numpy as np\nfrom scipy import optimiz...
[ [ "numpy.asarray", "numpy.ones", "numpy.tan", "numpy.random.uniform", "numpy.array" ] ]
GlukhovIgor/Descriptors_package
[ "6d27af1b4e7ab58a14898aaa95c8b2040d7b236b" ]
[ "src/biodescriptors/calc/calc_angles_between_hel.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom biodescriptors.calc import utils\n\n\ndef _calc_angles_between_hel(chain, ref):\n \"\"\"Calculation of angles between all helices in structure.\"\"\"\n \n helix_borders = ref\n vect_helices = []\n for i in range(0, len(helix_borders)):\n vect_hel...
[ [ "numpy.arccos", "numpy.dot", "numpy.linalg.norm", "pandas.DataFrame" ] ]
raoufkeskes/SearchEngine_FromScratch
[ "3e8d760efa3673b279b7f5cf61957c71a766cdd8" ]
[ "tme2/Weighter.py" ]
[ "import numpy as np\nfrom tme1.TextRepresenter import PorterStemmer \nfrom collections import Counter\n\nclass Weighter(object):\n \n def __init__( self , indexer ):\n '''\n Constructor\n '''\n self.indexer = indexer\n \n # abstract method\n def getWeightsForDoc ( self ...
[ [ "numpy.log" ] ]
DIDSR/dldp
[ "2749f86f98280220617b4ffcd2597f8a087c9332" ]
[ "dldp/heatmap_pred/HPC_DPAI/prediction/process_images_grp_normalization_wli.py" ]
[ "\nimport sys\nimport time\n\nfrom matplotlib import cm\nfrom tqdm import tqdm\nfrom skimage.filters import threshold_otsu\nfrom keras.models import load_model\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport os.path as osp\nimport openslide\nfrom pathlib import Path\nfrom skimage.f...
[ [ "numpy.array" ] ]