repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
spacemonkey01/pypastry | [
"b5c71d114af5740344aad7ba577c06fbf02a6046",
"b5c71d114af5740344aad7ba577c06fbf02a6046"
] | [
"pypastry/experiment/evaluation.py",
"tests/evaluation_test.py"
] | [
"from datetime import datetime\nfrom types import ModuleType\n\nimport numpy as np\nimport pandas as pd\nfrom git import Repo\nfrom joblib import Parallel, delayed\nfrom pypastry.experiment import Experiment\nfrom pypastry.experiment.hasher import get_dataset_hash\nfrom pypastry.experiment.results import ResultsRep... | [
[
"numpy.hstack",
"pandas.DataFrame",
"sklearn.base.clone",
"sklearn.base.is_classifier",
"scipy.stats.sem"
],
[
"sklearn.model_selection.GroupShuffleSplit",
"sklearn.dummy.DummyClassifier",
"pandas.DataFrame",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.metrics.make_... |
DeepThoughtTeam/tensorflow | [
"486a8950537c04fbd1c781b6e0bd0bf0999cc9a4"
] | [
"tensorflow/examples/tutorials/mnist/mnist_softmax.py"
] | [
"# Copyright 2015 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.matmul",
"tensorflow.InteractiveSession",
"tensorflow.zeros",
"tensorflow.cast",
"tensorflow.placeholder",
"tensorflow.initialize_all_variables",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.log",
"tensorflow.argmax"
]
] |
robgon-art/stylegan2-ada-pytorch | [
"51b24a249469b08e17ff2d6b2cd618d9cbf79e0f"
] | [
"train.py"
] | [
"# from https://github.com/rosinality/stylegan2-pytorch\r\n\r\nimport argparse\r\nimport math\r\nimport random\r\nimport os\r\n\r\nimport numpy as np\r\nimport torch\r\nfrom torch import nn, autograd, optim\r\nfrom torch.nn import functional as F\r\nfrom torch.utils import data\r\nimport torch.distributed as dist\r... | [
[
"torch.randn_like",
"torch.distributed.init_process_group",
"torch.utils.data.distributed.DistributedSampler",
"torch.cuda.set_device",
"torch.load",
"torch.randn",
"torch.utils.data.SequentialSampler",
"torch.utils.data.RandomSampler",
"torch.tensor",
"torch.no_grad",
... |
memmelma/visual-prior | [
"6b9c65f291c587fcbb3fcc3f61f76cdd1c3eb175"
] | [
"visualpriors/transforms.py"
] | [
"from .taskonomy_network import TaskonomyEncoder, TaskonomyDecoder, TaskonomyNetwork, TASKONOMY_PRETRAINED_URLS, TASKS_TO_CHANNELS\nimport multiprocessing.dummy as mp\nimport torch\n\ndefault_device = 'cuda' if torch.cuda.is_available() else 'cpu'\n\ndef representation_transform(img, feature_task='normal', device=d... | [
[
"torch.device",
"torch.no_grad",
"torch.utils.model_zoo.load_url",
"torch.cuda.is_available"
]
] |
amithfernando/DeepPavlov | [
"d643000f0a5bb4c220a28899d727e12e195000e0"
] | [
"deeppavlov/dataset_iterators/ranking_iterator.py"
] | [
"from deeppavlov.core.common.registry import register\nfrom deeppavlov.core.data.data_learning_iterator import DataLearningIterator\n\nimport numpy as np\nimport random\nfrom typing import Dict, List, Tuple\n\n\n@register('ranking_iterator')\nclass RankingIterator(DataLearningIterator):\n \"\"\"The class contain... | [
[
"numpy.random.seed",
"numpy.random.choice",
"numpy.random.shuffle",
"numpy.ones",
"numpy.random.randint"
]
] |
gtuzi/TensorFlowPlayground | [
"293457e8e8a5e802aa0f28da3034d17492171f4c"
] | [
"Autoencoders/AutoencoderPhasedTraining.py"
] | [
"'''\nTrain Autoencoder networks one at a time. Then combine the final\nnetwork into one. Each of these steps are phases.\nTo achieve this, use a different TensorFlow graph for each phase.\nAt each phase, you build the outer layers, as you progress inwards.\nTraining data for the next phase becomes the training out... | [
[
"tensorflow.zeros",
"tensorflow.train.AdamOptimizer",
"tensorflow.add_n",
"tensorflow.Graph",
"tensorflow.contrib.layers.variance_scaling_initializer",
"tensorflow.reset_default_graph",
"matplotlib.pyplot.subplot",
"tensorflow.square",
"matplotlib.pyplot.axis",
"matplotlib.... |
EleMisi/ConditionalVAE | [
"f5e6a13f13b6539a71d8aced830fcda8f5171090"
] | [
"src/celeba.py"
] | [
"from collections import OrderedDict\nimport cv2\nfrom tensorflow.keras.utils import Sequence\nimport math\nimport numpy as np\nimport os\nimport pandas as pd\nimport random\nimport tensorflow as tf\n\nfrom utils import save_data\n\n\nclass CelebADataset(Sequence):\n\n\n def __init__(self, train_size, batch_size... | [
[
"numpy.asarray",
"numpy.array",
"pandas.read_csv",
"numpy.float32"
]
] |
dulithchinthaka/DCDS | [
"3f804a87aa57007769985b51eb2d7939fe15cb95"
] | [
"reid/models/fusion_branch.py"
] | [
"from torch import nn\nimport torch\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport pdb\n\n\n\n\ndef Dist_Comp(pg1, pg2, dotp):\n A = dotp\n A = A - torch.min(A) #############\n\n #################################################################################################... | [
[
"torch.norm",
"torch.ones",
"torch.max",
"torch.cat",
"torch.zeros",
"torch.min",
"torch.eye",
"torch.matmul",
"torch.eig",
"torch.diag",
"torch.autograd.Variable"
]
] |
ncsoft/rotated-box-is-back | [
"52040333851bd2456a4e2f15347311cad3410636"
] | [
"rpn_util/generate_anchors.py"
] | [
"# --------------------------------------------------------\n# Faster R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Sean Bell\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom ... | [
[
"numpy.hstack",
"numpy.sqrt",
"numpy.arange",
"numpy.round",
"numpy.array"
]
] |
Waste-NANDO/Mask_RCNN | [
"272fbeba35e62ce3a6772c9c70e62da9fcb4a40e"
] | [
"materials_trash_detector/trash_dataset.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n\nDataset for Mask R-CNN\nConfigurations and data loading code for COCO format.\n\n@author: Mattia Brusamento\n\"\"\"\n\nimport os\nimport sys\nimport time\nimport numpy as np\nimport json\n\n# Download and install the Python coco tools from https://github.com/waleedka/coco\n# That... | [
[
"numpy.array",
"numpy.stack",
"numpy.ones"
]
] |
omserta/xsocs | [
"5e1cf1352233498c48f0566e0b819e18373e95e5"
] | [
"xsocs/gui/view/fitview/FitModel.py"
] | [
"# coding: utf-8\n# /*##########################################################################\n#\n# Copyright (c) 2015-2017 European Synchrotron Radiation Facility\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Soft... | [
[
"numpy.where"
]
] |
ZiwenZhuang/rlpyt | [
"95a05a86f576190cf6217fd9aad7b5f615ee97d1",
"95a05a86f576190cf6217fd9aad7b5f615ee97d1"
] | [
"rlpyt/utils/logging/logger.py",
"rlpyt/utils/seed.py"
] | [
"from enum import Enum\n\nfrom exptools.logging.tabulate import tabulate\nfrom exptools.logging.console import mkdir_p, colorize\nfrom exptools.logging.autoargs import get_all_parameters\nfrom contextlib import contextmanager\nimport numpy as np\nimport os\nimport os.path as osp\nimport sys\nimport datetime\n# impo... | [
[
"numpy.min",
"numpy.median",
"numpy.max",
"numpy.std",
"numpy.average",
"torch.save"
],
[
"torch.manual_seed",
"torch.cuda.manual_seed",
"numpy.random.seed"
]
] |
hkaraoguz/RRPN | [
"4d09535cc383d6311738cda0c6c7cde3eeca05d8"
] | [
"lib/setup.py"
] | [
"# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\nimport os\nfrom os.path import join as pjoin\nfrom setuptoo... | [
[
"numpy.get_numpy_include",
"numpy.get_include"
]
] |
Shanlans/tensorflow-deeplab-resnet | [
"6d1035221b67fed81058bf84c96e56d8f4e62a89"
] | [
"kaffe/tensorflow/network.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport pdb\n\nslim = tf.contrib.slim\n\nDEFAULT_PADDING = 'SAME'\n\n\ndef layer(op):\n '''Decorator for composable network layers.'''\n\n def layer_decorated(self, *args, **kwargs):\n # Automatically set a name if not provided.\n name = kwargs.setdef... | [
[
"tensorflow.nn.bias_add",
"tensorflow.nn.relu",
"tensorflow.get_variable",
"tensorflow.nn.softmax",
"tensorflow.concat",
"tensorflow.constant",
"tensorflow.nn.conv2d",
"tensorflow.nn.max_pool",
"tensorflow.reshape",
"tensorflow.squeeze",
"tensorflow.nn.avg_pool",
"t... |
GolamRashed/azure-databricks-mlops-mlflow | [
"d1e4a21cb5047213ac0d4c620aac8938048d8168"
] | [
"ml_source/tests/diabetes/scoring/test_scoring_batch.py"
] | [
"import os\nimport unittest\n\nimport pandas as pd\nfrom diabetes.scoring.batch.run import batch_scoring\nfrom diabetes.training.evaluate import split_data\nfrom diabetes.training.train import train_model\n\n\nclass TestScoringBatchMethods(unittest.TestCase):\n def test_batch_scoring(self):\n ridge_args =... | [
[
"pandas.read_csv"
]
] |
EXAUQ/mogp-emulator | [
"9d5772135498bdf5b95b44b4afb065c2c266f899",
"9d5772135498bdf5b95b44b4afb065c2c266f899"
] | [
"mogp_emulator/GaussianProcessGPU.py",
"mogp_emulator/SequentialDesign.py"
] | [
"\"\"\"\nextends GaussianProcess with an (optional) GPU implementation\n\"\"\"\n\nimport os\nimport re\nimport numpy as np\n\nfrom mogp_emulator.Kernel import SquaredExponential, Matern52\nfrom mogp_emulator.MeanFunction import MeanFunction, MeanBase\n\nimport mogp_emulator.LibGPGPU as LibGPGPU\n\nfrom mogp_emulato... | [
[
"numpy.allclose",
"numpy.reshape",
"numpy.copy",
"numpy.shape",
"numpy.array",
"numpy.zeros"
],
[
"numpy.dot",
"numpy.savez",
"numpy.isfinite",
"numpy.reshape",
"numpy.arange",
"numpy.eye",
"numpy.full",
"numpy.all",
"numpy.ones",
"numpy.argmax",... |
ag-ds-bubble/swtloc | [
"af11cfa4369116ed708b9db930b294ed9a430f59"
] | [
"swtloc/bubble_bbox.py"
] | [
"# Author : Achintya Gupta\n\nimport numpy as np\nfrom cv2 import cv2\n\nclass BubbleBBOX:\n\n def __init__(self, labelmask, comp_props, lookup_radii_multiplier=0.8,\n sw_ratio = 2, cl_deviat = [13,13,13], ht_ratio = 2, ar_ratio = 3, ang_deviat = 30,\n bubble_width = 1):\n ... | [
[
"numpy.abs",
"numpy.sqrt",
"numpy.unique",
"numpy.int32",
"numpy.linalg.norm",
"numpy.array",
"numpy.zeros"
]
] |
FRCTeam2984/infiniterecharge2020 | [
"8f3e8515c69cd9c378f19a0d0e24a5de2b5011e2"
] | [
"src/utils/lazytalonsrx.py"
] | [
"import logging\n\nimport ctre\nimport numpy as np\n\n\nclass EncoderType:\n Quad = ctre.FeedbackDevice.QuadEncoder\n Integrated = ctre.FeedbackDevice.IntegratedSensor\n CTREMag = ctre.FeedbackDevice.CTRE_MagEncoder_Relative\n\n\nclass EncoderConfig:\n def __init__(self, _type: EncoderType, cpr: int):\n... | [
[
"numpy.clip"
]
] |
OlegJakushkin/KaggleGPT2-ArxivTitleGeneration | [
"270a492b426cc3f0969b6b2af677ab1a86c4439a"
] | [
"generate-gpt2.py"
] | [
"import os\nimport pandas as pd\nimport requests\n\nfrom tqdm import tqdm\n\ntqdm.pandas()\n\nfrom pandarallel import pandarallel\n\nfrom gensim.summarization import keywords\nfrom gpt2_client import *\nimport gpt_2_simple as gpt2\nimport tensorflow as tf\nfrom itertools import groupby\n\nfrom termcolor import colo... | [
[
"tensorflow.Graph",
"pandas.read_csv",
"pandas.Series",
"numpy.random.seed",
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.debugging.set_log_device_placement",
"tensorflow.placeholder",
"tensorflow.set_random_seed",
"tensorflow.train.Saver"
]
] |
carlosal1015/sfepy | [
"f02f88c5df9814ad710c658429e23c90744b0d9d"
] | [
"sfepy/solvers/semismooth_newton.py"
] | [
"from __future__ import absolute_import\n\nimport numpy as nm\nimport numpy.linalg as nla\nimport scipy.sparse as sp\n\nfrom sfepy.base.base import output, get_default, debug\nfrom sfepy.base.timing import Timer\nfrom sfepy.solvers.nls import Newton, conv_test\nfrom sfepy.linalg import compose_sparse\nimport six\nf... | [
[
"numpy.ones_like",
"numpy.abs",
"numpy.sqrt",
"numpy.isfinite",
"numpy.empty_like",
"numpy.arange",
"numpy.linalg.norm",
"numpy.finfo",
"scipy.sparse.spdiags",
"numpy.zeros_like",
"numpy.where",
"numpy.empty"
]
] |
zommiommy/ray | [
"4fb195a22e972a0b54359ffa58afedb35e827540"
] | [
"rllib/agents/es/es.py"
] | [
"# Code in this file is copied and adapted from\n# https://github.com/openai/evolution-strategies-starter.\n\nfrom collections import namedtuple\nimport logging\nimport numpy as np\nimport time\n\nimport ray\nfrom ray.rllib.agents import Trainer, with_common_config\nfrom ray.rllib.agents.es import optimizers, utils... | [
[
"numpy.square",
"numpy.sign",
"numpy.mean",
"numpy.random.uniform",
"numpy.array",
"numpy.random.RandomState"
]
] |
awslabs/sagemaker-privacy-for-nlp | [
"899f178748401eaf2713cec83d37306f8a1327a8"
] | [
"source/sagemaker/src/package/data_privatization/container/train.py"
] | [
"# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# SPDX-License-Identifier: LicenseRef-.amazon.com.-AmznSL-1.0\n# Licensed under the Amazon Software License http://aws.amazon.com/asl/\n\nimport argparse\nimport os\nfrom os.path import join\nimport json\nimport random\nimport time\nimport... | [
[
"torch.sigmoid",
"torch.zeros",
"torch.manual_seed",
"torch.nn.functional.avg_pool2d",
"torch.nn.Embedding",
"torch.nn.Linear",
"torch.nn.BCEWithLogitsLoss",
"torch.cuda.is_available",
"torch.save"
]
] |
DragonDriver/milvus | [
"b72e4c63726e28cd54f90c642faf5394d4a24c12"
] | [
"tests20/python_client/testcases/test_collection.py"
] | [
"import numpy\nimport pandas as pd\nimport pytest\nfrom pymilvus import DataType\n\nfrom base.client_base import TestcaseBase\nfrom utils.util_log import test_log as log\nfrom common import common_func as cf\nfrom common import common_type as ct\nfrom common.common_type import CaseLabel, CheckTasks\n\nprefix = \"co... | [
[
"pandas.DataFrame",
"pandas.date_range"
]
] |
sfepy/example_poropiezo | [
"c21916c8e4f2d277aefe0462898c68cea4ca052a"
] | [
"poropiezo_micro_dfc.py"
] | [
"# This example implements homogenization of piezoeletric porous media.\n# The mathematical model and numerical results are described in: \n#\n# ROHAN E., LUKEŠ V.\n# Homogenization of the fluid-saturated piezoelectric porous media.\n# International Journal of Solids and Structures\n# Volume 147, 15 August 2018, Pa... | [
[
"numpy.array",
"numpy.expand_dims",
"numpy.vstack",
"numpy.unique"
]
] |
karavik18/Orthogonal-Transforms | [
"7210dbd33cd8dddb5baaa6b018f0ecf5cab30e07"
] | [
"src/utils.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Python version: 3.6\n\nimport numpy as np\nimport math\n\ndef getSequence():\n inSequence = np.array([])\n inSeqString = input(\"\\nPlease enter the array (elements separated by space): \")\n seqSplited = inSeqString.split()\n for i in range(len(seqSpli... | [
[
"numpy.log2",
"numpy.cos",
"numpy.sin",
"numpy.concatenate",
"numpy.exp",
"numpy.array",
"numpy.zeros"
]
] |
vazgenk/catboost | [
"dc7a55065ce2ef0dc140a35b06e6cf4dcd851ac5"
] | [
"catboost/pytest/test.py"
] | [
"from itertools import permutations\nimport yatest.common\nfrom yatest.common import ExecutionTimeoutError, ExecutionError\nimport pytest\nimport os\nimport filecmp\nimport numpy as np\nimport timeit\nimport json\n\nimport catboost\n\nfrom catboost_pytest_lib import (\n apply_catboost,\n compare_evals_with_pr... | [
[
"numpy.dot",
"numpy.hstack",
"numpy.log",
"numpy.random.random",
"numpy.allclose",
"numpy.random.seed",
"numpy.arange",
"numpy.all",
"numpy.concatenate",
"numpy.random.randn",
"numpy.mean",
"numpy.float32",
"numpy.savetxt",
"numpy.array",
"numpy.random.R... |
lyalcorn/LUCI | [
"ed9dde4286ca80694f53a3a50e1da2073a92ff76"
] | [
"LUCI/LuciFitParameters.py"
] | [
"\"\"\"\nIn this file we have the functions used to calculate the velocity, the velocity dispersion (broadening),\nand the flux as well as their uncertainties.\n\"\"\"\nimport math\nimport numpy as np\nfrom scipy import special as sps\n\n# Define Constants #\nSPEED_OF_LIGHT = 299792 # km/s\nFWHM_COEFF = 2.*math.sq... | [
[
"numpy.sqrt",
"numpy.abs"
]
] |
trohit/stackedBarChart | [
"8e8c2ee542f87e8ad7fefe648dec712abeaef1fe"
] | [
"graphcsv.py"
] | [
"#!/usr/bin/env python3.7\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Apr 4 10:15:48 2020\n@author: rohit\n\npython3.7 ./graphcsv.py -i /tmp/linuxmem_a.csv --offset 5 --vxdate \"Apr 06 11:04:50\" --vpct 20 --vtitle \"report gen started\"\n\ndate,drname,cpupct,curmem,maxmem,mempct,netrx,nettx\nApr 06 11:00:37,... | [
[
"matplotlib.pyplot.gca",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.xticks"
]
] |
soothing35/cryoEM_annealling | [
"212beaf23fe287d69571582fdbadc736f1abf908"
] | [
"Pymol_scripts/Draw_rotation_axis.py"
] | [
"'''\nModified from:\nhttp://pymolwiki.org/index.php/RotationAxis\n\nAn extra function, auto_draw_axis, was added, to calculate the rotational angles among bunch of structures (line 267)\n'''\n\nfrom __future__ import print_function\n\n__author__ = 'Pablo Guardado Calvo'\n__version__ = '0.1'\n__email__ = 'pablo.... | [
[
"numpy.dot",
"numpy.absolute",
"numpy.linalg.norm",
"numpy.linalg.lstsq",
"numpy.array"
]
] |
Ethan07902050/s3prl | [
"e120e29a59e5b4f6a1e9d7946602070567301938"
] | [
"s3prl/downstream/mosei/expert.py"
] | [
"import os\n\n# import math\nimport torch\n\n# import random\n\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader\nfrom torch.nn.utils.rnn import pad_sequence\n\nfrom .model import Model\nfrom .dataset import MOSEIDataset\n\nimport pandas as pd\n\n# import sys\n\nfrom collections import d... | [
[
"torch.nn.CrossEntropyLoss",
"pandas.read_csv",
"torch.LongTensor",
"torch.nn.utils.rnn.pad_sequence",
"torch.utils.data.DataLoader",
"torch.nn.Linear",
"torch.FloatTensor",
"sklearn.metrics.f1_score"
]
] |
yashbonde/gpt | [
"11e57a5fddd0eb20e44ebe3a661aa0b144a1730b"
] | [
"tokenizer.py"
] | [
"# @yashbonde x NBX Internal - 28th April 2021\n# This file is based on code by the authors denoted below and has been modified from its original version.\n#\n# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may n... | [
[
"torch.tile"
]
] |
smoorjani/matrix-multiplication | [
"8d378d972f45e9f9c1f4b26457021636ad1f2d9b"
] | [
"benchmarks/random_tensor_benchmark.py"
] | [
"import torch\nimport numpy as np\nimport time\nimport logging\nfrom custom_mm import (\n init_cublas,\n destroy_cublas,\n init_cusparse,\n destroy_cusparse\n)\nfrom matmuls import (\n cublas_matmul,\n cusparse_matmul\n)\n\ninit_cublas()\ninit_cusparse()\n\nLOG = \"./random_tensor_benchmark.log\"\... | [
[
"numpy.random.seed",
"torch.manual_seed",
"torch.tensor",
"numpy.random.permutation",
"numpy.random.rand",
"numpy.unravel_index"
]
] |
pwentrys/tensorflow_tests | [
"b8d897bc1ca02c9f35139cc8090ee3814e349716"
] | [
"tensorflow_self_check.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.test.is_built_with_cuda"
]
] |
scottcha/tsfresh | [
"b3395c12d7e25494bdc297a31f6d1136e76c477e"
] | [
"tests/integrations/test_feature_extraction.py"
] | [
"# This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)\n# Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016\n\nfrom unittest import TestCase\n\nimport dask.dataframe as dd\nimport pandas as pd\n\nfrom tsfresh.examples.driftbif_simulation import load... | [
[
"pandas.DataFrame"
]
] |
jaisakthism/u-net | [
"daf600930d6637f65beafc8f914e186bfc418316"
] | [
"train.py"
] | [
"from __future__ import print_function\n\nimport cv2\nimport numpy as np\nfrom keras.models import Model\nfrom keras.layers import Input, merge, Convolution2D, MaxPooling2D, UpSampling2D, Dropout\nfrom keras.optimizers import Adam\nfrom keras.callbacks import ModelCheckpoint, LearningRateScheduler\nfrom keras impor... | [
[
"numpy.load",
"numpy.ndarray",
"numpy.save",
"numpy.random.randint"
]
] |
dirangill/Hands-On-Data-Analysis-with-Pandas-2nd-edition | [
"580ee52cf37e5ddee54470aa0526da2a5ca9b310"
] | [
"book_env/Lib/site-packages/ipympl/backend_nbagg.py"
] | [
"\"\"\"Interactive figures in the Jupyter notebook\"\"\"\n\nfrom base64 import b64encode\nimport json\nimport io\n\nfrom IPython.display import display, HTML\n\nfrom ipywidgets import DOMWidget, widget_serialization\nfrom traitlets import (\n Unicode, Bool, CInt, Float, List, Instance, CaselessStrEnum, Enum,\n ... | [
[
"matplotlib.backends.backend_webagg_core.FigureCanvasWebAggCore.__init__",
"matplotlib.is_interactive",
"matplotlib.backends.backend_webagg_core.FigureManagerWebAgg.__init__",
"matplotlib._pylab_helpers.Gcf.get_all_fig_managers",
"matplotlib.backend_bases.FigureCanvasBase.start_event_loop_defa... |
foundations/py-futu-api | [
"b8f9fb1f26f35f99630ca47863f5595b6e635533"
] | [
"futu/trade/open_trade_context.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport pandas as pd\nfrom futu.common.open_context_base import OpenContextBase\nfrom futu.trade.trade_query import *\nfrom futu.common.err import *\nfrom futu.common.constant import *\n\nclass OpenTradeContextBase(OpenContextBase):\n \"\"\"Class for set context of HK stock trade\"\"\"... | [
[
"pandas.DataFrame"
]
] |
Chemformalixer/Machine-Learning-Multiple-Target-Vars | [
"eb42646e265aa594f7bdca1288764ef26a1096c1"
] | [
"CMTVEM_train_validate.py"
] | [
"#####################################################################################################################################################\n#####################################################################################################################################################\n### ... | [
[
"sklearn.neural_network.MLPClassifier",
"matplotlib.pyplot.legend",
"sklearn.metrics.matthews_corrcoef",
"sklearn.metrics.confusion_matrix",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"numpy.mean",
"sklearn.metrics.f1_score",
"sklearn.ensemble.RandomForestClassifier",
"s... |
MengLcool/Ac-OCR | [
"370152cc33995f41ee79374b3f5d62e94fea09d3"
] | [
"Recognition/transformer_xl/utils/log_uniform_sampler.py"
] | [
"import torch\r\nfrom torch import nn\r\nimport numpy as np\r\n\r\nclass LogUniformSampler(object):\r\n def __init__(self, range_max, n_sample):\r\n \"\"\"\r\n Reference : https://github.com/tensorflow/tensorflow/blob/r1.10/tensorflow/python/ops/candidate_sampling_ops.py\r\n `P(class) = ... | [
[
"torch.LongTensor",
"torch.Tensor",
"torch.zeros",
"torch.cat",
"torch.einsum",
"torch.nn.Embedding",
"torch.multinomial",
"torch.no_grad",
"torch.arange"
]
] |
VoidlessVoid7/eLibrary | [
"4158c1e720a15527ce4d337636d143f324806e9e"
] | [
"backend/model.py"
] | [
"import pandas as pd\nimport numpy as np\nimport pandas as pd\nimport numpy as np\nfrom flask import jsonify\nimport nltk\nnltk.download('stopwords')\nfrom nltk.corpus import stopwords\nfrom sklearn.metrics.pairwise import linear_kernel\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.feat... | [
[
"pandas.read_csv",
"sklearn.metrics.pairwise.cosine_similarity",
"pandas.Series",
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
luoshenseeker/AIJack | [
"4e871a5b3beb4b7c976d38060d6956efcebf880d"
] | [
"src/aijack/attack/inversion/gan_attack.py"
] | [
"import copy\n\nimport torch\n\nfrom ..base_attack import BaseAttacker\n\n\nclass GAN_Attack(BaseAttacker):\n \"\"\"GAN based model inversion attack (https://arxiv.org/abs/1702.07464)\n\n Attributes:\n model (torch.nn.Module):\n target_label(int): index of target class\n generator (torch.... | [
[
"torch.randn",
"torch.no_grad",
"torch.full"
]
] |
shivangdubey/sympy | [
"bd3ddd4c71d439c8b623f69a02274dd8a8a82198"
] | [
"sympy/physics/quantum/qubit.py"
] | [
"\"\"\"Qubits for quantum computing.\n\nTodo:\n* Finish implementing measurement logic. This should include POVM.\n* Update docstrings.\n* Update tests.\n\"\"\"\n\nfrom __future__ import print_function, division\n\nimport math\n\nfrom sympy import Integer, log, Mul, Add, Pow, conjugate\nfrom sympy.core.basic import... | [
[
"numpy.matrix",
"scipy.sparse.csr_matrix"
]
] |
kintatta/d3rl | [
"0674c4898927a53f36c5c875d8f217337f22d364"
] | [
"examples/data_augmentation/vector.py"
] | [
"from d3rlpy.datasets import get_pybullet\nfrom d3rlpy.algos import CQL\nfrom d3rlpy.metrics.scorer import evaluate_on_environment\nfrom d3rlpy.metrics.scorer import td_error_scorer\nfrom d3rlpy.metrics.scorer import discounted_sum_of_advantage_scorer\nfrom d3rlpy.metrics.scorer import average_value_estimation_scor... | [
[
"sklearn.model_selection.train_test_split"
]
] |
mrluin/ESFNet-Pytorch | [
"a2c166a91281e96f953398cf953f446ff6337a14"
] | [
"models/SegNet.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom collections import OrderedDict\r\n\r\nclass SegNet(nn.Module):\r\n # modified\r\n def __init__(self,config):\r\n super(SegNet, self).__init__()\r\n\r\n self.config = config\r\n self.name = 'SegNet'\r\n ... | [
[
"torch.load",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.nn.functional.max_pool2d",
"torch.nn.functional.max_unpool2d"
]
] |
jkkummerfeld/coref-ee | [
"594075470e9331ee1c40d611854b7546c735f668"
] | [
"ps.py"
] | [
"#!/usr/bin/env python\n\nimport os\n\nimport tensorflow as tf\nimport util\n\nif __name__ == \"__main__\":\n args = util.get_args()\n config = util.initialize_from_env(args.experiment, args.logdir)\n report_frequency = config[\"report_frequency\"]\n cluster_config = util.get_cluster_config()\n util.set_gpus()... | [
[
"tensorflow.train.Server",
"tensorflow.train.ClusterSpec"
]
] |
Usama0121/PronouncUR | [
"3583a8498ae9a9f87bcdbf2b2ce45b2ad61e6c8b"
] | [
"g2p.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport math\nimport os\nimport time\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.core.protobuf import saver_pb2\n\nimport data_utils\nimport seq2seq_model\n\nfrom six.moves import xr... | [
[
"tensorflow.Graph",
"tensorflow.global_variables",
"numpy.random.random_sample",
"tensorflow.global_variables_initializer",
"numpy.argmax",
"tensorflow.Session"
]
] |
eanemo/MedicalZooPytorch | [
"4996894818fad230532d42dfd590e914c36a0c53"
] | [
"lib/visual3D_temp/BaseWriter.py"
] | [
"import os\nimport numpy as np\nfrom torch.utils.tensorboard import SummaryWriter\n\nimport lib.utils as utils\n\ndict_class_names = {\"iseg2017\": [\"Air\", \"CSF\", \"GM\", \"WM\"],\n \"iseg2019\": [\"Air\", \"CSF\", \"GM\", \"WM\"],\n \"mrbrains4\": [\"Air\", \"CSF\", \"GM\"... | [
[
"numpy.mean",
"torch.utils.tensorboard.SummaryWriter"
]
] |
patrickywu/PartisanAssociations | [
"f28f3afefb75e87b6dd2909def5031a40f03b40b"
] | [
"partisanassociations/utils.py"
] | [
"import pandas as pd\nimport string\nimport gensim\nfrom gensim.parsing.preprocessing import preprocess_string\nfrom gensim.models.doc2vec import TaggedDocument\n\ndef data_reader(data, id_var, description_var, drop_missing=True):\n id = data[id_var].values\n descriptions = data[description_var].values\n d... | [
[
"pandas.DataFrame"
]
] |
MariosKef/RULe | [
"4cf4563d1abcf350de9958a0de26d2d0126c819d"
] | [
"mipego_multi/mipego.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Mar 6 15:05:01 2017\n\n@author: wangronin\n@email: wangronin@gmail.com\n\n\"\"\"\nfrom __future__ import division\nfrom __future__ import print_function\n\n# import pdb\nimport dill, functools, itertools, copyreg, logging\nimport numpy as np\n\nimport GPUtil as gp\n\... | [
[
"numpy.log",
"sklearn.metrics.r2_score",
"numpy.isinf",
"numpy.random.seed",
"numpy.nonzero",
"numpy.asarray",
"scipy.optimize.fmin_l_bfgs_b",
"numpy.asscalar",
"numpy.random.choice",
"numpy.min",
"numpy.all",
"numpy.max",
"numpy.argsort",
"numpy.array",
... |
sebastianffx/stainlib | [
"6d79f165fc69e7599d14310c6f4d26e3d0d01543"
] | [
"utils/stain_utils.py"
] | [
"import numpy as np\nimport cv2 as cv\nimport spams\nimport copy\nfrom stainlib.utils.excepts import TissueMaskException\nfrom abc import ABC, abstractmethod\n\nclass ABCStainExtractor(ABC):\n\n @staticmethod\n @abstractmethod\n def get_stain_matrix(I):\n \"\"\"\n Estimate the stain matrix gi... | [
[
"numpy.log",
"numpy.maximum",
"numpy.clip",
"numpy.linalg.norm",
"numpy.percentile",
"numpy.exp"
]
] |
rotmanmi/hp-vae-gan | [
"70c67c8ad9ff1f8c48a2bf7f883cd1f2cfd0c043"
] | [
"utils/images.py"
] | [
"import torch\nimport torch.nn.functional as F\nimport math\n\n__all__ = ['interpolate', 'interpolate_3D', 'adjust_scales2image', 'generate_noise', 'get_scales_by_index',\n 'get_fps_td_by_index', 'get_fps_by_index', 'upscale', 'upscale_2d']\n\n\ndef interpolate(input, size=None, scale_factor=None, interpo... | [
[
"torch.zeros_like",
"torch.randint",
"torch.nn.functional.interpolate",
"torch.zeros"
]
] |
balabalabalalaba/testb | [
"fd2a8262bba94c561be49d69120401f0d7259fdf"
] | [
"bicks/bicsearch.py"
] | [
"from bicks.eigenkpar import find_eigen_kpar_in_an_area, find_eigen_kpar\nfrom bicks.photoniccrystalbandprojection import find_band_projection\nfrom bicks.photoniccrystalbandprojection import mini_frequncy\nfrom bicks.field import FieldsWithCTIRInArea, FieldsWithCTIRMix\nimport matplotlib.pyplot as plt\nimport matp... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.tight_layout",
"numpy.sqrt",
"numpy.linspace",
"numpy.min",
"numpy.arange",
"numpy.real",
"numpy.exp",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
talperetz/pyds | [
"1a46d83c1ee71056484ab9e78bc19da6c2163583",
"1a46d83c1ee71056484ab9e78bc19da6c2163583"
] | [
"tests/resources/datasets/save_datasets.py",
"pyds/features_engineering.py"
] | [
"\"\"\" \n:author: Tal Peretz\n:date: 11/11/2016\n:TL;DR: this module purpose is generating datasets for pyds tests\n\"\"\"\n\nimport os\n\nimport pandas as pd\nimport sklearn.datasets\n\nsave_attribute_to_file_extension = {'to_excel': 'xls', 'to_html': 'html', 'to_json': 'json', 'to_pickle': 'pickle',\n ... | [
[
"pandas.Series",
"pandas.DataFrame"
],
[
"sklearn.linear_model.RandomizedLasso",
"pandas.concat",
"numpy.abs",
"sklearn.preprocessing.FunctionTransformer",
"sklearn.linear_model.RandomizedLogisticRegression",
"numpy.array",
"sklearn.preprocessing.MinMaxScaler"
]
] |
4pisky/radio-optical-transients-plot | [
"2ecc3bba79f6c87b84635a32596fa3c6e9ccf65d"
] | [
"radio_optical_transients_plot/ro_main.py"
] | [
"\"\"\"Radio Optical plot main classes.\n\nThis script contains the main plotting classes for the radio optical plots.\n\nThis file can be imported as a module and contains the following\nclasses:\n\n * RadioOpticalData: Object handling the data of the plot.\n * RadioOpticalPlot: Plotting non-track plots and ... | [
[
"matplotlib.patches.Ellipse",
"pandas.read_csv",
"matplotlib.patches.Arc",
"matplotlib.patches.Polygon",
"numpy.sqrt",
"numpy.logspace",
"numpy.arange",
"numpy.median",
"matplotlib.lines.Line2D",
"matplotlib.font_manager.FontProperties",
"numpy.std",
"numpy.any",
... |
chart21/BARFED | [
"803baafc9a0379cdd94f337be8fe39c890098624"
] | [
"MNIST/mnist_byz_attack.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.utils.data import TensorDataset\nfrom torch.utils.data import DataLoader\nimport numpy as np\nfrom fl_utils import distribute_data as dd\nfrom fl_utils import train_nodes as tn\nfrom fl_utils import construct_models as cm\n\ndevice = torch.device(\"cuda:0\" if torch.c... | [
[
"torch.nn.CrossEntropyLoss",
"numpy.sqrt",
"numpy.random.seed",
"numpy.random.choice",
"torch.utils.data.TensorDataset",
"torch.utils.data.DataLoader",
"numpy.append",
"torch.cuda.is_available",
"numpy.array"
]
] |
mohi7solanki/pywonderland | [
"2b9d61a8414d4cfa92d34325e5e2b9b5d501abca"
] | [
"src/polytopes/models.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nClasses for building models of 3D/4D polytopes\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSee the doc: \"https://neozhaoliang.github.io/polytopes/\"\n\n\"\"\"\nfrom itertools import combinations\nimport numpy as np\nimport hel... | [
[
"numpy.dot"
]
] |
d-murashkin/sentinel1_routines | [
"bf521dc96193420d88be0c1510ca03481018f3e2"
] | [
"download.py"
] | [
"\"\"\"\nScript for searching and downloading data from sentinel satellites.\ndhusget.sh script from the Copernicus web-page is used.\nSingle scenes can be downloaded from https://datapool.asf.alaska.edu\n\"\"\"\n\n__author__ = 'Dmitrii Murashkin'\n__email__ = 'murashkin@uni-bremen.de'\n\nimport os\nimport subproce... | [
[
"pandas.concat",
"pandas.read_csv"
]
] |
CLAW-Lab/ToM | [
"70770554602e0ef53f3c269e13d9c1b1043b06ae"
] | [
"ibr_game/few_shot_learning_system.py"
] | [
"import os\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom fastcore.utils import mapped\n\nfrom inner_loop_optimizers import LSLRGradientDescentLearningRule\n\n\ndef set_torch_seed(seed):\n \"\"\"\n Sets the pytorch seeds for cur... | [
[
"numpy.minimum",
"torch.max",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.load",
"numpy.mean",
"torch.cuda.is_available",
"torch.save",
"torch.softmax",
"torch.cuda.current_device",
"torch.stack",
"torch.cuda.device_count",
"numpy.random.RandomState",
"... |
H4ndsomeJohn/CSNet | [
"10838a30be7cad6068a632fc32309ac13f22d339"
] | [
"graph_representation/methods/mesh.py"
] | [
"# import meshio\nimport numpy as np\nimport scipy.spatial\nimport torch\nfrom graph_representation.methods.edge import add_to_edges, sort_Edges\nfrom graph_representation.MRIData import MRIData\n\n\ndef makeMesh(data: MRIData):\n edges_Ek = [[], []]\n edges_Et = [[], []]\n edges_Eb = [[], []]\n\n # for... | [
[
"numpy.argmin",
"numpy.nonzero",
"torch.cat"
]
] |
singularitatem/singularity | [
"3b7992244a4c152be42c207b15c2023e0da305a5"
] | [
"huggingface/nlp/demo.py"
] | [
"#!/usr/bin/env python3\n\nfrom absl import app, flags, logging\n\nimport torch as th\nimport pytorch_lightning as pl\n\nimport nlp\nimport transformers\n\nflags.DEFINE_boolean('debug', False, '')\nflags.DEFINE_integer('epochs', 10, '')\nflags.DEFINE_float('lr', 1e-2, '')\nflags.DEFINE_float('momentum', .9, '')\nfl... | [
[
"torch.nn.CrossEntropyLoss",
"torch.utils.data.DataLoader",
"torch.cuda.is_available",
"torch.cat"
]
] |
VU-IVM/Toponym-based-Algorithm-for-Grouped-Geoparsing-of-Social-media | [
"563cab3208c1b86837c45ba6ce33d740113c44af"
] | [
"methods/shapefiles.py"
] | [
"#!/usr/bin/python3\nfrom osgeo import ogr\nimport os\nimport numpy as np\nimport matplotlib.path as mpath\nfrom collections import defaultdict as dd\nimport shapefile as pyshp\nimport matplotlib.path\nimport matplotlib.patches as mpatches\n\nfrom methods import function\n\n\ndef open_shape(shapefile):\n return ... | [
[
"matplotlib.patches.PathPatch",
"numpy.column_stack"
]
] |
szk9876/rlkit | [
"9d8213884b8bc6722041e23ae4f717c6bc17596c",
"9d8213884b8bc6722041e23ae4f717c6bc17596c"
] | [
"rlkit/torch/sac/sac.py",
"rlkit/torch/sac/twin_sac.py"
] | [
"from collections import OrderedDict\n\nimport numpy as np\nimport torch.optim as optim\nfrom torch import nn as nn\n\nimport rlkit.torch.pytorch_util as ptu\nfrom rlkit.core.eval_util import create_stats_ordered_dict\nfrom rlkit.torch.torch_rl_algorithm import TorchRLAlgorithm\nfrom rlkit.torch.sac.policies import... | [
[
"torch.nn.MSELoss",
"numpy.prod"
],
[
"torch.nn.MSELoss",
"numpy.prod"
]
] |
epapoutsellis/CCPi-Dynamic | [
"d108cd7e9652992001a116347941eda7e75b3301"
] | [
"Wrappers/Python/test/test_DataProcessor.py"
] | [
"import sys\r\nimport unittest\r\nimport numpy\r\nfrom ccpi.framework import DataProcessor\r\nfrom ccpi.framework import DataContainer\r\nfrom ccpi.framework import ImageData\r\nfrom ccpi.framework import AcquisitionData\r\nfrom ccpi.framework import ImageGeometry\r\nfrom ccpi.framework import AcquisitionGeometry\r... | [
[
"numpy.reshape"
]
] |
ebaals/Thesis | [
"988bba5626b01599b6414a6a196ba22371a4fb89"
] | [
"sharppy/sharptab/watch_type.py"
] | [
"from sharppy.sharptab import thermo, utils, interp, params, constants\nimport numpy as np\n\n## Routines implemented in Python by Greg Blumberg - CIMMS and Kelton Halbert (OU SoM)\n## wblumberg@ou.edu, greg.blumberg@noaa.gov, kelton.halbert@noaa.gov, keltonhalbert@ou.edu\n\ndef wind_chill(prof):\n '''\n ... | [
[
"numpy.asarray",
"numpy.arange",
"numpy.ma.where",
"numpy.ma.max",
"numpy.where"
]
] |
tmct/statsmodels | [
"305258f5245e76409f6deab24d217ffbbc352ba0"
] | [
"statsmodels/stats/dist_dependence_measures.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\" Distance dependence measure and the dCov test.\n\nImplementation of Székely et al. (2007) calculation of distance\ndependence statistics, including the Distance covariance (dCov) test\nfor independence of random vectors of arbitrary length.\n\nAuthor: Ron Itzikovitch\n\nReferences\n... | [
[
"numpy.sqrt",
"scipy.stats.norm.cdf",
"numpy.multiply",
"numpy.random.shuffle",
"numpy.asanyarray",
"scipy.spatial.distance.pdist",
"numpy.floor",
"numpy.zeros"
]
] |
hsilva664/nstep_airl | [
"c08650d8fddf6a27081d2b63cb8f9eb23d746b6c"
] | [
"airl_state_scripts/no_transfer_scripts/pendulum_irl_state_action.py"
] | [
"import tensorflow as tf\n\nfrom sandbox.rocky.tf.policies.gaussian_mlp_policy import GaussianMLPPolicy\nfrom sandbox.rocky.tf.envs.base import TfEnv\nfrom rllab.baselines.linear_feature_baseline import LinearFeatureBaseline\nfrom rllab.envs.gym_env import GymEnv\n\n\nfrom inverse_rl.algos.irl_trpo import IRLTRPO\n... | [
[
"tensorflow.ConfigProto",
"tensorflow.GPUOptions",
"tensorflow.Session"
]
] |
kkkris7/License-Plate-Detection---Deep-Learning | [
"31812cb21fc6fb4e8df8ed4427440d4628704e92"
] | [
"detect.py"
] | [
"import argparse\nimport shutil\nimport time\nfrom pathlib import Path\nfrom sys import platform\nimport moviepy.editor as mpe\nimport numpy as np\nimport os\n\nfrom models import *\nfrom utils.datasets import *\nfrom utils.utils import *\nimport logging\n\n\ndef detect(\n cfg,\n weights,\n ima... | [
[
"numpy.arange"
]
] |
rexarski/ANLY580-final-project | [
"093eeaab7ab9fb382ad695335243e6ded893fb27"
] | [
"model_deploy/prepare/generate_wiki_index.py"
] | [
"import pickle\nfrom time import time\n\nimport datasets\nimport numpy as np\nimport faiss\n\nif __name__ == '__main__':\n st_time = time()\n wiki40b_snippets = datasets.load_dataset('wiki_snippets', name='wiki40b_en_100_0')['train']\n wiki40b_file_name = 'wiki40b.dat'\n wiki40b_passage_reps = np.memmap... | [
[
"numpy.memmap"
]
] |
vishwanath1306/katana | [
"81a4bbe798d9bee887cadd22c7a349bdab292feb"
] | [
"metagraph-plugin/tests/test_algorithms.py"
] | [
"import metagraph as mg\nimport numpy as np\nimport pytest\n\n\n# directed graph\n@pytest.fixture(autouse=True)\ndef kg_from_nx_di_8_12(networkx_weighted_directed_8_12):\n pg_test_case = mg.translate(networkx_weighted_directed_8_12, mg.wrappers.Graph.KatanaGraph)\n return pg_test_case\n\n\n# undirected graph\... | [
[
"numpy.isnan"
]
] |
n1labs/IDentif.AI | [
"dd69e2913c3a8e58e1c09fc0abd9e5c7cac5340a"
] | [
"monotherapy/monotherapy.py"
] | [
"import pandas as pd\r\nfrom openpyxl import load_workbook\r\nimport numpy as np\r\nimport logging\r\n\r\ndef get_raw_data(file_name, sheet_name):\r\n df = pd.read_excel(file_name, sheet_name=sheet_name).astype(float)\r\n\r\n return df\r\n\r\n\r\ndef get_control(df, dmso, extra_str):\r\n if dmso:\r\n ... | [
[
"pandas.concat",
"pandas.read_excel",
"numpy.abs",
"numpy.sqrt",
"pandas.ExcelWriter"
]
] |
irinaespejo/excursion | [
"c5a5c6d882b8dd1008fbabf1a3b81eaba382bef6"
] | [
"excursion/utils.py"
] | [
"from scipy.stats import norm\nimport numpy as np\nimport torch\nimport importlib\nimport sys\n\ndef cdf(value):\n return 0.5 * (\n 1 + torch.erf((value - self.loc) * self.scale.reciprocal() / math.sqrt(2))\n )\n\n\ndef load_example(example):\n testcase = None\n if example == \"1Dtoyanalysis\":\n... | [
[
"numpy.log",
"numpy.product",
"numpy.stack",
"numpy.concatenate",
"torch.exp",
"torch.isfinite",
"scipy.stats.norm",
"torch.log",
"numpy.any",
"torch.cuda.is_available",
"torch.distributions.Normal",
"numpy.array",
"numpy.moveaxis"
]
] |
gnniaaa/2048-api | [
"f8383d5173a40532965636fa1fc7026fdae194f0"
] | [
"game2048/zaixian2048.py"
] | [
"import os\nfrom torch.autograd import Variable\nfrom RNN import RNN1\nimport torch\nimport torch.nn as nn\nbatch_size = 128\nNUM_CLASSES = 4 # 分类数目\nNUM_EPOCHS = 20 # 训练的迭代次数\nimport pandas as pd\nfrom game import Game\nfrom displays import Display\nfrom agents import ExpectiMaxAgent, MyAgent1\nimport numpy as n... | [
[
"torch.LongTensor",
"pandas.read_csv",
"torch.nn.CrossEntropyLoss",
"numpy.amax",
"numpy.log2",
"numpy.reshape",
"torch.utils.data.TensorDataset",
"torch.utils.data.DataLoader",
"sklearn.model_selection.train_test_split",
"torch.FloatTensor",
"numpy.array",
"torch.a... |
zigaLuksic/glitch-doctor | [
"85ae7bfec15e0a0c564f31669c3d9f04a76aa159"
] | [
"tester.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport time\nfrom scipy.optimize import rosen, differential_evolution\nfrom metamodel import Metamodel\nfrom sklearn import ensemble, tree\nfrom test_models.repressilator import repressilator, repressilator_bounds\n\n# -------------------------------------------... | [
[
"sklearn.ensemble.RandomForestRegressor",
"matplotlib.pyplot.legend",
"numpy.log",
"scipy.optimize.differential_evolution",
"numpy.random.seed",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
matheushent/clfs-models | [
"e2f95064cc036289c203080e75718964873a5d8a"
] | [
"utils/stacking.py"
] | [
"\"\"\"Core module for stacking related operations\"\"\"\nfrom sklearn.base import BaseEstimator, TransformerMixin, RegressorMixin, clone\nfrom sklearn.model_selection import KFold\n\nimport numpy as np\n\nimport pickle\nimport os\n\nclass StackingAveragedModels(BaseEstimator, RegressorMixin, TransformerMixin):\n ... | [
[
"sklearn.base.clone",
"sklearn.model_selection.KFold"
]
] |
AutoDiff-Dream-Team/cs107-FinalProject | [
"4c3b0f6945acfe6fd3fe2757858538ec3cceb819"
] | [
"Auto_diff/tests/test_jacobian.py"
] | [
"import numpy as np\nfrom Auto_diff import FD, Jacobian\n\ndef test_function_jacobian():\n x = Jacobian([1, 3, 4])\n fun = np.sin(3*x[0] + 2*x[1] - x[2])\n assert isinstance(fun[0], FD), AssertionError('Not an instance of AD.')\n assert isinstance(fun[0].val, int) or isinstance(fun[0].val, float), Asser... | [
[
"numpy.sin"
]
] |
chilleo/ALPHA | [
"61ac17a08eb4eb778cec9236f4792c97969311a2"
] | [
"raxmlOutputWindows/matplotlibCustomBackend/customFormlayout.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nformlayout\n==========\n\nModule creating Qt form dialogs/layouts to edit various type of parameters\n\n\nformlayout License Agreement (MIT License)\n------------------------------------------\n\nCopyright (c) 2009 Pierre Raybaut\n\nPermission is hereby granted, free of charge, to ... | [
[
"matplotlib.backends.qt_compat.QtCore.Property",
"matplotlib.backends.qt_compat.QtWidgets.QApplication",
"matplotlib.backends.qt_compat.QtGui.QIcon",
"matplotlib.colors.to_rgba",
"matplotlib.backends.qt_compat.QtWidgets.QStackedWidget",
"matplotlib.backends.qt_compat.QtWidgets.QApplication... |
sflinter/hypergraph | [
"c3108ee51361d2e4b8ddc7eced1953f1548ce8d8"
] | [
"hypergraph/bandits.py"
] | [
"# Multi-armed bandit-based algorithms\n\nimport numpy as np\nfrom .genetic import GeneticOperators\n\n\nclass HyperBand:\n def __init__(self, config_ranges, loss, max_resources_per_conf, eta=3):\n \"\"\"\n Init the hyper band algorithm\n :param config_ranges: Config ranges eg taken from gra... | [
[
"numpy.argsort",
"numpy.log",
"numpy.floor",
"numpy.power"
]
] |
d4l-data4life/BBNOrchestra-for-VQAmed2021 | [
"b083c0c9c2be73419ca43536bf185fff379cf98c"
] | [
"lib/core/combiner.py"
] | [
"import numpy as np\nimport torch, math\nfrom core.evaluate import accuracy\n\nclass Combiner:\n def __init__(self, cfg, device):\n self.cfg = cfg\n self.type = cfg.TRAIN.COMBINER.TYPE\n self.device = device\n self.epoch_number = cfg.TRAIN.MAX_EPOCH\n self.func = torch.nn.Softm... | [
[
"torch.nn.Softmax",
"torch.cat"
]
] |
hliang2/ContrlledAE | [
"c2af71d99b0f79d76c6348c08eca9b11d9e3016e"
] | [
"code/gan_train.py"
] | [
"import os\nimport time\nimport torch\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nfrom torch.utils.data import DataLoader\nfrom config import DATASET_PARAMETERS, NETWORKS_PARAMETERS\nfrom parse_dataset import get_dataset\nfrom network import get_network\nfrom utils import Meter, cycle, ... | [
[
"torch.nn.functional.normalize",
"torch.sigmoid",
"torch.load",
"torch.utils.data.DataLoader",
"torch.optim.lr_scheduler.StepLR"
]
] |
zh123-art/SpatialSense | [
"477fd6e458377185cd50e05af26825bd14834ffd"
] | [
"baselines/models/recurrent_phrase_encoder.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass RecurrentPhraseEncoder(nn.Module):\n def __init__(self, word_embedding_dim, feature_dim):\n super().__init__()\n self.feature_dim = feature_dim\n self.gru = nn.GRU(\n input_size=word_embedding_dim,\n hidden_size=feature_di... | [
[
"torch.nn.GRU",
"torch.cuda.is_available",
"torch.zeros"
]
] |
ghPRao/pneumonia_detectiion_from_chest_xray | [
"645fa5ac94729ba4d073630688fa340275fd3b8c"
] | [
"src/model_utils.py"
] | [
"import tensorflow\nfrom tensorflow import keras\n\n# Keras\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Conv2D , MaxPool2D , Flatten , Dropout , BatchNormalization\nfrom keras.callbacks import ReduceLROnPlateau\nfrom keras.preprocessing.image import ImageDataGenerator\n\n#tqdm\nimport sys\... | [
[
"matplotlib.pyplot.imshow",
"numpy.nonzero",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"matplotlib.pyplot.show",
"sklearn.metrics.classification_report",
"matplotlib.pyplot.figure"
]
] |
dwhalen/holophrasm | [
"0d971428f9879ad3d6c0a781f1a021cff73fb1ce"
] | [
"multitrainer.py"
] | [
"import learning_history\nimport data_utils5 as data_utils\n\nimport random\nimport numpy as np\nimport time\n\nimport os\nimport sys\n\nimport pickle as pickle\nimport matplotlib.pyplot as plt\n\n#from pathos.multiprocessing import ProcessingPool as Pool\nfrom multiprocessing import Pool\nfrom multiprocessing impo... | [
[
"numpy.array"
]
] |
hysts/pl_gaze_estimation | [
"1123053a57115da5bb8ea9675911e7d9230f3ec9"
] | [
"pl_gaze_estimation/models/utils/utils.py"
] | [
"import torch\nfrom omegaconf import DictConfig\n\nfrom .initializer import create_initializer\n\n\ndef initialize_weight(init_config: DictConfig, model: torch.nn.Module) -> None:\n initializer = create_initializer(init_config)\n model.apply(initializer)\n\n\ndef load_weight(model_config: DictConfig, model: t... | [
[
"torch.load"
]
] |
aps-7bm/tomopy | [
"ccf2cfa2df1aba8987e7a8827ac360d0b5534c55"
] | [
"test/test_tomopy/test_recon/test_algorithm.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# #########################################################################\n# Copyright (c) 2015-2019, UChicago Argonne, LLC. All rights reserved. #\n# #\n# Copyright 2015-2019. UChicago Ar... | [
[
"numpy.ones"
]
] |
craffel/t-zero | [
"11f42bf6880a85ee72d4415e53b5054d42f4aa0b"
] | [
"inference/model_offload.py"
] | [
"# coding=utf-8\n\n\"\"\"\nScript showcasing how to run inference of T0++ on a single GPU using offloading.\nIt relies on Deepspeed (https://github.com/microsoft/DeepSpeed) and the ZeRO-3 offloading implementation.\n\nThe script is adapted from https://huggingface.co/transformers/main_classes/deepspeed.html#non-tra... | [
[
"torch.no_grad"
]
] |
suyash/tensorflow | [
"968d511ebf5fe5651752580a13e457498ebab50d"
] | [
"tensorflow/python/compat/compat.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.util.tf_export.tf_export"
]
] |
FullMetalNicky/PULP-Streamer | [
"d26269aaeff28cf9adae7fb49dff9aa2bdebd40d"
] | [
"script/himax_driver.py"
] | [
"#!/usr/bin/env python\n\nimport fcntl\nimport os\n\nimport numpy as np\n\nimport rospy\nfrom cv_bridge import CvBridge\nfrom sensor_msgs.msg import Image\n# import cv2\n\npage_size = 655536 # 4092 # 8192 # 1024 # 4096\nF_GETPIPE_SZ = 1032 # Linux 2.6.35+\nF_SETPIPE_SZ = 1031 # Linux 2.6.35+\n\n\ndef read_from... | [
[
"numpy.reshape",
"numpy.frombuffer"
]
] |
tanglef/geomloss | [
"4e09e3bfd376d92f2bb7efdf0854a5b7c756eb0d"
] | [
"geomloss/examples/optimal_transport/plot_interpolation_3D.py"
] | [
"\"\"\"Creating a fancy interpolation video between 3D meshes.\n==============================================================\n\nN.B.: I am currently very busy writing my PhD thesis. Comments will come soon!\n\"\"\"\n\n\n################################################################################\n# Setup\n# -... | [
[
"torch.cuda.synchronize",
"matplotlib.pyplot.tight_layout",
"numpy.linspace",
"torch.randperm",
"numpy.arange",
"numpy.arccos",
"numpy.cos",
"matplotlib.pyplot.set_cmap",
"numpy.ones",
"numpy.sin",
"torch.cuda.is_available",
"numpy.cross",
"matplotlib.pyplot.sho... |
RafalSkolasinski/simulation-codes-arxiv-1806.01815 | [
"fc5c27c6c625cc7f45cf5d7627eaafa3d3df4b9e"
] | [
"codes/shapes.py"
] | [
"# Collection of shape functions used in this projects\n\n\nimport numpy as np\nfrom functools import lru_cache\n\n\n@lru_cache()\ndef define_shape(name, R):\n \"\"\"Define shape of a given type and specified radius.\n\n Parameters\n ----------\n shape : string\n Name of the chosen shape. Options... | [
[
"numpy.array",
"numpy.abs",
"numpy.sin"
]
] |
RunzheYang/lingvo | [
"1291e29812f9ee9836f9cacbb05db9ec6b095234"
] | [
"lingvo/core/attention_test.py"
] | [
"# Lint as: python3\n# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2... | [
[
"numpy.dot",
"numpy.expand_dims",
"numpy.abs",
"numpy.random.seed",
"numpy.isfinite",
"numpy.asarray",
"numpy.array_repr",
"numpy.tile",
"numpy.logical_or",
"numpy.argmax",
"numpy.mean",
"numpy.random.rand",
"numpy.random.randn",
"numpy.transpose",
"nump... |
AKA-ZSZ/AI_Artistry | [
"64384c8c7fd6f8db89d0fe918bf94bec81f18a7a"
] | [
"histogram_matching.py"
] | [
"#!/usr/bin/env python\n \n'''\nWelcome to the Histogram Matching Program!\n \nGiven a source image and a reference image, this program\nreturns a modified version of the source image that matches\nthe histogram of the reference image.\n \nImage Requirements:\n - Source image must be color.\n - Reference image mu... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlim",
"numpy.savetxt",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.ylabel"
]
] |
mesjou/human-frictions | [
"2a5c919039bb29643a3e8dd36c0fa13ce7d93e0e"
] | [
"human_friction/utils/metric_generator.py"
] | [
"import collections\nfrom abc import ABC\n\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom human_friction.rllib.rllib_env import RllibDiscrete\n\n\nclass MetricGenerator(ABC):\n def __init__(self, env: RllibDiscrete):\n agent_metrics = [\"wage\", \"budget\", \"consumption\", \"labor\", \"rewar... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.title",
"pandas.DataFrame.from_dict"
]
] |
MichelKhalaf/traffic | [
"84e315d84a4ab9d8711414e7c275733e27a089ed"
] | [
"traffic/data/basic/airways.py"
] | [
"from __future__ import annotations\n\nimport logging\nfrom io import BytesIO\nfrom pathlib import Path\nfrom typing import Tuple, Union\n\nimport pandas as pd\nfrom shapely.geometry.base import BaseGeometry\n\nfrom ...core.mixins import GeoDBMixin\nfrom ...core.structure import Navaid, Route\n\n__github_url = \"ht... | [
[
"pandas.read_csv",
"pandas.read_pickle"
]
] |
KraProgrammer/AdventOfCode2020 | [
"937e743bfab228449e6bad2d06267c9c999afd1d"
] | [
"src/day5.py"
] | [
"from math import ceil, floor\n\nimport numpy as np\nfrom aocd.models import Puzzle\n\n\ndef solve_puzzle_one(input_array):\n ids = map(lambda bp: calc_id(bp, 7), input_array)\n print(max(ids))\n\n\ndef calc_id(bp, length_first=7):\n first = bp[0:length_first]\n sec = bp[length_first:]\n first_upper ... | [
[
"numpy.diff",
"numpy.argwhere"
]
] |
gpdsec/HSD | [
"42c8d1c338b09cb7b4f7bb2275253cb207fbce97"
] | [
"data/coco.py"
] | [
"\"\"\"VOC Dataset Classes\n\nOriginal author: Francisco Massa\nhttps://github.com/fmassa/vision/blob/voc_dataset/torchvision/datasets/voc.py\n\nUpdated by: Ellis Brown, Max deGroot\n\"\"\"\n\nimport os\nimport pickle\nimport os.path\nimport sys\nimport torch\nimport torch.utils.data as data\nimport torchvision.tra... | [
[
"numpy.minimum",
"numpy.max",
"numpy.mean",
"numpy.zeros",
"numpy.where",
"numpy.isclose"
]
] |
SamuelMarks/recommenders | [
"17d2c6dc9e20a3bcbabff3d4edf0e054128a4a3e"
] | [
"tensorflow_recommenders/models/base.py"
] | [
"# Copyright 2020 The TensorFlow Recommenders 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 ... | [
[
"tensorflow.GradientTape"
]
] |
SelmansThesis/stable-baselines3 | [
"0146c1d96237b84ce7e5d39022f40e583d7e262b"
] | [
"tests/test_cnn.py"
] | [
"import os\nfrom copy import deepcopy\n\nimport numpy as np\nimport pytest\nimport torch as th\n\nfrom stable_baselines3 import A2C, DQN, PPO, SAC, TD3\nfrom stable_baselines3.common.identity_env import FakeImageEnv\nfrom stable_baselines3.common.utils import zip_strict\n\n\n@pytest.mark.parametrize(\"model_class\"... | [
[
"torch.allclose"
]
] |
commonsense-exception/commonsense-exception | [
"ab83323a2d566f49b6de7b4b06c3c338ceec895f"
] | [
"analysis/jaccard/kbias_analysis.py"
] | [
"import pandas as pd\nimport argparse\nfrom tqdm import tqdm\n\n\"\"\"\nThe goal of this file is to produce jaccard analysis to analyze to what extent the\nk-associative bias of one model coincides with that of another - across the different\nmodel pairs and different Ks\n\"\"\"\n\ndef parse_args():\n parser = a... | [
[
"pandas.read_csv",
"pandas.isnull",
"pandas.DataFrame"
]
] |
bhky/targetran | [
"ae836949448c383d58bb5b5ce70b3a4547f32102"
] | [
"targetran/np/_np.py"
] | [
"\"\"\"\nAPI for NumPy usage.\n\"\"\"\n\nimport functools\nfrom typing import Any, Callable, List, Optional, Sequence, Tuple\n\nimport numpy as np\n\nfrom targetran._check import (\n _check_shear_input,\n _check_translate_input,\n _check_crop_input,\n _check_input_range,\n)\nfrom targetran._np_functiona... | [
[
"numpy.take",
"numpy.shape",
"numpy.array",
"numpy.where",
"numpy.random.default_rng"
]
] |
xaviermouy/ecosound | [
"25d333807e090e737b3ac910c2dcf8e5850b91b4"
] | [
"ecosound/core/metadata.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed May 6 10:56:38 2020\n\n@author: xavier.mouy\n\"\"\"\n\nimport pandas as pd\nimport os\n\nclass DeploymentInfo():\n \"\"\"\n A class to handle acoustic deployment metadadata .\n\n Object carrying deployment metadata that can be used for example to populate\n... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.