repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
qqfish/tensorflow-upstream | [
"9db9949c3a59bccbb59767e1b7f2088aa4ca3072"
] | [
"tensorflow/python/kernel_tests/matrix_triangular_solve_op_test.py"
] | [
"# Copyright 2015 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... | [
[
"numpy.linalg.solve",
"numpy.tile",
"numpy.empty",
"tensorflow.python.ops.array_ops.placeholder",
"tensorflow.python.platform.test.is_built_with_rocm",
"tensorflow.python.platform.test.main",
"tensorflow.python.ops.linalg_ops.matrix_triangular_solve",
"numpy.transpose",
"numpy.... |
Haian-Jin/EECS498_labs_public | [
"8f3fda5f910271749c8177846cd5052080e6af4c"
] | [
"A5/single_stage_detector.py"
] | [
"from calendar import c\nimport io\nfrom itertools import count\nimport time\nimport math\nfrom matplotlib.transforms import Bbox\nimport torch \nimport torch.nn as nn\nfrom torch import Tensor, grid_sampler, optim\nimport torchvision\nfrom a5_helper import *\nimport matplotlib.pyplot as plt\n\n\ndef hello_single_s... | [
[
"torch.cat",
"torch.zeros",
"torch.sum",
"torch.no_grad",
"torch.nn.Dropout",
"torch.tensor",
"torch.sort",
"torch.nonzero",
"torch.prod",
"torch.ones_like",
"torch.div",
"torch.sigmoid",
"torch.nn.Conv2d",
"torch.zeros_like",
"torch.exp",
"torch.min... |
CIDARLAB/ibis | [
"5108848c1d45326b3c65213b2f8deaa88fd29be6"
] | [
"ibis/datastucture/logic.py"
] | [
"\"\"\"\n--------------------------------------------------------------------------------\nDescription:\nFunctionality related to parsing verilog and generating logical networks.\n\nWritten by W.R. Jackson, Ben Bremer, Eric South\n--------------------------------------------------------------------------------\n\"\... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure"
]
] |
meaten/MotionAug | [
"ac7d5fa3e5ade1dffca8db50c1281e9a4a747b62"
] | [
"motionAE/src/motionVAETrainer.py"
] | [
"from motionAE.src.motionAETrainer import motionAETrainer\n\nimport os\nimport shutil\nimport numpy as np\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\n\nimport torch\nfrom torch.distributions.normal import Normal\nfrom torch.distributions.kl import _batch_trace_XXT, kl_divergence\n\... | [
[
"matplotlib.pyplot.legend",
"numpy.sqrt",
"numpy.linspace",
"sklearn.cluster.KMeans",
"torch.load",
"torch.zeros",
"matplotlib.pyplot.plot",
"numpy.concatenate",
"sklearn.manifold.TSNE",
"numpy.round",
"numpy.mean",
"torch.no_grad",
"numpy.var",
"numpy.exp",... |
ghosharthita/text2image | [
"d69aee765f116fa0f1e7f12459148d1494441175"
] | [
"mnist-captions/sample-captions.py"
] | [
"import h5py\nimport numpy as np\nimport json\nimport sys\nfrom random import randint\nimport pylab\nfrom util import sigmoid\nimport scipy\nfrom attention import SelectiveAttentionModel\nimport math\nimport cPickle as pickle\nfrom PIL import Image\nimport math\n\n#np.random.seed(np.random.randint(1 << 30))\n#rng =... | [
[
"numpy.argsort",
"numpy.repeat",
"scipy.misc.toimage",
"numpy.zeros"
]
] |
maxjeblick/pytorch-lightning | [
"3fe3cdd70d265b1149a4514139b40cc3ff098661"
] | [
"pytorch_lightning/utilities/distributed.py"
] | [
"# Copyright The PyTorch Lightning team.\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... | [
[
"torch.distributed.all_gather",
"torch.zeros_like",
"torch.distributed.is_initialized",
"torch.distributed.barrier",
"torch.distributed.is_available",
"torch.distributed.get_world_size",
"torch.distributed.all_reduce"
]
] |
jacky-nirvana/incubator-airflow | [
"2318cea74d4f71fba353eaca9bb3c4fd3cdb06c0"
] | [
"airflow/hooks/hive_hooks.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version... | [
[
"pandas.DataFrame"
]
] |
killf/pytorch-cifar10 | [
"2bf864eeed72fd6b2dcbc5513d83eb611d7d86ef"
] | [
"data_loader.py"
] | [
"import torch\n\n\n# 参考资料:https://github.com/NVIDIA/apex/blob/f5cd5ae937f168c763985f627bbf850648ea5f3f/examples/imagenet/main_amp.py#L256\n\nclass DataPreLoader:\n def __init__(self, loader):\n self.next_input = None\n self.next_target = None\n\n self.loader = iter(loader)\n self.stre... | [
[
"torch.cuda.current_stream",
"torch.cuda.Stream",
"torch.cuda.stream"
]
] |
gkswns3708/boostcampaitech2-image-classification-level1-04 | [
"238333baa04a95a155ed5e8aff49fe88ea9f491a"
] | [
"utils/util.py"
] | [
"import json\nimport torch\nimport pandas as pd\nfrom pathlib import Path\nfrom itertools import repeat\nfrom collections import OrderedDict\n\n\ndef ensure_dir(dirname):\n dirname = Path(dirname)\n if not dirname.is_dir():\n dirname.mkdir(parents=True, exist_ok=False)\n\ndef read_json(fname):\n fna... | [
[
"torch.device",
"torch.cuda.device_count",
"pandas.DataFrame"
]
] |
Adrian-St/ba-evaluation | [
"89132f6ec6748f76ad413cf0359cfd7bb4d72fcf"
] | [
"algorithms/fast_scanning.py"
] | [
"from .base import Algorithm\nfrom numba import njit\nimport numpy as np\n\n\nclass FastScanning(Algorithm):\n\n DEFAULT = {\n \"max_diff\": 6.0,\n \"min_size_factor\": 0.0002,\n }\n\n CONFIG = {\n \"max_diff\": [0.5, 1.0, 2.0, 3.0, 4.0, 6.0, 8.0, 12.0],\n \"min_size_factor\": [... | [
[
"numpy.square",
"numpy.arange",
"numpy.zeros"
]
] |
TMats/DeepSDF | [
"eafda02220ff25c6e2afd16697a9c5bc526ff2d1"
] | [
"deep_sdf/utils.py"
] | [
"#!/usr/bin/env python3\n# Copyright 2004-present Facebook. All Rights Reserved.\n\nimport logging\nimport torch\n\n\ndef add_common_args(arg_parser):\n arg_parser.add_argument(\n \"--debug\",\n dest=\"debug\",\n default=False,\n action=\"store_true\",\n help=\"If set, debuggin... | [
[
"torch.cat"
]
] |
StevenZhang0116/gp-alpha | [
"6004fee39b43ae020665a60c68494acf30f87a85"
] | [
"gpdesign/data.py"
] | [
"#!/usr/bin/python3\r\n\"\"\"\r\n这个文件定义了gpAlpha使用的数据, 和相关的预处理. 数据可以是daily或xmin, 不支持offset.\r\n对于每个数据字段, 需要定义其量纲.\r\n需要修改的部分已经标注.\r\n\"\"\"\r\nfrom abc import ABC, abstractmethod\r\nimport numpy as np, deap\r\nfrom deap import gp\r\nfrom base_classes_funcs import Array2d, Array2dValid, Array2dNeutralise, Ephemeral, ... | [
[
"numpy.isnan",
"numpy.array",
"numpy.where",
"numpy.random.rand"
]
] |
FangShancheng/conv-ensemble-str | [
"86029cb059a904ad3a6182e2f0855f0263e34d0b"
] | [
"model/decoder_conv.py"
] | [
"\"\"\"Convoltuional decoder with attention and language ensemble.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport abc\nimport collections\nimport six\nimport tensorflow as tf\nfrom tensorflow.... | [
[
"tensorflow.get_variable",
"tensorflow.concat",
"tensorflow.zeros",
"tensorflow.stack",
"tensorflow.reduce_sum",
"tensorflow.python.ops.math_ops.not_equal",
"tensorflow.pad",
"tensorflow.to_int32",
"tensorflow.nn.conv1d",
"tensorflow.python.ops.control_flow_ops.cond",
"... |
alinlab/L2T-ww | [
"f4dde04e8d5d5725dc3bff2f59cb0d0c26d0bcbe"
] | [
"train_l2t_ww.py"
] | [
"import os\nimport argparse\nimport logging\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom check_dataset import check_dataset\nfrom check_model import check_model\nfrom utils.utils import AverageMeter, accuracy, set_logging_config\nfrom train.meta_optimi... | [
[
"torch.optim.Adam",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.load",
"torch.nn.init.constant_",
"torch.nn.functional.cross_entropy",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.no_grad",
"torch.cuda.is_available",
"torch.optim.SGD",
"torch.nn.functional.inte... |
igormilovanovic/python-data-viz-cookbook | [
"7beb7d2f3cf0374769b885bcd7a083ad2ab477b9",
"7beb7d2f3cf0374769b885bcd7a083ad2ab477b9"
] | [
"3367OS_Code/3367OS_02_Code/ch02-imgshow-zoom.py",
"3367OS_Code/3367OS_05_Code/ch05/ch05_rec01_3dbar.py"
] | [
"import matplotlib.pyplot as plt\nimport scipy\nimport numpy\n\n\n# because the image we loaded is RGB image, \n# http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale\n\nbug = scipy.misc.imread('stinkbug1.png')\n\n# if you want to inspect the shape of the loaded image\n# uncomment following line\n#p... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.gray",
"matplotlib.pyplot.subplot",
"scipy.misc.imread",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
],
[
"matplotlib.ticker.FixedLocator",
"matplotlib.pyplot.show",
"numpy.random.rand",
"matplotlib.pyplot.figure"
... |
dizzyvn/torch-tcav | [
"c9795e817d1104923ef7422f5575607e6b835abc"
] | [
"concept/test_model.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport unittest\nimport os\nimport shutil\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom concept.model import ModelWrapper\n\n\nclass ScaleLayer(nn.Module):\n def __init__... | [
[
"torch.nn.Conv2d",
"torch.tensor",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.FloatTensor",
"torch.rand"
]
] |
mit-drl/Stereo-RCNN | [
"63c6ab98b7a5e36c7bcfdec4529804fc940ee900"
] | [
"lib/model/rpn/proposal_target_layer.py"
] | [
"# --------------------------------------------------------\n# Faster R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Sean Bell\n# --------------------------------------------------------\n# -------------------------------------------... | [
[
"torch.max",
"torch.cat",
"torch.round",
"torch.from_numpy",
"numpy.round",
"numpy.random.permutation",
"torch.FloatTensor",
"numpy.random.rand",
"torch.nonzero",
"torch.arange"
]
] |
wangheda/youtube-8m | [
"07e54b387ee027cb58b0c14f5eb7c88cfa516d58"
] | [
"youtube-8m-wangheda/frame_level_models.py"
] | [
"# Copyright 2016 Google Inc. 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 app... | [
[
"tensorflow.flags.DEFINE_string",
"tensorflow.flags.DEFINE_bool",
"tensorflow.flags.DEFINE_integer"
]
] |
KYHKL-H/RL-enhance-expert- | [
"c7bd24dcf027991c212451e3771c34e55558c436"
] | [
"code/networks.py"
] | [
"import torch\r\nfrom torch import nn\r\nimport torch.nn.functional as F\r\nimport dgl.nn as gnn\r\n\r\nEncode_CBGstate_hidden_dim1=32\r\nEncode_CBGstate_hidden_dim2=16\r\nEncode_CBGstatediff_hidden_dim1=32\r\nEncode_CBGstatediff_hidden_dim2=16\r\nEncode_CBGages_hidden_dim1=32\r\nEncode_CBGages_hidden_dim2=16\r\nEn... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.BatchNorm2d"
]
] |
lzamparo/embedding | [
"9d2aea3fc38698c3fdfcc7ee29269aeff62a5ee4"
] | [
"src/probe2vec/theano_minibatcher.py"
] | [
"import sys\nimport re\nimport gc\nimport time\n\nfrom .token_map import UNK\nfrom .unigram_dictionary import UnigramDictionary\nimport numpy as np\n\nimport os\n# Only import theano and lasagne if environment permits it\nexclude_theano_set = 'EXCLUDE_THEANO' in os.environ\nif exclude_theano_set and int(os.environ[... | [
[
"numpy.array",
"numpy.int32"
]
] |
NoahEBledsoe/cadCAD | [
"1dfb39a764471287eebb2cc71fc0afdc75d2d672"
] | [
"documentation/examples/example_1.py"
] | [
"from pprint import pprint\n\nimport pandas as pd\nfrom tabulate import tabulate\n\nfrom cadCAD.engine import ExecutionMode, ExecutionContext, Executor\nfrom documentation.examples import sys_model_A, sys_model_B\nfrom cadCAD import configs\n\nexec_mode = ExecutionMode()\n\n# Single Process Execution using a Single... | [
[
"pandas.DataFrame"
]
] |
IkerGarcia/DashboardPi | [
"2867cbe3a75f0e6996570c420cf9823fbf1c0431"
] | [
"Example1/DashboardPi.py"
] | [
"#!/usr/bin/env python\n#-*-coding:utf-8-*-\n#This program creates graphs with data obtained by the Sense HAT.\n#Created by Iker García.\n\nimport csv\nimport matplotlib\nmatplotlib.use(\"Agg\") #Added to plot graphs without running X server.\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sense_hat impo... | [
[
"matplotlib.pyplot.legend",
"matplotlib.use",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlabel",
"numpy.loadtxt"
]
] |
nicolaseberle/publifactory-project | [
"05089fc8db603792028565b83035ba3edf32d0e3"
] | [
"main.py"
] | [
"\n# This file has been formatted to be functional with plotly Python\n# Every modification will modify the graphic at the right of your screen.\n# You can find some information about plotly and how to make\n# good charts here : https://plot.ly/python/\n\nimport plotly.graph_objs as go\nimport plotly.io as plio\n\n... | [
[
"numpy.random.randn"
]
] |
ratschlab/tools-omicstools | [
"830c9a1634a88e5ab127e79d1756b5e81fe6d77d"
] | [
"gromics/viz/gwas.py"
] | [
"\"\"\"\nUseful plotting lib with various gwas standard plots\n\"\"\"\nimport sys\nimport matplotlib\nmatplotlib.use('AGG')\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Rectangle\nimport scipy as sp\nimport scipy.stats as spst\nimport math\n\nimport pdb\nimport fdr\n\n\ndef _get_chrm_offsets(chr... | [
[
"scipy.linspace",
"scipy.sum",
"scipy.zeros",
"matplotlib.use",
"scipy.isnan",
"matplotlib.pyplot.savefic",
"scipy.where",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplot",
"scipy.arange",
"matplotlib.pyplot.close",
"scipy.array",
"scipy.log10",
"sci... |
rlatawiec/fastai | [
"13fa123d3458206bb5b9f0df878225a8699ad37c"
] | [
"fastai/vision/models/yolov3.py"
] | [
"import torch\nimport torch.nn as nn\nimport numpy as np\nfrom ...layers import *\n\n\n__all__ = ['parse_cfg', 'create_modules', 'get_IoUs', 'rewrite_results', 'rewrite_bboxes', 'YOLOv3']\n\n\nclass NoNetBlock(Exception):\n\n def __init__(self, blocks):\n self.blocks = blocks\n\n def __str__(self):\n ... | [
[
"torch.nn.Sequential",
"numpy.fromfile",
"torch.max",
"torch.zeros",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.min",
"torch.nn.Upsample",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d"
]
] |
naomilwx/rlkit | [
"d4514f89e4cef0a93a936c4f6b34b2099ae3a523",
"d4514f89e4cef0a93a936c4f6b34b2099ae3a523"
] | [
"rlkit/core/logging.py",
"rlkit/torch/vae/online_vae_offpolicy_algorithm.py"
] | [
"\"\"\"\nBased on rllab's logger.\n\nhttps://github.com/rll/rllab\n\"\"\"\nfrom enum import Enum\nfrom contextlib import contextmanager\nimport numpy as np\nimport os\nimport os.path as osp\nimport sys\nimport datetime\nimport dateutil.tz\nimport csv\nimport json\nimport pickle\nimport errno\nimport torch\nfrom col... | [
[
"numpy.min",
"numpy.median",
"numpy.max",
"numpy.std",
"numpy.average",
"torch.save"
],
[
"torch.multiprocessing.Pipe",
"numpy.zeros",
"numpy.linalg.norm"
]
] |
siuoly/jodie | [
"9be2d1590abf986414da015f3c1a10119db3756e"
] | [
"evaluate_state_change_prediction.py"
] | [
"'''\nThis code evaluates the validation and test performance in an epoch of the model trained in jodie.py.\nThe task is: user state change prediction, i.e., when the state of a user changes from one to another, say normal to abnormal.\n\nTo calculate the performance for one epoch:\n$ python evaluate_state_change_... | [
[
"sklearn.metrics.roc_auc_score"
]
] |
11michalis11/Nashpy | [
"f33a09fa6efd25d8aad965cf8ed907563b5f57d2"
] | [
"src/nashpy/integer_pivoting/integer_pivoting.py"
] | [
"\"\"\"\nA class for integer pivoting. Used for an implementation of the Lemke Howson\nalgorithm.\n\"\"\"\nimport numpy as np\nimport numpy.typing as npt\n\n\ndef make_tableau(M: npt.NDArray) -> npt.NDArray:\n \"\"\"\n Make a tableau for the given matrix M.\n\n This tableau corresponds to the polytope of t... | [
[
"numpy.eye",
"numpy.argmax",
"numpy.count_nonzero",
"numpy.ones"
]
] |
MRossol/HOPP | [
"c8bcf610fdd2cbb27a807ddaf444684ef1aab7e8"
] | [
"examples/optimization/hybrid_opt/hybrid_optimization_problem.py"
] | [
"from math import floor\nfrom pathlib import Path\nfrom typing import Tuple\n\nimport PySAM.Pvwattsv7 as pvwatts\nimport PySAM.Windpower as windpower\nimport numpy as np\nfrom shapely.geometry import (\n LineString,\n Point,\n )\n\nfrom hybrid.sites import SiteInfo\nfrom hybrid.flicker.flicker_mismatch imp... | [
[
"numpy.array",
"numpy.loadtxt"
]
] |
PMSMcqut/pyleecan-of-manatee | [
"3efa06e8bc53c81a3e35457c108290e1d9ec1373"
] | [
"Tests/Plot/LamHole/test_Hole_54_plot.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@date Created on Wed Jan 13 17:45:15 2016\n@copyright (C) 2015-2016 EOMYS ENGINEERING.\n@author pierre_b\n\"\"\"\n\nfrom os.path import join\nfrom unittest import TestCase\n\nimport matplotlib.pyplot as plt\nfrom numpy import pi\n\nfrom pyleecan.Classes.Frame import Frame\nfrom pyl... | [
[
"matplotlib.pyplot.close",
"matplotlib.pyplot.gcf"
]
] |
WeiHao97/DIVA | [
"88dec4a4b881fef34ee2775d6a68a4d32849a5d7"
] | [
"quantization/ImageNet/semiBBattack.py"
] | [
"import numpy as np\nimport os\nos.environ[\"CUDA_VISIBLE_DEVICES\"]=\"0\"\nos.environ['TF_DETERMINISTIC_OPS'] = '1'\nimport tensorflow as tf\nfrom tensorflow.python.framework.ops import enable_eager_execution\nenable_eager_execution()\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nimport tenso... | [
[
"tensorflow.python.framework.ops.enable_eager_execution",
"tensorflow.keras.applications.MobileNet",
"tensorflow.keras.applications.resnet50.ResNet50",
"tensorflow.clip_by_value",
"tensorflow.sign",
"tensorflow.keras.models.clone_model",
"tensorflow.data.experimental.load",
"numpy.... |
dunedyn/MCEq_AIRS | [
"dee4aff5611f5884be245fba15a449c2c676059a"
] | [
"MCEq/geometry/T_downloader.py"
] | [
"\nfrom __future__ import print_function\nfrom __future__ import division\n\nfrom datetime import datetime, timedelta, date\nimport sys\nimport os\nimport glob\nimport numpy as np\n\n# Set working directory\n\ndef AIRS_Download(workpath,startDate,endDate): \n remotedir0 = \"https://acdisc.gesdisc.eosdis.nasa.... | [
[
"numpy.array"
]
] |
martinjameswhite/CobayaLSS | [
"a28900a92aa13f364a43cd2dc928414f50ededee"
] | [
"boss_analysis/boss_analysis_joint/lss_likelihood/joint_likelihood_gc_emu.py"
] | [
"import numpy as np\nimport time\nimport json\n\nfrom cobaya.theory import Theory\nfrom cobaya.likelihood import Likelihood\nfrom scipy.interpolate import InterpolatedUnivariateSpline as Spline\nfrom scipy.signal import argrelmax\nfrom scipy.interpolate import interp1d\nfrom numpy.polynomial.polynomial import p... | [
[
"numpy.dot",
"scipy.interpolate.InterpolatedUnivariateSpline",
"numpy.linspace",
"numpy.nonzero",
"numpy.linalg.inv",
"numpy.isnan",
"numpy.matmul",
"numpy.concatenate",
"numpy.max",
"numpy.append",
"numpy.polynomial.polynomial.polyval",
"numpy.zeros_like",
"num... |
AndyPJiang/basenji | [
"64e43570c8bece156b4ab926608014f489b7965e"
] | [
"bin/basenji_data_read.py"
] | [
"#!/usr/bin/env python\n# Copyright 2017 Calico 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 appli... | [
[
"numpy.sqrt",
"numpy.clip",
"numpy.isnan",
"numpy.nan_to_num",
"numpy.percentile",
"numpy.zeros"
]
] |
Mark-Oussoren/rule-vetting | [
"8b7ad0fcbde03c69d7422f36604ac3aac9ed3d56"
] | [
"rulevetting/projects/csi_pecarn/dataset.py"
] | [
"import glob\nfrom os.path import join as oj\n\nimport numpy as np\nimport os\nimport pandas as pd\nfrom tqdm import tqdm\nfrom typing import Dict\n\nimport rulevetting\nimport rulevetting.api.util\nfrom rulevetting.projects.iai_pecarn import helper\nfrom rulevetting.templates.dataset import DatasetTemplate\n\n\ncl... | [
[
"pandas.concat",
"numpy.split",
"pandas.read_csv",
"numpy.random.seed",
"numpy.arange",
"numpy.random.shuffle",
"pandas.cut",
"pandas.get_dummies"
]
] |
gabelev/MISMI | [
"b3d34632e491d9c96824f9a58cabc093755d8b83"
] | [
"debug/AMZ_tracker_mongo.py"
] | [
"from bs4 import BeautifulSoup\nimport urllib2\nimport csv\nimport pandas as pd\nimport time\nimport lxml\nimport datetime\nimport pickle\nimport requests\nimport re\nimport sys\nimport os\nimport pymongo\n\nfrom retry import retry as _retry\nfrom endpoints import Search_Business, Search_Amish, Category_Amish, Best... | [
[
"pandas.notnull",
"pandas.DataFrame.from_dict"
]
] |
amirgeva/desk | [
"76c4fd2360243348590f925eff2253d0912fe969"
] | [
"qtvnc.py"
] | [
"#!/usr/bin/env python3\nimport sys\nimport numpy as np\nfrom PyQt5 import QtWidgets, QtGui, QtCore\nfrom PyQt5.QtCore import Qt\nimport vnc\nfrom awm import Manager\n\napp = None\ndisplay = 15\n\n\ndef run_gui():\n app.processEvents()\n\n\ndef csvformat(img):\n h, w, c = img.shape\n rows = []\n for y i... | [
[
"numpy.reshape",
"numpy.frombuffer",
"numpy.zeros"
]
] |
mjfields/rstar | [
"ac21512589cf4769cd8a6a93d8fb835377f98ef1"
] | [
"rstar/plot.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\n\n\nimport numpy as np\n\nimport matplotlib.pyplot as plt\nimport corner\n\nfrom .utils import plot_labels, frac_res, frac_res_error, residual, sigma\n\n\n\n\nplt.rcParams['font.family'] = 'serif'\nplt.rcParams['font.weight'] = 'demi'\n\nplt.rcParams['mathtext.b... | [
[
"numpy.array",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.close"
]
] |
Yin-YinjianZhao/WarpX | [
"a194b909f73c44703b013b39dbcead0f278a8ba6"
] | [
"Examples/Modules/resampling/analysis_leveling_thinning.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright 2020 Neil Zaim\n#\n# This file is part of WarpX.\n#\n# License: BSD-3-Clause-LBNL\n\n## In this test, we check that leveling thinning works as expected on two simple cases. Each case\n## corresponds to a different particle species.\n\nimport yt\nimport numpy as np\nimport os\n... | [
[
"numpy.sqrt",
"numpy.abs",
"numpy.unique",
"scipy.special.erf",
"numpy.sort",
"numpy.all",
"numpy.exp",
"numpy.argmax",
"numpy.var",
"numpy.average"
]
] |
KornbergFresnel/multiagent-particle-envs | [
"b06a6b62682a10959fb694c8a8c9c72ca7599b70"
] | [
"multiagent/scenarios/magent_battle.py"
] | [
"import numpy as np\nimport collections\nimport multiprocessing\n\nfrom multiagent.core import World, Agent, Landmark\nfrom multiagent.scenario import BaseScenario\n\n\nclass Scenario(BaseScenario):\n def __init__(self):\n super().__init__()\n\n def make_world(self, **kwargs):\n \"\"\" Generate ... | [
[
"numpy.square",
"numpy.suare",
"numpy.concatenate",
"numpy.all",
"numpy.exp",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros"
]
] |
telegraphic/pygdsm | [
"6c7fc4af75de13cbf76908e99c31d93ba5bd639b"
] | [
"pygdsm/pygsm.py"
] | [
"\"\"\"\ngsm.py\n======\n\nPython interface for the Global Sky Model (GSM) or Oliveira-Costa et. al.\nThis is a python-based equivalent to the Fortran `gsm.f` that comes with the\noriginal data. Instead of the original ASCII DAT files that contain the PCA\ndata, data are stored in HDF5, which is more efficient.\n\n... | [
[
"numpy.log",
"numpy.einsum",
"numpy.min",
"scipy.interpolate.pchip",
"numpy.max",
"scipy.interpolate.interp1d",
"numpy.array"
]
] |
babsey/spiking-activity-dynamics | [
"7db80e6e70dfea6baddf8d6338644273a5d685ec"
] | [
"simulate_random_networks.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# simulate_random_networks.py\n#\n# Copyright 2018 Sebastian Spreizer\n# The MIT License\n\nimport numpy as np\nimport nest\nimport pylab as pl\n\nimport lib.local_values_landscape as lvl\n\n\n\"\"\"\nSet Kernel Status\n\"\"\"\n\nnp.random.seed(0)\nnest.ResetKernel()\nnest.SetKernelStat... | [
[
"numpy.random.normal",
"numpy.random.seed"
]
] |
huang714/raven | [
"2aa5e0be02786523cdeaf898d42411a7068d30b7"
] | [
"framework/Models/PostProcessors/ETStructure.py"
] | [
"# Copyright 2017 Battelle Energy Alliance, 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ... | [
[
"numpy.nditer",
"numpy.vstack",
"numpy.ones",
"numpy.where",
"numpy.zeros"
]
] |
HiEST/cova-tuner | [
"c7f6b991313901d9672b841390a72f921bae80eb"
] | [
"apps/detection_metrics.py"
] | [
"import argparse\nfrom pathlib import Path\nimport os\nimport sys\n\nimport cv2\nimport numpy as np\nimport pandas as pd\n\nimport src.evaluators.coco_evaluator as coco_evaluator\nimport src.evaluators.pascal_voc_evaluator as pascal_voc_evaluator\nimport src.utils.converter as converter\nimport src.utils.general_ut... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
chua-n/particle | [
"faf966a381bef0b7206498c7c5419432348215b3"
] | [
"nn/trial/vae.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass VAE(nn.Module):\n def __init__(self, n_latent=32, lamb=1, lr=1e-3, batch_norm=True, mode='train'):\n \"\"\"VAE 模型类实例初始化函数,定义了各神经网络层的架构。\n\n Parameters:\n -----------\n n_latent(int): 隐变量空间的维数\n lam... | [
[
"torch.randn_like",
"torch.mean",
"torch.nn.Sequential",
"torch.nn.ConvTranspose3d",
"torch.manual_seed",
"torch.randn",
"torch.nn.Sigmoid",
"torch.exp",
"torch.nn.Linear",
"torch.nn.Conv3d",
"torch.nn.functional.binary_cross_entropy",
"torch.no_grad",
"torch.nn... |
mhsung/fuzzy-set-dual | [
"781b0942be7a8bcf1ad034974238315eac058404",
"781b0942be7a8bcf1ad034974238315eac058404",
"781b0942be7a8bcf1ad034974238315eac058404"
] | [
"fuzzy_set_dual/network/retrieve.py",
"fuzzy_set_dual/network/main.py",
"data/generate_partial_objects.py"
] | [
"# Minhyuk Sung (mhsung@cs.stanford.edu)\n# March 2018\n\nimport os, sys\nBASE_DIR = os.path.normpath(\n os.path.join(os.path.dirname(os.path.abspath(__file__))))\nsys.path.append(os.path.join(BASE_DIR, '..', '..'))\nsys.path.append(os.path.join(BASE_DIR, '..', '..', 'network_utils'))\n\nfrom global_variable... | [
[
"numpy.expand_dims",
"numpy.logical_and",
"numpy.arange",
"numpy.random.shuffle",
"numpy.full",
"numpy.argmin",
"numpy.argsort",
"numpy.array",
"numpy.empty"
],
[
"tensorflow.train.get_checkpoint_state",
"numpy.random.seed",
"tensorflow.get_collection",
"ten... |
VahediLab/stripenn | [
"f72b14e0506596fe28730289a717e05b92393288"
] | [
"src/getStripe.py"
] | [
"import numpy as np\nimport pandas as pd\nimport math\nimport matplotlib\nimport cv2 as cv\nfrom src import stats\nfrom src import ImageProcessing\nmatplotlib.use('tkAgg')\nimport matplotlib.pyplot as plt\nimport statistics as stat\nfrom skimage import feature\nimport time\nimport multiprocessing\nimport random\nfr... | [
[
"numpy.nanmedian",
"numpy.minimum",
"pandas.Series",
"pandas.DataFrame",
"numpy.round",
"numpy.seterr",
"numpy.concatenate",
"numpy.mean",
"numpy.nanmean",
"numpy.where",
"numpy.ix_",
"numpy.clip",
"scipy.signal.medfilt",
"numpy.arange",
"numpy.subtract"... |
ValterSalvador/ENGA74_Computational_Intelligence | [
"ce54991eb0df928fd2fad87f0b3284861fac18a6"
] | [
"src/mann/utils/init.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport sys\n\ndef shared_glorot_uniform(shape, dtype=tf.float32, name='', n=None):\n\tif isinstance(shape,int):\n\t\thigh = np.sqrt(6. / shape)\n\t\tshape = [shape]\n\telse:\n\t\thigh = np.sqrt(6. / (np.sum(shape[:2]) * np.prod(shape[2:])))\n\tshape = shape if n is None... | [
[
"numpy.sqrt",
"tensorflow.zeros",
"tensorflow.cast",
"numpy.prod",
"tensorflow.random_uniform",
"numpy.sum",
"numpy.zeros"
]
] |
webcsm/ce-gzsl-keras | [
"398aa389d43e76e5ed9fb49c3f8c1e4a990aaf90"
] | [
"result.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.signal import savgol_filter\n\n\nWINDOW = 101\nPOLY_ORDER = 1\n\n\ndef extract_numbers(s: str) -> list:\n\n l = []\n\n for t in s.split():\n try:\n if t.endswith(\",\"):\n t ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"scipy.signal.savgol_filter",
"matplotlib.pyplot.ylabel"
]
] |
futurewarning/pyannote-audio | [
"1919f15748297667204e2f12756c289235443c24"
] | [
"pyannote/audio/core/model.py"
] | [
"# MIT License\n#\n# Copyright (c) 2020-2021 CNRS\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, mod... | [
[
"torch.randn",
"torch.nn.LogSoftmax",
"torch.no_grad",
"torch.nn.Sigmoid"
]
] |
zhiqwang/BladeDISC | [
"ae4ce5b914a860645e1e4a91b2512148f0885003"
] | [
"pytorch_blade/tests/test_almost_equal.py"
] | [
"import torch\nimport unittest\nimport copy\nfrom torch_blade.testing.common_utils import TestCase\nfrom torch_blade.testing.common_utils import assert_almost_equal\n\nclass TestAlmostEqual(TestCase):\n\n def test_almost_equal(self):\n rect = torch.ones(100, 200)\n square = rect[0:100:2, 0:200:4]\n... | [
[
"torch.ones"
]
] |
kjappelbaum/ml_molsim | [
"1af4c51c04940da5e55ff1d52e302039861f3e95"
] | [
"test/test.py"
] | [
"# basics \nimport os \nimport numpy as np \n\n# data\nimport pandas as pd \nimport pandas_profiling\n\n# machine learning \n# scaling of data\nfrom sklearn.preprocessing import StandardScaler, MinMaxScaler, RobustScaler\n# train/test split\nfrom sklearn.model_selection import train_test_split\n# model selection \n... | [
[
"pandas.read_csv",
"numpy.random.seed"
]
] |
JordanSeay/ML_ART_GAN_Exploration | [
"9816a055a8926e011dd24af3582cd57ed48006b9"
] | [
"data_preprocessing.py"
] | [
"import numpy as np\nfrom PIL import Image, ImageDraw\nfrom tqdm import tqdm\nimport ndjson\n\nwith open('full_simplified_bicycle.ndjson') as f:\n data = ndjson.load(f)\n\n\ndef draw_it(raw_strokes, image_name, dataset_name):\n image = Image.new(\"RGB\", (255,255), color=\"white\")\n image_draw = ImageDraw... | [
[
"numpy.array"
]
] |
umikanero/XDGMM | [
"69ccdd0316acf7b3c7a5aa6164ebd6c30462540c"
] | [
"SDSS/visualization.py"
] | [
"# coding=UTF-8\n# This Python file uses the following encoding: utf-8\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom numpy import linalg\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.cm as cmx\nimport os\nfrom matplotlib.pyplot import MultipleLocator\n\ndef visualize_3d_gmm(points, w, m... | [
[
"numpy.diag",
"matplotlib.pyplot.gca",
"numpy.dot",
"numpy.sqrt",
"matplotlib.pyplot.title",
"numpy.linspace",
"numpy.eye",
"numpy.cos",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.MultipleLocator",
"numpy.round",
"numpy.sin",
"numpy.size",
"numpy.linalg... |
LastRemote/sagemaker-python-sdk | [
"fddf29d9e4383cd3f939253eef47ee79a464dd37"
] | [
"tests/integ/test_neo_mxnet.py"
] | [
"# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"licens... | [
[
"numpy.zeros"
]
] |
samconsidine/thesis_scratch | [
"a1a89188522293c4029073ce3c77b26ccc201c91"
] | [
"neural_exec/model.py"
] | [
"from __future__ import annotations\n\nimport torch\nfrom torch import Tensor\nimport torch.nn as nn\nfrom torch_geometric.nn import MessagePassing\nfrom dataclasses import dataclass\nimport torch.nn.functional as F\n\n\ndevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n\n\nclass ProcessorNetwo... | [
[
"torch.cat",
"torch.nn.ReLU",
"torch.nn.Sigmoid",
"torch.nn.Linear",
"torch.nn.LeakyReLU",
"torch.cuda.is_available",
"torch.nn.GRUCell",
"torch.clamp"
]
] |
johnmarkacala/fastquant | [
"b823a2fcb617184ed92895b78e99217041f0bdbc"
] | [
"python/fastquant/utils/data_split.py"
] | [
"import math\nimport numpy as np\nfrom sklearn.utils.validation import _num_samples\n\n\ndef walk_forward_split(\n X,\n train_size=0.80,\n test_size=None,\n n_splits=3,\n mode=\"sliding\",\n training_overlap_size=0,\n):\n \"\"\"\n Split the time series data into multiple sets(or \"splits\") ... | [
[
"numpy.arange",
"sklearn.utils.validation._num_samples"
]
] |
Ssong24/CenterNet_Custom | [
"526ec70f8dfabf9fb9179c9be28ce50fb2a7961c"
] | [
"src/main.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport _init_paths\n\nimport os\n\nimport torch\nimport torch.utils.data\n\nfrom opts import opts\nfrom models.model import create_model, load_model, save_model\nfrom logger import Logger\nfrom datasets.... | [
[
"torch.device",
"torch.manual_seed",
"torch.no_grad",
"torch.sign"
]
] |
nserrino/mlexray | [
"0fadac398b64428be0bc9f043b5083bda38fbb90"
] | [
"one-offs/resnet.py"
] | [
"from tensorflow.keras.applications.resnet50 import ResNet50\nfrom tensorflow.keras.preprocessing import image\nfrom tensorflow.keras.applications.resnet50 import preprocess_input, decode_predictions\nimport numpy as np\n\nmodel = ResNet50(weights='imagenet')\n\nimg_path = 'elephant.jpg'\nimg = image.load_img(img_p... | [
[
"tensorflow.keras.applications.resnet50.ResNet50",
"numpy.expand_dims",
"tensorflow.keras.applications.resnet50.preprocess_input",
"tensorflow.keras.applications.resnet50.decode_predictions",
"tensorflow.keras.preprocessing.image.load_img",
"tensorflow.keras.preprocessing.image.img_to_arra... |
alexorfanoud/platform-resource-manager | [
"20bf51fe1b96cfd85cb3f5182dd2e1ec1a639925"
] | [
"performance_diagnose/plot.py"
] | [
"\"\"\"Plot.\"\"\"\n\n# Copyright (C) 2018 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
D-TACQ/ACQ400_MDSPLUS | [
"968574d41ab04009ff3738970e5846a5ff2fccfc"
] | [
"python/MDSplus/tests/treeUnitTest.py"
] | [
"#!/usr/bin/python\n# Copyright (c) 2017, Massachusetts Institute of Technology All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# Redistributions of source code must retain the above copy... | [
[
"numpy.int32",
"numpy.sin"
]
] |
jingyibo123/FCGF | [
"f0863a9ba4a29f677c0ddd2248cf4e56b9318add",
"f0863a9ba4a29f677c0ddd2248cf4e56b9318add"
] | [
"benchmark.py",
"model/simpleunet.py"
] | [
"import os\nimport numpy as np\nimport argparse\nimport open3d as o3d\nfrom urllib.request import urlretrieve\nfrom model.resunet import ResUNetBN2C\nfrom lib.timer import MinTimer\n\nimport torch\nimport MinkowskiEngine as ME\n\nif not os.path.isfile('redkitchen-20.ply'):\n print('Downloading a mesh...')\n urlre... | [
[
"numpy.array",
"torch.no_grad",
"torch.cuda.is_available"
],
[
"torch.norm"
]
] |
dillonmarquard/stock-webcrawl | [
"467b6dfdfa9a2dd6f7782a935606698037f9e644"
] | [
"Stock.py"
] | [
"import pandas as pd\nfrom requests_html import HTMLSession\nfrom datetime import date, timedelta\nimport numpy as np\nimport progressbar\n\nfrom Crawler import Crawler\n\nblacklist = ['youtube.com','bloomberg.com','wikipedia.org','wsj.com','sec.gov','outsiderclub.com','marketbeat.com','investing.com','ycharts.com'... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
abarthakur/clustering_riedel_dataset | [
"3f74d3979796bdc70af4dd03df65d790055f73f6"
] | [
"src/t_sne.py"
] | [
"import matplotlib.pyplot as plt\nfrom sklearn.decomposition import PCA\nfrom sklearn.manifold import TSNE\nimport numpy as np\n\ndef tsne_viz(mat, rownames, use_pca=True, learning_rate=1000, n_iter=1000,colors=None, output_filename=None, figheight=40, figwidth=50): \n \"\"\"2d plot of `mat` using t-SNE, wit... | [
[
"numpy.set_printoptions",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"sklearn.manifold.TSNE",
"numpy.array",
"sklearn.decomposition.PCA",
"matplotlib.pyplot.show"
]
] |
oliverruoff/PiBot_v4 | [
"9e724633e1b2972477b5d545e2b13e063a925689"
] | [
"code/flat_mapping_test/flat_mapper.py"
] | [
"import matplotlib.pyplot as plt\nimport json\n\npoint_1_map = [(6.56, 208.9, 209.0, 1.8), (11.93, 189.63, 190.0, 3.6), (17.97, 190.15, 191.0, 5.4), (23.94, 189.49, 191.0, 7.2), (29.88, 188.65, 191.0, 9.0), (35.79, 187.62, 191.0, 10.8), (41.88, 187.38, 192.0, 12.600000000000001), (48.25, 187.91, 194.0, 14.400000000... | [
[
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter"
]
] |
texttheater/OpenNMT-py | [
"fab4518bfb8799d077fddfd485429106a4e1831c"
] | [
"onmt/decoders/transformer.py"
] | [
"\"\"\"\nImplementation of \"Attention is All You Need\"\n\"\"\"\n\nimport torch\nimport torch.nn as nn\n\nfrom onmt.decoders.decoder import DecoderBase\nfrom onmt.modules import MultiHeadedAttention, AverageAttention\nfrom onmt.modules.position_ffn import PositionwiseFeedForward\nfrom onmt.utils.misc import sequen... | [
[
"torch.nn.Dropout",
"torch.ones",
"torch.zeros",
"torch.nn.LayerNorm",
"torch.gt"
]
] |
patrick-kidger/ktools | [
"9b31ed348ce011781576a1e194c9126e2937982f"
] | [
"src/activation.py"
] | [
"import tensorflow as tf\nimport tensorflow.keras.activations as activations\nimport tensorflow.keras.constraints as constraints\nimport tensorflow.keras.initializers as init\nimport tensorflow.keras.layers as layers\nimport tools\n\n\ndef concat_multiple_activations(activation_funcs, funcname='concat_activations',... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.nn.relu",
"tensorflow.keras.initializers.Constant",
"tensorflow.concat",
"tensorflow.keras.constraints.MinMaxNorm",
"tensorflow.identity",
"tensorflow.subtract",
"tensorflow.name_scope",
"tensorflow.keras.activations.get"
]
] |
hpaugam33/vehicule-detection | [
"d2718821fab484874b060eded0698ced9453a8f4",
"d2718821fab484874b060eded0698ced9453a8f4"
] | [
"utils/color_recognition_module/color_histogram_feature_extraction.py",
"vehicle_detection_main_custom_v2.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n# ----------------------------------------------\n# --- Author : Ahmet Ozlu\n# --- Mail : ahmetozlu93@gmail.com\n# --- Date : 31st December 2017 - new year eve :)\n# ----------------------------------------------\n\nfrom PIL import Image\nimpo... | [
[
"numpy.argmax"
],
[
"tensorflow.Graph",
"tensorflow.import_graph_def",
"numpy.expand_dims",
"tensorflow.gfile.GFile",
"numpy.squeeze",
"tensorflow.Session",
"tensorflow.GraphDef"
]
] |
TheoKanning/multi-armed-bandit | [
"7ac632839f56e0fb6ee7103432f9bdf5bdc8ef34"
] | [
"stats.py"
] | [
"import math\nimport numpy as np\nimport scipy.stats\n\n\ndef get_wins(scores):\n # returns a tuple of win counts (p1 wins, p2 wins)\n scores = np.array(scores)\n return np.sum(scores[:, 0] > scores[:, 1]), np.sum(scores[:, 1] > scores[:, 0])\n\n\ndef get_mean_and_ci(p1_wins, p2_wins):\n z = 1.96 # 95%... | [
[
"numpy.array",
"numpy.sum",
"numpy.average"
]
] |
touchfisher/YOLOX_2.0 | [
"3c223babd0944f18006f26bfb5c0736b9d8444da"
] | [
"myset.py"
] | [
"# encoding: utf-8\r\nimport os\r\n\r\nimport torch\r\nimport torch.distributed as dist\r\n\r\nfrom yolox.data import get_yolox_datadir\r\nfrom yolox.exp import Exp as MyExp\r\n\r\n\r\nclass Exp(MyExp):\r\n def __init__(self):\r\n super(Exp, self).__init__()\r\n self.num_classes = 1\r\n\r\n ... | [
[
"torch.utils.data.SequentialSampler",
"torch.utils.data.DataLoader",
"torch.distributed.get_world_size",
"torch.utils.data.distributed.DistributedSampler"
]
] |
carlos10seg/rec-service | [
"91ffb33c57028e959e16a7fc97a4dafee4f610a0"
] | [
"tests/functional/step_defs/train_save_model.py"
] | [
"import os\nimport sys\nimport pandas as pd\nimport json\nimport logging\nfrom sqlalchemy import create_engine\nfrom pandas.io import sql\nfrom lenskit.algorithms import basic, als, Predictor, Recommender\nimport lenskit.algorithms.item_knn as iknn\nimport lenskit.algorithms.user_knn as uknn\nimport lenskit.algorit... | [
[
"pandas.read_csv"
]
] |
n0wis/Stone-Soup | [
"84d14a597d6e0450eb4f2972d7087368ae768cd8"
] | [
"stonesoup/sensormanager/reward.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom copy import deepcopy\nimport numpy as np\nimport datetime\n\nfrom abc import ABC\nfrom typing import Mapping, Sequence, Set\nfrom stonesoup.base import Base, Property\nfrom stonesoup.predictor.kalman import KalmanPredictor\nfrom stonesoup.updater.kalman import ExtendedKalmanUpdater\... | [
[
"numpy.linalg.norm"
]
] |
osaaso3/brainiak | [
"153552c9b65e8354fa45985454f96978e0a92579",
"153552c9b65e8354fa45985454f96978e0a92579"
] | [
"brainiak/hyperparamopt/hpo.py",
"examples/funcalign/srm_image_prediction_example_distributed.py"
] | [
"# Copyright 2016 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l... | [
[
"numpy.random.random",
"numpy.sqrt",
"numpy.sort",
"numpy.ones",
"numpy.dtype",
"numpy.ceil",
"numpy.append",
"numpy.random.normal",
"numpy.argmin",
"numpy.isscalar",
"numpy.array",
"numpy.zeros",
"numpy.sum"
],
[
"matplotlib.pyplot.imshow",
"numpy.s... |
masino-lab/fairMLHealth | [
"943ffed5f57997401823bd2afc257f34f76ea157"
] | [
"test/test___utils.py"
] | [
"\"\"\" Test functions for fairmlhealth.__utils.py\n\"\"\"\n\nfrom logging import warning\nfrom fairmlhealth import measure, report, __validation as valid\nimport numpy as np\nimport pytest\nimport pandas as pd\nfrom .__utils import synth_dataset\n\n\n@pytest.fixture(scope=\"class\")\ndef load_data(request):\n N... | [
[
"pandas.concat",
"numpy.random.RandomState"
]
] |
bbrister/cudaImageWarp | [
"69267e1eb0a4556cdbf2d5eb1411faf0c94cc6ff"
] | [
"python/pyCudaImageWarp/cudaImageWarp.py"
] | [
"\"\"\"\nWarp an image using CUDA. Python wrapper for the C library.\n\n(c) Blaine Rister 2018\n\"\"\"\n\nimport numpy as np\nimport ctypes\nimport pyCudaImageWarp\n\n\"\"\"\nVerify that the inputs are correct. Returns default parameter values.\n\"\"\"\ndef __check_inputs(im, A, shape, device):\n\n # Make su... | [
[
"numpy.zeros",
"numpy.equal",
"numpy.require"
]
] |
HearSys/pattern_finder_gpu | [
"7430e870a112592c127d190014bfccd15068d346"
] | [
"test/test_find_pattern_rotated.py"
] | [
"from pathlib import Path\nimport numpy as np\nimport warnings\n\n\nimport sys\nsys.path.insert(0, str(Path(__file__).parent.parent))\nprint(sys.path[0])\nfrom pattern_finder_gpu import center_roi_around, find_pattern_rotated, rotation_around\n\n\n\ndef test_center_roi_around():\n test_roi = [0, 0, 3, 5]\n as... | [
[
"numpy.allclose",
"numpy.arcsin"
]
] |
wmeints/plsexplain | [
"dec5bd964105f8fe84242474306c0054426814e6"
] | [
"plsexplain/dashboard.py"
] | [
"import pandas as pd\nimport joblib\nimport dalex as dx\nimport progressbar\nimport uvicorn\nfrom .server import make_server\n\n\nclass Dashboard:\n \"\"\"Creates a dashboard to host the explainer logic.\n\n Parameters\n ----------\n model_file : str\n The path to the model. The model should be s... | [
[
"pandas.read_csv"
]
] |
CortlandMorse/pandas | [
"37dfcc1acf3b37a1ff5251fee3380a179da1f2ed",
"37dfcc1acf3b37a1ff5251fee3380a179da1f2ed"
] | [
"pandas/core/ops/__init__.py",
"pandas/tests/indexes/datetimes/test_tools.py"
] | [
"\"\"\"\nArithmetic operations for PandasObjects\n\nThis is not a public API.\n\"\"\"\nimport datetime\nimport operator\nfrom typing import Tuple, Union\n\nimport numpy as np\n\nfrom pandas._libs import Timedelta, Timestamp, lib\nfrom pandas.util._decorators import Appender\n\nfrom pandas.core.dtypes.common import ... | [
[
"pandas.core.computation.expressions.evaluate",
"pandas.core.ops.array_ops.logical_op",
"numpy.asarray",
"pandas._libs.lib.is_scalar",
"pandas.core.arrays.TimedeltaArray",
"pandas.core.ops.array_ops.arithmetic_op",
"pandas.core.ops.common.unpack_zerodim_and_defer",
"pandas.core.ops... |
filipeaguiarrod/Redes-Neurais-Artificiais-em-Python | [
"11d3b27d1f456aae1412e2e333bad3dad6edcc03"
] | [
"Perceptron de uma Camada/Perceptron Ajuste Pesos.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Aug 9 16:14:10 2020\n\n@author: rodri\n\"\"\"\n\n\n#Otimizando Percpetron com numpy (soma)\n\n\nimport numpy as np\n\n# Entrada e pesos para matriz:\n# x1 x2 sáidas\n# 0 0 0\n# 0 1 0 \n# 1 0 0 \n# 1 1 1\n\n\nentradas = np.array([[0,0],[0,1],[1,0],[1,1]]) #np.array c... | [
[
"numpy.array",
"numpy.where"
]
] |
pkaram/elliot | [
"85bd3201d126f93764f5b4b7341e57315be9d3ef"
] | [
"elliot/recommender/unpersonalized/random_recommender/Random.py"
] | [
"\"\"\"\nCreated on April 4, 2020\nTensorflow 2.1.0 implementation of APR.\n@author Anonymized\n\"\"\"\n\nimport numpy as np\n\nfrom elliot.recommender.base_recommender_model import BaseRecommenderModel\nfrom elliot.recommender.recommender_utils_mixin import RecMixin\nfrom elliot.utils.write import store_recommenda... | [
[
"numpy.arange",
"numpy.random.seed"
]
] |
changhoonhahn/centralMS | [
"39b4509ea99e47ab5cf1f9be8775d53eee6de80f"
] | [
"tests/evolver.py"
] | [
"'''\n'''\nimport time \nimport numpy as np \n# -- centralms -- \nfrom centralms import util as UT \nfrom centralms import catalog as Cat\nfrom centralms import evolver as Evo\nfrom centralms import observables as Obvs\n# -- plotting --\nimport corner as DFM \nimport matplotlib as mpl\nimport matplotlib.pyplot as p... | [
[
"matplotlib.pyplot.close",
"numpy.sum",
"numpy.linspace",
"matplotlib.pyplot.figure"
]
] |
LeeHann/pytorchTutorial | [
"74907915f41a8627ee84363cfc729696e5472732"
] | [
"02_LEARNING_PYTORCH_WITH_EXAMPLES/02_tensor.py"
] | [
"\"\"\"\n텐서는 종종 50배 혹은 그 이상의 속도 향상을 제공하는 GPU를 사용할 수 있다.\n텐서는 개념적으로 numpy 배열과 동일하지만,\npytorch가 텐서의 다양한 연산을 위해 다양항 기능을 제공한다.\n또한 numpy와 달리 GPU를 사용해 수치 연산을 가속할 수 있다.\npytorch 텐서를 gpu에서 실행하기 위해서는 단지 적절한 장치를 지정해주기만 하면 된다.\n# device = torch.device(\"cuda:0\") 이렇게.\n\"\"\"\n\n# -*- coding: utf-8 -*-\n\nimport torch\nimpor... | [
[
"torch.device",
"torch.randn",
"torch.linspace",
"torch.sin"
]
] |
pipo-chen/python-machine-learning | [
"fba486d20317ea8f3f1c85e6f9cc14909a20456e"
] | [
"phase/playML/simpleLinearRegression_test.py"
] | [
"import numpy as np\n\nclass SimpleLinearRegression:\n\n\tdef __init__(self):\n\t\tself.a_ = None\n\t\tself.b_ = None\n\n\tdef fit(self, x_train, y_train):\n\t\t#因为我们目前做的是一个特征的情况,所以判断维度 1 维\n\t\tassert x_train.ndim == 1,\\\n\t\t\"simple linear regressor can only solve simgle feature\"\n\t\tassert len(x_train) == le... | [
[
"numpy.mean"
]
] |
alisiahkoohi/importance-of-transfer-learning | [
"bb4c7943f4ff64a2f1785503328b4cbb4f5111aa"
] | [
"src/simulation-conditioning/src/model.py"
] | [
"import os\nimport time\nimport tensorflow as tf\nimport numpy as np\nfrom collections import namedtuple\nimport h5py\nfrom module import *\nfrom utils import *\nfrom math import floor\nfrom random import shuffle\nimport random\n\nclass simulation_conditioning(object):\n def __init__(self, sess, args):\n ... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.norm",
"numpy.absolute",
"tensorflow.summary.FileWriter",
"numpy.mod",
"tensorflow.ones_like",
"tensorflow.placeholder",
"tensorflow.trainable_variables",
"tensorflow.global_variables_initializer",
"tensorflow.zeros_like"... |
cbarrick/toys | [
"0368036ddb7594c0b6e7cdc704aeec918786e58a",
"0368036ddb7594c0b6e7cdc704aeec918786e58a"
] | [
"toys/datasets/simulated.py",
"toys/data.py"
] | [
"from typing import Any, Sequence\n\nimport numpy as np\n\nimport toys\nfrom toys.data import Dataset\n\n\nclass SimulatedPolynomial(Dataset):\n '''A simulated polynomial dataset with gaussian noise.\n\n A simulated polynomial dataset has two columns ``(input, target)``.\n Both columns may have arbitrary s... | [
[
"numpy.random.RandomState",
"numpy.prod"
],
[
"torch.utils.data.DataLoader",
"numpy.concatenate",
"numpy.shape",
"torch.cuda.is_available",
"numpy.isscalar",
"numpy.random.randint"
]
] |
xelibrion/catalyst | [
"9675e260f7880b2e8678b9158fc05f810a2189dc"
] | [
"catalyst/utils/image.py"
] | [
"from typing import List, Tuple\nimport logging\nimport os\nimport tempfile\nimport numpy as np\nimport imageio\nfrom skimage.color import label2rgb, rgb2gray\n\nimport torch\n\n_IMAGENET_STD = (0.229, 0.224, 0.225)\n_IMAGENET_MEAN = (0.485, 0.456, 0.406)\n\nlogger = logging.getLogger(__name__)\n\nJPEG4PY_ENABLED =... | [
[
"numpy.expand_dims",
"numpy.ascontiguousarray",
"torch.from_numpy",
"numpy.moveaxis",
"numpy.array",
"numpy.zeros"
]
] |
brucemuller247/HierarchicalLosses | [
"d4974ea179e949befd397c6c882732faa8822718"
] | [
"ptsemseg/loader/mapillary_vistas_loader.py"
] | [
"import os\nimport json\nimport torch\nimport numpy as np\nimport scipy.misc as m\n\nfrom torch.utils import data\n\nfrom ptsemseg.utils import recursive_glob\nfrom ptsemseg.augmentations import *\n\nclass mapillaryVistasLoader(data.Dataset):\n def __init__(self, root, split=\"training\", img_size=(640, 1280), \... | [
[
"numpy.array",
"torch.utils.data.DataLoader",
"numpy.zeros"
]
] |
Piki1989/spacetimeformer | [
"7e0caf17dd03e5d25e2766c4f7132805779bcc40"
] | [
"spacetimeformer/linear_model/linear_ar.py"
] | [
"import torch\nfrom torch import nn\n\n\nclass LinearModel(nn.Module):\n def __init__(self, context_points: int):\n super().__init__()\n self.window = context_points\n self.linear = nn.Linear(context_points, 1)\n\n def forward(self, y_c):\n bs, length, d_y = y_c.shape\n inp ... | [
[
"torch.nn.Linear"
]
] |
jn89b/utm_monte_carlo_simulation | [
"e344a576e488ad18b5a4be123ae530a85ee30428"
] | [
"scripts/astar_3d_drones.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Oct 20 16:14:14 2021\n\n@author: jn89b\n\nAstar \ntake in grid size\ntake in collision objects \ntake in x amount of drones\n\"\"\"\nfrom queue import PriorityQueue\nfrom scipy import spatial\n\nimport numpy as np\nimport collections\nimport heapq\nimport numpy as np... | [
[
"matplotlib.pyplot.axes",
"scipy.spatial.KDTree",
"matplotlib.pyplot.grid",
"numpy.array",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.figure"
]
] |
jwcarr/vertical_drift | [
"5b4b6c475b5118950514dc01960391ef0d95bd19"
] | [
"algorithms/Python/examples.py"
] | [
"# This script runs a simple test case through all ten algorithms. Tested under\n# Python 3.8.5 with the following packages:\n# - numpy 1.19.1\n# - scikit-learn 0.23.2\n# - scipy 1.5.2\n\nimport numpy as np\nimport drift_algorithms\n\n# 2D array representing the XY coordinates of the original fixations\nfixation_XY... | [
[
"numpy.array"
]
] |
xiguadong/ppq | [
"6c71adb3c2a8ca95967f101724b5e4b3e6f761ff"
] | [
"ppq/parser/caffe/caffe_import_utils.py"
] | [
"from typing import Dict, List\n\nimport numpy as np\nimport torch\nfrom ppq.core import NetworkFramework, empty_ppq_cache\nfrom ppq.executor import TorchExecutor\nfrom ppq.IR import (BaseGraph, GraphCommand, GraphCommandType, GraphFormatter,\n GraphMerger, Operation, Variable)\n\nfrom . import p... | [
[
"torch.from_numpy",
"numpy.ones",
"numpy.random.rand",
"torch.cuda.is_available",
"numpy.array",
"numpy.zeros"
]
] |
AterhiM/BERT-E2E-ABSA | [
"9266a851fd1d7164eb0fc422d3f5eb02e474080b"
] | [
"work.py"
] | [
"import argparse\r\nimport os\r\nimport torch\r\nimport numpy as np\r\n\r\nfrom glue_utils import convert_examples_to_seq_features, compute_metrics_absa, ABSAProcessor\r\nfrom tqdm import tqdm\r\nfrom transformers import BertConfig, BertTokenizer, XLNetConfig, XLNetTokenizer, WEIGHTS_NAME\r\nfrom absa_layer import ... | [
[
"torch.load",
"torch.utils.data.TensorDataset",
"torch.utils.data.SequentialSampler",
"torch.utils.data.DataLoader",
"torch.tensor",
"torch.no_grad",
"torch.cuda.is_available",
"torch.cuda.device_count",
"torch.save"
]
] |
lambda-stockly/build-stockly-DS | [
"e5dd50b574298ca5eaff54c5e25ec15dd666d63c"
] | [
"sentiment.py"
] | [
"import pandas as pd\nimport numpy as np\nimport os\nimport tweepy\nimport nltk\nfrom nltk.sentiment.vader import SentimentIntensityAnalyzer\n\n'''\n This script will be for Twitter Sentiment and News Sentiment.\n'''\n\nclass TwitterSentiment():\n '''\n TwitterSentiment object wth one parameter being t... | [
[
"numpy.max",
"pandas.Series",
"pandas.DataFrame"
]
] |
hmvege/GluonicLQCD | [
"9bb7466fce408bf51cb98d65f639acd37d034d62"
] | [
"scripts/error_checker_jacks_data.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\njd = np.loadtxt(\"../jacks_data/jackTest/test/_Qt_t10.000000\",skiprows=1)[:,1]\n\nmd = \"0.347143836683771 0.133306628081828 0.060674477592637 0.094298802835399 0.112075409092791 0.002688502164145 -0.142613671287127 -0.219390147983323 -0.257781516998556 -0.34... | [
[
"matplotlib.pyplot.legend",
"numpy.abs",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"numpy.loadtxt"
]
] |
sv2518/tensor-sensor | [
"8e46667da8b5f4ace022c7bd28e4bb27f37dc96e"
] | [
"tsensor/analysis.py"
] | [
"\"\"\"\nMIT License\n\nCopyright (c) 2020 Terence Parr\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify... | [
[
"matplotlib.pyplot.close"
]
] |
AshKelly/PyAutoLens | [
"043795966338a655339e61782253ad67cc3c14e6",
"043795966338a655339e61782253ad67cc3c14e6",
"043795966338a655339e61782253ad67cc3c14e6"
] | [
"test/lens/stack/test_lens_data_stack.py",
"test/integration/tools.py",
"test/lens/test_plane.py"
] | [
"import numpy as np\nimport pytest\n\nfrom autolens.data import ccd as im, convolution\nfrom autolens.data.array.util import grid_util\nfrom autolens.data.array import scaled_array\nfrom autolens.data.array import mask as msk\nfrom autolens.lens.stack import lens_data_stack as lis\nfrom autolens.model.inversion imp... | [
[
"numpy.array",
"numpy.full",
"numpy.ones"
],
[
"numpy.ones"
],
[
"numpy.array",
"numpy.full",
"numpy.ones"
]
] |
SRagy/pyprob | [
"c8fc67d5f4ad78d565a86c2f86abe10b73549f18"
] | [
"pyprob/distributions/uniform.py"
] | [
"import torch\n\nfrom . import Distribution\nfrom .. import util\n\n\nclass Uniform(Distribution):\n def __init__(self, low, high):\n low = util.to_tensor(low)\n high = util.to_tensor(high)\n super().__init__(name='Uniform', address_suffix='Uniform', torch_dist=torch.distributions.Uniform(lo... | [
[
"torch.distributions.Uniform"
]
] |
mamromer/automl | [
"79370be71f208f2c1e00ff75f62a0eed19769e92"
] | [
"efficientdet/backbone/efficientnet_model_test.py"
] | [
"# Copyright 2020 Google Research. 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... | [
[
"tensorflow.compat.v1.test.main",
"tensorflow.compat.v1.zeros",
"tensorflow.compat.v1.disable_v2_behavior"
]
] |
upmem/dpu_kmeans | [
"cd84ca1cd9b49116aeb22c500f7d1c78600b3269"
] | [
"benchmarks/benchmark.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport os\nfrom collections.abc import Sequence\nfrom random import random\nfrom time import perf_counter, sleep\n\nimport numpy as np\nimport pandas as pd\nimport yaml\nfrom sklearn.cluster import KMeans as CPUKMeans\nfrom sklearn.datasets import make_blobs\nfrom... | [
[
"pandas.concat",
"sklearn.cluster.KMeans",
"sklearn.datasets.make_blobs",
"pandas.read_parquet",
"pandas.DataFrame.from_dict",
"sklearn.metrics.adjusted_rand_score",
"sklearn.metrics.calinski_harabasz_score"
]
] |
jamfly/ERCNN | [
"5a6a596538ab5417580b2989395597125d646c6f"
] | [
"run.py"
] | [
"from torch.utils.data.sampler import WeightedRandomSampler\nfrom torch.utils.data import DataLoader, random_split\nfrom tensorboardX import SummaryWriter\n\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torch\n\nfrom dataloader import SentenceMatchingDataset, ToTensor\n\nfrom models.rcnn imp... | [
[
"torch.cuda.manual_seed",
"torch.load",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.utils.data.random_split",
"torch.cuda.is_available"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.