repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
piotrmarciniak1998/MachineLearningCourse
[ "7f587145f20afe49a3fd29f91c704ee761491459" ]
[ "machine_learning_course/lab_03_2.py" ]
[ "from sklearn import datasets\nimport pandas as pd\nimport numpy as np\n\nX, y = datasets.load_iris(return_X_y=True, as_frame=True)\nprint(X.describe()) # Opis\n\nprint(X.head()) # 5 pierwszych próbek\nprint(X.tail()) # 5 ostatnich próbek\n" ]
[ [ "sklearn.datasets.load_iris" ] ]
IfyAnene7/pypkgs_isa
[ "d1d346f4da54a49735915f90fc19dbdb6695850f" ]
[ "tests/test_pypkgs_isa.py" ]
[ "from pypkgs_isa import __version__\nfrom pypkgs_isa import pypkgs_isa\nimport pandas as pd\n\ndef test_version():\n assert __version__ == '0.1.0'\n \n\ndef test_catbind():\n a = pd.Categorical([\"character\", \"hits\", \"your\", \"eyeballs\"])\n b = pd.Categorical([\"but\", \"integer\", \"where it\", \...
[ [ "pandas.Categorical" ] ]
damien2012eng/deploy-ml-model-windows10
[ "9f03df226046023b92bf27089cb04baf79a04dfe" ]
[ "app.py" ]
[ "from flask import Flask ,render_template,url_for,request\nimport numpy as np \nimport pickle\n\napp = Flask(__name__)\nmodel = pickle.load(open('model.pkl','rb'))\n\n# Home Route\n@app.route('/')\ndef home():\n\treturn render_template('home.html')\n\n# prediction\n@app.route('/predict',methods=['POST'])\ndef predi...
[ [ "numpy.array" ] ]
karthickrock/Namma-food
[ "1e144b1317f673a06ef0e3533f4c36e2bdc7cd13" ]
[ "label_image.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\...
[ [ "tensorflow.Graph", "tensorflow.image.resize_bilinear", "tensorflow.import_graph_def", "tensorflow.read_file", "tensorflow.gfile.GFile", "numpy.squeeze", "tensorflow.cast", "tensorflow.image.decode_png", "tensorflow.expand_dims", "tensorflow.image.decode_bmp", "tensorfl...
CAVED123/reinvent-scaffold-decorator
[ "37d0a8a571cc633a54b8a1d90884763bf503c347" ]
[ "train_model.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n\n\"\"\"\nScript to train a model\n\"\"\"\n\nimport argparse\nimport os.path\nimport glob\nimport itertools as it\n\nimport torch\nimport torch.utils.tensorboard as tbx\n\nimport collect_stats_from_model as csfm\n\nimport models.model as mm\nimport models.actions as ma\n\nim...
[ [ "torch.utils.tensorboard.SummaryWriter", "torch.optim.lr_scheduler.StepLR" ] ]
JulianKlug/scop
[ "b0d6a805a11ee8b4d0f53a4d6a5ec402988298e4" ]
[ "exploratory_experiments/outcome/with_lesion_input/cross_validate_with_ground_truth_lesion.py" ]
[ "import os\nimport shutil\nimport tempfile\nfrom datetime import datetime\nimport numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import StratifiedKFold\n\nfrom keras_scope.test import test\nfrom utils.utils import ensure_dir, save_dataset\nfrom keras_scope.train import train\n\ndef cross_validate_wi...
[ [ "pandas.read_excel", "numpy.expand_dims", "pandas.DataFrame", "sklearn.model_selection.StratifiedKFold", "numpy.load", "numpy.array", "numpy.random.randint" ] ]
nerdneilsfield/2D-3D-pose-tracking
[ "33678c775e53360116099d43cf0712072b53a25f" ]
[ "afm/scripts/modeling/output/output.py" ]
[ "import modeling.registry as registry\nfrom modeling.registry import OUTPUT_METHODS\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os.path as osp\nimport os\nimport scipy.io as sio\n\n@OUTPUT_METHODS.register(\"display\")\ndef display(data_dict, cfg):\n image = data_dict['image'] \n # image_resi...
[ [ "matplotlib.pyplot.imshow", "numpy.sqrt", "matplotlib.pyplot.ylim", "scipy.io.savemat", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.axis", "numpy.array", "matplotlib.pyplot.show", "numpy.where" ] ]
Mrhsk/cpsc2021
[ "dcb7fb23edf7df79549279d053e4a8cadab3b268" ]
[ "utils/aux_metrics.py" ]
[ "\"\"\"\nauxiliary metrics for the task of qrs detection\n\nReferences\n----------\n[1] http://2019.icbeb.org/Challenge.html\n\"\"\"\nimport math\nimport multiprocessing as mp\nfrom typing import Union, Optional, Sequence, Dict\nfrom numbers import Real\n\nimport numpy as np\nimport torch\n\nfrom torch_ecg.torch_ec...
[ [ "numpy.abs", "torch.device", "numpy.array", "numpy.where", "numpy.sum", "numpy.zeros" ] ]
sdyinzhen/AutoBEL
[ "213011ef8c6d2bcc16ac92a263e615f4a7033ff4" ]
[ "source_code/plt_MC_models_smpls.py" ]
[ "#Author: David Zhen Yin\n#Contact: yinzhen@stanford.edu\n#Date: Apri 03, 2019\n\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\n\ndef m_ensampl_plt(m_smpls_pos, m_smpls_pri, layernum, i_dim, j_dim, k_dim, dobs):\n ''' \n Plot the the ensemble mean and variance of prior and p...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.imshow", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.yticks", "matplotlib.pyplot.title", "numpy.min", "numpy.around", "matplotlib.pyplot.colorbar", "numpy.max", "matplotlib.pyplot.subplot", "numpy.mean", "matplotl...
chcorophyll/general_image_process_python
[ "0ab3b3da246808c36822d31fa0fd226f8d4079ab" ]
[ "HaarCascade.py" ]
[ "\"\"\"\nReferences:\nhttps://github.com/Simon-Hohberg/Viola-Jones/tree/master/violajones\nhttps://medium.datadriveninvestor.com/understanding-and-implementing-the-viola-jones-image-classification-algorithm-85621f7fe20b\nhttps://github.com/aparande/FaceDetection\n\"\"\"\nimport math\nimport pickle\nfrom multiproces...
[ [ "numpy.array", "numpy.zeros", "numpy.linalg.norm", "sklearn.feature_selection.SelectPercentile" ] ]
JackFurby/VGG-Concept-Bottleneck
[ "c916b29f99e0a70622ac2b5dbeb54b8cce332f70" ]
[ "CUB/dataset.py" ]
[ "\"\"\"\nGeneral utils for training, evaluation and data loading\n\"\"\"\nimport os\nimport torch\nimport pickle\nimport numpy as np\nimport torchvision.transforms as transforms\n\nfrom PIL import Image\nfrom CUB.config import BASE_DIR, N_ATTRIBUTES\nfrom torch.utils.data import BatchSampler\nfrom torch.utils.data ...
[ [ "numpy.arange", "torch.utils.data.DataLoader", "torch.multinomial", "torch.DoubleTensor", "numpy.zeros" ] ]
Software-project-management-substation/BNN
[ "f175b8bf267d98b2c62e78922c51f7209ef912db" ]
[ "BilinearCNN/CUB_200.py" ]
[ "import os\r\nimport pickle\r\nimport numpy as np\r\nimport PIL.Image\r\n# from tqdm import tqdm\r\nimport torch.utils.data\r\n\r\nclass CUB_200(torch.utils.data.Dataset):\r\n def __init__(self, file_path, train=True, transform=None, target_transform=None):\r\n self.file_path = file_path\r\n self.t...
[ [ "numpy.array" ] ]
xiulianalways/python-machineLearn
[ "ef13791d002e22fa5c4122e9faf2762d51096828" ]
[ "Perceptron01.py" ]
[ "#coding:utf-8\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom chapter01.Perceptron import Perceptron\nfrom matplotlib.colors import ListedColormap\n\n#数据下载网址:https://archive.ics.uci.edu/ml/machine-learning-databases/iris/\ndef get_flowers_feature():\n '''\n iris.data中一共包含了1...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.pyplot.contourf", "matplotlib.pyplot.scatter", "numpy.unique", "numpy.arange", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "numpy.where", "matplotlib.pyplot.ylabel" ] ]
BrambleXu/japanese-company-lexicon
[ "562731b793b5ba9ac564c530f27a5c7d6c7bafe3" ]
[ "tools/convert_csv2jsonl.py" ]
[ "import os\nimport json\nimport unicodedata\nfrom typing import List\nfrom collections import OrderedDict, Counter, defaultdict\n\nimport pandas as pd\nfrom tqdm import tqdm\n\nfrom settings import ROOT_DIR\n\ndtypes = {'sequenceNumber': int, 'corporateNumber': int, 'process': int, 'correct': int, 'updateDate': str...
[ [ "pandas.read_csv" ] ]
adekunleba/dabl
[ "c4bfc23ba2be11763a2600c7d2a7a0059cb2251c" ]
[ "dabl/plot/utils.py" ]
[ "from warnings import warn\nfrom functools import reduce\nimport itertools\n\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Rectangle\nfrom seaborn.utils import despine\n\n\n# from sklearn.dummy import DummyClassifier\n# from sklearn.metrics import recall...
[ [ "numpy.asarray", "pandas.DataFrame", "sklearn.tree.DecisionTreeClassifier", "numpy.mean", "numpy.histogram", "pandas.crosstab", "matplotlib.pyplot.gca", "matplotlib.colors.to_rgb", "numpy.unique", "numpy.arange", "numpy.ceil", "matplotlib.pyplot.cm.tab10", "skle...
zhouzhibo0117/apollo
[ "f7a2369315a2bf106e473ced7392f4542f4ff3a3" ]
[ "modules/tools/plot_planning/imu_acc.py" ]
[ "#!/usr/bin/env python3\n\n###############################################################################\n# Copyright 2019 The Apollo 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...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
eavise-kul/lightnet
[ "d2d5d3fff8f929c3683c34f176217649375b98e1" ]
[ "test/test_networks.py" ]
[ "#\n# Test if network forward function runs\n# Copyright EAVISE\n#\n\nimport inspect\nimport pytest\nimport torch\nimport lightnet as ln\n\nclassification_networks = ['Darknet', 'Darknet19', 'Darknet53', 'MobileDarknet19', 'MobilenetV1', 'MobilenetV2']\nanchor_detection_networks = ['DYolo', 'MobilenetYolo', 'Mo...
[ [ "torch.rand", "torch.cuda.is_available" ] ]
zacharymartinot/ssht_numba
[ "12eb0130bd1debf22ea1b13d1f1eec1b1f4ca11c" ]
[ "tests/test_numba_wrappers.py" ]
[ "\"\"\"\nTests the numba wrapper functions against the equivalent pyssht functions\nusing random input data.\n\"\"\"\n\nimport numpy as np\nimport pyssht\n\nimport ssht_numba as sshtn\n\nL = 180\ns = -1\n\n\ndef test_everything():\n # Test indexing functions\n ind2elm_check = [pyssht.ind2elm(i) == sshtn.ind2e...
[ [ "numpy.abs", "numpy.allclose", "numpy.random.seed", "numpy.random.randn", "numpy.empty" ] ]
bingrao/advance_optimization
[ "cb3706bdd28714ed1ccb28951c6b9d8f6b58045a" ]
[ "max-coverage/src/tools/algorithms.py" ]
[ "import random\r\nimport numpy as np\r\n\r\nfrom utlis.data import get_mask\r\nfrom utlis.data import get_binary_array_with_sum\r\nfrom utlis.data import convert_numpy\r\n\r\n\r\n# nums: the numbers of sub-set selected\r\n# data: the input data\r\ndef random_coverage(nums, data):\r\n cover = []\r\n covered = ...
[ [ "numpy.random.randint", "numpy.unique" ] ]
cedricconol/texthero
[ "b73ef44911205cdb19b9b60c9d40eba54989c494" ]
[ "tests/test_representation.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom texthero import representation\nfrom texthero import preprocessing\n\nfrom . import PandasTestCase\n\nimport doctest\nimport unittest\nimport string\nimport math\nimport warnings\n\n\"\"\"\nTest doctest\n\"\"\"\n\n\ndef load_tests(loader, tests, ignore):\n tests.add...
[ [ "pandas.Series" ] ]
awacha/mdscripts
[ "831bda06557fa2d5f0899fc2f6552c9e49146cef" ]
[ "src/mdscripts/extract_energy.py" ]
[ "#!/usr/bin/env python\n\nimport os\nimport re\nimport subprocess\nimport sys\nimport tempfile\n\nimport numpy as np\nimport scipy.signal\nfrom PyQt5 import QtCore, QtWidgets\nfrom matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, NavigationToolbar2QT\nfrom matplotlib.figure import Figure\n\nfrom .extrac...
[ [ "numpy.polyfit", "matplotlib.figure.Figure", "numpy.median", "numpy.ptp", "matplotlib.backends.backend_qt5agg.NavigationToolbar2QT", "numpy.std", "numpy.mean", "numpy.searchsorted", "numpy.floor", "matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg", "numpy.array", ...
jdossgollin/2018-paraguay-floods
[ "75a001e01f7cc7a725a0daafe2749d26ace71a93" ]
[ "src/get/download_mjo.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Download raw MJO data from\nhttp://www.bom.gov.au/climate/mjo/graphics/rmm.74toRealtime.txt\nand parse it\n\"\"\"\n\nimport argparse\nimport os\nfrom datetime import datetime\nimport pandas as pd\nimport xarray as xr\n\nparser = argparse.ArgumentParser() # pyl...
[ [ "pandas.read_table", "pandas.to_datetime" ] ]
joshcombes/pyquil
[ "d61b4a086c622eea21e1cfcaccacfd6a9096d5bf" ]
[ "pyquil/tests/test_quantum_computer.py" ]
[ "import itertools\n\nimport networkx as nx\nimport numpy as np\nimport pytest\n\nfrom pyquil import Program, get_qc, list_quantum_computers\nfrom pyquil.api import QVM, QuantumComputer, local_qvm\nfrom pyquil.api._quantum_computer import _get_flipped_protoquil_program, _parse_name, \\\n _get_qvm_with_topology\nf...
[ [ "numpy.mean", "numpy.sum" ] ]
lionelmessi6410/Panorama-Stitching
[ "97e862d80ef168ad9306be9df8b108c1b2a3207f" ]
[ "code/EvaluateAffineMatrix.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Aug 27 11:53:25 2017\n\n@author: HGY\n\"\"\"\n\n'''\n# EvaluateAffineMatrix.py\n# Run this script to test your ComputeAffineMatrix() function\n# using sample data. You do not need to change anything in this script.\n'''\n\nimport numpy as np\nfrom scipy.io import loa...
[ [ "numpy.asarray", "numpy.square", "scipy.io.loadmat" ] ]
tomo726/DiffAugment-stylegan_pikachu
[ "a09e54235fda1d1e17fe5d8f180509dcb3e61c06" ]
[ "generate_gif.py" ]
[ "import argparse\nimport os\nimport numpy as np\nfrom PIL import Image\n\nimport dnnlib\nfrom dnnlib import tflib\n\nfrom training import misc\n\n\ndef run(resume, output, num_rows, num_cols, resolution, num_phases, transition_frames, static_frames, seed):\n tflib.init_tf({'rnd.np_random_seed': seed})\n _, _,...
[ [ "numpy.reshape", "numpy.random.randn", "numpy.concatenate" ] ]
croberson94/tensorflow
[ "99b0d28cffba6767dc10e7864265ddcc10f0007f" ]
[ "tensorflow/python/ops/ragged/ragged_factory_ops_test.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.framework.ops.device_v2", "tensorflow.python.data.ops.dataset_ops.Dataset.from_tensor_slices", "tensorflow.python.ops.ragged.ragged_factory_ops.constant", "tensorflow.python.platform.test.main", "tensorflow.python.data.ops.multi_device_iterator_ops.MultiDeviceIterator", ...
inkydragon/taichi
[ "b5f80c2771b578c2a32b9a024a351aafc8ca7a0b" ]
[ "examples/mpm128.py" ]
[ "import taichi as ti\nimport numpy as np\n\nti.init(arch=ti.gpu) # Try to run on GPU\n\nquality = 1 # Use a larger value for higher-res simulations\nn_particles, n_grid = 9000 * quality ** 2, 128 * quality\ndx, inv_dx = 1 / n_grid, float(n_grid)\ndt = 1e-4 / quality\np_vol, p_rho = (dx * 0.5)**2, 1\np_mass = p_vol ...
[ [ "numpy.array" ] ]
Shamli28/Sales-Data-Analysis
[ "bf5e45b8e209fdfca55ec19787672cdb2add503e" ]
[ "Sales Data Analysis.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # Preparing Data for Analysis\n\n# - Perform Analysis & basically derive insights from the data\n\n# ## Data Preparation\n\n# In[2]:\n\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os # whenever we have to deal with like,say,wheneve...
[ [ "pandas.concat", "pandas.read_csv", "pandas.to_datetime", "matplotlib.pyplot.subplots", "pandas.DataFrame", "matplotlib.pyplot.plot", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel" ] ]
muxevola/imagepy
[ "d6d8cbf214f47a4a545a0d283ae393a6932c4c0f" ]
[ "imagepy/menus/Table/Statistic/statistic_plgs.py" ]
[ "from imagepy.core.engine import Table\nimport pandas as pd\nfrom imagepy import IPy\n\nclass Statistic(Table):\n\ttitle = 'Table Statistic'\n\tnote = ['snap', 'only_num', 'row_msk', 'col_msk']\n\n\tpara = {'axis':'Column', 'sum':True, 'mean':True,'max':False, \n\t\t'min':False,'var':False,'std':False,'skew':False,...
[ [ "pandas.concat", "pandas.DataFrame" ] ]
anonymous0120/attentional_pervasive_fabricate_vanish_attack
[ "fa1d6e108c5e2521f801b9d53a3194e781942e61" ]
[ "apfv/attacks/afv.py" ]
[ "# Copyright 2021 Yantao Lu\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 to in...
[ [ "torch.nn.CrossEntropyLoss", "numpy.absolute", "scipy.stats.norm.pdf", "numpy.linspace", "torch.nn.ConstantPad2d", "numpy.clip", "torch.from_numpy", "numpy.stack", "scipy.ndimage.convolve", "numpy.sign", "numpy.random.uniform", "numpy.copy", "numpy.random.rand",...
sandeepnair2812/Weibull-Time-To-Event-Recurrent-Neural-Network
[ "162f5c17f21db79a316d563b60835d178142fd69" ]
[ "python/tests/test_tensorflow.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport pytest\n\nimport tensorflow as tf\nimport numpy as np\n\nfrom wtte.objectives.tensorflow import loglik_continuous, loglik_discrete\nfrom wtte.data_generators import generate_weibull\n\n# SANITY CH...
[ [ "numpy.abs", "numpy.random.seed", "tensorflow.reduce_mean", "tensorflow.placeholder", "tensorflow.ones", "tensorflow.global_variables_initializer", "tensorflow.train.GradientDescentOptimizer", "tensorflow.reset_default_graph", "tensorflow.Session", "tensorflow.set_random_se...
ying-wen/pmln
[ "76d82dd620504ac00035d9d0dc9d752cd53518d4" ]
[ "ctr_fm.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom time import time\nfrom sklearn import metrics\nfrom sample_encoding_keras import *\nfrom utility import Options, ctr_batch_generator, read_feat_index, eval_auc\nimport tensorflow as tf\n\nopts = Options()\nprint('Loading data...')\n\n#############################\n# Se...
[ [ "tensorflow.ConfigProto", "tensorflow.GPUOptions" ] ]
yuki-inaho/zense_grpc_rgbd_ir
[ "76739df6b1a402177d2cf47c791faa252688d5b3" ]
[ "scripts/fitter/cameraparam.py" ]
[ "import numpy as np\nimport math\nimport toml\n\n\ndef get_camera_param(toml_path):\n dict_toml = toml.load(open(toml_path))\n n_camera = int(dict_toml['General']['n_camera'])\n camera_param = {}\n for i_cam in range(n_camera):\n key = 'Camera{}'.format(i_cam)\n camera_name = dict_toml[key...
[ [ "numpy.linalg.inv", "numpy.array", "numpy.identity", "numpy.zeros" ] ]
chinjui/gym_torcs
[ "64260a1963cadfd9c528e3a694629049a0c20032" ]
[ "ActorNetwork.py" ]
[ "import numpy as np\nimport math\nfrom keras.initializers import normal, identity\nfrom keras.models import model_from_json\nfrom keras.models import Sequential, Model\n# from keras.engine.training import collect_trainable_weights\nfrom keras.layers import Dense, Flatten, Input, merge, Lambda\nfrom keras.optimizers...
[ [ "tensorflow.initialize_all_variables", "tensorflow.gradients", "tensorflow.placeholder", "tensorflow.train.AdamOptimizer" ] ]
julianschumann/ae-opt
[ "611b6c893546267732a2d690df20a4cc238002e6" ]
[ "Compliance_minimization/Figure_6/autoencoder_training.py" ]
[ "import numpy as np\nfrom mpi4py import MPI\nfrom keras.models import Model\nfrom keras.layers import Input\nfrom keras.optimizers import SGD\nimport tensorflow as tf\nimport keras.backend as K \n\n## These functions are used to train specific neural netoworks\n## See Appendices A.6, A.7, and A.9 of my master thesi...
[ [ "numpy.abs", "numpy.min", "numpy.arange", "numpy.random.shuffle", "numpy.max", "numpy.copy", "numpy.random.rand", "numpy.sum", "numpy.empty", "tensorflow.GradientTape" ] ]
nsahoo/zfit
[ "fcad2578f31138f5383f7fa5de6c0f8c6b1dbaa4" ]
[ "zfit/core/data.py" ]
[ "# Copyright (c) 2021 zfit\nimport warnings\nfrom collections import OrderedDict\nfrom contextlib import ExitStack\nfrom typing import Callable, Dict, List, Mapping, Tuple, Union\n\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nimport uproot\nfrom tensorflow.python.ops import array_ops\n\n# fro...
[ [ "tensorflow.random.shuffle", "tensorflow.cast", "tensorflow.is_tensor", "pandas.DataFrame" ] ]
boehmv/UPF3
[ "9a3ce9de98cd7e9722ff7de55a783f86c7eef7c0" ]
[ "tools/leafcutter/xlsx_combine_leafcutter.py" ]
[ "#!/usr/bin/python3\nimport pandas as pd\nimport numpy as np\nimport xlsxwriter\nimport glob\nfrom functools import reduce\n\ndef get_col_widths(dataframe):\n # First we find the maximum length of the index column \n idx_max = max([len(str(s)) for s in dataframe.index.values] + [len(str(dataframe.index.name...
[ [ "pandas.merge", "pandas.read_excel", "pandas.DataFrame", "pandas.ExcelWriter" ] ]
scsven/faiss
[ "0c18622fba0a5312567380fd7df28d971f4f57d1" ]
[ "python/faiss.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n#@nolint\n\n# not linting this file because it imports * form swigfaiss, which\n# causes a ton of useless warnings.\n\nimport numpy ...
[ [ "numpy.empty", "numpy.zeros", "numpy.dtype" ] ]
stegua/dotlib
[ "754d93f16522714668e99a3c313a2acdc2cd0bd1" ]
[ "python/wd_dual_simplex.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu May 4 10:45:47 2017\n\n@author: gualandi\n\"\"\"\n\nimport numpy as np\nfrom gurobipy import Model, GRB, quicksum, tuplelist\n\ndef ComputeDistanceMatrix(n, p=2, q=1):\n \"\"\" Compute the ground distance with power p of an n*n image \"\"\"\n def m(x,y):\n ...
[ [ "numpy.zeros", "numpy.sqrt" ] ]
alvaro-budria/body2hands
[ "8ab4b206dc397c3b326f2b4ec9448c84ee8801fe" ]
[ "utils/load_utils.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\nimport json\nimport numpy as np\nimport os, sys\nimport scipy\n\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import axes3d, Axes3D\nfrom scipy.spatial.transform import Rotation as R\n\nfrom shutil import copyfile\nfrom PIL import Image,ImageDraw\nf...
[ [ "scipy.spatial.transform.Rotation.from_rotvec", "numpy.expand_dims", "numpy.reshape", "scipy.spatial.transform.Rotation.from_matrix", "numpy.linalg.norm", "numpy.concatenate", "numpy.cross", "numpy.load", "numpy.array", "numpy.zeros" ] ]
Wookhwang/Election_Predictions_Project
[ "d550e58810df192ca1ec7d08eb817afb10d63aab" ]
[ "Morpheme/KoNLPy_DataFrame.py" ]
[ "import pandas as pd\r\nimport numpy as np\r\nfrom konlpy.tag import Okt\r\nfrom sklearn.feature_extraction.text import CountVectorizer\r\nfrom tqdm import tqdm\r\n\r\n'''\r\nif __name__ == '__main__':\r\n # 각 형태소별로 분류(Tagging)해주는 Okt 객체를 불러온다.\r\n tagger = Okt()\r\n\r\n # nouns 함수를 통해 명사에 해당하는 부분만 리스트 형태로...
[ [ "sklearn.feature_extraction.text.CountVectorizer", "pandas.read_csv", "pandas.DataFrame" ] ]
Kabongosalomon/task-dataset-metric-nli-extraction
[ "2f7ecd7e1e4a456d2e23d9384f11c453653c4351" ]
[ "tdm_style_one_to_two.py" ]
[ "# Imports \nimport os\nimport json\nimport argparse\nimport time\nimport ipdb\nimport pickle\nimport logging\nfrom shutil import copyfile, rmtree, copytree\nfrom filecmp import dircmp\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sb\nimport numpy as np\nfrom tqdm import tqdm\nfrom coll...
[ [ "pandas.read_csv" ] ]
JunnYu/Paddle-AI-Writer
[ "8d211f9e60aeed323b6330065668f54350514c70" ]
[ "src/model.py" ]
[ "########################################################################################################\n# AI人工智障写作 - https://github.com/BlinkDL/AI-Writer\n########################################################################################################\n\nimport logging\nimport math\n\nimport torch\nimpor...
[ [ "torch.nn.ZeroPad2d", "torch.sigmoid", "torch.ones", "torch.nn.functional.mish", "torch.einsum", "torch.nn.Embedding", "torch.nn.LayerNorm", "torch.exp", "torch.nn.Linear", "torch.nn.functional.one_hot", "torch.clamp", "torch.cumsum" ] ]
gpspelle/huawei-AI
[ "967842796e0809fa385d218e2e901c3df05df83e" ]
[ "submissions/xgburro/regressor.py" ]
[ "\nimport numpy as np\nfrom sklearn import multioutput\nimport xgboost as xgb\n\n\nclass Regressor():\n def _init_(self):\n super()._init_()\n self.model = None\n\n def fit(self, X, y):\n # Get data and create train data loaders\n X_32 = np.array([_[1] for _ in X])\n self.mo...
[ [ "numpy.array" ] ]
learningmatter-mit/Atomistic-Adversarial-Attacks
[ "9efb2dc85c6aad03db9f43e30d0fcb478c52e590" ]
[ "robust/actlearn/pipeline.py" ]
[ "import torch as ch\nfrom torch.optim import Adam\nfrom torch.utils.data import DataLoader\n\nfrom nff.train import hooks as nff_hooks\n\nfrom robust.models import NnEnsemble, NnRegressor\nfrom robust import metrics, hooks, train, loss, attacks, data\n\n\nDEFAULT_NAME = \"train\"\nBATCH_SIZE = 50\nMAX_EPOCHS = 300\...
[ [ "torch.optim.Adam", "torch.utils.data.DataLoader" ] ]
zhouruqin/MaskNet
[ "13eba26316b3cd5f6f3aee02ebd2458d90de023e" ]
[ "learning3d/models/flownet3d.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom time import time\nimport numpy as np\nfrom .. utils import pointnet2_utils as pointutils\n\ndef timeit(tag, t):\n print(\"{}: {}s\".format(tag, time() - t))\n return time()\n\ndef pc_normalize(pc):\n l = pc.shape[0]\n centroid =...
[ [ "torch.nn.BatchNorm1d", "torch.randint", "torch.max", "torch.ones", "torch.cat", "torch.sqrt", "torch.randn", "torch.nn.ModuleList", "torch.zeros", "torch.sum", "torch.arange", "torch.nn.Conv2d", "numpy.mean", "torch.nn.BatchNorm2d", "torch.nn.Conv1d", ...
CQCL/tket
[ "3f3d7c24d9a6c9cfd85966c13dcccc8a13f92adb" ]
[ "pytket/tests/utils_test.py" ]
[ "# Copyright 2019-2022 Cambridge Quantum Computing\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "numpy.allclose", "numpy.array_equal", "numpy.vdot", "numpy.asarray", "numpy.arange", "numpy.fliplr", "numpy.real", "numpy.exp", "numpy.array", "numpy.zeros", "numpy.isclose" ] ]
r-grewal/data5709
[ "70b6842a5caf139786fa4e7dae8f4e0a22e98fdd" ]
[ "networks_td3.py" ]
[ "import os\nimport torch as T\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom typing import Tuple\n\nclass ActorNetwork(nn.Module):\n \"\"\"\n Actor network for single GPU.\n\n Methods:\n forward(state):\n Forward propogate states to obtain next ...
[ [ "torch.cat", "torch.load", "torch.nn.Linear", "torch.nn.functional.relu", "torch.cuda.is_available" ] ]
Layne-Huang/CoaDTI
[ "cf3a33347c709b21c0a330e27041cec2bc2bb600" ]
[ "code/coaDTI.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nimport torch.optim as optim\r\nimport numpy as np\r\nfrom torch_geometric.nn import TopKPooling\r\nfrom torch_geometric.nn import global_mean_pool as gap, global_max_pool as gmp\r\nfrom torch_geometric.utils import add_self_loops, degree, ...
[ [ "torch.nn.functional.softmax", "numpy.sqrt", "torch.sin", "torch.zeros", "torch.cat", "torch.nn.Embedding", "torch.device", "torch.pow", "torch.nn.Dropout", "torch.nn.CrossEntropyLoss", "numpy.argmax", "torch.nn.TransformerEncoder", "torch.arange", "torch.co...
rivernuthead/active_width_analysis
[ "fffd6c02941545cd32380453039bc567336baba0" ]
[ "active_width_analysis_v1.0.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jun 7 19:05:57 2021\n\n@author: erri\n\n\nQuesto script analizza le immagini di differenza di saturazione e calcola,\nimpostate le soglie per di attività per monte e valle, il rapporto W_Active/W\nnello spazio e nel tempo \n\"\"\"\n# Import l...
[ [ "numpy.linspace", "matplotlib.pyplot.subplots", "numpy.append", "numpy.mean", "numpy.count_nonzero", "numpy.array", "numpy.zeros" ] ]
pymontecarlo/pymontecarlo-gui
[ "1b3c37d4b634a85c63f23d27ea8bd79bf5a43a2f" ]
[ "pymontecarlo_gui/widgets/lineedit.py" ]
[ "\"\"\"\"\"\"\n\n# Standard library modules.\nimport re\nimport math\n\n# Third party modules.\nfrom qtpy import QtWidgets, QtGui, QtCore\n\nimport numpy as np\n\n# Local modules.\nfrom pymontecarlo_gui.util.validate import (\n ValidableBase,\n VALID_BACKGROUND_STYLESHEET,\n INVALID_BACKGROUND_STYLESHEET,\...
[ [ "numpy.arange" ] ]
European-XFEL/EXtra-foam
[ "f8d225db6b8923d0cce9db2b8c8a80613600b64c" ]
[ "extra_foam/pipeline/tests/test_worker.py" ]
[ "import unittest\nfrom threading import Thread\nfrom unittest.mock import MagicMock, patch\nimport multiprocessing as mp\n\nfrom . import _TestDataMixin\nfrom extra_foam.pipeline.exceptions import ProcessingError, StopPipelineError\nfrom extra_foam.pipeline.f_worker import TrainWorker, PulseWorker\nfrom extra_foam....
[ [ "numpy.testing.assert_array_equal" ] ]
borley1211/adaptune
[ "f1d389dd189cc31ad3ada8a17aee42a943075ebd" ]
[ "audapter/driver/filter.py" ]
[ "from typing import Optional\n\nimport numpy as np\nfrom nptyping import Array\nfrom pyroomacoustics.transform import STFT\n\nfrom ..domain.model import FilterModel\nfrom ..helper.config import load_settings\nfrom ..interface.driver.filter_driver import FilterDriverABC\n\nsettings = load_settings()\n\n\nclass Filte...
[ [ "numpy.dot" ] ]
madaari/memcached
[ "cb79bc92089ba4f1c50cdf4e7aafddaeae2edf97" ]
[ "coyotest/NewTest4Core/Combined/OnlySlab/plot_script_portfolio.py" ]
[ "import pandas as pd\nimport plotly.express as px\nimport plotly.graph_objects as go\nfrom plotly.subplots import make_subplots\n\ndf1 = pd.read_csv('./WithoutNekara/memcached_coverage.txt')\n\ntrace1 = go.Scatter(\n x=df1['x'],\n y=df1['y'],\n name='Without Nekara'\n)\n\ndf2 = pd.read_csv('./WithNekara/me...
[ [ "pandas.read_csv" ] ]
congve1/self-critical.pytorch
[ "d2434682f3eccc72517e0b6af326b8d53a79a898" ]
[ "train.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.utils.tensorboard import SummaryWriter\n\nimport numpy as np\n\nimport time\nimport os\nfrom six.moves import cPickle\nimpor...
[ [ "torch.nn.DataParallel", "torch.cuda.synchronize", "torch.utils.tensorboard.SummaryWriter" ] ]
cyac15/visualization_COVID19_module
[ "ad34a87085b449bd3cf4b1463693cdcbe89fdd11" ]
[ "CovidVoting/add_data.py" ]
[ "\"\"\"This module creates a base data set that add_data() build on.\nadd_data_csv(base_data, new_data, base_state_col, new_state_col,\nuse_state, how_join)\nThe purpose of this module is to prepare data for visualization\n\"\"\"\n# Import Packages\nimport pandas as pd\nimport geopandas as gpd\n\n\ndef add_data_csv...
[ [ "pandas.merge", "pandas.read_csv" ] ]
arthurmensch/scikit-learn
[ "d4c9e849ba1ab27930190d93fcfc33cc4b82470d" ]
[ "sklearn/preprocessing/_encoders.py" ]
[ "# Authors: Andreas Mueller <amueller@ais.uni-bonn.de>\n# Joris Van den Bossche <jorisvandenbossche@gmail.com>\n# License: BSD 3 clause\n\nfrom __future__ import division\n\nimport numbers\nimport warnings\n\nimport numpy as np\nfrom scipy import sparse\n\nfrom .. import get_config as _get_config\nfrom ..b...
[ [ "numpy.asarray", "numpy.issubdtype", "numpy.cumsum", "numpy.dtype", "numpy.all", "numpy.max", "numpy.zeros_like", "numpy.any", "numpy.where", "numpy.hstack", "scipy.sparse.coo_matrix", "numpy.ones_like", "numpy.unique", "numpy.arange", "numpy.insert", ...
saulmoore1/tierpsy-tracker
[ "69630c90de2e8a0b70168790f9c1198a0a644b3c" ]
[ "tierpsy/analysis/split_fov/helper.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Aug 7 17:50:47 2019\n\n@author: lferiani\n\"\"\"\n\n#%% import statements\nimport numpy as np\nimport pandas as pd\nfrom numpy.fft import fft2, ifft2, fftshift\n\n#%% constants\n\nWELLS_ATTRIBUTES = ['x','y','r','row','col',\n ...
[ [ "numpy.fft.fft2", "numpy.fft.ifft2", "numpy.linspace", "numpy.isnan", "pandas.DataFrame", "numpy.fft.fftshift", "numpy.round", "pandas.HDFStore", "pandas.DataFrame.from_dict", "numpy.meshgrid", "numpy.zeros" ] ]
isabella232/agents
[ "b2ed02d20c43a4b789a4711f4653e8421f8ba526" ]
[ "tf_agents/experimental/examples/ppo/schulman17/train_eval_lib.py" ]
[ "# coding=utf-8\n# Copyright 2020 The TF-Agents Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required ...
[ [ "tensorflow.compat.v2.keras.initializers.Orthogonal", "tensorflow.compat.v2.Variable", "tensorflow.compat.v2.compat.v1.train.AdamOptimizer", "tensorflow.compat.v2.TensorSpec" ] ]
Gusb3ll/tsukiuncen
[ "2ae6bcac3cd3c8f224d179299ef46afd9ec87b24" ]
[ "Modules/HentAI/mrcnn/visualize.py" ]
[ "\"\"\"\nMask R-CNN\nDisplay and Visualization Functions.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport sys\nimport random\nimport itertools\nimport colorsys\n\nimport numpy as np\nfrom skimage.measure import ...
[ [ "matplotlib.pyplot.imshow", "numpy.concatenate", "numpy.any", "numpy.where", "matplotlib.patches.Polygon", "matplotlib.pyplot.tight_layout", "numpy.unique", "numpy.fliplr", "numpy.arange", "matplotlib.pyplot.subplot", "matplotlib.pyplot.axis", "numpy.zeros", "ma...
yashyenugu/pensieve
[ "406174bef0957449cda1d9f0d7ca988e02f6bc16" ]
[ "sim/multi_agent_gs.py" ]
[ "import threading\nfrom time import gmtime, sleep, strftime, time\nimport load_trace\nfrom a3c_gs import ActorNetwork, CriticNetwork, compute_gradients\nfrom run_tests import run_tests\nimport env\nimport tensorflow as tf\nimport os\nimport logging\nimport numpy as np\nimport multiprocessing as mp\nfrom Queue impor...
[ [ "numpy.minimum", "numpy.abs", "numpy.reshape", "numpy.cumsum", "numpy.stack", "tensorflow.global_variables_initializer", "numpy.max", "tensorflow.Session", "numpy.array", "numpy.zeros", "numpy.roll", "numpy.vstack", "numpy.random.randint" ] ]
lordtt13/Cybint-AI-projects
[ "87ad57a2e9c432483c2256408dd15762b7897b56" ]
[ "Shoe-Classification/train_.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Nov 9 22:39:22 2019\n\n@author: tanma\n\"\"\"\n\nfrom keras.callbacks import ModelCheckpoint,LearningRateScheduler,EarlyStopping\nfrom keras.optimizers import Adam\nfrom models import model\nfrom utils import train_val_generator\nfrom matplotlib import pyplot as plt...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
wiggin66/server
[ "d32e253244be8539a087ba59fee5ab63f9f6a040" ]
[ "qa/L0_sequence_batcher/sequence_batcher_test.py" ]
[ "# Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n# notice, this list...
[ [ "numpy.dtype" ] ]
aaronique/whisky-recommender-app
[ "35c33aad472561433eedfa252e8dff5d4772b516" ]
[ "eda/eda.py" ]
[ "import os\nimport numpy as np\nimport pandas as pd\n\nfrom sklearn.decomposition import PCA\nfrom sklearn.cluster import KMeans, MeanShift, DBSCAN\n\nPROFILE_DATA = os.path.abspath('data/profile.csv')\n\ndf = pd.read_csv(PROFILE_DATA)\n\nprofile_col_names = ['smoky', 'peaty', 'spicy', 'herbal', 'oily', 'full', 'ri...
[ [ "numpy.array", "pandas.read_csv", "sklearn.decomposition.PCA", "sklearn.cluster.KMeans" ] ]
lakehanne/FormationControl
[ "0d13f641a7fa3720a5b5f38fa957472b68522258" ]
[ "balls_detector/src/tracker.py" ]
[ "#!/usr/bin/env python\n\n'''\nwe subscribe to the published centroids (/locs/tagged & /locs/detected)\nand rearrange the new centroids according to a bijective nearest neighbor rule,\nthen publish the arranged data to a new topic (/locs/ordered)\n\nAuthors:\n 1. Sleiman Safaoui\n 2. Kaveh Fathian\n 3. ...
[ [ "numpy.delete", "numpy.zeros" ] ]
ppmlguy/fastgradclip
[ "0d8bff42ab13fa3471c520a2823050ccf0ff4a21" ]
[ "fastgc/layers/norm.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass InstanceNorm(nn.Module):\n def __init__(self, num_features, eps=1e-5, affine=True):\n super(InstanceNorm, self).__init__()\n self.num_features = num_features\n self.eps = eps\n self.affine = affine\n\n if self.affine:\n ...
[ [ "torch.Tensor" ] ]
gundamMC/animius
[ "911712ddb992a5f9b00e5a00299a55baf762a9c5" ]
[ "animius/Utils.py" ]
[ "import json\nfrom os.path import join\n\nimport numpy as np\nimport psutil\nimport pynvml\nimport tensorflow as tf\nfrom tensorflow.python.tools import freeze_graph as tf_freeze_graph\nfrom tensorflow.python.tools import optimize_for_inference_lib\n\n\ndef get_system_info():\n system_info = dict()\n\n # cpu ...
[ [ "tensorflow.train.get_checkpoint_state", "tensorflow.python.tools.freeze_graph.freeze_graph", "tensorflow.gfile.Open", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.python.tools.optimize_for_inference_lib.optimize_for_inference", "tensorflow.abs", "numpy.random.permutatio...
jbustospelegri/breast_cancer_diagnosis
[ "38eb990ef716912c6acabb443e6eb5c21d9b4e0d" ]
[ "src/algorithms/classification.py" ]
[ "import numpy as np\n\nfrom typing import Callable, io, Union, Tuple\nfrom time import process_time\n\nfrom tensorflow.keras import Sequential, optimizers, callbacks\nfrom tensorflow.keras.backend import count_params, eval\nfrom tensorflow.keras.callbacks import History\nfrom tensorflow.keras.optimizers import Adam...
[ [ "tensorflow.keras.applications.resnet50.ResNet50", "tensorflow.keras.layers.GlobalAveragePooling2D", "tensorflow.keras.constraints.max_norm", "tensorflow.keras.models.Model", "tensorflow.keras.backend.count_params", "tensorflow.keras.layers.Dense", "tensorflow.keras.regularizers.L2", ...
rj-renan/renan--python-microservice
[ "61b93785dbed8192d4c79801dbf770cda6e5770f" ]
[ "server/services/math_services.py" ]
[ "import numpy as np\n\n\ndef csv_to_list(csv_string):\n \"\"\"\n Converts a string with comma-separated integer values to a Python list of integers.\n Receives\n --------\n csv_string : string\n Comma-separated integer values.\n Returns\n -------\n integer_list : list\n List of...
[ [ "numpy.array" ] ]
staaker/sympy
[ "946be880abad6186c74eb3a10d608bebbcaf0851" ]
[ "sympy/matrices/tests/test_matrices.py" ]
[ "import random\n\nfrom sympy import (\n Abs, Add, E, Float, I, Integer, Max, Min, N, Poly, Pow, PurePoly, Rational,\n S, Symbol, cos, exp, expand_mul, oo, pi, signsimp, simplify, sin, sqrt, symbols,\n sympify, trigsimp, tan, sstr, diff, Function)\nfrom sympy.matrices.matrices import (ShapeError, MatrixErro...
[ [ "numpy.array" ] ]
0h-n0/DL_benchmarks
[ "64ede26c0a9b0b30abdb22474f1af73d89449052" ]
[ "examples/nosacred_th.py" ]
[ "import sys\nimport time\nimport copy\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\n\nclass Iterator(object):\n def __init__(self, data_type, image_shape, sequence_shape, niteration,\n batch_size, ...
[ [ "torch.LongTensor", "torch.nn.CrossEntropyLoss", "numpy.random.random", "numpy.arange", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.autograd.Variable", "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.FloatTensor", "numpy.prod", "torch.nn.DataParallel", "numpy.zer...
vrmusketeers/highway-env
[ "9c2354b375d7a367239099417cfe8d79e0e97e40" ]
[ "highway_env/vehicle/uncertainty/prediction.py" ]
[ "import copy\nfrom typing import List, Tuple, Callable, Union, TYPE_CHECKING\nimport numpy as np\n\nfrom highway_env import utils\nfrom highway_env.interval import polytope, vector_interval_section, integrator_interval, \\\n interval_negative_part, intervals_diff, intervals_product, LPV, interval_absolute_to_loc...
[ [ "numpy.maximum", "numpy.minimum", "numpy.clip", "numpy.eye", "numpy.cos", "numpy.sin", "numpy.identity", "numpy.tensordot", "numpy.flip", "numpy.transpose", "numpy.array", "numpy.zeros" ] ]
yanzhaochang/ELSO
[ "0674cd62e2e87a1ea31da8cab9d0613bae273887" ]
[ "code/DMADE.py" ]
[ "import numpy as np\r\nimport pandas as pd \r\nimport random\r\nimport multiprocessing\r\nimport csv\r\nimport math \r\n\r\nfrom PyQt5.QtWidgets import *\r\n\r\nfrom keras.models import load_model\r\nfrom keras import backend as K\r\nimport matplotlib.pyplot as plt\r\n\r\n\r\n\r\n\r\nclass ADELSM(): # 代理辅助模型驱动的差分进...
[ [ "pandas.read_csv", "numpy.min", "numpy.max", "numpy.mean", "numpy.argmin", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
senden9/lsh-rs
[ "d21f0c450338f04269d6ac49ca6cfccbf71a531d" ]
[ "lsh-py/test/test_.py" ]
[ "from floky import L2, SRP, QueryResult\nimport numpy as np\nfrom scipy.spatial.distance import cdist\nfrom typing import List\n\n\ndef get_mean_collisions(results: List[QueryResult]):\n return np.mean(list(map(lambda qr: qr.n_collisions, results)))\n\n\ndef test_l2():\n # first check we don't get any error i...
[ [ "numpy.arange", "numpy.random.randn", "scipy.spatial.distance.cdist", "numpy.random.seed" ] ]
INK-USC/DIG
[ "7d732c55b9f72521f6d58f1b06e7756985bfd5f0" ]
[ "main.py" ]
[ "import sys, numpy as np, argparse, random\nsys.path.append('../')\n\nfrom tqdm import tqdm\n\nimport torch\nfrom datasets import load_dataset\nfrom dig import DiscretetizedIntegratedGradients\nfrom attributions import run_dig_explanation\nfrom metrics import eval_log_odds, eval_comprehensiveness, eval_sufficiency\...
[ [ "numpy.round", "torch.manual_seed", "torch.cuda.is_available", "numpy.random.seed" ] ]
UNSKILL3-D/projectRobot
[ "bb584268f34ccae0da289ab74abc578af4b07c6d" ]
[ "robots/gen_save_maker.py" ]
[ "def compile_generator(filename):\n import numpy as np\n inp = open('generator.py', 'r')\n gen_code = ''\n buf = '+'\n while buf != 'def generate():\\n':\n buf = inp.readline()\n while buf:\n gen_code += buf\n buf = inp.readline()\n save = np.array(['dynamic', gen_code, 'de...
[ [ "numpy.array", "numpy.save" ] ]
isabelyuyingwu/parcels
[ "5bddee6d8de5c1ea14ee5e1cf3602b89bcc34952" ]
[ "tests/test_kernel_language.py" ]
[ "from parcels import FieldSet, ParticleSet, ScipyParticle, JITParticle, Kernel, Variable\nfrom parcels.kernels.seawaterdensity import polyTEOS10_bsq, UNESCO_Density\nfrom parcels import random as parcels_random\nimport numpy as np\nimport pytest\nimport random as py_random\nfrom os import path\nimport sys\n\n\nptyp...
[ [ "numpy.allclose", "numpy.meshgrid", "numpy.linspace", "numpy.ones", "numpy.array", "numpy.zeros", "numpy.isclose" ] ]
sinclairnick/EfficientDet
[ "f26fc90dab8e17479de141c75b4fb1a39904aea2" ]
[ "generators/common.py" ]
[ "import numpy as np\nimport random\nimport warnings\nimport cv2\nfrom tensorflow import keras\n\nfrom utils.anchors import anchors_for_shape, anchor_targets_bbox, AnchorParameters\n\n\nclass Generator(keras.utils.Sequence):\n \"\"\"\n Abstract generator class.\n \"\"\"\n\n def __init__(\n sel...
[ [ "numpy.pad", "numpy.clip", "numpy.min", "numpy.max", "numpy.delete", "numpy.array", "numpy.where", "numpy.zeros" ] ]
t170815518/AdvancedEAST
[ "744e4fc7243e61cb4fad510e7705678013593151" ]
[ "losses.py" ]
[ "import tensorflow as tf\n\nimport cfg\n\n\ndef quad_loss(y_true, y_pred):\n # loss for inside_score\n logits = y_pred[:, :, :, :1]\n labels = y_true[:, :, :, :1]\n # balance positive and negative samples in an image\n beta = 1 - tf.reduce_mean(labels)\n # first apply sigmoid activation\n predi...
[ [ "tensorflow.nn.sigmoid", "tensorflow.shape", "tensorflow.less", "tensorflow.reduce_mean", "tensorflow.reduce_sum", "tensorflow.reshape", "tensorflow.equal", "tensorflow.math.log", "tensorflow.square", "tensorflow.abs" ] ]
BUPTlfq/OpenHGNN
[ "77041e68c33a8a42a2c187c6e42d85b81cbb25d3" ]
[ "openhgnn/models/HGNN_AC.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nimport numpy as np\r\nfrom . import BaseModel, register_model\r\n\r\n@register_model('HGNN_AC')\r\nclass HGNN_AC(BaseModel):\r\n r\"\"\"\r\n Desctiption\r\n -----------\r\n HGNN_AC was introduced in `HGNN_AC <https://dl.acm.org...
[ [ "torch.mean", "torch.nn.functional.softmax", "torch.mm", "numpy.sqrt", "torch.Tensor", "torch.nn.functional.dropout", "torch.matmul", "torch.nn.LeakyReLU", "torch.where", "torch.device", "torch.ones_like" ] ]
LeapLabTHU/Pseudo-Q
[ "6919e47d18bae6eeca741998816c28647593faef" ]
[ "utils/loss_utils.py" ]
[ "import torch\nimport numpy as np\nimport torch.nn.functional as F\n\nfrom utils.box_utils import bbox_iou, xywh2xyxy, xyxy2xywh, generalized_box_iou\nfrom utils.misc import get_world_size\n\n\ndef build_target(args, gt_bbox, pred, device):\n batch_size = gt_bbox.size(0)\n num_scales = len(pred)\n coord_li...
[ [ "torch.nn.CrossEntropyLoss", "torch.sigmoid", "torch.ones", "torch.nn.functional.l1_loss", "torch.cat", "torch.zeros", "torch.log", "torch.stack", "numpy.array", "torch.nn.MSELoss" ] ]
gjsun/ares
[ "5a85b8ba79c95fe5f6363e8b23c99bf750b08b70" ]
[ "ares/analysis/GalaxyPopulation.py" ]
[ "\"\"\"\n\nGalaxyPopulation.py\n\nAuthor: Jordan Mirocha\nAffiliation: UCLA\nCreated on: Thu Jan 28 12:38:11 PST 2016\n\nDescription: \n\n\"\"\"\n\nimport time\nimport numpy as np\nfrom ..util import labels\nfrom matplotlib import cm\nimport matplotlib.pyplot as pl\nfrom .ModelSet import ModelSet\nfrom ..util.Surve...
[ [ "numpy.concatenate", "numpy.max", "numpy.zeros_like", "numpy.mean", "numpy.ma.array", "numpy.ma.is_masked", "numpy.ones_like", "numpy.arange", "numpy.diff", "matplotlib.gridspec.GridSpec", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.min", "numpy.logspa...
wiprodevnet/iot-ml-deployment
[ "78b6f3ad9d65f4f2c3e1654b8f01be941a17b572" ]
[ "IOTMLmodel/iot_ml_model.py" ]
[ "\"\"\"\r\nLinear Regression model data preperation and storage as pickle model\r\n\"\"\"\r\nimport pickle\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.linear_model import LinearRegression\r\nfrom sklearn import metrics\r\n\r\n# Linear Regress...
[ [ "pandas.concat", "pandas.read_csv", "pandas.to_datetime", "sklearn.model_selection.train_test_split", "sklearn.metrics.mean_squared_error", "sklearn.linear_model.LinearRegression", "numpy.array", "pandas.get_dummies" ] ]
dkdocs/nextera-demo
[ "9881f42c68e96d48ae9c8a33eb11752d62c6e9d8" ]
[ "mvtowerdetection/test/show_annotated_images.py" ]
[ "import os\nimport cv2\nimport numpy as np\nimport skimage.io as io\n\nfrom train.utils import get_subfiles\n\nfrom dotenv import load_dotenv\nload_dotenv()\n\n\nUnlabelled = [0, 0, 0]\nPole = [255, 255, 255]\n\nCOLOR_DICT = np.array([Pole, Unlabelled])\n\n\n# get binary image\ndef get_binary_image(img):\n # con...
[ [ "numpy.concatenate", "numpy.repeat", "numpy.array", "numpy.zeros" ] ]
gaolympie/datacraft-workshop-docker
[ "570133f1ff54ac5251c30cb9b0815bc7f0c08f09" ]
[ "utils/ui.py" ]
[ "import numpy as np\nimport streamlit as st\n\n\nfrom models.NaiveBayes import nb_param_selector\nfrom models.NeuralNetwork import nn_param_selector\nfrom models.RandomForet import rf_param_selector\nfrom models.DecisionTree import dt_param_selector\nfrom models.LogisticRegression import lr_param_selector\nfrom mod...
[ [ "numpy.round" ] ]
huozhanfeng/spark
[ "42904b8d013e71d03e301c3da62e33b4cc2eb54e" ]
[ "python/pyspark/mllib/util.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "numpy.zeros" ] ]
ScottHull/fEquilibrium
[ "fbc352484d0e60d6b224950f81d6fd730e36cb82" ]
[ "box/Box.py" ]
[ "import os\nimport matplotlib as mpl\n\nmpl.use('Qt5Agg')\nos.sys.path.append(os.path.dirname(os.path.abspath('.')))\nimport numpy as np\nimport pandas as pd\nfrom random import randint\nimport moviepy.editor as mpy\nfrom dynamics.Movement import move_particle\nfrom dynamics.Energy import energy, thermal_eq\nfrom t...
[ [ "matplotlib.use", "matplotlib.colors.Normalize", "matplotlib.pyplot.figure" ] ]
tmtmaj/deep-high-resolution-net.pytorch
[ "59513d90c30fb736e2a7f75186303eb5824e6be8" ]
[ "cocoeval_dacon.py" ]
[ "__author__ = 'tsungyi'\n\nimport numpy as np\nimport datetime\nimport time\nfrom collections import defaultdict\nfrom . import mask as maskUtils\nimport copy\n\nclass COCOeval:\n # Interface for evaluating detection on the Microsoft COCO dataset.\n #\n # The usage for CocoEval is as follows:\n # cocoG...
[ [ "numpy.logical_not", "numpy.spacing", "numpy.unique", "numpy.cumsum", "numpy.ones", "numpy.concatenate", "numpy.round", "numpy.max", "numpy.mean", "numpy.count_nonzero", "numpy.searchsorted", "numpy.exp", "numpy.argsort", "numpy.repeat", "numpy.array", ...
mastermind88/plotly.py
[ "df19fc702b309586cc24e25373b87e8bdbb3ff60" ]
[ "packages/python/plotly/plotly/tests/test_optional/optional_utils.py" ]
[ "from __future__ import absolute_import\n\nimport numpy as np\n\nfrom plotly import optional_imports\nfrom plotly.tests.utils import is_num_list\nfrom plotly.utils import get_by_path, node_generator\n\nimport copy\n\nmatplotlylib = optional_imports.get_module(\"plotly.matplotlylib\")\n\nif matplotlylib:\n import...
[ [ "matplotlib.use", "numpy.allclose", "numpy.array_equal" ] ]
weiyw16/pytorch-CycleGAN-and-pix2pix
[ "432a91ee6ca8dc606ba0116b27b0948abc48f295" ]
[ "mkmydata/makeHDF5_fromPng.py" ]
[ "import os\nimport h5py\nfrom PIL import Image\nimport numpy as np\n\nimport struct\nimport matplotlib.pyplot as plt\nimport torch\nimport torchvision.transforms as transforms\nNX = 276\nNZ = 276\nworkpath = \"./\"\nphase = 'train' #['train', 'test']\nmode = 'B' #['A', 'B']\ncontent = ['vx_split', 'vz_split']\n\nfi...
[ [ "torch.zeros" ] ]
mikpom/genontol
[ "ee3e0aaedf59a1bc373aadd3a4f9dbb0107baf94" ]
[ "genontol/tools.py" ]
[ "# Copyright 2015-2019 Jan Daniel Rudolph (@jdrudolph)\n# Modified version Copyright 2019 Mikhail Pomaznoy (@mikpom)\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 restric...
[ [ "numpy.take", "numpy.nonzero", "numpy.asarray", "numpy.empty_like", "numpy.arange", "numpy.minimum.accumulate", "numpy.argsort" ] ]
Westerley/framework_event2vec
[ "f066f150d0a89c10536255ff3ce26aecd967372e" ]
[ "Cluster/kMeans.py" ]
[ "# Import libraries necessary for this project\nimport numpy as np\nfrom scipy.spatial import distance\nimport random\n\nclass KMeans:\n\n \"\"\"K-Means clustering.\n Parameters\n ----------\n n_clusters : int, default: 2\n The number of clusters\n tol : float, default: 0.01\n Relative ...
[ [ "numpy.delete", "numpy.argmin", "numpy.mean", "numpy.array", "numpy.where", "numpy.sum" ] ]
frikol3000/DinoNN
[ "9722fce4be109feb9036f01af488863ce33f2cae" ]
[ "create_dataset.py" ]
[ "from PIL import ImageGrab\r\nfrom Chrome import Chrome\r\nfrom pynput import keyboard\r\nimport keyboard as kb\r\nimport pandas as pd\r\nfrom config import DATASET_FILE_NAME\r\n\r\njump = 0\r\nrun = 0\r\nfiles = []\r\nlabels = []\r\n\r\n\r\ndef main():\r\n global jump, run\r\n try:\r\n df = pd.read_cs...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
justin1121/federated
[ "3559af64e8417ccb1b12a9d26f366b721bef021b" ]
[ "tensorflow_federated/python/core/impl/reference_executor.py" ]
[ "# Copyright 2018, The TensorFlow Federated Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a...
[ [ "tensorflow.Graph", "tensorflow.TensorShape", "tensorflow.constant", "tensorflow.executing_eagerly", "tensorflow.Session", "numpy.array", "tensorflow.dtypes.as_dtype" ] ]
dwarfer7634/AIND_CV_project
[ "46d95be3a68e1ea316b17ee833c17411f35b040e" ]
[ "utils.py" ]
[ "import os\r\nimport cv2\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nfrom keras.models import load_model\r\nfrom pandas.io.parsers import read_csv\r\nfrom sklearn.utils import shuffle\r\n\r\ndef load_data(test=False):\r\n \"\"\"\r\n Loads data from FTEST if *test* is True, otherwise from F...
[ [ "numpy.expand_dims", "matplotlib.pyplot.title", "sklearn.utils.shuffle", "numpy.squeeze", "numpy.fromstring", "matplotlib.pyplot.show", "numpy.vstack", "matplotlib.pyplot.figure" ] ]
marcowoo7/research
[ "d31fc5dd7b830cb99257fee5e7ece3f11fece85d" ]
[ "20220111_Modeling_code_for_winter_2022_MW.py" ]
[ "# =============================================================================\r\n# Import libraries\r\n# =============================================================================\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom scipy.integrate import odeint\r\nfrom scipy.integrate import cumt...
[ [ "matplotlib.pyplot.legend", "numpy.sqrt", "numpy.linspace", "scipy.integrate.odeint", "numpy.round", "matplotlib.pyplot.plot", "numpy.histogram", "numpy.arange", "matplotlib.pyplot.hlines", "numpy.sin", "matplotlib.pyplot.close", "numpy.zeros", "matplotlib.pyplo...
vsskarthik/noxim-new
[ "c5fcb547f172390cfa06988f66c3e89a2ba008af" ]
[ "bin/plot_results.py" ]
[ "import matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\nimport os\n\ndir = 'latency'\ncsv_folder = 'new_csv_files'\nfile_list = os.listdir(f'./{csv_folder}/'+dir)\nfile_list.sort()\nfor i,j in enumerate(file_list):\n print(f'{i}) {j}')\n\nch = list(map(int,input('Space Seperated File Numbers: ...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
SohamChattopadhyayEE/Medical-image-segmentation
[ "3e36fd6ba4afa6320bcffdb1414543177ada78f3" ]
[ "util/dice_coeff.py" ]
[ "import torch\r\nfrom torch.autograd import Function\r\n\r\n\r\nclass DiceCoeff(Function):\r\n \"\"\"Dice coeff for individual examples\"\"\"\r\n\r\n def forward(self, input, target):\r\n self.save_for_backward(input, target)\r\n eps = 0.0001\r\n self.inter = torch.dot(input.view(-1), tar...
[ [ "torch.FloatTensor", "torch.sum" ] ]
chengjianglong/clab
[ "504a111a5ffbaa119dc64b30c8f7cb14288923a8" ]
[ "clab/util/fnameutil.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nProcessing for filenames. The logic is relatively hacky.\n\npip install pygtrie\n\"\"\"\nfrom __future__ import print_function, division\nfrom os.path import commonprefix, isdir, dirname, relpath, splitext\nfrom collections import deque\nimport pygtrie\n\n\ndef shortest_unique_pref...
[ [ "numpy.argsort" ] ]
CRISPRJWCHOI/IndelSearcher
[ "5824069868499bfbbd74582d5dc7a9a64a15035b" ]
[ "Random_sequence_generator.py" ]
[ "#!/usr/bin/env python\r\n\r\nimport sys\r\nimport pdb\r\nimport numpy as np\r\n\r\nnumber=int(sys.argv[1])\r\nlength=int(sys.argv[2])\r\nprobA=float(sys.argv[3])\r\nprobT=float(sys.argv[4])\r\nprobC=float(sys.argv[5])\r\nprobG=float(sys.argv[6])\r\nout=sys.argv[7]\r\n# m rows\r\n# n columns\r\n\r\ndef sequence(m,n...
[ [ "numpy.random.seed", "numpy.unique", "numpy.random.choice", "numpy.shape", "numpy.empty" ] ]