repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
subhashsuman01/fury | [
"13809a10cb4a6753f166ef547ac6a087357189ad"
] | [
"fury/ui.py"
] | [
"from _warnings import warn\n\nimport numpy as np\nimport vtk\nimport os\nimport abc\n\nfrom fury.data import read_viz_icons\nfrom fury.interactor import CustomInteractorStyle\nfrom fury.io import load_image\nfrom fury.utils import set_input, rotate\nfrom fury.actor import grid\n\n\nTWO_PI = 2 * np.pi\n\n\nclass UI... | [
[
"numpy.array",
"numpy.sin",
"numpy.asarray",
"numpy.rad2deg",
"numpy.any",
"numpy.arctan2",
"numpy.cos",
"numpy.issubdtype"
]
] |
Romero027/OmniNet | [
"c1cda1738c80925e5468b3ffc7aae2153bcd9e62"
] | [
"libs/omninet/omninet.py"
] | [
"#\n# Copyright 2019 Subhojeet Pramanik, Aman Husain, Priyanka Agrawal\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... | [
[
"torch.load"
]
] |
joannetruong/habitat-lab | [
"33654923dc733f5fcea23aea6391034c3f694a67"
] | [
"habitat_baselines/rl/ppo/ppo.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom typing import Optional, Tuple\n\nimport torch\nfrom torch import Tensor\nfrom torch import nn as nn\nfro... | [
[
"torch.exp",
"torch.min",
"torch.clamp",
"torch.max"
]
] |
slayoo/pyodesys | [
"8e1afb195dadf6c6f8e765873bc9dd0fae067c39"
] | [
"pyodesys/integrators.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nThis module is for demonstration purposes only and the integrators here\nare not meant for production use. Consider them provisional, i.e., API here\nmay break without prior deprecation.\n\"\"\"\n\nimport math\nimport warnings\n\nimport numpy as np\nfrom .util import import_\n\nlu_... | [
[
"numpy.square",
"numpy.array"
]
] |
pgmadonia/codeastro_project | [
"4d1d15a2d1eef67b07a8c5ab4f81e5aa1efb601c"
] | [
"build/lib/edgedec/picture.py"
] | [
"\"\"\"\nThis module recognizes shapes in pictures\n\"\"\"\nimport numpy as np\nimport sys\nnp.set_printoptions(threshold=sys.maxsize)\nimport matplotlib.image as img\nimport matplotlib.pyplot as plt\n\n# sample user interaction idea\n# img = library.image('pic1.png')\n# img_contour = img.draw_contours()\n\nclass P... | [
[
"numpy.array_equal",
"numpy.zeros",
"numpy.set_printoptions",
"matplotlib.image.imread",
"numpy.abs",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow"
]
] |
viethuong12/NLP | [
"c3d1f1cc8b1eb2c64302a88cfd2223c1b9823a45"
] | [
"classifier/prepare_data.py"
] | [
"from sklearn.model_selection import train_test_split\nimport os\n\n\ndef save_fasttext_format(X_data, y_data, output_file, prefix='__lb__'):\n with open(output_file, 'w', encoding='utf8') as fp:\n for x, y in zip(X_data, y_data):\n fp.write(prefix + y + ' ' + x + '\\n')\n\n\nXs = []\nys = []\n... | [
[
"sklearn.model_selection.train_test_split"
]
] |
jieralice13/forte | [
"4b5bb810c3cdd99de2fa3096e327e50caff68d7f"
] | [
"forte/processors/srl_predictor.py"
] | [
"# Copyright 2019 The Forte 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... | [
[
"torch.cuda.is_available",
"torch.tensor",
"torch.from_numpy",
"torch.cuda.current_device"
]
] |
Marco-Sulla/PyTables | [
"c06642ed12b1c99df76feb11f08a37b3e479ffbc"
] | [
"tables/tests/test_numpy.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport os\nimport sys\nimport tempfile\n\nimport numpy as np\n\nimport tables\nfrom tables import (\n StringCol, BoolCol, FloatCol, ComplexCol, EnumCol,\n Int8Col, UInt8Col, Int16Col, UInt16Col, Int32Col, UInt32Col,\n Int64Col, Float32Col, Float64Col, Time64Col\n)\nfrom tables.t... | [
[
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.np.array",
"numpy.arange",
"numpy.dtype"
]
] |
shiwj16/raa-drl | [
"0fc19546ac3186b2c60785a363a9f5d581ac08b9"
] | [
"RAA-DuelingDQN/src/anderson_alpha.py"
] | [
"# -*- coding: utf-8 -*-\r\n\r\nimport torch\r\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\r\n\r\n\r\nclass RAA(object):\r\n def __init__(self, num_critics, use_restart, reg=0.1):\r\n self.size = num_critics\r\n self.reg = reg # regularization\r\n ... | [
[
"torch.zeros",
"torch.min",
"torch.pow",
"torch.cuda.is_available",
"torch.tensor",
"torch.eye",
"torch.mean",
"torch.sum"
]
] |
mountain/numbers | [
"66ff00b57b197788113b51af97bf176451206c75"
] | [
"test/test_game.py"
] | [
"import unittest\n\nimport numpy as np\n\nfrom numx.serengeti import Serengeti\n\n\nclass TestGame(unittest.TestCase):\n\n def setUp(self):\n pass\n\n def tearDown(self):\n pass\n\n def test_probability(self):\n for alpha in np.linspace(0.2, 0.8, 16):\n print(alpha)\n\n ... | [
[
"numpy.linspace",
"numpy.mean",
"numpy.sqrt"
]
] |
etiennelndr/analyze_images | [
"edb0f31f9732b062a48fb298a5d8aadb2b0caa6a"
] | [
"src/nnmodels/animalsmodel.py"
] | [
"try:\n from .model import NNModel\n\n from keras.layers import Conv2D, Dropout, MaxPooling2D, Flatten, Dense\n from keras.preprocessing.image import ImageDataGenerator, load_img, img_to_array, array_to_img\n from keras.optimizers import Adam\n from keras.losses import categorical_crossentropy\n f... | [
[
"numpy.array",
"numpy.copy"
]
] |
amirDahari1/super-res | [
"2a93a20d65c570a5398caef65957fb612c3581c8"
] | [
"code/Evaluation.py"
] | [
"import BatchMaker\nimport LearnTools\nimport Networks\nimport ImageTools\nimport argparse\nimport torch\nimport numpy as np\nfrom tifffile import imsave, imread\n\n# Parsing arguments:\nparser = argparse.ArgumentParser()\n\nargs = LearnTools.return_args(parser)\n\nprogress_dir, wd, wg = args.directory, args.widthD... | [
[
"numpy.concatenate",
"torch.device",
"numpy.array",
"torch.cat",
"numpy.ceil",
"numpy.int8",
"numpy.round",
"torch.no_grad",
"torch.cuda.is_available",
"torch.LongTensor",
"numpy.random.randint",
"torch.randn"
]
] |
ppppps/SNN_Calibration | [
"1aca56daa5759a28bed6ed31b207c766d745dd51"
] | [
"CIFAR/models/utils.py"
] | [
"import numpy as np\nimport torch.nn as nn\n\n\nclass StraightThrough(nn.Module):\n \"\"\"\n\n \"\"\"\n def __init__(self, channel_num: int = 1):\n super().__init__()\n\n def forward(self, input):\n return input\n\n\nclass AvgPoolConv(nn.Conv2d):\n \"\"\"\n Converting the AvgPool lay... | [
[
"torch.nn.ReLU",
"numpy.mean"
]
] |
kaljuvee/openaltdata | [
"9c5d140b56cfd5260fe3cf52b24bb7d467e87cf1"
] | [
"data_collection/altdata_service/news/util/news_util.py"
] | [
"import os.path\r\nimport yaml\r\nimport logging\r\nfrom bs4 import BeautifulSoup\r\nimport data_collection.altdata_service.news.config.sqlalchemy_connector as dbconn\r\nfrom dateutil.parser import parse\r\nimport pandas as pd\r\n\r\nABS_PATH = os.path.dirname(os.path.abspath(__file__))\r\n# CONFIG_PATH = os.path.j... | [
[
"pandas.DataFrame"
]
] |
mcd4874/NeurIPS_competition | [
"4df1f222929e9824a55c9c4ae6634743391b0fe9"
] | [
"EEG_Lightning/dassl/engine/dg/MLDG_tmp_V1.py"
] | [
"import torch\nfrom torch.nn import functional as F\nimport torch.nn as nn\nfrom dassl.data import DataManager\nfrom dassl.optim import build_optimizer, build_lr_scheduler\nfrom dassl.utils import count_num_param\nfrom dassl.engine import TRAINER_REGISTRY, TrainerX\nfrom dassl.modeling.ops import ReverseGrad\nfrom ... | [
[
"numpy.array",
"torch.no_grad",
"numpy.random.permutation",
"torch.split",
"numpy.arange",
"torch.nn.functional.softmax",
"torch.nn.CrossEntropyLoss"
]
] |
FloatTech/AI-Bot | [
"2bdbff2f98c7a2fe9e2c5a81545fd5133d0e1f64"
] | [
"TF2_GPT-2/bot.py"
] | [
"\nimport re\nimport time\nimport queue\nimport logging\nimport threading\nimport collections\nimport json as json_\nimport os\nimport psutil\nimport websocket\n\nimport numpy as np \nimport Api as GPT\n\n\n\n\n\n\nWS_URL = \"ws://127.0.0.1:6700/ws\" # WebSocket 地址\nNICKNAME = [\"BOT\", \"ROBOT\"] # 机器人昵称... | [
[
"numpy.random.random"
]
] |
gaoxinge/taichi | [
"86d403f071b8505858763d4712b37cd71b89db91"
] | [
"python/taichi/examples/simulation/stable_fluid.py"
] | [
"# References:\n# http://developer.download.nvidia.com/books/HTML/gpugems/gpugems_ch38.html\n# https://github.com/PavelDoGreat/WebGL-Fluid-Simulation\n# https://www.bilibili.com/video/BV1ZK411H7Hc?p=4\n# https://github.com/ShaneFX/GAMES201/tree/master/HW01\n\nimport argparse\n\nimport numpy as np\n\nimport taichi a... | [
[
"numpy.linalg.norm",
"numpy.random.rand",
"numpy.zeros"
]
] |
fanyang587/NestedNet | [
"8479ff62d26f5d110277185397ca29bb536cde56"
] | [
"datasets/S3DIS2.py"
] | [
"#\n#\n# 0=========================0\n# | Kernel Point CNN |\n# 0=========================0\n#\n#\n# ----------------------------------------------------------------------------------------------------------------------\n#\n# Handle S3DIS dataset in a class\n#\n# -------------------------... | [
[
"numpy.random.rand",
"numpy.random.choice",
"numpy.argmin",
"numpy.min",
"tensorflow.global_variables_initializer",
"numpy.max",
"numpy.random.normal",
"numpy.bincount",
"numpy.full",
"numpy.empty",
"tensorflow.concat",
"numpy.concatenate",
"tensorflow.shape",
... |
ZGainsforth/thermopy3 | [
"b3a1ddcc92d17ff297a22d97daa645748abfeba2"
] | [
"thermopy/iapws.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom .units import Pressure, Temperature, Enthalpy\nfrom numpy import array, sum, sqrt\n\n\nclass Water(object):\n\n \"\"\"Taken from\n\n The International Association for the Properties of Water and\n Steam.... | [
[
"numpy.sum",
"numpy.array",
"numpy.sqrt"
]
] |
sekisetsu-method/star-eyes | [
"dc8e7ea17e1f124f0f42550504f032dd3c735591"
] | [
"core/cvt_00014.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf8 -*-\nprint(unicode(\"積雪メソッド\",\"UTF-8\"))\n\n__author__ = \"Arlo Emerson <arlo.emerson@sekisetsumethod.com>\"\n__status__ = \"production\"\n__version__ = \"14.0\"\n__date__ = \"17 August 2018\"\n\n#--- LICENSE -----------------------------------------------------------... | [
[
"numpy.interp"
]
] |
vishalbelsare/bbopt | [
"408e210e57b7a2aaf3cfd3a3c225fc2af6b3c56d"
] | [
"bbopt/optimizer.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# __coconut_hash__ = 0x3af381c\n\n# Compiled with Coconut version 2.0.0-a_dev9 [How Not to Be Seen]\n\n\"\"\"\nThe main BBopt interface.\n\"\"\"\n\n# Coconut Header: -------------------------------------------------------------\n\nfrom __future__ import print_functio... | [
[
"numpy.zeros"
]
] |
shlomihod/smartnoise-sdk-synth | [
"cc143390d96f3dd8b3af365094f969dfea0d4f0b"
] | [
"snsynth/pytorch/nn/patectgan.py"
] | [
"import math\nimport numpy as np\nimport torch\nfrom torch import optim\nfrom torch import nn\nimport torch.utils.data\nfrom torch.nn import BatchNorm1d, Dropout, LeakyReLU, Linear, Module, ReLU, Sequential, Sigmoid\nfrom torch.autograd import Variable\nimport warnings\n\nfrom .data_sampler import DataSampler\nfrom... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.cuda.manual_seed",
"numpy.isclose",
"torch.nn.LeakyReLU",
"torch.cuda.is_available",
"numpy.concatenate",
"torch.autograd.Variable",
"torch.normal",
"torch.manual_seed",
"numpy.arange",
"torch.nn.BCELoss",
"numpy.sqrt",
... |
shhong/nrn | [
"0d64e94330c6072529e31033d579b270f742454e"
] | [
"test/pynrn/test_vector_api.py"
] | [
"import sys\nimport numpy as np\nfrom neuron import h, hoc, numpy_element_ref as npyref\n\n\ndef copy(src, result, *args, dest=None):\n if dest is None:\n dest = h.Vector()\n dest.copy(src, *args)\n assert dest.to_python() == result\n\ndef vwrite_type(src, vtype):\n f = h.File()\n fname = \"vw... | [
[
"numpy.allclose",
"numpy.array"
]
] |
sommoMicc/FairMOT | [
"fb6ef23008a903c77502d25deb7fc63adae95f82"
] | [
"src/track.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport _init_paths\nimport os\nimport os.path as osp\nimport cv2\nimport logging\nimport argparse\nimport motmetrics as mm\nimport numpy as np\nimport torch\n\nfrom tracker.multitracker import JDETrack... | [
[
"numpy.sum",
"numpy.dot",
"numpy.asarray",
"torch.from_numpy"
]
] |
liamirpy/Covid19-face-mask-detection-with-openCV-deep-learning-and-python | [
"62357eb13bee05fd600a87b0f30465f7b9f51773"
] | [
"model.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nnp.random.seed(1000)\nimport cv2\nimport os\nfrom PIL import Image\nimport keras\nos.environ['KERAS_BACKEND']='tensorflow'\nimage_directory='/content/drive/My Drive/Covid_19/'\nSIZE=256\ndataset=[]\nlabel=[]\nn=0\no=0\n########READ DATA\nmask_images=os.listdir(i... | [
[
"numpy.random.seed",
"numpy.array"
]
] |
SamuelMarks/model-remediation | [
"8ab480785ee1446d8d67ea62f788b7feac610aec"
] | [
"tools/tutorials_utils/min_diff_keras_utils_test.py"
] | [
"# coding=utf-8\n# 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl... | [
[
"tensorflow.keras.losses.BinaryCrossentropy",
"tensorflow.keras.optimizers.Adam",
"tensorflow.test.main",
"tensorflow.keras.layers.Dense"
]
] |
mbtaPredict/Main | [
"e1c3320ff08b61355ac96f51be9e20c57372f13b"
] | [
"Graph_Code/hubway2011_graph.py"
] | [
"\"\"\"Part of Hubway Prediction project by Shane Kelly, William Lu, and\nKevin Crispie, Olin College of Engineering\n\"\"\"\n\nimport csv\nimport matplotlib.pyplot as plt\nimport matplotlib\nfrom pylab import *\nimport numpy as np\nfrom numpy import fft\n\n\ndef get_file(file_path):\n\t\"\"\" reads a csv file and ... | [
[
"numpy.angle",
"numpy.zeros",
"numpy.mean",
"matplotlib.pyplot.figure",
"numpy.fft.fft",
"numpy.arange",
"numpy.polyfit",
"numpy.cos",
"numpy.absolute",
"numpy.fft.fftfreq"
]
] |
IgorSechko/pytorch-retinanet | [
"76c080a91eb3f286ca59af7cbfa4889a7f0c0de0"
] | [
"retinanet/dataloader.py"
] | [
"from __future__ import print_function, division\nimport sys\nimport os\nimport torch\nimport numpy as np\nimport random\nimport csv\n\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms, utils\nfrom torch.utils.data.sampler import Sampler\n\nfrom pycocotools.coco import COCO\n\nim... | [
[
"torch.zeros",
"numpy.array",
"numpy.random.rand",
"numpy.zeros",
"torch.from_numpy",
"numpy.append"
]
] |
haohongxiang/PaddleNLP | [
"c862e9c3a4d49caf00f4de81bdfae36aba9b636e"
] | [
"paddlenlp/ops/faster_transformer/transformer/faster_transformer.py"
] | [
"# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.array",
"numpy.float16",
"numpy.transpose",
"numpy.zeros"
]
] |
westpark/piwars-2018 | [
"a2e1cb67e5fcc8f65ed17975d076088a9f92da2a"
] | [
"scratch/process.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n# Load library functions we want\nimport time\nimport os\nimport sys\n# import ThunderBorg\nimport io\nimport threading\nimport picamera\nimport picamera.array\nimport cv2\nimport numpy\n\n# Camera settings\nimageWidth = 320 # Camera image width\nimageHeight = 240 # Camera... | [
[
"numpy.array"
]
] |
FengJunJian/simple-faster-rcnn-pytorch | [
"ed849d60c16b7fad920491284b18165a32448d2c"
] | [
"data/dataset.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nimport torch as t\nfrom data.voc_dataset import VOCBboxDataset\nfrom skimage import transform as sktsf\nfrom torchvision import transforms as tvtsf\nfrom data import util\nimport numpy as np\nfrom utils.config import cfg#opt\n\n\ndef invers... | [
[
"numpy.array",
"torch.from_numpy"
]
] |
yoyoberenguer/IndexMapping | [
"42a43f418a272e0ca84a0cfa1f08d9140d1b151b"
] | [
"test/test_split.py"
] | [
"\"\"\"\r\nMIT License\r\n\r\nCopyright (c) 2019 Yoann Berenguer\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nt... | [
[
"numpy.frombuffer"
]
] |
SkrighYZ/scene_graph_benchmark | [
"b17e831a031e11c7b56d12dd092e8f476e48e3d4",
"b17e831a031e11c7b56d12dd092e8f476e48e3d4"
] | [
"maskrcnn_benchmark/modeling/balanced_positive_negative_sampler.py",
"maskrcnn_benchmark/layers/batch_norm.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\n\n\nclass BalancedPositiveNegativeSampler(object):\n \"\"\"\n This class samples batches, ensuring that they contain a fixed proportion of positives\n \"\"\"\n\n def __init__(self, batch_size_per_image, positive_frac... | [
[
"torch.zeros_like",
"torch.nonzero"
],
[
"torch.zeros",
"torch.rsqrt",
"torch.cat",
"torch.distributed.get_world_size",
"torch.stack",
"torch.split",
"torch.distributed.all_gather",
"torch.ones",
"torch.distributed.all_reduce",
"torch.ones_like",
"torch.zero... |
abitrolly/numba-benchmark | [
"4bea9c23276fd0399df26452d19f13810a6496c7"
] | [
"benchmarks/bench_ising.py"
] | [
"\"\"\"\nIsing model benchmark, adapted from\nhttp://matthewrocklin.com/blog/work/2015/02/28/Ising/\n\"\"\"\n\nfrom math import exp, log, e, sqrt\n\nimport numpy as np\n\n\nkT = 2 / log(1 + sqrt(2), e)\n\nN = 200\n\nrandom = np.random.RandomState(0)\n\nx_start = random.randint(2, size=(N, N)).astype('i8')\nx_start[... | [
[
"numpy.random.random",
"numpy.random.RandomState"
]
] |
mhw32/temperature-as-uncertainty-public | [
"d6c6f05dc217b6169f31ba25385cb4bcdd28ab6a"
] | [
"src/systems/hib.py"
] | [
"import torch\nimport math\nimport numpy as np\nimport torch.optim as optim\nimport torch.autograd as autograd\nimport torchvision\nfrom torchvision.utils import save_image\nfrom typing import Callable, Optional\nfrom pytorch_lightning.core.optimizer import LightningOptimizer\n\nfrom src.objectives.hib import HIB\n... | [
[
"numpy.concatenate",
"torch.optim.SGD",
"torch.optim.Adam",
"numpy.mean",
"torch.tensor",
"numpy.arange",
"numpy.linspace"
]
] |
SijinXiang/e3d | [
"1f3e555523e503b405f7d7195cee5ca551f74ef8"
] | [
"run.py"
] | [
"# Many thanks to daya for modifying the code :)\n# ==============================================================================\n\n\"\"\"Main function to run the code.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport datetime\nimport ... | [
[
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"numpy.ones",
"tensorflow.gfile.Exists",
"numpy.random.random_sample",
"tensorflow.gfile.MakeDirs",
"tensorflow.gfile.DeleteRecursively",
"tensorflow.app.run"
]
] |
systemshift/hivemind | [
"fdf92e5dc484e2ab4a639f0e2c788d3d061a3f1f"
] | [
"hivemind/client/averaging/__init__.py"
] | [
"\"\"\" A background process that averages your tensors with peers \"\"\"\n\nfrom __future__ import annotations\n\nimport asyncio\nimport contextlib\nimport ctypes\nimport multiprocessing as mp\nimport os\nimport threading\nimport uuid\nimport weakref\nfrom concurrent.futures.thread import ThreadPoolExecutor\nfrom ... | [
[
"torch.no_grad",
"numpy.float32"
]
] |
kainoj/pytorch-lightning | [
"4610fddb19d502e534b5c5d77c3dfd6f2e5359a5"
] | [
"tests/plugins/test_ddp_plugin.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"torch.device",
"torch.cuda.memory_allocated"
]
] |
MarkusPrim/flavio | [
"0d277f637c4e2eb8cd1849c88d9844200ddfbc4f"
] | [
"flavio/test_classes.py"
] | [
"import unittest\nimport numpy as np\nimport flavio\nfrom flavio.classes import *\nfrom flavio.statistics.probability import *\nfrom flavio.config import config\nimport scipy.integrate\nimport math\n\nclass TestClasses(unittest.TestCase):\n def test_parameter_class(self):\n p = Parameter( 'test_mb' )\n ... | [
[
"numpy.array"
]
] |
arsimone/flightmare | [
"c546d9d54970c7ad803f3ada4c2ea64c51ab7287"
] | [
"flightrl/stable-baselines3/stable_baselines3/ppo/ppo.py"
] | [
"from typing import Any, Dict, Optional, Type, Union\n\nimport numpy as np\nimport torch as th\nfrom gym import spaces\nfrom torch.nn import functional as F\n\nfrom stable_baselines3.common import logger\nfrom stable_baselines3.common.on_policy_algorithm import OnPolicyAlgorithm\nfrom stable_baselines3.common.polic... | [
[
"torch.min",
"torch.clamp",
"numpy.mean",
"torch.nn.functional.mse_loss",
"torch.abs",
"torch.exp",
"torch.mean"
]
] |
CommerciumBlockchain/electrum | [
"1c27908d537ff822220ab4fa96c3f2dbd29a59f6"
] | [
"lib/plot.py"
] | [
"import datetime\nfrom collections import defaultdict\n\nimport matplotlib\nmatplotlib.use('Qt5Agg')\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as md\n\nfrom .i18n import _\nfrom .bitcoin import COIN\n\n\nclass NothingToPlotException(Exception):\n def __str__(self):\n return _(\"Nothing to ... | [
[
"matplotlib.use",
"matplotlib.pyplot.xlabel",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.xticks"
]
] |
akira-l/online_mmdetection | [
"10c60467a57a605b783486b7fbc508776394ea79"
] | [
"mmdet/models/detectors/two_stage.py"
] | [
"import torch\nimport torch.nn as nn\n\n# from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler\nfrom ..builder import DETECTORS, build_backbone, build_head, build_neck\nfrom .base import BaseDetector\n\nimport pdb\n\n@DETECTORS.register_module()\nclass TwoStageDetector(BaseDetector):\n \"\... | [
[
"torch.randn"
]
] |
stepan-anokhin/VideoDeduplication | [
"27d7726601ded654ac3710952baf989674aecf7e"
] | [
"extract_features.py"
] | [
"import numpy as np\nimport os\n\nos.environ['WINNOW_CONFIG'] = os.path.abspath('config.yaml')\n\nfrom glob import glob\nfrom winnow.feature_extraction import IntermediateCnnExtractor,frameToVideoRepresentation,SimilarityModel\nfrom winnow.utils import create_directory,scan_videos,create_video_list,get_original_fn_... | [
[
"numpy.array",
"numpy.nan_to_num"
]
] |
iambaim/pyEcholab | [
"6e165ad1a947e62fc233467631c445fe9ebcdad2"
] | [
"examples/simple_ek60_test.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"A simple ek60 reader test.\n\nThis script demonstrates simple file reading and plotting of ek60 data. In\ngeneral, the script reads files passed to it, stores data in a data object,\nparses information from the data, and generates plots. Specifically,\nthis script demonstrates proc... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.figure"
]
] |
frcmi/opensight | [
"3b0c0c63a877f739a1ee8261a9befbb44a3b7796"
] | [
"opsi/util/cv/shape.py"
] | [
"from math import atan2, cos, sin, sqrt\nfrom typing import NamedTuple\n\nimport cv2\nimport numpy as np\nfrom numpy.core._multiarray_umath import ndarray\n\nfrom opsi.util.cache import cached_property\n\n\n# Also represents dimensions\nclass Point(NamedTuple):\n def nt_serialize(self):\n return {\"x\": s... | [
[
"numpy.array",
"numpy.matmul"
]
] |
zhua1/pythonActivities | [
"d4bebd9a43d658f4802b998f6963c9c87a94b7d0"
] | [
"activity1.py"
] | [
"# -*- coding: utf-8 -*-\nimport pandas as pd\n\nfile = pd.read_csv('C:\\\\Users\\\\meifl\\\\Desktop\\\\UCIRV201804DATA3-Class-Repository-DATA\\\\01-LessonPlan\\\\03-Python\\\\3\\\\Activities\\\\Unsolved\\\\01-Stu_CerealCleaner\\\\Resources\\\\cereal.csv', header = None)\n\nprint(file[0][file[7] >= 5])\n\n\n#------... | [
[
"pandas.read_csv"
]
] |
ttglennhall/simple_dev_python | [
"68c199255beba0053c7c9b905dca7ea5ec919c66"
] | [
"database.py"
] | [
"import sqlite3 as lite\nimport pandas as pd\n\ncon = lite.connect('challenge_database.db')\n\ncities = (('Las Vegas', 'NV'), ('Atlanta', 'GA'), ('New York City', 'NY'),\n ('Boston', 'MA'), ('Chicago', 'IL'), ('Miami', 'FL'), ('Dallas', 'TX'),\n ('Seattle', 'WA'), ('Portland', 'OR'), ('San Francisco', 'CA'),\... | [
[
"pandas.DataFrame"
]
] |
swfarnsworth/tmnt | [
"a53c8d62d0ddc6be5fc62013e6801019c345a6f4"
] | [
"tmnt/estimator.py"
] | [
"# coding: utf-8\n# Copyright (c) 2020 The MITRE Corporation.\n\"\"\"\nEstimator module to train/fit/estimate individual models with fixed hyperparameters.\nEstimators are used by trainers to manage training with specific datasets; in addition,\nthe estimator API supports inference/encoding with fitted models.\n\"\... | [
[
"numpy.array",
"numpy.isnan",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"numpy.mean",
"sklearn.metrics.precision_recall_fscore_support",
"numpy.where",
"sklearn.metrics.top_k_accuracy_score",
"sklearn.metrics.ndcg_score",
"sklearn.metrics.av... |
chari8/MathematicalBiology_Murray | [
"c787636b389b3eb8280571d931ed1d59117909fd"
] | [
"sec3/bc.py"
] | [
"import os, sys\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns #not used\n\ndef main(step_number, lamb, a, m, T, g, init):\n print(\"step_number:%d, lamb:%f, a:%d, m:%d, T:%d, g:%d\\n\" % (step_number, lamb, a, m, T, g))\n c = np.zeros(step_number + 10) \n\n for i in range(T):\... | [
[
"numpy.random.rand",
"numpy.array_equal",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"numpy.sqrt",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot"
... |
zhy0/sig-tsc | [
"a9d01760233f0fbb25d53a73225e9ee7bf53e1b3"
] | [
"model.py"
] | [
"#!/usr/bin/env python3\n\nimport numpy as np\nfrom iisignature import sig, logsig, prepare\nfrom sklearn import preprocessing\n\n\nclass SigModel:\n \"\"\"\n Signature classification/regression model.\n\n Params:\n model: (class) sklearn classification/regression model to use\n level: (int) ... | [
[
"sklearn.preprocessing.scale",
"numpy.transpose",
"numpy.shape"
]
] |
feedbackward/mml | [
"d257e0508d75c86c63f01dd6cfe6b48b79e0d4d4"
] | [
"mml/data/protein/protein.py"
] | [
"'''H5 data prep'''\n\n## External modules.\nimport csv\nimport numpy as np\nimport os\nimport tables\n\n## Internal modules.\nfrom mml.config import dir_data_toread\nfrom mml.config import dir_data_towrite\nfrom mml.utils import makedir_safe\n\n\n####################################################################... | [
[
"numpy.array",
"numpy.zeros"
]
] |
BillyBai/Tensorflow_CNN_Models | [
"03ca57b1adcdb12d02c5ef128c47dd4fd8ba1251"
] | [
"test.py"
] | [
"import tensorflow as tf\r\nimport config\r\nimport numpy as np\r\nimport json\r\nimport time\r\nfrom models.model_factory import get_models\r\nfrom utils.data_utils import load_image, test_10_crop_iterator\r\nfrom utils.train_utils import cross_entropy_batch, l2_loss\r\nfrom utils.augment_utils import test_10_crop... | [
[
"numpy.array",
"tensorflow.constant",
"numpy.argmax",
"tensorflow.reduce_mean",
"numpy.squeeze"
]
] |
openclimatedata/pymagicc | [
"b6e9c1a34b85ff45b92be8fd03e43d601eaba06e"
] | [
"pymagicc/io/scen.py"
] | [
"import warnings\n\nimport pandas as pd\nfrom six import StringIO\n\nfrom pymagicc.definitions import (\n PART_OF_SCENFILE_WITH_EMISSIONS_CODE_0,\n PART_OF_SCENFILE_WITH_EMISSIONS_CODE_1,\n convert_magicc6_to_magicc7_variables,\n convert_magicc7_to_openscm_variables,\n convert_magicc_to_openscm_regio... | [
[
"pandas.concat"
]
] |
noe/sparsely_factored_nmt | [
"b4cf93f80a15f22d7bc45830120e6aba8d5b2459"
] | [
"src/morphodropout/dataset.py"
] | [
"import torch\nfrom itertools import accumulate\nfrom fairseq.data import (\n data_utils,\n FairseqDataset,\n Dictionary,\n IdDataset,\n NestedDictionaryDataset,\n NumelDataset,\n NumSamplesDataset,\n)\nfrom functools import lru_cache\nimport numpy as np\nfrom seqp.hdf5 import Hdf5RecordReader\... | [
[
"numpy.array",
"torch.stack"
]
] |
Dapid/contact-vis | [
"60ad8afc739aba8abe8f7857c932b1902645d97f"
] | [
"contactvis/parsing/parse_pdb.py"
] | [
"import sys\nimport operator\nimport numpy as np\nfrom collections import defaultdict\n\n\ndef parse_atm_record(line):\n\n record = defaultdict()\n record['name'] = line[0:6].strip()\n record['atm_no'] = int(line[6:11])\n record['atm_name'] = line[12:16].strip()\n record['res_name'] = line[17:20].str... | [
[
"numpy.array"
]
] |
crisostomi/augmented-graphs-evaluator | [
"2ed3d9c0fcb7d30d6f45c048df21aee965a1fa73"
] | [
"src/age/modules/baseline.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\nfrom torch_geometric.data import Batch\nfrom torch_geometric.nn import global_mean_pool\nfrom torch_geometric.nn.conv.gat_conv import GATConv\n\nfrom age.modules.mlp import MLP\n\n\nclass GraphClassifier(nn.Module):\n def __init__(\n self,\n ... | [
[
"torch.nn.functional.relu"
]
] |
amirbiran/openrec | [
"69a1c57a7a1eec49720b776279b9120b80630ba2"
] | [
"openrec/legacy/utils/evaluators/auc.py"
] | [
"import numpy as np\nfrom openrec.legacy.utils.evaluators import Evaluator\n\nclass AUC(Evaluator):\n\n def __init__(self, name='AUC'):\n \n super(AUC, self).__init__(etype='rank', name=name)\n\n def compute(self, rank_above, negative_num):\n\n return np.mean((negative_num - rank_above) /... | [
[
"numpy.mean"
]
] |
Genpeng/order-sales-forecast | [
"c89269817a0d936900e5deb9bcc2f9a0d885382d"
] | [
"util/pandas_util.py"
] | [
"# _*_ coding: utf-8 _*_\n\n\"\"\"\nSome useful utility functions about pandas.\n\nAuthor: Genpeng Xu\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.preprocessing import MinMaxScaler\n\n\ndef row_normalization(df):\n \"\"\"Normalize each row of data.\"\"\"\n df_bak = df.copy()\n rnames = ... | [
[
"sklearn.preprocessing.MinMaxScaler"
]
] |
husencd/DriverPostureClassification | [
"91dbcffdea82527a26fbc840961970b4671a2a85"
] | [
"utils.py"
] | [
"import csv\nimport torch\n\n\nclass AverageMeter(object):\n \"\"\"Computes and stores the average and current value\"\"\"\n def __init__(self):\n self.reset()\n\n def reset(self):\n self.val = 0\n self.avg = 0\n self.sum = 0\n self.count = 0\n\n def update(self, val, ... | [
[
"torch.no_grad"
]
] |
daniagudelos/contact_tracing | [
"dd8e54b518393d87cc6aa7020c13ed11ea94c33b"
] | [
"optimizer/optimizer.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Mar 16 10:48:11 2021\n\n@author: saitel\n\"\"\"\nfrom parameters.parameters import TestParameters1\nfrom parameters.parameters import TestParameters2\nfrom periodic.reproduction_number_case1 import ReproductionNumberCalculator as rn_case1\nfro... | [
[
"numpy.array",
"scipy.optimize.minimize",
"scipy.optimize.Bounds",
"scipy.optimize.NonlinearConstraint"
]
] |
DanIulian/minigrid_rl | [
"d7b59fd1d1e62fc99d5134c89f59c6ad16246cfa",
"d7b59fd1d1e62fc99d5134c89f59c6ad16246cfa"
] | [
"torch_rl/torch_rl/algos/a2c.py",
"agents/ppo_icm.py"
] | [
"\"\"\"\n Copyright (c) https://github.com/lcswillems/torch-rl\n\"\"\"\n\nimport numpy\nimport torch\nimport torch.nn.functional as F\n\nfrom torch_rl.algos.base import BaseAlgo\n\nclass A2CAlgo(BaseAlgo):\n \"\"\"The class for the Advantage Actor-Critic algorithm.\"\"\"\n\n def __init__(self, envs, acmode... | [
[
"numpy.arange"
],
[
"torch.Size",
"torch.zeros",
"numpy.array",
"torch.sqrt",
"torch.nn.MSELoss",
"torch.min",
"torch.max",
"numpy.random.permutation",
"torch.no_grad",
"numpy.mean",
"numpy.save",
"torch.clamp",
"torch.randint",
"torch.tensor",
"... |
BruceW91/cogdl | [
"1ad524375f5ba062103698a0432fc857572a6933"
] | [
"tests/tasks/test_graph_classification.py"
] | [
"import torch\nfrom cogdl import options\nfrom cogdl.tasks import build_task\nfrom cogdl.datasets import build_dataset\nfrom cogdl.models import build_model\nfrom cogdl.utils import build_args_from_dict\n\n\ndef get_default_args():\n cuda_available = torch.cuda.is_available()\n default_dict = {\n ... | [
[
"torch.cuda.is_available"
]
] |
deitrr/vplanet | [
"7e1276cb5f02610ae289c899472459e665695529"
] | [
"tests/StellarEvol/test_StellarEvol.py"
] | [
"from benchmark import Benchmark, benchmark\nimport astropy.units as u\nimport pytest\nimport numpy as np\n\n\n@benchmark(\n {\n \"log.final.a.Luminosity\": {\"value\": 0.002445, \"unit\": u.LSUN},\n \"log.final.a.Temperature\": {\"value\": 2992.330343, \"unit\": u.K},\n \"log.final.a.Radius... | [
[
"numpy.isclose"
]
] |
jhpark428/studio | [
"3bc547fdf85ae6be80c1b40916f9f5d31d2b3f75"
] | [
"function/python/brightics/function/io/read_excel.py"
] | [
"\"\"\"\n Copyright 2019 Samsung SDS\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicab... | [
[
"pandas.read_excel"
]
] |
Aakriti05/ORCA_Astar-warehouse-navigation | [
"8699b30c25cacf1a7be1f56dc34db90d5a757b36"
] | [
"layouts/count_1.py"
] | [
"import numpy as np\nimport random\nfrom numpy import savetxt\n\ndata = np.loadtxt('tight_2_64.cfg', skiprows=10)\nprint(data)\nprint(np.shape(data), type(data))\nprint(data[3][3], type(data[3][3]))\n\nl = np.shape(data)[0]\n#expanded_layout = np.zeros((2*l,2*l), dtype=int)\ncount = 0\ncount_zero = 0\nfor i in rang... | [
[
"numpy.loadtxt",
"numpy.shape"
]
] |
alexanu/trading-with-python | [
"e6d6f6daea3089aebcd0f48c2e69c8bfe23c332c"
] | [
"lib/csvDatabase.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nintraday data handlers in csv format.\n\n@author: jev\n\"\"\"\n\n\n\nimport pandas as pd\nimport datetime as dt\nimport os\nimport numpy as np\nfrom .extra import ProgressBar\n\ndateFormat = \"%Y%m%d\" # date format for converting filenames to dates\ndateTimeFormat = \"%Y%m%d%H%M%S... | [
[
"pandas.WidePanel",
"pandas.DataFrame.from_csv",
"numpy.argmin",
"numpy.argmax",
"pandas.concat",
"pandas.HDFStore"
]
] |
urinieto/meshuggarn | [
"51f115662ad863aa72c9feb86e9c6d15da52a6a6"
] | [
"src/generate.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nGenerates the audio file with the trained RNN\n\"\"\"\nimport time\nimport logging\nimport numpy as np\nimport librosa\nfrom tqdm import tqdm\nfrom scipy.spatial.distance import cdist\n\nfrom keras.models import model_from_json\n\n\nNORM_CQT_FRAMES = \"../data/norm_cqt_frames.npy\"\n... | [
[
"numpy.concatenate",
"numpy.asarray",
"numpy.hanning",
"numpy.load",
"numpy.argsort"
]
] |
cronin4392/trident | [
"1c1eb01bcde861496ce83e265ff071fc9bcb9db2"
] | [
"trident/layers/tensorflow_blocks.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport collections\nimport copy\nimport inspect\nimport itertools\nimport math\nfrom functools import reduce\nfrom functools import wraps\nfrom itertools import repeat\n\nimport numpy as np\nimport ten... | [
[
"tensorflow.concat",
"tensorflow.random.normal",
"tensorflow.keras.layers.GaussianNoise",
"tensorflow.python.ops.image_ops.resize_images_v2",
"tensorflow.nn.dropout"
]
] |
rohitmusti/SQuAD-Context-Merging | [
"d055a1565b87399b1d611385097495431f5e250a"
] | [
"exp-x/exp3_train.py"
] | [
"\"\"\"Train a model on SQuAD.\n\nAuthor:\n Rohit Musti (rmusti@redhat.com)\n Chris Chute (chute@stanford.edu)\n\"\"\"\n\nimport numpy as np\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as sched\nimport torch... | [
[
"torch.nn.functional.nll_loss",
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.no_grad",
"torch.enable_grad",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.optim.lr_scheduler.LambdaLR",
"torch.nn.DataParallel"
]
] |
shahrukh357/ga-learner-dsmp-repo | [
"84f479c5fbb111886a4e758c67fb9558c8cab374"
] | [
"-Melbourne---Housing-Again!/code.py"
] | [
"# --------------\nimport numpy as np\r\nimport pandas as pd\r\nfrom sklearn.model_selection import train_test_split\r\n\r\n# path- variable storing file path\r\n\r\n#Code starts here\r\ndf = pd.read_csv(path)\r\nprint(df.columns[0:5])\r\nX=df.drop(['Price'],1)\r\ny=df['Price']\r\n\r\nX_train,X_test,y_train,y_test ... | [
[
"sklearn.linear_model.Lasso",
"sklearn.linear_model.LinearRegression",
"sklearn.metrics.r2_score",
"sklearn.preprocessing.PolynomialFeatures",
"sklearn.linear_model.Ridge",
"numpy.mean",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"sklearn.model_selection.cro... |
philipperemy/tensorflow-cnn-time-series | [
"d975e822b824315dfc6fa11a5af0450e42c6b0bf"
] | [
"alexnet_data.py"
] | [
"import matplotlib\n\nmatplotlib.use('Agg')\n\nfrom random import shuffle\n\nimport errno\nimport os\nfrom glob import glob\nimport skimage.io\nimport skimage.transform\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nDATA_FOLDER = '/tmp/cnn-time-series/'\n\n\ndef load_image(path):\n try:\n img =... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"numpy.tile",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
]
] |
anshul3899/Structured-Graph-Learning | [
"fabefa3d160baf8faefbffd7961a455348d6f068"
] | [
"main.py"
] | [
"import os\nimport numpy as np\nimport networkx as nx\nimport matplotlib.pyplot as plt\nfrom sklearn.datasets import make_moons, make_blobs\nfrom sgl import LearnGraphTopolgy\n\nplots_dir = './plots'\nif not os.path.exists(plots_dir):\n os.makedirs(plots_dir)\n\n'''Visual results on two moon dataset \n\n'''\nnp.... | [
[
"numpy.dot",
"numpy.random.seed",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.scatter",
"sklearn.datasets.make_moons"
]
] |
marios-stam/crazyswarm | [
"24bda524bd5a6818d364e6be4617203a65a6f2d7"
] | [
"ros_ws/src/crazyswarm/scripts/pycrazyswarm/visualizer/visVispy.py"
] | [
"import os\nimport math\n\nimport ffmpeg\nimport numpy as np\nfrom vispy import scene, app, io, geometry\nfrom vispy.color import Color\nfrom vispy.visuals import transforms\nfrom vispy.scene.cameras import TurntableCamera\n\nfrom .. import util as util\n\n\nCF_MESH_PATH = os.path.join(os.path.dirname(__file__), \"... | [
[
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.ones",
"numpy.eye"
]
] |
agnithamohan/CV_project | [
"0abe59233b83611d1e05492ef2a0cd3ea0b23372"
] | [
"probabilistic_unet.py"
] | [
"#This code is based on: https://github.com/SimonKohl/probabilistic_unet\n\nfrom unet_blocks import *\nfrom unet import Unet\nfrom utils import init_weights,init_weights_orthogonal_normal, l2_regularisation\nimport torch.nn.functional as F\nfrom torch.distributions import Normal, Independent, kl\nimport numpy as np... | [
[
"torch.distributions.kl.kl_divergence",
"torch.distributions.Normal",
"numpy.arange"
]
] |
neildhir/DCBO | [
"dc8a1df096cc83b37f45f9e546ed7f59ad693f33"
] | [
"src/utils/utilities.py"
] | [
"from copy import deepcopy\nfrom itertools import chain, combinations\nfrom typing import Tuple\nfrom networkx.classes.multidigraph import MultiDiGraph\nimport numpy as np\nfrom emukit.core import ContinuousParameter, ParameterSpace\nfrom numpy.core import hstack, vstack\nfrom .sequential_sampling import sequential... | [
[
"numpy.core.hstack",
"numpy.zeros_like",
"numpy.array",
"numpy.zeros",
"numpy.random.seed",
"numpy.random.permutation",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"numpy.core.vstack",
"numpy.transpose",
"numpy.hstack",
"numpy.random.get_state",
"n... |
Lornatang/zero2SGD | [
"546ca660e6b7843fa77086b2f7a6a575c271be02"
] | [
"activation.py"
] | [
"\"\"\"Implement some basic operations of Activation function.\n\"\"\"\n\n####################################################\n# Author: <Changyu Liu>shiyipaisizuo@gmail.com\n# License: MIT\n####################################################\n\nimport numpy as np\n\n\ndef linear(x, w, b):\n \"\"\" linear activ... | [
[
"numpy.dot",
"numpy.sum",
"numpy.exp",
"numpy.mean",
"numpy.multiply",
"numpy.sqrt",
"numpy.int64",
"numpy.var",
"numpy.maximum"
]
] |
jlfilho/sr-tf2 | [
"5309c69d252aad7a8e9260106353fd8acca29c6a"
] | [
"train.py"
] | [
"import tensorflow as tf\nimport argparse\nimport os\nimport statistics as stat\n\n\n\nfrom models.utils import plot_test_images, plot_images, print_metrics\n\nfrom models.espcn.model_espcn import ESPCN as espcn\n\nfrom models.evsrnet.model_evsrnet import EVSRNet\n\nfrom models.rtsrgan.model_generator import G_RTSR... | [
[
"tensorflow.keras.callbacks.TensorBoard",
"tensorflow.keras.losses.Huber",
"tensorflow.math.exp",
"tensorflow.keras.losses.MeanSquaredError",
"tensorflow.keras.losses.BinaryCrossentropy",
"tensorflow.keras.losses.MeanAbsoluteError",
"tensorflow.keras.callbacks.ReduceLROnPlateau",
"... |
RetiSpA/Covid-19 | [
"d2d5d73a78bbd2966abfb2ceb43a2270a165fb5c"
] | [
"python/utilities/path_dataset.py"
] | [
"import pandas as pd\nimport numpy as np\nimport re\nimport os\nimport requests\n\n\ndef get_folder_path(custom_path=''):\n \"\"\"\n Define a base folder on your file system\n \"\"\"\n if custom_path is '' or custom_path is None:\n BASEPATH = os.path.abspath('')\n else:\n BASEPATH = os.... | [
[
"numpy.random.seed",
"pandas.DataFrame",
"pandas.read_csv",
"pandas.read_excel"
]
] |
keyonvafa/sequential-rationales | [
"515d78718ee09c924d72bc9f9c6caebaec9b0b11"
] | [
"fairseq/fairseq/models/transformer/transformer_decoder.py"
] | [
"# 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\nimport math\nfrom typing import Any, Dict, List, Optional\n\nimport torch\nimport torch.nn as nn\nfrom fairseq import utils\nfrom fa... | [
[
"torch.nn.Linear",
"torch.rand",
"torch.zeros",
"torch.nn.ModuleList",
"torch.nn.init.constant_",
"torch.FloatTensor",
"torch.nn.init.xavier_uniform_",
"torch.randperm",
"torch.clamp",
"torch.nn.init.normal_",
"torch.randint",
"torch.eye",
"torch.empty",
"to... |
Belovolov/wrn-server | [
"76bd2652f1129986843918f9d7ef669229793859"
] | [
"utils/wr_nets.py"
] | [
"import cv2\nimport numpy as np\nimport wide_residual_network as wrn\nfrom keras.datasets import cifar10\nfrom keras import backend as K\nimport tensorflow as tf\nimport cifarMeta\n\nclass Wrn168c10():\n def __init__(self, weightsFile):\n (self.trainX, trainY), (testX, testY) = cifar10.load_data()\n ... | [
[
"numpy.frombuffer",
"numpy.empty",
"tensorflow.get_default_graph"
]
] |
noobermin/sharks-butts | [
"55de06a4c626257d77b374eab955975ef4eac23e"
] | [
"bin/sclrq.py"
] | [
"#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n'''\nJust render something.\n\nUsage:\n ./sclrq.py [options] (--show|-s) <i>\n ./sclrq.py [options] <i> <outname>\n\nOptions:\n --help -h\n --show -s Show\n --nozip -U sclr/flds are NOT gzipped.\n --zip -Z sclr/flds ar... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.tick_params",
"numpy.abs",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
]
] |
kevintzd/TargetDetection | [
"be4aebb3774be70fe37b1f3df2815cba024b6eae"
] | [
"image_web_server.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom flask import Flask, request, jsonify, send_from_directory, render_template\nfrom flask import Flask, request, redirect, url_for\nfrom werkzeug.utils import secure_filename\nfrom keras.backend import... | [
[
"tensorflow.get_default_graph",
"tensorflow.Session",
"tensorflow.train.Saver",
"matplotlib.pyplot.subplots",
"tensorflow.ConfigProto",
"numpy.where",
"matplotlib.pyplot.margins",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.Rectangle",
... |
hb563/chempropvle | [
"217a246607184137c0a00e06ef917aeb18321a52"
] | [
"chemprop/hyperparameter_optimization.py"
] | [
"\"\"\"Optimizes hyperparameters using Bayesian optimization.\"\"\"\n\nfrom copy import deepcopy\nimport json\nfrom typing import Dict, Union\nimport os\n\nfrom hyperopt import fmin, hp, tpe\nimport numpy as np\n\nfrom chempropvle.chemprop.args import HyperoptArgs\nfrom chempropvle.chemprop.constants import HYPEROP... | [
[
"numpy.isnan",
"numpy.random.RandomState"
]
] |
gluru/tensorflow | [
"0290bfd96901018d6fd0a520e77aafb44b19a1ac"
] | [
"tensorflow/lite/python/lite_v2_test.py"
] | [
"# Lint as: python2, python3\n# Copyright 2019 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/... | [
[
"tensorflow.lite.python.lite.TFLiteConverterV2.from_keras_model",
"tensorflow.ones",
"tensorflow.keras.layers.Reshape",
"tensorflow.lite.python.test_util.get_ops_list",
"tensorflow.lite.python.lite.TFLiteConverterV2.from_concrete_functions",
"numpy.random.random",
"tensorflow.python.pl... |
cy7533/Chinese-Text-Classification-Pytorch | [
"50fe721e779c03905e674656f85d13cd0adf7b86"
] | [
"models/HAN/word_att_model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom models.HAN.utils import matrix_mul, element_wise_mul\n\n\"\"\"\nHAN 词维度\n\"\"\"\n\n\nclass WordAttNet(nn.Module):\n def __init__(self, dict_len, embed_size, word_hidden_size):\n \"\"\"\n 初始化 HAN 词维度\n :param dict_l... | [
[
"torch.zeros",
"torch.nn.Embedding",
"torch.nn.GRU",
"torch.nn.functional.softmax"
]
] |
hknozturk/yarll | [
"c5293e6455e3debe6e4d4d21f713937a24a654f3"
] | [
"yarll/agents/tf2/sac.py"
] | [
"\"\"\"\nSoft Actor-Critic\n\nBased on SAC implementation from https://github.com/rail-berkeley/softlearning\n\"\"\"\nfrom copy import deepcopy\nimport csv\nfrom pathlib import Path\nfrom typing import Union\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras import Model\nfrom tensorflow.keras.laye... | [
[
"tensorflow.exp",
"tensorflow.reduce_min",
"tensorflow.debugging.assert_shapes",
"tensorflow.nn.moments",
"numpy.mean",
"tensorflow.keras.layers.Dense",
"tensorflow.sqrt",
"tensorflow.keras.Model",
"numpy.resize",
"tensorflow.keras.models.clone_model",
"tensorflow.tanh"... |
yingli2009/dtnn | [
"30ef997f69f5293ae1eee03ec24716d4f0f3ce18"
] | [
"dtnn/utils.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\n\ndef shape(x):\n if isinstance(x, tf.Tensor):\n return x.get_shape().as_list()\n return np.shape(x)\n"
] | [
[
"numpy.shape"
]
] |
cocomoff/SimpleRRNG | [
"35ce2c61e2d9cb917d7df74ecdbb21c9f25760ad"
] | [
"example.py"
] | [
"import numpy as np\r\nfrom rrng.generator import generate\r\nfrom rrng.visualizer import visualize\r\nfrom rrng.util import clean_up, write_to_csv\r\n\r\nif __name__ == '__main__':\r\n np.random.seed(20201222)\r\n Dx, Dy = 50, 50\r\n N = 30\r\n coeff = 1.3\r\n G, pos = generate(Dx, Dy, N, coeff)\r\n... | [
[
"numpy.random.seed"
]
] |
rossimattia/depth-refinement-and-normal-estimation | [
"daafd1658ebbddb38dda373b6f8a6c2cf81636f9"
] | [
"refinement.py"
] | [
"# Copyright (c) 2020,\n# ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland,\n# Laboratoire de Traitement des Signaux 4 (LTS4).\n# All rights reserved.\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... | [
[
"numpy.max",
"torch.device",
"torch.optim.lr_scheduler.StepLR",
"numpy.zeros",
"numpy.percentile",
"torch.no_grad",
"numpy.min",
"numpy.arange",
"numpy.transpose",
"torch.as_tensor",
"torch.nn.functional.pad"
]
] |
suryaavala/datasets | [
"bf04ec1ad4b889d05c1dc22bc8eebc2b1ce8ea47"
] | [
"tensorflow_datasets/core/utils/py_utils.py"
] | [
"# coding=utf-8\n# Copyright 2021 The TensorFlow Datasets 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 ... | [
[
"tensorflow.compat.v2.io.gfile.makedirs",
"tensorflow.compat.v2.io.gfile.exists",
"tensorflow.compat.v2.io.gfile.rename",
"tensorflow.compat.v2.io.gfile.listdir",
"tensorflow.compat.v2.io.gfile.rmtree",
"tensorflow.compat.v2.io.gfile.GFile"
]
] |
vishalbelsare/crosscat | [
"1f2ac5a43a50ebd7aaa89f0c5ac3815a170848c5"
] | [
"scripts/cython_code/test_multinomial_impute.py"
] | [
"#\n# Copyright (c) 2010-2016, MIT Probabilistic Computing Project\n#\n# Lead Developers: Dan Lovell and Jay Baxter\n# Authors: Dan Lovell, Baxter Eaves, Jay Baxter, Vikash Mansinghka\n# Research Leads: Vikash Mansinghka, Patrick Shafto\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"... | [
[
"numpy.array",
"numpy.nonzero",
"numpy.random.RandomState"
]
] |
safinsingh/manim-old | [
"ba403c02853118a7fbb3f17852a158ebef95a97a"
] | [
"manimlib/animation/transform.py"
] | [
"import inspect\n\nimport numpy as np\n\nfrom manimlib.animation.animation import Animation\nfrom manimlib.constants import DEFAULT_POINTWISE_FUNCTION_RUN_TIME\nfrom manimlib.constants import OUT\nfrom manimlib.constants import DEGREES\nfrom manimlib.mobject.mobject import Group\nfrom manimlib.mobject.mobject impor... | [
[
"numpy.identity",
"numpy.array",
"numpy.dot",
"numpy.log"
]
] |
zhjpqq/Detectron.pytorch | [
"8315af319cd29b8884a7c0382c4700a96bf35bbc"
] | [
"lib/modeling/FPN.py"
] | [
"import collections\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn import init\n\nfrom core.config import cfg\nimport utils.net as net_utils\nimport modeling.ResNet as ResNet\nfrom modeling.generate_anchors import generate_anchors\nfrom modeling.generate_p... | [
[
"torch.nn.functional.sigmoid",
"torch.nn.functional.upsample",
"torch.nn.ModuleList",
"torch.nn.init.constant_",
"torch.nn.MaxPool2d",
"torch.nn.Conv2d",
"torch.nn.init.normal_",
"torch.nn.functional.cross_entropy",
"torch.nn.functional.relu"
]
] |
bradkav/DarkAxionPortal | [
"5716e0684cf0f7e84f0a4de00a37734deff71d7b"
] | [
"code/PlotKineticMixingProjections.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nimport PlotFuncs_DarkPhoton as PF\n\nimport DarkAxionPortal\nfrom Units import *\n\nimport os\nimport argparse\n\nrootdir = os.path.dirname(os.path.abspath(__file__)) + \"/\"\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"-f_dp\", \"--f_dp\",help... | [
[
"matplotlib.pyplot.text",
"matplotlib.pyplot.plot",
"numpy.loadtxt",
"matplotlib.pyplot.gcf",
"numpy.sqrt"
]
] |
Mascariddu/vision | [
"d4d15445ecab3365c26498695861c9e773b86284"
] | [
"test/test_onnx.py"
] | [
"import io\nimport torch\nfrom torchvision import ops\nfrom torchvision import models\nfrom torchvision.models.detection.image_list import ImageList\nfrom torchvision.models.detection.transform import GeneralizedRCNNTransform\nfrom torchvision.models.detection.rpn import AnchorGenerator, RPNHead, RegionProposalNetw... | [
[
"torch.rand",
"torch._C._jit_set_profiling_executor",
"torch.no_grad",
"torch.ones",
"torch.manual_seed",
"torch.jit._flatten",
"torch.tensor",
"torch.onnx.export",
"torch._C._jit_set_profiling_mode",
"torch.jit.trace",
"torch.testing.assert_allclose",
"torch.randn"... |
ardilacarlosh/amazon-forecast-samples | [
"3a516e5b9b2af745546784178fcea115eda3008c"
] | [
"notebooks/util/fcst_utils.py"
] | [
"import time\nimport boto3\nimport json\nimport pandas as pd\nimport logging\nimport matplotlib.pyplot as plt\n\ndef wait_till_delete(callback, check_time = 5, timeout = 180):\n elapsed_time = 0\n while elapsed_time < timeout:\n try:\n out = callback()\n except Exception as e:\n ... | [
[
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"pandas.Timestamp",
"matplotlib.pyplot.fill_between",
"pandas.read_csv",
"matplotlib.pyplot.xticks"
]
] |
goodok/sympy | [
"de84ed2139125a755ea7b6ba91d945d9fbbe5ed9"
] | [
"sympy/matrices/expressions/matexpr.py"
] | [
"from sympy import Expr, Symbol, Mul, Add, Pow, expand, sympify, Tuple, Integer\nfrom sympy.core.basic import Basic\nfrom sympy.core.singleton import S\nfrom sympy.core.decorators import _sympifyit, call_highest_priority\nfrom sympy.matrices import ShapeError, Matrix\n\nclass MatrixExpr(Expr):\n \"\"\" Matrix Ex... | [
[
"numpy.empty"
]
] |
ZucchiniTang/ssd.pytorch | [
"b2b0a6f286a8d99de84fe0001a4b4f3b7e3e4ca4"
] | [
"layers/modules/multibox_loss.py"
] | [
"# -*- coding: utf-8 -*-\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom data import coco as cfg\nfrom ..box_utils import match, log_sum_exp\nimport sys\n\nclass MultiBoxLoss(nn.Module):\n \"\"\"SSD Weighted Loss Function\n Compute Targets:\n ... | [
[
"torch.nn.functional.smooth_l1_loss",
"torch.autograd.Variable",
"torch.nn.functional.cross_entropy",
"torch.LongTensor",
"torch.Tensor"
]
] |
UT-Covid/episimlab | [
"3ead2e8f0934094a829004d61a4314ed88e5c217"
] | [
"examples/example_sirv.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[ ]:\n\n\nimport xsimlab as xs\nimport xarray as xr\nfrom episimlab.models import ExampleSIR, EpiModel\nfrom episimlab.foi import BaseFOI\nfrom episimlab.utils import visualize_compt_graph, coerce_to_da\nimport networkx as nx\nimport pandas as pd\n\n\n# # Episimlab Tut... | [
[
"pandas.date_range"
]
] |
matt-peters/apex | [
"28097c9999d86bd889a1f03c963e29e3384f3996"
] | [
"apex/amp/scaler.py"
] | [
"import torch\nfrom ..multi_tensor_apply import multi_tensor_applier\nfrom ._amp_state import _amp_state, master_params, maybe_print\nfrom itertools import product\n\ndef scale_check_overflow_python(model_grad, master_grad, scale, check_overflow=False):\n # Exception handling for 18.04 compatibility\n if chec... | [
[
"torch.cuda.IntTensor"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.