repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
YigeWang-WHU/BlastLoadsRegression | [
"884ba58a31ba854eaf86b846e551a97d84b11924"
] | [
"dataset/blast_wall.py"
] | [
"from torch.utils.data import Dataset\nimport os\nimport numpy as np\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.model_selection import train_test_split\nimport torch\n\n\n\ndef make_dataset(data_root, txt, input_size, output_size, portion_train, portion_val):\n ##############################... | [
[
"numpy.array",
"sklearn.preprocessing.StandardScaler",
"numpy.split",
"numpy.arange",
"numpy.append"
]
] |
alex-kj-chin/ConstellationNet | [
"28bb44beb735654381a10c8c25d2cfdedbdb43bc"
] | [
"models/models.py"
] | [
"import torch\n\n\nmodels = {}\ndef register(name):\n def decorator(cls):\n models[name] = cls\n return cls\n return decorator\n\n\ndef make(name, **kwargs):\n if name is None:\n return None\n \n model = models[name](**kwargs)\n if torch.cuda.is_available() :\n model.cu... | [
[
"torch.cuda.is_available"
]
] |
mcglynnk/AdhereID_app | [
"7e15f695f8f17afe588abb5f9dd3cc1fa9e3ede5"
] | [
"app.py"
] | [
"# Setup\nfrom flask import Flask, render_template, request\n\nimport pandas as pd\nimport sklearn\nimport numpy as np\nimport pickle\nfrom _collections import OrderedDict\nimport requests\nfrom bs4 import BeautifulSoup\nimport re\n\nfrom required_files import res_url, conditions_list_file, drugs_list_file\n\n# Ini... | [
[
"pandas.DataFrame",
"numpy.array"
]
] |
bsmarine/BleedDetection | [
"2203e48cb8ed10adeda9fcef129560b6a907ef00"
] | [
"experiments/bleed_exp/multi_preprocessing.py"
] | [
"#!/usr/bin/env python\n# Copyright 2018 Division of Medical Image Computing, German Cancer Research Center (DKFZ).\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://... | [
[
"numpy.max",
"numpy.pad",
"numpy.array",
"numpy.round",
"pandas.DataFrame",
"numpy.mean",
"numpy.where",
"numpy.std",
"numpy.stack",
"numpy.clip",
"numpy.around",
"numpy.argwhere",
"numpy.unique"
]
] |
sanrou/fidelityWeighting | [
"3767d80ad31559264d8ff3e42407eeed863f0ebc"
] | [
"sourceFidelityAnalyses.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Aug 5 14:34:19 2021\nLoad source fidelity arrays. Do analyses.\n@author: rouhinen\n\"\"\"\n\nimport numpy as np\nimport os\nimport glob\n\n## Resolutions and path patterns\nresolutions = ['100', '200', '400', '597', '775', '942']\n\nsubjectsFolder = 'C:\\\\temp\\\\f... | [
[
"numpy.max",
"numpy.concatenate",
"numpy.median",
"numpy.load",
"numpy.min",
"numpy.mean"
]
] |
nathancy/stackoverflow | [
"e9e2e2b8fba61e41526638a13ac7ada6de2d7560"
] | [
"58133383-blur-section-using-mask/create_mask.py"
] | [
"import cv2\nimport numpy as np\n\n# Create a mask\nimage = cv2.imread('1.png')\nmask = np.zeros(image.shape, dtype=np.uint8)\ncnt = np.array([[200, 100], [350, 100], [350, 250], [200, 250]])\ncv2.fillPoly(mask, [cnt], [255,255,255])\ncv2.imwrite('newmask.png', mask)\n"
] | [
[
"numpy.array",
"numpy.zeros"
]
] |
satyam0051/preipl | [
"30b3c9a7f7de5a2ee6750fe3c002297c558d421d"
] | [
"ipl_team_win_predict.py"
] | [
"import pandas as pd\nimport numpy as np\nimport pickle as pkl\nfrom matplotlib import pyplot as plt\nfrom sklearn.svm import SVC\nfrom sklearn.tree import DecisionTreeClassifier\n\nimport seaborn as sb\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LogisticRegression\nfrom ... | [
[
"numpy.array",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.svm.SVC",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"numpy.unique"
]
] |
Anshu2711/zmc | [
"13e646cd7c69f4ce53951921e3ea18c7299c16e7"
] | [
"zmc/Zmc.py"
] | [
"import os \nimport subprocess \nimport numpy as np \nfrom random import seed \nfrom random import choice\nfrom random import random\nfrom timeit import default_timer as timer\n\n########### Defining a Zmc class that will initialize by reading all the input files #############################\nclass interval:\n ... | [
[
"numpy.multiply",
"numpy.array",
"numpy.sqrt"
]
] |
ocmadin/RJMC_2CLJQ | [
"8034cb676de429146caa1e5f080999f07f802543"
] | [
"rjmc_testcase_nested_squares.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Sep 20 18:42:58 2018\n\n@author: owenmadin\n\"\"\"\n\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Sep 20 11:33:46 2018\n\n@author: owenmadin\n\"\"\"\n\n\"\"\"\nThis code performs an RJMC model selection problem over... | [
[
"numpy.array",
"numpy.log",
"numpy.zeros",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.ones",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter",
"numpy.random.random"
]
] |
heiya7/tfnn | [
"19d604e11e5d76461570d7cc5dd105e1d9ed1964"
] | [
"tfnn/evaluating/evaluator.py"
] | [
"import tfnn\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom tfnn.evaluating.scalar_monitor import ScaleMonitor\nfrom tfnn.evaluating.layer_monitor import LayerMonitor\nfrom tfnn.evaluating.data_fitting_monitor import DataFittingMonitor\nfrom tfnn.evaluating.line_fitting_monitor import LineFittingMonitor... | [
[
"matplotlib.pyplot.ioff",
"matplotlib.pyplot.waitforbuttonpress",
"matplotlib.pyplot.close",
"matplotlib.pyplot.style.use"
]
] |
rakib045/TCarto | [
"3c3d92d09ab940e4ba89d1fc67bc30930d377a25"
] | [
"PrescribedAreaDrawing.py"
] | [
"#Best you use Anaconda. If you do not have quadprog, you have to\n#install it.. in anaconda you can use this '-c omnia quadprog '\nimport numpy as np\nimport random\n#import quadprog\nfrom sympy.geometry import *\nfrom PIL import Image, ImageDraw\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\n... | [
[
"numpy.sum"
]
] |
souljaboy764/intprim | [
"ecf905ce69dc14215230be3b3819d2236223e9ba"
] | [
"intprim/filter/spatiotemporal/ekf.py"
] | [
"##\r\n# This module defines a spatiotemporal filter based off of the extended Kalman filter.\r\n#\r\n# @author Joseph Campbell <jacampb1@asu.edu>, Interactive Robotics Lab, Arizona State University\r\nimport numpy as np\r\nimport scipy.linalg\r\n\r\nimport intprim.constants\r\nfrom intprim.filter.spatiotempora... | [
[
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.eye",
"numpy.diag"
]
] |
stumpdk/ripnfind | [
"0642232e190b6c3029da6536ea4823a17633569c"
] | [
"get_names.py"
] | [
"import pandas as pd \nimport json\n\nfirstnames = []\nlastnames = []\ndata = pd.read_csv(\"hack4dk_police_person.csv\", low_memory=False) \nfor l in data['firstnames']:\n if isinstance(l, str): \n for fname in l.split():\n if fname.find('.') == -1 and fname.find(',') == -1 and fname.find(' ') ... | [
[
"pandas.read_csv"
]
] |
TaikiMiyagawa/MSPRT-TANDEM | [
"dc337c5ffc3ae0e2feaca1da2b1760737a930c98"
] | [
"utils/misc.py"
] | [
"# MIT License\n\n# Copyright (c) 2021 Taiki Miyagawa and Akinori F. Ebihara\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 without limitation the r... | [
[
"tensorflow.config.experimental.set_visible_devices",
"tensorflow.abs",
"tensorflow.concat",
"tensorflow.where",
"tensorflow.tile",
"numpy.random.seed",
"tensorflow.random.set_seed",
"tensorflow.one_hot",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.linal... |
zilongzhong/LM-LSTM-CRF | [
"7d71abf80df1599e57b9ab77a2f2152f1341ca83"
] | [
"train_wc.py"
] | [
"from __future__ import print_function\r\nimport datetime\r\nimport time\r\nimport torch\r\nimport torch.autograd as autograd\r\nimport torch.nn as nn\r\nimport torch.optim as optim\r\nimport codecs\r\nfrom model.crf import *\r\nfrom model.lm_lstm_crf import *\r\nimport model.utils as utils\r\nfrom model.evaluator ... | [
[
"torch.cuda.set_device",
"torch.nn.CrossEntropyLoss",
"torch.load",
"torch.utils.data.DataLoader"
]
] |
Mavrikant/ros_swarm_control | [
"eae9dd6a8ea064ee46ff0c08549dd4a974fc04e4"
] | [
"swarm_control/scripts/virt_formation.py"
] | [
"#!/usr/bin/env python\n# coding=utf8\n\nimport numpy as np\nfrom swarm_msgs.msg import FormationParam\n\ndef create_virtual_structure(formation, angle=0.0, length=0., width=0.):\n \"\"\"\n Функция виртуального построения\n Virtual_formation - массив координат расположения РТП в строю\n x0,y0 - координа... | [
[
"numpy.fix",
"numpy.max",
"numpy.array",
"numpy.ceil",
"numpy.dot",
"numpy.sin",
"numpy.zeros",
"numpy.double",
"numpy.tan",
"numpy.min",
"numpy.arctan",
"numpy.arange",
"numpy.sqrt",
"numpy.cos",
"numpy.deg2rad",
"numpy.mod"
]
] |
LynnHo/VAE-Tensorflow | [
"aa908554925540f8c79c5228cde7fb306fe8868a"
] | [
"tflib/vision/dataset/mnist.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport gzip\nimport multiprocessing\nimport os\nimport struct\nimport subprocess\n\nimport numpy as np\nimport tensorflow as tf\nfrom tflib.data.memory_data import MemoryData\n\n\n_N_CPU = multiprocess... | [
[
"tensorflow.placeholder",
"numpy.fromfile"
]
] |
chriscannon9001/tablarray | [
"f07530f84a8c86abe996cdb999233ed9bb8edf7e"
] | [
"tablarray/np2ta/cbroadcast.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Feb 28 12:09:36 2020\n\n@author: chris\n\"\"\"\n# std lib\nimport attr\nimport numpy as np\n\n# broadcast loop controls\nDIMEQ = 0 # EQ dimensions\nDIMLP1 = 1 # loop over side 1\nDIMLP2 = 2 # loop over side 2\nDIMPAD1 = -1 #... | [
[
"numpy.logical_not",
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.logical_and",
"numpy.any",
"numpy.arange"
]
] |
rcchun/Mask_RCNN | [
"199a12e16fde4bdd2553f33a75eba530cbca586d"
] | [
"mrcnn/visualize_bak.py"
] | [
"\"\"\"\nMask R-CNN\nDisplay and Visualization Functions.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport sys\nimport random\nimport itertools\nimport colorsys\n\nimport numpy as np\nfrom skimage.measure import ... | [
[
"numpy.random.choice",
"numpy.random.rand",
"numpy.where",
"matplotlib.patches.Rectangle",
"numpy.concatenate",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot",
"matplotlib.lines.Line2... |
Levintsky/ARKitScenes | [
"58bf410f65bc2ae2e35e3c3d2a7c45d8b7863fca"
] | [
"depth_upsampling/sampler.py"
] | [
"import numpy as np\nimport torch.utils.data\n\n\nclass MultiEpochSampler(torch.utils.data.Sampler):\n r\"\"\"Samples elements randomly over multiple epochs\n\n Arguments:\n data_source (Dataset): dataset to sample from\n num_iter (int) : Number of times to loop over the dataset\n start_i... | [
[
"numpy.random.permutation"
]
] |
fortiema/keras-lm | [
"0e844ef7000e1459e49d34a959ab3fe5279edced"
] | [
"lm/text.py"
] | [
"from collections import Counter\nfrom concurrent.futures import ProcessPoolExecutor\nimport logging\nfrom pathlib import Path\nimport pickle\nimport re\n\nimport numpy as np\nimport spacy\nfrom spacy.attrs import ORTH\n\n\nlogger = logging.getLogger(__name__)\n\n\nclass TextDataSource:\n \"\"\"Generic source of... | [
[
"numpy.random.random",
"numpy.array",
"numpy.random.normal",
"numpy.expand_dims"
]
] |
realtwister/LearnedEvolution | [
"2ec49b50a49acae9693cfb05ac114dfbcc4aa337"
] | [
"tests/config/evaluation.py"
] | [
"import numpy as np\n\nfrom collections import namedtuple\n\nPopulation = namedtuple(\"Population\", ['mean_fitness','mean', 'covariance'])\n\nconfig = dict(\n dimension = 2,\n population_size = 100,\n algorithm = dict(\n mean_function =dict(\n type = \"RLMean\"\n ),\n covar... | [
[
"numpy.max",
"numpy.array",
"numpy.ceil",
"pandas.DataFrame",
"matplotlib.pyplot.semilogy",
"numpy.min",
"numpy.mean",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.log10",
"matplotlib.pyplot.yscale"
]
] |
melissa-sa/melissa | [
"d07c43a396267d26f52b7b152a385f8a600ac2e8"
] | [
"examples/heat_example/src/heat.py"
] | [
"#!@PYTHON_EXECUTABLE@\n\n###################################################################\n# Melissa #\n#-----------------------------------------------------------------#\n# COPYRIGHT (C) 2017 by INRIA and EDF. ALL RIGHTS RESERVED. #\n# ... | [
[
"numpy.ctypeslib.load_library"
]
] |
HarshCasper/jina | [
"97f9e97a4a678a28bdeacbc7346eaf7bbd2aeb89"
] | [
"tests/unit/drivers/test_helper.py"
] | [
"import random\n\nimport numpy as np\nimport pytest\n\nfrom jina import Document, DocumentSet\nfrom jina.proto import jina_pb2\nfrom jina.types.message import Message\nfrom jina.types.ndarray.generic import NdArray\n\n\n@pytest.fixture(scope='function')\ndef document():\n with Document() as doc:\n doc.tex... | [
[
"numpy.testing.assert_almost_equal",
"numpy.random.random",
"numpy.testing.assert_equal"
]
] |
aymgal/lenstronomy | [
"870ba77851e7b83646fdf7c50d770e45c00500ee"
] | [
"test/test_LensModel/test_Profiles/test_convergence.py"
] | [
"__author__ = 'sibirrer'\n\n\nfrom lenstronomy.LensModel.Profiles.convergence import Convergence\n\nimport numpy as np\nimport numpy.testing as npt\nimport pytest\n\n\nclass TestConvergence(object):\n \"\"\"\n tests the Gaussian methods\n \"\"\"\n def setup(self):\n self.profile = Convergence()\n... | [
[
"numpy.testing.assert_almost_equal",
"numpy.array"
]
] |
quyuanhang/match_in_chat | [
"a546c2430c88511ace4dc2e8b0d20f3b7ae3449c"
] | [
"src/utils/ShuffleData.py"
] | [
"import sys\nimport numpy as np\n\ndef load_data(fp, apd=None):\n with open(fp) as f:\n data = f.read().strip().split('\\n')\n data = [x.strip().split('\\001') for x in data]\n if apd:\n for d in data:\n d.append(apd)\n return data\n\ndef shuffle(data):\n n = len(data)\n p... | [
[
"numpy.random.permutation"
]
] |
lchenat/TSA | [
"661266ba16e06f63962b306a7c30d25f37920c2d"
] | [
"deep_rl/utils/torch_utils.py"
] | [
"#######################################################################\n# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #\n# Permission given to modify the code as long as you keep this #\n# declaration at the top #\n#######################... | [
[
"torch.zeros",
"torch.device",
"torch.rand",
"torch.arange",
"torch.nn.utils.clip_grad_norm_",
"torch.is_tensor",
"torch.tensor",
"torch.nn.functional.softmax",
"torch.log",
"torch.set_num_threads"
]
] |
Tiexin-RS/segment-with-nn | [
"f008f436e2fb3dc7a32d58dcf8bd45b5c5d8aed9"
] | [
"train/manual_infer/infer_deeplab.py"
] | [
"import logging\nimport tensorflow as tf\nfrom pathlib import Path\nimport matplotlib.pyplot as plt\nfrom segelectri.loss_metrics.loss import FocalLoss, LovaszLoss, DiceLoss, BoundaryLoss\nfrom segelectri.loss_metrics.metrics import MeanIou\n\n\ndef read_image(file_name, resize=True):\n img = tf.io.read_file(fil... | [
[
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.savefig",
"tensorflow.io.read_file",
"tensorflow.argmax",
"tensorflow.io.decode_image",
"tensorflow.one_hot",
"tensorflow.reshape",
"tensorflow.keras.models.load_model",
"tensorflow.image.resize",
"tensorflow.cast",
"matp... |
mmaguero/lang_detection | [
"edba3d8aab9c16568c338057fbb5372daf279bcc"
] | [
"src/utils/utility.py"
] | [
"#utils.py\n\nimport pandas as pd\nimport numpy as np\nimport nltk\nfrom nltk.tokenize import RegexpTokenizer\n\n\ndef intersecting_str(x,y,method='contains'):\n '''\n Set (per Guarani) with the top M most frequent words or dictionary. Then intersect|contains your text with each set. The set with the highest num... | [
[
"pandas.DataFrame",
"numpy.array"
]
] |
TheDebbio/srt-single-dish-tools | [
"a01059f888a55d4b3c9d0768d61c58ae005961ca"
] | [
"srttools/tests/test_read_config.py"
] | [
"# -*- coding: utf-8 -*-\n\n\n\nimport numpy as np\n\nfrom srttools.read_config import read_config\nimport os\nimport astropy.units as u\n\n\nclass TestConfig(object):\n @classmethod\n def setup_class(cls):\n cls.curdir = os.path.abspath(os.path.dirname(__file__))\n cls.datadir = os.path.join(cl... | [
[
"numpy.radians"
]
] |
wamiq-reyaz/facade-segmentation | [
"49112ef302108efd9813e4978d17935ee472c120"
] | [
"pyfacades/util/util.py"
] | [
"import os\n\nimport numpy as np\n\n\ndef softmax(a, axis=0):\n a = np.exp(a - a.max(axis=axis))\n a /= a.max(axis=axis)\n return a\n\n\ndef channels_first(image):\n return image.transpose(2, 0, 1)\n\n\ndef channels_last(image):\n return image.transpose(1, 2, 0)\n\n\ndef colorize(labels, colors):\n ... | [
[
"numpy.zeros"
]
] |
lcispro/FlexTensor | [
"329256e44669f36f62c72ac37d8849a841e2c007"
] | [
"flextensor/test/test_tvm_expr/grad/te-mse_loss-case1.py"
] | [
"import tvm\nimport numpy as np \nimport torch\n\nbatch_size = 3\nnum_classes = 5\nshape_size = [batch_size, num_classes]\ndtype = \"float32\"\nltype = \"int64\"\n\nA = tvm.te.placeholder(shape_size, dtype=dtype, name=\"A\", requires_grad=True)\ntargets = tvm.te.placeholder(shape_size, dtype=dtype, name=\"targets\"... | [
[
"numpy.zeros",
"torch.nn.functional.mse_loss",
"numpy.random.uniform",
"numpy.random.randint",
"torch.tensor"
]
] |
nemcekj/eeict2022 | [
"155caace09351b5bad824d85653debe12c32cd75"
] | [
"trainUnet.py"
] | [
"from torch.utils import data\nimport torch\nimport torchvision\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport pickle\nimport json\nimport matplotlib.pyplot as plt\nfrom skimage.transform import resize\nimp... | [
[
"torch.device",
"torch.sigmoid",
"torch.no_grad",
"matplotlib.pyplot.close",
"torch.optim.lr_scheduler.MultiStepLR",
"matplotlib.pyplot.figure",
"numpy.stack",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.imshow",
"m... |
wesleyktatum/chemical_properties_predictor | [
"0f9b6b3bbb634ef8cd7a66293dd5300da30829ac"
] | [
"chemicalize_scraper.py"
] | [
"import os\nimport sys\nfrom glob import glob\nimport pandas as pd\nimport zipfile\n\nfrom rdkit import Chem\nfrom rdkit.Chem import PandasTools\n\nclass ChemicalizeExtractor():\n \"\"\"\n \n \"\"\"\n def __init__(self, database_path):\n super().__init__()\n \n self.dbase_path = dat... | [
[
"pandas.DataFrame.from_dict",
"pandas.DataFrame",
"pandas.read_excel",
"pandas.Series",
"pandas.read_csv"
]
] |
kyotoor/kuzushijiness | [
"eb2ed7c2fcd1cc55940059fe5b8fc509910bd2a1"
] | [
"preprocess_kuzushiji.py"
] | [
"import numpy as np\nimport glob\nimport cv2\nimport os\n\n# resize function\n# resize pic by adding margin\ndef resize(img):\n width = int(img.shape[1])\n height = int(img.shape[0])\n \n if width == height:\n return_img = img\n elif width > height:\n return_img = np.zeros((width, w... | [
[
"numpy.zeros"
]
] |
CodingCat/mxnet | [
"658bad6521c0c32738908abd57b99cc265605b4d"
] | [
"tests/python/unittest/test_random.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.bincount",
"numpy.array",
"scipy.stats.norm.ppf",
"numpy.random.rand",
"scipy.stats.nbinom.cdf",
"numpy.log",
"numpy.zeros",
"scipy.stats.uniform.ppf",
"numpy.sum",
"numpy.float32",
"scipy.stats.expon.ppf",
"numpy.sqrt",
"scipy.stats.gamma.ppf",
"scip... |
yzy1015/Tensorflow_Template | [
"35732cf13c66465b7924339a170005094f70ea61"
] | [
"data_generator.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom PIL import Image\n\n\nclass ImgDataGen(tf.keras.utils.Sequence):\n\n def __init__(self, img_path, img_label, batch_size, preprocess_input=None,\n transform=None, shuffle=True, data_type=np.float32):\n\n self.img_path = img_path\n se... | [
[
"numpy.concatenate",
"numpy.random.shuffle"
]
] |
allenai/HyBayes | [
"9ac1b923953f471f104a4312499d007a676edc92"
] | [
"HyBayes/experiment.py"
] | [
"import copy\nimport configparser\nimport logging\nimport matplotlib.pyplot as plt\nimport pickle\nimport pymc3 as pm\n\nfrom .models.beta_bern_model import add_beta_bern_model\nfrom .models.beta_binomial_model import add_beta_binomial_model\nfrom .models.count_model import add_count_model\nfrom .models.metric_mode... | [
[
"matplotlib.pyplot.savefig",
"scipy.stats.describe",
"scipy.stats.t",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.clf"
]
] |
michhar/Machine-Learning-Workstreams | [
"dba91e4af39006ae1705f48d8cda8014b560a5b3"
] | [
"src/utils.py"
] | [
"\"\"\"\nMask R-CNN\nCommon utility functions and classes.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport sys\nimport os\nimport math\nimport random\nimport numpy as np\nimport scipy.misc\nimport scipy.ndimage\nimport ski... | [
[
"numpy.dot",
"torch.stack",
"numpy.minimum",
"numpy.multiply",
"numpy.where",
"numpy.cumsum",
"numpy.concatenate",
"numpy.max",
"numpy.divide",
"numpy.empty",
"numpy.argmax",
"numpy.arange",
"numpy.sqrt",
"numpy.array",
"numpy.pad",
"numpy.delete",
... |
SidRama/Longitudinal-VAE | [
"3b8a341da14063728dd37a8e76b4372eb5256c97"
] | [
"training.py"
] | [
"from torchvision import transforms\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data.sampler import BatchSampler\n\nimport numpy as np\nimport torch\nimport os\n\nfrom elbo_functions import deviance_upper_bound, elbo, KL_closed, minibatch_KLD_upper_bound, minibatch_KLD_upper_bound_iter\nfrom model_te... | [
[
"torch.device",
"torch.cat",
"torch.cholesky",
"numpy.empty",
"torch.unique",
"torch.no_grad",
"torch.optim.Adam",
"torch.autograd.grad",
"torch.cuda.empty_cache",
"torch.cuda.is_available",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.eye",
"numpy.... |
reubentg/545lab3 | [
"4d907594bbbfb1aba951396ecd568e0023f140f2"
] | [
"src/MPPI.py"
] | [
"#!/usr/bin/env python\n\nimport time\nimport sys\nimport rospy\nimport rosbag\nimport numpy as np\nimport utils as Utils\n\nimport torch\nimport torch.utils.data\nfrom torch.autograd import Variable\n\nfrom nav_msgs.srv import GetMap\nfrom ackermann_msgs.msg import AckermannDriveStamped\nfrom vesc_msgs.msg import ... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.sin",
"numpy.negative",
"torch.load",
"numpy.cos"
]
] |
krupaddesai/air-canvas | [
"1084a9d3b38753ad7c930b56b3e2363b5748c047"
] | [
"CVCanvas.py"
] | [
"import cv2\r\nimport numpy as np\r\nimport os\r\nimport HandTrackingModule as htm\r\n\r\nfolderPath = \"HeaderImages\"\r\nmyList = os.listdir(folderPath)\r\noverlayList = []\r\nfor path in myList:\r\n image = cv2.imread(f'{folderPath}/{path}')\r\n overlayList.append(image)\r\n\r\nheader = overlayList[0]\r\nc... | [
[
"numpy.zeros"
]
] |
bruinxiong/kornia | [
"0915bfec16425fcedf84f193aaa5c0f04fb6a8da"
] | [
"kornia/augmentation/augmentation.py"
] | [
"from typing import Callable, Tuple, Union, List, Optional, Dict, cast\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn.functional import pad\n\nfrom kornia.constants import Resample, BorderType, SamplePadding\nfrom kornia.augmentation import AugmentationBase2D\nfrom . import functional as F\nfrom . import ran... | [
[
"torch.nn.functional.pad",
"torch.tensor"
]
] |
ElsevierSoftwareX/SOFTX-D-20-00001 | [
"e578f21673decb9a40424379cf61e42736b07e13"
] | [
"src/microstructpy/meshing/trimesh.py"
] | [
"\"\"\"Triangle/Tetrahedron Meshing\n\nThis module contains the class definition for the TriMesh class.\n\n\"\"\"\n# --------------------------------------------------------------------------- #\n# #\n# Import Modules ... | [
[
"numpy.isclose",
"matplotlib.pyplot.xlim",
"numpy.argmin",
"numpy.min",
"matplotlib.pyplot.gcf",
"numpy.max",
"numpy.full",
"numpy.linalg.norm",
"numpy.nonzero",
"numpy.argmax",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.axis",
"numpy.array",
"numpy.delete"... |
Yunshan-Liu/gdplib | [
"f453abcde1906018635c2245414b707b69fa110c"
] | [
"gdplib/logical/spectralog.py"
] | [
"# coding: utf-8\n\n# # [Pyomo.GDP](./index.ipynb) Logical Expression System Demo - IR Spectroscopy Parameter Estimation\n#\n# This is a reproduction of the IR spectroscopy parameter estimation problem found in:\n#\n# > Vecchietti A. & Grossmann I. E.\n# > LOGMIP: A disjunctive 0-1 non-linear optimizer for process ... | [
[
"pandas.read_csv"
]
] |
tanlinc/opticalFlowGAN | [
"f568e531265029f2f25f223ee92e1f53c0bb52f6"
] | [
"tflib/FlowToolsColor.py"
] | [
"import numpy as np\n\ndef makeColorWheel():\n RY = 15\n YG = 6\n GC = 4\n CB = 11\n BM = 13\n MR = 6\n\n size = RY + YG + GC + CB + BM + MR\n colorwheel = np.zeros((3, size))\n\n col = 0\n # RY\n colorwheel[0, col:col+RY] = 255\n colorwheel[1, col:col+RY] = np.floor(255 * np.ara... | [
[
"numpy.max",
"numpy.isnan",
"numpy.zeros",
"numpy.where",
"numpy.arange",
"numpy.arctan2",
"numpy.sqrt",
"numpy.abs",
"numpy.floor"
]
] |
chreman/Headstart | [
"5d8b956faac4389c649f3072b5ac55aaa01644c6"
] | [
"server/workers/dataprocessing/src/streamgraph.py"
] | [
"import pandas as pd\nimport logging\nimport sys\nimport re\nimport numpy as np\n\nfrom itertools import chain\nfrom sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer\nfrom sklearn.decomposition import NMF, LatentDirichletAllocation\n\nformatter = logging.Formatter(fmt='%(asctime)s %(levelname... | [
[
"pandas.to_datetime",
"pandas.DataFrame.from_records",
"pandas.merge",
"numpy.random.seed",
"pandas.DataFrame",
"pandas.read_json",
"sklearn.decomposition.NMF",
"sklearn.decomposition.LatentDirichletAllocation",
"pandas.unique"
]
] |
VisualComputingInstitute/PARIS-sem-seg | [
"f70cccc533628349870f5fb6d5b0f76b1381392f"
] | [
"output_losses.py"
] | [
"import tensorflow as tf\n\nLOSS_CHOICES = [\n 'cross_entropy_loss',\n 'bootstrapped_cross_entropy_loss',\n 'focal_loss'\n]\n\ndef cross_entropy_loss(logits, target, void=-1):\n logits_flat = tf.reshape(logits, [-1, logits.shape[-1]])\n target_flat = tf.reshape(target, [-1])\n mask = tf.not_equal(... | [
[
"tensorflow.exp",
"tensorflow.size",
"tensorflow.not_equal",
"tensorflow.equal",
"tensorflow.reshape",
"tensorflow.constant",
"tensorflow.nn.top_k",
"tensorflow.pow",
"tensorflow.boolean_mask",
"tensorflow.nn.sparse_softmax_cross_entropy_with_logits"
]
] |
chenxu31/DCLGAN | [
"7c190091f6190cfb96579bd2bdf9ee450d0c8151"
] | [
"models/base_model.py"
] | [
"import os\nimport torch\nfrom collections import OrderedDict\nfrom abc import ABC, abstractmethod\nfrom . import networks\n\n\nclass BaseModel(ABC):\n \"\"\"This class is an abstract base class (ABC) for models.\n To create a subclass, you need to implement the following five functions:\n -- <__init__... | [
[
"torch.device",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.DataParallel"
]
] |
youngzhou1999/DI-drive | [
"73f0009503f78cfa1347fcc57b80d274a0b3824f"
] | [
"core/envs/carla_env_wrapper.py"
] | [
"import gym\nimport copy\nimport numpy as np\nfrom typing import Any, Dict, Optional\nfrom easydict import EasyDict\nfrom itertools import product\n\nfrom core.data.benchmark import ALL_SUITES\nfrom core.eval.carla_benchmark_evaluator import get_suites_list, read_pose_txt, get_benchmark_dir\nfrom .base_carla_env im... | [
[
"numpy.random.choice"
]
] |
PaccMann/paccmann_datasets | [
"0cb0cee349ffab8e227f09f7df0a8bca6a71f22e"
] | [
"pytoda/smiles/smiles_language.py"
] | [
"# Copyright 2020 Matteo Manica, Jannis Born, Ali Oskooei, Joris Cadow\n# Most parts of this file are Licenced under the MIT Licence.\n# Specifically the functions from_pretrained and save_pretrained are derivative\n# works with sources under the following licence:\n# Copyright 2018 The Open AI Team Authors and The... | [
[
"torch.cuda.is_available"
]
] |
sukritingupta/numpy | [
"bc0e4415614ef316cd0503c031de3f15931dc28c"
] | [
"numpy/typing/tests/data/pass/simple.py"
] | [
"\"\"\"Simple expression that should pass with mypy.\"\"\"\nimport operator\n\nimport numpy as np\nfrom collections.abc import Iterable\n\n# Basic checks\narray = np.array([1, 2])\n\n\ndef ndarray_func(x):\n # type: (np.ndarray) -> np.ndarray\n return x\n\n\nndarray_func(np.array([1, 2]))\narray == 1\narray.d... | [
[
"numpy.array",
"numpy.ones",
"numpy.dtype"
]
] |
santiagosilas/Flask-Bootstrap-ML-Dashboard | [
"f77b82ec6461a7eee36ecb06eff740471b7a8e4a"
] | [
"website/app/models.py"
] | [
"from sklearn.datasets import load_breast_cancer, load_boston, load_diabetes\n\n# Dictionary-like object, the interesting attributes are: \n# data:, the data to learn, \n# target: the classification labels, \n# target_names: the meaning of the labels, \n# feature_names: the meaning of the features\nds1 ... | [
[
"sklearn.datasets.load_diabetes",
"sklearn.datasets.load_boston",
"sklearn.datasets.load_breast_cancer"
]
] |
anoopjk/SFM | [
"467ad148e6813dc34faa70163dcbf45700ace082"
] | [
"src/sfm_graph/pair_graph.py"
] | [
"import numpy as np \n\nclass PairGraph(object):\n\n def __init__(self, pair_img_idxs=[], pose=np.eye(4),\n pts_3d=np.empty((0,0)), pts1_2d=np.empty((0,0)), pts2_2d=np.empty((0,0)), f=1.0):\n \n ncameras = 2\n self.f = f\n self.motion = np.zeros((ncameras,3,4))\n ... | [
[
"numpy.arange",
"numpy.empty",
"numpy.zeros",
"numpy.eye"
]
] |
elbecerrasoto/gym-automata | [
"145e9549029fe8effa827979b3f90016a681fffa"
] | [
"gym_cellular_automata/forest_fire/bulldozer/utils/render.py"
] | [
"\"\"\"\nThe render of the bulldozer consists of four subplots:\n1. Local Grid\n + Grid centered at current position, visualizes agent's micromanagment\n2. Global Grid\n + Whole grid view, visualizes agent's strategy\n3. Gauge\n + Shows time until next CA update\n4. Counts\n + Shows Forest vs No Forest ... | [
[
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.subplot2grid",
"matplotlib.pyplot.style.use",
"numpy.linspace"
]
] |
ranocha/nodepy | [
"b6cff1ff635611de76beebacd6d821788befb36b"
] | [
"nodepy/rooted_trees.py"
] | [
"from __future__ import print_function\n\nfrom __future__ import absolute_import\nimport numpy as np\nfrom sympy import factorial, sympify, Rational\n#from sage.combinat.combinat import permutations\nfrom nodepy.utils import permutations\nfrom six.moves import range\n\n#=============================================... | [
[
"numpy.ceil",
"matplotlib.pyplot.setp",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"numpy.ones",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.scatter",
"numpy.linspace",
"matp... |
akashdhruv/flowX | [
"65b752c58a9da29f8508b4056d4aa3ac6d336d41"
] | [
"flowx/imbound/_interface/visco/_force_flow.py"
] | [
"import numpy\n\nfrom . import _interface\n\ndef force_flow(gridc, gridx, gridy, scalars, particles, ibmf, ibmx, ibmy, velc, options):\n\n \"\"\"\n Subroutine to compute forces on the fluid due to the presence of the immersed boundary\n \n Arguments\n ---------\n gridc : object\n Grid object for... | [
[
"numpy.zeros_like"
]
] |
mrlt8/wyzecam | [
"8852bc55e0b134f56ef81097bd416c995dc6a46c"
] | [
"wyzecam/iotc.py"
] | [
"from typing import Any, Dict, Iterator, Optional, Tuple, Union\n\nimport enum\nimport logging\nimport pathlib\nimport time\nimport warnings\nfrom ctypes import CDLL, c_int\n\nfrom wyzecam.api_models import WyzeAccount, WyzeCamera\n\ntry:\n import av\n import av.video.frame\nexcept ImportError:\n av = None... | [
[
"numpy.rot90",
"numpy.ascontiguousarray"
]
] |
AdamSpannbauer/ncaa_color_bracket | [
"f8827b94a74fda9582d98bfdd7a6941599bb4a09"
] | [
"color_bracket.py"
] | [
"import pandas as pd\nimport json\nimport colorsys\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n#read in data\ncolor_data = pd.read_csv('data/school_color_df.csv', index_col=0)\nwith open(\"data/bracket.json\") as f:\n\tbracket = json.loads(f.read())\n\ndef gen_matchups(n):\n\t\"\"\"\n\tgenerate seed pai... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xticks"
]
] |
ChrisMorter/trieste | [
"229ebb8a308e970b2ad2f4a10429209099e3a4f8"
] | [
"docs/notebooks/asynchronous_greedy_multiprocessing.pct.py"
] | [
"# %% [markdown]\n# # Asynchronous Bayesian optimization with Trieste\n#\n# In this notebook we demonstrate Trieste's ability to perform asynchronous Bayesian optimisation, as is suitable for scenarios where the objective function can be run for several points in parallel but where observations might return back at... | [
[
"numpy.array",
"tensorflow.math.reduce_variance",
"tensorflow.zeros",
"numpy.sum",
"matplotlib.pyplot.subplots",
"tensorflow.constant",
"tensorflow.argmin",
"tensorflow.get_logger",
"numpy.atleast_2d"
]
] |
andrewli77/HAAR-A-Hierarchical-RL-Algorithm | [
"f468118e231938606593202898551035a8e60166"
] | [
"sandbox/snn4hrl/regressors/latent_regressor.py"
] | [
"import numpy as np\n\nfrom rllab.core.serializable import Serializable\nfrom rllab.core.parameterized import Parameterized\nfrom rllab.misc import logger\n\n# the regressor will be choosen to be from the same distribution as the latents\nfrom rllab.regressors.gaussian_mlp_regressor import GaussianMLPRegressor\nfro... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.mean",
"numpy.shape",
"numpy.sign",
"numpy.abs"
]
] |
FankaRoy/pyrockphy | [
"c29ebc3de25b4526b396fd477fb5dd7064cb0bda"
] | [
"critpor.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Dec 11 19:22:45 2018\r\n\r\n@author: Fanka, W. Roye T.\r\n\r\nRef: MATLAB code by T. Mukerji; \r\n function [vpcr,vscr,rocr,mcr,kcr,mucr]=critpor(vp1,vs1,ro1,vp2,vs2,ro2,\\\r\n phicr)\r\n\"\"\"\r\n#import m... | [
[
"numpy.sqrt"
]
] |
zyxsachin/pyWATTS | [
"0ecf0263a620a77c0dafbf94e1ba251bf04720be"
] | [
"pywatts/modules/profile_neural_network.py"
] | [
"import logging\nfrom typing import Dict\n\nimport tensorflow\nimport numpy as np\nimport xarray as xr\nfrom pywatts.core.base import BaseEstimator\nfrom pywatts.core.filemanager import FileManager\nfrom pywatts.utils._xarray_time_series_utils import numpy_to_xarray\n\nfrom tensorflow.keras import layers\nfrom tens... | [
[
"tensorflow.keras.layers.Conv1D",
"numpy.array",
"numpy.isnan",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.backend.square",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.SpatialDropout1D",
"tensorflow.keras.models.load_mo... |
graceon/R3Det_Tensorflow | [
"5ff8e2505aacfb9107d2c41980374385dc0200ba"
] | [
"libs/networks/build_whole_network.py"
] | [
"# -*-coding: utf-8 -*-\n\nfrom __future__ import absolute_import, division, print_function\n\nimport os\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\nimport numpy as np\n\nfrom libs.networks import resnet, resnet_gluoncv, mobilenet_v2, xception\nfrom libs.box_utils import anchor_utils, generate... | [
[
"tensorflow.reshape",
"tensorflow.cast",
"tensorflow.contrib.slim.l2_regularizer",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.train.Saver",
"tensorflow.contrib.slim.get_model_variables",
"tensorflow.variable_scope",
"numpy.array",
"tensorflow.py_func",
"numpy.... |
aishikhar/avalanche | [
"39c361aba1663795ed33f093ab2e15cc5792026e",
"39c361aba1663795ed33f093ab2e15cc5792026e"
] | [
"avalanche/benchmarks/classic/core50.py",
"avalanche/training/strategies/ar1.py"
] | [
"################################################################################\r\n# Copyright (c) 2021 ContinualAI. #\r\n# Copyrights licensed under the MIT License. #\r\n# See the accompanying LICENSE file for terms. ... | [
[
"torch.utils.data.dataloader.DataLoader"
],
[
"torch.nn.CrossEntropyLoss",
"torch.cat",
"torch.tensor",
"torch.utils.data.DataLoader"
]
] |
wjsi/mars-profiling | [
"1accb00c90da67b46ad98ea1592fecc524625454"
] | [
"tests/issues/test_issue587.py"
] | [
"\"\"\"\nTest for issue 587:\nhttps://github.com/pandas-profiling/pandas-profiling/issues/587\n\"\"\"\nimport pandas as pd\nimport pytest\n\nfrom mars_profiling import config\nfrom mars_profiling.model.base import get_counts, is_numeric\n\n\n@pytest.mark.skipif(\n int(pd.__version__.split(\".\")[0]) < 1, reason=... | [
[
"pandas.__version__.split",
"pandas.Series"
]
] |
jattenberg/SternPythonDataScience2018 | [
"78dbb8190faaf3946aac56efa2dd181554165e7d"
] | [
"ds_utils/features_pipeline_3.py"
] | [
"import logging\nimport re\nfrom collections import Counter, OrderedDict\nimport numpy as np\nimport chardet\nfrom pandas import DataFrame\nfrom html2text import html2text\nimport os\nimport functools\n\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom sklearn.pipeline import Pipeline, FeatureUnion, m... | [
[
"sklearn.preprocessing.StandardScaler",
"numpy.percentile",
"sklearn.preprocessing.PolynomialFeatures",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.pipeline.FeatureUnion",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.feature_extraction.text.TfidfVectorizer",
"nump... |
liwt31/Renormalizer | [
"123a9d53f4f5f32c0088c255475f0ee60d02c745"
] | [
"renormalizer/tests/parameter_PBI.py"
] | [
"import numpy as np\n\nfrom renormalizer.utils import Quantity, constant\nfrom renormalizer.model import MolList, Mol, Phonon\n\n\ndef construct_mol(nmols, dmrg_nphs, hartree_nphs) -> MolList:\n assert dmrg_nphs + hartree_nphs == 10\n elocalex = Quantity(2.13 / constant.au2ev)\n dipole_abs = 1.0\n\n # c... | [
[
"numpy.array",
"numpy.argsort",
"numpy.sqrt"
]
] |
georgetown-analytics/DC-Criminalistics | [
"9238523c8e4eb1f4e7225921096f9c65b12a4ae7"
] | [
"ingest-data-progs/ingest_weather_data.py"
] | [
"\"\"\"\nThis program ingests weather data from Dark Sky API using DC crime data.\n\"\"\"\nimport json\nimport pandas as pd\nimport requests\nimport sqlite3\n\ndef formatCrimeData():\n \"\"\"\n Import crime data and format date/time of crime for Dark Sky API calls.\n \"\"\"\n crime_zip = zipfile.ZipFile... | [
[
"pandas.io.json.json_normalize",
"pandas.read_csv"
]
] |
secretppcdc/secretppcdc.github.com | [
"0e00d7a02b177bfe1932bab1ff68096e2acf6f05"
] | [
"Recommend System/source code/DropoutNet-master/DropoutNet-master/utils.py"
] | [
"import time\nimport datetime\nimport numpy as np\nimport scipy\nimport tensorflow as tf\nfrom sklearn import preprocessing as prep\n\n\nclass timer(object):\n def __init__(self, name='default'):\n \"\"\"\n timer object to record running time of functions, not for micro-benchmarking\n usage ... | [
[
"numpy.concatenate",
"tensorflow.local_variables_initializer",
"numpy.ones_like",
"numpy.asarray",
"numpy.log",
"sklearn.preprocessing.StandardScaler",
"numpy.sum",
"numpy.copy",
"numpy.absolute",
"scipy.sparse.lil_matrix"
]
] |
AlexHerger/self-driving-truck | [
"0d6870ea8d00eb5daa89deee2ce0b8fe4d04783b"
] | [
"annotate/common.py"
] | [
"from __future__ import print_function, division\n\nimport sys\nimport os\nsys.path.append(os.path.join(os.path.dirname(__file__), '..'))\n\nfrom lib import replay_memory\nfrom lib import util\nimport Tkinter\nfrom PIL import Image, ImageTk\nimport numpy as np\nimport cPickle as pickle\nimport time\nimport imgaug a... | [
[
"numpy.maximum",
"numpy.zeros",
"numpy.clip"
]
] |
dlshu/RS-GAN-v1 | [
"1e992755d78e24ce6bf53f9ee2a665747017593d"
] | [
"model/conv_bn_relu.py"
] | [
"import torch.nn as nn\n\nclass ConvBNRelu(nn.Module):\n \"\"\"\n Building block used in HiDDeN network. Is a sequence of Convolution, Batch Normalization, and ReLU activation\n \"\"\"\n def __init__(self, channels_in, channels_out, stride=1):\n\n super(ConvBNRelu, self).__init__()\n \n ... | [
[
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d"
]
] |
Shahaf11111/retinanet | [
"48e1680c84aeec479db79d8a1645c05b90136b9f"
] | [
"visualize.py"
] | [
"import numpy as np\nimport torchvision\nimport time\nimport os\nimport copy\nimport pdb\nimport time\nimport argparse\n\nimport pandas as pd\n\nimport sys\nimport cv2\n\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import datasets, models, transforms\n\nfrom retinanet.dataloader... | [
[
"numpy.array",
"torch.__version__.split",
"pandas.DataFrame",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.transpose",
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.DataParallel"
]
] |
s-mostafa-a/PartiallyReversibleUnet | [
"f01a27bac14fc90780bf688cfd2e7f869a81ecf2"
] | [
"bratsDataset.py"
] | [
"import torch\nimport torch.utils.data\nimport h5py\nimport numpy as np\nimport time\nimport random\nimport dataProcessing.augmentation as aug\n\nclass BratsDataset(torch.utils.data.Dataset):\n #mode must be trian, test or val\n def __init__(self, filePath, expConfig, mode=\"train\", randomCrop=None, hasMasks... | [
[
"numpy.asarray",
"numpy.zeros",
"torch.from_numpy",
"numpy.transpose",
"numpy.argmax",
"numpy.squeeze",
"numpy.expand_dims"
]
] |
loserbbb/1-stage-wseg | [
"f1579be241986c1e19420bfbf6711b6c2208d99a"
] | [
"models/mods/pamr.py"
] | [
"import torch\nimport torch.nn.functional as F\nimport torch.nn as nn\n\nfrom functools import partial\n\n#\n# Helper modules\n#\nclass LocalAffinity(nn.Module):\n\n def __init__(self, dilations=[1]):\n super(LocalAffinity, self).__init__()\n self.dilations = dilations\n weight = self._init_... | [
[
"torch.zeros",
"torch.cat",
"torch.abs",
"torch.nn.functional.softmax",
"torch.nn.functional.pad",
"torch.nn.functional.conv2d"
]
] |
nf-core/spatialtranscriptomics | [
"40e2fe8125edad3036687a6043074b97252371f7"
] | [
"bin/scPreprocess.py"
] | [
"#!/usr/bin/env python\n\n# Load packages\nimport argparse\nimport scanpy as sc\nimport numpy as np\nimport pandas as pd\nimport scipy.stats\nfrom matplotlib import pyplot as plt\nfrom scipy.sparse import csr_matrix\n\n\n# Parse command-line arguments\nparser = argparse.ArgumentParser(\n description='Preprocess ... | [
[
"numpy.load",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"pandas.Series",
"pandas.read_csv",
"scipy.sparse.csr_matrix"
]
] |
chili-chiu/napari | [
"eb6e672975ce105ac0125f71da3d0970d17cefb9"
] | [
"napari/utils/_tests/test_proxies.py"
] | [
"from unittest.mock import patch\n\nimport numpy as np\nimport pytest\n\nfrom napari.components.viewer_model import ViewerModel\nfrom napari.utils._proxies import PublicOnlyProxy, ReadOnlyWrapper\n\n\ndef test_ReadOnlyWrapper_setitem():\n \"\"\"test that ReadOnlyWrapper prevents setting items\"\"\"\n d = {'hi... | [
[
"numpy.random.random",
"numpy.array"
]
] |
DavidWalz/scikit-optimize | [
"85bfd98760232570285644c1e86ef4d63fd270d7"
] | [
"skopt/tests/test_space.py"
] | [
"import pytest\nimport numbers\nimport numpy as np\nimport os\nimport yaml\nfrom tempfile import NamedTemporaryFile\n\nfrom numpy.testing import assert_array_almost_equal\nfrom numpy.testing import assert_array_equal\nfrom numpy.testing import assert_equal\nfrom numpy.testing import assert_raises_regex\n\nfrom skop... | [
[
"numpy.nextafter",
"numpy.array",
"numpy.ones_like",
"numpy.zeros_like",
"numpy.asarray",
"numpy.zeros",
"numpy.random.RandomState",
"numpy.testing.assert_equal",
"numpy.testing.assert_array_equal",
"numpy.testing.assert_raises_regex",
"numpy.float64",
"numpy.allclo... |
gkaancan/self-balanced-waiter-robot- | [
"9cc2fef49613698171869502abf1bf788f823076"
] | [
"self_balancing_waiter_robot/scripts/mapping.py"
] | [
"#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\npoint_array = np.loadtxt(\"/home/kaan/points_cloud.txt\")\n\n\n\nplt.plot(point_array[1],point_array[0])\nplt.xlabel(\"Time\")\nplt.ylabel(\"velocity\")\nplt.show()\n\n\n"
... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.loadtxt",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
bveitch/EpidPy | [
"455cd67afa2efbb774300115abb5fc7d4600b37d"
] | [
"dataset_builder.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Jul 4 11:55:56 2020\n\ndescription : Models and adds sample bias to epidemic data. \nauthor : bveitch\nversion : 1.0\nproject : EpidPy (epidemic modelling in python)\n\nUsage: \n Create synthetics for data fitting\n \n\"\"\... | [
[
"numpy.max",
"numpy.sum",
"numpy.arange"
]
] |
um-dsp/Morphence | [
"781d84ebc884ee3053a0355adfbd20312c627308"
] | [
"Copycat/Framework/oracle/model.py"
] | [
"#torch\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass CNN(nn.Module):\n \"\"\"Sample model.\"\"\"\n\n def __init__(self):\n super(CNN, self).__init__()\n\n self.conv_layer = nn.Sequential(\n\n # Conv Layer block 1\n nn.Conv2d(in_channels=3, ... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.Dropout2d"
]
] |
leehsiu/nerfactor | [
"87f7d3ffa56bdbca925958a4b89e249d35006c80"
] | [
"nerfactor/networks/embedder.py"
] | [
"# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"tensorflow.linspace"
]
] |
LemurPwned/VISM | [
"4d1e6b68d2bf1f9f3a09ce42c531ed2ce1d16400"
] | [
"video_utils/video_composer.py"
] | [
"import PIL\nimport skvideo.io as skv\nimport skimage.io as ski\nfrom skimage import color\nimport numpy as np\nimport os\nimport glob\n\n\nclass Movie:\n def __init__(self, directory, fformat='.png', cleanup=True):\n self.directory = directory\n self.filename = \"\"\n self.format = fformat\... | [
[
"numpy.array"
]
] |
mawanda-jun/IntelligentOCR | [
"ccb9838744ea829ca1b01dae8ba1525a489fd6c4"
] | [
"extract_pages_from_pdf.py"
] | [
"\"\"\"\nThe first step of the pipeline lead us to generate good images from pdf to do inference and OCR.\nTo avoid memory leak - as the user can upload very large pdf files - I've decided to use tue utility\npdftoppm and access one page at a once.\nThen the pages are beautified - this part can be better, since the... | [
[
"numpy.asarray"
]
] |
EoRImaging/GleamPlusFullSpectrum | [
"2da591dc063621b78a648ace486cef0bdf0c7f81"
] | [
"scripts/gleam_low_freq_fits.py"
] | [
"from pyradiosky import SkyModel, utils\nimport numpy as np\nfrom astropy.table import Table, setdiff\nfrom astropy.utils.diff import report_diff_values\nfrom astropy.io import fits\nfrom operator import itemgetter\nimport numpy.polynomial.polynomial as poly\nimport matplotlib.pyplot as plt\nimport plotly.graph_obj... | [
[
"numpy.delete",
"numpy.array",
"numpy.isnan",
"numpy.polynomial.polynomial.polyval",
"numpy.polynomial.polynomial.polyfit",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"numpy.diff",
"numpy.nanmean",
"numpy.arange",
"numpy.sqrt",
"numpy.isfinite",
"n... |
parolaraul/itChallengeML2017 | [
"c7e5d65ff5f9207342158dc2818638062ce3c220"
] | [
"Argentina - Mondiola Rock - 90 pts/Practica/TP2/ejercicio 7/busqueda_local.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nHeurísticas de búsqueda local\n\n@author: Germán L. Osella Massa (german.osella at nexo.unnoba.edu.ar)\n\"\"\"\n\nimport numpy as np\nfrom random import random\n\ndef hill_climb(solucion_inicial, evaluacion, obtener_vecinos):\n \"\"\"\n Hill climbing determinístico.\n \"\"... | [
[
"numpy.exp"
]
] |
XuanxuanGao/esvit | [
"a8328a283dc33c7cf80f556b0112d01482c9ab2b"
] | [
"esvit_embeddings.py"
] | [
"# coding=utf-8\n\n# Modified by Chunyuan Li (chunyl@microsoft.com)\n#\n# Copyright (c) Facebook, Inc. and its affiliates.\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# ... | [
[
"torch.nn.functional.normalize",
"torch.cat",
"torch.distributed.get_world_size",
"torch.distributed.init_process_group",
"torch.utils.data.DistributedSampler",
"torch.no_grad",
"torch.distributed.all_gather",
"torch.cuda.set_device",
"torch.utils.data.DataLoader",
"torch.d... |
doubleblind148/IGCCF | [
"bc0e90a5322f1ba4927ec89d9181190974f7e1ba"
] | [
"recgve/losses/tensorflow_losses.py"
] | [
"#!/usr/bin/env python\n__author__ = \"XXX\"\n__email__ = \"XXX\"\n\nimport tensorflow as tf\n\n\n@tf.function\ndef bpr_loss(x_u, x_i, x_j):\n \"\"\" Create BPR loss for a batch of samples\n\n Args:\n x_u (tf.Tensor): tensor containing user representations\n x_i (tf.Tensor): tensor containing po... | [
[
"tensorflow.nn.l2_loss",
"tensorflow.multiply",
"tensorflow.reduce_sum",
"tensorflow.math.log_sigmoid"
]
] |
PyJedi/PyLensing | [
"33ac22bb741564f77933f047614c4c8d4d2b6d37"
] | [
"lensing/gen_data_vortex.py"
] | [
"# Author: Pranath Reddy\n# This module is for generating galaxy-galaxy strong lensing images with vortex substructure\n\nimport numpy as np\nimport autolens as al\nimport matplotlib.pyplot as plt\nimport math\nimport scipy.io\nimport h5py\nimport os\nfrom progress.bar import Bar\nfrom astropy.cosmology import Flat... | [
[
"matplotlib.pyplot.imsave",
"numpy.save",
"numpy.asarray",
"numpy.sqrt"
]
] |
Fosstack/vmaf | [
"e13b6c383ec20dba0cbd64d3265cfe49677a6f18"
] | [
"python/vmaf/core/feature_extractor.py"
] | [
"from abc import ABCMeta, abstractmethod\nfrom xml.etree import ElementTree\n\nfrom vmaf.tools.decorator import override\n\n__copyright__ = \"Copyright 2016-2020, Netflix, Inc.\"\n__license__ = \"BSD+Patent\"\n\nimport re\nimport numpy as np\nimport ast\n\nfrom vmaf import ExternalProgramCaller\nfrom vmaf.core.exec... | [
[
"numpy.isinf",
"numpy.array",
"numpy.isnan",
"numpy.hstack",
"numpy.vstack"
]
] |
gcpeixoto/ICD | [
"bae7d02cd467240649c89b0ba4440966fba18cc7"
] | [
"_build/jupyter_execute/ipynb/15-otimizacao.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Otimização\n\n# ## Introdução\n# \n# Problemas de otimização (POs) são encontrados em diversas situações da Engenharia, em particular na Engenharia de Produção. Em uma linha de produção, por exemplo, a otimização de custos com logística, recursos humanos, matéria-prima... | [
[
"numpy.full",
"numpy.sin",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"numpy.exp",
"numpy.hypot",
"matplotlib.pyplot.ylabel",
"numpy.sqrt",
... |
yyyyangyi/CNNs-for-Multi-Source-Remote-Sensing-Data-Fusion | [
"28f229513a759a8c9b60d67c463c6d3672bfb85f"
] | [
"data/dataset_houston.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n\n# Load Houston data set\n\n\nimport os\nimport numpy as np\nimport gdal\nfrom common import Config\n\nX_TRAIN_FILE = 'X_train.npy'\nX_TEST_FILE = 'X_test.npy'\nY_TRAIN_FILE = '2018_IEEE_GRSS_DFC_GT_TR.tif'\nY_TEST_FILE = 'Test_Labels.tif'\n\nSAMPLE_H = Config.sample_h\nS... | [
[
"numpy.array"
]
] |
Claude0311/fdtd | [
"4938423ed73226e45d20589a206324a5259bf79a"
] | [
"fdtd/visualization.py"
] | [
"\"\"\" visualization methods for the fdtd Grid.\n\nThis module supplies visualization methods for the FDTD Grid. They are\nimported by the Grid class and hence are available as Grid methods.\n\n\"\"\"\n\n## Imports\n\n# plotting\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as ptc\n\n# relative\nfrom... | [
[
"matplotlib.pyplot.xlim",
"matplotlib.patches.Rectangle",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.figl... |
ppontisso/Keras-progressive_growing_of_gans | [
"e82c8d3529903463d9888fa18c98151ca0937254"
] | [
"Progressive growing of GANs/h5tool.py"
] | [
"# Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.\n#\n# This work is licensed under the Creative Commons Attribution-NonCommercial\n# 4.0 International License. To view a copy of this license, visit\n# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to\n# Creative Commons, PO Box 1866,... | [
[
"numpy.ceil",
"numpy.zeros",
"numpy.round",
"numpy.exp2",
"numpy.log2"
]
] |
coleman2246/camera-calibration | [
"438220d8db61bb20d74b9ce7e24d70895d762312"
] | [
"generate_calibration.py"
] | [
"import threading\nimport multiprocessing\nfrom multiprocessing import Process, Queue\n\nimport numpy as np\nimport cv2\nimport glob\n\n\n\nclass CameraCalibrator:\n def __init__(self, filename, save_format = \"pickle\"):\n self.format = save_format\n acceptable_formats = [\"pickle\",\"yaml\",\"jso... | [
[
"numpy.zeros"
]
] |
BPTIlt/NERF_for_difficult_objects | [
"a7e8176b43e84d8483f0abdac3ca79acdbf65030"
] | [
"train.py"
] | [
"import os, sys\nfrom opt import get_opts\nimport torch\nfrom collections import defaultdict\n\nfrom torch.utils.data import DataLoader\nfrom datasets import dataset_dict\n\n# models\nfrom models.nerf import Embedding, NeRF\nfrom models.rendering import render_rays\n\n# optimizer, scheduler, visualization\nfrom uti... | [
[
"torch.cat",
"torch.stack",
"torch.utils.data.DataLoader",
"torch.no_grad"
]
] |
MatiMoreyra/tensorflow-yolov4-tflite | [
"6b747d65b8dbc6848bcb05ab529d84445e25e782"
] | [
"convert_trt.py"
] | [
"from absl import app, flags, logging\nfrom absl.flags import FLAGS\nimport tensorflow as tf\nphysical_devices = tf.config.experimental.list_physical_devices('GPU')\nif len(physical_devices) > 0:\n tf.config.experimental.set_memory_growth(physical_devices[0], True)\nimport numpy as np\nimport cv2\nfrom tensorflo... | [
[
"tensorflow.python.compiler.tensorrt.trt_convert.TrtGraphConverterV2",
"tensorflow.random.normal",
"tensorflow.compat.v1.ConfigProto",
"tensorflow.compat.v1.InteractiveSession",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.python.compiler.tensorrt.trt_convert.DEFAULT_TRT... |
andrewfullard/tardis | [
"39994c0a509650c1300474590e05e53d979ae2ac"
] | [
"tardis/widgets/tests/test_shell_info.py"
] | [
"import pytest\nimport numpy as np\nimport pandas.testing as pdt\n\nfrom tardis.widgets.shell_info import (\n BaseShellInfo,\n SimulationShellInfo,\n HDFShellInfo,\n ShellInfoWidget,\n)\n\n\n@pytest.fixture(scope=\"class\")\ndef base_shell_info(simulation_verysimple):\n return BaseShellInfo(\n ... | [
[
"pandas.testing.assert_frame_equal"
]
] |
rusty1s/pytorch_sparse | [
"7c15c3cdac46e9653ecf29a5eda6af45432fd85e"
] | [
"setup.py"
] | [
"import os\nimport sys\nimport glob\nimport os.path as osp\nfrom itertools import product\nfrom setuptools import setup, find_packages\n\nimport torch\nfrom torch.__config__ import parallel_info\nfrom torch.utils.cpp_extension import BuildExtension\nfrom torch.utils.cpp_extension import CppExtension, CUDAExtension,... | [
[
"torch.cuda.is_available",
"torch.__config__.parallel_info",
"torch.utils.cpp_extension.BuildExtension.with_options"
]
] |
haje01/distper | [
"bac4a24b2378600096de5ae0f8c0eae0c9c40034"
] | [
"actor.py"
] | [
"\"\"\"액터 모듈.\"\"\"\nimport os\nimport time\nimport pickle\nfrom io import BytesIO\nfrom collections import defaultdict\n\nimport zmq\nimport numpy as np\nimport torch\n\nfrom common import ReplayBuffer, PrioReplayBuffer, ENV_NAME, ActorInfo,\\\n calc_loss, get_logger, DQN, async_recv, weights_init, array_experi... | [
[
"numpy.array",
"torch.max",
"torch.tensor",
"torch.load",
"numpy.random.random"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.