repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
mahkons/Lottery-ticket-hypothesis | [
"96ec399fdfc4138a37feecb24a63b3cdb8e50e1e"
] | [
"supervised/networks/VGG19.py"
] | [
"import torch\nimport torch.nn as nn\n\nclass VGG(nn.Module):\n #ANCHOR Change No. of Classes here.\n def __init__(self, features, num_classes=10, init_weights=True):\n super(VGG, self).__init__()\n self.features = features\n self.avgpool = nn.AdaptiveAvgPool2d((7, 7))\n self.class... | [
[
"torch.nn.Sequential",
"torch.nn.Dropout",
"torch.nn.init.constant_",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.init.normal_",
"torch.nn.BatchNorm2d",
"torch.flatten",
"torch.nn.ReLU",
"torch.nn.init.kaiming_... |
Guo-lab/Graph | [
"c4c5fbc8fb5d645c16da20351b9746019cf75aab"
] | [
"dgi_gat/layers/gat.py"
] | [
"import math\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\n\nclass GraphAttention(nn.Module):\n def __init__(self, in_features, out_features, dropout, alpha, concat=True):\n super(GraphAttention, self).__init__()\n \n #//self.fc = nn.Linear(in_ft, out_ft, bias=... | [
[
"torch.nn.functional.softmax",
"torch.empty",
"torch.nn.functional.dropout",
"torch.tensor",
"torch.matmul",
"torch.nn.LeakyReLU",
"torch.where",
"torch.nn.init.xavier_uniform_",
"torch.nn.functional.elu",
"torch.ones_like",
"torch.squeeze"
]
] |
radioactive73/PassGAN | [
"d11f9bb9eb9326be301bca14f47cbc5acd047495"
] | [
"train.py"
] | [
"import os, sys\nsys.path.append(os.getcwd())\n\nimport time\nimport pickle\nimport argparse\nimport numpy as np\nimport tensorflow as tf\ntf.compat.v1.disable_eager_execution()\n\nimport utils\nimport tflib as lib\nimport tflib.ops.linear\nimport tflib.ops.conv1d\nimport tflib.plot\nimport models\n\n'''\n\n$ pytho... | [
[
"tensorflow.compat.v1.train.AdamOptimizer",
"tensorflow.reduce_mean",
"tensorflow.random.uniform",
"numpy.random.shuffle",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.placeholder",
"numpy.argmax",
"tensorflow.square... |
FranckLejzerowicz/microbiome_analyzer | [
"7d48f69eac85fecc0016efba52ea23d846cdcaa2"
] | [
"microbiome_analyzer/_rarefy.py"
] | [
"# ----------------------------------------------------------------------------\n# Copyright (c) 2020, Franck Lejzerowicz.\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# ------------------------------------------------... | [
[
"numpy.set_printoptions",
"numpy.histogram",
"scipy.stats.skew"
]
] |
bzhaocaltech/alpha-zero-ramsey-numbers | [
"dfd10b577c1bc26c4f445bcc2fafa8c1bcf9cb6c"
] | [
"MCTS.py"
] | [
"import math\nimport numpy as np\n\nEPS = 1e-8\n\nclass MCTS():\n \"\"\"\n This class handles the MCTS tree.\n \"\"\"\n\n def __init__(self, game, nnet, args):\n self.game = game\n self.nnet = nnet\n self.args = args\n self.Qsa = {} # stores Q values for s,a (as defined in t... | [
[
"numpy.argmax",
"numpy.sum"
]
] |
9meo/Thai-Clickbait | [
"b4d98b2b58545fa4b031aad993fb9150493f729b"
] | [
"src/w2v.py"
] | [
"from __future__ import print_function\nfrom gensim.models import word2vec\nfrom os.path import join, exists, split\nimport os\nimport numpy as np\n\n\ndef train_word2vec(sentence_matrix, vocabulary_inv,\n num_features=300, min_word_count=1, context=10 , seg='seg_lextoplus'):\n \"\"\"\n Trai... | [
[
"numpy.random.uniform"
]
] |
HedgehogCode/stardist | [
"087dad36be7dbf50ae53f915df69974e00efb207"
] | [
"stardist/model.py"
] | [
"from __future__ import print_function, unicode_literals, absolute_import, division\nfrom six.moves import range, zip, map, reduce, filter\nfrom six import string_types\n\nimport numpy as np\nimport argparse\nimport warnings\nimport datetime\n\nimport keras.backend as K\nfrom keras.callbacks import ReduceLROnPlatea... | [
[
"numpy.expand_dims",
"numpy.take",
"numpy.stack",
"numpy.moveaxis",
"numpy.random.RandomState",
"numpy.empty"
]
] |
Snegovikufa/chaco | [
"89366735e20cded2bad90db8817a46de56d137b0"
] | [
"chaco/tests/arraydatasource_test_case.py"
] | [
"\"\"\"\nTest of basic dataseries behavior.\n\"\"\"\n\nimport unittest\n\nfrom numpy import arange, array, allclose, empty, isnan, nan\nimport numpy as np\n\nfrom chaco.api import ArrayDataSource, PointDataSource\n\n\nclass ArrayDataTestCase(unittest.TestCase):\n def test_basic_set_get(self):\n myarray = ... | [
[
"numpy.allclose",
"numpy.isnan",
"numpy.arange",
"numpy.array",
"numpy.empty"
]
] |
uysalserkan/OpenCV-Samples | [
"ab01dc128951626aa50c571b77d419ad9dfbfd3e"
] | [
"Color_Filtering.py"
] | [
"import cv2\nimport numpy as np\n\ncap = cv2.VideoCapture(0)\n\nwhile True:\n _, frame = cap.read()\n hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)\n\n lower_red = np.array([10, 10, 50])\n upper_red = np.array([255, 255, 180])\n\n mask = cv2.inRange(hsv, lower_red, upper_red)\n res = cv2.bitwise_an... | [
[
"numpy.array",
"numpy.ones"
]
] |
mnsaxena/np-shape-lab | [
"87e0b54ba147a499d0be692b8841dda887568b63"
] | [
"pythonscripts/asphericity.py"
] | [
"from numpy import linalg as LA\nimport csv\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nindices = []\nxPos = []\nyPos = []\nzPos = []\ncharge = []\n\n# loop through data as a csv, store data in lists\nwith open('disc.txt', mode='r') as csv_file:\n csv_reader = csv.reader(csv_file, delimiter='\\t')\n ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"numpy.arange",
"numpy.linalg.eig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
zolboo1024/numpy | [
"ce57efe4e9f741b45b45ccfb462668e9caa1c9c3"
] | [
"numpy/typing/tests/data/fail/arithmetic.py"
] | [
"from typing import List, Any\nimport numpy as np\n\nb_ = np.bool_()\ndt = np.datetime64(0, \"D\")\ntd = np.timedelta64(0, \"D\")\n\nAR_b: np.ndarray[Any, np.dtype[np.bool_]]\nAR_u: np.ndarray[Any, np.dtype[np.uint32]]\nAR_i: np.ndarray[Any, np.dtype[np.int64]]\nAR_f: np.ndarray[Any, np.dtype[np.float64]]\nAR_c: np... | [
[
"numpy.timedelta64",
"numpy.bool_",
"numpy.datetime64"
]
] |
Laeyoung/EasyOCR | [
"f41a5d951bd6fce8cfcdaa67a956c639c013eb18"
] | [
"easyocr/recognition.py"
] | [
"from PIL import Image\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.utils.data\nimport torch.nn.functional as F\nimport torchvision.transforms as transforms\nimport numpy as np\nfrom collections import OrderedDict\n\nfrom .model import Model\nfrom .utils import CTCLabelConverter\nimport math\n\... | [
[
"torch.nn.functional.softmax",
"numpy.expand_dims",
"numpy.maximum",
"torch.LongTensor",
"torch.load",
"torch.from_numpy",
"numpy.percentile",
"numpy.full",
"torch.no_grad",
"torch.FloatTensor",
"torch.IntTensor",
"torch.nn.DataParallel"
]
] |
johnflux/deep-learning-tictactoe | [
"da4dbdf5453c0ac2ed470098736f50dce6a4574b"
] | [
"play.py"
] | [
"#!/usr/bin/env python3\nimport numpy as np\nimport copy\nimport keras\nfrom keras.models import Model\nfrom keras.layers import Flatten, Dense, Dropout\n\n\n# Call this like:\n\nmodel = None\ncallbacks = []\n\ndef makeModel():\n global model, callbacks\n if model != None:\n return\n inputs = keras.... | [
[
"numpy.array",
"numpy.zeros",
"numpy.random.randint"
]
] |
cdrakesmith/CGATPipelines | [
"3c94ae4f9d87d51108255dc405c4b95af7c8b694"
] | [
"obsolete/pipeline_metagenomecommunities.py"
] | [
"\"\"\"\n=====================================================\nCommunity analysis of metgenomic shotgun sequencing\n=====================================================\n\n\nPipeline_metagenomecommunities.py takes as input a set of fastq\nfiles from a shotgun sequencing experiment of environmental samples\nand as... | [
[
"pandas.DataFrame"
]
] |
Heechul90/Deep_Learning | [
"6e3b172dd36198c83f19528bd3687faf487a0af9"
] | [
"Study/DeepLearning01.py"
] | [
"# 딥러닝을 구동하는 데 필요한 케라스 함수를 불러옴\nfrom keras.models import Sequential\nfrom keras.layers import Dense\n\n# 필요한 라이브러리를 불러옴\nimport numpy as np\nimport tensorflow as tf\n\n# 실행할 때마다 같은 결과를 출력하기 위해 설정하는 부분\nseed = 0\nnp.random.seed(seed)\ntf.set_random_seed(seed)\n\n# 준비된 수술 환자 데이터를 불러옴\ndata_set = np.loadtxt('dataset1/... | [
[
"tensorflow.set_random_seed",
"numpy.loadtxt",
"numpy.random.seed"
]
] |
nile649/POLY-GAN | [
"c91a0322fed909f8e96a1144ee33e0808e276c45"
] | [
"utils/utils.py"
] | [
"import torch\nimport numpy as np\nfrom torch.autograd import Variable\nimport random\n\n# Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network\n# ReplayBuffer was first introduced in the above mentioned paper, It's effect mathematically has been supported in \n# latest ICLR paper Pr... | [
[
"torch.nn.init.constant",
"torch.cat",
"torch.unsqueeze",
"torch.nn.init.normal"
]
] |
mashfiq10/Burgers1D | [
"9e8aafc612075cff9af4fe5cd4530b0eb2697b90"
] | [
"burgers1d.py"
] | [
"#!/usr/bin/python\n\n#################################################\n# 1D Burgers equation solver\n# Sk. Mashfiqur Rahman\n# Oklahoma State University\n# CWID: A20102717\n#################################################\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# domain\nx0 = 0.\nxL = 1.\n\nnx ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"numpy.sin",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.tick_params",
"numpy.empty",
"matplotlib.pyplot.ylabel"
]
] |
phivision/surreal | [
"61f56db4c840013497eef4c3954d1112c1c1acec"
] | [
"datageneration/main_part.py"
] | [
"import sys\nimport os\nimport random\nimport math\nimport bpy\nimport numpy as np\nfrom os import getenv\nfrom os import remove\nfrom os.path import join, dirname, realpath, exists\nfrom mathutils import Matrix, Vector, Quaternion, Euler\nfrom glob import glob\nfrom random import choice\nfrom pickle import load\nf... | [
[
"numpy.random.seed",
"numpy.asarray",
"numpy.eye",
"numpy.cos",
"numpy.linalg.norm",
"numpy.sin",
"numpy.ceil",
"numpy.random.normal",
"numpy.zeros_like",
"numpy.random.rand",
"numpy.transpose",
"numpy.array",
"numpy.zeros",
"numpy.empty"
]
] |
LoicDagnas/tensorflow-onnx | [
"6691850e79047d05d85017573170fd8240393b57"
] | [
"tf2onnx/optimizer/transpose_optimizer.py"
] | [
"# SPDX-License-Identifier: Apache-2.0\n\n\n\"\"\"Transpose Optimizer.\"\"\"\n\nfrom collections import defaultdict\n\nimport numpy as np\nimport onnx\nfrom tf2onnx.constants import NCHW_TO_NHWC, NHWC_TO_NCHW, NCDHW_TO_NDHWC, NDHWC_TO_NCDHW, TARGET_CHANNELS_LAST\nfrom .. import utils\nfrom .optimizer_base import Gr... | [
[
"numpy.multiply",
"numpy.reshape",
"numpy.prod",
"numpy.transpose",
"numpy.array"
]
] |
DIYer22/maskrcnn-benchmark | [
"c297c690adc06e6ee9ce45df9f1406a72c0eeec8"
] | [
"demo/predictor.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport cv2\nimport torch\nfrom torchvision import transforms as T\n\nfrom maskrcnn_benchmark.modeling.detector import build_detection_model\nfrom maskrcnn_benchmark.utils.checkpoint import DetectronCheckpointer\nfrom maskrcnn_benchmark.struct... | [
[
"torch.zeros",
"torch.cat",
"matplotlib.pyplot.get_cmap",
"torch.tensor",
"numpy.copy",
"torch.no_grad",
"torch.nonzero",
"torch.device"
]
] |
lxb1989/AugmentedAutoencoder | [
"954f60432009b9873b8e60544aee6a567dfbf67d"
] | [
"auto_pose/ae/ae_train.py"
] | [
" # -*- coding: utf-8 -*-\nimport os\nimport configparser\nimport argparse\nimport numpy as np\nimport signal\nimport shutil\nimport cv2\n\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\nimport progressbar\nimport tensorflow as tf\n\nfrom auto_pose.ae import ae_factory as factory\nfrom auto_pose.ae import utils as u\n\n... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.summary.FileWriter",
"tensorflow.ConfigProto",
"tensorflow.global_variables_initializer",
"tensorflow.GPUOptions",
"tensorflow.summary.merge_all",
"tensorflow.Session",
"tensorflow.variable_scope",
"tensorflow.train.Saver",
... |
richardwu/gdaxtrader | [
"1f9dab48f08bd0fd4e3e562c41ae4bc9d1218504"
] | [
"gdaxtrader/visualize.py"
] | [
"#!/usr/bin/env python\n\nimport matplotlib.pyplot as plt\nimport plotly\nimport pandas as pd\nimport time\nimport os\nimport copy\n\nimport common\nimport timeseries as ts\nimport ratesutil\n\n_plot_dir = 'plots'\n\n_increase_col = '#419871'\n_decrease_col = '#fc433e'\n\n_mov_avg_width = 1\n\n_bbands_col = '#ccc'\... | [
[
"matplotlib.pyplot.savefig"
]
] |
DS-Wen/SSPredict | [
"663f693405b066d4b93751c8374d9f5412c501ee"
] | [
"build/lib/sspredict/make_prediction/models.py"
] | [
"import scipy \nimport numpy as np\nimport pandas as pd\nfrom scipy import stats \nimport copy\nimport scipy.optimize as optimize\nimport scipy.integrate as integrate\n\nclass ss_edge_model:\n# calculate solid solution strengthening contribution for FCC/BCC CCAs\n# pseudo-ternary compositions\n# Edge dislocation mo... | [
[
"numpy.log",
"numpy.maximum",
"numpy.minimum",
"numpy.sqrt",
"numpy.arange",
"scipy.optimize.root",
"pandas.DataFrame",
"numpy.round",
"numpy.exp",
"scipy.stats.norm.rvs",
"scipy.integrate.quad",
"numpy.array"
]
] |
mindspore-ai/akg | [
"c9e922219c5a2153f3d83ffe9d68707ff90368a0"
] | [
"tests/common/test_run/gpu/csr_div_run.py"
] | [
"import numpy as np\nimport scipy.sparse\n\nimport akg\nfrom akg import tvm\nfrom akg import composite\nfrom akg.utils import CUDA\nfrom tests.common.base import get_rtol_atol\nfrom tests.common.gen_random import random_gaussian\nfrom tests.common.tensorio import compare_tensor\nfrom akg.utils import kernel_exec as... | [
[
"numpy.zeros",
"numpy.broadcast_to"
]
] |
Mirofil/AutoDL-Projects | [
"e7ee9fe27e5c5561a4b9fd1c1ee185677ef30893"
] | [
"lib/models/cell_searchs/nb101/optimizers/darts/train_search_no_higher.py"
] | [
"# python ./lib/models/cell_searchs/nb101/optimizers/darts/train_search_no_higher.py --seed=90 --mode=reptile --inner_steps=4 --inner_steps_same_batch=True\n\nimport argparse\nimport glob\nimport json\nimport logging\nimport os\nimport pickle\nimport sys\nimport time\n\nimport numpy as np\nimport torch\nimport torc... | [
[
"torch.cuda.get_device_properties",
"torch.nn.CrossEntropyLoss",
"torch.cuda.set_device",
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.manual_seed",
"torch.zeros_like",
"torch.utils.data.sampler.SubsetRandomSampler",
"torch.no_grad",
"torch.cuda.is_available",
... |
ougx/modflow6 | [
"70a056d977bfeb7b077eddab084f0836c9d1eff7"
] | [
"autotest/test_gwf_csub_sub01.py"
] | [
"import os\nimport numpy as np\n\ntry:\n import pymake\nexcept:\n msg = \"Error. Pymake package is not available.\\n\"\n msg += \"Try installing using the following command:\\n\"\n msg += \" pip install https://github.com/modflowpy/pymake/zipball/master\"\n raise Exception(msg)\n\ntry:\n import fl... | [
[
"numpy.recarray",
"numpy.zeros",
"numpy.abs",
"numpy.genfromtxt"
]
] |
droseger/mmdetection | [
"355da53ea7c4b061c62c5a8430adce7641bc2894"
] | [
"mmdet/datasets/sidewalk.py"
] | [
"import numpy as np\nfrom pycocotools.coco import COCO\n\nfrom .custom import CustomDataset\n\n\nclass Sidewalk(CustomDataset):\n CLASSES = ('_background_',\n 'tarmac_cavity',\n 'tarmac_cavity_dirt',\n 'tarmac_crack_fine',\n 'tarmac_crack_medium',\n ... | [
[
"numpy.array",
"numpy.zeros"
]
] |
Hou-Yijie/NNPJ-Final | [
"b83e34ba6def1f65ad8b65d3c99bfe3f68cbd836"
] | [
"Mixup.py"
] | [
"#!/usr/bin/env python3 -u\n# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree.\nfrom __future__ import print_function\n\nimport argparse\nimport csv\nimport os\n\nimport num... | [
[
"torch.set_rng_state",
"torch.nn.CrossEntropyLoss",
"numpy.random.beta",
"torch.max",
"torch.load",
"torch.randperm",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.get_rng_state",
"torch.cuda.is_available",
"torch.save"
]
] |
jmetzz/ml-laboratory | [
"26b1e87bd0d80efa4f15280f7f32ad46d59efc1f"
] | [
"basic_ml/tests/regression/test_lasso.py"
] | [
"import math\n\nimport numpy as np\nfrom numpy.testing import assert_almost_equal\n\nfrom regression.lasso import coordinate_descent_step\n\n\ndef test_lasso_coordinate_descent_step():\n expected_w = 0.425558846691\n actual_w = coordinate_descent_step(\n feature_matrix=np.array(\n [[3.0 / ma... | [
[
"numpy.testing.assert_almost_equal",
"numpy.array"
]
] |
Shuep418Slw/OSlw_StyleTransfer | [
"e197cabc0b0f2fc16409bb2d00061761b866f776"
] | [
"Python_Code/img2txt.py"
] | [
"import numpy as np\nimport cv2\nfrom PIL import Image\n#img=cv2.imread('picture.jpg')\n\nimg=np.array(Image.open('picture.jpg'))\nprint(img.shape)\n\nmaxlen=max(img.shape)\n\nheight,width = img.shape[:2]\n\n#if maxlen<=512:\n# tout=img\n#else:\ndivlen = int(maxlen / 512)+1\nprint(divlen)\ntout=cv2.resize(img,(5... | [
[
"numpy.reshape"
]
] |
ZichengDuan/MVM3D | [
"b62c96de5894ae5fef615e2ee54fe975248a3df7"
] | [
"codes/evaluation/pyeval/calAOS.py"
] | [
"import numpy as np\nfrom scipy.optimize import linear_sum_assignment\nimport math\nimport shapely\nfrom shapely.geometry import Polygon, MultiPoint # 多边形计算的库\n\ndef wh2bottomleft(bbox):\n x, y, w, h = bbox\n xmin = x - w/2\n xmax = x + w/2\n ymin = y - h/2\n ymax = y + h/2\n return xmin, ymin,... | [
[
"numpy.unique",
"numpy.arange",
"numpy.concatenate",
"numpy.deg2rad",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.where",
"numpy.loadtxt"
]
] |
yjhexy/tensorflow_learn | [
"2748f2e9d780a4915b56b6e6a7a4bfdfe3320488"
] | [
"tf_api/matrix/trace.py"
] | [
"# trace 练习测试 矩阵对角线只和\nimport tensorflow as tf\n\nwith tf.Session() as sess:\n a = tf.constant([[1, 5, 0, 0], [0, 2, 0, 0], [0, 0, 3, 0], [0, 0, 0, 4]])\n z = tf.trace(a)\n print(sess.run(z))\n"
] | [
[
"tensorflow.constant",
"tensorflow.Session",
"tensorflow.trace"
]
] |
danipab12/Lab3 | [
"7b9f43fe169e4c8f745fa946dc0355c8ac739f16"
] | [
"scripts/plot_log_regression.py"
] | [
"import csv\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom pylab import rcParams\n\nrcParams['figure.figsize'] = 10, 6\nrcParams['text.usetex']=True\n#rcParams['text.latex.unicode']=True\n\npenalties = {'l1': ([], []), 'l2': ([], [])}\nwith open('/Users/matze/Studium/Bachelorarbeit/Documents/thesis/da... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
jwkanggist/tf-keras-stock-pred | [
"c10a7ea9934443511bcf4b16096c0f574c4f5b03"
] | [
"tfmodule/train_config.py"
] | [
"# -*- coding: utf-8 -*-\nimport tensorflow as tf\n\nclass TrainConfig(object):\n def __init__(self):\n\n # the number of step between evaluation\n self.train_input_size = 1\n self.train_data_size = 0.8\n self.test_data_size = 0.8\n\n self.training_epochs = 300\n\n s... | [
[
"tensorflow.gfile.Exists",
"tensorflow.gfile.MakeDirs"
]
] |
zyh1999/pytorch-quantum | [
"c00bd564a99001fee2fd6b30e5e34562ab981e28"
] | [
"examples/core/models/q4digit_models.py"
] | [
"import torchquantum as tq\nimport torch.nn.functional as F\nfrom torchpack.utils.logging import logger\n\n\nclass Q4DigitFCModel0(tq.QuantumModule):\n \"\"\"rx ry rz crx cry crz layers\"\"\"\n class QLayer(tq.QuantumModule):\n def __init__(self, arch=None):\n super().__init__()\n ... | [
[
"torch.nn.functional.avg_pool2d",
"torch.nn.functional.log_softmax"
]
] |
DANISHFAYAZNAJAR/nalp | [
"8a7d8b7cb13dfc755a72d0770bf81ba9bc6ddb35"
] | [
"nalp/datasets/image.py"
] | [
"\"\"\"Imaging dataset class.\n\"\"\"\n\nfrom tensorflow import data\n\nimport nalp.utils.logging as l\nfrom nalp.core import Dataset\n\nlogger = l.get_logger(__name__)\n\n\nclass ImageDataset(Dataset):\n \"\"\"An ImageDataset class is responsible for creating a dataset that encodes images for\n adversarial g... | [
[
"tensorflow.data.Dataset.from_tensor_slices"
]
] |
hardikk13/BSP-NET-pytorch | [
"128092d930389b56a33723c425f85e363b542b68"
] | [
"modelSVR.py"
] | [
"import os\nimport time\nimport math\nimport random\nimport numpy as np\nimport h5py\n\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch import optim\nfrom torch.autograd import Variable\n\nimport mcubes\n# from bspt import digest_bsp, get_mesh, ... | [
[
"torch.mean",
"torch.zeros",
"torch.load",
"numpy.max",
"torch.cuda.is_available",
"torch.device",
"numpy.random.randint",
"numpy.reshape",
"numpy.arange",
"torch.from_numpy",
"numpy.zeros",
"torch.sigmoid",
"torch.nn.Parameter",
"numpy.min",
"torch.nn.i... |
junjc9/PSG | [
"4149b846c1dc19fe67fd8ff3939738ef04a2524a"
] | [
"train.py"
] | [
"# camera-ready\n\nimport sys\n\nfrom datasets import DatasetTrain, DatasetVal # (this needs to be imported before torch, because cv2 needs to be imported before torch for some reason)\n\nsys.path.append(\"./model\")\nfrom deeplabv3 import DeepLabV3\n\nsys.path.append(\"./utils\")\nfrom utils import add_weight_deca... | [
[
"torch.optim.Adam",
"torch.nn.CrossEntropyLoss",
"matplotlib.pyplot.title",
"matplotlib.use",
"torch.utils.data.DataLoader",
"torch.from_numpy",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"torch.autograd.Variable",
"matplotlib.pyplot.ylabel",
"numpy.mean",
... |
AndresQuichimbo/landlab | [
"39fee962ec962a389ae4522a55a17f53a0d37a6e"
] | [
"landlab/components/overland_flow/generate_overland_flow_kinwave.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Landlab component for overland flow using the kinematic-wave approximation.\n\nCreated on Fri May 27 14:26:13 2016\n\n@author: gtucker\n\"\"\"\n\n\nimport numpy as np\n\nfrom landlab import Component\n\n\nclass KinwaveOverlandFlowModel(Component):\n \"\"\"Calculate water flow over... | [
[
"numpy.sign",
"numpy.where",
"numpy.sqrt"
]
] |
EdmundLuan/CLF_CBF_NMPC_python | [
"9e89e585b67055f31e9324815a5267ed4c29894d"
] | [
"observer.py"
] | [
"import numpy as np\nimport math\n\nclass Observer:\n \"\"\"\n A simple observer that assumes targets move in straight lines at a constant speed.\n\n Take in full observation, return estimated full states and estimated velocities.\n\n Attributes: \n observation_history : emmmmm... \n ve... | [
[
"numpy.array"
]
] |
sirmammingtonham/ai_and_society_final_proj | [
"f6cb6fd1ce163292441745b99fcbee01ce1e8814"
] | [
"classification/detection.py"
] | [
"\"\"\"\nEvaluates a folder of video files or a single file with a xception binary\nclassification network.\n\nUsage:\npython detect_from_video.py\n -i <folder with video files or path to video file>\n -m <path to model file>\n -o <path to output folder, will write one or multiple output videos there>\n\nA... | [
[
"torch.nn.Softmax",
"numpy.mean",
"torch.max",
"torch.load"
]
] |
topikuu/scikit-fem | [
"3b244831001604bed87e93e88495fba1d950161d"
] | [
"skfem/io/meshio.py"
] | [
"\"\"\"Import any formats supported by meshio.\"\"\"\n\nimport warnings\n\nimport meshio\nimport numpy as np\n\nimport skfem\n\n\nMESH_TYPE_MAPPING = {\n 'tetra': skfem.MeshTet,\n 'hexahedron': skfem.MeshHex,\n 'triangle': skfem.MeshTri,\n 'quad': skfem.MeshQuad,\n 'line': skfem.MeshLine,\n 'tetra... | [
[
"numpy.ascontiguousarray",
"numpy.sort",
"numpy.nonzero",
"numpy.unique"
]
] |
hxyue1/Nonlinear-Statistical-Coupling | [
"fe3076e68f72579e647ca6abe05542bf4b9fab46"
] | [
"nsc/math/entropy.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nfrom .function import coupled_logarithm, coupled_exponential\n\n\ndef importance_sampling_integrator(function, pdf, sampler, n=10000, rounds=1, seed=1):\n \"\"\"\n \n\n Parameters\n ----------\n function : TYPE\n DESCRIPTION.\n pdf : TYPE\n ... | [
[
"numpy.mean",
"numpy.sum",
"numpy.random.seed"
]
] |
agartland/tcrdist2 | [
"77ab0036a3f8f3951093a3bb14741d961ae14eda"
] | [
"tcrdist/tests/test_mixcr.py"
] | [
"import pytest\nfrom tcrdist.repertoire import TCRrep\nfrom tcrdist import mixcr\nimport numpy as np\nimport pandas as pd\nimport os\n\n# INTEGRATION TESTS\ndef test_mixcr_to_tcrdist_on_clones():\n test_clones = os.path.join('tcrdist','test_files_compact','SRR5130260.1.test.fastq.output.clns.txt')\n df = mixc... | [
[
"pandas.Series",
"pandas.DataFrame"
]
] |
dvtxc/fibresem | [
"7c763bc7a153ad382a182cdb7b43614e11182f07"
] | [
"fibresem/matplotlib_scalebar/scalebar.py"
] | [
"\"\"\"\nArtist for matplotlib to display a scale / micron bar.\n\nExample::\n\n >>> fig = plt.figure()\n >>> ax = fig.add_axes([0.0, 0.0, 1.0, 1.0])\n >>> ax.imshow(...)\n >>> scalebar = ScaleBar(0.2)\n >>> ax.add_artist(scalebar)\n >>> plt.show()\n\nThe following parameters are available for customiza... | [
[
"matplotlib.offsetbox.AuxTransformBox",
"matplotlib.rcsetup.ValidateInStrings",
"matplotlib.rcParams.get",
"matplotlib.artist.Artist.__init__",
"matplotlib.rcsetup.defaultParams.update",
"matplotlib.RcParams",
"matplotlib.patches.Rectangle",
"matplotlib.font_manager.FontProperties"... |
toddkarin/vocmax | [
"00ba93acf67d03d6a3e8e5055a006accc5629159"
] | [
"vocmax/nsrdb.py"
] | [
"\nimport numpy as np\nimport pandas as pd\nimport glob\nimport os\nimport webbrowser\nimport time\n\n# import sys\n# import matplotlib\n# matplotlib.use('TkAgg')\n# import matplotlib.pyplot as plt\nimport pytz\n\ndef make_lat_long_grid(lat_lims=[-124,-66], lon_lims=[25, 47], lat_step=1, lon_step=1 ):\n \"\"\"\n... | [
[
"pandas.read_csv",
"numpy.sqrt",
"numpy.min",
"numpy.cos",
"pandas.DataFrame",
"numpy.dtype",
"numpy.max",
"numpy.diff",
"pandas.DataFrame.from_dict",
"numpy.load",
"numpy.array"
]
] |
CypHelp/TestNewWorldDemo | [
"ee6f73df05756f191c1c56250fa290461fdd1b9a"
] | [
"PythonBaseDemo/dataVisualizationDemo/19.5/plot_gdp_compare.py"
] | [
"# coding: utf-8\n#########################################################################\n# 网站: <a href=\"http://www.crazyit.org\">疯狂Java联盟</a> #\n# author yeeku.H.lee kongyeeku@163.com #\n# #\n# ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.text",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
NCTUyoung/Codes-for-Lane-Detection | [
"1f49c957accd2244f7dfe9dd2bf8c6e5a4d4da84"
] | [
"ERFNet-CULane-PyTorch/demo.py"
] | [
"import os\nfrom erf_settings import *\nimport numpy as np\nfrom tools import prob_to_lines as ptl\nimport cv2\nimport models\nimport torch\nimport torch.nn.functional as F\nfrom options.options import parser\nimport torch.backends.cudnn as cudnn\nimport torchvision.transforms as transforms\nfrom PIL import Image\n... | [
[
"torch.nn.functional.softmax",
"torch.load",
"numpy.asarray",
"torch.nn.Module.load_state_dict",
"torch.autograd.Variable"
]
] |
GaIbatorix/Quantum-SVM | [
"30e2d7378ac6e19a4ba062b92970a9e8033ad525"
] | [
"utils.py"
] | [
"# Created by Dennis Willsch (d.willsch@fz-juelich.de) \n# Modified by Gabriele Cavallaro (g.cavallaro@fz-juelich.de) \n\nimport sys\nimport re\nimport json\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import roc_auc_score,average_precision_score,precision_recall_curve,roc_c... | [
[
"sklearn.metrics.roc_auc_score",
"numpy.abs",
"numpy.asarray",
"numpy.arange",
"numpy.set_printoptions",
"sklearn.metrics.precision_recall_curve",
"numpy.genfromtxt",
"numpy.sign",
"numpy.atleast_2d",
"numpy.sort",
"numpy.argmax",
"numpy.argpartition",
"sklearn.... |
DanielJHaar/pythonpracticejun2020 | [
"24e2501fab559841c976eca07bd1900b356c3336"
] | [
"NP_ZerosOnes.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Jun 28 12:09:18 2020\r\n\r\n@author: danie\r\n\"\"\"\r\n\r\n\r\nimport numpy as np\r\ndim = tuple(map(int,input().split()))\r\n\r\nprint(np.zeros(dim, dtype = np.int))\r\nprint(np.ones(dim, dtype = np.int))"
] | [
[
"numpy.zeros",
"numpy.ones"
]
] |
intersun/CoDIR | [
"5b2abd49e92536d486324bd802b7ee6ff272e9b5"
] | [
"fairseq_cli/train.py"
] | [
"#!/usr/bin/env python3 -u\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"\nTrain a new model on one or across multiple GPUs.\n\"\"\"\n\nimport logging\nimport math\nimport os... | [
[
"torch.cuda.set_device",
"numpy.random.seed",
"torch.multiprocessing.spawn",
"torch.manual_seed",
"scipy.stats.pearsonr",
"sklearn.metrics.matthews_corrcoef",
"torch.cuda.device_count",
"torch.cat",
"torch.cuda.is_available",
"scipy.stats.spearmanr",
"sklearn.metrics.f1... |
cstorm125/thxxwiki | [
"394f8c0df773dd097fbd3fdd970954e99155e97e"
] | [
"align_sentences.py"
] | [
"import argparse\nimport glob\nimport numpy as np\nimport pandas as pd\nfrom tqdm.auto import tqdm\nfrom preprocess import rm_useless_spaces\nimport tensorflow_hub as hub\nimport tensorflow_text\nimport tensorflow as tf # tensorflow 2.1.0\n\n# #debug\n# class A:\n# def __init__(self):\n# self.max_n=3\n... | [
[
"tensorflow.matmul",
"tensorflow.argmax",
"pandas.concat",
"pandas.DataFrame"
]
] |
HaMF/bbfmr | [
"90bea743ac549828495354091145c025e3da3ee7"
] | [
"complex_model.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Apr 28 14:07:02 2016\n\n@author: hannes.maierflaig\n\"\"\"\n\nimport operator\nfrom lmfit.model import Model, Parameter, _align, _ensureMatplotlib, warnings\nfrom lmfit.model import ModelResult as ModelResultBase\nfrom lmfit.minimizer import Minimizer\nimport matplot... | [
[
"matplotlib.pyplot.gca",
"numpy.asarray",
"numpy.asfarray",
"numpy.isscalar",
"matplotlib.pyplot.GridSpec",
"matplotlib.pyplot.figure"
]
] |
ctrasd/Panda-2020-gold-medal-solution | [
"cab252b149f05d29e7321911bec3d8f314bd16b5"
] | [
"train_efficient_reg.py"
] | [
"from __future__ import print_function, absolute_import\r\nimport os\r\nimport sys\r\nimport time\r\nimport datetime\r\nimport argparse\r\nimport os.path as osp\r\nimport numpy as np\r\nimport random\r\nfrom PIL import Image\r\nimport tqdm\r\nimport cv2\r\n\r\nimport torchvision as tv\r\nimport torch.nn.functional ... | [
[
"torch.nn.SmoothL1Loss",
"numpy.hstack",
"numpy.fromfile",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.ones",
"torch.utils.data.DataLoader",
"torch.tensor",
"torch.set_num_threads",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.transpose",
"torch.nn.Da... |
rhayes777/PyAutoF | [
"87f56419348833b285b00da1a524e329588e0b01"
] | [
"test_autofit/graphical/gaussian/conftest.py"
] | [
"import numpy as np\nimport pytest\n\nimport autofit as af\nfrom test_autofit.graphical.gaussian.model import Gaussian, make_data\n\n\n@pytest.fixture(\n name=\"x\"\n)\ndef make_x():\n return np.arange(100)\n\n\n@pytest.fixture(\n name=\"y\"\n)\ndef make_y(x):\n return make_data(Gaussian(centre=50.0, in... | [
[
"numpy.arange"
]
] |
HrBlack/NMT_Pytorch | [
"2652958fbd4cf382ae54f6ce57e9b8ebcd9ace92"
] | [
"translate.py"
] | [
"import os\nimport logging\nimport argparse\nimport numpy as np\nfrom tqdm import tqdm\n\nimport torch\nfrom torch.serialization import default_restore_location\n\nfrom seq2seq import models, utils\nfrom seq2seq.data.dictionary import Dictionary\nfrom seq2seq.data.dataset import Seq2SeqDataset, BatchSampler\n\n\nde... | [
[
"torch.ones",
"torch.cat",
"torch.manual_seed",
"torch.serialization.default_restore_location",
"torch.no_grad",
"torch.where",
"torch.topk",
"numpy.where"
]
] |
kenchan0226/control-sum-cmdp | [
"5181e8e0c9bf6bef48f66457e06d3f398f4a428a"
] | [
"predict.py"
] | [
"import torch\nimport config\nimport argparse\nimport pickle as pkl\nfrom utils import io\nfrom utils.io import Many2ManyDatasetWithAttributes\nfrom torch.utils.data import DataLoader\nimport os\nfrom os.path import join\nfrom model.seq2seq import Seq2SeqModel\nfrom model.seq2seq_style_input import Seq2SeqModelStyl... | [
[
"torch.load",
"torch.manual_seed",
"torch.no_grad",
"torch.cuda.is_available",
"torch.device"
]
] |
denricoNBHS/stem | [
"06a8e0cc2064a9ffa9d2b85c969e6b224f0e90d1"
] | [
"projects/ascii/to_ascii.py"
] | [
"from PIL import Image\nimport numpy as np\n\ndef to_ascii(infile, width=80, outfile=None, font_ratio=.43):\n \n # ASCII character gradient from light to dark\n gradient = \" .:-=+*#%@\"\n\n # open the image\n img = Image.open(infile)\n \n # determine aspect ratio of image\n aspect = img.wi... | [
[
"numpy.array"
]
] |
Microsoft/fairlearn | [
"594f42ba4e30c40ef1a61e739686c2d401a03bfa"
] | [
"test/unit/metrics/test_create_group_metric_set.py"
] | [
"# Copyright (c) Microsoft Corporation and Fairlearn contributors.\n# Licensed under the MIT License.\n\nimport json\nfrom test.unit.input_convertors import conversions_for_1d\n\nimport pytest\nimport sklearn.metrics as skm\n\nfrom fairlearn.metrics import MetricFrame\nfrom fairlearn.metrics._group_metric_set impor... | [
[
"sklearn.metrics.roc_auc_score"
]
] |
GimpelZhang/git_test | [
"78dddbdc71209c3cfba58d831cfde1588989f8ab"
] | [
"notebooks/SLAM/extended_kalman_filter.py"
] | [
"\"\"\"\n\nExtended kalman filter (EKF) localization sample\n\nauthor: Atsushi Sakai (@Atsushi_twi)\n\nhttps://github.com/AtsushiSakai/PythonRobotics/blob/master/Localization/extended_kalman_filter/\n\"\"\"\n\nimport math\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Covariance for EKF:\n# 运动模型协方差:\nQ... | [
[
"numpy.diag",
"numpy.hstack",
"numpy.linalg.inv",
"numpy.linalg.eig",
"numpy.arange",
"numpy.eye",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.plot",
"numpy.deg2rad",
"numpy.random.randn",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.axi... |
idraper/Physics-Project | [
"6bd800813a060ada7026040e9d58150865a7327d"
] | [
"wave_math.py"
] | [
"import numpy as np\nimport sys, math\nsys.setrecursionlimit(3000)\n\nclass Math():\n\tdef __init__(self, amps, sfs):\n\t\tself.amplitudes = amps\n\t\tself.N = len(self.amplitudes)\n\t\tself.sample_frequency = sfs\n\t\tself.nyquist_limit = self.sample_frequency / 2\n\t\tself.calc_parts()\n\t\tself.calc_mag()\n\t\ts... | [
[
"numpy.log2",
"numpy.cos",
"numpy.sin",
"numpy.append",
"numpy.pow"
]
] |
JinhuaSu/todomanager | [
"accacb9f2d2d09ec7595c869e822fb26ab0a187b"
] | [
"src/read_todo_excel.py"
] | [
"#%%\nimport pandas as pd\ndf = pd.read_excel(\"../data/tomatodo_history_765.xlsx\",)\ndf\n# %%\n\ncol_names = [\"专注时间\",\"待办名称\",\"专注时长(分钟)\",\"心得\",\"状态\",\"完成度\"]\ndf_new = df.iloc[6:,1:]\ndf_new.columns = col_names\ndf_new.index = range(len(df_new))\ndf_new\n\n# %%\n# 心得最好包含尽可能多的信息,心得可以是一个json格式,直接读\n# 类型等填表,或者... | [
[
"pandas.read_excel",
"pandas.to_datetime",
"pandas.read_csv"
]
] |
Modelmat/frc-characterization | [
"76cd65b777eb2d3eb151d923dee7c297fb552514"
] | [
"frc_characterization/logger_analyzer/data_analyzer.py"
] | [
"# This GUI analyzes the data collected by the data logger. Support is\n# provided for both feedforward and feedback analysis, as well as diagnostic\n# plotting.\n\nimport copy\nimport json\nimport logging\nimport math\nimport os\nimport tkinter\nfrom tkinter import *\nfrom tkinter import filedialog\nfrom tkinter ... | [
[
"numpy.radians",
"numpy.concatenate",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.square",
"matplotlib.pyplot.tight_layout",
"numpy.ceil",
"matplotlib.pyplot.subplot",
"numpy.copysign",
"matplotlib.pyplot.figure",
"numpy.min",
"numpy.floor",
"numpy.array",
... |
trallard/ChooseViz | [
"07a3a0b6318b9480720705a9d31d2d475fba3762"
] | [
"plots/boxplot-1d/py/plot.py"
] | [
"import matplotlib.pyplot as plt\nimport pandas as pd\n\ndata = pd.read_csv('../../../data/data.csv')\n\nfig, ax = plt.subplots(1)\nbp = ax.boxplot(data['Height'],\n\t whis=1.5,\n\t showmeans=True)\nfig.savefig('plot.png')"
] | [
[
"pandas.read_csv",
"matplotlib.pyplot.subplots"
]
] |
fastyangmh/SeriesBAGAN | [
"c8d4a72fdeabb42697b03b8012209314a1f3f66c"
] | [
"data_preparation.py"
] | [
"#import\nfrom argparse import Namespace\nfrom os.path import join\nfrom glob import glob\nimport pandas as pd\nfrom FlowCal.io import FCSData\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom torch.utils.data import Dataset, DataLoader\nfrom typing import TypeVar\nfrom pytorch_lightni... | [
[
"torch.utils.data.DataLoader",
"sklearn.model_selection.train_test_split",
"numpy.concatenate",
"torch.cuda.is_available",
"numpy.where"
]
] |
j6mes/NeuralDB | [
"d912c4d3ccecb093dd8ad2ca9c4724d89dd89115"
] | [
"modelling/src/neuraldb/final_scoring.py"
] | [
"#\n# Copyright (c) 2021 Facebook, Inc. and its affiliates.\n#\n# This file is part of NeuralDB.\n# See https://github.com/facebookresearch/NeuralDB for further info.\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 ma... | [
[
"pandas.set_option",
"pandas.DataFrame",
"pandas.pivot_table"
]
] |
jjmata/robosat | [
"6b38bcf5cbf13bf79c06624d30600df12cfdd486"
] | [
"robosat/datasets.py"
] | [
"\"\"\"PyTorch-compatible datasets.\n\nGuaranteed to implement `__len__`, and `__getitem__`.\n\nSee: http://pytorch.org/docs/0.3.1/data.html\n\"\"\"\n\nimport torch\nfrom PIL import Image\nimport torch.utils.data\n\nfrom robosat.tiles import tiles_from_slippy_map, buffer_tile_image\n\n\n# Single Slippy Map director... | [
[
"torch.IntTensor",
"torch.cat"
]
] |
asahtik/manus-core | [
"f62f53cb604cf71411bde40d2f717e7bdc8b2a27"
] | [
"python/manus/__init__.py"
] | [
"\nimport manus.messages as messages\n\nimport numpy as np\n\nNAME = 'Manus'\nVERSION = 'N/A'\n\ntry:\n with open('/usr/share/manus/version', 'r') as f:\n VERSION = f.read()\nexcept IOError:\n pass\n\nclass MoveTo(object):\n def __init__(self, location, rotation = None, grip=0, speed=1.0):\n ... | [
[
"numpy.identity",
"numpy.cos",
"numpy.matmul"
]
] |
philstenning/openCV-face | [
"c62dd5b1bdf430b8e4da7ccfc3b11083238ab4de"
] | [
"headless_road.py"
] | [
"import numpy as np\nimport cv2\nimport time\n# from simple_pid import PID\n\ncap = cv2.VideoCapture(0)\n# cap = cv2.VideoCapture('http://192.168.55.6:8080/video')\n\n# set res of camera\nsettings = {\n \"window_x\": 320,\n \"window_y\": 240,\n \"crop_window_height\": 80,\n \"contrast_high\": 255,\n ... | [
[
"numpy.zeros",
"numpy.ones"
]
] |
iamatulsingh/QnA-web-api | [
"4db0388248ce5714eaa6bc518ff0b40bb5eb9cf8"
] | [
"demo/squad_seq2seq_glove_train.py"
] | [
"from keras_question_and_answering_system.library.seq2seq_glove import Seq2SeqGloveQA\nfrom keras_question_and_answering_system.library.utility.squad import SquADDataSet\nimport numpy as np\n\n\ndef main():\n random_state = 42\n output_dir_path = './models'\n\n np.random.seed(random_state)\n data_set = ... | [
[
"numpy.random.seed"
]
] |
bbw7561135/Plasma-Recipes | [
"b1cf938eea1c72a2d3a2e4c25aca0d35cb426401"
] | [
"TMz/TMz_cart.py"
] | [
"#\n# Created: 01.08.2020\n# Last modified: 06.08.2020\n# @author: Luca Pezzini\n# e-mail : luca.pezzini@edu.unito.it\n#\n\n#\n# 2D CARTESIAN TE_z MODE ON YEE MESH (FDTD)\n# Solve the Transverse Magnetic mode equation on the xy-plane (TM_z)\n# using the Finite Difference Time Do... | [
[
"matplotlib.pyplot.contourf",
"numpy.linspace",
"matplotlib.pyplot.title",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.pcolor",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlabel",
"numpy.meshgrid",
"numpy.zeros",
"matplotlib.pyplot.paus... |
alz/python-skyfield | [
"c240a22600d089bab53c3e7dcd4872fb8f6d3647",
"25d86f61d85406f1eb6cce3314bdb828e22de22c"
] | [
"skyfield/functions.py",
"skyfield/tests/test_against_novas.py"
] | [
"\"\"\"Basic operations that are needed repeatedly throughout Skyfield.\"\"\"\n\nfrom numpy import arcsin, arctan2, array, cos, load, sin, sqrt\nfrom pkgutil import get_data\nfrom skyfield.constants import tau\n\ndef dots(v, u):\n \"\"\"Given one or more vectors in `v` and `u`, return their dot products.\n\n ... | [
[
"numpy.arcsin",
"numpy.cos",
"numpy.sin",
"numpy.arctan2",
"numpy.array"
],
[
"numpy.array",
"numpy.abs",
"numpy.einsum"
]
] |
franzhaas/cmlib | [
"e313b1535d2823bc056d9b46973f6485ba781841"
] | [
"source_data/ScientificColourMaps4/nuuk/nuuk.py"
] | [
"# \n# nuuk\n# www.fabiocrameri.ch/visualisation\nfrom matplotlib.colors import LinearSegmentedColormap \n \ncm_data = [[0.013938, 0.35043, 0.55025], \n [0.020952, 0.35139, 0.54864], \n [0.027979, 0.35236, 0.54702], \n [0.035227, 0.353... | [
[
"matplotlib.colors.LinearSegmentedColormap.from_list",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
thhapke/ddathlete_di_operators | [
"7fb88db7c883e6bcdfe9d0ac1582798c7f3bd204"
] | [
"TrainingSummary/trainingsummary.py"
] | [
"from datetime import datetime\nimport math\nimport sys\n\nimport pytz\n\nimport pandas as pd\n\n\ndef on_input(msg):\n \n att = dict(msg.attributes)\n \n header = [c[\"name\"] for c in msg.attributes['table']['columns']]\n df = pd.DataFrame(msg.body, columns=header)\n df['TIMESTAMP'] = pd.to_date... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
janlight/gsoc-wav2vec2 | [
"4d241553137ba0c3ac5acb4670c5653512b17854"
] | [
"tests/test_wav2vec2.py"
] | [
"import unittest\nfrom functools import partial\n\nimport tensorflow as tf\n\nimport numpy as np\nimport tensorflow_hub as hub\nfrom convert_torch_to_tf import get_tf_pretrained_model\nfrom utils import is_torch_available, is_transformers_available, requires_lib\nfrom wav2vec2 import CTCLoss, Wav2Vec2Config, Wav2Ve... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.concat",
"numpy.max",
"torch.no_grad",
"tensorflow.random.set_seed",
"numpy.random.randint",
"numpy.allclose",
"torch.from_numpy",
"torch.tensor",
"numpy.argmax",
"tensorflow.function",
"torch.nn.Conv1d",
"tensorflow.t... |
SivaK18/MachineLearning | [
"299b5ee1f57969885f60f8d1c6461a3e97c8873b"
] | [
"logic.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Jan 30 09:19:01 2019\r\n\r\n@author: sivak\r\n\"\"\"\r\n\r\nimport numpy as np\r\ninputs = np.array([[0,0],[0,1],[1,0],[1,1]])\r\n# AND data\r\nANDtargets = np.array([[0],[0],[0],[1]])\r\n# OR data\r\nORtargets = np.array([[0],[1],[1],[1]])\r\n# XOR data\r\nXORta... | [
[
"numpy.array"
]
] |
deargen/DearCascadedWx | [
"86d4ec252b788af67ca84c665d293f426b64f826"
] | [
"src/models/ffnnrf.py"
] | [
"from models.neuralnet import SurvivalNeuralNet\n# from models.feedforwardnet import SurvivalFeedForwardNet\nfrom keras.models import Model\nfrom keras.layers import Input, Dense, Dropout\nfrom keras.regularizers import L1L2\nimport numpy as np\nimport pandas as pd\nimport _pickle as cPickle\nfrom keras.utils impor... | [
[
"numpy.argsort",
"pandas.read_csv",
"sklearn.ensemble.RandomForestClassifier"
]
] |
OmranKaddah/Disentangled-Representation-Learning | [
"cd6a2a8bf643532df6e134bafd893476d50bcc78"
] | [
"source_code/lib/dist.py"
] | [
"import math\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom lib.functions import STHeaviside\n\neps = 1e-8\n\n\nclass Normal(nn.Module):\n \"\"\"Samples from a Normal distribution using the reparameterization trick.\n \"\"\"\n\n def __init__(self, mu=0, sigm... | [
[
"torch.randn_like",
"torch.abs",
"torch.nn.functional.softmax",
"torch.sigmoid",
"numpy.log",
"torch.max",
"torch.Tensor",
"torch.cat",
"torch.rand_like",
"torch.sign",
"torch.nn.functional.logsigmoid",
"torch.exp",
"torch.nn.functional.sigmoid",
"torch.log"... |
p328188467/edenas | [
"82fc62528cb25a228d011f2e30f984969d012882"
] | [
"src/fashion_minst/micro_controller.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport sys\nimport os\nimport time\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom src.controller import Controller\nfrom src.utils import get_train_ops\nfrom src.common_ops import stack_lstm\n\... | [
[
"tensorflow.get_variable",
"tensorflow.control_dependencies",
"tensorflow.zeros",
"tensorflow.reduce_sum",
"tensorflow.tanh",
"tensorflow.to_int32",
"tensorflow.while_loop",
"tensorflow.Variable",
"tensorflow.random_uniform_initializer",
"numpy.reshape",
"tensorflow.to_... |
algorithmiaio/langpacks | [
"0e54c2680d8882053ed84e11952c0c1c3866048c"
] | [
"templates/pytorch-1.6.x-python38/src/__ALGO__.py"
] | [
"import Algorithmia\nimport torch as th\n\n\"\"\"\nExample Input:\n{\n \"matrix_a\": [[0, 1], [1, 0]],\n \"matrix_b\": [[25, 25], [11, 11]]\n}\n\nExpected Output:\n{\n \"product\": [[11, 11], [25, 25]]\n}\n\"\"\"\n\nclass InputObject:\n def __init__(self, input_dict):\n \"\"\"\n Creates an... | [
[
"torch.mm",
"torch.tensor"
]
] |
canary-for-cognition/multimodal-dl-framework | [
"7733376b05840e2b3dead438dd3981db9694b6ae"
] | [
"dataset/alzheimer/scripts/utils/rename_tobii_heatmaps.py"
] | [
"import os\nimport shutil\n\nimport pandas as pd\nfrom tqdm import tqdm\n\n\ndef get_preprocessed_file_name(filenames_to_pid_map: Dict, task: str, raw_filename: str) -> str:\n \"\"\"\n Creates and returns the PID-based file name for the preprocessed data item\n :param filenames_to_pid_map: a map from raw f... | [
[
"pandas.read_csv"
]
] |
yummydeli/machine_learning | [
"54471182ac21ef0eee26557a7bd6f3a3dc3a09bd"
] | [
"poi_mining/biz/LSA/split_by_cid.py"
] | [
"#!/usr/bin/env python\n# encoding:utf-8\n\n# ##############################################################################\n# The MIT License (MIT)\n#\n# Copyright (c) [2015] [baidu.com]\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documenta... | [
[
"pandas.read_table"
]
] |
ivan-alles/spleeter | [
"2e8fbb3105eeede6a9978bfb8c8cf651d23dec20"
] | [
"simplespleeter.py"
] | [
"\"\"\"\n Simplified version without training and architectural sugar.\n\"\"\"\n\nimport os\nimport json\n\nimport numpy as np\nimport librosa\nimport soundfile\nfrom librosa.core import istft, stft\nfrom scipy.signal.windows import hann\n\nfrom functools import partial\nfrom typing import Any, Dict, Iterable, Opti... | [
[
"numpy.expand_dims",
"tensorflow.concat",
"tensorflow.keras.layers.ELU",
"tensorflow.zeros",
"tensorflow.compat.v1.keras.initializers.he_uniform",
"numpy.concatenate",
"tensorflow.compat.v1.train.Saver",
"tensorflow.keras.layers.Concatenate",
"tensorflow.Graph",
"tensorflow... |
CrazySherman/models | [
"0bcc77dcdf504c0e7a4cbc5e29798d33ed77f693"
] | [
"research/deeplab/common.py"
] | [
"# Copyright 2018 The TensorFlow Authors All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi... | [
[
"tensorflow.gfile.Open"
]
] |
sxyd/Traffic_Control_Benchmark | [
"9f539c0101b198f2789859966a1dbdc3c6b160a2"
] | [
"utils/plot_net_trafficLights.py"
] | [
"#!/usr/bin/env python\n# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo\n# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others.\n# This program and the accompanying materials are made available under the\n# terms of the Eclipse Public License 2.0 which is available at\n# http... | [
[
"matplotlib.pyplot.plot"
]
] |
piotr-karon/realworld-starter-kit | [
"6285e4b5913fe5e99d72e9178eb4b1db246d02c9"
] | [
"experiments/render-tests-avg.py"
] | [
"#!/usr/bin/env python3\n\nimport json\nimport os\nfrom pathlib import Path\n\nimport numpy as np\nfrom natsort import natsorted\n\ntry:\n from docopt import docopt\n from marko.ext.gfm import gfm\n import pygal\n from pygal.style import Style, DefaultStyle\nexcept ImportError as e:\n raise Exception... | [
[
"numpy.max",
"numpy.min"
]
] |
threefoldtech/threebot_prebuilt | [
"1f0e1c65c14cef079cd80f73927d7c8318755c48"
] | [
"sandbox/lib/jumpscale/JumpscaleLibs/data/numtools/NumTools.py"
] | [
"from Jumpscale import j\nimport numpy\nimport struct\nimport math\n\nJSBASE = j.baseclasses.object\n\n\nclass NumTools(j.baseclasses.object):\n\n __jslocation__ = \"j.tools.numtools\"\n\n def __init__(self):\n JSBASE.__init__(self)\n self.__imports__ = \"numpy\"\n self._currencies = {}\n... | [
[
"numpy.ceil",
"numpy.interp",
"numpy.floor"
]
] |
blakezim/CAMP | [
"a42a407dc62151ab8a7eb4be3aee1318b984502c"
] | [
"camp/StructuredGridOperators/UnaryOperators/AffineTransformFilter.py"
] | [
"import torch\n\nfrom ...Core.StructuredGridClass import StructuredGrid\nfrom .ApplyGridFilter import ApplyGrid\nfrom ._UnaryFilter import Filter\n\n#TODO Check this filter to make sure the affine and translation are correct\n\n\nclass AffineTransform(Filter):\n def __init__(self, target_landmarks=None, source_l... | [
[
"torch.svd",
"torch.eye"
]
] |
drscotthawley/room-shape | [
"d2b27786bfe7639d4aff59712500b678472cf102"
] | [
"modes_from_dims.py"
] | [
"#! /usr/bin/env python\n# Author: Scott Hawley\n\n# Can the system learn the Rayleigh equation?\n# Given the dimensions of the room, can the network learn to generate a (sorted) list of resonant frequencies?\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom keras.models import Sequential, load_model\nfr... | [
[
"numpy.sqrt",
"numpy.random.seed",
"numpy.floor",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros"
]
] |
takanori-fujiwara/multidr | [
"7df887ede573af4aaad24fea19dca456d7a52ff1"
] | [
"multidr/cl.py"
] | [
"import numpy as np\nfrom scipy.stats import pearsonr\n\nfrom ccpca import CCPCA\n\n\nclass CL():\n \"\"\"TDR: Two-step dimensionality reduction (DR) to project a third-order\n tensor onto a lower-dimensional space\n\n Parameters\n ----------\n learner: Class Object for DR, optional, (default=None)\n... | [
[
"scipy.stats.pearsonr",
"numpy.array",
"numpy.sum",
"numpy.vstack"
]
] |
PhilippBongartz/ChessTransformer | [
"41b819cd97fb78205cf6fb09f005e816d2a251f7"
] | [
"chess_transformer_utils.py"
] | [
"#!/usr/bin/python\n# -*- coding: latin-1 -*-\n\nimport chess\n\nimport chess.pgn\n\nimport numpy as np\n\nimport random\n\n\n\n\n\n# all possible pairs of starting square and target square\n\ncolumn_numbers = {\n 'a':1,\n 'b':2,\n 'c':3,\n 'd':4,\n 'e':5,\n 'f':6,\n 'g':7,\n 'h':8\n}\n\ncol... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros"
]
] |
BorgwardtLab/graphkernels-review | [
"3dfc2fad64d4159722f06db11b555fc568997fcf"
] | [
"src/convert_to_text.py"
] | [
"#!/usr/bin/env python3\n#\n# convert_to_text.py: Converts a set of a graphs to a textual\n# representation in terms of their corresponding adjacencies.\n# This format is used by the MLG kernel.\n\nimport argparse\nimport glob\nimport logging\nimport os\nimport sys\nimport traceback\n\nimport igraph as ig\nimport n... | [
[
"numpy.savetxt",
"numpy.array"
]
] |
GuilleGorines/nfcore-pikavirus-legacy | [
"a588a58fa082cd1802db5271b366e7d74d19e22f"
] | [
"bin/graphs_coverage.py"
] | [
"#!/usr/bin/env python\n\n# USAGE:\n#\n# graphs_coverage.py Samplename coveragefiles\n# \n# Calculates basic coverage statistics for coverage files provided. Samplename needed for file naming.\n#\n# This script has been developed exclusively for nf-core/pikavirus, and we cannot\n# assure its functioning in any oth... | [
[
"pandas.concat",
"pandas.read_csv",
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.close",
"pandas.DataFrame.from_dict",
"matplotlib.pyplot.xlabel",
"numpy.average",
"matplotlib.pyplot.figure"
]
] |
shrenik-jain/ComVEX | [
"93622de3a4771cda13b14f8bba52990eb47c2409",
"93622de3a4771cda13b14f8bba52990eb47c2409"
] | [
"examples/EfficientDet/demo.py",
"tests/test_ViT.py"
] | [
"import os\nimport sys\n\nsys.path.insert(0, os.getcwd())\n\nimport torch \n\nfrom comvex.efficientdet import EfficientDetObjectDetectionConfig, EfficientDetObjectDetection\n\n\nif __name__ == \"__main__\":\n\n efficientdet_config = EfficientDetObjectDetectionConfig.D0(10, 20)\n efficientdet = EfficientDetObj... | [
[
"torch.randn"
],
[
"torch.randn"
]
] |
6un9-h0-Dan/pytext | [
"3b5102819bcf043dc4799ede1a4ae0b558aacb04"
] | [
"pytext/loss/loss.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nfrom enum import Enum\n\nimport torch\nimport torch.nn.functional as F\nfrom pytext.config import ConfigBase\nfrom pytext.config.component import Component, ComponentType\nfrom pytext.utils import loss as loss_utils, ... | [
[
"torch.nn.functional.kl_div",
"torch.mean",
"torch.nn.functional.softmax",
"torch.abs",
"torch.nn.functional.nll_loss",
"torch.nn.functional.margin_ranking_loss",
"torch.nn.functional.l1_loss",
"torch.sum",
"torch.tensor",
"torch.nn.functional.sigmoid",
"torch.nn.functi... |
QNLSydney/qcodes-measurements | [
"09dd8dfeaa1b413484ce058df08f99df2640271e"
] | [
"qcodes_measurements/tools/time.py"
] | [
"import time\nimport numpy as np\n\nfrom qcodes.dataset.measurements import Measurement\n\nfrom .measure import Setpoint, _flush_buffers, _run_functions, _plot_sweep\nfrom ..logging import get_logger\nlogger = get_logger(\"tools.time\")\n\ndef _interruptible_sleep(sleep_time):\n while sleep_time > 1:\n ti... | [
[
"numpy.full"
]
] |
matan-arnon/howdy | [
"bea79c00a79b286d632875338f89c1b3ba3ac277"
] | [
"howdy/src/cli/add.py"
] | [
"# Save the face of the user in encoded form\n\n# Import required modules\nimport time\nimport os\nimport sys\nimport json\nimport configparser\nimport builtins\nimport numpy as np\n\nfrom recorders.video_capture import VideoCapture\nfrom i18n import _\n\n# Try to import dlib and give a nice error if we can't\n# Ad... | [
[
"numpy.sum"
]
] |
Flsahkong/seeDiff | [
"730eaca8528d22ed3aa6b4dbc1965828a697cf9a"
] | [
"lib/model/faster_rcnn/faster_rcnn_global_local.py"
] | [
"import random\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport torchvision.models as models\nfrom torch.autograd import Variable\nimport numpy as np\nfrom model.utils.config import cfg\nfrom model.rpn.rpn import _RPN\nfrom model.roi_pooling.modules.... | [
[
"torch.nn.functional.softmax",
"torch.cat",
"torch.nn.functional.cross_entropy",
"torch.stack",
"torch.nn.functional.max_pool2d",
"torch.autograd.Variable"
]
] |
xingchenwan/nasbowl | [
"0abaa91b6ce436655a7488f75ed5aeca8df71246"
] | [
"kernels/multiscale_laplacian.py"
] | [
"from .weisfilerlehman import GraphKernels\nfrom grakel.utils import graph_from_networkx\nfrom grakel_replace.multiscale_laplacian import MultiscaleLaplacianFast as MLF, MultiscaleLaplacian as ML\nimport torch\nfrom .utils import transform_to_undirected\n\n\nclass MultiscaleLaplacian(GraphKernels):\n def __init_... | [
[
"torch.tensor"
]
] |
tiredamage42/WikiCrawler | [
"264d3511dec20bcf9c633315d3d6c93aa64cbe5c"
] | [
"dense_layer.py"
] | [
"import tensorflow.compat.v1 as tf\nimport graph_utils\ntf.disable_v2_behavior()\n\n'''\nfully connected dense layer\n'''\nclass DenseLayer():\n def __init__(self, layer_name, features):\n self.is_built = False\n self.layer_name = layer_name\n self.features = features\n\n def __call__(sel... | [
[
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.reshape",
"tensorflow.compat.v1.matmul",
"tensorflow.compat.v1.shape",
"tensorflow.compat.v1.variable_scope",
"tensorflow.compat.v1.add",
"tensorflow.compat.v1.constant"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.