repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
FusionBolt/nncase | [
"61e41170faed249303295d184f611f27cfefce9d"
] | [
"tests/importer/onnx/basic/test_matmul.py"
] | [
"# Copyright 2019-2021 Canaan Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ag... | [
[
"torch.randn",
"torch.matmul"
]
] |
ayush94582/pifu_surreal | [
"f370165481361991146fb80a0757be38a0763961"
] | [
"lib/model/HGPIFuNet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .BasePIFuNet import BasePIFuNet\nfrom .SurfaceClassifier import SurfaceClassifier\nfrom .DepthNormalizer import DepthNormalizer\nfrom .HGFilters import *\nfrom ..net_util import init_net\n\n\nclass HGPIFuNet(BasePIFuNet):\n '''\n HG P... | [
[
"torch.nn.Sigmoid",
"torch.cat",
"torch.nn.MSELoss"
]
] |
nntrongnghia/learn-recsys | [
"43505c2663255d10e900f4cb98553eb5058e0a09"
] | [
"caser.py"
] | [
"from argparse import ArgumentParser\nfrom turtle import forward\nfrom typing import List\n\nimport numpy as np\nimport pytorch_lightning as pl\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom pytorch_lightning.loggers import TensorBoardLogger\nfrom torchmetrics import RetrievalHitRate\n\... | [
[
"torch.stack",
"torch.nn.Linear",
"torch.nn.AdaptiveMaxPool2d",
"torch.nn.Embedding",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.sigmoid",
"torch.cat",
"torch.nn.Dropout"
]
] |
Adityaojas/Pose-Estimation-Clean | [
"9096512da1e42189b5ed98b61e304e93526a0be4"
] | [
"open_pose.py"
] | [
"# Imprt Libraries\nfrom scipy.spatial import distance as dist\nimport numpy as np\nimport pandas as pd\nimport progressbar\nimport cv2\n\n# Necessary Paths\nprotoFile = \"openpose-master/models/pose/mpi/pose_deploy_linevec_faster_4_stages.prototxt\"\nweightsFile = \"openpose-master/models/pose_iter_160000.caffemod... | [
[
"numpy.zeros",
"pandas.DataFrame",
"numpy.copy"
]
] |
wrutek/cnn_playground | [
"3ed013927838767d594e401dc8bbffc7ee363af2"
] | [
"dataset.py"
] | [
"from tensorflow.contrib.keras import datasets\nimport numpy as np\n\n\nclass MnistDataset:\n def __init__(self):\n (self.train_images, self.train_labels), (self.test_images, self.test_labels) = datasets.mnist.load_data()\n print('Dataset loaded')\n\n self.train_images = self.train_images/25... | [
[
"tensorflow.contrib.keras.datasets.mnist.load_data"
]
] |
vincentschut/isce2 | [
"1557a05b7b6a3e65abcfc32f89c982ccc9b65e3c"
] | [
"components/isceobj/TopsProc/runOverlapIfg.py"
] | [
"#\n# Author: Piyush Agram\n# Copyright 2016\n#\n\n\nimport isceobj\nimport stdproc\nfrom stdproc.stdproc import crossmul\nimport numpy as np\nfrom isceobj.Util.Poly2D import Poly2D\nimport argparse\nimport os\nimport copy\nfrom isceobj.Sensor.TOPS import createTOPSSwathSLCProduct\nfrom .runBurstIfg import adjustVa... | [
[
"numpy.complex64",
"numpy.zeros",
"numpy.conj",
"numpy.exp",
"numpy.memmap"
]
] |
kyspencer/GAMMA-PC-A-Greedy-Memetic-Algorithm-for-Storing-Cooling-Objects | [
"3462ff8cc555ad646b59909c661ca58b21294a7b"
] | [
"SampleScripts/tests/tests_moma.py"
] | [
"# test_moma.py\n# This file tests moma_dynamic.py for errors.\n# Author: Kristina Yancey Spencer\n\nimport unittest\nfrom mock import Mock\nimport binpacking_dynamic as bp\nimport coolcookies\nimport h5py\nimport mooproblem\nimport moma_dynamic as moma\nimport numpy as np\nimport solutions_dynamic as sols\nf... | [
[
"numpy.load",
"numpy.zeros",
"numpy.sum"
]
] |
ojotoxy/TensorFlow-Image-Classifier-using-Inception-v3-deep-learning | [
"b73bfc379e8ac3080d4dc9e756833c5a30e5de4f"
] | [
"train.py"
] | [
"#!/usr/bin/env python3\n# 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/LICEN... | [
[
"tensorflow.summary.scalar",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.reduce_max",
"tensorflow.matmul",
"tensorflow.squeeze",
"tensorflow.name_scope",
"tensorflow.image.resize_bilinear",
"tensorflow.Variable",
"tensorflow.summary.FileWriter",
"tensorfl... |
NonAbelianCapu/PyCompton | [
"a9f79d77b5d312a45bad341f961d36b703d12579"
] | [
"src/simulation.py"
] | [
"import particle as p\nimport detector as dct\nimport particle_source as ps\nimport cross_sections as xs\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport random\n\nclass Simulation(object):\n \"\"\"docstring for .\"\"\"\n\n def __init__(self, T, dt, detector, particle_source):\n\n self.T = ... | [
[
"numpy.log"
]
] |
trinhvietthanh/federated-learning | [
"95d79b76558e6d801f7d2b4d21bf68a7889b920a"
] | [
"src/baseline_main.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Python version: 3.6\n\n\nfrom tqdm import tqdm\nimport matplotlib.pyplot as plt\n\nimport torch\nfrom torch.utils.data import DataLoader\n\nfrom utils import get_dataset\nfrom options import args_parser\nfrom update import test_inference\nfrom models import MLP, CN... | [
[
"torch.utils.data.DataLoader",
"torch.nn.NLLLoss",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"torch.cuda.set_device"
]
] |
akin-aroge/NXCT | [
"bae6347ba8da1e433a46520bd346babf64f25481"
] | [
"fctest/__PolCurve__.py"
] | [
"import matplotlib.pyplot as plt\n\n\nclass PolCurve:\n\n def __init__(self, current_density, voltage):\n\n self.current_density = current_density\n self.voltage = voltage\n\n def plot_pol_curve(self, label=None, return_axes=None, ax=None):\n\n if ax is None:\n ax = plt.gca()\n... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.close"
]
] |
Lachimax/FRB | [
"aa3bb6828db0cf81931dac35cf7bd7184fc3b598"
] | [
"frb/figures/utils.py"
] | [
"\"\"\" Simple utilities for figures\"\"\"\n\nimport numpy as np\nimport matplotlib as mpl\n\n\ndef log_me(val, err):\n \"\"\"\n Generate log and error from linear input\n \n Args:\n val (float): \n err (float): \n\n Returns:\n float, (float/None):\n Returns none if th... | [
[
"numpy.log10",
"matplotlib.rc"
]
] |
dendisuhubdy/ClassyVision | [
"c7f8de4615181b5a14dd5ec44fa72bebb790e886"
] | [
"classy_vision/models/resnext.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nImplementation of ResNeXt (https://arxiv.org/pdf/1611.05431.pdf)\n\"\"\"\n\nimport copy\nimport math... | [
[
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.init.kaiming_normal_",
"torch.nn.init.constant_",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.ReLU"
]
] |
herolab-uga/pf-doa-localization | [
"f6d4f3b5bafdde7a9afa905b96378fdc113f70f6"
] | [
"dataset1/DifferentialRSS-Localization-DataSet1.py"
] | [
"import math\nimport numpy as np\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\nfrom matplotlib import pyplot as pb\nimport random\nfrom datetime import datetime\nimport time\nimport sys\nimport csv\n\n\ndef dist(x, y, pos):\n return math.sqrt((pos[0]-x)**2 + (po... | [
[
"numpy.sum",
"numpy.subtract",
"numpy.arange",
"numpy.random.normal",
"numpy.std",
"numpy.average"
]
] |
MobleyLab/SAMPL6 | [
"c661d3985af7fa0ba8c64a1774cfb2363cd31bda"
] | [
"host_guest/Analysis/Scripts/pkganalysis/efficiency.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"Functions for the efficiency statistical analysis.\"\"\"\n\n\n# =============================================================================\n# GLOBAL IMPORTS\n# =============================================================================\n\nimport copy\n\nimport numpy as np\nimpor... | [
[
"numpy.sqrt",
"numpy.allclose",
"scipy.special.gammaln",
"numpy.abs",
"numpy.exp",
"numpy.log10",
"numpy.nonzero",
"scipy.integrate.trapz",
"numpy.std",
"numpy.array",
"numpy.mean"
]
] |
tostenzel/thesis-projects-tostenzel | [
"18a3ee89fcd558ad2a7cfe1020980da75b9d034a"
] | [
"scrypy/jac_estimation_chol.py"
] | [
"\"\"\"\nEstimates covariance matrix for KW94 Dataset 1 with\nSimulated Max. Likelihood.\n\n\"\"\"\nimport os\n\nimport numpy as np\nimport pandas as pd\nimport respy as rp\nfrom estimagic.differentiation.differentiation import jacobian\nfrom estimagic.inference.likelihood_covs import cov_jacobian\nfrom estimagic.o... | [
[
"numpy.sqrt",
"pandas.DataFrame",
"pandas.concat",
"numpy.diag"
]
] |
guoyk1990/Keras-FCN | [
"35afe12e514a3bf5e56bc90e69d5b329ce9ae68d"
] | [
"evaluate.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom pylab import *\nimport os\nimport sys\nimport time\nimport cv2\nfrom PIL import Image\nfrom keras.preprocessing.image import *\nfrom keras.utils.np_utils import to_categorical\nfrom keras.models import load_model\nimport keras.backend as K\n\nfrom models im... | [
[
"numpy.ravel",
"numpy.sum",
"numpy.mean",
"numpy.diag"
]
] |
Christopher-Bradshaw/emcee | [
"d2047e867afc8a2b0cce9eb3af4a56b3017aaba9"
] | [
"emcee/tests/unit/test_autocorr.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom __future__ import division, print_function\n\nimport pytest\nimport numpy as np\n\nfrom emcee.autocorr import integrated_time, AutocorrError\n\n\ndef get_chain(seed=1234, ndim=3, N=100000):\n np.random.seed(seed)\n a = 0.9\n x = np.empty((N, ndim))\n x[0] = np.zeros(ndim... | [
[
"numpy.empty",
"numpy.zeros",
"numpy.random.randn",
"numpy.random.seed",
"numpy.abs",
"numpy.random.rand"
]
] |
bqia0/CycleGAN | [
"8be914de7f75de91d2c43c4745e4292d138ff591"
] | [
"networks.py"
] | [
"\nimport torch\nimport torch.nn as nn\nimport torchvision\nimport torchvision.datasets as datasets\nimport torchvision.transforms as transforms\nimport utils\nimport os\nfrom PIL import Image\n\n\nclass ResnetGenerator(nn.Module):\n \"\"\" Generator class utilizing resnets\"\"\"\n\n def __init__(self, input_... | [
[
"torch.utils.data.DataLoader",
"torch.nn.L1Loss",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.Conv2d",
"torch.nn.ReflectionPad2d",
"torch.cat",
"torch.nn.Dropout",
"torch.nn.ConvTranspose2d",
"torch.ones_like",
"torch.ones",
"torch.load",
"torch.nn.MSE... |
daheyinyin/GAN | [
"4ae0535738fd860c611868c5bdc76298809bba1d"
] | [
"cgan64.py"
] | [
"import os,sys\nimport matplotlib.pyplot as plt\nimport itertools\nimport pickle\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torch.autograd as autograd\nfrom torchvision import datasets, transforms\nfrom torchvision.utils import save... | [
[
"torch.utils.data.DataLoader",
"matplotlib.pyplot.tight_layout",
"torch.rand",
"torch.cuda.is_available",
"matplotlib.pyplot.ylabel",
"torch.nn.Conv2d",
"torch.nn.InstanceNorm2d",
"matplotlib.pyplot.plot",
"torch.cat",
"torch.nn.ConvTranspose2d",
"torch.nn.init.kaiming_... |
zastari/tropycal | [
"6fce00ccd246b4c4454b9bf0a483b551909cf2a2"
] | [
"tests/tracks.py"
] | [
"\"\"\"Tests for the `skewt` module.\"\"\"\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport numpy.testing\nimport datetime as dt\nimport pytest\n\nfrom cartopy import crs as ccrs\nimport tropycal.tracks as tracks\n\ndef assert_almost_equal(actual, desired, decimal=7):\n \"\"\"Che... | [
[
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axes"
]
] |
acobo/keras-YOLOv3-model-set | [
"6d7f7f2474dda43c112a9e0321447109a446ac69"
] | [
"yolo3/models/yolo3_nano.py"
] | [
"#!/usr/bin/env python3\r\n# -*- coding: utf-8 -*-\r\n\"\"\"YOLO_v3 Nano Model Defined in Keras.\"\"\"\r\n\r\nimport os\r\nfrom keras_applications.imagenet_utils import _obtain_input_shape\r\nfrom tensorflow.keras.utils import get_source_inputs, get_file\r\nfrom tensorflow.keras.layers import UpSampling2D, Concaten... | [
[
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.ReLU",
"tensorflow.keras.backend.expand_dims",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.layers.DepthwiseConv2D",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Multiply",
"tensorflow.keras.layers.... |
ljackson707/clustering-exercises | [
"a12eac030b01a0f6dc7abfc024272a004b64e307"
] | [
"summarize.py"
] | [
"import pandas as pd\n\n#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\ndef df_summary (df):\n info = df.info()\n describe = df.describe()\n nulls = df.isnull().sum()/len(df)*100\n value_count = df.value... | [
[
"pandas.concat"
]
] |
davidkirwan/tensorflow | [
"185a465225a520a1855145efda58b17b1a83d3a5"
] | [
"tensorflow/python/ops/variables.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... | [
[
"tensorflow.python.framework.tensor_shape.unknown_shape",
"tensorflow.python.util.deprecation.deprecated",
"tensorflow.python.framework.ops.colocate_with",
"tensorflow.python.framework.ops.register_tensor_conversion_function",
"tensorflow.python.ops.state_ops.assign_sub",
"tensorflow.pytho... |
vitorenesduarte/planet_sim | [
"aea6e324fdce7802976cbafa88a516ed40609ce9"
] | [
"fantoch_bote/plot/plot.py"
] | [
"import matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfile = open(\"out.dat\", \"r\")\n\n# parse data in file\nfor (id, line) in enumerate(file):\n min_n = 3\n max_n = 0\n # a2 and f2 are initialized with a latency 0 since for n = 3 we don't have a latency value\n data = {\"a1\": []... | [
[
"matplotlib.pyplot.subplots"
]
] |
QIU023/LifeLong-Segmentation | [
"f479d1641f461e9344dcf661d0ada7484fb80896"
] | [
"seg-part/train.py"
] | [
"import argparse\nimport os\nimport numpy as np\nfrom tqdm import tqdm\nfrom ipdb import set_trace\nfrom mypath import Path\nfrom dataloaders import make_data_loader\nfrom modeling.sync_batchnorm.replicate import patch_replication_callback\nfrom modeling.deeplab import *\nfrom modeling.unet import *\nfrom utils.los... | [
[
"numpy.load",
"numpy.argmax"
]
] |
EmilRyberg/marathon_ros2 | [
"a7a979e322de41c868e94e91fa7a8188dede6acb"
] | [
"marathon_ros2_csv/marathon_ros2_csv/plot_csv.py"
] | [
"from IPython.core.display import HTML, SVG\nimport pandas as pd\nimport numpy as np\nimport xport\nimport IPython\nfrom ipywidgets import Layout\nfrom ipywidgets import widgets\nfrom IPython.display import display\n\nimport matplotlib.ticker as ticker\nimport matplotlib.cm as cm\nimport matplotlib as mpl\nfrom mat... | [
[
"pandas.read_csv",
"matplotlib.pyplot.show",
"pandas.DataFrame"
]
] |
elementary-robotics/atom | [
"36aea078c0e029f03e7b9b4768729a683fb32a88"
] | [
"languages/python/tests/test_atom.py"
] | [
"import copy\nimport gc\nimport os\nimport random\nimport time\nfrom multiprocessing import Process, Queue\nfrom threading import Thread\n\nimport numpy as np\nimport pytest\nimport redis\nfrom atom import AtomError, Element, MetricsLevel, SetEmptyError\nfrom atom.config import (\n ATOM_CALLBACK_FAILED,\n ATO... | [
[
"numpy.ones"
]
] |
wangkuiyi/torchrec | [
"1318d91608f40f56fb20b2bd8cd97114e30902bf"
] | [
"torchrec/distributed/planner/planners.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport copy\nfrom functools import reduce\nfrom typing import Tuple, Dict, O... | [
[
"torch.device"
]
] |
mshader/mne-python | [
"4a932cbb76006329e62fb4901628db68b471774e"
] | [
"mne/filter.py"
] | [
"\"\"\"IIR and FIR filtering and resampling functions.\"\"\"\n\nfrom copy import deepcopy\nfrom functools import partial\n\nimport numpy as np\n\nfrom .annotations import _annotations_starts_stops\nfrom .io.pick import _picks_to_idx\nfrom .cuda import (_setup_cuda_fft_multiply_repeated, _fft_multiply_repeated,\n ... | [
[
"numpy.sum",
"numpy.ones",
"scipy.signal.minimum_phase",
"numpy.diff",
"numpy.any",
"numpy.argsort",
"numpy.ones_like",
"scipy.signal.sos2zpk",
"scipy.signal.tf2zpk",
"scipy.signal.get_window",
"scipy.signal.sosfreqz",
"numpy.logical_and",
"numpy.argmin",
"n... |
herrfeder/RaaS | [
"f2da76a0ddce9817117fa2226fe941056bed1620"
] | [
"utils/datasupport.py"
] | [
"import pandas as pd\nfrom utils.exceptions import WrongDataFrameSize, NoScanAvailable\nfrom IPython.core.debugger import Tracer; debughere = Tracer()\nimport json\n\n\ndef pop_all(l):\n r, l[:] = l[:], []\n return r\n\n\ndef extract_scan(df ,ip=\"\",protocol='tcp'):\n no_scan = []\n if ip: \n sc... | [
[
"pandas.DataFrame"
]
] |
pinggao18/analytics-zoo | [
"30a50e7f93770cb833e4ab99439d5210e2489e86"
] | [
"pyzoo/zoo/examples/orca/learn/pytorch/mnist/lenet_mnist.py"
] | [
"#\n# Copyright 2018 Analytics Zoo 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 ... | [
[
"torch.nn.NLLLoss",
"torch.nn.functional.log_softmax",
"torch.nn.Linear",
"torch.nn.functional.max_pool2d",
"torch.manual_seed",
"torch.nn.Conv2d"
]
] |
Tammy-Lee/analysis-llt | [
"ea1bb62d614bb75dac68c010a0cc524a5be185f2"
] | [
"analysis_llt/ml/cv/neural_network.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\ncreate on 2019-03-20 04:19\n\nauthor @lilia\n\"\"\"\nfrom sklearn.neural_network import MLPClassifier\n\nfrom analysis_llt.ml.cv.base import BaseCV\n\n\nclass MLPClassifierCV(BaseCV):\n def __init__(self, hidden_layer_sizes=(100,), learning_rate_init=0.001, cv=None, random_state... | [
[
"sklearn.neural_network.MLPClassifier"
]
] |
yamad07/vjvae | [
"dd8d6607f5ec6c46df1794f903b42aee890d970b"
] | [
"utils/analysis.py"
] | [
"import sys, os\r\nsys.path.append(os.path.join(os.path.dirname(__file__), '..'))\r\n\r\nimport logging, math, multiprocessing, random\r\n\r\nimport numpy as np\r\nimport tensorflow as tf\r\nimport sklearn\r\nimport sklearn.manifold.t_sne as tsne\r\n\r\nfrom collections import defaultdict, OrderedDict\r\n\r\n\r\nde... | [
[
"numpy.sum",
"numpy.ones",
"numpy.linalg.norm",
"numpy.array",
"numpy.zeros",
"sklearn.manifold.t_sne._joint_probabilities",
"numpy.reshape",
"numpy.ones_like",
"numpy.random.choice",
"numpy.argmax",
"numpy.where",
"numpy.log",
"numpy.sqrt",
"numpy.around",
... |
a1609jk/seaborn | [
"50b77328d1f9e6739bcd1e69a43c26226ed826da"
] | [
"seaborn/tests/test_distributions.py"
] | [
"import itertools\nfrom distutils.version import LooseVersion\n\nimport numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import to_rgb, to_rgba\n\nimport pytest\nfrom numpy.testing import assert_array_equal, assert_array_almost_equal\n\nfrom .. import distributions as d... | [
[
"numpy.ones",
"numpy.multiply",
"numpy.diff",
"numpy.histogram_bin_edges",
"numpy.asarray",
"numpy.random.RandomState",
"numpy.log",
"numpy.allclose",
"numpy.append",
"matplotlib.colors.to_rgba",
"matplotlib.pyplot.figure",
"numpy.abs",
"numpy.testing.assert_arr... |
shermanlo77/cptimeseries | [
"2a847ac15f7ea4925896c2a7baec78e8717e63f4"
] | [
"script/prior/downscale/check_valid_gp_prior.py"
] | [
"import numpy as np\nfrom scipy import linalg\n\nimport compound_poisson\nimport dataset\n\ndef main():\n downscale = compound_poisson.Downscale(dataset.AnaDual10Training())\n\n precision_array = np.linspace(250, 300, 50)\n for precision in precision_array:\n cov_chol = downscale.square_error.copy()... | [
[
"scipy.linalg.cholesky",
"numpy.linspace",
"numpy.exp"
]
] |
thu-ml/realsafe | [
"474d549aa402b4cdd5e3629d23d035c31b60a360"
] | [
"pytorch_ares/third_party/fast_adversarial/ImageNet/main_fast.py"
] | [
"# This module is adapted from https://github.com/mahyarnajibi/FreeAdversarialTraining/blob/master/main_free.py\n# Which in turn was adapted from https://github.com/pytorch/examples/blob/master/imagenet/main.py\nimport init_paths\nimport argparse\nimport os\nimport time\nimport sys\nimport torch\nimport torch.nn as... | [
[
"torch.utils.data.DataLoader",
"torch.optim.SGD",
"torch.load",
"numpy.interp",
"torch.nn.CrossEntropyLoss",
"torch.zeros",
"torch.nn.DataParallel",
"numpy.array"
]
] |
KunalRRathod/Matplotlib_Basics | [
"ad895c97135b9cc4dedd41f1cce00072efb24c8e"
] | [
"Colors.py"
] | [
"import matplotlib.pyplot as plt; import importlib; importlib.reload(plt)\r\nplt.clf()\r\nimport numpy as np\r\nimport pandas as pd\r\n# Any Dataset\r\ndf = pd.read_csv('.csv', index_col = 0)\r\ngdp_cap = list(df.gdp_cap)\r\nlife_exp = list(df.life_exp)\r\npop = list(df['population']/1e6)\r\ncont = list(df.cont)\r\... | [
[
"matplotlib.pyplot.xticks",
"pandas.read_csv",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.title",
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.pyplot.xlabel"
]
] |
JCoetzee123/spira | [
"dae08feba1578ecc8745b45109f4fb7bef374546"
] | [
"spira/yevon/geometry/edges/edges.3.py"
] | [
"import gdspy\nimport numpy as np\n\nfrom copy import deepcopy\nfrom spira.core.transforms import *\nfrom spira.yevon import constants\nfrom spira.yevon.gdsii.elem_list import ElementList\nfrom spira.yevon.gdsii.group import Group\nfrom spira.yevon.gdsii.polygon import __ShapeElement__\nfrom spira.yevon.geometry im... | [
[
"numpy.sqrt",
"numpy.arctan2",
"numpy.sign"
]
] |
NUS-LID/SANE | [
"fc16d4fd19f60960b83812adb8240f8fbedd4ef0"
] | [
"common/exploration_scheduler.py"
] | [
"import numpy as np\n\nclass ExplorationExploitationScheduler(object):\n def __init__(self, DQN, n_actions, eps_initial=1, eps_final=0.1, eps_final_frame=0.01, \n eps_evaluation=0.0, eps_annealing_frames=1000000, \n replay_memory_start_size=50000, max_frames=25000000, cutoff_frame... | [
[
"numpy.random.randint",
"numpy.abs",
"numpy.random.rand"
]
] |
ericmjl/influenza-reassortment | [
"21b11507be0f72376237c4ad31129d0148a69456"
] | [
"source_pair_manual_sh.py"
] | [
"handle = '20141103\\ All\\ IRD'\n\ndef get_header(n_nodes):\n\theader = '\\\n#!/bin/sh \\n\\\n#$ -S /bin/sh \\n\\\n#$ -cwd \\n\\\n#$ -V\\n\\\n#$ -m e\\n\\\n#$ -M ericmjl@mit.edu \\n\\\n#$ -pe whole_nodes {0}\\n\\\n#$ -l mem_free=2G\\n\\\n#############################################\\n\\n'.format(n_nodes)\n\n\tret... | [
[
"numpy.arange"
]
] |
zhangsiyu1103/ESNAC | [
"8f9d304976ceb5fed8f4fbb37e7be209796dd573"
] | [
"models/shufflenet_m.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .extension import *\n\nclass BottleneckM(nn.Module):\n\n def __init__(self, in_planes, out_planes, stride, groups):\n super(BottleneckM, self).__init__()\n self.stride = stride\n mid_planes = out_planes // 4\n ... | [
[
"torch.nn.BatchNorm2d",
"torch.nn.Linear",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.ReLU"
]
] |
titusquah/hal9000 | [
"620c1c5ce76db481e6da5e8cfba8d728afe0cb39"
] | [
"Jack's Code/runable_model_yize.py"
] | [
"#-*- coding: utf-8 -*-\nimport tensorflow as tf\nimport numpy as np\n#import ipdb\n\n#batchnormalize:看\ndef batchnormalize(X, eps=1e-8, g=None, b=None):\n if X.get_shape().ndims == 4:\n mean = tf.reduce_mean(X, [0,1,2])\n std = tf.reduce_mean( tf.square(X-mean), [0,1,2] )\n X = (X-mean) / t... | [
[
"tensorflow.reshape",
"tensorflow.ones",
"tensorflow.matmul",
"tensorflow.abs",
"tensorflow.is_nan",
"tensorflow.concat",
"tensorflow.random_normal",
"tensorflow.reduce_sum",
"tensorflow.multiply",
"tensorflow.clip_by_value",
"tensorflow.nn.sigmoid_cross_entropy_with_lo... |
txu2014/zipline | [
"e96b9ed7455be12ce77cd28cc65782ce94e11492"
] | [
"zipline/data/bcolz_daily_bars.py"
] | [
"# Copyright 2015 Quantopian, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ag... | [
[
"pandas.DatetimeIndex",
"numpy.iinfo",
"numpy.full",
"numpy.array",
"numpy.nan_to_num",
"pandas.Timestamp"
]
] |
byukan/nlpia | [
"73c03f651e54e945f9a7eebe4714095dc3e5609a"
] | [
"src/nlpia/plots.py"
] | [
"# from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot\n# import plotly.graph_objs as go\n\nimport os\n\nimport matplotlib\n\n# matplotlib.use('TkAgg') # noqa\nimport seaborn # noqa\nfrom matplotlib import pyplot as plt\n\nfrom mpl_toolkits.mplot3d import Axes3D # noqa\nimport pandas as... | [
[
"pandas.read_csv",
"matplotlib.pyplot.figure",
"pandas.DataFrame"
]
] |
CINPLA/edNEGmodel_analysis | [
"be8854c563376a14ee7d15e51d98d0d82be96a35"
] | [
"figures/plot_figure6.py"
] | [
"import warnings\nwarnings.filterwarnings(\"ignore\")\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nfrom set_style import set_style\n\nset_style('default', w=1, h=3.3)\n\nfig = plt.figure()\ngs = gridspec.GridSpec(8,6)\nax00 = plt.subplot(gs[0:2,0:2])\nax0 = plt.subpl... | [
[
"numpy.load",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplot",
"numpy.array",
"matplotlib.gridspec.GridSpec"
]
] |
ChaokunChang/SVAS | [
"61af6eb39269edff8ea5147311628b3200c3a3d2"
] | [
"models/tmp/xchani_yolov5_master/yolov5_models/experimental.py"
] | [
"# This file contains experimental modules\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom yolov5_models.common import Conv, DWConv\nfrom yolov5_utils.google_utils import attempt_download\n\n\nclass CrossConv(nn.Module):\n # Cross Convolution Downsample\n def __init__(self, c1, c2, k=3, s=1... | [
[
"torch.nn.BatchNorm2d",
"numpy.eye",
"numpy.roll",
"torch.load",
"torch.linspace",
"torch.arange",
"numpy.linalg.lstsq",
"torch.nn.Identity",
"numpy.array",
"torch.sigmoid",
"torch.cat",
"torch.nn.LeakyReLU"
]
] |
marcusvaltonen/python-droneposelib | [
"a08648207f20e90ed0491ef154ae9af56541831a"
] | [
"example/synthetic.py"
] | [
"import numpy as np\nimport droneposelib as dpl\n\n\ndef pflat(x):\n \"\"\"Divide by the last coordinate to get an inhomogenous representation.\"\"\"\n # Enfoce 2D\n if x.ndim == 1:\n x = np.expand_dims(x, 1)\n return x / x[-1, :]\n\n\ndef skew(a):\n a = np.squeeze(a)\n \"\"\"Create skew-sy... | [
[
"numpy.sqrt",
"numpy.sum",
"numpy.tile",
"numpy.ones",
"numpy.sign",
"numpy.random.default_rng",
"numpy.squeeze",
"numpy.diag",
"numpy.zeros",
"numpy.asfortranarray",
"numpy.hstack",
"numpy.expand_dims",
"numpy.array",
"numpy.linalg.norm"
]
] |
DahlitzFlorian/python-snippets | [
"212f63f820b6f5842f74913ed08da18d41dfe7a4"
] | [
"third_party/parse_complex_excel_sheets.py"
] | [
"from pathlib import Path\n\nimport pandas as pd\n\n\npath = Path(\"src/samples.xlsx\")\nxls = pd.ExcelFile(path)\nprint(xls.sheet_names)\n\ndf = xls.parse(xls.sheet_names[0])\nprint(df.head())\n"
] | [
[
"pandas.ExcelFile"
]
] |
alangee/FaiR-N | [
"724f2cbea44705cecd45b202cc649d75df813d5d"
] | [
"datasets/german/german_model.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Google Research 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 requ... | [
[
"tensorflow.layers.average_pooling2d",
"tensorflow.layers.max_pooling2d",
"tensorflow.layers.dense"
]
] |
shtoneyan/sea-lion | [
"7e1ce9a18a147eea42e6172a2329d696f6e6aef9"
] | [
"preprocessing/basenji_data_write.py"
] | [
"#!/usr/bin/env python\n# Copyright 2019 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.argwhere",
"numpy.zeros",
"tensorflow.io.TFRecordWriter",
"numpy.any",
"tensorflow.train.FloatList",
"tensorflow.train.Features",
"tensorflow.io.TFRecordOptions",
"tensorflow.train.BytesList"
]
] |
qacwnfq/linmix | [
"36635592d76d2d0e06324265ede385e2d5bcc721"
] | [
"linmix/linmix.py"
] | [
"\"\"\" linmix -- A hierarchical Bayesian approach to linear regression with error in both X and Y.\n\"\"\"\n\nfrom __future__ import print_function\n\nimport numpy as np\n\n\ndef task_manager(conn):\n chain = None\n while True:\n message = conn.recv()\n if message['task'] == 'init':\n ... | [
[
"numpy.ones",
"numpy.sum",
"numpy.var",
"numpy.random.RandomState",
"numpy.log",
"numpy.cov",
"numpy.vstack",
"numpy.seterr",
"numpy.logical_not",
"numpy.mean",
"numpy.zeros",
"numpy.median",
"numpy.hstack",
"numpy.all",
"numpy.array",
"numpy.zeros_l... |
kyle-bong/Realtime_Voice_Activity_Detection | [
"9ea2d6187ec157051163ac83bed3f7135a3bb802"
] | [
"realtime_detection.py"
] | [
"import numpy as np\n# from numpy_ringbuffer import RingBuffer\nimport librosa\nimport librosa.display\nimport matplotlib.pyplot as plt\nimport noisereduce as nr\nfrom tensorflow.keras.models import model_from_json\nfrom sklearn.preprocessing import LabelEncoder\nimport pyaudio\nimport wave # for save audio file\ni... | [
[
"numpy.dtype",
"numpy.asarray",
"sklearn.preprocessing.LabelEncoder",
"matplotlib.pyplot.plot",
"numpy.nan_to_num",
"numpy.isfinite",
"matplotlib.pyplot.figure",
"numpy.reshape",
"numpy.mean",
"matplotlib.pyplot.subplots",
"numpy.argmax",
"numpy.max",
"numpy.min... |
mufeili/P-GNN-dgl | [
"536569c22a3899a8b1a28cd0653923fd809cf9bd"
] | [
"main.py"
] | [
"import os\nimport dgl\nimport torch\nimport numpy as np\nimport torch.nn as nn\nfrom model import PGNN\nfrom sklearn.metrics import roc_auc_score\nfrom utils import get_dataset, preselect_anchor\n\nimport warnings\nwarnings.filterwarnings('ignore')\n\ndef get_loss(p, data, out, loss_func, device, get_auc=True):\n ... | [
[
"torch.sum",
"torch.FloatTensor",
"torch.cuda.is_available",
"torch.from_numpy",
"torch.nn.BCEWithLogitsLoss",
"numpy.array",
"numpy.std",
"torch.sigmoid",
"torch.cat",
"numpy.mean"
]
] |
jishnujayakumar/MLRC2020-EmbedKGQA | [
"ee99b8c83e6278b2dd6f16e0ae910c80b28da251"
] | [
"train_embeddings/main.py"
] | [
"from load_data import Data\nimport numpy as np\nimport torch\nimport time\nfrom collections import defaultdict\nfrom model import *\nfrom torch.optim.lr_scheduler import ExponentialLR\nimport argparse\nfrom tqdm import tqdm\nimport os\nfrom prettytable import PrettyTable\n\n \nclass Experiment:\n\n def __ini... | [
[
"numpy.save",
"torch.cuda.manual_seed_all",
"torch.optim.lr_scheduler.ExponentialLR",
"torch.load",
"numpy.random.shuffle",
"torch.sort",
"torch.manual_seed",
"torch.no_grad",
"numpy.random.seed",
"torch.tensor",
"torch.set_num_threads",
"numpy.array",
"numpy.me... |
kiyoon/PyVideoAI | [
"c4d3ba7a69723aeae7da48245989ae11cbdb1f8b"
] | [
"tools/run_train.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\n\"\"\"Wrapper to train and test a video classification model.\"\"\"\n\nimport argparse\nimport sys\nimport torch\n\nimport pyvideoai.utils.multiprocessing_helper as mpu\nfrom pyvideoai.train_multiprocess import train... | [
[
"torch.multiprocessing.spawn"
]
] |
DizzyProtos/asteroid | [
"bb3c374fefe7525c2f6da355834e470d45b45b90"
] | [
"asteroid/masknn/recurrent.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.nn.functional import fold, unfold\n\nfrom . import norms, activations\nfrom .norms import GlobLN, CumLN\nfrom ..utils import has_arg\n\n\nclass SingleRNN(nn.Module):\n \"\"\" Module for a RNN block.\n\n Inspired from https://github.com/yluo42/TAC/blob/master/uti... | [
[
"torch.nn.Linear",
"torch.nn.PReLU",
"torch.nn.Tanh",
"torch.nn.Conv1d",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.Sigmoid",
"torch.cat",
"torch.nn.Dropout"
]
] |
abhishekpratapa/turicreate | [
"f56f9ef9c138d8047037184afb6356c20bbc7f71"
] | [
"src/python/turicreate/toolkits/_mxnet/_mx_sframe_iter.py"
] | [
"# -*- coding: utf-8 -*-\n# pylint: disable= too-many-lines, redefined-builtin\n# Copyright © 2017 Apple Inc. All rights reserved.\n#\n# Use of this source code is governed by a BSD-3-clause license that can\n# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause\n\"\"\"SFrame Data It... | [
[
"numpy.swapaxes",
"numpy.random.randint",
"numpy.zeros"
]
] |
junhaoim/deep-learning-from-scratch | [
"26d26ca6182733af2bc2dfd079a268a4fc6196a1"
] | [
"ch06/overfit_weight_decay.py"
] | [
"# coding: utf-8\nimport os\nimport sys\n\nsys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom dataset.mnist import load_mnist\nfrom common.multi_layer_net import MultiLayerNet\nfrom common.optimizer import SGD\n\n(x_train, t_train), (x_test, t_test) = ... | [
[
"matplotlib.pyplot.legend",
"numpy.random.choice",
"numpy.arange",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel"
]
] |
psychicmario/continuum | [
"22f60d3fc71553f1334cffa7e88a1727cdf2413c"
] | [
"continuum/scenarios/class_incremental.py"
] | [
"import warnings\nfrom copy import copy\nfrom typing import Callable, List, Union\n\nimport numpy as np\n\nfrom continuum.datasets import _ContinuumDataset\nfrom continuum.scenarios import _BaseScenario\n\n\nclass ClassIncremental(_BaseScenario):\n \"\"\"Continual Loader, generating datasets for the consecutive ... | [
[
"numpy.array",
"numpy.logical_and",
"numpy.vectorize",
"numpy.unique"
]
] |
Goda-Research-Group/MLMC_stochastic_gradient | [
"5c90827192d4d0fbf9415013a9df700b6978c330"
] | [
"mlmc_eig_grad/visualize_path.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport mlmc_eig_grad.models as models\n\n\ndef convergence_with_path(paths_, inner_samples, labels, filename):\n\n if len(paths_) == 1:\n colors = [0]\n else:\n colors = np.arange(len(paths_)) * 0.8 / (len(paths_) - 1)\n\n plt.figure(figsi... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.yscale",
"numpy.arange",
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.close",
"numpy.array",
"matplotlib.pyplot.xlabel",
"numpy.mean"
... |
jlim13/pytorch.sngan_projection | [
"ba8630e5c0ef317399c7eba3d05daa72e9c9d034"
] | [
"test.py"
] | [
"# Training script for tiny-imagenet.\n# Again, this script has a lot of bugs everywhere.\nimport argparse\nimport datetime\nimport json\nimport os\nimport shutil\n\nimport numpy as np\nimport torch\nimport torch.utils.data as data\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torchvision\ni... | [
[
"torch.cuda.manual_seed_all",
"torch.empty_like",
"numpy.random.permutation",
"torch.manual_seed",
"numpy.random.seed",
"torch.set_default_tensor_type",
"torch.multiprocessing.set_start_method",
"torch.cuda.is_available",
"torch.nn.DataParallel",
"torch.device"
]
] |
csgwon/dl-pipeline | [
"5ac2cdafe0daac675d3f3e810918133de3466f8a"
] | [
"flaskapp/namecnn.py"
] | [
"from tools import *\nimport torch\nimport numpy as np\n\nimport sys\n\ncharcnn = torch.load('/var/www/html/flaskapp/charcnn.pth')\n\ncharcnn.train(False)\n\ndef predict(name):\n from torch.autograd import Variable\n name = encode_input(name)\n name = Variable(torch.from_numpy(name).float())\n name = na... | [
[
"torch.from_numpy",
"torch.load",
"torch.max"
]
] |
shbang91/PnC | [
"880cbbcf96a48a93a0ab646634781e4f112a71f6"
] | [
"Addition/PythonPlotter/DracoBip/plot_joint.py"
] | [
"import numpy as np\nimport matplotlib\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\nimport os\n\nfigure_number = 0\ncol_index = 0\nrow_index = 0\n\nfile_path = os.getcwd() + \"/../../../ExperimentDataCheck/\"\n\n## read files\ndata_q = \\\nnp.genfromtxt(file_path+'q.txt', delimiter=None, dtype=(float)... | [
[
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.use",
"matplotlib.pyplot.plot",
"numpy.genfromtxt"
]
] |
shivam124081/datumaro | [
"3aa8842a3649ec8e05c0bfe042794823375b812b"
] | [
"datumaro/components/launcher.py"
] | [
"# Copyright (C) 2019-2020 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\nimport numpy as np\n\nfrom datumaro.components.extractor import Transform, LabelCategories, AnnotationType\nfrom datumaro.util import take_by\n\n\n# pylint: disable=no-self-use\nclass Launcher:\n def __init__(self, model_dir=None)... | [
[
"numpy.array",
"numpy.expand_dims"
]
] |
jtbuckwalter/UPBC-Assignment-10-Advanced-Data-Storage-and-Retrieval | [
"a3b5cdadde2be90ab9e63ace2126648728c6e0bb"
] | [
"app.py"
] | [
"from flask import Flask, jsonify\n#################################################\n# Flask Setup\n#################################################\napp = Flask(__name__)\n\n\nimport numpy as np\nimport sqlalchemy\nfrom sqlalchemy.ext.automap import automap_base\nfrom sqlalchemy.orm import Session\nimport dateti... | [
[
"numpy.ravel"
]
] |
mharradon/SHMArrays | [
"ef03b4dbd6b3adbfdb3a83afa694c120862b36ac"
] | [
"tests.py"
] | [
"from SHMArrays import SHMArrays\nimport numpy as np\nimport pdb\nfrom collections import OrderedDict\n\nn_params = 20\nsizes = [int(1e5*np.random.rand()) for i in range(n_params)]\narrays = OrderedDict([('id'+str(i),np.random.randn(size)) for i,size in zip(range(n_params),sizes)])\narrays2 = OrderedDict([('id'+str... | [
[
"numpy.arange",
"numpy.concatenate",
"numpy.random.randn",
"numpy.random.rand"
]
] |
behnamh217rn21/PCA_v1 | [
"dfcf8d37649c75f217262edcded5111bf8de88d1"
] | [
"pca/pca.py"
] | [
"\"\"\"pca is a python package to perform Principal Component Analysis and to make insightful plots.\"\"\"\n\n# %% Libraries\nimport colourmap as colourmap\nfrom sklearn.decomposition import PCA, SparsePCA, TruncatedSVD\n# from sklearn import preprocessing\nfrom sklearn.preprocessing import StandardScaler\nfrom skl... | [
[
"numpy.ones",
"numpy.logical_or",
"numpy.var",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"numpy.cov",
"numpy.logical_and",
"numpy.linalg.eigh",
"matplotlib.pyplot.gca",
"numpy.abs",
"sklearn.decomposition.TruncatedSVD",
"matplotlib.pyplot.title",
"nu... |
fukatani/Chainer_training | [
"166acb8379cb1fb0c0eef760979d8da4c3a62840"
] | [
"py/Example.py"
] | [
"#-------------------------------------------------------------------------------\n# Name: Example\n# Purpose:\n#\n# Author: rf\n#\n# Created: 11/08/2015\n# Copyright: (c) rf 2015\n# Licence: Apache Licence 2.0\n#-------------------------------------------------------------------------------\n... | [
[
"sklearn.datasets.fetch_mldata",
"numpy.split"
]
] |
lakshara98/SDGP-Project | [
"3054db54d2ab9a61728836ba3e4fa0b74c1a7c36"
] | [
"src/generate.py"
] | [
"\"\"\"Data generator generates batches of inputs and outputs/labels for training.\n\nThe inputs are each made from two parts. The first maxlend words are the original description, followed by `eos` followed by the headline which we want to predict, except for the last word in the headline which is always `eos` and... | [
[
"numpy.all",
"numpy.zeros"
]
] |
magelead/BiAAE | [
"1caa063ee9650e98b20e4e0e68b24374acc6e435"
] | [
"models/aaes/uniaae.py"
] | [
"# proposed model implementation\n\nimport numpy as np\n\nimport torch\nfrom torch import nn\nimport pytorch_lightning as pl\n\nfrom torch import autograd\n\nimport sys\nsys.path.append('..')\n\nfrom networks import MnistCNNDecoder, ExprDiffDecoder, ConditionedDecoder, RNNEncoder, FinetunedEncoder\nfrom networks im... | [
[
"torch.ones_like",
"torch.randn_like",
"torch.load",
"numpy.random.permutation",
"torch.zeros_like",
"torch.nn.ModuleList",
"torch.nn.BCEWithLogitsLoss",
"torch.optim.lr_scheduler.StepLR",
"torch.cat"
]
] |
mlmaster1995/Detection-of-AD-Using-Graph-Regularized-CNN-Based-on-MRIs | [
"0780be8e7bf68cf6651abb4c597dd87460deff01"
] | [
"python_files/Kmeans.py"
] | [
"\"\"\"\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements. See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ownership. The ASF licenses this file\nto you under the Apache License, Version 2.0 (the\n\"License\"); you m... | [
[
"tensorflow.reshape",
"tensorflow.gather_nd",
"tensorflow.squeeze",
"tensorflow.convert_to_tensor",
"tensorflow.concat",
"tensorflow.reduce_sum",
"tensorflow.math.argmin",
"tensorflow.less",
"tensorflow.constant",
"tensorflow.transpose",
"tensorflow.shape",
"tensorf... |
jungr-ait/spatialmath-python | [
"140d499e733ed9775762df90d36e4b2c4c2fc6eb"
] | [
"tests/base/test_graphics.py"
] | [
"import unittest\nimport numpy as np\nfrom spatialmath.base import *\n\n# test graphics primitives\n# TODO check they actually create artists\n\n\nclass TestGraphics(unittest.TestCase):\n def test_plotvol2(self):\n plotvol2(5)\n\n def test_plotvol3(self):\n plotvol3(5)\n\n def test_plot_box(s... | [
[
"numpy.diag"
]
] |
williecostello/BetterReads | [
"318e438f342a08fe2db8f8dd4bce17cd85ef8795"
] | [
"src/04_modelling/embed_sentences.py"
] | [
"import numpy as np\nimport pandas as pd\nimport tensorflow_hub as hub\nimport os\nimport joblib\n\n# Loads Universal Sentence Encoder locally, from downloaded module\nembed = hub.load('data/04_models/universal_sentence_encoder/')\n# Loads Universal Sentence Encoder remotely, from Tensorflow Hub\n# embed = hub.load... | [
[
"pandas.read_csv",
"numpy.array"
]
] |
poulamisganguly/foam_ct_phantom | [
"51820d5b570e2b9b3b0100500edb8666d4bc6909"
] | [
"foam_ct_phantom/generate.py"
] | [
"#-----------------------------------------------------------------------\n#Copyright 2019 Centrum Wiskunde & Informatica, Amsterdam\n#\n#Author: Daniel M. Pelt\n#Contact: D.M.Pelt@cwi.nl\n#Website: http://dmpelt.github.io/foam_ct_phantom/\n#License: MIT\n#\n#This file is part of foam_ct_phantom, a Python package f... | [
[
"numpy.argmin",
"numpy.zeros"
]
] |
Hiwyl/mmdetection-obj | [
"6d9c6064503ee87d490b20d30f9ae0dda7d60d27"
] | [
"tools/test.py"
] | [
"import argparse\nimport os\nimport os.path as osp\nimport pickle\nimport shutil\nimport tempfile\n\nimport mmcv\nimport torch\nimport torch.distributed as dist\nfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallel\nfrom mmcv.runner import get_dist_info, init_dist, load_checkpoint\n\nfrom mmdet.core ... | [
[
"torch.distributed.all_gather",
"torch.distributed.broadcast",
"torch.no_grad",
"torch.tensor",
"torch.full",
"torch.cuda.current_device",
"torch.distributed.barrier",
"torch.zeros"
]
] |
kokbent/covid-chicago | [
"a1530d25508453f84db9d61437c61ffd573901af"
] | [
"plotters/Ki_plotter.py"
] | [
"import argparse\nimport os\nimport pandas as pd\nimport matplotlib as mpl\nmpl.use('Agg')\nimport matplotlib.pyplot as plt\nimport sys\nsys.path.append('../')\nfrom load_paths import load_box_paths\nimport matplotlib.dates as mdates\nimport seaborn as sns\nfrom processing_helpers import *\n\nmpl.rcParams['pdf.font... | [
[
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"matplotlib.dates.DateFormatter",
"pandas.Timestamp.today",
"pandas.Timedelta",
"matplotlib.pyplot.suptitle",
"matplotlib.use",
"pandas.Timestamp"
]
] |
arokem/nipy | [
"d6b2e862c65558bb5747c36140fd6261a7e1ecfe"
] | [
"nipy/modalities/fmri/tests/test_hrf.py"
] | [
"\"\"\" Testing hrf module\n\"\"\"\n\nfrom os.path import dirname, join as pjoin\n\nimport numpy as np\n\nfrom scipy.stats import gamma\nimport scipy.io as sio\n\nfrom ..hrf import (\n gamma_params,\n gamma_expr,\n lambdify_t,\n spm_hrf_compat,\n spmt,\n dspmt,\n ddspmt,\n )\n\nfrom nose.too... | [
[
"numpy.testing.assert_almost_equal",
"scipy.io.loadmat",
"numpy.abs",
"numpy.argmax",
"numpy.arange",
"numpy.max",
"scipy.stats.gamma",
"numpy.linspace",
"numpy.mean"
]
] |
hirune924/ml-tools | [
"1a4e3d205b6eeef7bef7ef2f205ac8087ffa7f69"
] | [
"src/model/train.py"
] | [
"# import comet_ml in the top of your file\nfrom comet_ml import Experiment\n \n# Add the following code anywhere in your machine learning file\nexperiment = Experiment(api_key=\"QCxbRVX2qhQj1t0ajIZl2nk2c\",\n project_name=\"ml-tools\", workspace=\"hirune924\",\n aut... | [
[
"sklearn.model_selection.StratifiedKFold"
]
] |
enternityFan/FakeNewsProject | [
"b3bd18c2ae715ea2ce5e8cfdacb04e813b0b095b"
] | [
"test_ch.py"
] | [
"# @Time : 2022-02-22 18:56\n# @Author : Phalange\n# @File : test_ch.py.py\n# @Software: PyCharm\n# C'est la vie,enjoy it! :D\n\nimport os\nimport pandas as pd\nimport torch\nfrom d2l import torch as d2l\nimport DataProcess\nimport Module.AttentionModel\nimport Module.evalScript\nfrom torch import nn\nimport numpy ... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"torch.load"
]
] |
s4f-leipzig/Droughtstripes | [
"938cff9fa454dbf84c122ffcc38e07127f70778f"
] | [
"droughtstripes_monthly_python3.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed May 4 13:03:43 2020\n\n@author: Scientists4Future Leipzig\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport urllib \nfrom matplotlib.colors import LinearSegmentedColormap\n\n\n## Manual entries require... | [
[
"pandas.read_table",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gca",
"matplotlib.colors.LinearSegmentedColormap.from_list",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.margins",
"matplotlib.pyplot.NullLocator",
"numpy.stack"
]
] |
Anhmike/NVTabular | [
"e1f0d6edc9e99fea087944a06891564086e26ecd"
] | [
"nvtabular/inference/triton/ensemble.py"
] | [
"# Copyright (c) 2021, NVIDIA 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.dtype",
"tensorflow.keras.models.load_model"
]
] |
sgarg18/arshadowgan | [
"8183f8c06f93c249e48193cdfa41a5e78bcc3d5e"
] | [
"shadow_class/networks.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport torch\nimport torch.nn as nn\nimport segmentation_models_pytorch as smp\n\n\nclass Generator_with_Refin(nn.Module):\n def __init__(self, encoder):\n \"\"\"Generator initialization\n\n Args:\n encoder: an encoder for Unet generator\n \"\"\"\n ... | [
[
"torch.nn.BatchNorm2d",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.Identity",
"torch.nn.ReLU",
"torch.nn.LeakyReLU"
]
] |
DDQXZcp/FYP_ProjectFile_TANG_Zhiheng | [
"b0e3b9d1c5cee61e1d09a32e405244bda09b6f0d"
] | [
"CNN/training_result_test.py"
] | [
"from tensorflow import keras\r\nfrom skimage import io\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport cv2\r\nimport os\r\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = '-1'\r\n'''\r\nmymodel4_30: 30:0.5\r\nmymodel4_50epoch:50epoch 0.98:0.2\r\n'''\r\n\r\n\r\npath='D:\\pycharm project'\r\n#ori_files= os... | [
[
"tensorflow.keras.models.load_model",
"numpy.zeros",
"numpy.histogram",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show"
]
] |
rtagirov/python_scr_pc_imperial | [
"423204964ddbc9c117bd2b3bb4397ee98b89a56d"
] | [
"nat/nesatl_clv.py"
] | [
"import numpy as np\nimport pylab as pl\nimport matplotlib.pyplot as plt\n\nfrom matplotlib.ticker import AutoMinorLocator\nfrom matplotlib.ticker import MultipleLocator\n\nfrom scipy import interpolate\n\nimport importlib\nimport sys\nimport os\n\nimport paths; importlib.reload(paths)\nimport pltaux; importlib.re... | [
[
"numpy.sqrt",
"matplotlib.ticker.MultipleLocator",
"matplotlib.pyplot.subplots",
"numpy.array",
"numpy.trapz",
"numpy.where",
"numpy.loadtxt"
]
] |
prokia/deepHops | [
"bd42d72c7c6e3b7813342a1dac0befc46bc66838"
] | [
"deephop/onmt/train_single.py"
] | [
"#!/usr/bin/env python\n\"\"\"\n Training on a single process\n\"\"\"\nfrom __future__ import division\n\nimport argparse\nimport os\nimport random\nimport torch\n\nimport onmt.opts as opts\nfrom graph_embedding import init_condition_transformer\n\nfrom onmt.inputters.inputter import build_dataset_iter, lazily_l... | [
[
"torch.load",
"torch.cuda.manual_seed",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.cuda.set_device"
]
] |
potterhsu/easy-fpn.pytorch | [
"cac901f2570bd8dba7bb456128c7c7985c255ea4"
] | [
"evaluator.py"
] | [
"from typing import Tuple\n\nimport torch\nfrom torch.utils.data import DataLoader\nfrom tqdm import tqdm\n\nfrom dataset.base import Base as DatasetBase\nfrom model import Model\n\n\nclass Evaluator(object):\n def __init__(self, dataset: DatasetBase, path_to_data_dir: str, path_to_results_dir: str):\n su... | [
[
"torch.utils.data.DataLoader",
"torch.no_grad"
]
] |
julesy89/pysurrogate | [
"6fe58f157920ef7819bcd4756342b2ca778f43b8"
] | [
"pysurrogate/archive/eim/meta_eim.py"
] | [
"import numpy as np\n\nfrom pysao.eim.evolutionary_interpolation import EvolutionaryInterpolationModel\nfrom pysao.metamodels.metamodel import Metamodel\n\n\nclass EIModel(Metamodel):\n def __init__(self):\n Metamodel.__init__(self)\n self.model = None\n\n def _predict(self, X):\n return ... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
WikiMegrez/wikisearch | [
"89dcd07962bacf0dc3cce55bf529b8af44e8150e"
] | [
"wiki_search/core/bert_ranking.py"
] | [
"import torch\nfrom transformers import BertTokenizer, BertModel\nfrom wiki_search.dataset import Document\n\n\ntorch.set_grad_enabled(False)\nMODEL_NAME = 'bert-base-cased'\n\n\nclass BertRanking(object):\n def __init__(self, device: str = 'cuda:0'):\n self.device = torch.device(device)\n self.mod... | [
[
"torch.set_grad_enabled",
"torch.device"
]
] |
kkmumu/DeepRobust | [
"0cc1950177ed6604e55274e1a7cd578d54fba5c4"
] | [
"deeprobust/image/netmodels/feed_dataset.py"
] | [
"\"\"\"\r\nThis function help to feed in train and test datasets.\r\nSelect model archtecture and seed then output corresponding model.\r\n\r\n\"\"\"\r\nfrom __future__ import print_function\r\nimport os\r\nimport argparse\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F #233\r\nimport to... | [
[
"torch.utils.data.DataLoader",
"torch.manual_seed",
"torch.utils.data.random_split",
"torch.utils.data.ConcatDataset"
]
] |
GSEL9/data-science-tools | [
"950ea7b3c675dc5b1648e6289e796da7b8cafb95"
] | [
"dstools/model_comparison.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# model_comparison.py\n#\n\n\"\"\"\n\"\"\"\n\n__author__ = 'Severin Langberg'\n__email__ = 'langberg91@gmail.com'\n\n\nimport os\nimport utils\nimport ioutil\nimport shutil\nimport logging\nimport model_selection\nimport feature_selection\n\nimport numpy as np\nimport pandas as pd\n\nfr... | [
[
"sklearn.model_selection.ParameterGrid",
"sklearn.externals.joblib.Parallel",
"sklearn.externals.joblib.delayed"
]
] |
JarnoRFB/xarray | [
"1ab7569561db50eaccbae977b0ef69993e0c0d0c"
] | [
"xarray/core/duck_array_ops.py"
] | [
"\"\"\"Compatibility module defining operations on duck numpy-arrays.\n\nCurrently, this means Dask or NumPy arrays. None of these functions should\naccept or return xarray objects.\n\"\"\"\nimport contextlib\nimport inspect\nimport warnings\nfrom functools import partial\n\nimport numpy as np\nimport pandas as pd\... | [
[
"numpy.array",
"numpy.asarray",
"numpy.timedelta64"
]
] |
QUVA-Lab/escnn | [
"59ed6b96f61f8616f87b3f25aa2f8abdb6f1a882"
] | [
"escnn/nn/modules/pointconv/r2_point_convolution.py"
] | [
"\n\nfrom escnn.nn import FieldType, GeometricTensor\nfrom escnn.group import Representation\nfrom escnn.kernels import KernelBasis\n\nfrom torch_geometric.data import Data\n\nfrom .rd_point_convolution import _RdPointConv\n\nfrom typing import Callable, Tuple, Dict, Union, List\n\nimport torch\nimport numpy as np\... | [
[
"torch.linspace"
]
] |
Johannes0Horn/deeplabmodel | [
"ee8618265d336b7f235bc7cbb6779b7dd06436a0"
] | [
"deeplab/utils/train_utils.py"
] | [
"# Copyright 2018 The TensorFlow Authors All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi... | [
[
"tensorflow.train.polynomial_decay",
"tensorflow.equal",
"tensorflow.reshape",
"tensorflow.logging.info",
"tensorflow.train.latest_checkpoint",
"tensorflow.train.exponential_decay",
"tensorflow.where",
"tensorflow.train.get_or_create_global_step",
"tensorflow.not_equal"
]
] |
Muflhi01/TextWorld | [
"c419bb63a92c7f6960aa004a367fb18894043e7f"
] | [
"textworld/generator/game.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT license.\n\n\nimport copy\nimport json\nimport textwrap\n\nfrom typing import List, Dict, Optional, Mapping, Any, Iterable, Union, Tuple\nfrom collections import OrderedDict\nfrom functools import partial\n\nimport numpy as np\nf... | [
[
"numpy.random.RandomState"
]
] |
noshita/image-labelling-tool | [
"59c8eb8dae1ab24b35192fb858ed21596d433fcd"
] | [
"flask_app.py"
] | [
"# The MIT License (MIT)\n#\n# Copyright (c) 2015 University of East Anglia, Norwich, UK\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 lim... | [
[
"matplotlib.pyplot.imread",
"matplotlib.pyplot.get_cmap"
]
] |
BarakeelFanseu/GRAC_CIKM | [
"3cbdbbb6c4902653f633c6d8f1c80f370b2938cf"
] | [
"others_clean.py"
] | [
"import scipy.io as sio\nimport time\n# import tensorflow as tf\nimport numpy as np\nimport scipy.sparse as sp\nfrom sklearn.cluster import KMeans, SpectralClustering\nfrom metrics import clustering_metrics\nfrom sklearn.metrics.pairwise import euclidean_distances\nfrom sklearn.feature_extraction.text import TfidfT... | [
[
"numpy.ones",
"numpy.sum",
"scipy.sparse.linalg.svds",
"numpy.diag",
"numpy.random.seed",
"sklearn.cluster.KMeans",
"sklearn.metrics.pairwise.euclidean_distances",
"numpy.where",
"numpy.unique",
"numpy.mat",
"numpy.mean",
"sklearn.cluster.SpectralClustering",
"n... |
c-hydro/hyde | [
"b0728397522aceebec3e7ff115aff160a10efede"
] | [
"src/common/plot/lib_plot_point.py"
] | [
"\"\"\"\nLibrary Features:\n\nName: lib_plot_point\nAuthor(s): Fabio Delogu (fabio.delogu@cimafoundation.org)\nDate: '20180918'\nVersion: '1.0.0'\n\"\"\"\n\n#######################################################################################\n# Library\nfrom numpy import arange\n\nimp... | [
[
"numpy.arange",
"matplotlib.pylab.figure",
"matplotlib.pylab.show",
"matplotlib.pylab.clim"
]
] |
Andy51/openvino | [
"61ccde700f1d8a587291547d96b1eaa00955b89c"
] | [
"model-optimizer/mo/front/tf/loader.py"
] | [
"\"\"\"\n Copyright (C) 2018-2020 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... | [
[
"tensorflow.saved_model.load",
"tensorflow.enable_eager_execution",
"tensorflow.train.load_checkpoint",
"tensorflow.disable_eager_execution",
"tensorflow.report_uninitialized_variables",
"tensorflow.train.NewCheckpointReader",
"tensorflow.train.import_meta_graph",
"tensorflow.pytho... |
flyflyinit/GUI-admin-tool | [
"1fa97393ee2a39a65f5b7bbe95eb5b5f04bc6ad6"
] | [
"project/networking/networkingplots.py"
] | [
"try:\n import psutil\nexcept ImportError as e:\n print(f'package not found\\n{e}\\n')\n\ntry:\n from PyQt5 import QtCore, QtWidgets\nexcept ImportError as e:\n print(\n f'package PyQt5 Not Found\\n{e}\\ntry :\\npip3 install --user pyqt5\\nOR\\ndnf install python3-pyqt5, yum install python3-pyqt5... | [
[
"matplotlib.pyplot.style.use",
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.updateGeometry",
"matplotlib.figure.Figure",
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.__init__",
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg.setSizePolicy"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.