repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
aliabd/cos-cvae | [
"d6f94dd0f1de6727e43da55d36a6433fbfd0c44b"
] | [
"GoogleConceptualCaptioning/eval_ensemble.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport json\nimport numpy as np\n\nimport time\nimport os\nfrom six.moves import cPickle\n\nimport opts\nimport models\nfrom dataloader import *\nfrom dataloaderraw import *\nimport eval_utils\nimport ... | [
[
"torch.load"
]
] |
raghu1121/SLM-Lab | [
"58e98b6521f581515d04ebacff5226105237ed9b"
] | [
"slm_lab/env/openai.py"
] | [
"from slm_lab.env.base import BaseEnv, ENV_DATA_NAMES\nfrom slm_lab.env.wrapper import wrap_atari, wrap_deepmind\nfrom slm_lab.env.registration import register_env\nfrom slm_lab.lib import logger, util\nfrom slm_lab.lib.decorator import lab_api\nimport gym\nimport numpy as np\nimport pydash as ps\n\nlogger = logger... | [
[
"numpy.array",
"numpy.isscalar"
]
] |
ErhanYILMAZ/DESC_Model | [
"4735c312b14d470918336519ea23c2214be90a2a"
] | [
"DESC_Simulation.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\nCopyright (c) 2021 by Erhan YILMAZ (https://orcid.org/0000-0003-4788-9022)\nThis file is licensed under CC BY-SA (Attribution-ShareAlike)\nIt is provided \"as is\", without express or implied warranty, for educational and informational purposes only.\n\nPy... | [
[
"matplotlib.pyplot.legend",
"pandas.read_csv",
"numpy.abs",
"matplotlib.pyplot.title",
"numpy.asarray",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
... |
jsw7460/mylinear | [
"c1bd90467837ec53a1010e1607d251aa3d2b9766"
] | [
"modules.py"
] | [
"from math import sqrt\n\nimport torch\nimport torch.nn as nn\n\n\n# Linear Embedding\nclass GraphEmbedding(nn.Module):\n def __init__(self, input_size, embedding_size):\n super(GraphEmbedding, self).__init__()\n self.embedding_size = embedding_size\n self.embedding = nn.Linear(input_size, e... | [
[
"torch.tanh",
"torch.nn.Linear",
"torch.softmax",
"torch.einsum"
]
] |
jimorsm/vue-element-admin-fastapi | [
"3ffc7dc3d2be988e544f339af466538cb0708d25"
] | [
"backend/app/app/db/init_db.py"
] | [
"import os, logging\nimport pandas as pd\nimport numpy as np\nfrom app.db.session import engine\n\nlogger = logging.getLogger(__name__)\n\ndef init_db() -> None:\n # Tables should be created with Alembic migrations\n init_data_path = os.path.join(os.path.dirname(__file__), \"init_data\")\n files = ['depart... | [
[
"numpy.isnan",
"pandas.read_csv"
]
] |
OpenSourceBrain/SadehEtAl2017-InhibitionStabilizedNetworks | [
"9d3ec01d545cc0a13b8e8057e83df8b8247d3b79"
] | [
"SpikingSimulationModels/networkTools.py"
] | [
"\n################################################################################\n# -- Tools for simulating networks of spiking neurons using the NEST simulator\n################################################################################\n\nimport numpy as np; import pylab as pl; import time, os, sys\nfrom ... | [
[
"numpy.count_nonzero",
"numpy.ones"
]
] |
siriusdemon/mmaction2 | [
"ba2d97eeaff3ec20dbc51225bdd91bf167861d8e"
] | [
"api.py"
] | [
"import torch\nimport sys\n\nfrom mmaction.apis.inference2 import init_recognizer, inference_recognizer\n\n\nclass Predictor:\n\n def __init__(self):\n self.config_file = 'configs/recognition/slowfast/writing_inference.py'\n self.checkpoint_file = 'checkpoints/writing.pth'\n device = 'cuda' ... | [
[
"torch.device",
"torch.cuda.is_available"
]
] |
brills/tfx-bsl | [
"089d6673a8d3cccef84ff3d6583808544d2da038"
] | [
"tfx_bsl/coders/sequence_example_coder_test.py"
] | [
"# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"tensorflow.train.SequenceExample"
]
] |
chepo92/tinyquaternion | [
"cc5a1a576231bb6691dc8a48b4b6f4b81b3ca225"
] | [
"tinyquaternion/test/test_tinyquaternion.py"
] | [
"import numpy as np\r\n\r\nfrom tinyQuaternion import Quaternion\r\n\r\nq = Quaternion(q=np.array([0., 0., 2., 0.]))\r\nprint(q)\r\nprint(repr(q))\r\n\r\nprint(q.vector)\r\nprint(q.scalar)\r\nprint(q.magnitude)\r\nprint(q.is_unit())\r\nprint(q.normalized)\r\nprint(q.is_unit())\r\nprint(q.conjugate)\r\nprint(q.inver... | [
[
"numpy.array"
]
] |
AlexMinhao/NAS_GNN | [
"89183988a96e1d6baed910ab3843c13282f8b077"
] | [
"graphnas/trainer.py"
] | [
"import glob\nimport os\n\nimport numpy as np\nimport scipy.signal\nimport torch\n\nimport graphnas.utils.tensor_utils as utils\nfrom graphnas.gnn_model_manager import CitationGNNManager\nfrom graphnas_variants.macro_graphnas.pyg.pyg_gnn_model_manager import GeoCitationManager\nfrom time import time\n\nlogger = uti... | [
[
"numpy.ones_like",
"numpy.random.seed",
"torch.load",
"torch.manual_seed",
"torch.cuda.empty_cache",
"numpy.max",
"numpy.std",
"numpy.mean",
"torch.cuda.manual_seed_all"
]
] |
DavidSlayback/rlpyt | [
"445adbd3917842caae0cae0d06e4b2866c8f1258"
] | [
"rlpyt/samplers/serial/isaac.py"
] | [
"from rlpyt.utils.logging import logger\nfrom rlpyt.agents.base import AgentInputs\nfrom rlpyt.samplers.buffer import build_samples_buffer_torch_env\nfrom rlpyt.utils.buffer import buffer_to\nfrom rlpyt.utils.logging import logger\nfrom rlpyt.samplers.collections import BatchSpec, TrajInfo\nfrom rlpyt.samplers.prev... | [
[
"torch.sum",
"torch.zeros"
]
] |
kifish/ParlAI | [
"93a0f31f3d6b03a97c1a081927427dbe1eb1242e",
"93a0f31f3d6b03a97c1a081927427dbe1eb1242e"
] | [
"parlai/scripts/eval_wordstat.py",
"parlai/core/torch_classifier_agent.py"
] | [
"#!/usr/bin/env python3\n\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\"\"\"\nThis helper script can be used alone with modelfile and task: the output will contain\nthe word statist... | [
[
"numpy.array"
],
[
"torch.LongTensor",
"torch.nn.CrossEntropyLoss",
"torch.nn.functional.softmax",
"torch.FloatTensor",
"torch.nn.DataParallel"
]
] |
fabiobaccarin/allstate-loss | [
"4c0fea6ea28847fc67b9e742dc3ac30e1ac4d10a"
] | [
"scripts/08_ranking_raw.py"
] | [
"\"\"\"\nRanking of features with minimum preprocessing (raw features)\n\"\"\"\n\nimport json\nimport pandas as pd\nimport numpy as np\nimport seaborn as sns; sns.set(style='whitegrid')\nfrom matplotlib import pyplot as plt\nfrom sklearn.preprocessing import (\n power_transform, quantile_transform, scale, Standa... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.close"
]
] |
shashankboosi/Machine-Vision | [
"c37ef9b4c7a309529d0e660fed3eb627fc42804e"
] | [
"src/deep_learning.py"
] | [
"import torch\nimport pandas as pd\nfrom sklearn import preprocessing\nimport matplotlib.pyplot as plt\n\n# Load data\ndata = pd.read_csv(\"../data/mnist_train.csv\")\ntrain_data = data[:2000]\ntest_data = data[2000:2500]\n\n# ----- Prepare Data ----- #\n# Preparing your data including data normalization\ntrain_X =... | [
[
"matplotlib.pyplot.legend",
"torch.nn.NLLLoss",
"pandas.read_csv",
"torch.nn.Dropout2d",
"torch.max",
"matplotlib.pyplot.title",
"torch.nn.functional.dropout",
"torch.nn.functional.log_softmax",
"torch.nn.Conv2d",
"matplotlib.pyplot.savefig",
"torch.tensor",
"matplo... |
gdikov/MNIST_Challenge | [
"56834aeeaeefc440cb1d9882c95b73b84fe20edf"
] | [
"models/logreg/logreg.py"
] | [
"import numpy as np\nimport os\n\nfrom models.model import AbstractModel\nfrom numerics.solver import Adam\nfrom numerics.softmax import softmax_loss, softmax\n\nclass LogisticRegression(AbstractModel):\n\n def __init__(self, batch_size=10000, add_bias=False):\n super(LogisticRegression, self).__init__('L... | [
[
"numpy.dot",
"numpy.arange",
"numpy.save",
"numpy.ones",
"numpy.argmax",
"numpy.mean",
"numpy.random.randn",
"numpy.load",
"numpy.array_split",
"numpy.zeros",
"numpy.sum"
]
] |
realiti4/td-gammon | [
"5d6ded0536398a6331b0ab2fc63c85aaef755476"
] | [
"td_gammon/utils.py"
] | [
"import os\nimport gym\nimport sys\nfrom agents import TDAgent, HumanAgent, TDAgentGNU, RandomAgent, evaluate_agents, Agent_2ply\nfrom gnubg.gnubg_backgammon import GnubgInterface, GnubgEnv, evaluate_vs_gnubg\nfrom gym_backgammon.envs.backgammon import WHITE, BLACK\nfrom model import TDGammon, TDGammon_stock, TDGam... | [
[
"torch.utils.tensorboard.SummaryWriter"
]
] |
BlooAM/Day-ahead-prices | [
"e5c51682de4bb2b093fd6412b2131012e7e836ca"
] | [
"src/data_generator/extractors/pscmi_coal_index.py"
] | [
"from datetime import datetime, time\n\nimport pandas as pd\n\nfrom src.data_generator.extractors.base_extractor import BaseExtractor\n\n\nclass PscmiCoalIndexExtractor(BaseExtractor):\n _DATA_PATH = 'resources/PSCMI_1.csv'\n\n def extract(self, date: datetime) -> pd.DataFrame:\n date_truncated_to_mont... | [
[
"pandas.read_csv"
]
] |
zhulf0804/ROPNet | [
"aa12c96f186dadd9a6c5be4524db35fea77cb28c"
] | [
"src/models/CG.py"
] | [
"import numpy as np\nimport open3d as o3d\nimport os\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport sys\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nROOR_DIR = os.path.dirname(BASE_DIR)\nsys.path.append(ROOR_DIR)\nfrom utils import batch_quat2mat\n\n\nclass PointNet(nn.Mo... | [
[
"torch.nn.Sequential",
"torch.norm",
"torch.max",
"torch.cat",
"torch.unsqueeze",
"torch.nn.Linear",
"torch.nn.Conv1d",
"torch.nn.GroupNorm",
"torch.nn.ReLU"
]
] |
jacobmas/bezpy | [
"759618d5518a08e456fab748e5d9cf4881a04525"
] | [
"bezpy/mt/io.py"
] | [
"\"\"\"Input/output functions for IRIS magnetotelluric data.\"\"\"\n\n__all__ = [\"read_xml\", \"read_xml_lower\", \"read_1d_usgs_profile\", \"get_1d_site\"]\n\nimport glob\nimport datetime\nimport xml.etree.ElementTree as ET\nimport numpy as np\nimport pandas as pd\nimport pkg_resources\n\nfrom .site import Site1d... | [
[
"numpy.array",
"numpy.vstack",
"pandas.DataFrame.from_dict"
]
] |
cvcoding/STGNN | [
"f85ae92abc598dd23d66a3c959ccc7e42e95a237"
] | [
"rnn_cell_impl_local.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\... | [
[
"tensorflow.python.framework.tensor_shape.TensorShape",
"tensorflow.python.ops.array_ops.shape",
"tensorflow.python.ops.random_ops.random_uniform",
"tensorflow.python.ops.array_ops.split",
"tensorflow.python.ops.array_ops.zeros",
"tensorflow.python.framework.ops.device",
"tensorflow.py... |
mpriessner/CAFI | [
"4dac24cbd65a5cabf741b87d9521f6bbab54b124"
] | [
"ZS4Mic/codes/data_scripts/create_lmdb_mp.py"
] | [
"'''create lmdb files for Vimeo90K-7 frames training dataset (multiprocessing)\nWill read all the images to the memory\n'''\n\nimport os,sys\nimport os.path as osp\nimport glob\nimport pickle\nfrom multiprocessing import Pool\nimport numpy as np\nimport lmdb\nimport cv2\ntry:\n sys.path.append(osp.dirname(osp.di... | [
[
"numpy.frombuffer"
]
] |
Challyfilio/GAIIC2022-itmatch | [
"55eb1f762dec2d9fe859ed9caafd35cfcd125de6"
] | [
"src/training/train.py"
] | [
"import os\nimport time\nimport json\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\n\nfrom torch.cuda.amp import autocast\nimport torch.distributed as dist\n\nfrom zero_shot import zero_shot_eval\nfrom clip.clip import _transform, load, tokenize\n\nimport sys\nimport pdb\nimport wandb\n\nimport logging... | [
[
"torch.nn.CrossEntropyLoss",
"torch.clamp",
"torch.cat",
"torch.argsort",
"numpy.median",
"torch.distributed.all_gather",
"torch.zeros_like",
"torch.cuda.amp.autocast",
"torch.no_grad",
"numpy.mean",
"torch.where",
"torch.distributed.get_rank",
"torch.distribute... |
piyushrpt/fringe | [
"63388b96b98940d84f981899f955cdb4382a2c71"
] | [
"tests/wrapped_phase_velocity/test1.py"
] | [
"#!/usr/bin/env python3\n\nimport numpy as np\nfrom scipy.spatial import Delaunay\nimport matplotlib.pyplot as plt\n\n\nBaseline = np.array([ 0. , 202.23261006 , 247.67336194 , 157.46570522 , -3.03759106,\n 146.51305542, 432.34588205 , 129.9950411 , 304.6576168 , 342.39451334,\n 77.48752496, 35.3... | [
[
"matplotlib.pyplot.imshow",
"numpy.linalg.matrix_rank",
"numpy.sqrt",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.zeros_like",
"numpy.random.randn",
"numpy.exp",
"numpy.conjugate",
"numpy.hstack",
"numpy.reshape",
"numpy.arange",
"numpy.sin",
"numpy.argmax... |
universea/MoRL | [
"499311cf41f9ef45b6941289ecbfb77cfd9288ec"
] | [
"benchmark/paddle/QuickStart/cartpole_agent.py"
] | [
"import morl\nimport paddle\nimport numpy as np\n\n\nclass CartpoleAgent(morl.Agent):\n \"\"\"Agent of Cartpole env.\n\n Args:\n algorithm(morl.Algorithm): algorithm used to solve the problem.\n\n \"\"\"\n\n def __init__(self, algorithm):\n super(CartpoleAgent, self).__init__(algorithm)\n\... | [
[
"numpy.expand_dims"
]
] |
LordArma/cambrac | [
"c781679b59e7d7a39f05680c1892fea18478f883"
] | [
"cambrac/add_two_matrix.py"
] | [
"import cProfile\nimport io\nimport json\nimport pstats\nimport os\nimport matplotlib.pyplot as plt\n\n\ndef add_by(length, is_row=False):\n A = [[1 for i in range(length)] for j in range(length)]\n B = [[2 for i in range(length)] for j in range(length)]\n\n C = [[0 for i in range(length)] for j in range(l... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.title",
"matplotlib.pyplot.gcf"
]
] |
Jbwasse2/snn-rl | [
"29b040655f432bd390bc9d835b86cbfdf1a622e4"
] | [
"furtherFormulas/3dBarChartGenerator.py"
] | [
"# from http://pythonprogramming.net/3d-bar-charts-python-matplotlib/\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\nimport pylab as pylab\n \nfig = plt.figure()\nax1 = fig.add_subplot(111, projection='3d')\n \nxpos = np.ones(60)... | [
[
"matplotlib.pyplot.Rectangle",
"numpy.ones",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.figure"
]
] |
xhdtc8/mmclassification | [
"606015470be69aaa3ea19b1a1bfed598c2ec5785"
] | [
"mmcls/models/heads/arcface_head.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math\nfrom ..utils import is_tracing\n\nfrom ..builder import HEADS\nfrom .cls_head import ClsHead\n\n\ndef l2_norm(input, axis = 1):\n norm = torch.norm(input, 2, axis, True)\n output = torch.div(input, norm)\n return output\n\n... | [
[
"torch.div",
"torch.nn.functional.softmax",
"torch.norm",
"torch.mm",
"torch.FloatTensor",
"torch.nn.init.normal_",
"torch.where",
"torch.onnx.is_in_onnx_export",
"torch.pow"
]
] |
claforte/SRGAN-PyTorch | [
"b201d5d20296829d3bb4e852ae989bc3f95165cd"
] | [
"srgan_pytorch/utils/device.py"
] | [
"# Copyright 2020 Dakewe Biotech Corporation. All Rights Reserved.\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# Unle... | [
[
"torch.device",
"torch.cuda.get_device_properties",
"torch.cuda.device_count",
"torch.cuda.is_available"
]
] |
lukeshingles/artistools | [
"51a6f4f265a976f4a159d284bc257453b26ee426"
] | [
"artistools/estimators/estimators.py"
] | [
"#!/usr/bin/env python3\n\"\"\"Functions for reading and processing estimator files.\n\nExamples are temperatures, populations, and heating/cooling rates.\n\"\"\"\n# import math\nimport math\nimport multiprocessing\nimport sys\nfrom collections import namedtuple\nfrom functools import lru_cache, partial, reduce\n# ... | [
[
"pandas.DataFrame.from_records"
]
] |
amroadel/Learn2steer | [
"e9a3e74c602257b76dbbe777fb7065733c59a801"
] | [
"tools/resnet_50_pre-trained_model.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport resnet\nfrom config import Config\nfrom tensorflow.python.ops import control_flow_ops\nfrom tensorflow.python.training import moving_averages\n\nactivation = tf.nn.relu\nMOVING_AVERAGE_DECAY = 0.9997\nBN_DECAY = MOVING_AVERAGE_DECAY\nBN_EPSILON = 0.001\nCONV_WEIG... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.get_variable",
"tensorflow.python.ops.control_flow_ops.cond",
"tensorflow.Graph",
"tensorflow.python.training.moving_averages.assign_moving_average",
"tensorflow.get_collection",
"tensorflow.nn.moments",
"tensorflow.truncated_normal_initi... |
Alabenba/EDSR-tensorflow2 | [
"da2edaf18c941e690bee6880c470f7fd944533d8"
] | [
"model.py"
] | [
"from tensorflow.keras.layers import Add, Conv2D, Input, Lambda, Activation\nfrom tensorflow.keras.models import Model\nimport tensorflow as tf\n\n\ndef SubpixelConv2D(scale, **kwargs):\n return Lambda(lambda x: tf.nn.depth_to_space(x, scale), **kwargs)\n\n\ndef edsr(scale, num_filters=64, num_res_blocks=8, res_... | [
[
"tensorflow.nn.depth_to_space",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Add",
"tensorflow.keras.layers.Input"
]
] |
wmcabee-cs/nbc_analysis | [
"d6c717aea0bd3638f9f6d03e2facb45fdbb062fc"
] | [
"src/nbc_analysis/load_profiles/main.py"
] | [
"from nbc_analysis.utils.debug_utils import retval\nfrom nbc_analysis.utils.config_utils import get_config\nfrom pathlib import Path\nfrom toolz import concatv, first, cons, partial, concat, take\nfrom itertools import starmap\nimport pandas as pd\nimport yaml\nfrom toolz import pluck\nimport re\nimport arrow\nimpo... | [
[
"pandas.DataFrame.from_records",
"pandas.read_csv"
]
] |
mattkjames7/NNFunction | [
"5a6ecd057678d9b8001488ff7984b134dd534163"
] | [
"NNFunction/LoadANN.py"
] | [
"import numpy as np\nimport PyFileIO as pf\nimport os\nfrom .NNFunction import NNFunction\n\ndef LoadANN(fname,ReturnModel=True,ReadCost=True):\n\t'''\n\tRead an ANN file\n\t\n\t\n\tImports\n\t=======\n\tfname : str\n\t\tName of the file to load from\n\tReturnModel : bool\n\t\tIf True, an ANN will be returned, othe... | [
[
"numpy.array"
]
] |
ashwinreddy/voting | [
"4a9ef46901ddad23e814d5744944463f6fd9ae83"
] | [
"socialchoice/voting/pairwise.py"
] | [
"from .method import Method\nimport numpy as np\n\nclass PairwiseComparison(Method):\n def __init__(self, preference_schedule):\n super(PairwiseComparison, self).__init__(preference_schedule)\n \n def _compare_candidates(self, i, j):\n \"\"\"Compares candidates i and j as if no other candidat... | [
[
"numpy.where"
]
] |
xdedss/SuccessiveConvexification | [
"8b330b64a31f546ce92c1e34036c212484cbae5e"
] | [
"GFOLD_problem.py"
] | [
"# -*- coding: utf-8 -*-\n# GFOLD_static_p3p4\n\n\nmin_=min\nfrom cvxpy import *\nimport cvxpy_codegen as cpg\nfrom time import time\nimport numpy as np\nimport sys\n\nimport GFOLD_params\n\n''' As defined in the paper...\n\n PROBLEM 3: Minimum Landing Error (tf roughly solved)\n MINIMIZE : norm of landing error ve... | [
[
"numpy.array"
]
] |
richardyoung00/qiskit-aqua | [
"a72ac30e9f47890968418fb25023898f7450eb9a"
] | [
"qiskit/aqua/components/uncertainty_models/gaussian_conditional_independence_model.py"
] | [
"# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2019, 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE... | [
[
"scipy.stats.distributions.norm.ppf",
"numpy.sqrt",
"scipy.stats.distributions.norm.cdf",
"scipy.stats.distributions.norm.pdf",
"numpy.zeros"
]
] |
shivchander/binary-classifiers | [
"aa8bd0734c2dad484dbe6316e042d283be9e1dd1"
] | [
"neighborhood.py"
] | [
"#!/usr/bin/env python3\n__author__ = \"Shivchander Sudalairaj\"\n__license__ = \"MIT\"\n\n'''\nNeighborhood based Classifier\n'''\nfrom scipy.spatial import distance\nimport random\n\n\nclass NeighborhoodClassifier:\n def __init__(self, X, y):\n self.X = X # data features\n self.y = y... | [
[
"scipy.spatial.distance.euclidean"
]
] |
mgeorgati/PoPNetV2 | [
"2b1b973cec2835a512e2fb1ed436b78dd23a97cd"
] | [
"data_scripts/sumTifsByRegion.py"
] | [
"import os\r\nimport rasterio\r\nimport numpy as np\r\n\r\n#18subregion names and others\r\n# othna is the only dfference between 2011 and 2017\r\ncountry_dict = {\"australia\" : [\"aus\",\"cxr\", \"cck\", \"hmd\", \"nzl\", \"nfk\"],\r\n \"antarctica\" : [\"ata\"],\r\n \"eastern_asia\":[\"chn\... | [
[
"numpy.add.reduce"
]
] |
csmithchicago/n2v | [
"82b73cea6fbc79b6c85002a561d364b250836ee1"
] | [
"n2v/models/care_isotropic.py"
] | [
"from __future__ import print_function, unicode_literals, absolute_import, division\n\nimport numpy as np\nfrom scipy.ndimage.interpolation import zoom\n\nfrom n2v.internals.probability import ProbabilisticPrediction\nfrom .care_standard import CARE\nfrom ..internals.predict import predict_direct\nfrom ..data impor... | [
[
"numpy.rollaxis",
"numpy.maximum",
"numpy.isscalar",
"numpy.moveaxis",
"scipy.ndimage.interpolation.zoom"
]
] |
ArthurTolley/skypy | [
"5621877ada75c667b1af7e665b02a91026f7ef0f"
] | [
"skypy/galaxy/ellipticity.py"
] | [
"\"\"\"Galaxy ellipticity module.\n\nThis module provides facilities to sample the ellipticities of galaxies.\n\"\"\"\n\nimport numpy as np\nfrom scipy import stats\n\n\n__all__ = [\n 'beta_ellipticity',\n 'ryden04',\n]\n\n\ndef beta_ellipticity(e_ratio, e_sum, size=None):\n r'''Galaxy ellipticities sample... | [
[
"numpy.random.beta",
"numpy.sqrt",
"numpy.subtract",
"numpy.random.uniform",
"numpy.broadcast",
"numpy.isscalar",
"numpy.negative",
"scipy.stats.truncnorm.rvs"
]
] |
evankozierok/PyPRAM-to-Mesa | [
"a8e47d688b9db9b3e3c7ecd9d5bf77c4a310a521"
] | [
"Samples/Migration/run_abm.py"
] | [
"from Samples.Migration.Migration.MigrationModel import MigrationModel\nfrom mesa.datacollection import DataCollector\nimport matplotlib.pyplot as plt\nimport time\n\n# the original PRAM has 1000000 agents; however, you may want to keep it smaller in the ABM (this sample has 1000)\n# because of memory and time conc... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.savefig"
]
] |
pratikpatil92/customer-segmentation | [
"860cb09413ff1218b502f0488f9b37ca5a483908"
] | [
"code.py"
] | [
"# --------------\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n# load data\ndf = pd.read_csv(path)\n# check the null values\ndf.isnull().sum()\n# drop null values\ndf.dropna(subset=['Description','CustomerID'],inplace=True)\n# check the null values\ndf.isnull()... | [
[
"numpy.log",
"pandas.to_datetime",
"pandas.read_csv",
"matplotlib.pyplot.title",
"sklearn.cluster.KMeans",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"numpy.where",
"matplotlib.pyplot.figure"
]
] |
HAL-lucination/segfuse | [
"df19ae53d43ac6ef98b2ed0ddabb14857b2b903a"
] | [
"Utils/Segmentation.py"
] | [
"import sys\r\nsys.path.append(\"Utils/seg/\")\r\n\r\n# System libs\r\nimport os, csv, torch, numpy, scipy.io, PIL.Image, torchvision.transforms\r\n# Our libs\r\nimport mit_semseg as mit_semseg\r\nfrom mit_semseg.models import ModelBuilder, SegmentationModule\r\nfrom mit_semseg.utils import colorEncode\r\n\r\ndef g... | [
[
"torch.nn.NLLLoss",
"torch.no_grad",
"torch.max"
]
] |
AntoniaSophia/deep-reinforcement-learning | [
"1d1c77039eea22fcf6726c35c3dd2563adfcb519"
] | [
"lab-taxi/agent.py"
] | [
"import numpy as np\nfrom collections import defaultdict\n\nclass Agent:\n\n def __init__(self, nA=6):\n \"\"\" Initialize agent.\n\n Params\n ======\n - nA: number of actions available to the agent\n \"\"\"\n self.mode = 1 # 0 = Sarsa , 1 = Sarsamax , 2 = Expected Sar... | [
[
"numpy.dot",
"numpy.ones",
"numpy.max",
"numpy.argmax",
"numpy.zeros"
]
] |
AdrianLundell/HelmertTool | [
"1ee5dbed4d2a935b193d4fe83339b5da4d12b36f"
] | [
"HelmertTool/visualise.py"
] | [
"import pandas as pd \nimport numpy as np\nimport matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\nfrom HelmertTool.io import get_path \n\ndef plot_sites3D(df: pd.DataFrame):\n fig = plt.figure()\n ax = fig.add_subppytholot(projection='3d')\n ax.scatter3D(df.X, df.Y, df.Z)\n plt.show()\n\ndef... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
bvsk35/Curve-Fitting | [
"549bd3b2f9a0d136f8abd392b52d15a3ef86b1ac"
] | [
"CurveFitting.py"
] | [
"# This file applied Back Propagation Algorithm\r\n# for curve fitting problem\r\n# Neural Network Architecture has\r\n# 3 layers: Input, Hidden and Output\r\n\r\n# Import Required Libraries\r\nimport numpy\r\nimport matplotlib.pyplot as plt\r\n\r\n# Parameters\r\nEpoch = numpy.array([]) # No. of Training Iteration... | [
[
"numpy.square",
"matplotlib.pyplot.legend",
"numpy.dot",
"matplotlib.pyplot.title",
"numpy.multiply",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.concatenate",
"numpy.size",
"numpy.savetxt",
"matplotlib.pyplot.xlabel",
"numpy.tanh",
"numpy.arr... |
OSU-AIMS/golf-smart | [
"fdc0794dedc21ea832e946013fcb487e9f043f09"
] | [
"scripts/smart_golf_utilities.py"
] | [
"#!/usr/bin/env python3\n#\n# Software License Agreement (Apache 2.0 License)\n# Copyright (c) 2022, The Ohio State University\n#\n# Author: C. Cooper\n#\n# Description:\n# Support class offering tools for robot kinematics and other related calculations.\n\n\nimport numpy as np\n\n\nclass ROBOT_KINEMATICS():\n \... | [
[
"numpy.sqrt",
"numpy.linspace",
"numpy.cos",
"numpy.sin",
"numpy.append",
"numpy.zeros"
]
] |
hemraj4545/Data-Structures-and-Algorithms-in-Python | [
"e13becf63097e86dc073bc2de3b8d5586623743d"
] | [
"Graphs/BFS.py"
] | [
"import numpy\nfrom collections import deque\n\n\nclass Graph:\n def __init__(self, vertices):\n self._vertices = vertices\n self._adjMatrix = numpy.zeros((vertices, vertices))\n self._size = 0\n\n def add_edge(self, u, v, w=1):\n self._adjMatrix[u][v] = w\n\n def delete_edge(se... | [
[
"numpy.zeros"
]
] |
ashimgiyanani/ProjectTemplate_python | [
"3135e8976aac751049a6da34a550db0fe045f0bb"
] | [
"fun/FnImportOneDas.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon May 10 13:33:36 2021\n\n@author: giyash\n\"\"\"\n\ndef FnImportOneDas(tstart, tend, channel_paths, ch_names,sampleRate, target_folder):\n\timport pandas as pd\n\timport numpy as np\n\timport sys, os\n\tsys.path.append(r\"c:\\Users\\giyash\\OneDrive - Fraunhofer\\Pyth... | [
[
"pandas.tseries.frequencies.to_offset",
"numpy.array",
"numpy.float64",
"pandas.DatetimeIndex"
]
] |
fderyckere/pgmpy | [
"236a74b117a11f7230a3d110bb33fadd18c0acff"
] | [
"pgmpy/tests/test_readwrite/test_BIF.py"
] | [
"import unittest\n\nimport numpy as np\nimport numpy.testing as np_test\nimport networkx as nx\n\nfrom pgmpy.readwrite import BIFReader, BIFWriter\nfrom pgmpy.models import BayesianModel\nfrom pgmpy.factors.discrete import TabularCPD\nfrom pgmpy.extern.six.moves import map, range\n\n\nclass TestBIFReader(unittest.T... | [
[
"numpy.testing.assert_array_equal",
"numpy.array"
]
] |
mike-gimelfarb/cascade_correlation_neural_networks | [
"ca9ce7dfb2c145d5c0b67b496c586fc441967518"
] | [
"examples/run_spirals.py"
] | [
"import os\nos.environ['CUDA_VISIBLE_DEVICES'] = '-1'\n\nimport string\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport tensorflow.compat.v1 as tf\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.model_selection import train_test_split\nfrom sklearn... | [
[
"matplotlib.pyplot.legend",
"numpy.hstack",
"matplotlib.pyplot.title",
"numpy.unique",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.subplots",
"numpy.sin",
"matplotlib.pyplot.plot",
"sklearn.preprocessing.LabelEncoder",
"numpy.cos",
"numpy.ones",
"... |
LSST/utils | [
"894b03d5c625bfacc91cb7f2a74889d56e580028"
] | [
"python/lsst/utils/tests.py"
] | [
"# This file is part of utils.\n#\n# Developed for the LSST Data Management System.\n# This product includes software developed by the LSST Project\n# (https://www.lsst.org).\n# See the COPYRIGHT file at the top-level directory of this distribution\n# for details of code ownership.\n#\n# Use of this source code is ... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.axes",
"numpy.max",
"numpy.all",
"numpy.any",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplots_adjust",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.logical_not",
"matplotlib.pyplo... |
JonathanArvidsson/DCE-DSC-MRI_CodeCollection | [
"7ddddbe302a23f51bcec5444e2a3cab31f5a9bb4"
] | [
"src/original/OGJ_OsloU_Norway/Simulations/noise/run.py"
] | [
"import MRImageAnalysis as mri\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom phantoms_py.phantom import phantom\nimport sys\n\ndata_save_path = '../results/noise/'\n\n\ndef plot_phantom_curves(ph, fit=None):\n\tif fit is not None:\n\t\tfitted_img = fit.fittedImage()\n\telse:\n\t\tfitted_img = None\n\... | [
[
"numpy.linspace",
"matplotlib.pyplot.subplots",
"numpy.random.normal",
"numpy.mean",
"numpy.savetxt",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.show"
]
] |
vdivakar/patchify.py | [
"b3c9b44618f827537e495b619dd370d4391756d3"
] | [
"patchify.py"
] | [
"import numpy as np\nfrom skimage.util import view_as_windows\nfrom itertools import product\nfrom typing import Tuple\n\ndef patchify(patches: np.ndarray, patch_size: Tuple[int, int], step: int = 1):\n return view_as_windows(patches, patch_size, step)\n\ndef unpatchify(patches: np.ndarray, imsize):\n if len(... | [
[
"numpy.zeros"
]
] |
Kat-90/improver | [
"a5c31be3430df429ae38e7c16e267fcbc2af1858"
] | [
"improver_tests/cli/test_init.py"
] | [
"# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# (C) British Crown Copyright 2017-2020 Met Office.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following c... | [
[
"numpy.zeros"
]
] |
chwj81/pytorch-ssd | [
"1c666d498216b6a569016d010fc6f98b4d14a559"
] | [
"run_ssd_example2.py"
] | [
"from vision.ssd.vgg_ssd import create_vgg_ssd, create_vgg_ssd_predictor\r\nfrom vision.ssd.mobilenetv1_ssd import create_mobilenetv1_ssd, create_mobilenetv1_ssd_predictor\r\nfrom vision.ssd.mobilenetv1_ssd_lite import create_mobilenetv1_ssd_lite, create_mobilenetv1_ssd_lite_predictor\r\nfrom vision.ssd.squeezenet_... | [
[
"numpy.count_nonzero",
"torch.max",
"torch.cuda.is_available",
"torch.tensor"
]
] |
aebrahimian/alpha-zero-hex | [
"466ca3b08713f179390d1595e28f7a473994df54"
] | [
"hex/pytorch/NNet.py"
] | [
"import argparse\nimport os\nimport shutil\nimport time\nimport random\nimport numpy as np\nimport math\nimport sys\nsys.path.append('../../')\nfrom utils import *\nfrom pytorch_classification.utils import Bar, AverageMeter\nfrom NeuralNet import NeuralNet\n\nimport argparse\nimport torch\nimport torch.nn as nn\nim... | [
[
"torch.load",
"torch.sum",
"torch.exp",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.array"
]
] |
heprom/pymicro | [
"176bf3a829dbf67796a3d4471f18868a3da229a7"
] | [
"pymicro/core/samples.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"DataPlatform module for the management of multimodal mechanical datasets.\n\nThe `samples` module provides a base class `SampleData` implementing a generic\ndata model and data paltform API, allowing to define by inheritance specific\ndata platform classes for... | [
[
"numpy.dot",
"numpy.issubdtype",
"numpy.squeeze",
"numpy.dtype",
"numpy.all",
"numpy.max",
"numpy.concatenate",
"numpy.mean",
"numpy.any",
"numpy.cross",
"numpy.where",
"numpy.unique",
"numpy.arange",
"numpy.atleast_1d",
"numpy.std",
"numpy.zeros",
... |
zpc-666/Temporal-Action-Proposal-Generation-competition | [
"5ee01a60b562e0248e5915c78d175ea6aaf854c1"
] | [
"utils.py"
] | [
"import numpy as np\r\nimport os, pickle, tqdm, json\r\nimport paddle\r\nimport random\r\n\r\ndef set_seed_paddle(seed=1024):\r\n seed = int(seed)\r\n random.seed(seed)\r\n os.environ['PYTHONHASHSEED'] = str(seed)\r\n np.random.seed(seed)\r\n paddle.seed(seed)\r\n\r\ndef iou_with_anchors(anchors_min,... | [
[
"numpy.square",
"numpy.maximum",
"numpy.minimum",
"numpy.random.seed",
"numpy.array",
"numpy.divide"
]
] |
nightttt7/tool9 | [
"659054ce1acd681935f423509a7dfbdd887ae35f"
] | [
"tool9/func.py"
] | [
"__all__ = ['period', 'describe', 'ni', 'yearlyreturn', 'yearlyreturnm',\n 'exesssyearlyreturn', 'exesssyearlyreturnm', 'sr', 'srm', 'srf',\n 'srfm', 'var', 'es', 'drawdown', 'avedrawdown', 'maxdrawdown',\n 'portfolio_risk', 'period_4_plot', 'performance', 'performance1',\n '... | [
[
"numpy.diag",
"numpy.dot",
"pandas.to_datetime",
"numpy.sqrt",
"pandas.DataFrame",
"numpy.exp",
"numpy.array"
]
] |
dapopov-st/python-youtube-code | [
"770c9291988898f259ad28bbab5989acee8fb830"
] | [
"AI-plays-2048/game_ai.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\nNUMBER_OF_MOVES = 4\nSAMPLE_COUNT = 50\n\nSPM_SCALE_PARAM = 10\nSL_SCALE_PARAM = 4\nSEARCH_PARAM = 200\n\nfrom game_functions import initialize_game, random_move,\\\n move_down, move_left,\\\n move_right, m... | [
[
"numpy.amax",
"numpy.log2",
"numpy.power",
"numpy.arange",
"numpy.copy",
"numpy.argmax",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.ylabel"
]
] |
wangxiang2713/tvm | [
"0467539b35fe4ab6b577dc60c627f9923e584c5f"
] | [
"tests/python/frontend/onnx/test_forward.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.logical_xor",
"torch.randint",
"numpy.take",
"numpy.asarray",
"numpy.dtype",
"torch.set_grad_enabled",
"numpy.random.randn",
"numpy.exp",
"numpy.where",
"scipy.special.softmax",
"torch.nn.EmbeddingBag",
"numpy.random.randint",
"torch.onnx.export",
"to... |
sailist/ASRFrame | [
"484cf1ee5beec4c39439de683c5b4c1f1ea3a94a"
] | [
"util/layer_viso.py"
] | [
"'''\n作者:挥挥洒洒\n来源:CSDN\n原文:https://blog.csdn.net/u010420283/article/details/80303231\n版权声明:本文为博主原创文章,转载请附上博文链接!\n'''\n\n# 暂时没有使用\n\nfrom keras.models import load_model\nfrom keras import backend as K\nimport matplotlib.pyplot as plt\n\n\n\n\ndef main():\n model = load_model('data/checkpoints/inception.026-1.07.h... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.imread",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show"
]
] |
lucasthim/auto-fuzzy | [
"1aa8f246973ad95c326e785f41614db0cb99b71c"
] | [
"deprecated/ensemble/senfis/calcula_media.py"
] | [
"import glob\nimport os\nimport re\nimport numpy as np\nimport autoFIS.autoFIS.utils_autofis as toolfis\n\n\ndef summary_multiple(successful_classifiers, metrics_train, metrics_test, metrics_rules):\n r0 = successful_classifiers\n ac_train, auc_train = metrics_train[0:2]\n ac_test, auc_test = metrics_test[... | [
[
"numpy.std",
"numpy.mean"
]
] |
timbobailey/AVO-plotter | [
"3d76bfe4dae1e79f6a1042d91636373e0fdb8a2c"
] | [
"avonumericals.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nfrom bruges.reflection import reflection as avomodel\n\n\nclass AVONumerical:\n ''' A class to isolate the AVO calls from the main gui'''\n # Extents and step of sliders\n # min, max, step\n vpextents = (100, 10000, 50) # m/s\n vsextents = (100, 1000... | [
[
"numpy.arange"
]
] |
isLinXu/YOLOv5_Efficient | [
"1f50b44cafdc942b3f222a072bee726722fda5ca"
] | [
"yolov5_master/predict.py"
] | [
"'''\n@author: linxu\n@contact: 17746071609@163.com\n@time: 2021-8-16 上午09:56\n@desc: 模型执行-主函数\n'''\n\nimport os\nimport shutil\nimport time\nfrom pathlib import Path\n\nimport cv2\nimport torch\nfrom numpy import random\nfrom yolov5_master.utils.general import (check_img_size, non_max_suppression, scale_coords, xy... | [
[
"torch.tensor",
"numpy.random.randint",
"torch.from_numpy",
"torch.zeros"
]
] |
cpcdoy/rust-bert | [
"c9e8e960a8d76706a0d0afde5e76d30592b161e8"
] | [
"utils/download-dependencies_gpt2-large.py"
] | [
"from transformers import GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP\nfrom transformers.tokenization_gpt2 import PRETRAINED_VOCAB_FILES_MAP\nfrom transformers.file_utils import get_from_cache, hf_bucket_url\nfrom pathlib import Path\nimport shutil\nimport os\nimport numpy as np\nimport torch\nimport subprocess\n\nconfig_pa... | [
[
"numpy.savez",
"torch.load"
]
] |
tmills/uda | [
"c9843dc5d955a6ea124f99caa2d3517d91b3d6a7"
] | [
"scripts/learn_pivots_dual_domain.py"
] | [
"#!/usr/bin/env python3\nimport sys\nfrom os.path import join,exists,dirname\nimport random\nfrom datetime import datetime\nimport time\n\nimport numpy as np\nfrom numpy.random import randint\nfrom sklearn.datasets import load_svmlight_file\nfrom torch.autograd import Function, Variable\nimport torch.nn as nn\nimpo... | [
[
"torch.abs",
"torch.FloatTensor",
"torch.cuda.is_available",
"sklearn.datasets.load_svmlight_file",
"numpy.where",
"torch.nn.L1Loss",
"numpy.random.randint",
"torch.autograd.Variable",
"torch.ones",
"numpy.arange",
"torch.nn.Sigmoid",
"torch.mul",
"numpy.zeros",... |
djlduckett/Genome_Resources | [
"7d0e17c349606464f11a20ce3f04acdc57202cd6"
] | [
"1snp_by_id.py"
] | [
"#!/usr/bin/env python\n\n###Imports###\nimport numpy as np\nimport pandas as pd\nimport re\nimport sys\nimport collections\n\n###Definitions###\nvcf_file = sys.argv[1]\n\n###Functions###\n\ndef get_header_lines(vcf_file):\n lines = []\n comment = True \n with open(vcf_file, 'r') as f:\n while co... | [
[
"numpy.random.choice"
]
] |
tritas/bitl | [
"f394e633e38f983fed10c3e672af7be2883cbdbb"
] | [
"bitl/policies/oful.py"
] | [
"# -*- coding: utf-8 -*-\n# Author: Aris Tritas, Nithin Holla\n# License: BSD 3-clause\n\nimport numpy as np\nfrom scipy.optimize import minimize\n\n\nclass OFUL(object):\n # Constructor function\n \"\"\"\n Optimism-in-the-face-of-Uncertainty linear bandits\n \"\"\"\n\n def __init__(\n self,\n... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.asarray",
"numpy.eye",
"numpy.linalg.det",
"numpy.argmax",
"numpy.identity",
"scipy.optimize.minimize",
"numpy.ravel",
"numpy.zeros",
"numpy.sum",
"numpy.vstack"
]
] |
rohanblueboybaijal/face_classification | [
"395fde734dffbf93f2ea72e322d2229368c2c40e"
] | [
"src/petcat.py"
] | [
"from statistics import mode\n\nimport cv2\nimport matplotlib.pyplot as plt\nfrom keras.models import load_model\nfrom keras.preprocessing import image\nimport numpy as np\n\nfrom utils.datasets import get_labels\n\ndef detect_faces(detection_model, gray_image_array):\n return detection_model.detectMultiScale(gr... | [
[
"numpy.asarray",
"numpy.max",
"numpy.expand_dims",
"numpy.argmax"
]
] |
avolkov1/keras_experiments | [
"333fad99dfd0d789b86c6976c5b3f9929edd6a67"
] | [
"examples/variational_autoencoder/variational_autoencoder_deconv_tfdataset_mgpu.py"
] | [
"'''This script demonstrates how to build a variational autoencoder\nwith Keras and deconvolution layers.\n\nReference: \"Auto-Encoding Variational Bayes\" https://arxiv.org/abs/1312.6114\n\nUsing Tensorflow queue and asynchronous training.\n\noriginal implementation:\nhttps://github.com/fchollet/keras/blob/master/... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.scatter",
"numpy.linspace",
"matplotlib.use",
"numpy.tile",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.zeros",
"tensorflow.contrib.data.Dataset.from_tensor_sl... |
iPriest001/my_mmdetection_v218 | [
"229c7da16908d08abcf65f55b241184f6b61b47d"
] | [
"mmdet/models/necks/fpn_AAR1.py"
] | [
"import warnings\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import ConvModule, xavier_init\nfrom mmcv.runner import auto_fp16\nimport numpy as np\nfrom timm.models.layers import DropPath, to_2tuple, trunc_normal_\n\nfrom ..builder import NECKS\n\n\nclass AdaptiveAngleConv(n... | [
[
"torch.nn.Softmax",
"torch.cat",
"torch.nn.init.constant_",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.zeros_like",
"torch.sum",
"torch.nn.Linear",
"torch.nn.functional.relu",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"tor... |
ranok92/deepirl | [
"88c7e76986243cf0b988d8d7dc0eef6b58e07864"
] | [
"experiments/run_experiment_drone_rl.py"
] | [
"import pdb\nimport sys # NOQA\n\nsys.path.insert(0, \"..\") # NOQA: E402\n\nimport numpy as np\nimport argparse\nimport torch.multiprocessing as mp\nimport os\n\nimport git\nimport gym\nimport glob\nfrom logger.logger import Logger\nimport matplotlib\nimport datetime, time\n\n# from debugtools import compile_res... | [
[
"torch.multiprocessing.set_start_method",
"matplotlib.use",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
erfanMhi/Deep-Reinforcement-Learning-CS285-Pytroch | [
"6da04f367e52a451c202ae7e5477994c1d149baf"
] | [
"hw4/cs285/policies/argmax_policy.py"
] | [
"import torch\nimport tensorflow as tf\n\nfrom cs285.infrastructure.torch_utils import convert_args_to_tensor\n\nclass ArgMaxPolicy(object):\n\n def __init__(self, critic, device='cpu'):\n self.critic = critic\n self.device = device\n\n @convert_args_to_tensor()\n def get_action(self, obs):\n... | [
[
"torch.no_grad"
]
] |
lace/entente | [
"49805e0f7117098f35826eb6a23e1ad7ad22c136"
] | [
"entente/landmarks/test_landmarker.py"
] | [
"from entente.landmarks.landmarker import Landmarker\nfrom entente.landmarks.serialization import dump_landmarks\nfrom lacecore import Mesh, shapes\nimport numpy as np\nimport pytest\n\n\ndef source_target_landmarks():\n source_mesh = shapes.cube(np.zeros(3), 1.0)\n target_mesh = (\n source_mesh.transf... | [
[
"numpy.testing.assert_array_equal",
"numpy.array",
"numpy.zeros"
]
] |
datavaluepeople/tentaclio | [
"eb6920a0e115c6c08043063a8c1013d812ec34c8"
] | [
"tests/functional/postgres/test_client.py"
] | [
"import pandas as pd\nimport pytest\nimport sqlalchemy as sqla\n\n\nTEST_TABLE_NAME = \"test_table\"\nTEST_COLUMNS = [\"column_int\", \"column_str\", \"column_float\"]\nTEST_VALUES = [1, \"test_1\", 123.456]\n\n\ndef _client(db_client):\n test_meta = sqla.MetaData()\n sqla.Table(\n # Meta\n TEST... | [
[
"pandas.DataFrame"
]
] |
runeg96/vgn | [
"24278b80935f2a9cd51d20c9e2c5bfe6da4ce53a"
] | [
"src/vgn/utils/btsim.py"
] | [
"import time\n\nimport numpy as np\nimport pybullet\nfrom pybullet_utils import bullet_client\n\n\nfrom vgn.utils.transform import Rotation, Transform\n\nassert pybullet.isNumpyEnabled(), \"Pybullet needs to be built with NumPy\"\n\n\nclass BtWorld(object):\n \"\"\"Interface to a PyBullet physics server.\n\n ... | [
[
"numpy.diag",
"numpy.array",
"numpy.matmul",
"numpy.asarray"
]
] |
roshanr11/solaris | [
"1032f089c311c008a1a8fb297d8b46a991febcb1"
] | [
"solaris/eval/base.py"
] | [
"import shapely.wkt\nimport geopandas as gpd\nimport pandas as pd\nfrom tqdm import tqdm\nimport os\nfrom . import iou\nfrom fiona.errors import DriverError\nfrom fiona._err import CPLE_OpenFailedError\n\n\nclass Evaluator():\n \"\"\"Object to test IoU for predictions and ground truth polygons.\n\n Attributes... | [
[
"pandas.read_csv"
]
] |
sarang-IITKgp/scikit-microwave-design | [
"a8567c2d40eebde93af5989c43d6e3008167e137"
] | [
"src/skmd/network.py"
] | [
"\"\"\"Module containing the basic Microwave netwrok object\"\"\"\n\nimport numpy as np\n\nclass Network:\n\tdef __init__(self, p11, p12, p21, p22, parameter='abcd',Z0=50,omega=None):\n\t\t\"\"\"For conversion from ABCD <-> S, it is assumed that the network has equal and real characteristic impedance on both the po... | [
[
"numpy.zeros_like",
"numpy.ones_like",
"numpy.cosh",
"numpy.sinh"
]
] |
NavpreetDevpuri/Python | [
"04f156a8973d6156a4357e0717d9eb0aa264d086"
] | [
"neural_network/2_hidden_layers_neural_network.py"
] | [
"\"\"\"\nReferences:\n - http://neuralnetworksanddeeplearning.com/chap2.html (Backpropagation)\n - https://en.wikipedia.org/wiki/Sigmoid_function (Sigmoid activation function)\n - https://en.wikipedia.org/wiki/Feedforward_neural_network (Feedforward)\n\"\"\"\n\nimport numpy\n\n\nclass TwoHiddenLayerNeuralN... | [
[
"numpy.dot",
"numpy.random.rand",
"numpy.array",
"numpy.exp",
"numpy.zeros"
]
] |
rddaz2013/Prediction-of-roll-motion-using-fully-nonlinear-potential-flow-and-Ikedas-method | [
"ac0a27e31d64edc8ae8912b6ed10005029868c90"
] | [
"src/visualization/visualize.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef plot_area(results,interesting_ = ['B_W_hat','B_F_hat','B_E_hat','B_L_hat'], ax=None):\n \"\"\"Plot area with annotations\n\n Parameters\n ----------\n results : [type]\n [description]\n interesting_ : list, optional\n [descri... | [
[
"numpy.trapz",
"numpy.interp",
"matplotlib.pyplot.subplots"
]
] |
sourav-roni/multiphenotype_methods | [
"f93863f5b457e9816951830fcc12d804ec9f4588"
] | [
"ds/sparse_variational_age_autoencoder.py"
] | [
"import numpy as np\nfrom multiphenotype_utils import (get_continuous_features_as_matrix, add_id, remove_id_and_get_mat, \n partition_dataframe_into_binary_and_continuous, divide_idxs_into_batches)\nimport pandas as pd\nimport tensorflow as tf\nfrom dimreducer import DimReducer\n\nfrom general_autoencoder import... | [
[
"tensorflow.compat.v1.abs",
"tensorflow.compat.v1.disable_v2_behavior"
]
] |
zld126126/MyPython | [
"960a75d6e3d5049ab0cba6f4c682845cdb96c341"
] | [
"my_tensorflow/my_tensorflow.py"
] | [
"# -*- coding: UTF-8 -*-\nimport tensorflow as tf\n\n# 当直接运行包含main函数的程序时,main函数才会被执行\ndef main():\n print(\"你好!我是一个TensorFlow示例...\")\nif __name__ == '__main__':\n main() \n\n# 定义一个随机数(标量)\nrandom_float = tf.random.uniform(shape=())\n\n# 定义一个有2个元素的零向量\nzero_vector = tf.zeros(shape=(2))\n\n# 定义两个2×2的常量矩阵\nA... | [
[
"tensorflow.matmul",
"tensorflow.constant",
"tensorflow.zeros",
"tensorflow.random.uniform",
"tensorflow.add"
]
] |
dharunya0609/lifelines | [
"e2af3132db5a8090672612ad912fcaa1533ebdd3"
] | [
"perf_tests/weibull_perf_test.py"
] | [
"# -*- coding: utf-8 -*-\n\nif __name__ == \"__main__\":\n import pandas as pd\n import numpy as np\n import time\n\n from lifelines import WeibullFitter\n\n data = (\n [{\"start\": 0, \"stop\": 2, \"E\": False}] * (1000 - 376)\n + [{\"start\": 2, \"stop\": 5, \"E\": False}] * (376 - 82... | [
[
"pandas.DataFrame.from_records"
]
] |
spscah/strava-grab | [
"ab29a4bd2349aec01cc74cdbea26c8f3079904c6"
] | [
"refresh-all-activities.py"
] | [
"import pandas as pd\nimport requests\nimport json\nimport time\n\n# based on https://medium.com/swlh/using-python-to-connect-to-stravas-api-and-analyse-your-activities-dummies-guide-5f49727aac86 \n\n## Get the tokens from file to connect to Strava\nwith open('strava_tokens.json') as json_file:\n strava_tokens =... | [
[
"pandas.DataFrame"
]
] |
gustavocidornelas/fused-multimodal-emotion | [
"a15a1313f6e0848d8fc8c5aa796e92effa2f8e8b"
] | [
"model/model_multimodal_attention.py"
] | [
"\"\"\"\nCreated on Tue May 14, 2019\n\n@author: Gustavo Cid Ornelas\n\"\"\"\n\nimport tensorflow as tf\nimport numpy as np\n\nfrom model_audio import *\n\nclass MultimodalAttentionModel:\n \"\"\"\n Class that creates the graph for the multimodal model with global attention\n\n \"\"\"\n\n def __init... | [
[
"tensorflow.concat",
"tensorflow.contrib.rnn.GRUCell",
"tensorflow.zeros",
"tensorflow.stack",
"tensorflow.reduce_sum",
"tensorflow.nn.sigmoid_cross_entropy_with_logits",
"tensorflow.train.AdamOptimizer",
"tensorflow.summary.scalar",
"tensorflow.Variable",
"tensorflow.name_... |
douglastome/msc2018continual-learning | [
"b5b92dc7ac36362a51cd812a1abab68424ed009e"
] | [
"src/vggish_slim.py"
] | [
"# Copyright 2017 The TensorFlow Authors All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi... | [
[
"tensorflow.Graph",
"tensorflow.zeros_initializer",
"tensorflow.reshape",
"tensorflow.identity",
"tensorflow.placeholder",
"tensorflow.global_variables",
"tensorflow.truncated_normal_initializer",
"tensorflow.variable_scope",
"tensorflow.train.Saver"
]
] |
luoyan407/predict_trustworthiness | [
"8f394fc511b9aa31a766a30f0e1b059481aa5f76"
] | [
"src/checkpoint.py"
] | [
"import os\nimport torch\nfrom tensorflow.io import gfile\nimport numpy as np\n\n\ndef load_pretrained_d_oracle(path):\n \"\"\" Load weights from a given checkpoint path in npz/pth \"\"\"\n if path.endswith('npz'):\n keys, values = load_jax(path)\n state_dict = convert_jax_pytorch(keys, values)\... | [
[
"tensorflow.io.gfile.GFile",
"numpy.load",
"torch.load",
"torch.tensor"
]
] |
shreyasajal/PredictIn-1 | [
"e458f3cf2b0cff1a6924bc83c8f3bdb6fc1f255d"
] | [
"static/cssFolder/app.py"
] | [
"from flask import Flask, render_template, url_for, request\nimport numpy as np\nimport pandas as pd\nimport joblib\n \nfilename = 'model.pkl'\nreg = joblib.load(filename)\n\napp= Flask(__name__)\n\n@app.route('/')\ndef index():\n return render_template('index.html')\n\n@app.route('/aboutus')\ndef aboutus():\n ... | [
[
"numpy.array",
"pandas.DataFrame"
]
] |
gritYCDA/shape_deform | [
"5780f59f39164e01dcda668c4c57df92876561a1"
] | [
"train_ae.py"
] | [
"import os\nimport time\nimport argparse\nimport torch\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\nfrom lib.auto_encoder import PointCloudAE\nfrom lib.loss import ChamferLoss\nfrom data.shape_dataset import ShapeDataset\nfrom lib.utils import setup_logger\n\nparser = argparse.ArgumentParser()\npar... | [
[
"tensorflow.compat.v1.Summary.Value",
"torch.load",
"tensorflow.compat.v1.summary.FileWriter",
"tensorflow.compat.v1.disable_v2_behavior",
"torch.utils.data.DataLoader"
]
] |
zhupengjia/BERT-pytorch | [
"7efd2b5a631f18ebc83cd16886b8c6ee77a40750"
] | [
"bert_pytorch/dataset/dataset.py"
] | [
"from torch.utils.data import Dataset\nimport tqdm\nimport torch\nimport random\n\n\nclass BERTDataset(Dataset):\n def __init__(self, corpus_path, vocab, seq_len, encoding=\"utf-8\", corpus_lines=None):\n self.vocab = vocab\n self.seq_len = seq_len\n\n with open(corpus_path, \"r\", encoding=... | [
[
"torch.tensor"
]
] |
tunir27/ICDCN-2019 | [
"98a976d7d4c0b50f67c1bb95a67f3125168a6107"
] | [
"Chennai_Floods_code/network2(backup).py"
] | [
"import pandas as pd\nimport codecs\nimport numpy as np\nimport networkx as nx\nfrom networkx.drawing.nx_agraph import graphviz_layout\nimport re\nimport matplotlib.pyplot as plt\n\n#data = pd.read_csv('edges.csv')\nDG=nx.DiGraph()\ndata = codecs.open('Cluster2 Tweets.txt',\"r\",encoding=\"utf-8\")\nregex = r\"\\w*... | [
[
"matplotlib.pyplot.show"
]
] |
qumoptly/OpenFermion | [
"9851b393698da29b63229e0f8457578ac5675a01"
] | [
"src/openfermion/utils/_reduced_hamiltonian_test.py"
] | [
"import os\nimport numpy as np\nimport openfermion as of\nfrom openfermion.config import DATA_DIRECTORY\nfrom openfermion.hamiltonians import MolecularData\nfrom openfermion.ops import InteractionOperator\nfrom openfermion.utils._reduced_hamiltonian import make_reduced_hamiltonian\n\n\ndef test_mrd_return_type():\n... | [
[
"numpy.allclose",
"numpy.isclose"
]
] |
cresset-group/forcebalance | [
"78a48d0e9ee9b5a8f3295cee8a811ad4cfcd2aa6"
] | [
"src/lipid.py"
] | [
"\"\"\" @package forcebalance.lipid Matching of lipid bulk properties. Under development.\n\nauthor Lee-Ping Wang\n@date 04/2012\n\"\"\"\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom builtins import str\nfrom builtins import zip\nfrom builtins import map\nfrom builtins import rang... | [
[
"numpy.dot",
"numpy.log",
"numpy.abs",
"numpy.set_printoptions",
"numpy.linalg.norm",
"numpy.ones",
"numpy.seterr",
"numpy.append",
"numpy.average",
"numpy.outer",
"numpy.array",
"numpy.zeros"
]
] |
ales-erjavec/openTSNE | [
"bd0924b10f3e4c9112ee7778950d88e3f5de920f"
] | [
"openTSNE/affinity.py"
] | [
"import logging\nimport operator\nfrom functools import reduce\n\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom openTSNE import _tsne\nfrom openTSNE import nearest_neighbors\nfrom openTSNE import utils\nfrom openTSNE.utils import is_package_installed\n\nlog = logging.getLogger(__name__)\n\n\nclass Affinitie... | [
[
"numpy.ones_like",
"scipy.sparse.issparse",
"numpy.array_equal",
"numpy.asarray",
"numpy.max",
"numpy.exp",
"numpy.array",
"numpy.sum"
]
] |
rizwandel/optagan | [
"e929b2fa25522bb43e949b8ed4d77d074422b4fe"
] | [
"optagan/run_latent_generation.py"
] | [
"#!/usr/bin/env python3\n# coding=utf-8\n# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this fil... | [
[
"torch.nn.functional.softmax",
"torch.Tensor",
"numpy.random.seed",
"torch.zeros",
"torch.manual_seed",
"torch.tensor",
"torch.no_grad",
"torch.sort",
"torch.cuda.manual_seed_all",
"torch.cuda.is_available",
"torch.topk",
"torch.Tensor.long",
"torch.cuda.device_... |
26medias/GAN-toolkit | [
"8d4d0cc8a8e8bd74e4af9abac19994c7e2f68f6f"
] | [
"verifier/face_verifier.py"
] | [
"from .facenet.inception_resnet_v1 import InceptionResNetV1\nfrom keras.layers import Lambda, Input\nfrom keras.models import Model\nfrom keras import backend as K\nimport tensorflow as tf\nimport numpy as np\nfrom scipy.spatial import distance\nfrom pathlib import Path\n\nFILE_PATH = str(Path(__file__).parent.reso... | [
[
"tensorflow.image.resize_bilinear",
"numpy.argmax",
"scipy.spatial.distance.cosine",
"tensorflow.image.per_image_standardization"
]
] |
VirkSaab/Medical-VQA | [
"6d77963cc81940fc680a18d931e0d88a3264f5fa"
] | [
"mvqag/experiments/abnormality/2020.py"
] | [
"import torch\nimport torch.nn as nn\nimport torchvision.transforms as T\nimport pandas as pd\nfrom typing import Dict, List\nfrom torchcontrib.optim import SWA\nfrom pathlib import Path\nfrom mvqag import CNF_PATH\nfrom mvqag.utils import load_yaml, load_json, get_recent_githash, load_qa_file\nfrom mvqag.data impo... | [
[
"torch.flip",
"pandas.concat",
"torch.nn.CrossEntropyLoss",
"torch.cuda.manual_seed",
"torch.manual_seed",
"torch.cuda.manual_seed_all",
"torch.nn.DataParallel",
"torch.optim.lr_scheduler.StepLR"
]
] |
manigalati/ACDC2017 | [
"e27e4b13ff5dc81eba5594c8b745d580b9603ea3"
] | [
"dataset_utils.py"
] | [
"# Copyright 2017 Division of Medical Image Computing, German Cancer Research Center (DKFZ)\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/... | [
[
"numpy.vstack",
"numpy.unique"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.