repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
Alt-Shivam/colour | [
"22dd196592e6db03113fe19c4d5810b6d96fa094"
] | [
"colour/notation/munsell.py"
] | [
"\"\"\"\nMunsell Renotation System\n=========================\n\nDefines various objects for *Munsell Renotation System* computations:\n\n- :func:`colour.notation.munsell_value_Priest1920`: *Munsell* value :math:`V`\n computation of given *luminance* :math:`Y` using\n *Priest, Gibson and MacNicholas (1920)*... | [
[
"numpy.max",
"numpy.array",
"numpy.sin",
"numpy.isnan",
"numpy.min",
"numpy.degrees",
"numpy.radians",
"numpy.arange",
"numpy.ravel",
"numpy.sqrt",
"numpy.around",
"numpy.squeeze",
"numpy.floor"
]
] |
tylercroberts/PartyParrot | [
"89894ea054a466f2ec1c5a620fd312cdc2008a77"
] | [
"party_parrot/parrot_engine.py"
] | [
"\"\"\"\n\n Engine\n ~~~~~~\n\n\"\"\"\nimport pyperclip\nfrom sklearn.utils import shuffle\nfrom string import ascii_lowercase as chars\nfrom party_parrot._slack_parrots import parrots\nfrom party_parrot._utils import dict_str_replace\n\n\nclass ParrotLang(object):\n def __init__(self):\n self._defa... | [
[
"sklearn.utils.shuffle"
]
] |
ectucker1/info-diffusion | [
"36a78861d393b7f7fb2a9d5e8dff8ccdfe0baf33"
] | [
"indiff/data/combine_partials.py"
] | [
"from pathlib import Path\nimport click\nimport pandas as pd\nimport os\n\n\n@click.command()\ndef main():\n partial_folder = Path('data/raw')\n dataset_files = partial_folder.glob('*.h5')\n\n partials = []\n\n for file in dataset_files:\n print('Reading file', file)\n partials.append(pd.r... | [
[
"pandas.read_hdf",
"pandas.concat"
]
] |
jayadeepsasikumartud/Mask_RCNN | [
"3d2fa2a701b328547cd6a2ed51c5d43ad41085d0"
] | [
"mrcnn/visualize.py"
] | [
"\"\"\"\nMask R-CNN\nDisplay and Visualization Functions.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport sys\nimport random\nimport itertools\nimport colorsys\n\nimport cv2\nimport numpy as np\nfrom skimage.mea... | [
[
"numpy.random.choice",
"numpy.random.rand",
"numpy.where",
"matplotlib.patches.Rectangle",
"numpy.concatenate",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot",
"matplotlib.lines.Line2... |
zbzhu99/NGSIM_Imitation | [
"0af6ce327e4fc4da32eddb08ba0bba5403dac24e"
] | [
"ILSwiss/run_scripts/ma_adv_irl_exp_script.py"
] | [
"import yaml\r\nimport argparse\r\nimport numpy as np\r\nimport os\r\nimport sys\r\nimport inspect\r\nimport random\r\nimport pickle\r\n\r\ncurrentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))\r\nparentdir = os.path.dirname(currentdir)\r\nsys.path.insert(0, parentdir)\r\nprint(sys.... | [
[
"numpy.std",
"numpy.random.randint",
"numpy.mean"
]
] |
C0deZLee/bosch-hackathon | [
"1cc6f5c63ed88d121daed1cf6701ef5e45e8563e"
] | [
"Bosch/message/vec2img.py"
] | [
"# 简化 : 假设其中一个轴为0\n\n\ndef getRange(pts, ax):\n mx = pts[0][ax]\n mi = pts[0][ax]\n for p in pts:\n if p[ax] < mi:\n mi = p[ax]\n if p[ax] > mx:\n mx = p[ax]\n return mx - mi\n\n\ndef pts2flatten(pts):\n ret = []\n rg = [getRange(pts, i) for i in range(3)]\n ... | [
[
"numpy.array",
"numpy.zeros"
]
] |
satvik007/AI_Lab | [
"cfd95ffabd46c07bfff0a4da46026ba44492fd8e"
] | [
"Week4/1.py"
] | [
"from __future__ import print_function\nimport numpy as np\nimport random\n\n\nclass Environment:\n\n def __init__ (self, n):\n self.arr = np.arange(1, n * n + 1).reshape((n, n))\n print (self.arr)\n self. n = n\n self.zero = self.find_zero()\n\n def find_zero(self):\n for i... | [
[
"numpy.arange"
]
] |
simitii/Bongard-LOGO | [
"45a0ab244c809b32bcba139b7273b8ec5aa0708c"
] | [
"Bongard-LOGO_Baselines/models/meta_baseline.py"
] | [
"# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# This work is licensed under the MIT License.\n# To view a copy of this license, visit https://opensource.org/licenses/MIT\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport models\nimport utils\nfrom .models import ... | [
[
"torch.nn.functional.normalize",
"torch.cat",
"torch.tensor"
]
] |
lxuechen/fast-dpsgd | [
"bcd920f81cb8501d16d4e953133bedba86029f56",
"bcd920f81cb8501d16d4e953133bedba86029f56"
] | [
"owkindp.py",
"fast_torch_dp.py"
] | [
"'''\nCode for Grad-CNN implementations\n'''\n\nimport time\n\nimport torch\nimport torch.nn.functional as F\nfrom gradcnn import crb, make_optimizer\nfrom torch import nn, optim\n\nimport data\nimport utils\nfrom pytorch import get_data\n\n\nclass MNISTNet(crb.Module):\n def __init__(self, **_):\n super(... | [
[
"torch.nn.functional.sigmoid",
"torch.cuda.synchronize",
"torch.nn.AvgPool2d",
"torch.nn.ReLU",
"torch.mean",
"torch.nn.BCELoss",
"torch.nn.functional.relu",
"torch.nn.functional.max_pool2d",
"torch.nn.CrossEntropyLoss"
],
[
"torch.cuda.synchronize",
"torch.nn.Cross... |
bdvllrs/marl-patroling-agents | [
"f2924d88a412acd27c02e3889aedc648a6d7400e"
] | [
"sim/env.py"
] | [
"from typing import List\n\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom mpl_toolkits.mplot3d.art3d import Poly3DCollection, Line3DCollection\nimport mpl_toolkits.mplot3d.art3d as art3d\nimport numpy as np\nfrom sim.rewards import reward_full\nfrom sim.agents.agents import Agent\ni... | [
[
"matplotlib.pyplot.Rectangle",
"numpy.linalg.norm",
"numpy.arange"
]
] |
short-greg/takonet | [
"22ca288feb36fb435b7c120f76a6902d0d5529f4"
] | [
"tako/test_build.py"
] | [
"from multiprocessing.sharedctypes import Value\nfrom re import X\nimport typing\nimport torch\nfrom torch import nn\nfrom torch.nn.modules.container import Sequential\nfrom ._networks import In, Multitap, Node, NodePort, OpNode, Out, Port\nfrom ._build import (\n ChainFactory, CounterNamer, Kwargs, ModFactory, ... | [
[
"torch.Size",
"torch.rand",
"torch.nn.Linear",
"torch.sigmoid",
"torch.ones",
"torch.manual_seed",
"torch.randn"
]
] |
WayneDW/Bayesian-Sparse-Deep-Learning | [
"94036065c4a249e8c87ebef84e686f885528c23f"
] | [
"trainer.py"
] | [
"''' Trainer file\nAn Adaptive Empirical Bayesian Method for Sparse Deep Learning (NeurIPS 2019)\n(c) Wei Deng, Xiao Zhang, Faming Liang, Guang Lin\n'''\nimport math\nimport copy\nimport sys\nimport os\nimport timeit\nimport csv\nimport dill\nimport argparse\nimport random\nfrom random import shuffle\n\nfrom tqdm i... | [
[
"torch.autograd.Variable",
"torch.cuda.is_available"
]
] |
TizioMaurizio/ArduinoWorkshop | [
"d38ede91c6b7a925eafb0272a5fa9f44885ae017"
] | [
"Projects/OpenCVwebCamera/AnimeColor.py"
] | [
"import cv2\nimport numpy as np\nimport serial\nimport time\nfrom typing import Dict\n\nimport mss\nfrom PIL import Image\nfrom screeninfo import get_monitors\n\n\ndef nothing(x):\n pass\n \ncv2.namedWindow(\"Trackbars\")\n \ncv2.createTrackbar(\"B\", \"Trackbars\", 0, 255, nothing)\ncv2.createTrackbar(\"G\", \"... | [
[
"numpy.uint8"
]
] |
nshelch/NCams | [
"a2027a739337df8b620b2454cf83bb2516db8a00"
] | [
"ncams/camera_pose.py"
] | [
"#!python3\n# -*- coding: utf-8 -*-\n\"\"\"\nNCams Toolbox\nCopyright 2019-2020 Charles M Greenspon, Anton Sobinov\nhttps://github.com/CMGreenspon/NCams\n\nFunctions related to estimation of relative positions and orientations of the cameras.\n\nFor more details on the camera data structures and dicts, see help(nca... | [
[
"numpy.array",
"numpy.zeros",
"numpy.sum",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.where",
"numpy.identity",
"numpy.arange",
"numpy.transpose",
"numpy.asscalar",
"numpy.repeat",
"numpy.hstack",
"numpy.vstack"
]
] |
segurac/NCRFpp | [
"c922af88f3daa456be15454efe244bcfff42c693"
] | [
"model/seqmodel.py"
] | [
"# -*- coding: utf-8 -*-\n# @Author: Jie Yang\n# @Date: 2017-10-17 16:47:32\n# @Last Modified by: Jie Yang, Contact: jieynlp@gmail.com\n# @Last Modified time: 2018-03-30 16:20:07\n\nimport torch\nimport torch.autograd as autograd\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nf... | [
[
"torch.nn.NLLLoss",
"torch.max",
"torch.nn.functional.log_softmax"
]
] |
andudu/Pose_Net_tracking | [
"63229cbe380985d78de165c41a133998b734d931"
] | [
"tracking.py"
] | [
"import numpy as np\nimport operator\n\nclass tracking(object):\n\n def __init__(self):\n\n self.previous_dict = {}\n self.current_dict = {}\n self.return_dict = {}\n\n def return_most_similar(self,current_keypoints):\n\n # Intializes the prev dictionary with persons and all of the... | [
[
"numpy.linalg.norm"
]
] |
judithabk6/Clonesig_analysis | [
"b473425833a75a6699b3b5b3026d91d00dbb53ba"
] | [
"signature_code/evaluate_dream.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\nimport pandas as pd\nimport sys\nfrom collections import Iterable\nimport numpy as np\nimport pickle\nimport scipy as sp\nfrom clonesig.data_loader import SimLoader\nfrom clonesig.evaluate import score1B_base, score1C_base, score2A_base, score2C_base, score_sig_1A_bas... | [
[
"numpy.array",
"numpy.zeros",
"pandas.merge",
"pandas.DataFrame",
"numpy.where",
"numpy.argmax",
"pandas.Series",
"numpy.repeat",
"pandas.read_csv",
"numpy.unique",
"numpy.isin"
]
] |
cendaifeng/keras-face-recognition | [
"cda443e6ffec4c618f24c10ef30208f4f31a4181"
] | [
"version/face_recognize_sleep.py"
] | [
"import cv2\nimport os\nimport time\nimport numpy as np\nfrom net.mtcnn import mtcnn\nimport utils.utils as utils\nfrom net.inception import InceptionResNetV1\nimport RPi.GPIO as GPIO\nimport signal\nimport atexit\n\n\n# 初始化舵机\natexit.register(GPIO.cleanup)\nservopin = 17\nGPIO.setmode(GPIO.BCM)\nGPIO.setup(servopi... | [
[
"numpy.array",
"numpy.reshape",
"numpy.argmin",
"numpy.shape",
"numpy.clip",
"numpy.expand_dims"
]
] |
dparle/CarND-Capstone | [
"7ad6173ec71cc548c5b807de042608cd386c4862"
] | [
"ros/src/tl_detector/light_classification/tl_classifier.py"
] | [
"from styx_msgs.msg import TrafficLight\nimport rospy\nimport yaml\nimport tensorflow as tf\nimport numpy as np\nimport os\nimport cv2\n\nclass TLClassifier(object):\n def __init__(self):\n self.session = None\n self.model_graph = None\n self.classes = {1: TrafficLight.GREEN, 2: TrafficLight... | [
[
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.GraphDef",
"tensorflow.import_graph_def",
"tensorflow.gfile.GFile",
"tensorflow.ConfigProto",
"numpy.squeeze",
"numpy.expand_dims"
]
] |
yiskw713/pytorch_utils | [
"ce353202b28d5add9fa4fa6e4f9cdedffc3f8114"
] | [
"tests/opencv_misc/test_interframe_difference.py"
] | [
"import numpy as np\nimport pytest\n\nfrom src.opencv_misc.interframe_difference import InterframeDifferenceProcessor\n\n\nclass TestInterframeDifferenceProcessor:\n @pytest.fixture()\n def processor(self) -> InterframeDifferenceProcessor:\n return InterframeDifferenceProcessor(threshold=30)\n\n def... | [
[
"numpy.all",
"numpy.zeros"
]
] |
karthiksharma98/mmdetection | [
"295145d41a74598db98a037224f0f82c074f3fff"
] | [
"mmdet/models/dense_heads/yolof_rep_head.py"
] | [
"import torch\nimport torch.nn as nn\nfrom mmcv.cnn import (ConvModule, bias_init_with_prob, constant_init, is_norm,\n normal_init)\nfrom mmcv.runner import force_fp32\n\nfrom mmdet.core import anchor_inside_flags, multi_apply, reduce_mean, unmap\nfrom ..builder import HEADS\nfrom .anchor_head ... | [
[
"torch.cat",
"torch.stack",
"torch.nn.init.constant_",
"torch.nn.Sequential",
"torch.nn.Conv2d"
]
] |
canaanchap/roguedeka | [
"aacd3e45966deff21eb2db5e6e6034eaaf9b88b2"
] | [
"venv/lib/python3.7/site-packages/tcod/sdl.py"
] | [
"\"\"\"SDL2 specific functionality.\n\nAdd the line ``import tcod.sdl`` to include this module, as importing this\nmodule is not implied by ``import tcod``.\n\"\"\"\nfrom typing import Any, Tuple\n\nimport numpy as np\n\nfrom tcod.loader import lib, ffi\n\n__all__ = (\"Window\",)\n\n\nclass _TempSurface:\n \"\"\... | [
[
"numpy.ascontiguousarray"
]
] |
zgojcic/3D_multiview_reg | [
"22468adadfccaffe92c6d88a4cce42b5b7edb77e"
] | [
"lib/pairwise/__init__.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport MinkowskiEngine as ME\r\nfrom lib.layers import Soft_NN, Sampler\r\nfrom lib.utils import extract_overlaping_pairs, extract_mutuals, construct_filtering_input_data\r\nfrom lib.pairwise import (\r\n config, training\r\n)\r\n\r\n__all__ = [\r\n config, training\r... | [
[
"torch.empty",
"torch.isnan"
]
] |
fbuchert/crypto-trading | [
"9fdf44ae9a0fdc96a24a5645b52c2fcbf4406402"
] | [
"portfolio/portfolio.py"
] | [
"import os\nimport pickle\nimport logging\nimport pandas as pd\n\nfrom typing import List, Tuple\nfrom core.instrument import Instrument\nfrom core.events import TradeExecutedEvent\n\nrootLogger = logging.getLogger()\n\n\nclass Portfolio:\n def __init__(self, instruments: List[Instrument], save_path: str = ''):\... | [
[
"pandas.Series"
]
] |
Saynah/athos-webapp | [
"df29e08a98f6ae6fe7d817b155e8c736dacc7acc"
] | [
"app/views.py"
] | [
"from flask import render_template\nfrom app import app\nimport matplotlib.pyplot as plt, mpld3\n\n@app.route('/')\n@app.route('/index')\ndef index():\n return render_template(\"index.html\",\n title = 'Home', user = { 'nickname': 'Mark' },\n )\n\n# keep this page for debugging purposes\n@app.route(\... | [
[
"matplotlib.pyplot.subplots"
]
] |
subramon/qlu | [
"2fb8a2b3636dd11e2dfeae2a6477bd130316da47"
] | [
"ML/DT/python/DTree_sklearn_ramesh_dataset_train_test.py"
] | [
"\n# coding: utf-8\n\n# In[15]:\n\n\nimport sklearn_dt_utils as utils\nfrom sklearn.tree import export_graphviz\nimport pandas as pd\nimport os\n\n\n# In[16]:\n\n\nq_src_dir = os.getenv('Q_SRC_ROOT')\nif not q_src_dir:\n print(\"'Q_SRC_ROOT' is not set\")\n exit(-1)\ntrain_csv_file_path = \"%s/ML/KNN/data/fro... | [
[
"sklearn.tree.export_graphviz"
]
] |
sdll/gccpm-tvm | [
"caf22e629b96a9aa1f1a53e07ed81ec12520a04d"
] | [
"demo.py"
] | [
"import argparse\n\nimport cv2\nimport numpy as np\nimport torch\n\nfrom models.with_mobilenet import PoseEstimationWithMobileNet\nfrom modules.keypoints import extract_keypoints, group_keypoints\nfrom modules.load_state import load_state\nfrom modules.pose import Pose, propagate_ids\nfrom val import normalize, pad... | [
[
"numpy.ones",
"torch.load",
"torch.from_numpy"
]
] |
PeculiarOvertones/FHDeX | [
"60e285101704196db24afe8b2461283753526fc5"
] | [
"exec/immersed_boundary/src_analysis/data_model.py"
] | [
"# used pretty much everywhere\nimport numpy as np\n# used to enable function overloading\nfrom multimethod import multimeta\n\n\n\nclass SoA(object, metaclass=multimeta):\n _pref = \"particle_\"\n _pos = \"position_\"\n _vel = \"vel\"\n\n _id = \"id\"\n _cpu = \"cpu\"\n _id_0 = \"id_0\... | [
[
"numpy.array"
]
] |
mathause/pandas | [
"72327f32e2328d3e13b6c55617d71036fccdd0e1"
] | [
"pandas/tests/series/indexing/test_getitem.py"
] | [
"\"\"\"\nSeries.__getitem__ test classes are organized by the type of key passed.\n\"\"\"\nfrom datetime import (\n date,\n datetime,\n time,\n)\n\nimport numpy as np\nimport pytest\n\nfrom pandas._libs.tslibs import (\n conversion,\n timezones,\n)\n\nfrom pandas.core.dtypes.common import is_scalar\n... | [
[
"pandas.DatetimeIndex",
"pandas._testing.rands_array",
"pandas.Timestamp",
"pandas.IntervalIndex.from_breaks",
"pandas._testing.assert_series_equal",
"pandas.period_range",
"numpy.dtype",
"pandas.DataFrame",
"pandas.timedelta_range",
"pandas.Period",
"numpy.array",
... |
carldlaird/idaes-pse | [
"cc7a32ca9fa788f483fa8ef85f3d1186ef4a596f"
] | [
"idaes/surrogate/roundingRegression/RoundingRegression.py"
] | [
"#################################################################################\n# The Institute for the Design of Advanced Energy Systems Integrated Platform\n# Framework (IDAES IP) was produced under the DOE Institute for the\n# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021\n# by th... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.linalg.matrix_rank",
"numpy.dot",
"numpy.zeros",
"numpy.random.choice",
"numpy.delete",
"numpy.count_nonzero",
"numpy.ones",
"scipy.linalg.qr_insert",
"numpy.nonzero",
"numpy.shape",
"scipy.linalg.qr",
"numpy.linalg... |
GuoooooJing/nasa-cloudstreet-image-classification | [
"2923609da6a0501101bdf3db322b7e012e683391"
] | [
"ml_model/twolayer.py"
] | [
"import torch\nimport torch.nn as nn\nclass ConvNet(nn.Module):\n def __init__(self, num_classes=10):\n super(ConvNet, self).__init__()\n self.layer1 = nn.Sequential(\n nn.Conv2d(3, 16, kernel_size=5, stride=1, padding=2),\n nn.BatchNorm2d(16),\n nn.ReLU(),\n ... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
ruohai0925/artemis | [
"deca36ea6f5ccd823f6808d4e9afcaaf94059dd0"
] | [
"Examples/Modules/ionization/analysis_ionization.py"
] | [
"#! /usr/bin/env python\n\n# Copyright 2019-2020 Luca Fedeli, Maxence Thevenet\n#\n# This file is part of WarpX.\n#\n# License: BSD-3-Clause-LBNL\n\n\n\"\"\"\nThis script tests the result of the ionization module in WarpX.\n\nInput files inputs.rt and inputs.bf.rt are used to reproduce the test from\nChen, JCP, 201... | [
[
"numpy.max",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"numpy.abs",
"matplotlib.pyplot.scatter",
"matplotlib.pyplo... |
lemolatoon/chemistry | [
"f69c5a70a959ebd36265e6de1c317fcc0963c6ac"
] | [
"gly_titration.py"
] | [
"from os import name\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\ncb = np.array(0.1 * 0.9505)\r\n\r\nva = 50\r\n\r\nkw = 10 ** (-14)\r\n\r\ndef h2so4(ph: np.ndarray, graph: bool = False):\r\n k1 = np.array(10 ** (-2.35))\r\n k2 = np.array(10 ** (-1.99))\r\n\r\n beta1 = 10 ** (9.78)\r\n ... | [
[
"numpy.array",
"numpy.log",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
cragkhit/elasticsearch | [
"07fb10bec4614f55bcc39e571d1185fc9ce86242"
] | [
"evaluation/plot_index_query.py"
] | [
"from matplotlib import pyplot as plt\nimport numpy as np\nimport matplotlib\n\n# Index time plot\n\nfiles = [4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576]\nmethods = [22, 50, 178, 423, 1723, 6601, 28030, 111190, 442403, 1771183, 4870113]\nnicad_methods = [22, 50, 178, 423, 1723, 6601, 28030, 111190]\n... | [
[
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.s... |
yepedraza/hm-class-nn | [
"08e9bbd9c2c9ff7faeeb6c317aea16e434d1b233"
] | [
"neuralNetwork.py"
] | [
"from dataset import Dataset\nimport numpy as np\n\nclass NeuralNetwork:\n layers_dim = []\n params = {}\n errors = []\n epochs = int \n alpha = float #Learning rate\n training = True\n train_data = Dataset([],[])\n\n def __init__(self, train_data, layers_dim):\n self.train_data = tra... | [
[
"numpy.random.rand",
"numpy.exp",
"numpy.mean"
]
] |
lukepinkel/pystats | [
"8e8d7588a63c9ca39b6b7ca1e4a6e92f5a1c0c22"
] | [
"pystatsm/pyfa/rotation.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jun 15 22:04:25 2020\n\n@author: lukepinkel\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom ..utilities.linalg_operations import vec, invec, vecl, vdg\nfrom ..utilities.special_mats import kmat\n\n\n\n\ndef vgq_cf(L, gamma):\n '''\... | [
[
"numpy.zeros_like",
"numpy.dot",
"numpy.linalg.norm",
"numpy.linalg.multi_dot",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"numpy.linalg.pinv",
"numpy.eye",
"numpy.finfo",
"numpy.arange",
"numpy.abs",
"numpy.linalg.svd",
"numpy.linalg.inv",
"numpy.kron"
... |
USE-sum/usesum | [
"eaf6dae0c451459551f728c0a8866777c20ed707"
] | [
"onmt/trainer.py"
] | [
"\"\"\"\n This is the loadable seq2seq trainer library that is\n in charge of training details, loss compute, and statistics.\n See train.py for a use case of this library.\n\n Note: To make this a general library, we implement *only*\n mechanism things here(i.e. what to do), and leave the stra... | [
[
"torch.zeros",
"torch.squeeze",
"torch.autograd.set_detect_anomaly",
"torch.cumsum"
]
] |
Roemer/CrazyServ | [
"a61769008d6490c16c4c58d25638315698aabdcf"
] | [
"crazyserv/packagegenerator.py"
] | [
"import random\nimport numpy as np\nfrom .arena import Arena\nfrom .deliverylogger import DeliveryLogger\nfrom .drone import Drone\n\n\nclass PackageGenerator:\n def __init__(self):\n self.coordinate_pool = self.define_coordinate_pool()\n self.pool_size = self.coordinate_pool.shape[0]\n self... | [
[
"numpy.array"
]
] |
RomainGratier/Black-box_Optimization_via_Deep_Generative-Exploratory_Networks | [
"2cce334b473df709eb67d2f351a96cde1addc5a6"
] | [
"src/forward/cnn_models.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nfrom src.forward.layers import FlattenLayer\n\ndef conv_init(m):\n classname = m.__class__.__name__\n if classname.find('Conv') != -1:\n #nn.init.xavier_uniform(m.weight, gain=np.sqrt(2))\n nn.init.normal_(m.weight, mea... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.init.constant",
"torch.nn.MaxPool2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.init.normal_",
"torch.nn.Softplus",
"torch.nn.functional.max_pool2d"
]
] |
sandipan1/stable-baselines3 | [
"5fe6d54f3bbdfade1e90ff5fc9b2506f3facdc37"
] | [
"stable_baselines3/a2c/a2c.py"
] | [
"from typing import Any, Dict, Optional, Type, Union\n\nimport torch as th\nfrom gym import spaces\nfrom torch.nn import functional as F\n\nfrom stable_baselines3.common.on_policy_algorithm import OnPolicyAlgorithm\nfrom stable_baselines3.common.policies import ActorCriticPolicy\nfrom stable_baselines3.common.type_... | [
[
"torch.nn.functional.mse_loss",
"torch.exp",
"torch.mean"
]
] |
bendichter/hdmf | [
"237721cba907086b4cc52befe2ab616683ffa2c1"
] | [
"src/hdmf/build/map.py"
] | [
"from __future__ import absolute_import\nimport re\nimport numpy as np\nimport warnings\nfrom collections import OrderedDict\nfrom copy import copy\nfrom datetime import datetime\nfrom six import with_metaclass, raise_from, text_type, binary_type, integer_types\n\nfrom ..utils import docval, getargs, ExtenderMeta, ... | [
[
"numpy.dtype"
]
] |
NicolasHammer/self_driving_car | [
"1a869a6bb8cb5241341eed051a0683ca17abfe44"
] | [
"trained_models/pilot_net.py"
] | [
"import torch.nn as nn\n\nclass PilotNet(nn.Module):\n def __init__(self, num_controls: int, dropout: float = 0.):\n super(PilotNet, self).__init__()\n\n self.convolutional_block = nn.Sequential(\n # 1st layer\n nn.Conv2d(1, 24, kernel_size=(5,5), stride=(2,2)),\n n... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.ELU",
"torch.nn.Conv2d",
"torch.nn.Flatten"
]
] |
troyliu0105/mmselfsup | [
"df907e5ce02951e68e5de825986d8d7e879ac5b4"
] | [
"mmselfsup/models/heads/latent_pred_head.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport torch\nimport torch.nn as nn\nfrom mmcv.runner import BaseModule\n\nfrom ..builder import HEADS, build_neck\n\n\n@HEADS.register_module()\nclass LatentPredictHead(BaseModule):\n \"\"\"Head for latent feature prediction.\n\n This head builds a predictor,... | [
[
"torch.nn.Linear",
"torch.nn.functional.normalize",
"torch.no_grad",
"torch.nn.CrossEntropyLoss"
]
] |
William-Choe/donkey | [
"733fd842b17b8ea5243031c1db0b88c7bcf759f2"
] | [
"donkeycar/parts/image.py"
] | [
"import os\nimport io\nfrom PIL import Image\nimport numpy as np\nfrom donkeycar.utils import img_to_binary, binary_to_img, arr_to_img, img_to_arr\n\nclass ImgArrToJpg():\n\n def run(self, img_arr):\n if img_arr is None:\n return None\n try:\n image = arr_to_img(img_arr)\n ... | [
[
"numpy.array",
"numpy.reshape",
"numpy.dtype"
]
] |
mattkjames7/PlanetSpice | [
"5a5c2cb75b9832af42cb746a1a6a886b9cc4da88"
] | [
"PlanetSpice/Earth/Orbit.py"
] | [
"import numpy as np\nfrom ..Tools.RotTrans import RotTrans\nfrom ..Sun.Transform import HAEtoHCI\n\ndef OrbitHAE():\n\t'''\n\tThis function returns the orbit of Earth in HAE coordinates\n\t(Heliocentric Aries Ecliptic) where Z is perpendicular to the \n\tEarth's ecliptic plane (positive northwards), X points toward... | [
[
"numpy.sin",
"numpy.zeros",
"numpy.arange",
"numpy.cos",
"numpy.sqrt"
]
] |
olliethomas/ml-fairness-gym | [
"adaa878596d3ce7dc0ee821f53f99cdf0cd2ef5f"
] | [
"ml_gym/agents/allocation_agents_test.py"
] | [
"# coding=utf-8\n# Copyright 2020 The ML Fairness Gym Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.equal",
"numpy.array",
"numpy.isclose",
"numpy.sum",
"numpy.std",
"numpy.abs",
"numpy.all"
]
] |
ANarayan/robustness-gym | [
"eed2800985631fbbe6491b5f6f0731a067eef78e"
] | [
"robustnessgym/core/dataformats/vision.py"
] | [
"from __future__ import annotations\n\nimport copy\nimport gzip\nimport logging\nimport os\nimport pickle\nimport tempfile\nimport uuid\nfrom collections import defaultdict\nfrom types import SimpleNamespace\nfrom typing import Any, Callable, Dict, List, Mapping, Optional, Tuple, Union, cast\n\nimport cytoolz as tz... | [
[
"torch.Size",
"numpy.where",
"numpy.array",
"torch.utils.data.DataLoader"
]
] |
lmmx/lattice-obj | [
"76b62e5d36457d9fed341680a4edfc044f734f71"
] | [
"hasse.py"
] | [
"import numpy as np\nimport itertools\n\ndef ranks_dict(poset):\n \"\"\"\n Return a dictionary `r_dict` with rank keys (in descending order, from supremum,\n i.e. `h.vertices()[0]`, to infimum, `h.vertices()[-1]`) and lists of indices of\n the vertices at that level, to be displayed from left to right, ... | [
[
"numpy.max",
"numpy.linspace",
"numpy.subtract"
]
] |
craigtaub/DashSensor | [
"848d54d0c9fe7077cdc65075e9160f51c84fe410"
] | [
"input.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\n\nimport numpy as np\nimport cv2\n\nIMAGE_SIZE = 64\n\n\ndef resize_with_pad(image, height=IMAGE_SIZE, width=IMAGE_SIZE):\n\n def get_padding_size(image):\n h, w, _ = image.shape\n longest_edge = max(h, w)\n top, bottom, left, right = (0, 0, 0, 0)\n ... | [
[
"numpy.array"
]
] |
FedeClaudi/LocomotionControl | [
"1281f7894825096ad212407351463a2105c5152a"
] | [
"analysis/visuals.py"
] | [
"import matplotlib.pyplot as plt\nfrom typing import Union\nimport pandas as pd\nimport numpy as np\nfrom loguru import logger\nfrom scipy.stats import sem\n\n\n# from fcutils.plot.distributions import plot_kde\nfrom fcutils.plot.elements import plot_mean_and_error\nfrom myterial import blue_grey, blue_grey_dark, g... | [
[
"numpy.sin",
"numpy.ones_like",
"pandas.DataFrame",
"numpy.mean",
"matplotlib.pyplot.subplots",
"numpy.degrees",
"numpy.std",
"numpy.arange",
"numpy.cos",
"scipy.stats.sem",
"numpy.hstack",
"numpy.linspace",
"numpy.vstack"
]
] |
yuxiang-gao/crowdenv_training | [
"8d8f4f46c905155783195430175723a2a7755630"
] | [
"utils/exp_manager.py"
] | [
"import argparse\nimport os\nimport pickle as pkl\nimport time\nimport warnings\nfrom collections import OrderedDict\nfrom pprint import pprint\nfrom typing import Any, Callable, Dict, List, Optional, Tuple\n\nimport gym\nimport numpy as np\nimport optuna\nimport yaml\nfrom optuna.integration.skopt import SkoptSamp... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
jgh9094/Benchmarks | [
"508598ab0354acf0655f6109d347a86b71e11faf"
] | [
"Pilot3/JGH/Data/Code/gather.py"
] | [
"'''\r\nCreated by: Jose Guadalupe Hernandez\r\nEmail: jgh9094@gmail.com\r\n\r\nexport PATH=$HOME/anaconda3/bin:$PATH\r\n\r\nPython file will aggregate\r\n'''\r\n\r\n# general python imports\r\nimport numpy as np\r\nimport argparse\r\nimport pickle as pk\r\nimport psutil\r\n\r\nimport os.path\r\nfrom os import path... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
cutz-j/DL | [
"de425477979cd41ecd82e651a9add8b1ba9ee650"
] | [
"DLp/Assignment1-1[reg].py"
] | [
"# import packages\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom reg_utils import sigmoid, relu, plot_decision_boundary, initialize_parameters, load_2D_dataset, predict_dec\nfrom reg_utils import compute_cost, predict, forward_propagation, backward_propagation, update_parameters\nimport sklearn\nimport... | [
[
"numpy.square",
"numpy.dot",
"numpy.random.rand",
"numpy.matmul",
"numpy.random.seed",
"matplotlib.pyplot.xlabel",
"numpy.sum",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"numpy.int64",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.... |
yashgarg2107/Index-structures-for-k-NN-search | [
"25efa4582de4a933d64ee0ff7a600ce5887ed322"
] | [
"Scripts/prec_100_eval.py"
] | [
"import numpy as np \n\nkdt = np.loadtxt(\"results_kdt.txt\",delimiter=' ')\nlsh = np.loadtxt(\"results_lsh.txt\",delimiter=' ')\nseq = np.loadtxt(\"results_seq.txt\",delimiter=' ')\n\ncount=0\nfor i in range(100):\n\tfor j in range(100):\n\t\tfor k in range(100):\n\t\t\tif(np.array_equal(seq[i*100+j],lsh[i*100+k])... | [
[
"numpy.loadtxt",
"numpy.array_equal"
]
] |
sebastianmattar/LedFx | [
"c087862666c4cbc1eca9e9e1f741ed741c5bae3a"
] | [
"ledfx/devices/FXMatrix.py"
] | [
"from ledfx.devices import Device\nimport logging\nimport voluptuous as vol\nimport numpy as np\nimport socket\n\n_LOGGER = logging.getLogger(__name__)\n\nclass FXMatrix(Device):\n \"\"\"FXMatrix device support\"\"\"\n\n CONFIG_SCHEMA = vol.Schema({\n vol.Required('ip_address', description='Hostname or... | [
[
"numpy.dtype"
]
] |
igormcsouza/serialize-images | [
"2fc567a7eb380c7cb4c92463cbeae663393361cb"
] | [
"tests/test_serialize_images.py"
] | [
"import numpy\n\nfrom serialize_images import __version__\nfrom serialize_images.core import MainArraySerializable\n\n\ndef test_version():\n assert __version__ == '0.1.1'\n\ndef test_core_encode():\n result = MainArraySerializable.encode_to_string(numpy.ndarray([0]))\n print(result)\n assert type(resul... | [
[
"numpy.ndarray"
]
] |
wr1/b3p | [
"3c77a2fda329fa539393188e5045b5fdc91cd8b5"
] | [
"b3p/blade.py"
] | [
"from b3p import splining\nfrom b3p import loft_utils\nfrom b3p import blade_section\n\n\nimport numpy as np\nfrom copy import deepcopy as dc\nfrom matplotlib import pyplot as plt\nimport pickle\nimport math\nimport vtk\n\n\nclass blade:\n def __init__(\n self,\n chord,\n thickness,\n ... | [
[
"numpy.array",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure",
"numpy.interp",
"numpy.radians",
... |
felipessalvatore/vol4life | [
"76add3842007c41f4edcc2bdd449922d6ea708ca"
] | [
"vol4life/stats.py"
] | [
"import numpy as np\nimport scipy as sp\nimport pandas as pd\nfrom scipy import stats\n\n\ndef get_ecdf(series_):\n return lambda x: (series_.sort_values() < x).astype(int).mean()\n\n\ndef get_sample_acvf(x, h):\n \"\"\"\n x: series\n h: shift param\n return: autocovariance estimator\n \"\"\"\n ... | [
[
"numpy.array",
"scipy.stats.norm.ppf",
"pandas.DataFrame",
"scipy.stats.spearmanr",
"numpy.abs",
"numpy.sqrt",
"scipy.stats.norm.cdf",
"scipy.stats.ccf"
]
] |
franp9am/pytorch-lightning | [
"d2aaf6b4cc420a4ef2aa4d1db29a0e881cea9406"
] | [
"pytorch_lightning/callbacks/early_stopping.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.tensor",
"torch.isfinite"
]
] |
lsrock1/slowfast-detection. | [
"70ceb071bbcc90d472f15076fe917f1328a303ef"
] | [
"slowfast/datasets/loader.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\n\"\"\"Data loader.\"\"\"\n\nimport itertools\nimport numpy as np\nimport torch\nfrom torch.utils.data._utils.collate import default_collate\nfrom torch.utils.data.distributed import DistributedSampler\nfrom torch.uti... | [
[
"numpy.concatenate",
"torch.is_tensor",
"torch.utils.data._utils.collate.default_collate",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.utils.data.distributed.DistributedSampler"
]
] |
hansupark/tensorflow-yolov4 | [
"d8b1ceb0049b080e20c70aea37655006021f7ef5"
] | [
"py_src/yolov4/model/neck.py"
] | [
"\"\"\"\nMIT License\n\nCopyright (c) 2020 Hyeonki Hong <hhk7734@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\n... | [
[
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.UpSampling2D"
]
] |
SolarLiner/reconvolve | [
"fbe5419543d0e5fd9b8569714ecc07a78c2e7e51"
] | [
"bin/process.py"
] | [
"from argparse import ArgumentParser, Namespace, FileType\nimport logging\n\nimport numpy as np\nimport scipy.signal as sig\nfrom scipy.io import wavfile\n\nfrom reconvolve.probe import Probe\nfrom . import BaseCommand\n\nlogger = logging.getLogger(__name__)\n\n\nclass ProcessCommand(BaseCommand):\n name = \"pro... | [
[
"numpy.float32",
"scipy.io.wavfile.read"
]
] |
lucho8908/adaptive_template_systems | [
"3e217d151d09e5eed213f927960986854331c148"
] | [
"Examples/Shapes/uli_data_random_forest.py"
] | [
"import numpy as np\r\nimport multidim\r\nimport itertools\r\nimport os\r\nimport hdbscan\r\nimport sys\r\nimport time\r\nimport pandas as pd\r\nimport itertools\r\n\r\nfrom copy import deepcopy\r\nfrom matplotlib.patches import Ellipse\r\nfrom ripser import ripser\r\nfrom persim import plot_diagrams\r\nfrom numba ... | [
[
"numpy.isclose",
"numpy.set_printoptions",
"numpy.mean",
"numpy.where",
"pandas.read_csv",
"numpy.concatenate",
"numpy.log",
"matplotlib.pyplot.subplots",
"numpy.sqrt",
"numpy.column_stack",
"numpy.vstack",
"numpy.array",
"sklearn.ensemble.RandomForestClassifier... |
GT-AcerZhang/PaddlePaddle-Classification | [
"90ff2188aa0501637fe9e36ee9b5fdf57e4ad60a"
] | [
"eval.py"
] | [
"import argparse\nimport time\nimport numpy as np\nimport paddle.fluid as fluid\nfrom utils import utils\nfrom tqdm import tqdm\n\n\ndef parse_args():\n parser = argparse.ArgumentParser()\n parser.add_argument(\"--use_gpu\", type=bool, default=True)\n parser.add_argument(\"--img_size\", type=int, ... | [
[
"numpy.array",
"numpy.expand_dims"
]
] |
ToluClassics/transformers | [
"aa19f478acc8f46b7f70e9c525a2bd07dfed548c"
] | [
"src/transformers/models/sew_d/modeling_sew_d.py"
] | [
"# coding=utf-8\n# Copyright 2021 ASAPP Inc. and the HuggingFace Inc. team. 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/lice... | [
[
"torch.nn.Linear",
"numpy.random.rand",
"torch.stack",
"torch.nn.ModuleList",
"torch.nn.init.kaiming_normal_",
"numpy.tile",
"torch.ones",
"numpy.sign",
"numpy.where",
"torch.nn.functional.pad",
"numpy.broadcast_to",
"torch.nn.CrossEntropyLoss",
"torch.nn.functi... |
eikaramba/segmentation_models.pytorch | [
"7a061d7c73021bfdf881b407817d014de8eea2f0"
] | [
"segmentation_models_pytorch/losses/dice.py"
] | [
"from typing import Optional, List\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.nn.modules.loss import _Loss\nfrom ._functional import soft_dice_score, to_tensor\nfrom .constants import BINARY_MODE, MULTICLASS_MODE, MULTILABEL_MODE\n\n__all__ = [\"DiceLoss\"]\n\n\nclass DiceLoss(_Loss):\n\n def _... | [
[
"torch.nn.functional.one_hot",
"torch.nn.functional.logsigmoid"
]
] |
shlu2019/meta_learning_pacoh | [
"b4c2c37d9715e74542bab556ac1f5d778cc3409c"
] | [
"third_party/neural_processes/neural_process.py"
] | [
"import torch\nfrom third_party.neural_processes.models import Encoder, MuSigmaEncoder, Decoder\nfrom torch import nn\nfrom torch.distributions import Normal\nfrom third_party.neural_processes.utils import img_mask_to_np_input\n\n\nclass NeuralProcess(nn.Module):\n \"\"\"\n Implements Neural Process for funct... | [
[
"torch.distributions.Normal",
"torch.mean"
]
] |
energy-modelling-club/times2spine | [
"12831a78f21a4c696a798aa0990019ff3ea613ac"
] | [
"ImportFunction.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jun 3 16:28:52 2019\n\n@author: Matteo D'Andrea (s180192)\n\"\"\"\n###################### LYBRARIES AND PACKAGES #################################\nimport openpyxl\nimport numpy as np\nimport pandas as pd\n####################################... | [
[
"numpy.reshape"
]
] |
gowthaman25/Image-Noise-Removal-using-CNN | [
"da8141a81281d701b565e17a3d2a186988a99569"
] | [
"Main.py"
] | [
"import numpy as np \nimport glob\nimport cv2\nimport pandas as pd\nimport tensorflow as tf\nimport tensorflow.keras \nfrom keras.models import load_model,Sequential\nfrom keras.layers.advanced_activations import LeakyReLU, PReLU\nfrom keras.optimizers import Adam\nfrom skimage.measure import compare_psnr, compare_... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.load",
"numpy.random.shuffle",
"numpy.save",
"numpy.random.randint",
"numpy.clip"
]
] |
lacostya86/aphantasia | [
"c287ffd30d19ff1b51111143be7c1d3d98bac962"
] | [
"illustra.py"
] | [
"import os\nimport argparse\nimport math\nimport numpy as np\nimport shutil\nfrom imageio import imsave\nfrom googletrans import Translator, constants\n\nimport torch\nimport torchvision\nimport torch.nn.functional as F\n\nimport clip\nos.environ['KMP_DUPLICATE_LIB_OK']='True'\nfrom sentence_transformers import Sen... | [
[
"torch.cosine_similarity",
"torch.optim.AdamW",
"torch.save",
"torch.no_grad",
"torch.cuda.empty_cache",
"torch.load",
"torch.randn",
"torch.clip"
]
] |
ddemaio/pycryptobot | [
"33353c72280816896d3f1e6465e4a5f5ebe64d4b"
] | [
"models/exchange/binance/api.py"
] | [
"from models.exchange.coinbase_pro.api import FREQUENCY_EQUIVALENTS, SUPPORTED_GRANULARITY\nimport math\nimport re\nimport numpy as np\nimport pandas as pd\nimport sys\nfrom datetime import datetime, timedelta\nfrom binance.client import Client\nfrom time import sleep\nfrom models.helper.LogHelper import Logger\n\n... | [
[
"numpy.divide",
"pandas.DataFrame",
"pandas.to_datetime"
]
] |
Aarya-Create/PBL-Mesh | [
"978bcac47b9c925da4caba22d1f64fc254d13916"
] | [
"ctdr/optimize.py"
] | [
"from ctdr.utils import util_vis, util_mesh, render_objs\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nimport time\n# from mesh_intersection.loss import DistanceFieldPenetrationLoss\n\nfrom ctdr.utils import util_vis, util_mesh\n\ndef get_params(model, exclude_mus=False):\n return model.par... | [
[
"torch.cat",
"torch.prod",
"torch.unique",
"torch.cuda.synchronize",
"torch.min",
"torch.max",
"torch.no_grad",
"torch.optim.Adam",
"torch.optim.SGD",
"torch.clamp",
"numpy.mean",
"numpy.arange",
"torch.utils.data.DataLoader",
"torch.log",
"torch.sum"
... |
SteffenMauceri/OWLS-Autonomy | [
"e676282a87e17030887b0174f3b8b38aab170d15"
] | [
"src/helm_dhm/tracker/test/conftest.py"
] | [
"import os\nimport glob\nimport json\nimport pytest\nfrom helm_dhm.tracker import *\n\nimport numpy as np\n\n@pytest.fixture\ndef postprocessors_sample_track():\n test_data = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data', 'sample.track')\n with open(test_data) as f:\n track = json.loa... | [
[
"numpy.random.seed",
"numpy.array",
"numpy.random.rand"
]
] |
mritools/mrrt.mri | [
"00829032f6d19d078a23d006b73f1028b3ec3902"
] | [
"mrrt/mri/operators/tests/test_mri_noncartesian.py"
] | [
"\"\"\"Tests related to Non-Cartesian MRI reconstruction.\"\"\"\nfrom itertools import product\nimport time\n\nimport numpy as np\nfrom numpy.testing import assert_, assert_equal\nimport pytest\n\nfrom mrrt.operators.LinOp import DiagonalOperatorMulti\nfrom mrrt.mri.operators.tests._generate_testdata import generat... | [
[
"numpy.testing.assert_equal",
"matplotlib.pyplot.title",
"numpy.testing.assert_",
"numpy.isscalar",
"numpy.abs"
]
] |
locuslab/DC3 | [
"35437af7f22390e4ed032d9eef90cc525764d26f"
] | [
"baseline_opt.py"
] | [
"try:\n import waitGPU\n waitGPU.wait(utilization=50, memory_ratio=0.5, available_memory=5000, interval=9, nproc=1, ngpu=1)\nexcept ImportError:\n pass\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\ntorch.set_default_dtype(torch.float64)\n\nimport operator\nfrom functools import reduc... | [
[
"numpy.concatenate",
"torch.device",
"torch.is_tensor",
"torch.norm",
"torch.cuda.is_available",
"torch.tensor",
"torch.set_default_dtype"
]
] |
aahouzi/FaceFocus | [
"a864a5f4427938572ea7e9630ccf65c26477ae84"
] | [
"Train/TPU_training.py"
] | [
"############################################################################################\n# Author: Anas AHOUZI #\n# File Name: Train/TPU_training.py #\n# Creat... | [
[
"tensorflow.distribute.MirroredStrategy",
"tensorflow.GradientTape",
"tensorflow.distribute.get_strategy",
"tensorflow.image.psnr",
"tensorflow.keras.metrics.Sum",
"tensorflow.config.experimental_connect_to_cluster",
"tensorflow.map_fn",
"tensorflow.distribute.cluster_resolver.TPUC... |
JTQIN/landlab | [
"08baf1f11eebf99aded071acd786d2c9e44d1f39"
] | [
"landlab/bmi/bmi_bridge.py"
] | [
"\"\"\"\n========================================================================================\nWrap landlab component with the Basic Modeling Interface (:mod:`landlab.bmi.bmi_bridge`)\n========================================================================================\n\n.. sectionauthor:: Eric Hutton\n\nF... | [
[
"numpy.full"
]
] |
royhzq/sg-headlines-rnn | [
"cef84f1ffe7f18a37386e9602166082c10e9020b"
] | [
"app.py"
] | [
"from flask import Flask, request, jsonify\nfrom utils import generate_headlines\nimport tensorflow as tf\nimport json\ntf.enable_eager_execution()\n\nimport numpy as np\n\napp = Flask(__name__)\n\nchar2idx = json.loads(open(\"./data/st_char2idx.txt\", 'br').read().decode(encoding='utf-8'))\nidx2char = np.array(jso... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.enable_eager_execution"
]
] |
jeevan-revaneppa-hirethanad/audio-to-speech-pipeline | [
"a5bd7f0321834507e4157eb1aea8659cd205bf1c"
] | [
"packages/ekstep_data_pipelines/audio_analysis/speaker_analysis/clustering.py"
] | [
"import math\n\nimport hdbscan\nimport numpy as np\nfrom sklearn.metrics.pairwise import cosine_distances\n\n\nclass Clustering:\n def __init__(self):\n pass\n\n def make_partial_sets(self, embeddings, partial_set_size):\n \"\"\"\n Takes all the embeddings and returns a list of partial se... | [
[
"numpy.array",
"sklearn.metrics.pairwise.cosine_distances",
"numpy.linalg.norm",
"numpy.mean"
]
] |
chrisdane/ESMValTool | [
"35e0c2b0dbaa0927a2d677f382b43520633a1a0f"
] | [
"esmvaltool/diag_scripts/ocean/diagnostic_tools.py"
] | [
"\"\"\"\nDiagnostic tools\n================\n\nThis module contains several python tools used elsewhere by the ocean\ndiagnostics package.\n\nThis tool is part of the ocean diagnostic tools package in the ESMValTool.\n\nAuthor: Lee de Mora (PML)\n ledm@pml.ac.uk\n\"\"\"\nimport logging\nimport os\nimport sys\nim... | [
[
"numpy.max",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.plot",
"numpy.min",
"matplotlib.pyplot.gcf"
]
] |
potipot/ultra_light_face | [
"4b8489e2e207cf490549f94de1e35212e846f115"
] | [
"train.py"
] | [
"\"\"\"\nThis code is the main training code.\n\"\"\"\nimport argparse\nimport itertools\nimport logging\nimport os\nimport sys\n\nimport torch\nfrom torch import nn\nfrom torch.optim.lr_scheduler import CosineAnnealingLR, MultiStepLR\nfrom torch.utils.data import DataLoader, ConcatDataset\n\nfrom vision.datasets.v... | [
[
"torch.utils.data.ConcatDataset",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.no_grad",
"torch.optim.SGD",
"torch.optim.Adam",
"torch.cuda.device_count",
"torch.optim.lr_scheduler.MultiStepLR",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.nn.Dat... |
daniel-izmaylov/DialogBERT | [
"24197b55cb9b2647bf336294f3880ec92bf6eedf"
] | [
"main.py"
] | [
"# DialogBERT\n# Copyright 2021-present NAVER Corp.\n# BSD 3-clause\n\n# coding=utf-8\nimport argparse\nimport glob\nimport logging\nimport os\nimport pickle\nimport random\nimport re\nimport shutil\nfrom tqdm import tqdm\nimport numpy as np\nimport torch\n\nimport models, solvers, data_loader\n\nlogger = logging.g... | [
[
"torch.device",
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.distributed.init_process_group",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.cuda.set_device",
"torch.cuda.is_available"
]
] |
simonbatzner/e3nn | [
"9f5e336d5443d26a04d37162c10eb851beb0f5c5"
] | [
"tests/util/test_jit.py"
] | [
"import pytest\nimport warnings\n\nimport torch\n\nfrom e3nn.o3 import Linear, Irreps\nfrom e3nn.util.jit import script, trace_module, compile_mode, compile\nfrom e3nn.util.test import assert_equivariant\n\n\ndef test_submod_tracing():\n \"\"\"Check that tracing actually occurs\"\"\"\n @compile_mode('trace')\... | [
[
"torch.as_tensor",
"torch.jit.script",
"torch.randn"
]
] |
HuanYunXuanZi/tensorfow-rbm | [
"b55460e3fdbf83c2a9278c35cf20c6fed1d4666c"
] | [
"tfrbm/rbm.py"
] | [
"from __future__ import print_function\n\nimport tensorflow as tf\nimport numpy as np\nimport sys\nfrom .util import tf_xavier_init\n\n\nclass RBM:\n def __init__(self,\n n_visible,\n n_hidden,\n learning_rate=0.01,\n momentum=0.95,\n ... | [
[
"tensorflow.zeros",
"tensorflow.acos",
"numpy.zeros",
"tensorflow.Session",
"tensorflow.train.Saver",
"numpy.random.shuffle",
"tensorflow.mul",
"tensorflow.constant",
"tensorflow.placeholder",
"numpy.arange",
"numpy.hstack",
"tensorflow.global_variables_initializer"... |
siddeshpillai/neural-graph | [
"ff4ff603284cad82af5df0dea98807bb7c1b54ff"
] | [
"neural_graph.py"
] | [
"import os\n\nimport numpy as np\nimport scipy.misc\n\nfrom stylize import stylize\n\nimport math\nfrom argparse import ArgumentParser\n\nfrom PIL import Image\n\n# default arguments\nCONTENT_WEIGHT = 5e0\nCONTENT_WEIGHT_BLEND = 1\nSTYLE_WEIGHT = 5e2\nTV_WEIGHT = 1e2\nSTYLE_LAYER_WEIGHT_EXP = 1\nLEARNING_RATE = 1e1... | [
[
"numpy.dstack",
"numpy.zeros",
"numpy.clip"
]
] |
cabustillo13/Jugando-con-Python | [
"a02f67531426a8ca819f91317445c567e7094546"
] | [
"juego2.py"
] | [
"import cv2\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n# Imagen a analizar\nimagenColor = cv2.imread('./Recursos/juego2/photo0.png')\nimagenGris = cv2.cvtColor(imagenColor, cv2.COLOR_BGR2GRAY)\n\ncont=0 #Cantidad de rectangulos\ntol=10 #Tolerancia para evitar duplicado en el conteo de r... | [
[
"numpy.where"
]
] |
smoosavioon/saeedconnect4 | [
"8fa002119317e7d684a1c959b4e5c0cd906d060a"
] | [
"agents/common.py"
] | [
"import numpy as np\nfrom enum import Enum\nfrom typing import Optional\nfrom typing import Callable, Tuple\nfrom numba import njit\n\n\nBoardPiece = np.int8 # The data type (dtype) of the board\nNO_PLAYER = BoardPiece(0) # board[i, j] == NO_PLAYER where the position is empty\nPLAYER1 = BoardPiece(1) # board[i, ... | [
[
"numpy.zeros",
"numpy.flipud",
"numpy.where",
"numpy.all",
"numpy.diag"
]
] |
TahaEntezari/ramstk | [
"f82e5b31ef5c4e33cc02252263247b99a9abe129"
] | [
"tests/analyses/statistics/weibull_unit_test.py"
] | [
"# pylint: skip-file\n# type: ignore\n# -*- coding: utf-8 -*-\n#\n# tests.analyses.statistics.weibull_unit_test.py is part of The RAMSTK Project\n#\n# All rights reserved.\n# Copyright since 2007 Doyle \"weibullguy\" Rowland doyle.rowland <AT> reliaqual <DOT> com\n\"\"\"Test class for the Exponential distribu... | [
[
"numpy.array"
]
] |
micbru/montepython_public | [
"d8a90553f327bc67a45eaad21338681d0c34c29f"
] | [
"montepython/nested_sampling.py"
] | [
"\"\"\"\n.. module:: nested_sampling\n :synopsis: Interface the MultiNest program with Monte Python\n\nThis implementation relies heavily on the existing Python wrapper for\nMultiNest, called PyMultinest, written by Johannes Buchner, and available `at\nthis address <https://github.com/JohannesBuchner/PyMultiNest... | [
[
"numpy.loadtxt"
]
] |
SamyTahar/CarND-Capstone | [
"c92238c0e36501729402d7a8644c12cc3859988f"
] | [
"ros/src/tl_detector/light_classification/tl_classifier.py"
] | [
"from styx_msgs.msg import TrafficLight\nimport tensorflow as tf\nimport numpy as np\nimport datetime\nimport rospy\n\n\nclass TLClassifier(object):\n def __init__(self, is_sim):\n #TODO load classifier\n\n if is_sim is False:\n PATH_TO_GRAPH = r'light_classification/models/sim/frozen_in... | [
[
"numpy.asarray",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.GraphDef",
"tensorflow.import_graph_def",
"tensorflow.gfile.GFile",
"numpy.squeeze"
]
] |
mkkb/vispy | [
"8540f8d96fe3af84ba80bde6d6bf55484eaa8e3a"
] | [
"vispy/visuals/image.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright (c) Vispy Development Team. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\nfrom __future__ import division\n\nimport numpy as np\n\nfrom ..gloo import Texture2D, VertexBuffer\nfrom ..color import get_colormap\nfrom .shaders im... | [
[
"numpy.max",
"numpy.array",
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"numpy.ascontiguousarray",
"numpy.min"
]
] |
Yuriowindiatmoko2401/Xpersona | [
"3f5ccb183e3cfa755dea2dd2afd9abbf1a0f93b8"
] | [
"multilingual/transformers/file_utils.py"
] | [
"\"\"\"\nUtilities for working with the local dataset cache.\nThis file is adapted from the AllenNLP library at https://github.com/allenai/allennlp\nCopyright by the AllenNLP authors.\n\"\"\"\nfrom __future__ import (absolute_import, division, print_function, unicode_literals)\n\nimport sys\nimport json\nimport log... | [
[
"torch.hub._get_torch_home"
]
] |
rezaghoddoosian/Hierarchical-Task-Modeling | [
"b338b21547de11880d4345cb2bfdc5b44a37299d"
] | [
"train.py"
] | [
"import torch\r\nimport torch.nn.functional as F\r\nimport torch.optim as optim\r\nfrom video_dataset import Dataset\r\nfrom tensorboard_logger import log_value\r\nimport utils\r\nimport numpy as np\r\nfrom torch.autograd import Variable\r\nimport time\r\ntorch.set_default_tensor_type('torch.cuda.FloatTensor')\r\n\... | [
[
"numpy.max",
"torch.autograd.Variable",
"torch.set_default_tensor_type",
"torch.nn.functional.log_softmax",
"torch.from_numpy",
"numpy.abs",
"torch.Tensor"
]
] |
v-liuwei/USTC-2021Spring-Introduction_to_Deep_Learning_labs- | [
"92815244520001f01deed334d066a4e087f7a959"
] | [
"exp3/src/utils.py"
] | [
"import torch\nimport random\nimport os\nimport numpy as np\n\n\ndef binary_acc(preds, label):\n preds = torch.round(preds)\n correct = torch.eq(preds, label).float()\n acc = correct.sum() / correct.shape[0]\n return acc\n\n\ndef set_seed(seed=123):\n random.seed(seed)\n np.random.seed(seed)\n ... | [
[
"torch.round",
"torch.cuda.manual_seed_all",
"torch.eq",
"numpy.random.seed",
"torch.manual_seed"
]
] |
Atharva-Phatak/Is-That-A-Melanoma | [
"2327f05d0268cacab513890a8d7c4e6219bf54c7"
] | [
"dataset.py"
] | [
"import torch\nimport torch.nn as nn\n\nfrom PIL import Image\n\nclass MelanomaDataset(torch.utils.data.Dataset):\n\n '''This class retrieves the image and corresponding label for the image.\n Args:\n df : The dataframe which contains the image name and the label.\n path : The path wh... | [
[
"torch.tensor"
]
] |
MCW9/ImageForensics | [
"0e1fc7b992832b222a57ecfb2446fc6cf159baad"
] | [
"train.py"
] | [
"# Marcelo Cicconet, Oct 2017\n\nfrom scipy import misc\nimport numpy as np\nimport tensorflow as tf\nimport random\nimport matplotlib.pyplot as plt\nimport sys\nfrom image_distortions import *\nimport time\n\nwith tf.device('/gpu:0'):\n # --------------------------------------------------\n print('setup para... | [
[
"numpy.concatenate",
"numpy.random.rand",
"numpy.zeros",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.plot",
"tensorflow.train.Saver",
"numpy.min",
"numpy.random.shuffle",
"numpy.ones",
"scipy.misc.imread",
"tensorflow.ConfigProto",
"numpy.arange",
"matplotlib.py... |
Afellman/hospital-chargemaster | [
"b3473c798fd2f343f7f02c1e32496f9eea9fa94d"
] | [
"data/oshpd-ca/parse.py"
] | [
"#!/usr/bin/env python\n\nimport os\nfrom glob import glob\nimport json\nimport pandas\nimport datetime\n\n# This is a challenging dataset because it's so big!\n# We will do our best to break the data into pieces\n\nhere = os.path.dirname(os.path.abspath(__file__))\nfolder = os.path.basename(here)\nlatest = '%s/lat... | [
[
"pandas.isnull",
"pandas.DataFrame",
"pandas.read_excel"
]
] |
lobachevzky/hsr | [
"b8c40b82c0d39fedc8f64cb50734620a0b2d84ab"
] | [
"baselines/ddpg/main.py"
] | [
"import argparse\nimport time\nimport os\nimport logging\nfrom baselines import logger, bench\nfrom baselines.common.misc_util import (\n set_global_seeds,\n boolean_flag,\n)\nimport baselines.ddpg.training as training\nfrom baselines.ddpg.models import Actor, Critic\nfrom baselines.ddpg.memory import Memory\... | [
[
"tensorflow.reset_default_graph"
]
] |
cap-michaili/Detectron.pytorch | [
"f49cd51c12ff5c8c3dd3264352116266aa3d7d85"
] | [
"lib/roi_data/retinanet.py"
] | [
"# Copyright (c) 2017-present, Facebook, 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 applicabl... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.empty",
"numpy.zeros",
"numpy.round",
"numpy.where",
"numpy.arange",
"numpy.log2"
]
] |
ianhi/ipympl-interactions | [
"9c48292d5c5931cd136da25961729858b7846abb"
] | [
"mpl_interactions/pyplot.py"
] | [
"\"\"\"Control the output of standard plotting functions such as :func:`~matplotlib.pyplot.plot` and\n:func:`~matplotlib.pyplot.hist` using sliders and other widgets. When using the ``ipympl`` backend\nthese functions will leverage ipywidgets for the controls, otherwise they will use the built-in\nMatplotlib widget... | [
[
"numpy.histogram",
"numpy.column_stack",
"matplotlib.colors.to_rgba_array",
"matplotlib.patches.Rectangle",
"matplotlib.markers.MarkerStyle",
"matplotlib.collections.PatchCollection",
"numpy.asanyarray"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.