repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
Hydrapse/pytorch-template | [
"d7ea2f19bbdc032b8663ca432c1ef9012fe6180b"
] | [
"src/utils/outliers.py"
] | [
"import math\n\nimport torch\n\n\ndef replace_nan(val, nan_to=0., inf_to=1.):\n val = torch.where(torch.isinf(val), torch.full_like(val, nan_to), val)\n return torch.where(torch.isnan(val), torch.full_like(val, inf_to), val)\n\n\ndef clip_int(val, lower, upper):\n val = 0 if math.isnan(val) else round(val)... | [
[
"torch.isinf",
"torch.isnan",
"torch.full_like"
]
] |
kyledecker/project_ksd15_wjl11 | [
"f17b62ce1affaaaec65cdb0ea16c376ae00027d0"
] | [
"test/test_feature_extraction.py"
] | [
"import os\nimport sys\nsys.path.insert(0, os.path.abspath('./src/'))\n\n\ndef test_calc_mode():\n from feature_extraction import calc_mode\n import numpy as np\n\n hist = np.zeros(256)\n hist[5] = 0.4\n hist[20] = 0.5\n hist[100] = 0.2\n\n actual = calc_mode(hist)\n expected = 20\n\n ass... | [
[
"numpy.array_equal",
"numpy.zeros",
"numpy.median",
"numpy.ones",
"numpy.std"
]
] |
bfgoldstein/torchfi | [
"6a735ecf81c39bfdfa770e6a41a66e4f88ea808b"
] | [
"torchFI/modules/linear.py"
] | [
"###############################################################\n# This file was created using part of Distiller project developed by:\n# NervanaSystems https://github.com/NervanaSystems/distiller\n# \n# Changes were applied to satisfy torchFI project needs\n#######################################################... | [
[
"torch.nn.functional.linear",
"numpy.random.binomial"
]
] |
hughkong/asstarer | [
"ed331aa2b4c7665f10214117510cfee099216ede"
] | [
"mnist_4.0_batchnorm_five_layers_sigmoid.py"
] | [
"# encoding: UTF-8\n# Copyright 2016 Google.com\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable ... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.group",
"tensorflow.matmul",
"tensorflow.ones",
"tensorflow.reshape",
"tensorflow.nn.moments",
"tensorflow.nn.softmax",
"tensorflow.global_variables_initializer",
"tensorflow.cast",
"tensorflow.no_op",
"tens... |
evanaze/captcha | [
"62d226742be7f4091e54a7ea960703812bd44fd5"
] | [
"src/models/model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass Net(nn.Module):\n def __init__(self):\n super(Net, self).__init__()\n self.conv1 = nn.Conv2d(1, 32, 5, 2)\n self.conv2 = nn.Conv2d(32, 64, 7, 3)\n self.dropout1 = nn.Dropout2d(0.25)\n self.dropout2 =... | [
[
"torch.nn.Linear",
"torch.flatten",
"torch.nn.functional.log_softmax",
"torch.nn.Conv2d",
"torch.nn.functional.relu",
"torch.nn.functional.max_pool2d",
"torch.nn.Dropout2d"
]
] |
haosulab/SAPIEN | [
"6bc3f4e2be910199b793f185aea5791d9f193e4c"
] | [
"manualtest/kuafu_mem.py"
] | [
"# A minimal example of using KuafuRenderer\n#\n# By Jet <i@jetd.me>\n#\nimport sapien.core as sapien\nimport numpy as np\n\n\ndef main():\n sim = sapien.Engine()\n\n sapien.KuafuRenderer.set_log_level(\"debug\")\n\n config = sapien.KuafuConfig()\n config.use_viewer = True\n config.spp = 1\n\n ren... | [
[
"numpy.random.rand"
]
] |
rocke2020/vit-pytorch | [
"a1f828da0c952fa56a90a71f7c88c8e0025c1d42"
] | [
"vit_pytorch/vit.py"
] | [
"import torch\nfrom torch import nn, einsum\nimport torch.nn.functional as F\n\nfrom einops import rearrange, repeat\nfrom einops.layers.torch import Rearrange\n\n# helpers\n\ndef pair(t):\n return t if isinstance(t, tuple) else (t, t)\n\n# classes\n\nclass PreNorm(nn.Module):\n def __init__(self, dim, fn):\n... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.LayerNorm",
"torch.nn.Identity",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.Softmax",
"torch.einsum",
"torch.finfo",
"torch.nn.GELU",
"torch.randn"
]
] |
trex47/opencap | [
"fd641133b2abaab22c13912d97fe1fe64b132dd7"
] | [
"examples/pyopencap/pyscf/cap_trajectory.py"
] | [
"import os\nimport numpy as np\nimport functools\nfrom numpy import linalg as LA\nimport matplotlib.pyplot as plt\nimport argparse\n\n#########################################\n# Alter these values to suit your purposes\nref_energy = -1.1738730219803575\nguess = 13.1\neta_list = np.linspace(0,10000,1001)\n#########... | [
[
"numpy.reshape",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.real",
"numpy.linalg.eig",
"matplotlib.pyplot.ylabel",
"numpy.absolute",
"matplotlib.pyplot.show",
"numpy.linspace",
"numpy.gradient"... |
dantkz/tensorflow | [
"5333bbeb3142af2a06f1ebd971061fc4e28da743"
] | [
"tensorflow/contrib/cluster_resolver/python/training/tpu_cluster_resolver.py"
] | [
"# Copyright 2017 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 required... | [
[
"tensorflow.python.training.server_lib.ClusterSpec"
]
] |
smola/scipy | [
"ff8b9d9e87a585a820846d7f459d6156ba621c4d"
] | [
"benchmarks/benchmarks/signal_filtering.py"
] | [
"from __future__ import division, absolute_import, print_function\n\nimport numpy as np\nimport timeit\nfrom concurrent.futures import ThreadPoolExecutor, wait\n\ntry:\n from scipy.signal import lfilter, firwin, decimate, butter, sosfilt\nexcept ImportError:\n pass\n\nfrom .common import Benchmark\n\nclass De... | [
[
"scipy.signal.firwin",
"numpy.sin",
"scipy.signal.sosfilt",
"numpy.random.RandomState",
"numpy.random.seed",
"scipy.signal.butter",
"scipy.signal.lfilter",
"numpy.arange",
"scipy.signal.decimate",
"numpy.array_split"
]
] |
U-sepSick/NeRF | [
"c5910f84321eb5f72e3332507b0384f1b23f51f7"
] | [
"extract_color_mesh.py"
] | [
"import torch\nimport os\nimport numpy as np\nimport cv2\nfrom PIL import Image\nfrom collections import defaultdict\nfrom tqdm import tqdm\nimport mcubes\nimport open3d as o3d\nfrom plyfile import PlyData, PlyElement\nfrom argparse import ArgumentParser\n\nfrom models.rendering import *\nfrom models.nerf import *\... | [
[
"torch.cat",
"numpy.ones_like",
"numpy.empty",
"numpy.nan_to_num",
"torch.norm",
"torch.FloatTensor",
"numpy.argmax",
"torch.zeros_like",
"numpy.linalg.inv",
"numpy.vstack",
"numpy.array",
"numpy.zeros",
"numpy.clip",
"numpy.asarray",
"torch.no_grad",
... |
ealmuina/thesis | [
"d436ae0c6f775c56b2072889ceafae1507291c74"
] | [
"clusterapp/features/TimeParameters/StartTimeParameter.py"
] | [
"import numpy as np\n\nfrom .TimeParameter import TimeParameter\nfrom .__init__ import *\n\n\nclass StartTimeParameter(TimeParameter):\n name = 'StartTime'\n\n \"\"\"docstring for StartTimeParameter\"\"\"\n\n def __init__(self):\n super(TimeParameter, self).__init__()\n\n def measure(self, segmen... | [
[
"numpy.round"
]
] |
eric-sentient/MIDI-reAE-chords | [
"ac16210bbeb822cb4babb95974a4a05d527763cc"
] | [
"run.py"
] | [
"import numpy as np\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.utils import shuffle\r\nfrom keras.callbacks import EarlyStopping, ModelCheckpoint\r\nfrom keras import models\r\nimport model\r\nimport load_train\r\nfrom random import randrange\r\n\r\n\r\nBATCH_SIZE = 400\r\nEPOCHS = 100\... | [
[
"sklearn.model_selection.train_test_split",
"numpy.count_nonzero"
]
] |
ankit-ai/BertQA-Attention-on-Steroids | [
"49c3de360f88f55c8442b9f8153af56c28a689a9"
] | [
"examples/pytorch_pretrained_bert/modeling_conv.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may ... | [
[
"torch.nn.Linear",
"torch.sigmoid",
"torch.nn.Dropout",
"torch.cat",
"torch.zeros",
"torch.sqrt",
"torch.arange",
"torch.nn.Conv1d",
"torch.nn.Softmax",
"torch.nn.Tanh",
"torch.nn.CrossEntropyLoss",
"torch.nn.init.xavier_uniform_",
"torch.ones",
"torch.load"... |
DirkEilander/compound_hotspots | [
"f9d7960633be80e8e24d2f2563df367cc3f060c6"
] | [
"src/3-postprocess/peaks.py"
] | [
"#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n#\r\n# Author: Dirk Eilander (contact: dirk.eilander@vu.nl)\r\n# Created: Nov 2nd 2018\r\n\r\nimport xarray as xr\r\nimport numpy as np\r\nimport scipy\r\n\r\n__all__ = ['get_peaks', 'peaks_over_threshold', 'annual_max']\r\n\r\ndef get_peaks(ts, min_dist=1, dim='... | [
[
"numpy.nanpercentile",
"numpy.atleast_1d"
]
] |
lxxue/cil-road-segmentation-2019 | [
"c6477556dc3d6d9c8ed2f2a3f185b4d986a03bb4"
] | [
"furnace/engine/evaluator.py"
] | [
"import os\nimport os.path as osp\nimport cv2\nimport numpy as np\nimport time\nfrom tqdm import tqdm\n\nimport torch\nimport torch.nn.functional as F\nimport torch.multiprocessing as mp\n\nfrom engine.logger import get_logger\nfrom utils.pyt_utils import load_model, link_file, ensure_dir\nfrom utils.img_utils impo... | [
[
"numpy.concatenate",
"numpy.ceil",
"numpy.ascontiguousarray",
"torch.FloatTensor",
"torch.no_grad",
"torch.multiprocessing.get_context",
"torch.exp"
]
] |
Latronists/Two-Layer-Reinforcement-Learning | [
"91dbadf1a385e42c0eeea8a6329ed164edddb41b"
] | [
"multiagent/core.py"
] | [
"import numpy as np\n\n# physical/external base state of all entites\nclass EntityState(object):\n def __init__(self):\n # physical position\n self.p_pos = None\n # physical velocity\n self.p_vel = None\n\n# state of agents (including communication and internal/mental state)\nclass Ag... | [
[
"numpy.square",
"numpy.random.randn",
"numpy.zeros",
"numpy.logaddexp"
]
] |
alphacastio/connectors-eurostats | [
"297c92f667649469def9b1d140eab0aecb86fa89"
] | [
"0608.Labour & Income - European Union - Eurostat - Labour Market - Unemployment Rate.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport requests\nimport numpy as np\nimport pandas as pd\n\nfrom alphacast import Alphacast\nfrom dotenv import dotenv_values\nAPI_KEY = dotenv_values(\".env\").get(\"API_KEY\")\nalphacast = Alphacast(API_KEY)\n\n# In[2]:\n\n\ndf = pd.read_csv('https://ec.eur... | [
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
frc1678/server-2019 | [
"5ccf17945cbed9dd9587d55349a59a73ed06063c"
] | [
"consolidation.py"
] | [
"\"\"\"Functions that are used for the consolidation of tempTIMDs into one TIMD.\n\nThe main function in this file is consolidate_temp_timds(), which is\ncalled in calculate_timd.py.\"\"\"\n# External imports\nimport collections\nimport numpy as np\n# No internal imports\n\ndef consolidate_times(times):\n \"\"\"... | [
[
"numpy.std",
"numpy.mean"
]
] |
yashchandak/UnO | [
"caa709679236ec70d37c249e0cebace27fb30c51"
] | [
"Src/solver.py"
] | [
"#!~miniconda3/envs/pytorch/bin python\n# from __future__ import print_function\n# from memory_profiler import profile\n\n\nimport argparse\nfrom datetime import datetime\n\nimport numpy as np\nimport Src.Utils.utils as utils\nfrom Src.config import Config\nfrom time import time\nimport matplotlib.pyplot as plt\n\n... | [
[
"numpy.mean"
]
] |
INK-USC/expl-refinement | [
"815a7892a8d4c42fb429856746212a44f67d2547"
] | [
"matcher/Model/Phrase_Matcher_Predictor.py"
] | [
"from Model.Phrase_Matcher import *\nimport torch, time, numpy as np\n\nclass Phrase_Matcher_Predictor:\n def __init__(self, batch_size):\n self.batch_size = batch_size\n \n def predict(self, model_, data, train_mode):\n all_scores = []\n model_.eval()\n for i in range(int(np.ce... | [
[
"torch.load"
]
] |
marcorusc/project_repo_ecm_simul | [
"167cce668631be12f88e9f4936b4c39e71963e39"
] | [
"bin/physiboss.py"
] | [
"# PhysiBoSS Tab\nimport os\nfrom ipywidgets import Layout, Label, Text, Checkbox, Button, HBox, VBox, Box, \\\n FloatText, BoundedIntText, BoundedFloatText, HTMLMath, Dropdown, interactive, Output\nfrom collections import deque, Counter\nimport xml.etree.ElementTree as ET\nimport matplotlib.pyplot as plt\nfrom ... | [
[
"numpy.array",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.title",
"scipy.io.loadmat",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.transpose"
]
] |
BearerPipelineTest/google-ctf | [
"a0cab9cb6663ab908b9186d5428aa9674253c5c3",
"a0cab9cb6663ab908b9186d5428aa9674253c5c3"
] | [
"2020/hackceler8/match-3-package/other-challenge-src/inv/main.py",
"2021/quals/hw-parking/src/game.py"
] | [
"# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.array",
"numpy.dot"
],
[
"matplotlib.use",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.show"
]
] |
Feupos/DataScience | [
"d246ab70554095456afb14ddef990accb3f9d2ac"
] | [
"FakeNewsAnalysis/FakeNewsAnalysis/validate.py"
] | [
"import matplotlib.pyplot as plt\nfrom matplotlib import colors\nfrom matplotlib.ticker import PercentFormatter\nimport matplotlib.dates as md\n\nimport sklearn\nfrom sklearn import svm\nfrom sklearn.naive_bayes import GaussianNB, ComplementNB, MultinomialNB\nfrom sklearn.feature_extraction.text import CountVectori... | [
[
"pandas.read_pickle",
"sklearn.ensemble.RandomForestClassifier",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"sklearn.model_selection.KFold",
"matplotlib.pyplot.show"
]
] |
gycggd/leaf-classification | [
"b37dd4a6a262562c454038218c1472329e54128b"
] | [
"src/tf_train_mt_combined.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport argparse\nimport os\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--data_dir', type=str, default='',\n help='input data path')\nparser.add_argument('--model_dir', type=str, default='',\n help='output model path'... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.data.TFRecordDataset",
"tensorflow.nn.conv2d",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.global_variables_initializer",
"numpy.fromstring",
"tensorflow.parse_single_example",
"tensorflow.cast",
"num... |
wd15/pymks-clean | [
"97a4145c56626f6a1dea5c3a67dbaf83d3372446"
] | [
"pymks/tests/test_structure_analysis.py"
] | [
"import numpy as np\n\n\ndef test_n_componets_from_reducer():\n from pymks import MKSStructureAnalysis\n from pymks import DiscreteIndicatorBasis\n from sklearn.manifold import LocallyLinearEmbedding\n reducer = LocallyLinearEmbedding(n_components=7)\n dbasis = DiscreteIndicatorBasis(n_states=3, doma... | [
[
"sklearn.manifold.Isomap",
"numpy.allclose",
"sklearn.manifold.LocallyLinearEmbedding",
"numpy.random.randint",
"numpy.arange"
]
] |
g0lemXIV/pyod | [
"dfafc57f74dc3d49d0166f21ab2ddb97e3d1d898"
] | [
"pyod/test/test_so_gaal.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport sys\n\nimport unittest\n# noinspection PyProtectedMember\nfrom numpy.testing import assert_allclose\nfrom numpy.testing import assert_array_less\nfrom numpy.testing import assert_equal\nfrom numpy.t... | [
[
"sklearn.base.clone",
"numpy.testing.assert_raises",
"numpy.testing.assert_equal"
]
] |
jiangtiantu/kquant_data | [
"9bd47ba23c23110757186897e37ea36234bdce2c"
] | [
"demo_stock/A_1day/D04_download_pb_lf.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n下载财报一类的信息\n\"\"\"\nimport os\nimport pandas as pd\nfrom WindPy import w\nfrom kquant_data.xio.csv import write_data_dataframe, read_data_dataframe\nfrom kquant_data.api import all_instruments\nfrom kquant_data.wind_resume.wsd import download_daily_at\n\nfrom ... | [
[
"pandas.concat"
]
] |
yil532/MAX-Text-Sentiment-Classifier | [
"6f40c4f5def7d0a0ddd96cfc3e382d4c936b7ac6"
] | [
"training/training_code/bert/create_pretraining_data.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | [
[
"tensorflow.logging.set_verbosity",
"tensorflow.train.Features",
"tensorflow.gfile.Glob",
"tensorflow.python_io.TFRecordWriter",
"tensorflow.logging.info",
"tensorflow.gfile.GFile",
"tensorflow.app.run"
]
] |
mirofedurco/PyAstronomy | [
"b0e5806a18bde647654e6c9de323327803722864",
"b0e5806a18bde647654e6c9de323327803722864"
] | [
"src/modelSuite/atanProfile.py",
"src/funcFit/funcFitSanity.py"
] | [
"from __future__ import print_function, division\nfrom PyAstronomy import funcFit as fuf\nimport numpy as np\n\nclass AtanProfile(fuf.OneDFit):\n \"\"\"\n A profile based on the arc tangent function.\n \n This class implements the following profile:\n \n .. math::\n f(x) = \\\\frac{A}{2\\\\arct... | [
[
"numpy.arctan",
"numpy.sqrt",
"numpy.abs"
],
[
"numpy.random.random",
"numpy.linspace"
]
] |
hyperlist/mmdetection | [
"ba4918de7fb21a96edc373584fa21a17d098a843"
] | [
"mmdet/models/backbones/pvt.py"
] | [
"import math\nimport warnings\n\nimport numpy as np\nimport paddle\nimport paddle.nn as nn\n\nfrom mmcv.cnn import (Conv2d, build_activation_layer, build_norm_layer,\n constant_init, normal_init, trunc_normal_init)\nfrom mmcv.cnn.bricks.drop import build_dropout\nfrom mmcv.cnn.bricks.transforme... | [
[
"numpy.prod",
"torch.nn.modules.utils._pair"
]
] |
jiwei0921/MRNet | [
"e1736a9e0d4c1b0996badbbeb870703fef119ab2"
] | [
"MRNet_code/utils/dice_loss.py"
] | [
"import torch\nfrom torch.autograd import Function\nimport numpy as np\n\n\nclass DiceCoeff(Function):\n \"\"\"Dice coeff for individual examples\"\"\"\n\n def forward(self, input, target):\n self.save_for_backward(input, target)\n eps = 0.0001\n self.inter = torch.dot(input.view(-1), tar... | [
[
"torch.FloatTensor",
"torch.sum"
]
] |
satyarth42/Soft-computing-lab | [
"0142332e8c17d358c3518cd2bdfef1f74b1a340d"
] | [
"4 fuzzy distances.py"
] | [
"import numpy as np\r\na = [x for x in input().split(\" \")]\r\nb = [x for x in input().split(\" \")]\r\nd_a = {}\r\nd_b = {}\r\nfor x in a:\r\n x = x.split(',')\r\n d_a[int(x[0])]=float(x[1])\r\n\r\nfor x in b:\r\n x = x.split(',')\r\n d_b[int(x[0])]=float(x[1])\r\n\r\nprint(\"set A \"+str(d_a))\r\npri... | [
[
"numpy.sqrt"
]
] |
blab/dengue | [
"5eacc47fbd77c59e7342d5be4aa81f7d3b4ff0bf"
] | [
"titer_model/implementation-nextstrain-augur/base/prediction.py"
] | [
"from __future__ import division, print_function\nimport numpy as np\nimport time\nfrom collections import defaultdict\nfrom base.io_util import myopen\nfrom itertools import izip\nimport pandas as pd\n\ndef LBI(tree, tau=0.001, attr='lbi'):\n '''\n traverses the tree in postorder and preorder to calculate th... | [
[
"numpy.linspace",
"numpy.exp"
]
] |
bkong1990/pytorch-adda | [
"a503bc47187e61f06636d843be067ffb889dda6f"
] | [
"utils.py"
] | [
"\"\"\"Utilities for ADDA.\"\"\"\n\nimport os\nimport random\n\nimport torch\nimport torch.backends.cudnn as cudnn\nfrom torch.autograd import Variable\n\nimport params\nfrom datasets import get_mnist, get_usps\n\n\ndef make_variable(tensor, volatile=False):\n \"\"\"Convert Tensor to Variable.\"\"\"\n if torc... | [
[
"torch.cuda.manual_seed_all",
"torch.autograd.Variable",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.load"
]
] |
lijianhet/neurogym | [
"b82981f7ecac556e9dd3c478ffc37cce49e4ead1"
] | [
"neurogym/utils/plotting.py"
] | [
"\"\"\"Plotting functions.\"\"\"\n\nimport glob\nimport numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\n\nimport gym\n\n\n# TODO: This is changing user's plotting behavior for non-neurogym plots\nmpl.rcParams['font.size'] = 7\nmpl.rcParams['pdf.fontt... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.array",
"numpy.zeros_like",
"matplotlib.animation.FuncAnimation",
"numpy.round",
"numpy.ones",
"numpy.load",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.min",
... |
fritzo/funsor | [
"1d07af18c21894dd56e2f4f877c7845430c3b729"
] | [
"test/test_optimizer.py"
] | [
"# Copyright Contributors to the Pyro project.\n# SPDX-License-Identifier: Apache-2.0\n\nfrom collections import OrderedDict\n\nimport pytest\n\nimport funsor\nfrom funsor.domains import Bint\nfrom funsor.einsum import (\n einsum,\n naive_contract_einsum,\n naive_einsum,\n naive_plated_einsum,\n)\nfrom ... | [
[
"torch.allclose"
]
] |
FilipBronic/sktime | [
"d613d704cdc7263ad28fb4519d2d301f2ebd0779",
"d613d704cdc7263ad28fb4519d2d301f2ebd0779"
] | [
"sktime/classification/feature_based/_matrix_profile_classifier.py",
"sktime/forecasting/ets.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Martrix Profile classifier.\n\nPipeline classifier using the Matrix Profile transformer and an estimator.\n\"\"\"\n\n__author__ = [\"Matthew Middlehurst\"]\n__all__ = [\"MatrixProfileClassifier\"]\n\nimport numpy as np\nfrom sklearn.neighbors import KNeighborsClassifier\n\nfrom sktim... | [
[
"numpy.where",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.zeros",
"numpy.unique"
],
[
"numpy.isinf",
"numpy.nanargmin",
"numpy.isnan"
]
] |
ghosalsattam/graphics | [
"946aa03b5178d2fc557a81045b84df24af322afd"
] | [
"tensorflow_graphics/geometry/transformation/tests/euler_test.py"
] | [
"# Copyright 2020 The TensorFlow 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"tensorflow.convert_to_tensor"
]
] |
diatomsRcool/NSF_awards | [
"2943629d68339f24f85e1badb8abf85ee8775839"
] | [
"award_explore.py"
] | [
"import pandas as pd\nimport numpy as np\n\ndata = []\n\nf = range(1,75,1)\nfor n in f:\n print(n)\n in_file = open('/Users/annethessen/NSF_awards/award_data/' + str(n) + '.txt', 'r')\n next(in_file)\n for line in in_file:\n line.strip('\\n')\n row = line.split('\\t')\n #print(row[0... | [
[
"pandas.DataFrame",
"numpy.array"
]
] |
shc558/wwyfcs | [
"05ca6c94f59f7317e4e597d3df18f549dcadf7c1"
] | [
"wwyfcs/trainer/train_language_model.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nFine-tuning DialoGPT using language modeling based on\nHuggingface transformers run_language_modeling.py &\ntutorial from Nathan Cooper\n\"\"\"\nimport pandas as pd\nimport logging\nimport math\nimport os\nimport pickle\nfrom dataclasses import dataclass, field\nfrom typing import ... | [
[
"torch.nn.utils.rnn.pad_sequence",
"pandas.read_csv",
"torch.tensor",
"torch.stack"
]
] |
jjdelvalle/gradcafe_analysis | [
"a5d72bd7e60d014d5ed1111ea2a32cb503f89c55"
] | [
"app/parse_html.py"
] | [
"from bs4 import BeautifulSoup\nimport datetime, time\nfrom IPython.core.debugger import Pdb\nimport sys, re\nimport os.path\nfrom collections import Counter\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport pandas\n\n\nPROGS = [\n ('Computer Engineering', 'Electrical and Computer Engineering'),\n ... | [
[
"pandas.DataFrame"
]
] |
ZikangXiong/two-d-nav-gym | [
"1ab3d5323e87d672f04a9c796f7ccabb752a6e67"
] | [
"two_d_nav/utils.py"
] | [
"import math\n\nimport numpy as np\nimport pygame\n\nfrom two_d_nav import config\n\n\ndef normalize_pos(pos: np.ndarray) -> np.ndarray:\n map_size = np.array(config.map_size)\n center = map_size / 2\n radius = map_size - center\n\n return (pos - center) / radius\n\n\ndef denormalize_pos(pos: np.ndarray... | [
[
"numpy.array"
]
] |
Angelnatao/asv-subtools | [
"77d4d940d235b16e9e36a6ee07ce283fa36f4172"
] | [
"pytorch/libs/nnet/pooling.py"
] | [
"# -*- coding:utf-8 -*-\n\n# Copyright xmuspeech (Author: Snowdar 2019-05-29 2020-06-10)\n\nimport numpy as np\n\nimport torch\nimport torch.nn.functional as F\n\nfrom libs.support.utils import to_device\n\nfrom .components import *\n\n## Pooling ✿\nclass StatisticsPooling(torch.nn.Module):\n \"\"\" An usual mea... | [
[
"torch.zeros",
"torch.cat",
"torch.nn.Softmax",
"torch.ones",
"torch.nn.ReLU",
"torch.tensor",
"torch.mean",
"torch.randn",
"torch.sum"
]
] |
harupy/koalas | [
"db2b00a0d57a16d7ccac101607195d2face73572"
] | [
"databricks/koalas/tests/test_series_conversion.py"
] | [
"#\n# Copyright (C) 2019 Databricks, 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 la... | [
[
"pandas.Series"
]
] |
bcrafton/ssdfa | [
"661f9059184fde6ba7ad1ca710c5b5a1954c5ea6"
] | [
"lib/BatchNorm.py"
] | [
"\nimport tensorflow as tf\nimport numpy as np\nimport math\nfrom tensorflow.python.ops import gen_nn_ops\n\nfrom lib.Layer import Layer\n\nclass BatchNorm(Layer):\n def __init__(self, input_size, name=None, load=None, train=True, eps=1e-3):\n self.input_size = list(input_size)\n if len(self.input_... | [
[
"numpy.zeros",
"numpy.ones",
"tensorflow.Variable",
"numpy.load",
"tensorflow.nn.moments",
"tensorflow.reshape",
"numpy.shape",
"tensorflow.python.ops.gen_nn_ops.fused_batch_norm_grad_v2",
"tensorflow.sqrt",
"numpy.prod",
"tensorflow.nn.batch_normalization",
"tensor... |
khanzaifa37/HR_Help | [
"8c010e8f369028f306b5aa396137c1036af872f6"
] | [
"app.py"
] | [
"import os, sys, shutil, time\nimport pickle\nfrom flask import Flask, request, jsonify, render_template,send_from_directory\nimport pandas as pd\nfrom sklearn.externals import joblib\nfrom sklearn.ensemble import RandomForestClassifier\nimport numpy as np\nimport urllib.request\nimport json\nfrom geopy.geocoders i... | [
[
"sklearn.preprocessing.LabelEncoder",
"pandas.cut",
"pandas.concat",
"pandas.DataFrame",
"sklearn.model_selection.RandomizedSearchCV",
"scipy.stats.randint",
"sklearn.preprocessing.MinMaxScaler",
"pandas.Series",
"sklearn.model_selection.train_test_split",
"sklearn.tree.Dec... |
s-arora-1987/Disaster-Response-App | [
"2c2a74bea481d4c52520b35d92f9344d63528ee3"
] | [
"workspace/models/train_classifier.py"
] | [
"import sys\nimport pandas as pd\nfrom sqlalchemy import create_engine\nimport time\nimport pickle\n\n# for tokenizing\nimport nltk\nnltk.download(['punkt', 'wordnet'])\nimport re\nfrom nltk.tokenize import word_tokenize\nfrom nltk.stem import WordNetLemmatizer\nurl_regex = 'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[... | [
[
"sklearn.metrics.classification_report",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.model_selection.train_test_split",
"sklearn.feature_extraction.text.TfidfTransformer",
"pandas.read_sql_table"
]
] |
oplatek/ndm | [
"d32bd9d685902d9da52b7e7abd286fb5d9c7274a",
"d32bd9d685902d9da52b7e7abd286fb5d9c7274a"
] | [
"ndm/model_cnn12_bn_w2targs.py",
"ndm/model_rnn2_w2t.py"
] | [
"#!/usr/bin/env python3\n\nimport tensorflow as tf\n\nfrom tfx.bricks import embedding, dense_to_one_hot, linear, dropout, reduce_max, batch_norm_lin, conv2d_bn, \\\n pow_1, softmax_2d\n\nfrom model import ModelW2TArgs\n\n\nclass Model(ModelW2TArgs):\n def __init__(self, data, FLAGS):\n super(Model, se... | [
[
"tensorflow.trainable_variables",
"tensorflow.concat",
"tensorflow.nn.relu",
"tensorflow.argmax",
"tensorflow.random_uniform",
"tensorflow.Variable",
"tensorflow.scalar_summary",
"tensorflow.clip_by_value",
"tensorflow.name_scope",
"tensorflow.gather",
"tensorflow.nn.so... |
skjerns/NT1-HRV | [
"cb6de312f6b2710c4d059bb2a4638b053617c2f7"
] | [
"sandbox/compare_hypnograms_second_rater.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Apr 1 14:48:42 2020\n\n@author: skjerns\n\"\"\"\nimport config as cfg\nimport ospath\nimport shutil\nimport sleep_utils\nimport numpy as np\nfrom sklearn.metrics import cohen_kappa_score\nimport matplotlib.pyplot as plt\n\n\nfiles = ospath.list_files(cfg.folder_edf,... | [
[
"numpy.mean",
"matplotlib.pyplot.title",
"sklearn.metrics.cohen_kappa_score",
"matplotlib.pyplot.subplots"
]
] |
ZW7436/PycQED_py3 | [
"dcc19dbaedd226112a2f98a7985dcf2bab2c9734"
] | [
"pycqed/instrument_drivers/physical_instruments/ZurichInstruments/ZI_HDAWG8.py"
] | [
"import time\nimport logging\nimport os\nimport numpy as np\nfrom . import zishell_NH as zs\nfrom qcodes.utils import validators as vals\nfrom .ZI_base_instrument import ZI_base_instrument\nfrom qcodes.instrument.parameter import ManualParameter\nfrom zlib import crc32\n\nimport ctypes\nfrom ctypes.wintypes import ... | [
[
"numpy.array",
"numpy.savetxt",
"numpy.zeros",
"numpy.genfromtxt",
"numpy.arange",
"numpy.vstack"
]
] |
yketa/active_work | [
"99107a0d4935296b673f67469c1e2bd258954b9b"
] | [
"cloningR.py"
] | [
"\"\"\"\nModule cloningR launches cloning simulations of rotors and provides classes to\nread output data files from these simulations.\n\nBias is chosen with environment variable `CLONING_BIAS':\n (0) order parameter,\n (1) squared order parameter.\n(see https://yketa.github.io/DAMTP_MSC_2019_Wiki/#Brownian%... | [
[
"numpy.random.seed",
"numpy.linspace",
"numpy.random.randint",
"numpy.empty"
]
] |
linyuehzzz/hedetniemi_distance | [
"e1e3378f7f7013e0e36f4026da1342beac725a98"
] | [
"scripts/floyd/floyd_distance_nb_cuda.py"
] | [
"from timeit import default_timer\nfrom numba import cuda, njit, float32\nimport numpy as np\nimport math\nimport timeout_decorator\n\n\n##******** Read graph data ********##\n\n## Number of nodes (100/1,000/10,000/100,000/1,000,000)\nnodes = [100, 1000, 10000, 100000, 1000000]\nprint('Nodes: ', nodes)\n## Total de... | [
[
"numpy.array"
]
] |
kaggledatasets/kaggledatasets | [
"685d16590667443546f7ad2c31dfac8ad6be6ca2"
] | [
"kaggledatasets/structured/newyork_airbnb_opendata.py"
] | [
"# Copyright 2019 Omkar Prabhu\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 agreed... | [
[
"pandas.read_csv",
"tensorflow.data.experimental.make_csv_dataset"
]
] |
dontLoveBugs/MyTorch | [
"d14bd1a231bde7f2e05282f86c640bcce4a55baf"
] | [
"instances/fcn/voc.fcn32s.R101_v1c/train.py"
] | [
"from __future__ import division\nimport os.path as osp\nimport sys\nimport argparse\nfrom tqdm import tqdm\n\nimport torch\nimport torch.nn as nn\nimport torch.distributed as dist\nimport torch.backends.cudnn as cudnn\nfrom torch.nn.parallel import DistributedDataParallel\n\nfrom config import config\nfrom dataloa... | [
[
"torch.cuda.manual_seed",
"torch.optim.SGD",
"torch.nn.parallel.DistributedDataParallel",
"torch.manual_seed",
"torch.cuda.set_device",
"torch.cuda.is_available",
"torch.distributed.all_reduce",
"torch.nn.CrossEntropyLoss"
]
] |
Ashiroes/flask_api_dl | [
"2a39b653ad2de7fd5da48735b4711d791ce62053"
] | [
"style_transfer.py"
] | [
"# =======================================================================================================================\n# TRANSFERT DE STYLE\n# =======================================================================================================================\nimport base64\nimport json\nimport time\nfrom i... | [
[
"tensorflow.config.experimental_run_functions_eagerly",
"tensorflow.io.read_file",
"tensorflow.function",
"tensorflow.keras.Model",
"tensorflow.clip_by_value",
"tensorflow.keras.applications.vgg19.preprocess_input",
"tensorflow.cast",
"tensorflow.linalg.einsum",
"tensorflow.ima... |
Moonire/L-system_python | [
"b21f2d7a7b9dd571f47c95fda3cad5e8cff2e00b"
] | [
"L-System.py"
] | [
"import matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\n\"\"\"\r\nNon Stochastic Context free L-system implementation for python 3.x\r\nConformaly to the description given in 'The Algorithmic Beauty of Plants' by Lindenmayer (algorithmicbotany.org/papers/abop/abop.pdf)\r\ni.e : the angles are in degrees and g... | [
[
"numpy.sin",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.plot",
"numpy.transpose",
"numpy.cos",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
]
] |
ctoher/pymatgen | [
"54df358f61fbe60417e90850811b75c1a9e2e230"
] | [
"pymatgen/io/abinitio/abiinspect.py"
] | [
"# coding: utf-8\n\"\"\"\nThis module provides objects to inspect the status of the Abinit tasks at run-time.\nby extracting information from the main output file (text format).\n\"\"\"\nfrom __future__ import unicode_literals, division, print_function\n\nimport collections\nimport numpy as np\nimport yaml\nimport ... | [
[
"numpy.array",
"matplotlib.pyplot.subplots"
]
] |
fossabot/xclim | [
"31fbdce6545d29e8a762b64b880e04eeb601f9eb"
] | [
"xclim/testing/tests/test_cli.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Tests for `xclim` package, command line interface\nimport numpy as np\nimport pytest\nimport xarray as xr\nfrom click.testing import CliRunner\n\nimport xclim\nfrom xclim.cli import cli\nfrom xclim.testing import open_dataset\n\ntry:\n from dask.distributed impo... | [
[
"numpy.testing.assert_allclose",
"numpy.ones"
]
] |
AnuragAnalog/Machine-learning | [
"4ec2657524cb54d715b0bddeb7d8ea3b7644a302"
] | [
"encoding.py"
] | [
"#!/usr/bin/python3\n\nimport numpy as np\n\nclass OneHotEncoder():\n def __init__(self):\n self.unique = dict()\n self.fit_called = False\n self.row = 2\n self.column = 2\n\n def __str__(self):\n if self.fit_called:\n return \"Encoding is: \"+str(self.unique)\n ... | [
[
"numpy.array"
]
] |
liaoaoyuan97/pandas | [
"2fad6a38f8ecb1f4f7568ca57cb974f7f058cb9d"
] | [
"pandas/plotting/_core.py"
] | [
"import importlib\nfrom typing import TYPE_CHECKING, Optional, Sequence, Tuple, Union\n\nfrom pandas._config import get_option\n\nfrom pandas._typing import Label\nfrom pandas.util._decorators import Appender, Substitution\n\nfrom pandas.core.dtypes.common import is_integer, is_list_like\nfrom pandas.core.dtypes.ge... | [
[
"pandas.util._decorators.Substitution",
"pandas.core.dtypes.common.is_integer",
"pandas._config.get_option",
"pandas.core.dtypes.common.is_list_like",
"pandas.util._decorators.Appender"
]
] |
floregol/gae | [
"d5db3f32a8d26001a9b44f7a863a75a61807461f",
"d5db3f32a8d26001a9b44f7a863a75a61807461f"
] | [
"gae/layers.py",
"gae/train.py"
] | [
"from gae.initializations import *\nimport tensorflow as tf\n\nflags = tf.app.flags\nFLAGS = flags.FLAGS\n\n# global unique layer ID dictionary for layer name assignment\n_LAYER_UIDS = {}\n\n\ndef get_layer_uid(layer_name=''):\n \"\"\"Helper function, assigns unique layer IDs\n \"\"\"\n if layer_name not i... | [
[
"tensorflow.floor",
"tensorflow.sparse_retain",
"tensorflow.random_uniform",
"tensorflow.matmul",
"tensorflow.transpose",
"tensorflow.reshape",
"tensorflow.variable_scope",
"tensorflow.name_scope",
"tensorflow.sparse_tensor_dense_matmul",
"tensorflow.nn.dropout"
],
[
... |
singhnarotam1997/Detectron | [
"ecc6b25fc8869486126f1384b4e6e042a718bd5b"
] | [
"detectron/utils/boxes.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n##############################################################################\n#\n# Based on:\n# ----------------... | [
[
"numpy.minimum",
"numpy.exp",
"numpy.mean",
"numpy.where",
"numpy.sort",
"numpy.max",
"numpy.uint8",
"numpy.log",
"numpy.vstack",
"numpy.array",
"numpy.zeros",
"numpy.round",
"numpy.float32",
"numpy.hstack",
"numpy.average",
"numpy.ascontiguousarray"... |
zhutianpeng/ImgProcessPlatform_pose | [
"748be1b98a44450671809e1d6040fd9aa0ff7998"
] | [
"src/run_directory.py"
] | [
"\nimport argparse\nimport logging\nimport time\nimport glob\nimport ast\nimport os\n# import dill\nimport redis\n\nfrom RedisQueue import RedisQueue\nimport dealimg\n\nimport common\nimport cv2\nimport numpy as np\nfrom estimator import TfPoseEstimator\nfrom networks import get_graph_path, model_wh\n\nfrom lifting... | [
[
"numpy.fromstring"
]
] |
James-OHara/NCHRP-BSM-Traffic-Measures | [
"d6842c9dc63de8c2d470482fbfd1ec91a9c2ae56"
] | [
"Mobility Algorithms/Queues at Known Locations/Machine_Learning/train_test_export_ML_model_offline.py"
] | [
"\"\"\"This python script trains supervised machine learning Random Forest models on the complete data provided, \nouptputs performance metrics, and exports the trained Random Forest to a pickle file.\n\nTest with: python train_test_export_ML_model_offline.py sample_BSMs_X_file.csv sample_max_queues_Y_file.csv samp... | [
[
"pandas.to_datetime",
"sklearn.metrics.confusion_matrix",
"pandas.cut",
"pandas.merge",
"sklearn.ensemble.RandomForestClassifier",
"numpy.sum",
"sklearn.metrics.accuracy_score",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.f1_score"
]
] |
garima-mahato/EVA4 | [
"e8efe40a4de2d5da3a04314f52a02610ecde16f1"
] | [
"S7/python_files/model.py"
] | [
"from __future__ import print_function\r\nimport math\r\nimport numpy\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nimport torch.optim as optim\r\nfrom torchvision import datasets, transforms\r\nfrom torch.optim.lr_scheduler import StepLR\r\nimport matplotlib.pyplot as plt\r\nfrom t... | [
[
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.functional.log_softmax",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
francelico/deep-reinforcement-learning | [
"65ea99a4ecf527cb9d8a703313da4815f4688ff0"
] | [
"p3_collab-compet/maddpg_agentlab.py"
] | [
"# main code that contains the neural network setup\n# policy + critic updates\n# see ddpg.py for other details in the network\n\nfrom ddpg import DDPGAgent\nimport torch\nfrom utilities import soft_update, transpose_to_tensor, transpose_list\n#device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\... | [
[
"torch.nn.SmoothL1Loss",
"torch.cat",
"torch.stack",
"torch.no_grad"
]
] |
imbyjuli/blackboard-tensorflow-nrp | [
"93fb4b5ba18e5e3c55526670160ee3ec21626e43"
] | [
"model_src/colour/bw_network/backward_model.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\n# Imports\nimport numpy as np\nimport tensorflow as tf\nimport cv2\nimport csv\nfrom backward_weights import init_locally_backward_weights ,initiate_backward_weights\nfrom backward_layers import ait_ba... | [
[
"tensorflow.logging.set_verbosity",
"tensorflow.estimator.EstimatorSpec",
"tensorflow.train.AdagradOptimizer",
"tensorflow.reshape",
"tensorflow.losses.mean_squared_error",
"tensorflow.layers.dense",
"tensorflow.nn.softmax",
"tensorflow.train.get_global_step",
"tensorflow.cast"... |
xbrq/gilp | [
"7fb1d2425d905aa43a5bcde25713b40878bc30d1",
"7fb1d2425d905aa43a5bcde25713b40878bc30d1"
] | [
"gilp/tests/test_graphic.py",
"gilp/_geometry.py"
] | [
"import pytest\nimport numpy as np\nimport plotly.graph_objects as plt\nfrom gilp._graphic import (Figure, num_format, linear_string, equation_string,\n label)\n\n\n# The following functions are not tested since they create visual objects:\n# table, vector, scatter, line, equation, and pol... | [
[
"numpy.array"
],
[
"numpy.array",
"numpy.linalg.norm",
"numpy.linalg.matrix_rank",
"numpy.matmul",
"numpy.zeros",
"numpy.round",
"numpy.linalg.det",
"numpy.mean",
"numpy.where",
"numpy.arctan2",
"numpy.linalg.solve",
"scipy.spatial.HalfspaceIntersection",
... |
healther/elephant | [
"b4525dcabc1f4c2204479f580100151eaebd8603"
] | [
"elephant/spike_train_generation.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nFunctions to generate spike trains from analog signals,\nor to generate random spike trains.\n\nSome functions are based on the NeuroTools stgen module, which was mostly\nwritten by Eilif Muller, or from the NeuroTools signals.analogs module.\n\n:copyright: Copyright 2015 by the El... | [
[
"numpy.min",
"numpy.where",
"numpy.finfo",
"numpy.sort",
"numpy.cumsum",
"numpy.random.random",
"numpy.concatenate",
"numpy.sqrt",
"numpy.append",
"numpy.vstack",
"numpy.delete",
"numpy.array",
"numpy.zeros",
"numpy.shape",
"numpy.diff",
"numpy.dstac... |
Turoad/py-RFCN-priv | [
"f2837b0aa2b74941bf5a62304798b74547d486f4"
] | [
"lib/fast_rcnn/config.py"
] | [
"# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\n\"\"\"Fast R-CNN config system.\n\nThis file specifies defa... | [
[
"numpy.array"
]
] |
jwarndt/uspy | [
"ab5bb73f9243a1d7978c83ccb63e7189fc18cd8a"
] | [
"uspy/features/lsr.py"
] | [
"import math\r\nimport os\r\n\r\nimport cv2\r\nfrom osgeo import gdal\r\nfrom osgeo import ogr\r\nfrom osgeo import osr\r\nimport skimage\r\nfrom skimage.color import rgb2gray\r\nfrom skimage._shared._warnings import expected_warnings\r\nfrom scipy.stats import entropy\r\nimport numpy as np\r\n\r\nfrom nmapy.utilit... | [
[
"scipy.stats.entropy",
"numpy.tan",
"numpy.mean",
"numpy.where",
"numpy.unique",
"numpy.max",
"numpy.histogram",
"numpy.unravel_index",
"numpy.argmax",
"numpy.array",
"numpy.zeros",
"numpy.float32",
"numpy.arctan",
"numpy.sum",
"numpy.ones",
"numpy.r... |
leonardozcm/Point-Completion-Fig-AutoGenerator | [
"93e7151610765e7e2b41ace2d03c8750f0b6c80c"
] | [
"utils/metrics.py"
] | [
"# -*- coding: utf-8 -*-\n# @Author: Haozhe Xie\n# @Date: 2019-08-08 14:31:30\n# @Last Modified by: Haozhe Xie\n# @Last Modified time: 2020-05-25 09:13:32\n# @Email: cshzxie@gmail.com\n\nimport logging\nimport open3d\nimport torch\n\nfrom Chamfer3D.dist_chamfer_3D import chamfer_3DDist\n\nclass Metrics(object)... | [
[
"torch.mean"
]
] |
Somefive/cogdl | [
"cf594cdb3a97f45333d08c937205d1a691828a33"
] | [
"cogdl/data/dataloader.py"
] | [
"import torch.utils.data\nfrom torch.utils.data.dataloader import default_collate\n\nfrom cogdl.data import Batch, Data\n\n\nclass DataLoader(torch.utils.data.DataLoader):\n r\"\"\"Data loader which merges data objects from a\n :class:`cogdl.data.dataset` to a mini-batch.\n\n Args:\n dataset (Datase... | [
[
"torch.utils.data.dataloader.default_collate"
]
] |
dbhaskar92/GSAE | [
"3340dfc38f95b29ff04d890d93deedf8dcae9324",
"3340dfc38f95b29ff04d890d93deedf8dcae9324"
] | [
"gsae/utils/load_splits.py",
"train_gsae.py"
] | [
"import numpy as np\n\nimport torch\nimport torch.utils.data\nfrom torch import nn, optim\nfrom torch.nn import functional as F\n\nfrom gsae.utils import eval_metrics\n\n# DEFINE THESE GLOBAL VARIABLES WITH YOUR OWN PATHS TO DATA\n########################################\nSEQ3_DATA_DIR = ''\nSEQ4_DATA_DIR = ''\nHIV... | [
[
"numpy.log",
"numpy.load",
"torch.eye",
"torch.utils.data.DataLoader",
"torch.Tensor",
"torch.utils.data.TensorDataset"
],
[
"torch.nn.MSELoss",
"torch.utils.data.random_split",
"torch.no_grad",
"torch.utils.data.DataLoader",
"torch.utils.data.TensorDataset"
]
] |
ImLaoBJie/yolo3_sort_deepsort | [
"6a6028d42f240aa0b79656f36f85f96b9a90ab00"
] | [
"read_data_cifar100.py"
] | [
"import pickle\nimport numpy as np\nimport os\nimport matplotlib.pyplot as plt\n\nPATH = 'cifar-100-python/'\nREMOVE = list(range(0, 100))\nREMAIN = list(np.concatenate([[11, 35, 46, 98], [8, 13, 48, 58], [81, 85]]))\nfor i in REMAIN:\n REMOVE.remove(i)\n\n\ndef filter(image, label):\n # filter\n remove_in... | [
[
"numpy.concatenate",
"numpy.rot90",
"numpy.array",
"numpy.delete",
"numpy.random.permutation",
"numpy.dstack",
"matplotlib.pyplot.show",
"numpy.int32",
"numpy.flip",
"matplotlib.pyplot.imshow"
]
] |
simonthor/madflow | [
"cc4ee123d1d6cea7295a8f4be774eff87ea727cf"
] | [
"python_package/madflow/parameters.py"
] | [
"\"\"\"\n Utilities and functions to deal with the parameters of the model\n\"\"\"\nfrom .config import DTYPE, DTYPECOMPLEX, complex_me, float_me, run_eager\nimport numpy as np\nimport tensorflow as tf\nfrom itertools import chain\n\nGS_SIGNATURE = [tf.TensorSpec(shape=[None], dtype=DTYPECOMPLEX)]\nALPHAS_SIGNAT... | [
[
"tensorflow.TensorSpec",
"tensorflow.function",
"tensorflow.math.sqrt"
]
] |
RocketRoss/setigen | [
"fde4434094b5cc0d095c341d0b90e8f65c9e9215"
] | [
"tests/test_cband_h5.py"
] | [
"import pytest\n\nimport os\nimport numpy as np\n# from astropy import units as u\nimport setigen as stg\n\n\n@pytest.fixture()\ndef frame_setup_from_h5():\n my_path = os.path.abspath(os.path.dirname(__file__))\n path = os.path.join(my_path, 'assets/sample.fil')\n frame = stg.Frame(waterfall=path)\n ret... | [
[
"numpy.min"
]
] |
iSmida/DetectionYolo | [
"b7e1eb26ca874da797cee02cb3e1639cf3546e0c"
] | [
"lib/ssds.py"
] | [
"from __future__ import print_function\nimport numpy as np\n\nimport torch\nfrom torch.autograd import Variable\nimport torch.backends.cudnn as cudnn\nimport timeit\n\nfrom lib.layers import *\nfrom lib.utils.timer import Timer\nfrom lib.utils.data_augment import preproc\nfrom lib.modeling.model_builder import crea... | [
[
"torch.cuda.is_available",
"torch.Tensor",
"torch.load",
"torch.cuda.device_count"
]
] |
pysofe/pysofe | [
"088d4061fcf194a85ff3332e7bdd3bde095e4f69"
] | [
"pysofe/spaces/functions.py"
] | [
"\"\"\"\nProvides convinience classes for functions in the fem framework.\n\"\"\"\n\n# IMPORTS\nimport numpy as np\n\n# DEBUGGING\nfrom IPython import embed as IPS\n\nclass FEFunction(object):\n '''\n A finite element function defined via degrees of freedoms.\n\n Parameters\n ----------\n\n fe_space ... | [
[
"numpy.asarray",
"numpy.size"
]
] |
jeffhsu3/BERMUDA | [
"1e1e031b7dc59bca98a494729f151905bf05e13b"
] | [
"helper.py"
] | [
"# !/usr/bin/env python\nimport numpy as np\nfrom sklearn.decomposition import PCA\nimport umap\nimport matplotlib.pyplot as plt\n\n# 9-class Set1, for plotting data with qualitative labels\ncolor_dict = {0:'#e41a1c', 1:'#377eb8', 2:'#4daf4a', 3: '#984ea3', 4:'#ff7f00',\n 5:'#ffff33', 6:'#a65628', 7:'#... | [
[
"numpy.zeros",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"numpy.where",
"numpy.argsort",
"sklearn.decomposition.PCA",
"numpy.unique"
]
] |
tgisaturday/DP_AAE | [
"3d6afa549731410156c60ff01cba9b8498bc2436"
] | [
"imageAAE/PPAPGAN/cifar10_PPAPGAN.py"
] | [
"import tensorflow as tf\nfrom tensorflow.python.keras._impl.keras.datasets.cifar10 import load_data\nimport numpy as np\nimport matplotlib.pyplot as plt\nplt.switch_backend('agg')\nimport matplotlib.gridspec as gridspec\nimport os\nimport math\nimport cv2\nimport time\nfrom scipy.misc import toimage\nfrom utils im... | [
[
"tensorflow.contrib.layers.batch_norm",
"tensorflow.nn.conv2d",
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.ones_like",
"numpy.min",
"tensorflow.reshape",
"tensorflow.sqrt",
"tensorflow.nn.xw_plus_b",
"tensorflow.zeros_like",
"tensorflow.clip_by_value",
... |
Site-Command/fiftyone | [
"5bfea96d2aba037e77b189d0ba3713e1b87ef654"
] | [
"fiftyone/core/aggregations.py"
] | [
"\"\"\"\nAggregations.\n\n| Copyright 2017-2021, Voxel51, Inc.\n| `voxel51.com <https://voxel51.com/>`_\n|\n\"\"\"\nfrom copy import deepcopy\n\nimport numpy as np\n\nimport eta.core.utils as etau\n\nimport fiftyone.core.expressions as foe\nfrom fiftyone.core.expressions import ViewField as F\nimport fiftyone.core.... | [
[
"numpy.array",
"numpy.abs",
"numpy.linspace"
]
] |
PhoneSix/Domain-Contrast | [
"5c674b581bce9beacf5bc0dd13113f33c4050495"
] | [
"lib/datasets/comic.py"
] | [
"from __future__ import print_function\nfrom __future__ import absolute_import\n# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# ----------------------------------------... | [
[
"numpy.mean",
"scipy.io.loadmat",
"numpy.zeros"
]
] |
hai-h-nguyen/pomdp-baselines | [
"629180d56641810d99653a116cca41ede65172eb"
] | [
"MRPO/examples/plot_heatmaps.py"
] | [
"\"\"\"Plot heatmaps of evaluation results.\"\"\"\nimport argparse\nimport itertools\nimport json\nimport os\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy.interpolate import griddata\nimport scipy.spatial\n\nCELL_AGGREGATIONS = {\n \"mean\": np.mean,\n \"min\": np.min,\... | [
[
"numpy.max",
"numpy.asarray",
"numpy.median",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"numpy.min",
"numpy.mean",
"numpy.arange",
"numpy.issubdtype"
]
] |
Honno/coinflip | [
"15c1e0419e13c91c3f988558f3f050b516413c2b"
] | [
"src/coinflip/cli/parsing.py"
] | [
"from dataclasses import dataclass\n\nimport pandas as pd\n\nfrom coinflip._randtests.common.exceptions import NonBinarySequenceError\n\n__all__ = [\"DataParsingError\", \"parse_text\", \"parse_binary\"]\n\n\nclass DataParsingError(ValueError):\n \"\"\"Base class for parsing-related errors\"\"\"\n\n\n@dataclass\... | [
[
"pandas.read_csv",
"pandas.Series"
]
] |
poc11/resqpy | [
"5dfbfb924f8ee9b2712fb8e38bff96ee8ee9d8e2"
] | [
"resqpy/rq_import/_grid_from_cp.py"
] | [
"\"\"\"_grid_from_cp.py: Module to generate a RESQML grid object from an input corner point array.\"\"\"\n\nversion = '15th November 2021'\n\nimport logging\n\nlog = logging.getLogger(__name__)\n\nimport numpy as np\nimport numpy.ma as ma\n\nimport resqpy.crs as rqc\nimport resqpy.grid as grr\nimport resqpy.olio.ve... | [
[
"numpy.logical_not",
"numpy.max",
"numpy.array",
"numpy.logical_or",
"numpy.empty",
"numpy.isnan",
"numpy.zeros",
"numpy.count_nonzero",
"numpy.sum",
"numpy.ones",
"numpy.logical_and",
"numpy.ma.masked_array",
"numpy.where",
"numpy.any",
"numpy.arange",
... |
velatkilic/LISA | [
"ef2a3489bd194f7bf790c057edaf9c89b65c572b"
] | [
"python_old/atmos_models.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nLidar Scatterer Augmentation (LISA)\n - Given lidar point cloud and a rain rate generates corresponding noisy signal\n - Reflection data must be normalized to range [0 1] and\n range must be in units of meters\n\"\"\"\nimport numpy as np\nfrom sci... | [
[
"numpy.arccos",
"numpy.random.rand",
"scipy.special.gamma",
"scipy.integrate.trapz",
"numpy.tan",
"numpy.load",
"numpy.exp",
"numpy.where",
"numpy.cos",
"numpy.concatenate",
"numpy.random.normal",
"numpy.sin",
"numpy.divide",
"numpy.max",
"numpy.log",
... |
pgrv/CarND-Semantic-Segmentation | [
"42d0b8dcfd8d1b49dee8c1279758c1f33e8f428e"
] | [
"main.py"
] | [
"#!/usr/bin/env python3\nimport os.path\nimport tensorflow as tf\nimport helper\nimport warnings\nfrom distutils.version import LooseVersion\nimport project_tests as tests\n\n\n# Check TensorFlow Version\nassert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You a... | [
[
"tensorflow.test.gpu_device_name",
"tensorflow.train.AdamOptimizer",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.get_default_graph",
"tensorflow.Session",
"tensorflow.reshape",
"tensorflow.placeholder",
"tensorflow.saved_model.loader.load",
"tensorflow.add",
... |
aqlaboratory/openfold | [
"d6b36a80e3ee82eee8ac09215fce553d822f86a3"
] | [
"openfold/model/template.py"
] | [
"# Copyright 2021 AlQuraishi Laboratory\n# Copyright 2021 DeepMind Technologies Limited\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LIC... | [
[
"torch.cat",
"torch.nn.ModuleList",
"torch.unbind",
"torch.is_grad_enabled",
"torch.index_select",
"torch.sum"
]
] |
lillin-bug/Vehicle-Detection | [
"2b6eb60b900090034373d058646f2d4253a49b90"
] | [
"hyperlpr/e2e.py"
] | [
"#coding=utf-8\nfrom keras import backend as K\nfrom keras.models import load_model\nfrom keras.layers import *\nimport numpy as np\nimport random\nimport string\n\nimport cv2\nimport e2emodel as model\nchars = [u\"京\", u\"沪\", u\"津\", u\"渝\", u\"冀\", u\"晋\", u\"蒙\", u\"辽\", u\"吉\", u\"黑\", u\"苏\", u\"浙\", u\"皖\", ... | [
[
"numpy.array"
]
] |
anisehsani/composer | [
"42599682d50409b4a4eb7c91fad85d67418cee13"
] | [
"composer/algorithms/colout/colout.py"
] | [
"# Copyright 2021 MosaicML. All Rights Reserved.\n\n\"\"\"Core ColOut classes and functions.\"\"\"\n\nfrom __future__ import annotations\n\nimport logging\nimport textwrap\nimport weakref\nfrom typing import TypeVar\n\nimport torch\nfrom PIL.Image import Image as PillowImage\nfrom torchvision.datasets import Vision... | [
[
"torch.randperm"
]
] |
MickeyZeng/Data-Visualization | [
"c7005d1096545d7a5eb96dd0c9bc13e874d42fa4"
] | [
"heatmap/guided_backprop.py"
] | [
"\"\"\"\nCreated on Thu Oct 26 11:23:47 2017\n\n@author: Utku Ozbulak - github.com/utkuozbulak\n\"\"\"\nimport torch\nfrom torch.nn import ReLU\n\n\nclass GuidedBackprop():\n \"\"\"\n Produces gradients generated with guided back propagation from the given image\n \"\"\"\n\n def __init__(self, model)... | [
[
"torch.clamp"
]
] |
luobaozhu/featexp | [
"c371494e9cfd08dababdfa5226929b1b7f0c8f73"
] | [
"featexp/base.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\ndef get_grouped_data(input_data, feature, target_col, bins, cuts=0):\n \"\"\"\n Bins continuous features into equal sample size buckets and returns the target mean in each bucket. Separates out\n nulls into another bucket.\n ... | [
[
"pandas.isnull",
"numpy.isnan",
"pandas.cut",
"pandas.DataFrame",
"numpy.percentile",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout",
"pandas.concat",
"numpy.corrcoef",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xticks",
... |
fyviezhao/dressing-in-order | [
"63790663ad0420d9d2dabed22d5c56dd40422313"
] | [
"models/external_functions.py"
] | [
"\"\"\"\nFunctions are modified on top of GFLA.\nGFLA's license: https://github.com/RenYurui/Global-Flow-Local-Attention/blob/master/LICENSE.md\n\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torchvision.models as models\nimport torch.nn.functional as F\nimport os\nimport torchvision.transforms as transfor... | [
[
"numpy.dot",
"torch.stack",
"torch.bmm",
"torch.nn.BCEWithLogitsLoss",
"torch.exp",
"torch.sum",
"torch.nn.functional.avg_pool2d",
"numpy.arange",
"torch.tensor",
"torch.nn.functional.conv2d",
"torch.zeros",
"torch.max",
"torch.nn.Sequential",
"numpy.identit... |
VegaVK/AirSim | [
"c7c1f55a7d5dc97f1fdd98fb1df191db2576da12"
] | [
"PythonClient/car/lidar_occ_grid.py"
] | [
"#!/usr/bin/env python3 \nimport rospy\nimport setup_path \nimport airsim\nimport cv2\nimport numpy as np\nimport os\nimport sys\nimport math\nimport setup_path \nimport argparse\nimport pprint\nimport time\nfrom geometry_msgs.msg import Point\nfrom visualization_msgs.msg import Marker\n\n# Use below in settings.js... | [
[
"numpy.delete",
"numpy.isnan",
"numpy.dtype",
"numpy.floor"
]
] |
prabhudevguntur/voice_conversion | [
"0f6799870d8dbd2a61639bfb0530e8979cdd1ff7"
] | [
"src/train.py"
] | [
"import argparse\nimport os\nimport numpy as np\nimport itertools\nimport sys\nfrom tqdm import tqdm\n\nfrom torch.utils.data import DataLoader\nfrom torch.autograd import Variable\n\nfrom models import *\nfrom data_proc import DataProc\n\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch\n\nfrom... | [
[
"torch.nn.MSELoss",
"numpy.mean",
"torch.nn.L1Loss",
"torch.cuda.is_available",
"torch.load",
"torch.mean",
"torch.pow"
]
] |
TUW-GEO/web-validation-tool | [
"e73faeeda0a5abe4366f1dd39c77d2e63d8bae93"
] | [
"validation_tool/iout/ancillary_data.py"
] | [
"'''\nCreated on Jun 26, 2013\n\n@author: pydev\n'''\n\n\nimport scipy.io as sc_io\nimport numpy as np\n#import general.grid.dgg.warp_grid_constants as dgg_const\nimport psycopg2 as psql\n\n#ind_ld = dgg_const.ind_ld()\n\nporosity = sc_io.readsav('/media/sf_D/porosity_ind_ld.sav')['porosity']\n\nporosity_top=porosi... | [
[
"scipy.io.readsav"
]
] |
Lo1s/superresolution | [
"18052465694bfc2543b9af71d8012d854a516d1a"
] | [
"base/base_trainer.py"
] | [
"import os\nimport torch\nimport torchvision.transforms as transforms\nimport torchvision.utils as vutils\nfrom PIL import Image\nfrom abc import abstractmethod\nfrom numpy import inf\nfrom logger import TensorboardWriter\nfrom model.esrgan.utils.utils import MODEL_KEY, GENERATOR_KEY, DISCRIMINATOR_KEY\nfrom test i... | [
[
"torch.save",
"torch.no_grad",
"torch.load"
]
] |
Marxvim/Robinhood-1 | [
"c3c83391dcb3eb1b1584bf83a0d965d82c4679ed"
] | [
"robinhood/quote.py"
] | [
"from .detail.const_dict import ConstDict\nfrom .detail.common import timestamp_now, _to_float\nfrom datetime import datetime\nimport pandas as pd\n\n\nclass QuoteBase(ConstDict):\n\n\tdef __init__(self, quote, time=None):\n\t\tquote['time'] = time if time else timestamp_now()\n\t\tConstDict.__init__(self, quote)\n... | [
[
"pandas.Timestamp"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.