repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
GardnerOne/ml-agents | [
"4f3d2117cfc72999abeea99039145d0bee9c56cf"
] | [
"ml-agents/mlagents/trainers/policy/policy.py"
] | [
"from abc import abstractmethod\nfrom typing import Dict, List, Optional\nimport numpy as np\n\nfrom mlagents_envs.base_env import DecisionSteps\nfrom mlagents_envs.exception import UnityException\n\nfrom mlagents.model_serialization import SerializationSettings\nfrom mlagents.trainers.action_info import ActionInfo... | [
[
"numpy.zeros"
]
] |
ConleyKong/conley_estimator | [
"1f71cdb07ff5a8b2ba85c70de43941b9224e4f13"
] | [
"utils/tf_metrics.py"
] | [
"#-*- coding:utf-8 -*-\n\"\"\"\n-----------------------------------\n Project Name: conley_estimator\n File Name : MnistEstData\n Author : Conley.K\n Create Date : 2020/5/28\n Description : 引用自https://github.com/guillaumegenthial/tf_metrics\n-------------------------------------... | [
[
"tensorflow.python.ops.metrics_impl._streaming_confusion_matrix",
"numpy.zeros",
"tensorflow.where",
"tensorflow.diag_part",
"numpy.ones",
"tensorflow.equal",
"tensorflow.zeros_like",
"tensorflow.reduce_sum",
"tensorflow.to_float",
"tensorflow.reduce_mean"
]
] |
lapaniku/cortex | [
"746be852caeff2ad80fcf45dcbaaf1899163ad2e"
] | [
"examples/pytorch/multi-model-text-analyzer/predictor.py"
] | [
"# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.23.*, run `git checkout -b 0.23` or switch to the `0.23` branch on GitHub)\n\nimport torch\nfrom transformers import pipeline\nfrom starlette.responses import JSONResponse\n\n\... | [
[
"torch.cuda.is_available"
]
] |
amrzv/google-research | [
"4e7e88504eff132be8adeaf426d8e13c432a0902"
] | [
"tf3d/utils/label_map_util.py"
] | [
"# coding=utf-8\n# Copyright 2021 The Google Research 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 requ... | [
[
"tensorflow.io.gfile.GFile"
]
] |
johnswanson/pytorch-gpu-benchmark | [
"c4ed9cb025bcc798166756ad4823243cf622ccdc"
] | [
"benchmark_models.py"
] | [
"\"\"\"Compare speed of different models with batch size 16\"\"\"\nimport torch\nfrom torchvision.models import resnet, densenet, vgg, squeezenet,inception\nfrom torch.autograd import Variable\nfrom info_utils import print_info\nimport torch.nn as nn\nimport time\nimport pandas\nimport argparse\nimport os\nfrom plo... | [
[
"torch.cuda.synchronize",
"torch.no_grad",
"torch.cuda.get_device_name",
"torch.nn.CrossEntropyLoss",
"torch.cuda.device_count",
"torch.LongTensor",
"torch.randn",
"torch.nn.DataParallel"
]
] |
vstadnytskyi/caproto-sandbox | [
"712d44a15770b0a51503fba1068a68b3286d8ee5"
] | [
"caproto_sandbox/io_device_client_simple.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n\n\"\"\"\nfrom matplotlib import pyplot as plt\nfrom logging import debug,warn,info,error\nimport epics\nfrom time import time,sleep\nfrom _thread import start_new_thread\nfrom caproto.threading.client import Context\nfrom pdb import pm\nimport epics\nfrom n... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot"
]
] |
richard-vock/multi2novel | [
"a81b2e20b6cbf9cc1d3ce139631d9608bbdaf714"
] | [
"dataset.py"
] | [
"from os.path import join\nimport numpy as np\nimport h5py\nimport torch\n\nseq_length = 4\n\nclass Dataset(object):\n def __init__(self, root, ids, n,\n max_examples=None, bound=10, cache=False):\n self.ids = list(ids)\n self.n = n\n self.bound = bound\n\n if max_exam... | [
[
"torch.Tensor",
"torch.cat",
"numpy.random.randint"
]
] |
hsukyle/cactus-maml | [
"b9319fe3480955c17e376cecc667c38e365c510e"
] | [
"maml.py"
] | [
"\"\"\" Code for the MAML algorithm and network definitions. \"\"\"\nfrom __future__ import print_function\nimport numpy as np\nimport sys\nimport tensorflow as tf\ntry:\n import special_grads\nexcept KeyError as e:\n print('WARN: Cannot define MaxPoolGrad, likely already defined for this version of tensorflo... | [
[
"tensorflow.nn.conv2d",
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.python.platform.flags.DEFINE_float",
"tensorflow.python.platform.flags.DEFINE_string",
"tensorflow.clip_by_value",
"tensorflow.to_float",
"tensorflow.n... |
nodonoughue/emitter-detection-python | [
"ebff19acebcc1edfd941280e05f8ddf2ff20c974"
] | [
"make_figures/chapter5.py"
] | [
"\"\"\"\nDraw Figures - Chapter 5\n\nThis script generates all of the figures that appear in Chapter 5 of the textbook.\n\nPorted from MATLAB Code\n\nNicholas O'Donoughue\n25 March 2021\n\"\"\"\n\nimport utils\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport seaborn as sns\nfrom examples import chapter5... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.get_cmap",
"numpy.random.default_rng",
"matplotlib.pyplot.close",
"matplotlib.pyplot.show"
]
] |
tanzhenyu/keras-cv | [
"b7208ee25735c492ccc171874e34076111dcf637"
] | [
"kerascv/data/voc_segmentation.py"
] | [
"import os\nimport random\nimport numpy as np\nimport tensorflow as tf\nfrom PIL import Image, ImageOps, ImageFilter\n\n\ndef voc_segmentation_dataset_from_directory(\n directory=None,\n base_size=520,\n crop_size=480,\n batch_size=20,\n split=\"train\",\n shuffle=True,\n ... | [
[
"tensorflow.data.Dataset.from_generator",
"numpy.array",
"tensorflow.io.gfile.GFile",
"numpy.ones_like"
]
] |
bmelaiths/meta-dataset | [
"10088555c400768d895f97ae004738196e38a237",
"10088555c400768d895f97ae004738196e38a237"
] | [
"meta_dataset/learners/experimental/optimization_learners.py",
"meta_dataset/learners/experimental/base.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Meta-Dataset 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 require... | [
[
"tensorflow.unique",
"tensorflow.gradients",
"tensorflow.executing_eagerly",
"tensorflow.zeros_like",
"tensorflow.sqrt",
"tensorflow.clip_by_value",
"tensorflow.keras.losses.CategoricalCrossentropy",
"tensorflow.control_dependencies",
"tensorflow.nn.softmax",
"tensorflow.id... |
ihumphrey/HGDL | [
"996a9dd01a4e7f34e85bd14bb24ec23537555104"
] | [
"tests/test_schwefel.py"
] | [
"import numpy as np\nfrom hgdl.hgdl import HGDL as hgdl\nfrom .support_functions import *\nimport time\nimport dask.distributed as distributed\nimport tracemalloc\n\n\n\ndef test_schwefel():\n arr = 5\n brr = 6\n bounds = np.array([[-500,500],[-500,500]])\n #dask_client = distributed.Client(\"10.0.0.1... | [
[
"numpy.array",
"numpy.random.uniform"
]
] |
mikailkhona/1DGCN | [
"615fe1e999c179f034e4f5d5dd2f5ec5789cdc82"
] | [
"LNP_helper_functions.py"
] | [
"\"\"\"\nOriginal MATLAB code by Ila Fiete and John Widloski (2014)\nAdapted into Python by Francisco Acosta in 2020 \n\"\"\"\n\nimport numpy as np\n\n\n\ndef compute_LNP_ionic_currents(g_L):\n \n '''\n This function computes the total ionic current (I_ion) based on:\n - ionic conductance amplitudes of ... | [
[
"numpy.concatenate",
"numpy.zeros",
"numpy.random.poisson",
"numpy.ones",
"numpy.exp"
]
] |
JakeL77/PyFR | [
"19deeb3f550f7a31803b54a6b54d7c80d4200e8b"
] | [
"pyfr/plugins/residual.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\n\nfrom pyfr.mpiutil import get_comm_rank_root, get_mpi\nfrom pyfr.plugins.base import BasePlugin, init_csv\n\n\nclass ResidualPlugin(BasePlugin):\n name = 'residual'\n systems = ['*']\n formulations = ['std']\n\n def __init__(self, intg, cfgsect, suffix):\... | [
[
"numpy.linalg.norm",
"numpy.sqrt"
]
] |
urunimi/tf-sample | [
"51566b3f9b8bfde35eeed81c36f2c360e226f229"
] | [
"org.tensorflow/01_helloworld/placeholder.py"
] | [
"import tensorflow as tf\n\na = tf.placeholder(tf.float32)\nb = tf.placeholder(tf.float32)\nadder_node = a + b\n\nss = tf.Session()\n\nprint(ss.run(adder_node, {a: 3, b: 4.5}))\nprint(ss.run(adder_node, {a: [1, 3], b: [2, 4]}))\n\nadd_and_triple = adder_node * 3\nprint(ss.run(add_and_triple, {a: 3, b: 4.5}))"
] | [
[
"tensorflow.Session",
"tensorflow.placeholder"
]
] |
psi1104/HiDT | [
"148e790e7711d4032aa2a0f458ba0985e54fd328"
] | [
"main.py"
] | [
"import argparse\nimport glob\nimport os\nimport sys\nsys.path.append('./HiDT')\n\nimport torch\nfrom PIL import Image\nfrom torchvision import transforms\nfrom tqdm import tqdm\n\nfrom hidt.networks.enhancement.RRDBNet_arch import RRDBNet\nfrom hidt.style_transformer import StyleTransformer\nfrom hidt.utils.prepro... | [
[
"torch.no_grad",
"torch.cuda.is_available"
]
] |
dinhtungtp/pSp | [
"0b95f32569ad89eae2eab156e2ee5c0f5655ed09"
] | [
"models/psp.py"
] | [
"\"\"\"\r\nThis file defines the core research contribution\r\n\"\"\"\r\nimport matplotlib\r\n\r\nmatplotlib.use('Agg')\r\nimport torch\r\nfrom torch import nn\r\nfrom models.encoders import psp_encoders\r\nfrom models.stylegan2.model import Generator, ConstantRectangleInput\r\nfrom configs.paths_config import mode... | [
[
"matplotlib.use",
"torch.load"
]
] |
dnwissel/msc_thesis | [
"857dd7624ba9e0730be79c8968215699a442c2fa"
] | [
"src/chores/get_permutation_importance.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nimport json\nimport os\nimport sys\n\nmodule_path = os.path.abspath(os.path.join(\"./src/\"))\nif module_path not in sys.path:\n sys.path.append(module_path)\n\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom model.autoencoders import SHAENet, SHAE... | [
[
"sklearn.preprocessing.StandardScaler",
"numpy.random.RandomState",
"pandas.DataFrame",
"numpy.argmax",
"numpy.arange",
"pandas.read_csv"
]
] |
ArthMx/torchtrainer | [
"cc0fdbf7151b45425d4ab56cc61a669adf4d04c4"
] | [
"torchtrainer/trainer.py"
] | [
"import torch\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom functools import reduce\nimport os\nimport time\nfrom .utils import Progbar\n\nclass Trainer(object):\n \"\"\"Class abstracting model training in PyTorch.\"\"\"\n \n def __init__(self, model, loss_fn, optimizer, metrics=None, device=\... | [
[
"torch.device",
"matplotlib.pyplot.xlabel",
"torch.save",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"torch.no_grad",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
behrouzz/numeph | [
"8fa395f1f429ffa67c5dd18a15bb646ef0d0e290"
] | [
"numeph/core.py"
] | [
"import pickle, re\nimport numpy as np\nfrom datetime import datetime\nfrom jplephem import spk\nfrom .julian import datetime_to_jd, jd_to_sec\nfrom .utils import objects, num2txt, txt2num\n\n\nclass Segment:\n def __init__(self, cet_tar, domain, coef):\n self.cet_tar = cet_tar\n self.center = cet_... | [
[
"numpy.concatenate",
"numpy.zeros",
"numpy.logical_and",
"numpy.where",
"numpy.polynomial.chebyshev.Chebyshev"
]
] |
michaelberks/madym_python | [
"e1d0f55552dc44cb6fc76e8c8fcdd29b601bd00d"
] | [
"src/QbiPy/dce_models/tofts_model.py"
] | [
"'''\nModule for woring with the extended-Tofts model.\n\nWe provide the forward model (concentration_from_model), to be used elsewhere in\nfitting if required. In addition we provide methods for fitting the model using\na linear-least squares approach.\n\nThe model includes the standard 3 parameters Ktrans, ve, vp... | [
[
"numpy.linalg.lstsq",
"numpy.exp",
"numpy.zeros"
]
] |
timozerrer/DRL4IOT | [
"1cb8df0c4c0cff9922717b5ff8d73315eb10d242"
] | [
"wrappers/glove_obs_wrapper.py"
] | [
"import gym\nimport numpy as np\nimport os\n\nclass GloveObsWrapper(gym.Wrapper):\n def __init__(self, gym_env, glove_model_path):\n env = gym_env\n self.glove = self.loadGloveModel(glove_model_path)\n super(GloveObsWrapper, self).__init__(env)\n print(\"shape\", env.observation_space... | [
[
"numpy.array"
]
] |
equitensor/EquiTensor_2021 | [
"aa8f234380f6e827478e8f5650230ebef9b0b960"
] | [
"EquiTensors/train_equitensor_aw.py"
] | [
"# EquiTensor + AW: Core + Fairness (adversary + disentanglement module)\n# + AW (Adaptive weighting)\n\n# 1) up date AE, supply sensitive info map (binarized) as y, into decoder.\n# L = L(rec) + lamda * (1 - L(adversary))\n# where L(rec) = sum (L(ds_i) * weight(ds_i))\n# weight(ds_i) i... | [
[
"numpy.array",
"numpy.load",
"numpy.swapaxes",
"numpy.repeat",
"pandas.read_csv",
"numpy.expand_dims"
]
] |
Optimus-Q/infertrade | [
"6f177d63d90bb63b00eb4380a634bbc229425008"
] | [
"infertrade/utilities/api_automation.py"
] | [
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distribu... | [
[
"pandas.read_csv"
]
] |
finalljx/Elastic-Federated-Learning-Solution | [
"fb588fdc03a2c1598b40b36712b27bdffdd24258"
] | [
"efls-train/python/efl/privacy/fixedpoint_tensor.py"
] | [
"# Copyright (C) 2016-2021 Alibaba Group Holding Limited\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 ... | [
[
"tensorflow.strings.to_number",
"tensorflow.shape",
"tensorflow.strings.length",
"tensorflow.ones_like",
"tensorflow.math.abs",
"tensorflow.zeros_like",
"tensorflow.greater",
"tensorflow.less_equal",
"tensorflow.math.floor",
"tensorflow.cast"
]
] |
Seraphyx/fm-intro | [
"58b25b198712fe7703d1015b82fbdca7e4f1c1ba"
] | [
"src/tf/load_data.py"
] | [
"'''\nData pre process for AFM and FM\n@author: \nLizi Liao (liaolizi.llz@gmail.com)\nXiangnan He (xiangnanhe@gmail.com)\n'''\nimport numpy as np\nimport os\nimport pandas as pd\nfrom scipy.sparse import csr_matrix\nfrom sklearn.feature_extraction import DictVectorizer\n\n\nclass LoadData(object):\n '''given the... | [
[
"pandas.read_table",
"sklearn.feature_extraction.DictVectorizer",
"numpy.argsort"
]
] |
ChenMnZ/CF-ViT | [
"afc7ba54510cfbd410921a8b5eb5d6f0243718e7"
] | [
"lvvit/loss/cross_entropy.py"
] | [
"import torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nimport math\r\nimport pdb\r\n\r\nclass SoftTargetCrossEntropy(nn.Module):\r\n\r\n def __init__(self):\r\n super(SoftTargetCrossEntropy, self).__init__()\r\n\r\n def forward(self, x, target):\r\n N_rep = x.shape[0]\r\n ... | [
[
"torch.nn.functional.log_softmax"
]
] |
mmvih/polus-plugins | [
"c424938e3f35900758f7d74f3dfec2adfb3228fc"
] | [
"transforms/images/polus-autocropping-plugin/src/autocrop.py"
] | [
"import logging\nimport random\nfrom concurrent.futures import as_completed\nfrom concurrent.futures import ProcessPoolExecutor\nfrom functools import reduce\nfrom pathlib import Path\n\nimport numpy\nimport scipy.ndimage\nimport scipy.stats\nfrom bfio import BioReader\nfrom bfio import BioWriter\n\nfrom utils impo... | [
[
"numpy.percentile",
"numpy.transpose",
"numpy.asarray",
"numpy.mean"
]
] |
nils91/tensorflow-ml | [
"3aee5a3ef738e49c9e746bebb9c607a8fe203add"
] | [
"nb.py"
] | [
"from sklearn.naive_bayes import GaussianNB\nfrom sklearn import datasets, metrics\n\niris = datasets.load_iris()\nclassifier = GaussianNB()\nclassifier.fit(iris.data, iris.target)\nscore = metrics.accuracy_score(iris.target, classifier.predict(iris.data))\nprint(\"Accuracy: %f\" % score)\n\nnewfeatures=[[4.9,3.1,1... | [
[
"sklearn.naive_bayes.GaussianNB",
"sklearn.datasets.load_iris"
]
] |
selective-inference/Python-software | [
"e906fbb98946b129eb6713e8956bde7a080181f4"
] | [
"selectinf/randomized/tests/test_multiple_queries.py"
] | [
"from __future__ import division, print_function\n\nimport numpy as np\nimport nose.tools as nt\n\nimport regreg.api as rr\n\nfrom ..lasso import lasso, selected_targets, full_targets, debiased_targets\nfrom ..screening import marginal_screening\nfrom ..query import multiple_queries\nfrom ...tests.instance import g... | [
[
"numpy.array",
"numpy.log",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.savefig",
"numpy.ones",
"matplotlib.pyplot.plot",
"numpy.mean",
"numpy.std",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
Aimledge/tvm | [
"f41c050fc681a9d9805e6c73e729df233e1acbac"
] | [
"nnvm/tests/python/compiler/test_rpc_exec.py"
] | [
"import tvm\nfrom tvm import rpc\nfrom tvm.contrib import util, graph_runtime\nimport nnvm.symbol as sym\nimport nnvm.compiler\nimport numpy as np\n\ndef test_rpc_executor():\n host = \"localhost\"\n port = 9100\n server = rpc.Server(host, port, use_popen=True)\n\n x = sym.Variable(\"x\")\n y = sym.V... | [
[
"numpy.ones"
]
] |
SiriusKY/onnxruntime | [
"3c5853dcbc9d5dda2476afa8c6105802d2b8e53d"
] | [
"onnxruntime/test/python/onnxruntime_test_python_iobinding.py"
] | [
"import numpy as np\nfrom numpy.testing import assert_almost_equal\nfrom onnx.mapping import NP_TYPE_TO_TENSOR_TYPE\nfrom onnx.defs import onnx_opset_version\nfrom onnx import helper\nimport onnxruntime as onnxrt\nfrom onnxruntime.capi._pybind_state import ( # pylint: disable=E0611\n OrtDevice as C_OrtDevice, O... | [
[
"numpy.testing.assert_almost_equal",
"numpy.array",
"numpy.arange"
]
] |
ZedThree/tokamesh | [
"6671cd5a7e9b11ae7f81dee3dfcb85662145b35f"
] | [
"tokamesh/geometry.py"
] | [
"\nfrom numpy import sqrt, log, pi, tan, dot, cross, identity\nfrom numpy import absolute, nan, isfinite, minimum, maximum\nfrom numpy import array, ndarray, linspace, full, zeros, stack, savez, int64\nfrom collections import defaultdict\nfrom time import time\nimport sys\n\n\nclass BarycentricGeometryMatrix(object... | [
[
"numpy.full",
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.minimum",
"numpy.absolute",
"numpy.log",
"numpy.tan",
"numpy.identity",
"numpy.savez",
"numpy.stack",
"numpy.sqrt",
"numpy.isfinite",
"numpy.linspace",
"numpy.cross",
"numpy.maximum"
]... |
mjp59/SimpleITK_Segmentation | [
"58350a12ed79547520ac4ed56f5c6b0eb185a645"
] | [
"ImageProcessor.py"
] | [
"import skimage as ski\nimport numpy as np\n\n\nclass ImageProcessor:\n \"\"\"ImageProcessor is a class that implements the image processing\n functions from scikit-image. It has no input parameters for the\n construction and does not have any attributes.\n \"\"\"\n\n def __init__(self):\n pas... | [
[
"numpy.invert",
"numpy.zeros"
]
] |
farrjere/fortune_teller | [
"8489c700cf99d0e291b7a5322dd21cf3aa054c19"
] | [
"example_models/label_encoder.py"
] | [
"from sklearn.preprocessing import LabelEncoder\nfrom sklearn.pipeline import Pipeline\nclass MultiColumnLabelEncoder:\n def __init__(self,columns = None):\n self.columns = columns # array of column names to encode\n\n def fit(self,X,y=None):\n return self # not relevant here\n\n def transfor... | [
[
"sklearn.preprocessing.LabelEncoder"
]
] |
tunahansalih/VPE | [
"97a47820ebe167120af096c8eb746195790e9e4d"
] | [
"code/models/vaeIdsiaStn.py"
] | [
"# This code is modified from the repository\n# https://github.com/bhpfelix/Variational-Autoencoder-PyTorch\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\n\nclass View(nn.Module):\n def __init__(self):\n super(View, self).__init__()\n\n d... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.ReplicationPad2d",
"torch.nn.Sigmoid",
"torch.FloatTensor",
"torch.no_grad",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"torch.autograd.Variable",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.functional.grid_sam... |
JohnZed/cudf | [
"403d2571e5fcde66b7768b2213f6c142cc8b63db"
] | [
"python/cudf/cudf/core/frame.py"
] | [
"import functools\nimport warnings\nfrom collections import OrderedDict\n\nimport cupy\nimport numpy as np\nimport pandas as pd\nfrom pandas.api.types import is_dtype_equal\n\nimport cudf\nimport cudf._lib as libcudf\nfrom cudf._lib.nvtx import annotate\nfrom cudf._lib.scalar import as_scalar\nfrom cudf.core.column... | [
[
"numpy.full",
"numpy.isnan",
"numpy.find_common_type",
"numpy.iterable",
"pandas.DataFrame",
"pandas.api.types.is_numeric_dtype",
"numpy.isscalar",
"pandas.api.types.is_dtype_equal",
"pandas.api.types.is_dict_like",
"pandas.api.types.is_integer_dtype"
]
] |
PaccMann/tape | [
"772a461732fc4044a1dee84d2688bf16960e272c"
] | [
"tape/utils/distributed_utils.py"
] | [
"import typing\nimport argparse\nimport os\nimport multiprocessing as mp\nimport sys\nimport signal\n\nimport torch\nimport torch.distributed as dist\nfrom torch.multiprocessing import _prctl_pr_set_pdeathsig # type: ignore\n\nfrom ..errors import EarlyStopping\n\n\ndef reduce_scalar(scalar: float) -> float:\n ... | [
[
"torch.distributed.is_available",
"torch.distributed.get_world_size",
"torch.multiprocessing._prctl_pr_set_pdeathsig",
"torch.distributed.is_initialized",
"torch.distributed.all_reduce",
"torch.cuda.FloatTensor",
"torch.distributed.barrier"
]
] |
daivuong7696/open_nsfw | [
"41c0acb286c9d858adf5cd8ddb6c2eaa4ad18944"
] | [
"classify_nsfw.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nCopyright 2016 Yahoo Inc.\nLicensed under the terms of the 2 clause BSD license. \nPlease see LICENSE file in the project root for terms.\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport os\nfrom tqdm import tqdm\nimport sys\nimport argparse\nimport glob\nimport time\nfrom ... | [
[
"matplotlib.use",
"numpy.array",
"sklearn.metrics.confusion_matrix",
"sklearn.metrics.precision_recall_curve",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.classification_report",
"pandas.read_csv",
"sklearn.metrics.roc_curve"
]
] |
PyXRD/pyxrd | [
"26bacdf64f3153fa74b8caa62e219b76d91a55c1"
] | [
"pyxrd/mixture/views/edit_mixture_view.py"
] | [
"# coding=UTF-8\n# ex:ts=4:sw=4:et=on\n\n# Copyright (c) 2013, Mathijs Dumon\n# All rights reserved.\n# Complete license can be found in the LICENSE file.\n\nfrom pkg_resources import resource_filename # @UnresolvedImport\n\nimport gi\ngi.require_version('Gtk', '3.0')\nfrom gi.repository import Gtk\n\nimport numpy... | [
[
"numpy.empty"
]
] |
JiahaoYao/torchdrug | [
"39ad8c729542c1c8aab490635106b4ee890558a6"
] | [
"torchdrug/data/dataloader.py"
] | [
"from collections import deque\n\nimport torch\nfrom torch._six import container_abcs, string_classes, int_classes\n\nfrom torchdrug import data\n\n\ndef graph_collate(batch):\n \"\"\"\n Convert any list of same nested container into a container of tensors.\n\n For instances of :class:`data.Graph <torchdru... | [
[
"torch.stack",
"torch.tensor",
"torch.utils.data.get_worker_info"
]
] |
BeckResearchLab/SBMLLint | [
"a5f2b1ad691c192e456e2c0b5d208d921a933a4f"
] | [
"SBMLLint/common/reaction.py"
] | [
"\"\"\"Chemical Reaction.\"\"\"\n\nfrom SBMLLint.common import constants as cn\nfrom SBMLLint.common.molecule import Molecule, MoleculeStoichiometry\n\nimport numpy as np\n\n\nREACTION_SEPARATOR = \"->\"\n\n\n################# FUNCTIONS ###################\ndef getMolecules(libsbml_reaction, func):\n \"\"\"\n Con... | [
[
"numpy.isclose"
]
] |
sshnan7/deep-high-resolution-net.pytorch | [
"3261cfcf85f3a2d2a5852eb1714c04c7f52c47e0"
] | [
"demo/nlos_infer.py"
] | [
"####### Image data를 읽어와 GT 를 만드는 코드 #######\r\n\r\nfrom __future__ import absolute_import\r\nfrom __future__ import division\r\nfrom __future__ import print_function\r\n\r\nimport argparse\r\nimport csv\r\nimport os\r\nimport shutil\r\n\r\nfrom PIL import Image\r\nimport torch\r\nimport torch.nn.parallel\r\nimport... | [
[
"numpy.array",
"torch.stack",
"numpy.asarray",
"numpy.zeros",
"numpy.ones",
"numpy.exp",
"numpy.save",
"torch.cuda.set_device",
"torch.cuda.is_available",
"numpy.arange",
"torch.cuda.FloatTensor",
"torch.load"
]
] |
JackGeraghty/AQP-Research | [
"6b78f4fa0bdc7a26dadaf52b3d317e20bb40d1f0"
] | [
"nodes/loadcsvasdfnode.py"
] | [
"\"\"\"Module containing the LoadCSVAsDFNode. Used to load a csv file into a dataframe.\"\"\"\n\nimport sys\nimport logging\nimport pandas as pd\n\nfrom .node import AQPNode\nfrom pathlib import Path\nfrom constants import LOGGER_NAME\n\nLOGGER = logging.getLogger(LOGGER_NAME)\n\nclass LoadCSVAsDFNode(AQPNode):\n ... | [
[
"pandas.read_csv"
]
] |
gregadc/oct | [
"7e9bddeb3b8495a26442b1c86744e9fb187fe88f"
] | [
"oct/results/report.py"
] | [
"import six\nimport time\nfrom collections import defaultdict\n\nimport ujson as json\nimport pandas as pd\n\nfrom oct.results.models import db, Result, Turret\n\n\nclass ReportResults(object):\n \"\"\"Represent a report containing all tests results\n\n :param int run_time: the run_time of the script\n :pa... | [
[
"pandas.to_datetime",
"pandas.DataFrame"
]
] |
YashNita/DCASE2019-Task5-Urban-Sound-Tagging-Multi_Accuracy-Curve-Display- | [
"377a42a937b75aa41c780651ad0ff94062a83515"
] | [
"pytorch/evaluate.py"
] | [
"import os\nimport sys\nsys.path.insert(1, os.path.join(sys.path[0], '../utils'))\nsys.path.insert(1, os.path.join(sys.path[0], '../evaluation_tools'))\n\nimport numpy as np\nimport time\nimport logging\nimport matplotlib.pyplot as plt\nfrom sklearn import metrics\nimport _pickle as cPickle\nimport datetime\nimport... | [
[
"numpy.mean",
"matplotlib.pyplot.subplots",
"numpy.sign",
"sklearn.metrics.average_precision_score",
"matplotlib.pyplot.show"
]
] |
AshwinBalaji52/Personality-Detection-from-text-using-Deep-Learning | [
"ce3aba2aa2ed118c990eab71c28c82ac78674730"
] | [
"Personality Detection/trainBuild.py"
] | [
"import re\nimport string\nimport pandas as pd\nfrom nltk.corpus import stopwords\nclass trainBuild:\n\tdef __init__(self):\n\t\tself.stop = list(set(stopwords.words(\"english\")))\n\t\tself.word =[] ## NRC word list\n\t\tself.better = {} ## NRC word attributes\n\t\tself.data = pd.DataFrame() ## all data\n\t## get... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
kramer65/matplotlib | [
"a78d7e8e8958307e0e874b7f71de709f5c2fc279",
"a78d7e8e8958307e0e874b7f71de709f5c2fc279"
] | [
"lib/matplotlib/figure.py",
"lib/matplotlib/__init__.py"
] | [
"\"\"\"\nThe figure module provides the top-level\n:class:`~matplotlib.artist.Artist`, the :class:`Figure`, which\ncontains all the plot elements. The following classes are defined\n\n:class:`SubplotParams`\n control the default spacing of the subplots\n\n:class:`Figure`\n top level container for all plot el... | [
[
"matplotlib.colorbar.make_axes_gridspec",
"matplotlib.colorbar.make_axes",
"matplotlib.blocking_input.BlockingKeyMouseInput",
"matplotlib._image.from_images",
"matplotlib.blocking_input.BlockingMouseInput",
"matplotlib.patches.Rectangle",
"matplotlib.colorbar.colorbar_factory",
"ma... |
nwillemse/nctrader | [
"4754ccdeae465ef4674a829f35fc3f78cf1d3ea4"
] | [
"nctrader/statistics/performance.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom scipy.stats import linregress\n\n\ndef aggregate_returns(returns, convert_to):\n \"\"\"\n Aggregates returns by day, week, month, or year.\n \"\"\"\n def cumulate_returns(x):\n return np.exp(np.log(1 + x).cumsum())[-1] - 1\n\n if convert_to == 'we... | [
[
"numpy.log",
"scipy.stats.linregress",
"numpy.mean",
"numpy.std",
"numpy.sqrt",
"pandas.Series"
]
] |
ESCM-summarization/ESCM-summary-evaluation | [
"3780b51f0ed44cbbea3f163a871d875f1e5e9393"
] | [
"Models code/Transformer/train.py"
] | [
"#!/usr/bin/env python\n\"\"\"\n Main training workflow\n\"\"\"\nfrom __future__ import division\nimport argparse\nimport os\nimport signal\nimport torch\n\nimport onmt.opts as opts\nimport onmt.utils.distributed\n\nfrom onmt.utils.logging import logger\nfrom onmt.train_single import main as single_main\n\n\ndef... | [
[
"torch.multiprocessing.get_context"
]
] |
bairw660606/PPDM | [
"d89c1e583a87b1fe5f1c6bb94ed4b09838d5e547"
] | [
"src/lib/eval/hoia_eval.py"
] | [
"import json\nimport numpy as np\nimport os\n\nclass hoia():\n def __init__(self, annotation_file):\n self.annotations = json.load(open(annotation_file, 'r'))\n self.overlap_iou = 0.5\n self.verb_name_dict = {1: 'smoke', 2: 'call', 3: 'play(cellphone)', 4: 'eat', 5: 'drink',\n ... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.zeros",
"numpy.sum",
"numpy.mean",
"numpy.nonzero",
"numpy.where",
"numpy.argsort",
"numpy.cumsum",
"numpy.maximum"
]
] |
maps16/FComputacional1 | [
"eb4a5b5ea9542023a5f928cc1f15d3f25f7ea0d0"
] | [
"Actividad3/Codigo/x3_Sin3x.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.interpolate import interp1d\n\n#Generando datos\nx01 = np.random.random(12)\nx1 = 4.0*x01-2.0\ny1 = (x1*x1*x1)*(np.sin(3.0*x1))\n\n\n#Graficar los puntos aleatorios x y los f(x)=Sin(2x)\nplt.plot(x1, y1, 'o', label='Data')\n\n#Punto para interpolar\nx... | [
[
"numpy.sin",
"scipy.interpolate.interp1d",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show",
"numpy.random.random"
]
] |
tridelat/proteus | [
"13380120826ff0ffa0f244ddd4ee7f389dd8b917"
] | [
"proteus/mprans/VOF.py"
] | [
"# A type of -*- python -*- file\n\"\"\"\nAn optimized volume-of-fluid transport module\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom builtins import range\nfrom past.utils import old_div\nimport numpy as np\nfrom math import fabs\nimport proteus\nfrom proteus import cfemIn... | [
[
"numpy.abs",
"numpy.ones",
"numpy.zeros",
"numpy.copy"
]
] |
GuillemGSubies/TFG | [
"ca808761f397b39626614641544f74ebc6594987"
] | [
"src/model.py"
] | [
"# @author Guillem G. Subies\n\n\nimport datetime\nimport json\nimport zipfile\nfrom math import ceil\nfrom subprocess import check_call\n\nimport jsonpickle\nimport keras.utils as ku\nimport numpy as np\nfrom keras.callbacks import EarlyStopping, ReduceLROnPlateau\nfrom keras.layers import (\n LSTM,\n Bidire... | [
[
"numpy.random.normal",
"numpy.log"
]
] |
microsoft/mutransformers | [
"480287ce7b18a07a3432e8f2fbc0f0e5b71e2599"
] | [
"mutransformers/models/gpt2/_original_configuration_gpt2.py"
] | [
"# coding=utf-8\n# Copyright 2018 The OpenAI Team Authors and 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 file except in compliance with the License.\n# You may obtain a copy o... | [
[
"torch.zeros",
"torch.ones"
]
] |
qimingj/tensor2tensor | [
"a6df48799dc93176df94c36d3a1aea75caa7c594"
] | [
"tensor2tensor/models/video/basic_stochastic.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Tensor2Tensor 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 requir... | [
[
"tensorflow.concat",
"tensorflow.layers.flatten",
"tensorflow.expand_dims",
"tensorflow.less",
"tensorflow.random_uniform",
"tensorflow.variable_scope",
"tensorflow.layers.conv2d",
"tensorflow.to_float",
"tensorflow.layers.dense",
"tensorflow.random_normal_initializer"
]
... |
AlexSG18/FrotiersInEcology | [
"3023d2479082ee6d4c144e4eb5153d40614d2280"
] | [
"tests/test_models/test_losses.py"
] | [
"import pytest\nimport torch\n\nfrom mmdet.models import Accuracy, build_loss\n\n\ndef test_ce_loss():\n # use_mask and use_sigmoid cannot be true at the same time\n with pytest.raises(AssertionError):\n loss_cfg = dict(\n type='CrossEntropyLoss',\n use_mask=True,\n use... | [
[
"torch.empty",
"torch.Tensor",
"torch.tensor"
]
] |
UltraSuite/tal-tools | [
"cf6a497143d19e47149f057626a9bf3ad9cbea95"
] | [
"visualiser/tools/plotters.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nPlot individual video frames.\n\nDate: 2020\nAuthor: M. Sam Ribeiro\n\"\"\"\n\nimport os\nfrom textwrap import wrap\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\n\n\n\ndef set_dark_mode()... | [
[
"matplotlib.use",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gcf",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.subplot"
]
] |
anibalsolon/covid-xprize | [
"cafc2c65c7e4f4184c16a1793da85371b6bc3218"
] | [
"examples/prescriptors/random/prescribe.py"
] | [
"# Copyright 2020 (c) Cognizant Digital Business, Evolutionary AI. All rights reserved. Issued under the Apache 2.0 License.\n\nimport os\nimport argparse\nimport numpy as np\nimport pandas as pd\n\nNUM_PRESCRIPTIONS = 10\n\nNPI_MAX_VALUES = {\n 'C1_School closing': 3,\n 'C2_Workplace closing': 3,\n 'C3_Ca... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.date_range",
"numpy.random.randint",
"pandas.read_csv"
]
] |
UBC-MDS/DSCI_532_Group_12 | [
"de6fe6ebcb0ceccc2eb2c0aefb057fd485c4324e"
] | [
"src/python/data_model.py"
] | [
"import pandas as pd\nimport datetime\nimport os, sys, inspect\nimport numpy as np\n\nfile_daily_report = \"daily_report.csv\"\nfile_timeseries_confirmed = \"time_series_covid19_confirmed_global.csv\"\nfile_timeseries_recovered = \"time_series_covid19_recovered_global.csv\"\nfile_timeseries_death = \"time_series_co... | [
[
"pandas.to_datetime",
"pandas.melt",
"pandas.read_csv",
"numpy.zeros"
]
] |
matt-long/aerobic-safety-margins | [
"2f58775d8e67ea105a217ce89d09e239d208e001"
] | [
"notebooks/util.py"
] | [
"import os\nimport time\nfrom collections.abc import Iterable\n\nimport cftime\nimport dask\nimport intake\nimport numpy as np\nimport xarray as xr\nimport yaml\nfrom dask.distributed import Client\nfrom dask_jobqueue import PBSCluster\n\npath_to_here = os.path.dirname(os.path.realpath(__file__))\n\nUSER = os.envir... | [
[
"numpy.concatenate",
"numpy.testing.assert_almost_equal",
"numpy.sum",
"numpy.diff",
"numpy.radians",
"numpy.abs",
"numpy.hstack"
]
] |
jggjevestad/NavLib | [
"d81fd6e3d4b733aaefd4c69cea6b5d44a06f820b"
] | [
"lib/gnss.py"
] | [
"# Import libraries\nfrom numpy import array, sqrt, sin, cos, arctan2\nfrom lib.constants import GM, OMEGADOTe\n\n\n# Correction for beginning or end of week crossovers in GNSS systems\ndef dt(t, t0):\n t = t - t0\n\n if t > 302400:\n t = t - 604800\n elif t < -302400:\n t = t + 604800\n\n ... | [
[
"numpy.sin",
"numpy.sqrt",
"numpy.cos"
]
] |
alantess/vigilantV2 | [
"3bc44e5b87d69f87bccd4df534478ba665f2391f"
] | [
"common/helpers/support.py"
] | [
"from PIL import Image\nfrom scipy import misc, ndimage\nimport matplotlib.pyplot as plt\nimport torch\nimport numpy as np\nfrom torchvision import models\nfrom torchvision import transforms\n\n\ndef intepret_semantic_model(model, device, alpha=50):\n invTrans = transforms.Compose([\n transforms.Normalize... | [
[
"torch.no_grad",
"scipy.ndimage.gaussian_filter",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
]
] |
kottmanj/z-quantum-core | [
"21752e92e79aafedbfeb6e7ae196bdc2fd5803e4"
] | [
"src/python/zquantum/core/estimator_test.py"
] | [
"from pyquil import Program\nfrom pyquil.gates import X\nfrom openfermion import QubitOperator, qubit_operator_sparse, IsingOperator\nimport numpy as np\nimport pytest\n\nfrom .interfaces.estimator_test import EstimatorTests\nfrom .interfaces.mock_objects import MockQuantumBackend, MockQuantumSimulator\nfrom .estim... | [
[
"numpy.array"
]
] |
jsheedy/biofeedback-cube | [
"178a518d70fdf0dfa3b51226a2a97dbfa68a0543"
] | [
"biofeedback_cube/fx/midi.py"
] | [
"import numpy as np\n\nfrom ..state import clock\nfrom ..config import HEIGHT, WIDTH\nfrom ..hydra import hydra\nfrom ..palettes import palettes, cmap\nfrom ..state import midi_notes\nfrom ..utils import index_dict, xx, yy, sin, cos\n\n\ndef note_default(grid, t):\n\n # _min, _max = min(notes), max(notes)\n _... | [
[
"numpy.sin",
"numpy.sqrt",
"numpy.cos",
"numpy.clip"
]
] |
CADWRDeltaModeling/schimpy | [
"55b4cda524205dce64d5cfa0c86e9edd8cfacaa5"
] | [
"tests/test_schism_mesh.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\" unit tests of schism_mesh\n\"\"\"\nfrom schimpy import SchismMesh, read_mesh, write_mesh, BoundaryType\nimport numpy as np\nimport unittest\nimport os\n\n\nclass TestSchismMesh(unittest.TestCase):\n \"\"\" Unit test class for TriSchismMesh\n \"\"\"\n\n ... | [
[
"numpy.array"
]
] |
tmatha/datasets | [
"936e5f2ebd0e14b5ee3116de7d1690d53933f7cf"
] | [
"tensorflow_datasets/image/lsun.py"
] | [
"# coding=utf-8\n# Copyright 2019 The TensorFlow Datasets 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 ... | [
[
"tensorflow.Graph"
]
] |
mli0603/lietorch | [
"9d8130bec3d01825591b505808bedbb0dffd4b72"
] | [
"examples/rgbdslam/viz.py"
] | [
"import time\nimport argparse\nimport torch\nimport scipy\nimport numpy as np\nimport open3d as o3d\n\nfrom queue import Empty\nfrom multiprocessing import Queue, Process\nfrom scipy.spatial.transform import Rotation\n\ndef pose_matrix_from_quaternion(pvec):\n \"\"\" convert 4x4 pose matrix to (t, q) \"\"\"\n ... | [
[
"numpy.array",
"scipy.spatial.transform.Rotation.from_quat",
"numpy.linalg.inv",
"numpy.eye"
]
] |
thyamu/Neet | [
"cdc55fdb25700e44bcdb4f496b91d21a61a81c83"
] | [
"test/boolean/test_sensitivity.py"
] | [
"import unittest\nfrom neet.boolean import (LogicNetwork, WTNetwork)\nimport numpy as np\n\n\nclass TestSensitivity(unittest.TestCase):\n def test_sensitivity(self):\n net = WTNetwork([[1, -1], [0, 1]], [0.5, 0])\n self.assertEqual(1.0, net.sensitivity([0, 0]))\n\n def test_average_sensitivity_l... | [
[
"numpy.ones"
]
] |
dphaas/pymeasure | [
"580c33bf5f1e409bb575c46bbd1df682bf27cfe1"
] | [
"pymeasure/instruments/keysight/keysightDSOX1102G.py"
] | [
"#\n# This file is part of the PyMeasure package.\n#\n# Copyright (c) 2013-2022 PyMeasure Developers\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including... | [
[
"numpy.array"
]
] |
AKSingh-Udacity/PySyft | [
"51679c1941f172713cd2ba0d080b531a1693a15e"
] | [
"syft/frameworks/torch/hook/hook_args.py"
] | [
"import torch\nimport syft as sy\nfrom syft.exceptions import RemoteTensorFoundError\nfrom syft.exceptions import PureTorchTensorFoundError\n\nfrom syft.exceptions import ResponseSignatureError\nfrom syft.frameworks.torch.tensors.interpreters import AutogradTensor\nfrom syft.frameworks.torch.tensors.interpreters im... | [
[
"torch.nn.Parameter"
]
] |
hnykda/kfsims | [
"0c814c1e6bc2881b72c74f519e693e74e9abde71"
] | [
"kfsims/network.py"
] | [
"import networkx as nx\nimport numpy as np\nimport types\n\nfrom kfsims.node import node_factory, observe_factory\nfrom kfsims.common import init_all\nfrom kfsims import noise\n\n\ndef make_node(measurements, cov, rho=0.9, tau=5, u=5):\n _, xk, P, _, _, _, _, H, F, Q, N = init_all()\n U = cov * (u - 3)\n n... | [
[
"numpy.array",
"numpy.random.seed",
"numpy.sum",
"numpy.random.permutation",
"numpy.mean",
"numpy.linalg.inv"
]
] |
philippeitis/versa | [
"36f1bba5171945bc7a7370d9a7adf380c3fd9806"
] | [
"src/shapenet.py"
] | [
"import os\n\nimport numpy as np\n\n\"\"\"\n Supporting methods for data handling\n\"\"\"\n\n\ndef shuffle_batch(images, labels):\n \"\"\"\n Return a shuffled batch of data\n \"\"\"\n permutation = np.random.permutation(images.shape[0])\n return images[permutation], labels[permutation]\n\n\ndef ... | [
[
"numpy.max",
"numpy.sin",
"numpy.array",
"numpy.random.seed",
"numpy.random.permutation",
"numpy.load",
"numpy.random.shuffle",
"numpy.where",
"numpy.cos",
"numpy.deg2rad",
"numpy.unique"
]
] |
antonia-ms/NeuroLang-1 | [
"131595437ae59056f1e10a6664bb88e80d9a6230"
] | [
"neurolang/probabilistic/cplogic/testing.py"
] | [
"import contextlib\nimport itertools\n\nimport numpy as np\n\nfrom ...expression_pattern_matching import add_match\nfrom ...expression_walker import PatternWalker\nfrom ...expressions import Constant, Symbol\nfrom ...relational_algebra import (\n ColumnStr,\n NamedRelationalAlgebraFrozenSet,\n NaturalJoin,... | [
[
"numpy.random.seed",
"numpy.random.get_state",
"numpy.isclose",
"numpy.random.set_state"
]
] |
ManuelVs/NeuralNetworks | [
"464a8acb9c019eb1591a0aa940a8bfc6f8c7121d"
] | [
"fen/classifier.py"
] | [
"import tensorflow as tf\n\n\nclass Classifier:\n\n def __init__(self, model, input_length, output_length):\n self.model = model\n self.input_length = input_length\n self.output_length = output_length\n\n def compile(self, batch_size=32):\n self._ds_x = tf.placeholder(tf.float32, [... | [
[
"tensorflow.local_variables_initializer",
"tensorflow.train.AdamOptimizer",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.argmax",
"tensorflow.Session",
"tensorflow.Variable",
"tensorflow.equal",
"numpy.mean",
"tensorflow.truncated_normal",
"tensorflow.placehold... |
hu-minghao/Whale_best_practices | [
"4300821500d8dfd386f3ba32506f06dd2b8009b7"
] | [
"inception_V3/retrain.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.image.resize_bilinear",
"tensorflow.reduce_min",
"tensorflow.image.random_flip_left_right",
"tensorflow.matmul",
"tensorflow.import_graph_def",
"tensorflow.stack",
"tensorflow.python.platform.gfile.Exists",
"tensorflow.nn.softmax",
"tensorflow.random_crop",
"ten... |
Tereshchenkolab/paper-ecg | [
"e51d4b4dc09db39f27cc9674729c8932f994daab"
] | [
"src/main/python/Conversion.py"
] | [
"from pathlib import Path\n\nimport numpy as np\nfrom numpy.lib.arraysetops import isin\n\nimport ecgdigitize\nimport ecgdigitize.signal\nimport ecgdigitize.image\nfrom ecgdigitize import common, visualization\nfrom ecgdigitize.image import ColorImage, Rectangle\n\nfrom model.InputParameters import InputParameters\... | [
[
"numpy.array",
"numpy.swapaxes"
]
] |
ishitamed19/few-shot-meta-baseline | [
"9b6e87e4fd52a7e6745d2a87f9399dddc13aaad4"
] | [
"models/classifier.py"
] | [
"import math\n\nimport torch\nimport torch.nn as nn\n\nimport models\nimport utils\nfrom .models import register\n\n\n@register('classifier')\nclass Classifier(nn.Module):\n \n def __init__(self, encoder, encoder_args,\n classifier, classifier_args):\n super().__init__()\n self.e... | [
[
"torch.nn.Linear",
"torch.empty",
"torch.tensor"
]
] |
tor4z/DBS | [
"1232cda2fc93d1a3b5c3c08dbef68f4d157f7b5f"
] | [
"resnet.py"
] | [
"import torch\nimport torch.nn as nn\n\n\ndef conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1):\n \"\"\"3x3 convolution with padding\"\"\"\n return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,\n padding=dilation, groups=groups, bias=False, dilation=dilation)... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.nn.init.kaiming_normal_",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
neverix/book-covers | [
"c9fed069f05100f2ea7cd794453fb24fa010bb7a"
] | [
"train.py"
] | [
"from model import data, model\nfrom pathlib import Path\nimport tensorflow as tf\nfrom tensorflow.keras.models import load_model\n\n\nsave_path = Path(\"model.h5\")\n\n\nif __name__ == '__main__':\n train, val = data()\n if not save_path.exists():\n model = model()\n model.compile(\"adam\", \"c... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.keras.callbacks.ModelCheckpoint"
]
] |
patricknharris/IEX-ELK-TopsTransform | [
"a4e898dacf27b4002b35b5fd7584ac857eb8dc56"
] | [
"iex-elk.py"
] | [
"# monolithic simple module to convert IEX json to ELK json format\n# IEX Attribution: \n# https://iextrading.com/trading/market-data/\n# in middle of this module within transform function\n# simple convervsion to DF - DataFrame\n# TBD DataFrame Normalization and Naive Correlation functions TBD\n# Within ELK this e... | [
[
"pandas.DataFrame.from_dict"
]
] |
godber/ginga | [
"acb32ed422aa604681c63c5a9494ffb0ad96cf2e"
] | [
"ginga/BaseImage.py"
] | [
"#\n# BaseImage.py -- Abstraction of an generic data image.\n#\n# Eric Jeschke (eric@naoj.org) \n#\n# Copyright (c) Eric R. Jeschke. All rights reserved.\n# This is open-source software licensed under a BSD license.\n# Please see the file LICENSE.txt for details.\n#\nimport math\nimport numpy\nimport logging\n\nfr... | [
[
"numpy.zeros",
"numpy.nanmin",
"numpy.radians",
"numpy.isfinite",
"numpy.dstack",
"numpy.nanmax"
]
] |
pskrunner14/neural-networks | [
"83d3b41ad4773ee375b8ef9bed736d7e3f2bf334"
] | [
"nn/loss/categorical_crossentropy.py"
] | [
"import numpy as np\nnp.random.seed(42)\n\nfrom .loss import Loss\n\nclass CategoricalCrossentropy(Loss):\n\n def __init__(self):\n super().__init__()\n\n def forward(self, probs, targets):\n pass\n\n def backward(self):\n pass\n\n# def softmax_crossentropy_with_logits(logits, targets)... | [
[
"numpy.random.seed"
]
] |
ymei/MimosaBMRDO | [
"e73ce698376a7d38ed17486de217397e66bbc864"
] | [
"Software/util/mainpy.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jan 20 2017\nThis the main python script for datataking and processing\n@author: Dong Wang\n\"\"\"\nfrom ethernet_t import *\nfrom dataprocess_t import *\nfrom command import *\nfrom i2c_control import *\nimport sys\nimport os\nimport shlex\nimport socket\nimport tim... | [
[
"matplotlib.pyplot.colorbar",
"matplotlib.animation.FuncAnimation",
"numpy.zeros",
"matplotlib.pyplot.figure",
"matplotlib.colors.BoundaryNorm",
"matplotlib.pyplot.show",
"matplotlib.colors.ListedColormap",
"matplotlib.pyplot.imshow"
]
] |
Priyansh-Kedia/drl-RPN-tf-TACC- | [
"9ecb3750e833a2908edb4eb67dc5233889f7b7df"
] | [
"lib/datasets/imdb.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 and Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom ... | [
[
"numpy.zeros_like",
"numpy.zeros",
"numpy.where",
"numpy.arange",
"numpy.sort",
"numpy.hstack",
"numpy.vstack"
]
] |
tf2gan/vae-gan-code-for-reinforced-panel | [
"b4d407b999551ad5fd965cd2bb18c1e5bbba3449"
] | [
"vae_tfrecord_batch.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun May 9 19:08:30 2021\r\n\r\n@author: Administrator\r\n\"\"\"\r\nimport glob\r\nimport os\r\nimport tensorflow as tf\r\nfrom PIL import Image\r\nfrom math import floor\r\n# data_path='/data-input/pic2000'# windows里好像这个\\\\比较管用,与os相适配\r\ndata_path='I:\\\\zhangkunpe... | [
[
"tensorflow.train.BytesList",
"tensorflow.train.FloatList",
"tensorflow.train.Int64List",
"tensorflow.train.Features",
"tensorflow.constant",
"tensorflow.io.TFRecordWriter"
]
] |
jubick1337/NeMo | [
"9d50733ba0e698b98d0019e9e697686e0a24b90e"
] | [
"scripts/nlp_language_modeling/build_knn_map_index.py"
] | [
"# Copyright (c) 2022, NVIDIA CORPORATION. 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 re... | [
[
"numpy.array",
"numpy.ones_like",
"numpy.zeros"
]
] |
FilthyFrankTheGoanimator/Voice | [
"0bf3570bd6b376c936ea9f04fc15f129e738b168"
] | [
"synthesis/vocoders/hifigan.py"
] | [
"import json\nimport torch\n\nfrom synthesis.vocoders.hifigan_model import Generator\nfrom synthesis.vocoders.vocoder import Vocoder, MAX_WAV_VALUE\n\n\nclass AttrDict(dict):\n \"\"\"\n Credit: https://github.com/jik876/hifi-gan\n \"\"\"\n\n def __init__(self, *args, **kwargs):\n super(AttrDict, ... | [
[
"torch.device",
"torch.no_grad",
"torch.cuda.is_available",
"torch.load"
]
] |
tusikalanse/Machine-Learning-for-Software-Engineers | [
"59415e2db98ba2a1d97a55560d1c0cb8567b1725"
] | [
"Data-Analysis/Fliters.py"
] | [
"import pandas as pd\n\ndf = pd.DataFrame({\n 'playerID': ['bettsmo01', 'canoro01', 'cruzne02', 'ortizda01', 'bettsmo01'],\n 'yearID': [2016, 2016, 2016, 2016, 2015],\n 'teamID': ['BOS', 'SEA', 'SEA', 'BOS', 'BOS'],\n 'HR': [31, 39, 43, 38, 18]})\n\nprint(df['HR'] > 40)\n# 0 False\n# 1 False\n# 2 True... | [
[
"pandas.DataFrame"
]
] |
wannaphongcom/numfa_server | [
"717ed6cf673f93eb714e6d915d868d0acd30e85e"
] | [
"framework/new/dl2.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport os\nimport numpy as np\nimport pickle\nfrom keras.models import Sequential\nfrom pythainlp.word_vector import thai2vec\nfrom keras.layers.recurrent import LSTM,SimpleRNN\nfrom sklearn.model_selection import train_test_split\n\nwith open(\"db.pickle\", 'rb') as f:\n vec_x,vec_y=... | [
[
"sklearn.model_selection.train_test_split",
"numpy.array"
]
] |
ssdavidson/reddit_incivility | [
"650e4ce9c5e1b1f37fe421eeab4f2643a5f3930e"
] | [
"log_regression/run_regression_large2.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.linear_model.logistic import LogisticRegression\n#from sklearn.externals import joblib\nfrom sklearn.model_selection import train_test_split, cross_val_score\nimport csv, pickle, time, sys\n#import sp... | [
[
"pandas.DataFrame",
"torch.utils.data.DataLoader"
]
] |
pgruening/dl_bio_example | [
"7af124df5b2dd4e6cc63d90f4e75680a187fc98c"
] | [
"experiments/model_search/exe_evaluate_model_search.py"
] | [
"from DLBio.helpers import MyDataFrame, search_rgx, load_json, check_mkdir\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom os.path import join\nfrom DLBio.kwargs_translator import get_kwargs\n\nBASE_FOLDER = 'experiments/model_search' # the folder of the experiment\nMODEL_FOLDER = join(BASE_FOLDER, '... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tight_layout"
]
] |
Sirish07/opencv | [
"4b6047e746f06ce3e595c886cf6c0266498c6a67"
] | [
"apps/opencv_stitching_tool/opencv_stitching/camera_adjuster.py"
] | [
"from collections import OrderedDict\nimport cv2 as cv\nimport numpy as np\n\nfrom .stitching_error import StitchingError\n\n\nclass CameraAdjuster:\n \"\"\"https://docs.opencv.org/master/d5/d56/classcv_1_1detail_1_1BundleAdjusterBase.html\"\"\" # noqa\n\n CAMERA_ADJUSTER_CHOICES = OrderedDict()\n CAMERA_... | [
[
"numpy.zeros"
]
] |
jsa214/CogAlg | [
"ca7d03c392f423fd4e3be9fa7a546bf3c4098621"
] | [
"frame_2D_alg/intra_blob_debug.py"
] | [
"import numpy as np\nimport numpy.ma as ma\nfrom comp_angle import comp_angle\nfrom comp_deriv import comp_deriv\nfrom comp_range import comp_range\n# from comp_P_ import comp_P_\nfrom filters import get_filters\nget_filters(globals()) # imports all filters at once\nfrom generic_branch import master_blob\n\n'''\n ... | [
[
"numpy.ma.array",
"numpy.hypot",
"numpy.logical_and"
]
] |
andriiaprysiazhnyk/brats_competition | [
"c2fa999c3458a118ca5c5fe81a37a74ef664fef3",
"c2fa999c3458a118ca5c5fe81a37a74ef664fef3"
] | [
"brats_competition/model_training/common/adapters/base.py",
"brats_competition/model_training/common/models/models_3d/nnutils.py"
] | [
"import torch\nfrom collections import OrderedDict\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom ..models import get_network\nfrom ..metrics import get_metric\nfrom ..losses import get_loss\nfrom ..augmentations import denormalization\n\n__all__ = ['ModelAdapter']\n\n\nclass ModelAdapter:\n def __in... | [
[
"torch.utils.tensorboard.SummaryWriter",
"torch.nn.DataParallel"
],
[
"torch.nn.ReLU",
"torch.nn.GroupNorm",
"torch.nn.Conv3d"
]
] |
braveld/ConvNetWord | [
"6adf8788528fa262d8727763f147c5118b05048f"
] | [
"sentence_convnet_final.py"
] | [
"__author__ = 'mangate'\n\nimport cPickle\nfrom model import Model\nimport process_data_mr\nimport process_data_tweets\nimport process_data_sst1\nimport process_data_sst2\nimport process_data_subj\nimport process_data_trec\nimport process_data_politeness2\nimport process_data_opi\nimport process_data_irony\nimport ... | [
[
"tensorflow.flags.DEFINE_boolean"
]
] |
worldlove521/Paddle | [
"c7f1f3ed0c897073cc7ae8ec60a13a8217dffe7d"
] | [
"python/paddle/fluid/executor.py"
] | [
"# Copyright (c) 2018 PaddlePaddle 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 ... | [
[
"numpy.array"
]
] |
podondra/roboschool-rl | [
"2e6d6b1302eaa9aea12ebd81e2ad7a22d29a8d69"
] | [
"classic/cem.py"
] | [
"# inspired by\n# http://rl-gym-doc.s3-website-us-west-2.amazonaws.com/mlss/lab1.html\nimport numpy\n\n\nclass LinearPolicy:\n def __init__(self, theta, env):\n obs_dim = env.observation_space.shape[0]\n act_dim = env.action_space.n\n self.W = theta[:obs_dim * act_dim].reshape(obs_dim, act_d... | [
[
"numpy.max",
"numpy.random.normal",
"numpy.dot",
"numpy.zeros",
"numpy.ones",
"numpy.mean",
"numpy.argsort"
]
] |
marcobarilari/pybids | [
"ce98ad8fee0ed19518a7b9ba48aec5eed13a4783"
] | [
"bids/layout/tests/test_models.py"
] | [
"\"\"\"Tests of functionality in the models module.\"\"\"\n\nimport sys\nimport os\nimport pytest\nimport copy\nimport json\nfrom pathlib import Path\n\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker\nimport numpy as np\n\nfrom bids.layout.models import (BIDSFile, Entity, Tag, Base, C... | [
[
"numpy.allclose"
]
] |
sgkang/empymod | [
"c8fd726fdbae0788da2cdbb88e77c8b81edd37dc"
] | [
"tests/create_data/kernel.py"
] | [
"\"\"\"Create data for kernel tests. Kernel tests are just securing status quo.\"\"\"\nimport numpy as np\nfrom copy import deepcopy\nfrom scipy.constants import mu_0, epsilon_0\nfrom empymod import kernel, filters\n\n# All possible (ab, msrc, mrec) combinations\npab = (np.arange(1, 7)[None, :] + np.array([10, 20, ... | [
[
"numpy.array",
"numpy.savez_compressed",
"numpy.arange",
"numpy.sqrt",
"numpy.outer"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.