repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
aquinquenel/scikit-learn-mooc
[ "edb91f1669ffad65038f5bf48a6771299be4c09d", "edb91f1669ffad65038f5bf48a6771299be4c09d" ]
[ "python_scripts/ensemble_ex_04.py", "python_scripts/parameter_tuning_manual.py" ]
[ "# ---\n# jupyter:\n# kernelspec:\n# display_name: Python 3\n# name: python3\n# ---\n\n# %% [markdown]\n# # 📝 Exercise M6.04\n#\n# The aim of the exercise is to get familiar with the histogram\n# gradient-boosting in scikit-learn. Besides, we will use this model within\n# a cross-validation framework in ...
[ [ "sklearn.datasets.fetch_california_housing" ], [ "sklearn.model_selection.cross_validate", "sklearn.preprocessing.StandardScaler", "pandas.read_csv", "sklearn.linear_model.LogisticRegression" ] ]
adrianmatias/ml4grownups
[ "2ead636d99acc1e67e48789514fc87691f799ebc" ]
[ "src/dataset.py" ]
[ "import os\n\nimport pandas as pd\nimport numpy as np\nfrom conf import Conf\nfrom typing import List\nfrom sklearn.model_selection import train_test_split\n\nCONF = Conf()\n\n\ndef main():\n dataset = Dataset(\n data_user=get_data(\"users_onboarding_paywall.tsv\"),\n data_activity=get_data(\"activ...
[ [ "pandas.merge", "pandas.read_csv", "sklearn.model_selection.train_test_split" ] ]
google-research/crafty
[ "a232e66c245f4b7d67fe0443cdc094ca61dd7484" ]
[ "util.py" ]
[ "\n # 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...
[ [ "tensorflow.io.gfile.GFile" ] ]
jzh800/DREAMPlace
[ "1ddae063d7b78f4b66e371eec9c33d2c633c3c09", "1ddae063d7b78f4b66e371eec9c33d2c633c3c09" ]
[ "dreamplace/PlaceDB.py", "dreamplace/ops/density_overflow/density_overflow.py" ]
[ "##\n# @file PlaceDB.py\n# @author Yibo Lin\n# @date Apr 2018\n# @brief placement database \n#\n\nimport sys\nimport os\nimport re\nimport time \nimport numpy as np \nimport logging\nimport Params\nimport dreamplace \nimport dreamplace.ops.place_io.place_io as place_io \nimport pdb \n\ndatatypes = {\n '...
[ [ "numpy.amax", "numpy.maximum", "numpy.minimum", "numpy.amin", "numpy.full", "numpy.ceil", "numpy.floor", "numpy.argsort", "numpy.array", "numpy.zeros", "numpy.sum" ], [ "numpy.amax", "torch.empty", "matplotlib.use", "numpy.arange", "matplotlib.py...
KathCYM/ParlAI
[ "2ec2ad365b008d28347cbbd459ba29eb41657034" ]
[ "parlai/agents/rag/retrievers.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\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\"\"\"\nRetrievers for RAG.\n\"\"\"\nfrom abc import ABC, abstractmethod\nimport copy\nimport csv\nimport gzip\ni...
[ [ "torch.Tensor", "torch.isnan", "torch.tensor", "numpy.append", "torch.mul", "torch.FloatTensor", "torch.cuda.is_available", "torch.stack", "numpy.argsort", "sklearn.feature_extraction.text.TfidfVectorizer" ] ]
awesome-archive/character-based-cnn
[ "6a8910a49ce5d43b639d1da0320df8cfa88cb75b" ]
[ "src/utils.py" ]
[ "import json\r\nimport re\r\nimport numpy as np\r\nfrom sklearn import metrics\r\n\r\n# text-preprocessing\r\n\r\n\r\ndef lower(text):\r\n return text.lower()\r\n\r\n\r\ndef remove_hashtags(text):\r\n clean_text = re.sub(r'#[A-Za-z0-9_]+', \"\", text)\r\n return clean_text\r\n\r\n\r\ndef remove_user_mentio...
[ [ "numpy.argmax", "numpy.identity", "sklearn.metrics.f1_score", "numpy.zeros", "sklearn.metrics.accuracy_score" ] ]
SithisSir/sr
[ "b87413f943b631511d22fca0796749e090a1f2e9" ]
[ "models/model_espcn.py" ]
[ "import tensorflow as tf\nfrom .model import Model\n\n\nclass ESPCN(Model):\n def __init__(self, args):\n super().__init__(args)\n self._prediction_offset = self._scale_factor * 4\n\n def get_data(self):\n data_batch, initializer = self.dataset.get_data()\n\n lr_batch = tf.cast(dat...
[ [ "tensorflow.losses.mean_squared_error", "tensorflow.depth_to_space", "tensorflow.image.psnr", "tensorflow.reduce_mean", "tensorflow.summary.image", "tensorflow.cast", "tensorflow.placeholder", "tensorflow.variable_scope", "tensorflow.square", "tensorflow.pad", "tensorfl...
deven96/python
[ "46be8622fe58f004bdbd636a08a8904ef4134bcd" ]
[ "bigml/laminar/numpy_ops.py" ]
[ "# -*- coding: utf-8 -*-\n#!/usr/bin/env python\n#\n# Copyright 2017-2019 BigML\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\...
[ [ "numpy.dot", "numpy.amax", "numpy.tile", "numpy.copy", "numpy.array", "numpy.exp", "numpy.sum" ] ]
FindDefinition/cumm
[ "3d58e85b660afa05c20514afe65b8aa3a4995953" ]
[ "cumm/gemm/turing_my_iters.py" ]
[ "# Copyright 2021 Yan Yan\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 i...
[ [ "numpy.arange", "numpy.log2", "numpy.zeros" ] ]
MuellerSeb/ogs5py
[ "752e7bd2298fbd476406d168f6b7d1a85863dccd" ]
[ "ogs5py/tools/output.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Tools for ogs5py output files (independent from VTK package).\"\"\"\nimport glob\nimport os\nimport re\nimport xml.etree.ElementTree as ET\n\nimport numpy as np\n\nfrom ogs5py.tools.types import PCS_TYP\n\n##############################################################################...
[ [ "numpy.argsort", "numpy.array" ] ]
shaheerakber67/PPEMonitoringSystem
[ "93b9d78bcd93ba48a1ed6d0730d10d469e737d67" ]
[ "core/utils.py" ]
[ "import cv2\nimport random\nimport colorsys\nimport numpy as np\nimport tensorflow as tf\nimport pytesseract\nfrom core.config import cfg\nimport re\n\n# If you don't have tesseract executable in your PATH, include the following:\n# pytesseract.pytesseract.tesseract_cmd = r'<full_path_to_your_tesseract_executable>'...
[ [ "numpy.fromfile", "tensorflow.concat", "numpy.product", "tensorflow.maximum", "tensorflow.minimum", "numpy.full", "numpy.concatenate", "numpy.argmax", "numpy.float32", "numpy.exp", "numpy.array", "tensorflow.math.divide_no_nan" ] ]
yy-YangYi/shrinkbench
[ "42c6abb640aa37a6c9da098fe136a26c96a4ce0c" ]
[ "experiment/train.py" ]
[ "import pathlib\nimport time\n\nimport torch\nimport torchvision.models\nfrom torch import nn\nfrom torch.utils.data import DataLoader\nfrom torch.backends import cudnn\nfrom tqdm import tqdm\n\nfrom .base import Experiment\nfrom .. import datasets\nfrom .. import models\nfrom ..metrics import correct\nfrom ..model...
[ [ "torch.nn.CrossEntropyLoss", "torch.load", "torch.utils.data.DataLoader", "torch.set_grad_enabled", "torch.cuda.is_available" ] ]
lhz1029/pixel-cnn
[ "f759b8d9a6b3f4b15144ef3f6d3bf18ac31dacc4" ]
[ "plot_unifs.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport argparse\nfrom functools import partial\n \nif __name__ == \"__main__\":\n parser = argparse.ArgumentParser()\n parser.add_argument(\"-f\", type=str, default='',\n help=\"Location of checkpoint to restore\")\n parser.add...
[ [ "numpy.load", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig" ] ]
robertogyn19/incubator-superset
[ "14c3488c79f8f3cdbd1123e8f7a92f8746c2db09" ]
[ "superset/views/core.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "pandas.DataFrame.from_records" ] ]
dstahlke/qitensor
[ "2b430e01e3f0d3c8488e35f417faaca27f930af3" ]
[ "qitensor/experimental/noncommgraph.py" ]
[ "# Noncommutative graphs as defined by Duan, Severini, Winter in arXiv:1002.2514.\n\nfrom __future__ import print_function, division\n\nimport numpy as np\nimport scipy.linalg as linalg\nimport itertools\nimport collections\nimport cvxopt.base\nimport cvxopt.solvers\n\nfrom qitensor import qudit, HilbertSpace, Hilb...
[ [ "numpy.rollaxis", "numpy.dot", "numpy.random.random", "numpy.sqrt", "numpy.allclose", "numpy.sum", "numpy.abs", "numpy.eye", "numpy.bmat", "numpy.any", "scipy.linalg.norm", "scipy.linalg.eigvalsh", "numpy.tensordot", "numpy.array", "numpy.zeros", "nu...
shijh/HeadPoseEstimation-WHENet
[ "6e0b4bc5cfe86e9d78c0514a963dae6792b11c35" ]
[ "whenet.py" ]
[ "import efficientnet as efn\nimport keras\nimport numpy as np\nfrom utils import softmax\n\nclass WHENet:\n def __init__(self, snapshot=None):\n base_model = efn.EfficientNetB0(include_top=False, input_shape=(224, 224, 3))\n out = base_model.output\n out = keras.layers.GlobalAveragePooling2D...
[ [ "numpy.array", "numpy.sum" ] ]
Code-Cornelius/python_libraries
[ "71c388da60e2aeb94369c3813faca93bf6a18ebf", "71c388da60e2aeb94369c3813faca93bf6a18ebf", "71c388da60e2aeb94369c3813faca93bf6a18ebf" ]
[ "corai/src/data_processing_fct.py", "corai_util/finance/src/implied_vol.py", "corai_util/calculus/tests/test_diff_eq.py" ]
[ "import os\n\nimport numpy as np\nfrom corai_util.tools.src.function_writer import list_of_dicts_to_json\nfrom sklearn.preprocessing import MinMaxScaler, StandardScaler\n\n\ndef pipeline_scaling_minimax(df):\n minimax = MinMaxScaler(feature_range=(0, 1))\n minimax.fit(df)\n return minimax, minimax.transfor...
[ [ "sklearn.preprocessing.StandardScaler", "numpy.cos", "sklearn.preprocessing.MinMaxScaler", "numpy.sin" ], [ "scipy.optimize.bisect", "numpy.exp" ], [ "scipy.stats.uniform.pdf", "numpy.array", "numpy.sqrt", "numpy.linspace" ] ]
isl-org/faiss
[ "908812266c4472b0ab07ac46a5a65635cdad8bb5" ]
[ "contrib/exhaustive_search.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\nimport faiss\nimport time\nimport numpy as np\n\nimport logging\n\nLOG = logging.getLogger(__name__)\n\ndef knn_ground_truth(xq, db_...
[ [ "numpy.hstack", "numpy.ascontiguousarray", "numpy.cumsum", "numpy.zeros_like", "numpy.zeros" ] ]
NatalieHanzhina/bayesian_retinanet_tf2
[ "a34290cb3e837ff67de73fc74a9a1899f14fa46c" ]
[ "keras_retinanet/utils/tf_version.py" ]
[ "\"\"\"\nCopyright 2017-2019 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable la...
[ [ "tensorflow.version.VERSION.split" ] ]
Indy4G/Web-Design-Challenge
[ "3e540217268b98b2874992c87836912791053484" ]
[ "docs/csv_to_html.py" ]
[ "import pandas as pd\ndf = pd.read_csv(\"Resources/cities.csv\")\ndf.to_html('raw_data.html',classes=[\"table-bordered\", \"table-striped\", \"table-hover\"])\n" ]
[ [ "pandas.read_csv" ] ]
dingdian110/alpha-ml
[ "d6a7a8a8a3452a7e3362bf0ef32b9ac5fe215fde", "d6a7a8a8a3452a7e3362bf0ef32b9ac5fe215fde", "d6a7a8a8a3452a7e3362bf0ef32b9ac5fe215fde" ]
[ "alphaml/datasets/rgs_dataset/dataset_loader.py", "alphaml/datasets/cls_dataset/mammography.py", "alphaml/engine/components/models/regression/libsvm_svr.py" ]
[ "data_dir_template = 'data/rgs_data/%s/'\n\n\ndef load_data(dataset_name):\n if dataset_name == 'boston':\n from sklearn.datasets import load_boston\n boston=load_boston()\n X, y = boston.data, boston.target\n else:\n raise ValueError('Invalid dataset name: %s!' % dataset_name)\n ...
[ [ "sklearn.datasets.load_boston" ], [ "pandas.read_csv" ], [ "sklearn.svm.SVR" ] ]
boryana-ilieva/respy
[ "c3f600eefbb54d4f34ae2cc1e52d4d32c03ba0dc" ]
[ "doc/graphs/_modules/auxiliary_samples.py" ]
[ "\"\"\" This module contains auxiliary functions to plot some information on the\nRESTUD economy.\n\"\"\"\n\n# standard library\nimport matplotlib.pylab as plt\nimport numpy as np\nimport shutil\nimport shlex\nimport os\n\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib.ticker import FuncFormatter\nfrom ma...
[ [ "matplotlib.pylab.bar", "numpy.tile", "matplotlib.pylab.figure", "matplotlib.pylab.legend", "matplotlib.pylab.savefig", "numpy.exp" ] ]
caymansimpson/reuniclusVGC
[ "d30522f4d2eb2fc2d6aa9ed71905b9e6aab87c37" ]
[ "tests/rl_with_open_ai_gym_wrapper.py" ]
[ "# -*- coding: utf-8 -*-\nimport numpy as np\nimport tensorflow as tf\n\nimport sys\n\nsys.path.append(\".\") # will make \"bots\" callable from root\nsys.path.append(\"..\") # will make \"bots\" callable from simulators\nsys.path.append('/Users/cayman/Repositories/poke-env/src')\n\nfrom poke_env.player.env_player ...
[ [ "numpy.random.seed", "tensorflow.keras.layers.Dense", "numpy.ones", "numpy.concatenate", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.layers.Flatten", "tensorflow.keras.models.Sequential", "tensorflow.random.set_seed" ] ]
woojeongjin/vokenization
[ "1acd3baa23d08cea43ac2e56b2faad1a805bc457", "1acd3baa23d08cea43ac2e56b2faad1a805bc457" ]
[ "vokenization/evaluate_diversity.py", "vlm/run_glue_epochs.py" ]
[ "import argparse\nfrom collections import defaultdict\nimport json\nimport os\nimport sys\n\nimport numpy as np\nimport tqdm\n\nfrom vokenization import Vokenizer, load_model_and_tokenizer\nimport common\n\nimgset2fname = {\n 'coco_train': 'mscoco_train.json',\n 'coco_nominival': 'mscoco_nominival.json',\n ...
[ [ "numpy.zeros" ], [ "torch.cuda.device_count" ] ]
LautaroEst/cs231n-Computer-Vision
[ "f353a3d376d452dd1f9ef8979ddc96de91a45605" ]
[ "Utils/Pruebas-Pytorch/pytorch_utils/MNISTdataloader.py" ]
[ "import torch\nfrom torchvision import datasets as dset\nfrom torch.utils.data import DataLoader, sampler\nfrom torchvision.transforms import Compose, ToTensor\n\n\nclass Reshape(object):\n \n def __call__(self, sample):\n return sample[0,:,:]\n \n\n\ndef GetMNISTDataLoaders(NUM_TRAIN, NUM_VAL, ...
[ [ "torch.utils.data.DataLoader" ] ]
cyrusneary/multi-agent-comms
[ "d88ebfa3d1adb4da55283472c95d8a094f42df43" ]
[ "optimization_problems/total_corr2.py" ]
[ "from ntpath import join\nimport cvxpy as cp\nfrom cvxpy.lin_ops.lin_utils import conv\nfrom cvxpy.settings import NONNEG\nimport numpy as np\nfrom scipy.special import rel_entr\n\nimport sys, os, time\nsys.path.append('../')\nfrom markov_decision_process.mdp import MDP\n\ndef build_linearized_program(mdp: MDP, \n ...
[ [ "numpy.zeros", "numpy.where" ] ]
YIWANGFAN/RetinaFace-
[ "99f54ebca356053a987ed3c616dbb2cd06070c89" ]
[ "wyfRetinaFace/data/data_augment.py" ]
[ "import cv2\nimport numpy as np\nimport random\nfrom utils.box_utils import matrix_iof\n\n\ndef _crop(image, boxes, labels, landm, img_dim):\n height, width, _ = image.shape\n pad_image_flag = True\n\n for _ in range(250):\n \"\"\"\n if random.uniform(0, 1) <= 0.2:\n scale = 1.0\n ...
[ [ "numpy.hstack", "numpy.expand_dims", "numpy.maximum", "numpy.minimum", "numpy.logical_and", "numpy.array", "numpy.empty" ] ]
albertoivo/chicago-bikeshare-mlnd
[ "fccb797a5cec1a527e160ca5377f6912078d9f49" ]
[ "chicago_bikeshare_pt.py" ]
[ "#!/usr/bin/env python3\n# coding: utf-8\n\nimport csv\nimport matplotlib.pyplot as plt\nimport zipfile\nimport os.path\n\ncsv_name = 'chicago.csv'\ncsv_zip_name = 'chicago.csv.zip'\n\nis_csv = os.path.isfile(csv_name)\nis_csv_zip_name = os.path.isfile(csv_zip_name)\n\nif is_csv_zip_name and not is_csv:\n print(...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.bar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
bbboming/inc_via_bay
[ "0a339a866e8f83ff8fbda99909a58d24514ca3d1" ]
[ "train_70_30.py" ]
[ "# train.py\n#!/usr/bin/env\tpython3\n\nimport os\nimport sys\nimport argparse\nfrom datetime import datetime\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\n\nimport torchvision\nfrom torchvision import datasets\nimport torchvision.tran...
[ [ "torch.nn.CrossEntropyLoss", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.load", "torch.utils.data.DataLoader", "torch.cuda.is_available", "torch.nn.DataParallel", "torch.autograd.Variable" ] ]
GuodongZhu/nevergrad
[ "446bc2ef0c7ef318578013721843f7701507fd67" ]
[ "nevergrad/optimization/test_base.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\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\nimport warnings\nfrom unittest import TestCase\nfrom typing import List, Tuple, Any\nimport genty\nimport numpy...
[ [ "numpy.testing.assert_equal", "numpy.int32", "numpy.testing.assert_almost_equal", "numpy.int64", "numpy.testing.assert_raises", "numpy.float64", "numpy.float32", "numpy.array" ] ]
salem-devloper/Lung-Segmentation-Non-Covid
[ "11eb87e46014aefaf034239bf68b65c5eb55711d" ]
[ "QataCovDataset.py" ]
[ "import torch\nimport torchvision\nimport numpy as np\nfrom torch.utils.data import DataLoader,Dataset\nimport os\nimport random\nimport cv2\nfrom PIL import Image\n\nfrom skimage import io\n\n\n# torch.utils.data.Dataset is an abstract class representing a dataset\nclass QataCovDataset(Dataset): # inherit from tor...
[ [ "numpy.hstack", "matplotlib.pyplot.imshow", "numpy.array", "numpy.zeros", "matplotlib.pyplot.figure" ] ]
SHITIANYU-hue/flow
[ "6fb5697868517fea7098a81b78c1be8e925f09f7", "6fb5697868517fea7098a81b78c1be8e925f09f7" ]
[ "tests/setup_scripts.py", "flow/benchmarks/baselines/bottleneck0.py" ]
[ "\"\"\"Specifies several methods for creating networks and environments.\n\nThis allows us to reduce the number of times these features are specified when\ncreating new tests, as all tests follow approximately the same format.\n\"\"\"\n\nimport logging\n\nfrom numpy import pi, sin, cos, linspace\n\nfrom flow.contro...
[ [ "numpy.cos", "numpy.linspace", "numpy.sin" ], [ "numpy.std", "numpy.mean" ] ]
sm7175/MLAI
[ "e33a8af0c67265f7ba9e00fb315e56aa78c82075" ]
[ "RL-based system for assisting cab drivers/Env.py" ]
[ "# Import routines\n\nimport numpy as np\nimport math\nimport random\nfrom itertools import permutations\n\n# Defining hyperparameters\nm = 5 # number of cities, ranges from 1 ..... m\nt = 24 # number of hours, ranges from 0 .... t-1\nd = 7 # number of days, ranges from 0 ... d-1\nC = 5 # Per hour fuel and other c...
[ [ "numpy.random.poisson" ] ]
is0280fp/Side-by-Side-Walking-Model
[ "c1bbed8c4ebd74f09729e77d1cbdf8772c038f36" ]
[ "kubo_trajectory.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Feb 6 19:27:32 2018\n\n@author: yume\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef load_default_trajectory():\n ps = np.array(([\n [-0.53173167, 1.00566862],\n [-0.64863302, 1.21137899],\n ...
[ [ "matplotlib.pyplot.plot", "numpy.array" ] ]
watate/spinningup
[ "f05f04f6319e3972212448ccec080d4cac426884" ]
[ "spinup/utils/logx.py" ]
[ "\"\"\"\n\nSome simple logging functionality, inspired by rllab's logging.\n\nLogs to a tab-separated-values file (path/to/output_directory/progress.txt)\n\n\"\"\"\nimport json\nimport joblib\nimport shutil\nimport numpy as np\nimport tensorflow as tf\nimport os.path as osp, time, atexit, os\nfrom spinup.utils.mpi_...
[ [ "numpy.concatenate", "tensorflow.get_default_graph", "tensorflow.compat.v1.saved_model.simple_save", "tensorflow.saved_model.loader.load" ] ]
jed057/wtpy
[ "4df1dff1dcee43c80701bb0edc1b3eaea385b77f" ]
[ "wtpy/apps/WtBtAnalyst.py" ]
[ "from pandas import DataFrame as df\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom dateutil.parser import parse\r\nfrom collections import Counter\r\nfrom datetime import datetime\r\n\r\nimport math\r\nimport json\r\nfrom xlsxwriter import Workbook\r\n\r\n\r\nclass Calculate():\r\n '''\r\n 绩效比率计算\r\n ...
[ [ "pandas.concat", "pandas.merge", "pandas.read_csv", "numpy.abs", "pandas.Series", "numpy.minimum.accumulate", "pandas.DataFrame", "numpy.argmax", "numpy.argmin", "numpy.insert", "numpy.maximum.accumulate", "numpy.sum" ] ]
kunadawa/video-object-detection
[ "9e90f9d02b04b1052c596d857968e93d7c421366" ]
[ "samples/conftest.py" ]
[ "import pytest\nimport numpy\nfrom proto.generated import detection_handler_pb2\nimport datetime\n\n\n@pytest.fixture\ndef create_handle_detection_request():\n \"\"\"\n returns a detection_handler_pb2.handle_detection_request object if the input data is successfully serialized into protobuf types\n \"\"\"\...
[ [ "numpy.array" ] ]
ultimus11/Driverless-Need-For-Speed-MW
[ "b5181fb8727ab73f6c3c1c8460437f74de7c90fd" ]
[ "parts/part3/nfs4.py" ]
[ "import cv2\r\nimport numpy as np\r\nimport time\r\nfrom grabScreen import grab_screen\r\nfrom direct_key_inputs import PressKey, ReleaseKey, W, A, S, D\r\n\r\ndef forward():\r\n PressKey(W)\r\n ReleaseKey(A)\r\n ReleaseKey(D)\r\ndef process_roi_lanes(img,lines):\r\n try:\r\n for line in lines:\r...
[ [ "numpy.array", "numpy.zeros_like" ] ]
suddhu/MinkLoc3D
[ "11a2d2d3a96e74133b4aff635d456e22133babcd" ]
[ "training/vizEpochs.py" ]
[ "# Author: Jacek Komorowski\n# Warsaw University of Technology\n\nimport argparse\nfrom utils import MinkLocParams\nfrom tacto.utils.util3D import Util3D\nfrom shapeclosure.misc import plotTNSE3d, sampleSurfacePoses, renderInteractions\nimport gc \nimport os\nfrom os import path as osp\nfrom model_factory import mo...
[ [ "torch.load", "numpy.isnan", "torch.tensor", "numpy.all", "numpy.mean", "torch.utils.tensorboard.SummaryWriter", "torch.cuda.is_available", "torch.device", "numpy.sum" ] ]
Intelligent-Computing-Lab-Yale/Energy-Separation-Training
[ "9336862a10c915a482d427e8a36367f648e7dd40" ]
[ "detector_net.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\n\nimport torchvision\nimport torchvision.transforms as transforms\n\nimport os\nimport time\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nsize_1 = 64\nsize_2 = 64\n\ncl...
[ [ "torch.nn.MaxPool2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
nismod/sim
[ "951e9356d95d114225a16ad24c74d531f7528057" ]
[ "hh.py" ]
[ "\nimport pandas as pd\n\nimport ukpopulation.snhpdata as SNHPData\nimport ukpopulation.utils #as utils\n\n\nsnhp_e = pd.read_csv(\"data/ons_hh_e_2016-2041.csv\").drop([str(y) for y in range(2001,2014)], axis=1)\nsnhp_w = pd.read_csv(\"data/hh_w_2014-2039.csv\").drop([\"Unnamed: 0\", \"Unnamed: 1\"], axis=1)\n\nsnh...
[ [ "pandas.concat", "pandas.read_csv" ] ]
sophon-ai-algo/sophon-inference
[ "f923413b76615e265af28fd1dd2b43e5eb303dcd" ]
[ "modules/auto_runner/external/tensorflow_functions.py" ]
[ "\"\"\" Copyright 2016-2022 by Bitmain Technologies Inc. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless r...
[ [ "tensorflow.Graph", "tensorflow.import_graph_def", "tensorflow.device", "tensorflow.gfile.GFile", "numpy.ones", "tensorflow.Session", "tensorflow.profiler.ProfileOptionBuilder.float_operation", "tensorflow.GraphDef", "tensorflow.train.write_graph" ] ]
Dani-Mora/wide-deep-cnn
[ "16b74dd29fc3d97a86e8c65cc542306d59c00a9a" ]
[ "code/widedeep/ops/variables.py" ]
[ "\"\"\"\nHelper class to create variables in Tensorflow\n\"\"\"\n\nimport tensorflow as tf\n\nNON_SAVABLE_COL = 'not_saveable'\n\n\ndef variable(name,\n shape,\n dtype,\n initializer,\n collections=[],\n regularizer=None,\n trainable=True):\n ...
[ [ "tensorflow.get_variable", "tensorflow.get_collection", "tensorflow.nn.zero_fraction", "tensorflow.global_norm", "tensorflow.summary.histogram" ] ]
ceykmc/detectron2
[ "0b500b4d7ed11e9728867298f5f168fb34908e2c" ]
[ "tests/data/test_detection_utils.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\nimport copy\nimport numpy as np\nimport unittest\nimport pycocotools.mask as mask_util\n\nfrom detectron2.data import detection_utils\nfrom detectron2.data import transforms as T\nfrom detectron2.structures import BitMasks, BoxMode\n\n\ncla...
[ [ "numpy.asarray", "numpy.random.rand", "numpy.zeros", "numpy.allclose" ] ]
nathanielfernandes/HamoodBot
[ "e22b321e0594360fb427080322ed8731b48cec16" ]
[ "modules/math_functions.py" ]
[ "#\nimport sys, re\nimport requests\nimport json\nimport io\nimport os\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom numpy import sqrt, sin, cos, tan, log\nfrom sympy import symbols, Eq, solve, parse_expr, integrate, diff\nfrom copy import copy\nimport time, math, random\n\nimport signal\nfrom contextl...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.axhline", "matplotlib.pyplot.axvline", "numpy.arange", "matplotlib.pyplot.savefig", "matplotlib.pyplot.clf", "matplotlib.pyplot.close", "matplotlib.pyplot.grid" ] ]
VITA-Group/Large_Scale_GCN_Benchmarking
[ "d4c85a899a22b5a982ae437eac037f3629454510" ]
[ "Precomputing/base.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch_geometric.transforms import SIGN\nfrom torch.utils.data import DataLoader\n\nimport torch\nfrom torch_sparse import SparseTensor\n\nfrom sklearn.metrics import f1_score\n\nfrom utils import get_memory_usage, compute_tensor_bytes, MB, GB\nimport time\nimport...
[ [ "torch.cuda.synchronize", "torch.nn.functional.log_softmax", "torch.cat", "torch.utils.data.TensorDataset", "torch.utils.data.DataLoader", "torch.cuda.empty_cache", "torch.cuda.max_memory_allocated", "torch.no_grad", "torch.split", "sklearn.metrics.f1_score" ] ]
Defra-Data-Science-Centre-of-Excellence/sdg-build
[ "716a7597e5cb7de248915b21fa1a9e4a5cd1e0e0" ]
[ "sdg/DisaggregationReportService.py" ]
[ "import os\nimport sdg\nimport pandas as pd\nfrom slugify import slugify\nfrom sdg.Loggable import Loggable\n\nclass DisaggregationReportService(Loggable):\n \"\"\"Report generation to document disaggregations in data.\"\"\"\n\n\n def __init__(self, outputs, languages=None, translation_helper=None,\n ...
[ [ "pandas.isna", "pandas.DataFrame" ] ]
Alibaba-Gemini-Lab/tf-encrypted
[ "bf381b949c8860fbd97876e8275fdbc55987effe" ]
[ "tf_encrypted/tensor/native.py" ]
[ "\"\"\"Native tensors and their factory.\n\nThese use TensorFlow's native dtypes tf.int32 and tf.int64 for the given float\nencoding being used (fixed-point, etc.).\"\"\"\nfrom __future__ import absolute_import\n\nimport abc\nimport math\nfrom typing import Dict\nfrom typing import List\nfrom typing import Optional...
[ [ "tensorflow.convert_to_tensor", "tensorflow.concat", "tensorflow.stack", "tensorflow.reduce_sum", "tensorflow.bitwise.bitwise_and", "tensorflow.cast", "tensorflow.space_to_batch_nd", "tensorflow.equal", "tensorflow.where", "tensorflow.cumsum", "tensorflow.strided_slice"...
beijing-penguin/pytorch-tutorial
[ "986aade6848ef4809975aa029ae83d8bb84fd26e" ]
[ "my_pytoch/net/neural_networks.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass Net(nn.Module):\n\n def __init__(self):\n super(Net, self).__init__()\n # 1 input image channel, 6 output channels, 5x5 square convolution\n # kernel\n self.conv1 = nn.Conv2d(1, 6, 5)\n self.conv2 ...
[ [ "torch.nn.Linear", "torch.randn", "torch.nn.Conv2d" ] ]
Rahul-404/Handwritten-digit-recognition-MNIST
[ "c20fca30c2cfc26e15c64b45e3065111e9c5b974" ]
[ "run.py" ]
[ "from keras.models import load_model\nfrom tkinter import *\nimport tkinter as tk\nimport win32gui\nfrom PIL import ImageGrab, Image\nimport numpy as np\nimport warnings\nwarnings.filterwarnings('ignore')\n\nmodel = load_model('mnist.h5')\n\ndef predict_digit(img):\n # resize image to 28x28 pixels\n img = img...
[ [ "numpy.array" ] ]
MacDaddio/BigGAN-PyTorch
[ "cd47be41de43e8ba3679e144883560966aba3480" ]
[ "train.py" ]
[ "\"\"\" BigGAN: The Authorized Unofficial PyTorch release\n Code by A. Brock and A. Andonian\n This code is an unofficial reimplementation of\n by A. Brock, J. Donahue, and K. Simonyan (arXiv 1809.11096).\n\n Let's go.\n\"\"\"\n\nimport os\nimport functools\nimport math\nimport numpy as np\nfrom tqdm im...
[ [ "numpy.max", "torch.nn.DataParallel" ] ]
jglaser/pytorch-optimizer
[ "910b414565427f0a66e20040475e7e4385e066a5" ]
[ "tests/test_optimizer_with_nn.py" ]
[ "import numpy as np\nimport pytest\nimport torch\nfrom torch import nn\n\nimport torch_optimizer as optim\n\n\ndef make_dataset(seed=42):\n rng = np.random.RandomState(seed)\n N = 100\n D = 2\n\n X = rng.randn(N, D) * 2\n\n # center the first N/2 points at (-2,-2)\n mid = N // 2\n X[:mid, :] = ...
[ [ "torch.sigmoid", "torch.Tensor", "torch.manual_seed", "torch.nn.BCELoss", "numpy.ones", "torch.nn.Linear", "numpy.array", "numpy.random.RandomState" ] ]
startupcode001/payequity
[ "21432b36c77cd7cd0ebc263453302a01ec3b5170", "21432b36c77cd7cd0ebc263453302a01ec3b5170" ]
[ "Script/PE_Functions_1.py", "Script/46/PE_Functions.py" ]
[ "import pandas as pd\nimport numpy as np\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport plotly.graph_objects as go\n\nfrom sklearn.preprocessing import StandardScaler,MinMaxScaler\nfrom sklearn.experimental import enable_iterative_imputer\nfrom sklearn.impute import Iter...
[ [ "matplotlib.pyplot.yticks", "pandas.to_datetime", "numpy.log", "matplotlib.pyplot.ylim", "matplotlib.pyplot.subplots", "pandas.DataFrame", "numpy.ceil", "matplotlib.pyplot.setp", "pandas.DataFrame.from_dict", "matplotlib.pyplot.text", "pandas.to_numeric", "matplotli...
sidarth164/RecoEdge
[ "351d680a8878f8ab4917e9a96af7d34600a4a6f6" ]
[ "fedrec/trainers/dlrm_trainer.py" ]
[ "from typing import Dict\n\nimport attr\nimport numpy as np\nimport torch\nfrom fedrec.trainers.base_trainer import BaseTrainer, TrainConfig\nfrom fedrec.federated_worker import FederatedWorker, Neighbour\nfrom fedrec.preprocessor import PreProcessor\nfrom fedrec.utilities import registry\nfrom fedrec.utilities imp...
[ [ "numpy.concatenate", "numpy.round", "torch.no_grad" ] ]
kad99kev/pytorch_gan_trainer
[ "f9db1072f29485843be3008e25d64abac8a36e2b" ]
[ "pytorch_gan_trainer/models/acgan/discriminator.py" ]
[ "import torch.nn as nn\n\n\nclass Discriminator(nn.Module):\n \"\"\"Discriminator model for ACGAN.\n\n Arguments:\n target_size (int): Target size of input image.\n num_channels (int): Number of channels in images of dataset.\n num_classes (int): Number of classes in dataset.\n fea...
[ [ "torch.nn.Softmax", "torch.nn.Dropout", "torch.nn.Conv2d", "torch.nn.Sigmoid", "torch.nn.Linear", "torch.nn.LeakyReLU", "torch.nn.BatchNorm2d" ] ]
JamesKing76/AudioSuperResolution
[ "85114887248c02b1c80f7162c909f6fe51d3667e" ]
[ "Processing/Downsampler.py" ]
[ "import os\n\nimport numpy as np\nimport soundfile as sf\n\n\ndef retrive_data_low(file, downsample_rate, n, m):\n \"\"\"\n This function downsamples a file and extracts its lowpoints and crops it to be of an appropriate size\n :param file: The audio file to be downasmpled\n :param downsample...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.pad" ] ]
Emilie-Thome/Multi-Agent-RL
[ "4546abb48a5febb1c7ea24fc6af99dcf4c6fd811", "4546abb48a5febb1c7ea24fc6af99dcf4c6fd811" ]
[ "data/local/test-discounts/exp_plot.py", "data/local/test-transfer-params/exp_plot.py" ]
[ "import csv\nimport matplotlib.pyplot as plt\nfrom scipy import stats\nimport numpy as np\n\n\ndir_prefix = 'test_discounts_2021_04_16_10_06_18_00'\ndiscounts = [0.5, 0.75, 0.99]\nparticipation_rates = [0.5, 1]\nagents_numbers = [5, 10]\naverage_periods = [1, 5, 10]\n\nfiles_id = ['0'+str(i) for i in range(1,10)] +...
[ [ "matplotlib.pyplot.figure" ], [ "matplotlib.pyplot.figure" ] ]
collodi/svd_layer
[ "67a608ca10d3d37bf861e4e7490e62d298fa83b9" ]
[ "svd_layer/conv.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass Net(nn.Module):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\n\t\tself.cv_drop = nn.Dropout2d(p=0.2)\n\n\t\tself.cv1 = nn.Conv2d(1, 5, 5, padding=2)\n\t\tself.cv2 = nn.Conv2d(5, 5, 5, padding=2)\n\t\tself.cv3 = nn.Conv2d(5, 5, 5, pad...
[ [ "torch.nn.Dropout2d", "torch.nn.AlphaDropout", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.functional.adaptive_max_pool2d", "torch.nn.SELU" ] ]
xx-zhou16/Grammar
[ "e4a5427ef4ffad63fa265acbade098bb963a814b" ]
[ "fairseq/criterions/cross_entropy.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\nimport math\nfrom dataclasses import dataclass\n\nimport torch.nn.functional as F\nfrom fairseq import metrics, utils\nfrom fairseq....
[ [ "torch.nn.functional.nll_loss" ] ]
kastnerkyle/PyCon2015
[ "649700cb4ce2e55c0c23315538970152a63c7173" ]
[ "ex1_recommendations.py" ]
[ "from pandas.io.excel import read_excel\nfrom matrix_factorization import PMF\nimport matplotlib.pyplot as plt\nfrom utils import download\nfrom scipy import sparse\nimport numpy as np\nimport zipfile\nimport os\n\n\"\"\"\nA dataset of jokes and associated user ratings.\nEigentaste: A Constant Time Collaborative Fi...
[ [ "numpy.dot", "scipy.sparse.coo_matrix", "numpy.abs", "numpy.clip", "numpy.vstack", "matplotlib.pyplot.subplots", "numpy.copy", "pandas.io.excel.read_excel", "numpy.random.RandomState", "numpy.where", "matplotlib.pyplot.show" ] ]
milo-lab/biomass_distribution
[ "36cf0a80ec94deb73cb560b66cbd9fa190f528ce" ]
[ "bacteria_archaea/marine_deep_subsurface/cell_num/marine_deep_subsurface_prok_cell_num.py" ]
[ "\n# coding: utf-8\n\n# In[1]:\n\n# Load dependencies\nimport pandas as pd\nimport numpy as np\nimport sys\nfrom scipy.stats import gmean\nsys.path.insert(0, '../../../statistics_helper')\nfrom CI_helper import *\n\n\n# # Estimating the total number of bacteria and archaea in the marine deep subsurface\n# In order ...
[ [ "scipy.stats.gmean", "pandas.read_excel", "numpy.max", "numpy.mean", "numpy.array" ] ]
RyogaLi/tilseq_mutcount
[ "ba6d82851981d0849673e8858b208a5aecab4064" ]
[ "TileSeqMut/help_functions.py" ]
[ "#!/usr/bin/env python3.7\n\n# Helper functions\n# 1. downsample fastq files into n reads\n# 2. loading process animation function\n# 3. parse input json file\n\nimport pandas as pd\nimport random\nimport os\nimport sys\nimport json\nimport time\nimport itertools\nimport logging\nfrom Bio.Seq import Seq\n\n\ndef pa...
[ [ "pandas.DataFrame", "pandas.DataFrame.from_dict" ] ]
Doctorado-ML/RSvm
[ "42c2e40000d9dded4c80a827aeda236ab91a0cd3" ]
[ "rsvm/RSvm.py" ]
[ "import numpy as np\nfrom sklearn.base import BaseEstimator, ClassifierMixin\nfrom sklearn.utils.multiclass import (\n check_classification_targets,\n type_of_target,\n)\nfrom sklearn.utils.validation import (\n check_X_y,\n check_array,\n check_is_fitted,\n)\n\n\nclass RSvm(BaseEstimator, Classifier...
[ [ "numpy.dot", "sklearn.utils.validation.check_is_fitted", "numpy.nonzero", "sklearn.utils.validation.check_array", "numpy.unique", "numpy.clip", "sklearn.utils.multiclass.check_classification_targets", "numpy.zeros_like", "sklearn.utils.validation.check_X_y", "sklearn.utils....
liuguiyangnwpu/rrcf
[ "936ec1356cfbbc2ec77e9c90d7755d8afeb0b093" ]
[ "test/test_rrcf.py" ]
[ "import numpy as np\nimport rrcf\n\nnp.random.seed(0)\nn = 100\nd = 3\nX = np.random.randn(n, d)\nZ = np.copy(X)\nZ[90:, :] = 1\n\ntree = rrcf.RCTree(X)\nduplicate_tree = rrcf.RCTree(Z)\n\ntree_seeded = rrcf.RCTree(random_state=0)\nduplicate_tree_seeded = rrcf.RCTree(random_state=np.random.RandomState(0))\n\ndeck =...
[ [ "numpy.allclose", "numpy.random.seed", "numpy.arange", "numpy.random.shuffle", "numpy.copy", "numpy.random.randn", "numpy.random.uniform", "numpy.random.RandomState" ] ]
soytupadrrre/Master_Python_Eip
[ "c4774209d7dd15584233fe5d4cc01b1434c9316b" ]
[ "creacion_de_aplicaciones/tkinter_iris/app/gui/sepal_plot.py" ]
[ "import tkinter as tk\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg\nfrom matplotlib.backends.backend_tkagg import NavigationToolbar2Tk\nfrom matplotlib.figure import Figure\nimport pandas as pd\n\nclass SepalPlotApp:\n def __init__(self, master=None):\n # build ui\n self.sepal_l...
[ [ "matplotlib.backends.backend_tkagg.NavigationToolbar2Tk", "pandas.read_csv", "matplotlib.backends.backend_tkagg.FigureCanvasTkAgg", "matplotlib.figure.Figure" ] ]
changliao1025/WellApplication
[ "dc0d343614b731daea93579347e5820341acf9f6" ]
[ "wellapplication/MannKendall.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jan 8 19:55:22 2016\n\n@author: p\n\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nimport numpy as np\nimport pandas as pd\nfrom scipy.stats import norm\n\nimport sys\n\nif sys.version_info >= (3, 0):\n def xrange(*args...
[ [ "scipy.stats.norm.ppf", "numpy.sqrt", "numpy.unique", "numpy.sign", "pandas.to_numeric", "numpy.sum", "numpy.zeros" ] ]
nasa42/prophet
[ "31de123e3ca2ad9c448088be4905f44f47b5b087" ]
[ "test/support/country_holidays.py" ]
[ "import pandas as pd\nfrom fbprophet import Prophet\n\n# float_precision='high' required for pd.read_csv to match precision of Rover.read_csv\ndf = pd.read_csv('examples/example_wp_log_peyton_manning.csv', float_precision='high')\n\nm = Prophet()\nm.add_country_holidays(country_name='US')\nm.fit(df, seed=123)\nfutu...
[ [ "pandas.read_csv" ] ]
ViktorAlm/COVID-QA
[ "a2a300f07b02aa5b2e078c1f2bb184894717264d" ]
[ "datasources/META_scraper.py" ]
[ "import importlib.util\nimport logging\nimport os\n\nimport pandas as pd\nfrom haystack.database.elasticsearch import ElasticsearchDocumentStore\nfrom haystack.retriever.elasticsearch import ElasticsearchRetriever\nfrom scrapy.crawler import CrawlerProcess\n\nlogger = logging.getLogger(__name__)\n\nPATH = os.getcwd...
[ [ "pandas.concat", "pandas.DataFrame.from_dict" ] ]
ft-lab/Shade3D_sample_scripts
[ "881fef1affce09d5ba6b5081256c8e4ef4c334ae" ]
[ "scripts/ConvLineToPolyLine.py" ]
[ "# -----------------------------------------------------.\n# 線形状を等間隔の直線群に変換.\n#\n# @title \\en Convert line to equally spaced line groups \\enden\n# @title \\ja 線形状を等間隔の直線群に変換 \\endja\n# -----------------------------------------------------.\nimport numpy\nimport math\n\nscene = xshade.scene()\n\n#-----------------...
[ [ "numpy.array", "numpy.linalg.norm" ] ]
AlexB-B/DeePyMoD_torch_AlexVersion
[ "183f938e3a9a9acfb43f9bc0ce4629ed64b0fa0c" ]
[ "src/deepymod_torch/network.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass Library(nn.Module):\n def __init__(self, library_func, library_args={}):\n super().__init__()\n self.library_func = library_func\n self.library_args = library_args\n\n def forward(self, input):\n self.time_deriv_list, self.theta = sel...
[ [ "torch.nn.Parameter", "torch.rand", "torch.arange" ] ]
jcraig0/MiniAlphaZero
[ "b1533263d4ef6fadbf6ecff69cff6149747b6079" ]
[ "mcts.py" ]
[ "import torch\r\nimport config\r\nimport math\r\nimport copy\r\n\r\n\r\nclass Node:\r\n def __init__(self):\r\n self.wins = 0\r\n self.visits = 0\r\n self.probs = None\r\n self.move = None\r\n self.children = []\r\n self.parent = None\r\n\r\n\r\ndef board_to_tensor(board...
[ [ "torch.sum", "torch.no_grad", "torch.zeros" ] ]
MunkiChung/dm_control
[ "eeddc6619979c5e10ce554c4496b9f41bee90711" ]
[ "dm_control/mujoco/wrapper/core.py" ]
[ "# Copyright 2017 The dm_control 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 applicable law...
[ [ "numpy.copyto", "numpy.empty" ] ]
Dangandy/covid
[ "2c8b9f4ab365c5b460e7d7e28273d7966e382b77" ]
[ "backend/lstm.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nImplementation of building LSTM model\n\"\"\"\n# 3rd party imports\nimport pandas as pd\nimport numpy as np\nimport random as rn\nimport datetime as datetime\n\n# model\nimport tensorflow as tf\nfrom keras.models import Sequential\nfrom keras.layers import LSTM\nfrom keras.layers im...
[ [ "pandas.merge", "numpy.random.seed", "pandas.read_sql_table", "sklearn.model_selection.train_test_split", "numpy.array", "pandas.get_dummies" ] ]
persalteas/RNAnet
[ "60f0af5acad06695acd782f9401f5e166852f45f" ]
[ "geometric_stats.py" ]
[ "#!/usr/bin/python3\n\n# RNANet statistics\n# Developed by Aglaé Tabot & Louis Becquey, 2021 \n\n# This file computes additional geometric measures over the produced dataset,\n# and estimates their distribtuions through Gaussian mixture models.\n# THIS FILE IS NOT SUPPOSED TO BE RUN DIRECTLY.\n\nimport matplotlib.p...
[ [ "matplotlib.pyplot.legend", "numpy.sqrt", "numpy.linspace", "pandas.DataFrame", "numpy.concatenate", "matplotlib.pyplot.plot", "matplotlib.pyplot.gca", "numpy.arange", "matplotlib.pyplot.gcf", "matplotlib.pyplot.subplot", "matplotlib.pyplot.close", "pandas.read_sql"...
wolframalexa/taming-transformers
[ "41732cda0ce9579efba643d516b472e0e9dc7679" ]
[ "main.py" ]
[ "import argparse, os, sys, datetime, glob, importlib\nfrom omegaconf import OmegaConf\nimport numpy as np\nfrom PIL import Image\nimport torch\nimport torchvision\nfrom torch.utils.data import random_split, DataLoader, Dataset\nimport pytorch_lightning as pl\nfrom pytorch_lightning import seed_everything\nfrom pyto...
[ [ "torch.no_grad", "torch.clamp", "numpy.log2", "torch.utils.data.DataLoader" ] ]
LinkGeoML/EnsembleToponymInterlinking
[ "ccfdf2d5d1d901136d7aa73993255e96c6f1a43c" ]
[ "StringMatching/main.py" ]
[ "import argparse\r\nimport glob\r\nimport pandas as pd\r\nimport pickle\r\nimport torch\r\nfrom RSModel import RSModel\r\nfrom RSPoolModel import RSPoolModel\r\nfrom RSPenTanhModel import RSPenTanhModel\r\nfrom RSPenTanhPoolModel import RSPenTanhPoolModel\r\nfrom RSHardAttentionModel import RSHardAttentionModel\r\n...
[ [ "torch.manual_seed" ] ]
jegork/tf-pose-estimation
[ "d277dcfc372da1d63a55c8fb6538ed3259b795e3" ]
[ "create_video.py" ]
[ "import argparse\nimport logging\nimport time\n\nimport cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom tf_pose.estimator import TfPoseEstimator\nfrom tf_pose.networks import get_graph_path, model_wh\n\nlogger = logging.getLogger('TfPoseEstimator-Video')\nlogger.setLevel(logging.DEBUG)\nch = loggin...
[ [ "numpy.zeros" ] ]
ai-se/bellwether-configuration
[ "921ec881b17f29ed73bdb5b4510c2a30a6d23ef4" ]
[ "src/RQ3/metrics.py" ]
[ "import numpy as np\n\n\ndef rank_diff(actual, predicted):\n actual_ranks = np.argsort(actual).tolist()[0]\n predicted_ranks = predicted[actual_ranks]\n diff = abs(actual_ranks - predicted_ranks)\n return diff\n" ]
[ [ "numpy.argsort" ] ]
rionbr/smm4h
[ "6009ed7800884ab37b7080c8c825c30f501b6942" ]
[ "include/termdictparser.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nTerm Dictionary Parser\n==========================\n\nClasses to handle multi-word-token building and the parsing of sentences to extract matched terms.\n\nFor performance, both One-word-terms and multi-word-terms are handled using the `treelib` implementation of a Tree.\n\nRequire...
[ [ "pandas.DataFrame" ] ]
gachiemchiep/ggcnn
[ "0c50aa7600e8a30d44c5c85cebd6e3394a81f30e" ]
[ "utils/dataset_processing/evaluation.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom .grasp import GraspRectangles, detect_grasps\n\n\ndef plot_output(rgb_img, depth_img, grasp_q_img, grasp_angle_img, no_grasps=1, grasp_width_img=None):\n \"\"\"\n Plot the output of a GG-CNN\n :param rgb_img: RGB Image\n :param depth_img: Dept...
[ [ "matplotlib.pyplot.colorbar", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
XHChen0528/ConditionalGAN_Develop
[ "4ea6d8ea130589bc3ff8f3117660050ba41cdd0f" ]
[ "components/ConditionalWSConv2d.py" ]
[ "#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n#############################################################\n# File: ConditionalWSConv2d.py\n# Created Date: Tuesday October 1st 2019\n# Author: Chen Xuanhong\n# Email: chenxuanhongzju@outlook.com\n# Last Modified: Saturday, 5th October 2019 12:21:23 pm\n# Modifie...
[ [ "torch.nn.functional.conv2d", "numpy.sqrt", "torch.nn.Embedding", "torch.nn.init.xavier_uniform_" ] ]
thirschbuechler/didactic-barnacles
[ "88d0a2b572aacb2cb45e68bb4f05fa5273224439" ]
[ "computation/scipy-peaks.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Apr 12 17:48:42 2020\n\n@author: thomas\n\"\"\"\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nfrom scipy.misc import electrocardiogram\nfrom scipy.signal import find_peaks\n\n \ny = electrocardiogram()[2000:4000]\nprint(np.shape...
[ [ "matplotlib.pyplot.stem", "scipy.signal.find_peaks", "matplotlib.pyplot.plot", "numpy.shape", "scipy.misc.electrocardiogram" ] ]
traffic-lights/rlpyt
[ "ec4689cddd55d98c037194685cfd6ca8e6785014", "ec4689cddd55d98c037194685cfd6ca8e6785014" ]
[ "rlpyt/projects/safe/safety_gym_env.py", "rlpyt/ul/envs/atari.py" ]
[ "\n# Requires installing OpenAI gym and safety gym.\n\nimport numpy as np\n\nimport safety_gym\nimport gym\nfrom gym import Wrapper\n\nfrom rlpyt.envs.gym import GymEnvWrapper\nfrom rlpyt.samplers.collections import TrajInfo\n\n# To use: return a dict of keys and default values which sometimes appear in\n# the wrap...
[ [ "numpy.append", "numpy.dtype", "numpy.transpose" ], [ "numpy.concatenate", "numpy.maximum", "numpy.zeros", "numpy.random.randint" ] ]
joon1170/CreditCard-Fraud
[ "6e89b406078441209552f4421077e56075266778" ]
[ "01_explore.py" ]
[ "# Certification Project by Joon Kim\n#\n# ## Part 1 - Data Exploration, Feature Selection\n\n# In this module we use Spark in conjunction with some popular Python libraries\n# to explore data and select features we will use in the next module which is model training,\n# scoring and evaluation.\n\n# ## Setup\n# Imp...
[ [ "matplotlib.pyplot.subplot", "matplotlib.pyplot.show" ] ]
tunsmm/fitness_guide
[ "42df50c9f35a4345c72e9c7e3868867fc8dfd563" ]
[ "fitness_guide/menu/services/data/regression_amino.py" ]
[ "import numpy as np\n\nfrom regression.Regression import LinearRegression\nfrom regression.Optimization import MomentGrad\nfrom regression.Loss import LinearMSE\n\nif __name__ == \"__main__\":\n dataset = np.load('amino_xy_matrix.np', allow_pickle=True)\n data_x = dataset[:, :-1]\n data_y = dataset[:, -1]\...
[ [ "numpy.load" ] ]
dgerod/gesto-prof
[ "4c45e1306625831bf5718f3843347d7eb7b58132" ]
[ "scripts/helpers/preparar_facturas_recibidas.py" ]
[ "import os\nimport sys\n\n_CURRENT_DIRECTORY = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(os.path.dirname(os.path.dirname(os.path.normpath(_CURRENT_DIRECTORY))))\n\nimport pandas as pd\nfrom scripts.common.configuration import Configuration\n\n\nconfiguration = Configuration()\nfile_path = os.path....
[ [ "pandas.read_csv", "pandas.to_datetime", "pandas.DataFrame" ] ]
edurenye/keras-rl2
[ "8e1ce5ea9bb335c75775857ef3d36a5b0d8cf9a2" ]
[ "rl/core.py" ]
[ "# -*- coding: utf-8 -*-\nimport warnings\nfrom copy import deepcopy\n\nimport numpy as np\nfrom tensorflow.keras.callbacks import History\n\nfrom rl.callbacks import (\n CallbackList,\n TestLogger,\n TrainEpisodeLogger,\n TrainIntervalLogger,\n Visualizer\n)\n\n\nclass Agent(object):\n \"\"\"Abst...
[ [ "numpy.int16", "numpy.zeros_like", "numpy.float32", "tensorflow.keras.callbacks.History", "numpy.isreal", "numpy.random.randint" ] ]
Spiden-data/DeepeR
[ "03e2bf135aa692b0df34b6c8baca3dcae3e988ea" ]
[ "Raman Spectral Denoising/train.py" ]
[ "import os\r\nimport sys\r\nimport random\r\nimport datetime\r\nimport time\r\nimport shutil\r\nimport argparse\r\nimport warnings\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport scipy.io\r\nimport scipy.signal\r\nimport math\r\nfrom skimage.measure import compare_ssim ...
[ [ "torch.nn.MSELoss", "torch.optim.lr_scheduler.CyclicLR", "torch.distributed.init_process_group", "torch.multiprocessing.spawn", "torch.cuda.set_device", "torch.optim.lr_scheduler.MultiplicativeLR", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.no_grad", "torch....
mdpiper/fortran-explorations
[ "a82147365ef8f4325e608c2316842e932a37cf7b" ]
[ "bmi/bmiheat_ex.py" ]
[ "\"\"\"An example of calling a Fortran BMI through Cython.\"\"\"\n\nimport numpy as np\nfrom bmi_heat import Heat\n\n\nconfig_file = 'test.cfg'\n\n\nnp.set_printoptions(formatter={'float': '{: 6.1f}'.format})\n\n# Instantiate a model and get its name.\nm = Heat()\nprint(m.get_component_name())\n\n# Initialize the m...
[ [ "numpy.arange", "numpy.set_printoptions", "numpy.array", "numpy.roll", "numpy.empty" ] ]
AleksZhuravlyov/dpnm_validation
[ "13bdee4b79f9737e3d78caa6b04c98b1c34401db" ]
[ "sgrid/script.py" ]
[ "# MIT License\n# \n# Copyright (c) 2020 Aleksandr Zhuravlyov and Zakhar Lanets\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 ...
[ [ "numpy.array", "numpy.random.rand" ] ]
IgorTavcar/classla
[ "5a1246b62eb352af631d4f4593f467e9ccbd3777" ]
[ "classla/models/charlm.py" ]
[ "\"\"\"\nEntry point for training and evaluating a character-level neural language model.\n\"\"\"\n\nimport random\nimport argparse\nfrom copy import copy\nfrom collections import Counter\nfrom types import GeneratorType\nimport numpy as np\nimport torch\nimport math\nimport logging\nimport time\nimport os\n\nfrom ...
[ [ "torch.nn.CrossEntropyLoss", "torch.optim.lr_scheduler.ReduceLROnPlateau", "numpy.random.random", "numpy.random.seed", "torch.cuda.manual_seed", "torch.load", "torch.manual_seed", "torch.tensor", "torch.nn.utils.clip_grad_norm_", "numpy.random.normal", "torch.no_grad", ...
zzs1994/DJsRH
[ "6041c2df810723dd0052e2e5b7c6bd33033f0f21" ]
[ "datasets.py" ]
[ "import torch\nimport cv2\nimport scipy.io as scio\nfrom PIL import Image\nimport settings\nimport numpy as np\nimport scipy.io as scio\nfrom torchvision import transforms\nimport h5py\n\n\nif settings.DATASET == \"WIKI\":\n\n label_set = scio.loadmat(settings.LABEL_DIR)\n test_txt = np.array(label_set['T_te'...
[ [ "scipy.io.loadmat", "numpy.concatenate", "numpy.random.permutation", "numpy.transpose", "numpy.array", "numpy.where" ] ]
huangjunjie-cs/pytorch_geometric_signed_directed-1
[ "24b121ff4325d201b30811975bcb6f104a39dc35" ]
[ "torch_geometric_signed_directed/nn/signed/SSSNET_node_clustering.py" ]
[ "from typing import Tuple\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.parameter import Parameter\n\nfrom .SIMPA import SIMPA\n\nclass SSSNET_node_clustering(nn.Module):\n r\"\"\"The signed graph clustering model from the\n `SSSNET: Semi-Supervised Signed Network Clus...
[ [ "torch.nn.functional.normalize", "torch.nn.Dropout", "torch.mm", "torch.nn.functional.softmax", "torch.nn.functional.log_softmax", "torch.FloatTensor", "torch.nn.init.xavier_uniform_", "torch.nn.ReLU", "torch.argmax" ] ]
lykzsm/Pytorch-Medical-Classification
[ "86c1215612f6d6483ccb5cd061925ba755120f35" ]
[ "main.py" ]
[ "import os\nos.environ['CUDA_VISIBLE_DEVICES'] = '0'\ndevicess = [0]\nfrom collections import defaultdict\nimport time\nimport argparse\nimport numpy as np\nfrom PIL import Image\nimport torch\nfrom sklearn import metrics\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard import SummaryWriter\nf...
[ [ "torch.optim.lr_scheduler.StepLR", "torch.utils.data.DataLoader", "sklearn.metrics.confusion_matrix", "torch.is_tensor", "numpy.concatenate", "torch.utils.tensorboard.SummaryWriter", "torch.cuda.is_available", "sklearn.metrics.f1_score", "torch.nn.DataParallel", "sklearn.me...
ArnaudTurn/cudf
[ "e5817349cbcad8a68cf9d2b54d12b097ee1502f6" ]
[ "python/cudf/cudf/core/column/datetime.py" ]
[ "# Copyright (c) 2019-2021, NVIDIA CORPORATION.\n\nfrom __future__ import annotations\n\nimport builtins\nimport datetime as dt\nimport locale\nimport re\nfrom locale import nl_langinfo\nfrom numbers import Number\nfrom types import SimpleNamespace\nfrom typing import Any, Mapping, Sequence, Union, cast\n\nimport n...
[ [ "numpy.datetime_data", "pandas.to_datetime", "pandas.api.types.is_datetime64_dtype", "numpy.isnat", "numpy.issubdtype", "numpy.datetime64", "numpy.timedelta64", "pandas.api.types.is_timedelta64_dtype", "numpy.array", "pandas.Timestamp" ] ]
careyjiang/tensorflow_hmm
[ "6dad60141a240df8170fb6832c782a7672dfdb8f" ]
[ "test/test_hmm.py" ]
[ "from __future__ import print_function\n\nimport pytest\nimport numpy as np\nimport tensorflow as tf\n\nfrom tensorflow_hmm import HMMNumpy, HMMTensorflow\n\n\n@pytest.fixture\ndef latch_P():\n P = np.array([[0.5, 0.5], [0.0, 1.0]])\n # P = np.array([[0.5, 0.5], [0.5, 0.5]])\n # P = np.array([[0.5, 0.5], [...
[ [ "numpy.asarray", "tensorflow.placeholder", "numpy.stack", "numpy.ones", "tensorflow.global_variables_initializer", "tensorflow.Session", "numpy.testing.assert_allclose", "numpy.array", "numpy.sum", "numpy.isclose" ] ]
SmartDataLab/building_damage_kd
[ "45392fff69de818b8d13576de6c413372ca3d0e0" ]
[ "train50_loc-KD.py" ]
[ "import os\n\nos.environ[\"MKL_NUM_THREADS\"] = \"1\"\nos.environ[\"NUMEXPR_NUM_THREADS\"] = \"1\"\nos.environ[\"OMP_NUM_THREADS\"] = \"1\"\n\nfrom os import path, makedirs, listdir\nimport sys\nimport numpy as np\n\nnp.random.seed(1)\nimport random\n\nrandom.seed(1)\n\nimport torch\nfrom torch import nn\nfrom torc...
[ [ "torch.optim.lr_scheduler.MultiStepLR", "numpy.rot90", "torch.sigmoid", "torch.norm", "numpy.random.seed", "torch.load", "torch.cat", "torch.utils.data.DataLoader", "torch.cuda.empty_cache", "torch.tensor", "torch.no_grad", "numpy.mean", "torch.log" ] ]
davebx/ARTDeco
[ "1b08583a2e23015f6bc444919b2e10d5fb1bcf19" ]
[ "ARTDeco/diff_exp_read_in.py" ]
[ "'''\nModule that contains functions for running diff_exp_read_in mode.\n'''\nimport pandas as pd\nimport numpy as np\nimport os\nimport functools\n\n'''\nDefine a function that can get all of the condition information.\n'''\ndef get_conditions(conditions_file,meta_file):\n\n #Get conditions.\n condition1,con...
[ [ "numpy.log2", "pandas.merge", "pandas.read_csv" ] ]
Amshra267/BOSCH_A-G_INTERIIT
[ "480af2894d91585ba8940b795fd8f20a6caa2998" ]
[ "main.py" ]
[ "from copyreg import dispatch_table\nimport os\n\n# comment out below line to enable tensorflow logging outputs\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\nimport time\nimport tensorflow as tf\nimport statistics\nphysical_devices = tf.config.experimental.list_physical_devices('GPU')\nif len(physical_devices) > 0:\n ...
[ [ "tensorflow.convert_to_tensor", "tensorflow.keras.models.load_model", "numpy.linspace", "numpy.asarray", "tensorflow.cast", "matplotlib.pyplot.get_cmap", "tensorflow.map_fn", "numpy.mean", "tensorflow.compat.v1.InteractiveSession", "numpy.moveaxis", "tensorflow.config.e...
atfkaka/CNTK
[ "4370db138aa1e14d9363a8ad055f23b7e7369377" ]
[ "bindings/python/cntk/ops/functions.py" ]
[ "from cntk import cntk_py\nfrom ..utils import typemap, sanitize_var_map, value_to_seq\nfrom enum import Enum, unique\nimport numpy as np\n\n\n@unique\nclass CloneMethod(Enum):\n '''\n Describes different ways how :func:`~cntk.ops.functions.Function.clone`\n works.\n '''\n\n share = 'share'\n '''\...
[ [ "numpy.ones_like" ] ]