repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
kingqiuol/pytorch-template | [
"8bc78f996fbbc15ae54a3055cd3d33199b4a96d8"
] | [
"utils/metric.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2022/1/12 13:55\n# @Author : jinqiu\n# @Site : \n# @File : metric.py\n# @Software: PyCharm\n\nimport time\nimport torch\n\nfrom scipy import interp\nfrom itertools import cycle\n\nimport torch.nn as nn\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom thop import profile... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.step",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.plot",
"torch.no_grad",
"numpy.zeros_like",
"torch.randn",
"sklearn.metrics.precision_recall_curve",
"matplotlib.pyplot.figure",
"mat... |
Mad97dong/supp-deep-decoder | [
"7727df8bb8e13a71aca982d47859a32eb4affd5d"
] | [
"include/decoder.py"
] | [
"import torch\nimport torch.nn as nn\n\ndef add_module(self, module):\n self.add_module(str(len(self) + 1), module)\n\ntorch.nn.Module.add = add_module\n\n\ndef conv(in_f, out_f, kernel_size, stride=1, pad='zero'):\n padder = None\n to_pad = int((kernel_size - 1) / 2)\n if pad == 'reflection':\n ... | [
[
"torch.nn.Sequential",
"torch.nn.ReflectionPad2d",
"torch.nn.Conv2d",
"torch.nn.Sigmoid",
"torch.nn.Upsample",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
linamnt/dnn-neurogenesis | [
"bd3a437592e257d9d27ede59057aab85b0566c54",
"bd3a437592e257d9d27ede59057aab85b0566c54"
] | [
"cc_scripts/mnist-additive-growth.py",
"cc_scripts/mnist-targeted.py"
] | [
"# imports\nimport neurodl.mlp as mlp\nimport numpy as np\nimport pandas as pd\nimport torch.nn as nn\nimport torch.optim as optim\nfrom datetime import datetime\nimport torch\nimport argparse\nimport copy\n\n# file management\nimport os\nfrom shutil import copyfile\nfrom pathlib import Path\n\ntorch.manual_seed(23... | [
[
"torch.manual_seed",
"torch.nn.NLLLoss",
"torch.cuda.is_available"
],
[
"torch.manual_seed",
"torch.nn.NLLLoss",
"torch.cuda.is_available"
]
] |
alessiobonfiglio/pytorch-lightning | [
"5b30a659524eb5518e36f714525da5705c7bf414"
] | [
"pytorch_lightning/plugins/training_type/training_type_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.cuda.empty_cache"
]
] |
felixdittrich92/numerisches_python | [
"0f895ee19b4fa3cf7ad38cd3dfe3cd7020ee34a7"
] | [
"02_Arrays_in_Numpy/5.2_Shape.py"
] | [
"import numpy as np\n\nx = np.array([[45, 43, 67],\n [45, 18, 42],\n [36, 78, 99],\n [33, 55, 77],\n [21, 36, 77],\n [46, 98, 102]])\n\nprint(x.shape)\nprint(\"---------------------\")\n\n# Shape ändern\nx.shape = (3, 6)\nprint(x)\nprint(\"-----------... | [
[
"numpy.array"
]
] |
unconst/SimpleWord2Vec | [
"d1af6993c1d6bca273a0c8d147132ee9867f5543"
] | [
"visualizer/TBLogger.py"
] | [
"import tensorflow as tf\n\nclass TBLogger(object):\n \"\"\"Logging in tensorboard without tensorflow ops.\"\"\"\n\n def __init__(self, log_dir):\n \"\"\"Creates a summary writer logging to log_dir.\"\"\"\n self.writer = tf.compat.v1.summary.FileWriter(log_dir)\n\n def log_scalar(self, tag, v... | [
[
"tensorflow.compat.v1.summary.FileWriter",
"tensorflow.compat.v1.Summary.Value",
"tensorflow.HistogramProto",
"tensorflow.compat.v1.Summary"
]
] |
dmgav/nslsii | [
"9cd77e0aa24d59fddf534948b9b97dacb0832ed2"
] | [
"nslsii/tests/test_kafka_publisher.py"
] | [
"from functools import partial\nimport multiprocessing\nimport queue\nimport time\n\nimport msgpack\nimport msgpack_numpy as mpn\nimport numpy as np\nimport pytest\n\nfrom bluesky.plans import count\nfrom bluesky_kafka import RemoteDispatcher\nfrom event_model import RunRouter, sanitize_doc\nimport nslsii\n\n\n@pyt... | [
[
"numpy.array",
"numpy.float64",
"numpy.ones"
]
] |
rajan-blackboxes/GAN | [
"ea4bcd3a68c14007ccc395847ac55ab86c0f5c82"
] | [
"dlnd_face_generation_project/run.py"
] | [
"from model import D, G\nfrom tqdm.autonotebook import tqdm\nfrom torchvision.utils import make_grid\nimport torch\nimport imageio\nimport numpy as np\nfrom argparse import ArgumentParser\n\ncheck_gpu = torch.cuda.is_available()\nweight_path = 'weights/G.pth'\n\nG.load_state_dict(torch.load(weight_path, map_locatio... | [
[
"numpy.min",
"torch.load",
"numpy.max",
"torch.no_grad",
"torch.cuda.is_available",
"torch.device",
"numpy.random.uniform",
"torch.as_tensor"
]
] |
shahules786/torch-audiomentations | [
"ade8b6124a5e5868e046050e5d6b7869bf3a6cfb"
] | [
"torch_audiomentations/utils/dsp.py"
] | [
"import torch\n\n\ndef calculate_rms(samples):\n \"\"\"\n Calculates the root mean square.\n\n Based on https://github.com/iver56/audiomentations/blob/master/audiomentations/core/utils.py\n \"\"\"\n return torch.sqrt(torch.mean(torch.square(samples), dim=-1, keepdim=False))\n\n\ndef calculate_desired... | [
[
"torch.log10",
"torch.square"
]
] |
STEllAR-GROUP/keras | [
"21c69c1dcc2080c17c241c54d50ea20881e70df0"
] | [
"tests/keras/backend/backend_test.py"
] | [
"import pytest\nfrom numpy.testing import assert_allclose\nimport numpy as np\nimport scipy.sparse as sparse\nimport warnings\n\nfrom keras import backend as K\nfrom keras.utils.conv_utils import convert_kernel\nfrom keras.backend import numpy_backend as KNP\n\n\ntry:\n from keras.backend import cntk_backend as ... | [
[
"numpy.asarray",
"numpy.all",
"numpy.max",
"numpy.random.randn",
"numpy.mean",
"numpy.exp",
"numpy.random.randint",
"numpy.allclose",
"numpy.arange",
"numpy.std",
"numpy.zeros",
"numpy.random.choice",
"numpy.min",
"numpy.random.rand",
"numpy.testing.asse... |
JlsBssmnn/ALiPy | [
"57f5a1e4c0252436ecf2572da6973d054807add5"
] | [
"alipy/data_manipulate/datapreprocess.py"
] | [
"'''\nData Preprocess\n'''\n# Authors: Guo-Xiang Li\n# License: BSD 3 clause\n\nfrom __future__ import division\nimport numpy as np\nfrom scipy import sparse\n\n__all__ = [\n 'minmax_scale',\n 'StandardScale'\n]\n\n\ndef _handle_zeros_in_scale(scale, copy=True):\n ''' Makes sure that whenever scale is zero... | [
[
"numpy.nanmax",
"scipy.sparse.issparse",
"numpy.asarray",
"numpy.nanmin",
"numpy.isscalar"
]
] |
ng390/datasets | [
"32435918035a02f6a968d18042c60c417db7cc1d"
] | [
"tensorflow_datasets/testing/test_utils.py"
] | [
"# coding=utf-8\n# Copyright 2020 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.executing_eagerly",
"tensorflow.compat.v2.test.main",
"tensorflow.compat.v2.io.gfile.GFile",
"tensorflow.compat.v2.enable_v2_behavior",
"tensorflow.compat.v2.io.gfile.exists",
"tensorflow.compat.v2.io.gfile.makedirs",
"numpy.ones",
"tensorflow.compat.v2.Graph"... |
William9923/IF4072-SentimentClassification | [
"5e22a6da418056955243c310bab0382e4683b781"
] | [
"evaluate.py"
] | [
"import numpy as np\nimport pandas as pd \npd.options.mode.chained_assignment = None\nfrom src.utility.config import Config, Option\nfrom pipeline import SentimentAnalyzer\n\nevaluate_exp_name = \"exp-p1-2.1\"\nevaluate_fe_option = \"bert\"\nevaluate_clf_option = \"bert\"\nconfig = Config(evaluate_exp_name)\noption... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
DataCanvasIO/HyperTS | [
"b2560daf8f08748691e7bd9efd14cc5f881186a3"
] | [
"hyperts/framework/dl/layers/_layers.py"
] | [
"from hyperts.utils import consts\nfrom collections import OrderedDict\n\nimport tensorflow as tf\nfrom tensorflow.keras import layers\nfrom tensorflow.keras import models\nimport tensorflow.keras.backend as K\n\nfrom hypernets.utils import logging\n\nlogger = logging.get_logger(__name__)\n\n\nclass MultiColEmbeddi... | [
[
"tensorflow.concat",
"tensorflow.reduce_sum",
"tensorflow.keras.layers.GlobalAveragePooling1D",
"tensorflow.cast",
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.backend.permute_dimensions",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.layers.Embedding",
"tenso... |
mkingopng/game_theory | [
"a7027e490d745d9e793155205666a85cd0e5dde4"
] | [
"hotelling's_beach_4.py"
] | [
"\"\"\"\n\n\"\"\"\nfrom scipy.stats import norm\nfrom matplotlib import pyplot\nimport numpy as np\n\n\npyplot.hist(norm.rvs(loc=1, scale=0.5, size=10000), bins=30, alpha=0.5, label='norm_1')\npyplot.hist(norm.rvs(loc=5, scale=0.5, size=10000), bins=30, alpha=0.5, label='norm_2')\npyplot.legend()\npyplot.show()\n\n... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show",
"scipy.stats.norm.rvs"
]
] |
KopfKrieg/ReinLife | [
"560e1495319e2b68d74285a60007cde6c1a27a18"
] | [
"ReinLife/World/environment.py"
] | [
"import random\nimport copy\nfrom typing import List, Type, Union, Collection, Tuple\nimport numpy as np\n\n# Custom packages\nfrom .entities import Agent, Empty, Food, Poison, SuperFood, Entity\nfrom .grid import Grid\nfrom .utils import Actions, EntityTypes\nfrom ReinLife.Helpers.tracker import Tracker\nfrom Rein... | [
[
"numpy.random.random",
"numpy.unique",
"numpy.vectorize",
"numpy.argmin",
"numpy.argmax",
"numpy.array",
"numpy.where"
]
] |
Kaori223/Week3_2 | [
"55cf63c6fa1cd7ebf6141ee9e4e89b2cf1f97ced"
] | [
"api/api.py"
] | [
"import flask\nfrom flask import request, jsonify\nimport numpy\nimport json\nimport sys\nimport pandas as pd\nfrom sklearn.decomposition import PCA\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.externals import joblib\napp = flask.Flask(__name_... | [
[
"sklearn.externals.joblib.load",
"pandas.DataFrame"
]
] |
Zakode/QT | [
"dce14d9d0d8f3cf28bf5adf346c0050dd2655943"
] | [
"Ecemple 0 : Skeleton QTAPP.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport sys\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n#Importar aquí las librerías a utilizar\n\nfrom PyQt5 import uic, QtWidgets\n\nqtCreatorFile = \"appandas.ui\" #Aquí va el nombre de tu archivo\n\nUi_MainWindow, QtBaseClass = uic.loadUiType(qtCre... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
]
] |
modichirag/hmc | [
"e7c7931e999d0ffdee506662d0f095efdc7dc152",
"e7c7931e999d0ffdee506662d0f095efdc7dc152"
] | [
"scripts/test_adaptive.py",
"scripts/deprecated/funnelpool2step.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport time\nimport sys, os\nfrom mpi4py import MPI\n\ncomm = MPI.COMM_WORLD\nrank = comm.Get_rank()\nsize = comm.Get_size()\n\n\nfrom adaptivehmc import AdHMC\nfrom pyhmc import PyHMC, PyHMC_multistep\nimport diagnostics as dg\nimport pystan\n\nimport argparse... | [
[
"numpy.save",
"numpy.concatenate",
"numpy.random.uniform",
"numpy.load",
"numpy.array"
],
[
"numpy.random.uniform",
"numpy.array",
"numpy.save"
]
] |
ksajan/Classification-of-TB | [
"894a0658c6ab780c08494112272c754f9f6a39c6"
] | [
"scripts/inception_preprocessing.py"
] | [
"# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.image.random_contrast",
"tensorflow.equal",
"tensorflow.image.random_saturation",
"tensorflow.image.central_crop",
"tensorflow.image.random_hue",
"tensorflow.image.random_flip_left_right",
"tensorflow.summary.image",
"tensorflow.squeeze",
"tensorflow.subtract",
... |
anirudhacharya/Theano-PyMC | [
"55f54243cf88397b032ebc7121d1090ee91aea7d",
"55f54243cf88397b032ebc7121d1090ee91aea7d"
] | [
"tests/compile/test_shared.py",
"tests/tensor/utils.py"
] | [
"import numpy as np\nimport pytest\n\nimport aesara.tensor\nfrom aesara.compile.sharedvalue import SharedVariable, generic, shared\nfrom aesara.configdefaults import config\nfrom aesara.misc.safe_asarray import _asarray\nfrom aesara.tensor.type import (\n TensorType,\n bscalar,\n bvector,\n dscalar,\n ... | [
[
"numpy.asarray",
"numpy.int32",
"numpy.int8",
"numpy.int16",
"numpy.ones",
"numpy.int64",
"numpy.random.rand",
"numpy.float64",
"numpy.float32",
"numpy.zeros",
"numpy.float"
],
[
"numpy.complex128",
"numpy.true_divide",
"numpy.abs",
"numpy.allclose",... |
rganti/Optimal_Protocols_bnAbs | [
"2b24325cd33749bbfaaadedd5c41b418ae55dc1d"
] | [
"src/data/simulation_setup.py"
] | [
"import numpy as np\n\nfrom src.data.ssc_setup import BnabModel\n\n\nclass BnabGillespie(object):\n\n def __init__(self, p_ini, parameters):\n\n self.p_ini = p_ini\n self.len_ini = len(self.p_ini) + 1\n self.vars = ['N{0}'.format(i) for i in range(self.len_ini)]\n\n self.bnab = BnabMo... | [
[
"numpy.zeros"
]
] |
zerowfz/incubator-tvm | [
"0e63873298839f2740c247f1f470243fcf25a1ae"
] | [
"tutorials/get_started/relay_quick_start.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.random.uniform"
]
] |
LuizNovais/TCC | [
"f256b42dbc9a9606b9d9c3838560f72943e8c2dd"
] | [
"detect_mask_video_v4.py"
] | [
"# USAGE\r\n# python detect_mask_video.py\r\n\r\n# import the necessary packages\r\nfrom tensorflow.keras.applications.mobilenet_v2 import preprocess_input\r\nfrom tensorflow.keras.preprocessing.image import img_to_array\r\nfrom tensorflow.keras.models import load_model\r\nfrom imutils.video import VideoStream\r\nf... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.keras.applications.mobilenet_v2.preprocess_input",
"numpy.array",
"tensorflow.keras.preprocessing.image.img_to_array"
]
] |
vevurka/mt-lob | [
"70989bcb61f4cfa7884437e1cff2db2454b3ceff"
] | [
"gdf_pca/gdf_pca_gru_simple.py"
] | [
"import functools\nimport logging\nimport os\nimport sys\n\nimport numpy as np\nimport pandas as pd\n\nfrom lob_data_utils import gdf_pca, stocks_numbers\nfrom numpy.random import seed\n\nseed(1)\n\nlogger = logging.getLogger(__name__)\n\n\ndef as_keras_metric(method):\n import tensorflow as tf\n from keras i... | [
[
"pandas.read_csv",
"tensorflow.local_variables_initializer",
"tensorflow.control_dependencies",
"numpy.random.seed",
"tensorflow.identity",
"pandas.DataFrame",
"numpy.any"
]
] |
mrdoer/code_test | [
"d547b11e46260f19fbde68b8c47a0c2199fe460f"
] | [
"code/vot_SiamRPN.py"
] | [
"# --------------------------------------------------------\r\n# DaSiamRPN\r\n# Licensed under The MIT License\r\n# Written by Qiang Wang (wangqiang2015 at ia.ac.cn)\r\n# --------------------------------------------------------\r\n#!/usr/bin/python\r\n\r\nimport vot\r\nfrom vot import Rectangle\r\nimport sys\r\nimp... | [
[
"numpy.array",
"torch.FloatTensor",
"torch.load"
]
] |
ramosmy/DiverseBranchBlock | [
"cd627d5089eaa25dedaa258b189fde508586a2f7"
] | [
"diversebranchblock.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom dbb_transforms import *\n\ndef conv_bn(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1,\n padding_mode='zeros'):\n conv_layer = nn.Conv2d(in_channels=in_channels, out_channels=out_chann... | [
[
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.sqrt",
"torch.nn.functional.conv2d",
"torch.nn.Conv2d",
"torch.from_numpy",
"torch.nn.Identity",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.init.zeros_",
"torch.nn.functional.pad"
]
] |
ketsu-shan/slp | [
"6ab50bb562d3290097ef75995af43ed60e7dc507"
] | [
"grad-cam.py"
] | [
"import torch\nimport matplotlib.pyplot as plt\nfrom torch.autograd import Function\nfrom torchvision import models\nfrom torchvision import utils\nimport cv2\nimport sys\nsys.path.append('..')\nfrom collections import OrderedDict\nimport numpy as np\nfrom torch.autograd import Variable\nimport argparse\nimport os\... | [
[
"numpy.maximum",
"torch.load",
"numpy.min",
"numpy.uint8",
"torch.sum",
"torch.from_numpy",
"torch.unsqueeze",
"numpy.max",
"numpy.mean",
"numpy.float32",
"numpy.transpose",
"torch.cuda.is_available",
"numpy.load",
"torch.clamp",
"numpy.zeros"
]
] |
ae77em/7526-tp-grupal-2c2018 | [
"2ed236031c74c87e1ea3c9176c02819c5d5b1738",
"2ed236031c74c87e1ea3c9176c02819c5d5b1738"
] | [
"tp2/respuesta3b.py",
"tp2/respuesta2.py"
] | [
"\"\"\"\nPunto 3b\n\n\"\"\"\nfrom scipy.integrate import odeint\nfrom scipy import arange\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib.pyplot import figure\nfrom matplotlib.pyplot import show\nimport sympy\n\ndef f(x,y):\n return x * 0.5 + y\n\ndef g(x, y):\n return y - x * 0.5\n\ndef h(x,y,z):\n... | [
[
"matplotlib.pyplot.show",
"scipy.integrate.odeint",
"scipy.arange",
"matplotlib.pyplot.figure"
],
[
"numpy.matrix",
"numpy.dot",
"numpy.linalg.solve",
"matplotlib.pyplot.title",
"numpy.random.choice",
"numpy.arange",
"numpy.eye",
"numpy.ones",
"matplotlib.py... |
harrison-caudill/ipo-sim | [
"b60a30adba1979a70f856c4db4495f79d8bf0a59"
] | [
"standalone/rsu_election_combos_bdawes.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"Generates a graph called graph.py, where bar = % of all RSUs sold and \nX-axis labels = indices within vested_quants which were chosen as 'sell_to_cover'\"\"\"\n\n__author__ = \"Ben Dawes\"\n\nimport itertools\nvested_quants = [...]\nwithholding = ...\ntotal = sum(vested_quants)\nsal... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.rcdefaults",
"matplotlib.pyplot.ylabel"
]
] |
globaevg/incubator-superset | [
"47b5780c5cd333cea3610028a1b5eecb11b0b791"
] | [
"superset/views/core.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"pandas.DataFrame.from_records"
]
] |
oprecomp/HLS_BLSTM | [
"3c8bd95b454670588783d8e0fd7315384325aba3"
] | [
"scripts/img2txt.py"
] | [
"import os\nimport numpy as np\nfrom PIL import Image\n\nPADDING = 16\nMIN_CLIP = -1.75\nMAX_CLIP = 3.75\n\nimg = Image.open('/tools/projects/LSTM-PYNQ/notebooks/Fraktur_images/010001.raw.lnrm.png').convert('L')\ninput_data = np.array(img.getdata())\n\ninput_data = input_data * 1.0 / np.amax(input_data)\ninput_data... | [
[
"numpy.savetxt",
"numpy.std",
"numpy.mean",
"numpy.amax"
]
] |
jfc43/eval-transductive-robustness | [
"91aea64cc69be1e3f4d14f94de9ff976c8c307df"
] | [
"TADV/eval_static.py"
] | [
"import argparse\nimport logging\nimport os\nimport numpy as np\nimport torch\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader, TensorDataset\nfrom torchvision import transforms\nfrom torchvision import datasets\nimport utils.torch\nimport utils.numpy\nimport models\nimport json\nfrom autoattac... | [
[
"torch.Tensor",
"torch.utils.data.TensorDataset",
"torch.utils.data.DataLoader",
"torch.no_grad",
"numpy.array"
]
] |
CSCI599-Lim-Squad/clothesGAN | [
"909c14d3074f242efd88c903d740b807c440b846"
] | [
"train_skin.py"
] | [
"import tensorflow as tf\nimport numpy as np\nfrom model_skin import CycleGAN\nfrom reader import Reader\nfrom datetime import datetime\nimport os\nimport logging\nfrom utils import ImagePool\n\nFLAGS = tf.flags.FLAGS\n\ntf.flags.DEFINE_integer('batch_size', 1, 'batch size, default: 1')\ntf.flags.DEFINE_integer('im... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.Graph",
"tensorflow.summary.FileWriter",
"tensorflow.train.latest_checkpoint",
"tensorflow.flags.DEFINE_string",
"tensorflow.train.start_queue_runners",
"tensorflow.train.Coordinator",
"tensorflow.train.import_meta_graph",
"n... |
georgehaan/akshare | [
"8d5112cf4fe8eaf647108a4421b360f6454c8f28"
] | [
"akshare/stock_feature/stock_board_industry_ths.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\"\"\"\nDate: 2022/5/29 19:48\nDesc: 同花顺-板块-行业板块\nhttp://q.10jqka.com.cn/thshy/\n\"\"\"\nfrom datetime import datetime\nfrom functools import lru_cache\n\nimport pandas as pd\nimport requests\nfrom bs4 import BeautifulSoup\nfrom py_mini_racer import py_mini_racer\nfro... | [
[
"pandas.concat",
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.read_html",
"pandas.DataFrame.from_dict",
"pandas.to_numeric"
]
] |
Mind-the-Pineapple/Autoregressive-models | [
"34880e294b0999ddae77965f1f1b18528a7c5add"
] | [
"WIP/train_cifar10_with_VQEMA.py"
] | [
"\"\"\"\n\nRefs:\nhttps://github.com/deepmind/sonnet/blob/master/sonnet/examples/vqvae_example.ipynb\nhttps://github.com/deepmind/sonnet/blob/master/sonnet/python/modules/nets/vqvae.py\nhttps://github.com/rstudio/keras/blob/master/vignettes/examples/vq_vae.R\nhttps://blogs.rstudio.com/tensorflow/posts/2019-01-24-vq... | [
[
"tensorflow.reduce_sum",
"tensorflow.keras.layers.Conv2DTranspose",
"numpy.mean",
"numpy.var",
"tensorflow.random.set_seed",
"tensorflow.python.training.moving_averages.assign_moving_average",
"tensorflow.keras.layers.Conv2D",
"tensorflow.stop_gradient",
"matplotlib.pyplot.axis... |
cattidea/Paddle | [
"3800f192b9b348facfaec7b89867e613e7c01922"
] | [
"python/paddle/tensor/math.py"
] | [
"# Copyright (c) 2020 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.iinfo",
"numpy.finfo"
]
] |
us4useu/ius-2021-gpu-short-course | [
"195fe8798c3a4867d34c4462e938852c36387a38"
] | [
"utils/gpu_short_course/flow_imaging.py"
] | [
"import numpy as np\nimport cupy as cp\nimport math\nimport scipy.signal as signal\nimport matplotlib.pyplot as plt\nfrom scipy.io import loadmat\nimport pickle\nfrom cupyx.scipy import fftpack\nimport cupyx.scipy.ndimage\nfrom matplotlib import animation\n\n\ndef dB(data, mx=1):\n return 20*np.log10(data/mx)\n\... | [
[
"numpy.nanmax",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.tight_layout",
"numpy.abs",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.colorbar",
"numpy.copy",
"scipy.signal.butter",
"numpy.log10",
"matplotlib.animation.FuncAnimation",
... |
rlorigro/pileupGenerator | [
"2e9d663765f57f6e052dd9176da093efd9027c73"
] | [
"src/MultiDecoder.py"
] | [
"import numpy\nfrom PIL import Image\nimport os\n\nclass Decoder:\n def __init__(self,summaryFilename,localPath=None):\n self.summaryFile = summaryFilename\n self.localPath = localPath\n\n # matches\n self.decodeToSNPMap = ['M', 'A', 'C', 'G', 'T', 'I', 'D', '_']\n self.decodeT... | [
[
"numpy.reshape",
"numpy.load",
"numpy.sum"
]
] |
jcf94/FlexTensor | [
"72501488089e7a5674243ca8f0ebb311c743d8a1"
] | [
"flextensor/optimize/optimize_norm.py"
] | [
"import os\nimport sys\nimport argparse\nimport time\nimport json\nimport torch\nimport tvm\nimport numpy as np\nfrom tvm import rpc\nfrom flextensor.utils import Config, RpcInfo\nfrom flextensor.task import Task, TASK_TABLE\nfrom flextensor.scheduler import schedule, schedule_with_config\nfrom flextensor.measure i... | [
[
"numpy.random.uniform"
]
] |
iCGY96/Depth-Estimation | [
"71a736c5380db0ab30ad2b8aff6400fd9f73cac7"
] | [
"depthmodel/average_gradients.py"
] | [
"# Copyright 2018 CGY. All Rights Reserved.\n\nfrom __future__ import absolute_import, division, print_function\nimport tensorflow as tf\n\ndef average_gradients(tower_grads):\n\n average_grads = []\n for grad_and_vars in zip(*tower_grads):\n # Note that each grad_and_vars looks like the following:\n # ... | [
[
"tensorflow.concat",
"tensorflow.expand_dims",
"tensorflow.reduce_mean"
]
] |
Qinbf/Detecting | [
"186365da419312dcf080fe6a34768907da6490a3",
"186365da419312dcf080fe6a34768907da6490a3"
] | [
"detecting/models/rpn_heads/rpn_head.py",
"detecting/datasets/transforms.py"
] | [
"import tensorflow as tf\nlayers = tf.keras.layers\n\nfrom detecting.utils import transforms\nfrom detecting.utils.misc import *\n\nfrom detecting.models.anchors import anchor_generator, anchor_target\nfrom detecting.loss import losses\n\n# RPN层\nclass RPNHead(tf.keras.Model):\n def __init__(self, \n ... | [
[
"tensorflow.boolean_mask",
"tensorflow.nn.softmax",
"tensorflow.concat",
"tensorflow.nn.relu6",
"tensorflow.constant",
"tensorflow.shape",
"tensorflow.image.non_max_suppression",
"tensorflow.keras.regularizers.l2",
"tensorflow.cast",
"tensorflow.ones",
"tensorflow.gathe... |
blackoctopus21/pytorch-retinanet | [
"f12db6aa2d76a02fb078025c87a33e2b347f9e5d"
] | [
"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",
"torch.from_numpy",
"numpy.append",
"numpy.random.rand",
"numpy.array",
"numpy.zeros"
]
] |
PaddlePaddle/LARK | [
"94a2367ba7f0f83b48330233450ea095d8dc9382"
] | [
"erniekit/utils/multi_process_eval.py"
] | [
"# *_*coding:utf-8 *_*\n\n\"\"\"multi process to test\"\"\"\nfrom __future__ import unicode_literals\n\nimport os\nimport json\nimport time\nimport six\nimport sys\nfrom io import open\nimport math\nimport time\nimport subprocess\nimport collections\nimport logging\nimport numpy as np\nfrom erniekit.utils.util_help... | [
[
"numpy.array"
]
] |
Moo-YewTsing/airplane_demo | [
"08b23f5a62f7885ace39b050fdf124e3cd500f2f"
] | [
"cloud_components/AI Platform/ML/trainer/input_metadata.py"
] | [
"import json\nimport tensorflow as tf\nfrom tensorflow_transform.tf_metadata import dataset_metadata, schema_utils\n\nHASH_STRING_FEATURE_KEYS = {'MKT_UNIQUE_CARRIER': 15}\nCATEGORICAL_FEATURE_KEYS = list(HASH_STRING_FEATURE_KEYS.keys())\n\n# VOC_STRING_FEATURE_KEYS = {'MKT_UNIQUE_CARRIER':12}\n# CATEGORICAL_FEATUR... | [
[
"tensorflow.io.FixedLenFeature"
]
] |
ajmcastro/quantum-reinforcement-learning | [
"772f97ab28b313b6bc1ac6a5779628214ec9946c"
] | [
"checkers.py"
] | [
"import math\nimport numpy as np\n\nfrom enum import Enum\nfrom functools import reduce\n\nfrom negamax import negamax\n\nclass Color(Enum):\n WHITE = 1\n BLACK = 2\n\nclass Piece(Enum):\n PAWN = 1\n KING = 2\n\nclass Status(Enum):\n ONGOING = 1,\n DRAW = 2,\n WHITE_WIN = 3,\n BLACK_WIN = 4\... | [
[
"numpy.array",
"numpy.sum"
]
] |
luxward/QUANTAXIS | [
"ddfaba4377ff6c43e6794337c6b3f7ff9b65b348"
] | [
"QUANTAXIS/QAData/base_datastruct.py"
] | [
"# coding:utf-8\n#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016-2018 yutiansut/QUANTAXIS\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including withou... | [
[
"numpy.array",
"pandas.to_datetime",
"pandas.Timestamp"
]
] |
epelaaez/qiskit-machine-learning | [
"04f359f7dcd1186ece17640df1168a0c7ff9a3e8"
] | [
"test/neural_networks/test_neural_network.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio... | [
[
"numpy.zeros"
]
] |
Sebastian-Griesbach/Improving-Policy-Conditioned-Value-Functions | [
"ec4125c5e056753e507df0406fcd60b6b6c3dc25"
] | [
"src/tc_utils/statistics.py"
] | [
"from typing import Dict\nimport numpy as np\nimport os\nimport torch\n\nclass OnlineNormalization():\n\n AVOID_ZERO_DEVISION_CONSTANT = 1e-8\n FILE_SAVE_NAME = \"online_normalization_stats\"\n\n def __init__(self, to_normalize_info: Dict, n_bound: int = np.inf) -> None:\n \"\"\"Handles online norma... | [
[
"numpy.square",
"numpy.zeros",
"numpy.sqrt"
]
] |
bcarreres/snsim | [
"0ff67bbd0c597c0c7c60b4791eb491eb18b22be6"
] | [
"snsim/salt_utils.py"
] | [
"\"\"\"Contains function related to SALT model.\"\"\"\n\nimport sncosmo as snc\nimport numpy as np\n\n\ndef n21_x1_model(z, rand_gen=None):\n \"\"\"X1 distribution redshift dependant model from Nicolas et al. 2021.\n\n Parameters\n ----------\n z : numpy.array(float)\n Redshift(s) of the SN.\n ... | [
[
"numpy.log",
"numpy.sqrt",
"numpy.linspace",
"numpy.einsum",
"numpy.cumsum",
"numpy.atleast_1d",
"numpy.interp",
"numpy.exp",
"numpy.sum"
]
] |
vreinharz/ProtRNADCA | [
"456d43fa8356240a95d83ac1ff03ff522ec0cd83"
] | [
"Src/dca_protrna.py"
] | [
"################################################################################\n#BSD 2-Clause License #\n# #\n#Copyright (c) 2019, Vladimir Reinharz ... | [
[
"numpy.log",
"numpy.linalg.inv",
"pandas.DataFrame",
"numpy.ones",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.divide"
]
] |
23pointsNorth/gym | [
"c05e497b467aab4572f3578f1b9068d4585106d2"
] | [
"gym/spaces/prng.py"
] | [
"import numpy\n\nnp_random = numpy.random.RandomState()\n\ndef seed(seed=None):\n \"\"\"Seed the common numpy.random.RandomState used in spaces\n\n CF\n https://github.com/openai/gym/commit/58e6aa95e5af2c738557431f812abb81c505a7cf#commitcomment-17669277\n for some details about why we seed the spaces se... | [
[
"numpy.random.RandomState"
]
] |
TimChild/dat_analysis | [
"2902e5cb2f2823a1c7a26faf6b3b6dfeb7633c73"
] | [
"src/dat_analysis/analysis_tools/square_wave.py"
] | [
"from typing import Optional, Tuple, Union\n\nimport numpy as np\n\nfrom ..dat_object.dat_hdf import DatHDF\nfrom ..dat_object.make_dat import get_dat\nfrom ..dat_object.attributes.square_entropy import square_wave_time_array, Output\nfrom .. import useful_functions as U\n\n\ndef get_setpoint_indexes_from_times(dat... | [
[
"numpy.nanmax",
"numpy.nanmean",
"numpy.nancumsum"
]
] |
tedunderwood/asymmetry | [
"000c934b4da533132a4de3737731de04518bdb2b"
] | [
"entropycalc/kld_calc_worker_supp1.py"
] | [
"import pandas as pd\nimport numpy as np\nimport random, sys, os\nfrom scipy.stats import entropy\n\ndef get_kld_timelines(package):\n '''\n Calculates Kullback-Leibler divergence forward and back in time\n for a \"segment\" of rows in the metadata frame.\n\n Accepts as its argument a 5-tuple that shoul... | [
[
"scipy.stats.entropy",
"numpy.zeros"
]
] |
sami-ets/samitorch | [
"b0407c110ae198a9e18594716811bd7184ff2f36"
] | [
"tests/inputs/test_transformers.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2019 SAMITorch Authors. All Rights Reserved.\n#\n# Licensed under the MIT License;\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://opensource.org/licenses/MIT\n#\n# Unless required by applicable la... | [
[
"numpy.expand_dims",
"numpy.ones",
"numpy.testing.assert_array_equal",
"numpy.all",
"numpy.testing.assert_array_less",
"numpy.random.randint"
]
] |
ArcticFaded/Quanty | [
"f6fa5221af521b87ec62363d93dc3af8164b3f64"
] | [
"quantea/marketsim/portvals.py"
] | [
"import pandas as pd\nimport numpy as np\n\ndef compute_portvals(market, orders, commission=0.00, impact=0.000, start_val=100000):\n \"\"\"\n market : Market_DataFrame returned by actions.get_stock_data\n orders : Dataframe of format\n {\n 'date': trading day,\n <TICKER>: <ORDE... | [
[
"numpy.isnan",
"pandas.DataFrame"
]
] |
hylomorph-solutions/sklearn-porter | [
"982cb02a8ac0cb98789c43842ea4a1258eb90f34"
] | [
"tests/estimator/classifier/SVC/SVCJSTest.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom unittest import TestCase\n\nimport numpy as np\n\nfrom sklearn.svm import SVC\nfrom sklearn.datasets import make_classification\nfrom sklearn.feature_selection import SelectKBest\nfrom sklearn.feature_selection import f_regression\nfrom sklearn.pipeline import Pipeline\n\nfrom tests... | [
[
"numpy.amax",
"sklearn.datasets.make_classification",
"numpy.amin",
"sklearn.feature_selection.SelectKBest",
"sklearn.svm.SVC",
"numpy.random.uniform"
]
] |
martin-he543/first-year-data-analysis | [
"cd316b57d5fb704aa1083ff6f6764e16a0617e53"
] | [
"lenses-data-analysis.py"
] | [
"import numpy as np\nfrom numpy import exp\nfrom numpy import polyfit\nfrom numpy import log\nimport matplotlib.pyplot as plt\n\nRImageDistance,RObjectDistance,Magnification,ObjectDistance = np.loadtxt(r\"2021.11.25 Lenses - Computing/lenses-experiment-a.csv\",delimiter=\",\",skiprows=1,unpack=True) \nfont = {'font... | [
[
"numpy.polyfit",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show",
"numpy.loadtxt",
"matplotlib.pyplot.ylabel"
]
] |
lucasrm25/Reinforcement-Learning | [
"d6e3aac0b80e554f84c17bdb5b3f73c087a6a33e"
] | [
"ex06-nstep/ex06-nstep.py"
] | [
"''' Implementation of n-step SARS Algorithm to find optimal policy for the\nFrozenLake environment\n'''\n\nimport multiprocessing as mp\nfrom itertools import chain, product\n\nimport gym\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn.metrics import mean_squared_error\nfrom tqdm import tqdm\nim... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.random.randint",
"numpy.argmax",
"numpy.unravel_index",
"numpy.zeros",
"matplotlib.pyplot.figure",
"matplotlib.patches.Rectangle",
"numpy.chararray",
"numpy.random.... |
froystig/jax | [
"1d6cbc93dd06c365ffb1b28232dda4652dbcbb97",
"1d6cbc93dd06c365ffb1b28232dda4652dbcbb97"
] | [
"jax/_src/scipy/stats/multivariate_normal.py",
"tests/ode_test.py"
] | [
"# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.shape"
],
[
"numpy.arange",
"numpy.array",
"numpy.linspace",
"scipy.integrate.odeint"
]
] |
iblumin/xgboost | [
"3d7756b479dda826324285c9a8ebb536a93b343f"
] | [
"python-package/xgboost/core.py"
] | [
"# coding: utf-8\n# pylint: disable=too-many-arguments, too-many-branches, invalid-name\n# pylint: disable=too-many-branches, too-many-lines, too-many-locals\n# pylint: disable=too-many-public-methods\n\"\"\"Core XGBoost Library.\"\"\"\nimport collections\n# pylint: disable=no-name-in-module,import-error\nfrom coll... | [
[
"numpy.histogram",
"numpy.unique",
"numpy.vectorize",
"numpy.column_stack",
"numpy.array",
"numpy.zeros"
]
] |
ByungKwanLee/Masking-Adversarial-Damage | [
"30c39f889b320e26685aab418e7e6b2cc1d12e93"
] | [
"models/resnet_mask.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom models.operator.mask import Conv2d_mask, Linear_mask\r\n\r\n\r\nclass BasicBlock(nn.Module):\r\n expansion = 1\r\n\r\n def __init__(self, in_planes, planes, stride=1):\r\n super(BasicBlock, self).__init__()\r\n sel... | [
[
"torch.nn.Sequential",
"torch.nn.functional.avg_pool2d",
"torch.nn.functional.relu",
"torch.nn.BatchNorm2d"
]
] |
R0bk/image_captioning | [
"be233a61c1cfe1f79d0215052ae4dcc28cc8dcd5"
] | [
"main.py"
] | [
"#!/usr/bin/python\nimport nltk\nnltk.download('punkt')\n\nimport tensorflow as tf\n\nfrom config import Config\nfrom model import CaptionGenerator\nfrom dataset import prepare_train_data, prepare_eval_data, prepare_test_data\n\nFLAGS = tf.app.flags.FLAGS\n\ntf.flags.DEFINE_string('phase', 'train',\n ... | [
[
"tensorflow.flags.DEFINE_boolean",
"tensorflow.flags.DEFINE_string",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"tensorflow.get_default_graph",
"tensorflow.flags.DEFINE_integer",
"tensorflow.app.run"
]
] |
zyayoung/K210-Tracking | [
"d1641d84d40d05eabf8b152f5d0e1627bfc3fdd8"
] | [
"playback_gui.py"
] | [
"from time import sleep, clock\nimport cv2\nimport sys\nfrom threading import Timer,Thread,Event\nfrom PyQt5.QtCore import QThread\nfrom PyQt5.QtWidgets import QApplication,QMainWindow,QFileDialog,QVBoxLayout\nfrom PyQt5 import QtGui, QtCore ,QtWidgets\n\nimport numpy as np\nfrom matplotlib.backends.backend_qt4agg ... | [
[
"numpy.int32",
"numpy.zeros",
"matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg",
"matplotlib.figure.Figure"
]
] |
alphacastio/connectors-chile-macro-basics | [
"0eb69a10728934fd6fbd44d22c699315022ad389",
"0eb69a10728934fd6fbd44d22c699315022ad389"
] | [
"0097.IPC_Chile.py",
"8444.BOP - Chile - BCCh - External Debt by Public or Private Sector.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport pandas as pd\nimport requests\nfrom urllib.request import urlopen\n\nfrom alphacast import Alphacast\nfrom dotenv import dotenv_values\nAPI_KEY = dotenv_values(\".env\").get(\"API_KEY\")\nalphacast = Alphacast(API_KEY)\n\n# In[2]:\n\n\nurl = \"https://... | [
[
"pandas.read_excel",
"pandas.to_datetime"
],
[
"pandas.to_datetime",
"numpy.where",
"pandas.read_html"
]
] |
aegis-rider/mmdeploy | [
"230596bad92fafadb36cf0a69c57d80522cc7c60"
] | [
"mmdeploy/pytorch/ops/squeeze.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport torch.onnx.symbolic_helper as sym_help\n\nfrom mmdeploy.core import SYMBOLIC_REWRITER\n\n\n@SYMBOLIC_REWRITER.register_symbolic('squeeze', is_pytorch=True)\ndef squeeze__default(ctx, g, self, dim=None):\n \"\"\"Register default symbolic function for `squee... | [
[
"torch.onnx.symbolic_helper._get_const"
]
] |
lena-kilian/Spatial_Emissions | [
"5eea1dfcbb33a8af87725621f2ac91de7a13189d"
] | [
"src/Practice.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jan 19 14:24:09 2021\n\n@author: lenakilian\n\nSources:\n http://darribas.org/gds_scipy16/ipynb_md/05_spatial_dynamics.html\n https://pysal.org/notebooks/explore/giddy/Markov_Based_Methods.html\n https://pysal.org/notebooks/lib/libpys... | [
[
"matplotlib.pyplot.legend",
"numpy.linspace",
"matplotlib.pyplot.title",
"scipy.stats.kde.gaussian_kde",
"numpy.arange",
"numpy.set_printoptions",
"matplotlib.pyplot.ylim",
"numpy.nonzero",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabe... |
ngam/jax-cfd | [
"8eff9c47bdc7fb19b6453db94ca65f6be64d91f6"
] | [
"jax_cfd/ml/interpolations.py"
] | [
"\"\"\"Interpolation modules.\"\"\"\n\nimport collections\nimport functools\nfrom typing import Any, Callable, Tuple, Union\n\nimport gin\nimport jax.numpy as jnp\nfrom jax_cfd.base import grids\nfrom jax_cfd.base import interpolation\nfrom jax_cfd.ml import layers\nfrom jax_cfd.ml import physics_specifications\nfr... | [
[
"numpy.cumsum"
]
] |
visym/vipy | [
"fe4dec63dc107306ef77bdcd76d48f3c5122d422",
"fe4dec63dc107306ef77bdcd76d48f3c5122d422"
] | [
"vipy/image.py",
"vipy/torch.py"
] | [
"import os\nimport PIL\nimport PIL.Image\nimport PIL.ImageFilter\nimport platform\nimport dill\nimport vipy.show\nimport vipy.globals\nfrom vipy.globals import print\nfrom vipy.util import isnumpy, isurl, isimageurl, \\\n fileext, tempimage, mat2gray, imwrite, imwritegray, \\\n tempjpg, filetail, isimagefile,... | [
[
"numpy.expand_dims",
"numpy.sqrt",
"numpy.asarray",
"numpy.squeeze",
"matplotlib.pyplot.get_cmap",
"numpy.round",
"numpy.max",
"numpy.random.randint",
"numpy.pad",
"torch.from_numpy",
"matplotlib.pyplot.gcf",
"numpy.ceil",
"numpy.copy",
"numpy.packbits",
... |
mazm13/Image-to-Tree.pytorch | [
"1d32e31d489ea6be784dbbe173acc362b82c59dc"
] | [
"scripts/prepro_valtest_labels.py"
] | [
"\"\"\"\nPreprocess a raw json dataset into hdf5/json files for use in data_loader.py\n\nInput: json file that has the form\n[{ file_path: 'path/img.jpg', captions: ['a caption', ...] }, ...]\nexample element in this list would look like\n{'captions': [u'A man with a red helmet on a small moped on a dirt road. ', u... | [
[
"numpy.concatenate",
"numpy.all",
"numpy.zeros"
]
] |
486755496/vision | [
"9e5edbd5fc3c844dd53686c4e781854b9b26cd8f"
] | [
"torchvision/ops/roi_align.py"
] | [
"import torch\nfrom torch import nn, Tensor\n\nfrom torch.nn.modules.utils import _pair\nfrom torch.jit.annotations import BroadcastingList2\n\nfrom torchvision.extension import _assert_has_ops\nfrom ._utils import convert_boxes_to_roi_format, check_roi_boxes_shape\n\n\ndef roi_align(\n input: Tensor,\n boxes... | [
[
"torch.ops.torchvision.roi_align",
"torch.nn.modules.utils._pair"
]
] |
ridwanfathin/BHT-ARIMA | [
"65df2af999cb13e15e39c4729638d31eb553c9c2"
] | [
"BHT_ARIMA/BHTARIMA.py"
] | [
"\nimport copy\n\nimport tensorly as tl\nimport scipy as sp\nimport numpy as np\nfrom tensorly.decomposition import tucker\n\nfrom .util.MDT import MDTWrapper\nfrom .util.functions import fit_ar_ma, svd_init\n\n\nclass BHTARIMA(object):\n \"\"\"BHT-ARIMA, a tensor-base ARIMA algorithm\n\n This algorithm can f... | [
[
"numpy.dot",
"numpy.linalg.svd",
"numpy.random.random",
"numpy.random.seed",
"numpy.isnan",
"numpy.linalg.norm",
"numpy.diff",
"numpy.insert",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
yanlai00/bridge_data_imitation_learning | [
"d81a3d9181672f5f26dfbd1844d3017cf7a11367"
] | [
"bridgedata/models/gcbc_images_context.py"
] | [
"import numpy as np\nimport pdb\nimport torch\nimport os\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom bridgedata.utils.general_utils import AttrDict\nfrom bridgedata.utils.general_utils import select_indices, trch2npy\nfrom bridgedata.models.base_model import BaseModel\nfrom bridgedata.models.utils... | [
[
"torch.cat",
"torch.unbind",
"torch.split",
"torch.stack",
"numpy.array"
]
] |
neulab/RIPPLe | [
"e1d20fb96afa5a18f18617daa4427d55d0c36e26"
] | [
"run_experiment.py"
] | [
"import subprocess\nimport poison\nimport yaml\nimport uuid\nfrom pathlib import Path\nfrom typing import List, Any, Dict, Optional, Tuple, Union\nfrom utils import load_config, save_config, load_results, load_metrics\nimport mlflow_logger\nimport torch\nimport json\nimport tempfile\nimport logging\n\nfrom utils im... | [
[
"torch.load"
]
] |
alexchartier/digital_rf | [
"cb548266bac910eeee12c210cf31e36809a38565"
] | [
"python/setup.py"
] | [
"# ----------------------------------------------------------------------------\n# Copyright (c) 2017 Massachusetts Institute of Technology (MIT)\n# All rights reserved.\n#\n# Distributed under the terms of the BSD 3-clause license.\n#\n# The full license is in the LICENSE file, distributed with this software.\n# -... | [
[
"numpy.get_include"
]
] |
ameya98/DeepGenerativeModels | [
"2f5fe5fc3bcfeb57c6cfb8c9845a4c38f119ba3b"
] | [
"deepgenmodels/utils/mixture_distribution.py"
] | [
"# Mixture distributions for modelling multiple classes, at once.\n# Author: Ameya Daigavane\n\nimport torch\n\nclass MixtureDistribution:\n def __init__(self, dims, dists, weights=None):\n self.dims = dims\n self.n_components = len(dists)\n self.dists = dists\n\n if weights is not No... | [
[
"torch.sum",
"torch.ones",
"torch.zeros"
]
] |
wsumel/AMMC | [
"ef101878b4a97f07984186ea09146348c0526fa6"
] | [
"pytracking-master/ltr/train_settings/dimp/dimp50.py"
] | [
"import torch.nn as nn\nimport torch.optim as optim\nfrom ltr.dataset import Lasot, Got10k, TrackingNet, MSCOCOSeq\nfrom ltr.data import processing, sampler, LTRLoader\nfrom ltr.models.tracking import dimpnet\nimport ltr.models.loss as ltr_losses\nfrom ltr import actors\nfrom ltr.trainers import LTRTrainer\nimport ... | [
[
"torch.nn.MSELoss",
"torch.optim.lr_scheduler.StepLR"
]
] |
miettal/jismesh | [
"f8daf036dcaf431a00d1361feacc86c9808647b2"
] | [
"jismesh/utils/__init__.py"
] | [
"from __future__ import absolute_import\n\nimport numpy as _np\nfrom . import _vector\nfrom . import _scalar\n\ndef unit_lat(level):\n if _np.isscalar(level):\n unit_lat = _scalar.unit_lat\n else:\n unit_lat = _vector.unit_lat\n \n return unit_lat(level)\n\ndef unit_lon(level):\n if _np... | [
[
"numpy.isscalar"
]
] |
igorHamidovic/machine_text_summarization | [
"781919d50feaf1cef1fc82aa7ea4b6e98aa0eece"
] | [
"mts/attention_model.py"
] | [
"# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.transpose",
"tensorflow.contrib.seq2seq.LuongAttention",
"tensorflow.summary.image",
"tensorflow.contrib.seq2seq.BahdanauAttention",
"tensorflow.contrib.seq2seq.tile_batch",
"tensorflow.no_op",
"tensorflow.contrib.seq2seq.AttentionWrapper"
]
] |
Stratomaker/libsvm | [
"b624dde8ff1d1ae0eb9c5e3e200f114d29ee83ef"
] | [
"python/svm.py"
] | [
"#!/usr/bin/env python\n\nfrom ctypes import *\nfrom ctypes.util import find_library\nfrom os import path\nimport sys\n\ntry:\n\timport scipy\n\tfrom scipy import sparse\nexcept:\n\tscipy = None\n\tsparse = None\n\nif sys.version_info[0] < 3:\n\trange = xrange\n\tfrom itertools import izip as zip\n\n__all__ = ['lib... | [
[
"scipy.where",
"scipy.ascontiguousarray",
"scipy.ctypeslib.as_array",
"scipy.arange",
"scipy.empty"
]
] |
tn1031/set-matching-pytorch | [
"f88ee1e374fef15c70f1ad2da92ce653de22f1eb"
] | [
"set_matching/metrics.py"
] | [
"from typing import Callable, Sequence, Union\n\nimport torch\nfrom ignite.exceptions import NotComputableError\nfrom ignite.metrics.accuracy import _BaseClassification\nfrom ignite.metrics.metric import reinit__is_reduced, sync_all_reduce\n\n\nclass NPairsAccuracy(_BaseClassification):\n def __init__(\n ... | [
[
"torch.eq",
"torch.sum",
"torch.tensor",
"torch.device",
"torch.argmax"
]
] |
behrouzz/star_chart | [
"0a92b68f77003484f0c5d66349d436d71c903b7a"
] | [
"app.py"
] | [
"from datetime import datetime, date\nimport pandas as pd\nimport plotly.graph_objects as go\nimport dash\nfrom dash import dcc, html\nfrom dash.dependencies import Input, Output\nfrom embeds import *\nfrom styles import *\nfrom constellations import const_str\nfrom tools import load_constellations, radec_to_altaz,... | [
[
"pandas.read_csv"
]
] |
t-brandt/exoplanet | [
"68c567de27702190b41434c56d78315358f5c441",
"68c567de27702190b41434c56d78315358f5c441"
] | [
"tests/orbits/rebound_test.py",
"src/exoplanet/theano_ops/rebound/rebound.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport pytest\nimport theano\n\nfrom exoplanet.light_curves import LimbDarkLightCurve\nfrom exoplanet.orbits.keplerian import KeplerianOrbit\nfrom exoplanet.orbits.rebound import ReboundOrbit\n\ntry:\n import rebound # NOQA\nexcept ImportError:\n pytest.skip(\n... | [
[
"numpy.allclose",
"numpy.linspace",
"numpy.shape",
"numpy.array",
"numpy.sum"
],
[
"numpy.ascontiguousarray",
"numpy.atleast_1d",
"numpy.atleast_2d",
"numpy.shape",
"numpy.argsort",
"numpy.empty"
]
] |
apuaaChen/tvm | [
"8a0c3c2e3c0a3a7b393bef9fe39016d0e61f704c"
] | [
"python/tvm/relay/frontend/pytorch.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"torch.zeros",
"torch._C._jit_pass_onnx_function_substitution",
"numpy.float16",
"numpy.int32",
"numpy.int8",
"numpy.uint8",
"torch._C._jit_pass_inline",
"numpy.finfo",
"numpy.ones",
"numpy.int64",
"numpy.int16",
"numpy.float64",
"numpy.isscalar",
"numpy.flo... |
fgr1986/rram_multilevel_driver | [
"7715ca64df2a18bbba1021c07684f470b4f225d2"
] | [
"resistive_controlled_scheme/python/python_post_driver_characterization_study/driver_characterization_study.py"
] | [
"# import plotly.plotly as py\nimport plotly.offline\nfrom plotly.graph_objs import Scatter, Layout\nimport numpy as np\nimport pandas as pd\nimport sys\nimport os\n\n\n############################\n# Useful functions\n############################\ndef find_nearest(array, value):\n idx = (np.abs(array-value)).ar... | [
[
"numpy.abs",
"numpy.linspace",
"numpy.genfromtxt",
"numpy.full",
"numpy.argmax",
"numpy.searchsorted",
"numpy.transpose",
"numpy.array",
"numpy.zeros"
]
] |
kevinguo344/distopia | [
"077dd3501bd43565d1a9647a151fb20b90b71a54"
] | [
"distopia/mapping/voronoi.py"
] | [
"\"\"\"\nVoronoi Mapping\n===============\n\"\"\"\nfrom scipy.spatial import Voronoi\nfrom distopia.district import District\nfrom distopia.precinct import Precinct\nfrom distopia.mapping._voronoi import PolygonCollider, get_region_vertices\nimport numpy as np\nfrom collections import defaultdict\nimport logging\ni... | [
[
"numpy.dot",
"scipy.spatial.Voronoi",
"numpy.asarray",
"numpy.linalg.norm",
"numpy.ones",
"numpy.arctan2",
"numpy.iinfo",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.empty"
]
] |
divyanshupachisia/safety_rl | [
"4cb7a3606b793e45d071cff2183d2f15a3e4893b"
] | [
"utils/carPEAnalysis.py"
] | [
"\"\"\"\nPlease contact the author(s) of this library if you have any questions.\nAuthors: Kai-Chieh Hsu ( kaichieh@princeton.edu )\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport torch\nimport pickle\nimport gym\nimport os\n\nimport sys\n\nsys.path.append(\"..\")\nfrom RARL.config import dqn... | [
[
"numpy.concatenate",
"torch.no_grad",
"torch.FloatTensor",
"torch.cuda.is_available",
"torch.device",
"matplotlib.pyplot.tight_layout",
"numpy.arange",
"numpy.ceil",
"numpy.load",
"numpy.array",
"numpy.logical_and",
"numpy.sum",
"matplotlib.pyplot.show",
"nu... |
qimin/pymatgen | [
"4823c777a8af4a3ca7cd29297563ba8174ec402c"
] | [
"pymatgen/core/structure_modifier.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nThis module provides classes used to modify structures.\n\"\"\"\n\nfrom __future__ import division\n\n__author__ = \"Shyue Ping Ong\"\n__copyright__ = \"Copyright 2011, The Materials Project\"\n__version__ = \"1.0\"\n__maintainer__ = \"Shyue Ping Ong\"\n__email__ = \"shyue@mit.edu\... | [
[
"numpy.dot",
"numpy.linalg.norm",
"numpy.append",
"numpy.random.randn",
"numpy.random.rand",
"numpy.array"
]
] |
okadalabipr/Imoto_Cancers_2020 | [
"598d74841b0f7a433c8d935c07c171c8f43b6cc2"
] | [
"python/biomass/models/mapk_cascade/fitness.py"
] | [
"import numpy as np\nfrom scipy.spatial.distance import cosine\n\nfrom .observable import observables, ExperimentalData, NumericalSimulation\nfrom .set_search_param import SearchParam\n\n\ndef _compute_objval_rss(sim_data, exp_data):\n \"\"\"Return Residual Sum of Squares\n \"\"\"\n return np.dot((sim_data... | [
[
"numpy.dot",
"scipy.spatial.distance.cosine",
"numpy.max",
"numpy.array",
"numpy.sum"
]
] |
Tim-Bonner-1825/Flood-Warning-System | [
"d6d2c232216de521a8ba196e175ee59e820dd1c2"
] | [
"floodsystem/stationdata.py"
] | [
"#Copyright (C) 2018 Garth N. Wells\n#\n# SPDX-License-Identifier: MIT\n\"\"\"This module provides interface for extracting statiob data from\nJSON objects fetched from the Internet and\n\n\"\"\"\n\nimport datetime\n\nimport matplotlib\n\nfrom floodsystem.analysis import polyfit\nfrom floodsystem.utils import sorte... | [
[
"matplotlib.dates.date2num"
]
] |
dnzltajo/Schl_prjcts | [
"b5b35abb1a1b305f39d45825b6d2178b848906b7"
] | [
"fhouse8.py"
] | [
"import numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.model_selection import KFold\r\nfrom sklearn.metrics import mean_squared_error, r2_score\r\nfrom sklearn.model_selection import cross_val_score\r\nfrom scipy import stats\r\n\r\nplt.style.u... | [
[
"matplotlib.pyplot.legend",
"numpy.polyfit",
"numpy.poly1d",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.plot",
"scipy.stats.linregress",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.style.use",
"matplo... |
taorunz/SQIR | [
"e826699c9063be390f7e9d25b6f3c0b52ee5d25c"
] | [
"VOQC/benchmarks/create_tables.py"
] | [
"'''\n Assumes that the following files exist in the current\n directory: pyzx_out.csv, qiskit_out.csv, tket_out.csv,\n voqc_out.csv\n'''\n\nimport os\nimport sys\nimport numpy as np\nimport re\n\n#############################################################################################\n# Open each fil... | [
[
"numpy.array"
]
] |
hsxian/StatisticalSample | [
"f9908a022a3502f00b7d5025049d8d23e55e6a4b"
] | [
"statistical/utils/pandas_util.py"
] | [
"import pandas as pd\n\n\ndef split_data_frame_list(df, target_column, output_type=float):\n ''' \n Accepts a column with multiple types and splits list variables to several rows.\n\n df: dataframe to split\n target_column: the column containing the values to split\n output_type: type of all outputs\... | [
[
"pandas.DataFrame"
]
] |
JustusSchwan/MasterThesis | [
"a9b928ed1c121a72ad1bfec28d941d31e4b232e8"
] | [
"trash/generate_raw_features.py"
] | [
"import cPickle\nimport csv\nimport math\n\nimport cv2\nimport numpy as np\n\nimport expressivity\nimport face_extractor\nimport filter\nfrom trash import utility_positional\n\n\ndef draw_face(image, pts, color, thickness=1):\n open_ranges = [[0, 17], [17, 22], [22, 27], [27, 31], [31, 36]]\n closed_ranges = ... | [
[
"numpy.array"
]
] |
kzl/lifelong_rl | [
"44815713f6732abccac6c69bb0e3fe9e68e08210"
] | [
"lifelong_rl/envs/wrappers.py"
] | [
"import numpy as np\nimport itertools\nfrom gym import Env\nfrom gym.spaces import Box\nfrom gym.spaces import Discrete\n\nfrom collections import deque\nimport copy\n\n\nclass ProxyEnv(Env):\n\n def __init__(self, wrapped_env):\n self._wrapped_env = wrapped_env\n self.action_space = self._wrapped_... | [
[
"numpy.ones_like",
"numpy.linspace",
"numpy.clip",
"numpy.ones",
"numpy.std",
"numpy.mean",
"numpy.zeros_like",
"numpy.array",
"numpy.zeros"
]
] |
Sandorabad/xgboost_sandorabad | [
"5f70b4df7af60b9498b4c5225b8c612655a26b1e"
] | [
"tests/python/test_models.py"
] | [
"import numpy as np\nimport xgboost as xgb\nimport unittest\n\ndpath = 'demo/data/'\ndtrain = xgb.DMatrix(dpath + 'agaricus.txt.train')\ndtest = xgb.DMatrix(dpath + 'agaricus.txt.test')\n\nrng = np.random.RandomState(1994)\n\nclass TestModels(unittest.TestCase):\n\n\tdef test_glm(self):\n\t\tparam = {'silent':1, 'o... | [
[
"numpy.exp",
"numpy.random.RandomState",
"numpy.sum"
]
] |
madskoefoed/Machine-Learning-for-Trading.py | [
"e79884e668470500b9b55e8f86aa2a1f734e60c3"
] | [
"lesson4/lesson4.16.py"
] | [
"# Lesson 4.16 - Modifying array elements\nimport numpy as np\n\ndef test_run():\n a = np.random.rand(5, 4)\n print(\"Array:\\n\", a)\n\n a[0, 0] = 1\n print(\"Modified array:\\n\", a)\n\n a[0, :] = 2\n print(\"Modified (replaced a row with a single value):\\n\", a)\n\n a[:, 3] = [1, 2, 3, 4, 5... | [
[
"numpy.random.rand"
]
] |
buruzaemon/moojoos | [
"4b3746ec67b16b2ecb2054eb127bb0b0c120254d"
] | [
"src/moojoos/test_blur.py"
] | [
"import unittest\nimport blur\nimport numpy as np\n\nclass DiffOfDiffCheck(unittest.TestCase):\n\n def setUp(self):\n self.arr = np.array([0,1,2,3,4])\n \n def testDiffIndex0(self):\n self.assertEqual(blur._diffofdiff(self.arr, 0), 2)\n \n def testDiffIndex1(self):\n self.assertE... | [
[
"numpy.array"
]
] |
hany606/gym-pybullet-drones | [
"479fce887301ba316e5c5ae1093a1cb301c649f5",
"d9c78a754ecae4018a722d6ab00ad080e2bb149c"
] | [
"assignments/aer1216_fall2020_hw2_ctrl.py",
"gym_pybullet_drones/envs/BaseAviary.py"
] | [
"\"\"\"Control implementation for assignment 2.\n\nThe controller used the simulation in file `aer1216_fall2020_hw2_sim.py`.\n\nExample\n-------\nTo run the simulation, type in a terminal:\n\n $ python aer1216_fall2020_hw2_sim.py\n\nNotes\n-----\nTo-dos\n Search for word \"Objective\" this file (there are 4 o... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.linalg.inv",
"numpy.cos",
"numpy.array",
"numpy.zeros"
],
[
"numpy.diag",
"numpy.dot",
"numpy.resize",
"numpy.sqrt",
"numpy.max",
"numpy.exp",
"numpy.where",
"numpy.hstack",
"numpy.clip",
"numpy.reshape",
"nu... |
sjanssen2/empress | [
"39a342de88b19ea41bf7adabd1016878e24de0d8"
] | [
"empress/tools.py"
] | [
"# ----------------------------------------------------------------------------\n# Copyright (c) 2016-2020, empress development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file LICENSE, distributed with this software.\n# -------------------------------------... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.