repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
cnk113/TREX
[ "add83d8108f3602c5bbe7b37f60ff19f89b2236d" ]
[ "src/trex/writers.py" ]
[ "from pathlib import Path\nfrom typing import List\nfrom .cell import Cell\nimport operator\nimport warnings\n\nwith warnings.catch_warnings():\n warnings.filterwarnings(\"ignore\", \"Conversion of the second argument of issubdtype\")\n import loompy\nimport numpy as np\n\n\ndef write_count_matrix(path: Path,...
[ [ "numpy.array" ] ]
18621579069/PaddleHub-yu
[ "47741382cf15eda852fefdada6ce83ef86350af6", "15e8bcef2addf239081e235bdcfd039de12330e0" ]
[ "paddlehub/contrib/ppdet/data/source/simple_source.py", "hub_module/modules/text/semantic_model/slda_news/util.py" ]
[ "# Copyright (c) 2019 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 re...
[ [ "numpy.array" ], [ "numpy.random.uniform", "numpy.random.seed" ] ]
mcoughlin/PypeIt
[ "9aa1d10633faf3d73135e1a1c94b1cd18c7058e0" ]
[ "pypeit/core/gui/identify.py" ]
[ "import os\nimport copy\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom matplotlib.lines import Line2D\nfrom matplotlib.colors import LinearSegmentedColormap, Normalize\nfrom matplotlib.cm import ScalarMappable\nimport matplotlib.transforms as mtransforms\nfrom matplotlib.widgets impor...
[ [ "matplotlib.widgets.Button", "numpy.copy", "matplotlib.colors.LinearSegmentedColormap.from_list", "matplotlib.pyplot.axes", "matplotlib.pyplot.subplots_adjust", "numpy.polyfit", "numpy.polyval", "matplotlib.colors.Normalize", "numpy.argmin", "numpy.abs", "numpy.where", ...
JerBouma/OpenBBTerminal
[ "0c60d70cb29b0a6e4db41d6dd0d34f79a6169b27" ]
[ "openbb_terminal/cryptocurrency/overview/coinpaprika_view.py" ]
[ "\"\"\"CoinPaprika view\"\"\"\n__docformat__ = \"numpy\"\n\nimport logging\nimport os\n\nfrom pandas.plotting import register_matplotlib_converters\n\nimport openbb_terminal.cryptocurrency.overview.coinpaprika_model as paprika\nfrom openbb_terminal.cryptocurrency.dataframe_helpers import (\n lambda_long_number_f...
[ [ "pandas.plotting.register_matplotlib_converters" ] ]
haesleinhuepf/pyclesperanto_prototype
[ "65bc3035d3b2b61a2722c93b95bae310bfbd190e" ]
[ "pyclesperanto_prototype/_tier8/_affine_transform.py" ]
[ "from typing import Union\n\nfrom .._tier0 import plugin_function\nfrom .._tier0 import Image\nfrom .._tier0 import push\nfrom ._AffineTransform3D import AffineTransform3D\nfrom skimage.transform import AffineTransform\nimport numpy as np\n\n@plugin_function\ndef affine_transform(source : Image, destination : Image...
[ [ "numpy.linalg.inv", "numpy.asarray" ] ]
tourdeml/SAM
[ "08cb3cccb39157859a1c77ef1e1852120df4a790" ]
[ "sam/utils.py" ]
[ "from typing import Iterable, Callable\n\nimport torch\nfrom torch.optim import Optimizer\n\n\ndef compute_sam(group: dict, closure: Callable):\n grads = []\n params_with_grads = []\n\n rho = group['rho']\n # update internal_optim's learning rate\n\n for p in group['params']:\n if p.grad is no...
[ [ "torch._foreach_mul_", "torch._foreach_add_", "torch._foreach_sub_" ] ]
andrewor14/benchmarks
[ "cb2457bbda6138b3e0af95a6d50b7d476d52c410" ]
[ "scripts/tf_cnn_benchmarks/models/ssd_model.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.reshape", "tensorflow.variable_scope", "tensorflow.squeeze", "tensorflow.concat", "tensorflow.nn.softmax", "tensorflow.reduce_sum", "tensorflow.split", "tensorflow.contrib.framework.argsort", "tensorflow.multiply", "tensorflow.losses.sparse_softmax_cross_entropy...
Nagasaki45/deep_disfluency
[ "4c57a194433af9601ebef0e4c9a451cce4c06252" ]
[ "deep_disfluency/rnn/elman.py" ]
[ "import theano\nimport numpy as np\nimport os\n\nfrom theano import tensor as T\nfrom collections import OrderedDict\n\n# nb might be theano.config.floatX\ndtype = T.config.floatX # @UndefinedVariable\n\n\nclass Elman(object):\n\n def __init__(self, ne, de, na, nh, n_out, cs, npos,\n update_embe...
[ [ "numpy.random.uniform", "numpy.asarray", "numpy.zeros" ] ]
mrakitin/xrt
[ "a2d09296860386ed3a83cea45ab43e7959e58f33" ]
[ "xrt/runner.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nModule :mod:`runner` defines the entry point of xrt - :func:`run_ray_tracing`,\ncontainers for job properties and functions for running the processes or\nthreads and accumulating the resulting histograms.\n\"\"\"\n__author__ = \"Konstantin Klementiev, Roman Chernikov\"\n__date__ = ...
[ [ "numpy.concatenate", "matplotlib.pyplot.show", "matplotlib.pyplot.get_backend", "numpy.long" ] ]
luckykamon/Morpion
[ "a4da849a354c542fc5a79a3742a86b040df7e016" ]
[ "create_image/white.py" ]
[ "import imageio\nimport matplotlib.pyplot as plt\nimport Image\nimport numpy as np\n\nim = Image.new(\"RGB\", (65,65), \"white\")\npic = np.array(im)\nim=pic\nimageio.imsave(\"white.png\", im)\n\n" ]
[ [ "numpy.array" ] ]
faymek/compression
[ "20c6745b741e266f7118e6b3fc88d22f6179cfdf" ]
[ "examples/varate.py" ]
[ "#%%\n\"\"\"\nbmshj2018\n\n\"\"\"\n\nimport argparse\nimport glob\nimport sys\n\nfrom absl import app\nfrom absl.flags import argparse_flags\nimport numpy as np\nimport tensorflow.compat.v1 as tf\n\nimport tensorflow_compression as tfc\nfrom dynamic import *\n\n\nSCALES_MIN = 0.11\nSCALES_MAX = 256\nSCALES_LEVELS =...
[ [ "tensorflow.compat.v1.train.MonitoredTrainingSession", "tensorflow.compat.v1.train.StopAtStepHook", "tensorflow.compat.v1.log", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.compat.v1.expand_dims", "numpy.log", "tensorflow.compat.v1.image.psnr", "tensorflow.compat.v1.shap...
szokejokepu/natural-rws
[ "bb1ad4ca3ec714e6bf071d2136593dc853492b68" ]
[ "core/argo/core/network/MultivariateNormalTriL.py" ]
[ "import tensorflow as tf\nfrom tensorflow_probability import distributions as tfd\nfrom functools import partial\nfrom .AbstractGaussianSimple import AbstractGaussianSimple\nimport types\nimport sonnet as snt\n\nclass MultivariateNormalTriL(AbstractGaussianSimple):\n\n def __init__(self,\n output...
[ [ "tensorflow.pad", "tensorflow.contrib.distributions.fill_triangular", "tensorflow.layers.flatten", "tensorflow.multiply", "tensorflow.initializers.constant", "tensorflow.linalg.set_diag", "tensorflow.nn.softplus" ] ]
cristhiandcl/AD-DL
[ "b7abb3fe619e736b269067033ba4aad1f03cf3b8" ]
[ "clinicadl/clinicadl/tools/tsv/tsv_utils.py" ]
[ "# coding: utf8\n\nfrom copy import copy\nimport numpy as np\nimport pandas as pd\nfrom os import path\n\n\ndef neighbour_session(session, session_list, neighbour):\n if session not in session_list:\n temp_list = session_list + [session]\n temp_list.sort()\n else:\n temp_list = copy(sessi...
[ [ "scipy.stats.chisquare", "pandas.DataFrame", "pandas.concat", "numpy.array", "numpy.concatenate", "numpy.unique" ] ]
jeetbanik/Corona-Real-Time-Face-Mask-and-Keypoints-Detection
[ "3232f5d7b84fffcc61c2bb84d1b5109154bcc6bb" ]
[ "Testing Model Including Facial Keypoints.py" ]
[ "import numpy as np\nfrom PIL import Image\nimport cv2\nfrom model import Net\nimport torch\nfrom torchvision import transforms\nfrom mtcnn import MTCNN\n\ndef LoadModel(fpath):\n '''\n function to load saved model\n '''\n c = torch.load(fpath, map_location='cpu')\n model = c['model']\n model.load...
[ [ "torch.load", "torch.cuda.is_available", "torch.from_numpy", "torch.max", "numpy.array" ] ]
KarthikKothareddy/AirFlow
[ "faaf0b8b4467bcf5bff4a5b49086a9e02cb9c112" ]
[ "tests/core.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in wri...
[ [ "numpy.testing.assert_array_almost_equal" ] ]
fheyen/ClaVis
[ "528ca85dd05606d39761b5a00d755500cf1cd2f6" ]
[ "backend/modules/classifiers/cifar10_cnn/__init__.py" ]
[ "import numpy\nimport keras\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Activation, Flatten\nfrom keras.layers import Conv2D, MaxPooling2D\nfrom keras.callbacks import EarlyStopping\nimport os\nfrom ...tools import check_ar...
[ [ "numpy.random.seed" ] ]
Tianxiaomo/ROI
[ "8422716605f846c6f4276051a9738cb6c162611d" ]
[ "roi/layers/nms.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport torch\nfrom torchvision.ops import boxes as box_ops\nfrom torchvision.ops import nms # BC-compat\n\n\ndef batched_nms(boxes, scores, idxs, iou_threshold):\n \"\"\"\n Same as torchvision.ops.boxes.batche...
[ [ "torch.empty", "torch.min", "torch.unique", "torch.max" ] ]
xmengxin/MFGR
[ "ba807d0f52c0eb00d330eaa9bcef56c1343d2588" ]
[ "models/dcgan_conv.py" ]
[ "import torch\nimport torch.nn as nn\n\n\n# custom weights initialization called on netG and netD\ndef weights_init(m):\n classname = m.__class__.__name__\n if classname.find('Conv') != -1:\n nn.init.normal_(m.weight.data, 0.0, 0.02)\n elif classname.find('BatchNorm') != -1:\n nn.init.normal_...
[ [ "torch.nn.BatchNorm2d", "torch.nn.Linear", "torch.randint", "torch.nn.init.constant_", "torch.nn.Dropout2d", "torch.randn", "torch.flatten", "torch.nn.init.normal_", "torch.nn.Tanh", "torch.nn.Upsample", "torch.nn.Conv2d", "torch.nn.Sigmoid", "torch.nn.LeakyReLU...
hiagopinacio/ross
[ "1bc84061f23df455d9e37cb11b244ac795c836ad" ]
[ "ross/api_report.py" ]
[ "# fmt: off\nfrom copy import copy, deepcopy\n\nimport numpy as np\nimport pandas as pd\nfrom plotly import express as px\nfrom plotly import graph_objects as go\nfrom plotly.subplots import make_subplots\nfrom scipy.interpolate import interp1d\nfrom scipy.signal import argrelextrema\n\nfrom ross.bearing_seal_eleme...
[ [ "numpy.sum", "scipy.interpolate.interp1d", "scipy.signal.argrelextrema", "numpy.transpose", "numpy.append", "numpy.argmin", "numpy.cos", "numpy.log10", "numpy.delete", "numpy.where", "numpy.round", "numpy.linspace", "numpy.mean", "numpy.argmax", "pandas....
dimitymiller/cac-openset
[ "b07dadbb8caa5d7430c403734f6543ff17e2ae11" ]
[ "datasets/generate_trainval_splits.py" ]
[ "\"\"\"\n\tRandomly select train and validation subsets from training datasets.\n\t80/20 split ratio used for all datasets except TinyImageNet, which will use 90/10.\n\n\tDimity Miller, 2020\n\"\"\"\n\nimport json\nimport random\nimport torchvision\nimport numpy as np\n\nrandom.seed(1000)\n\ndef save_trainval_split...
[ [ "numpy.unique" ] ]
Pandinosaurus/depthai
[ "a46ad95744d8175f1c87bf8cd92c7423a84b8607" ]
[ "depthai_profiler.py" ]
[ "#!/usr/bin/env python3\n\n#depthai function profiler\nimport subprocess\nimport sys\nimport numpy as np\n\n#this is a debugging tool, that's why it's not added to requirements.txt\ntry:\n import snakeviz\nexcept ImportError:\n raise ImportError('\\033[1;5;31m snakeviz module not found, run: \\033[0m python3 ...
[ [ "numpy.concatenate" ] ]
IJSComplexMatter/cddm
[ "f4d7521ad88271027c61743b2e8a2355a40cb117" ]
[ "examples/paper/plot_error.py" ]
[ "\"\"\"Plots fig 3. and fig 4. from the paper.\n\nYou must first create data calling the following scripts:\n \n$ python auto_correlate_random_error.py\n$ python auto_correlate_standard_error.py\n$ python auto_correlate_fast_error.py\n$ python cross_correlate_error.py\n\n\"\"\"\n\nfrom cddm.sim import random_tim...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "numpy.arange", "matplotlib.pyplot.subplot", "matplotlib.pyplot.show", "numpy.sqrt" ] ]
panpanyunshi/rlkit
[ "e1f6c9e59ab2baab93d35385cdc43ab3632b2b65" ]
[ "rlkit/torch/core.py" ]
[ "import numpy as np\nimport torch\n\nfrom rlkit.torch import pytorch_util as ptu\n\n\ndef eval_np(module, *args, **kwargs):\n \"\"\"\n Eval this module with a numpy interface, 返回numpy类型变量\n\n Same as a call to __call__ except all Variable input/outputs are\n replaced with numpy equivalents.\n\n Assum...
[ [ "numpy.dtype" ] ]
asaran/decision-transformer
[ "f6f8bf283256d616d213ac5bd07cb7f3efb101b3" ]
[ "gym/decision_transformer/models/decision_transformer.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\n\nimport transformers\n\nfrom decision_transformer.models.model import TrajectoryModel\nfrom decision_transformer.models.trajectory_gpt2 import GPT2Model\n\n\nclass DecisionTransformer(TrajectoryModel):\n\n \"\"\"\n This model uses GPT to model (Return...
[ [ "torch.ones", "torch.stack", "torch.nn.Linear", "torch.nn.Embedding", "torch.nn.Tanh", "torch.nn.LayerNorm", "torch.zeros" ] ]
elwintay/clearml_test
[ "c87985303e69490e83ec779d098570bc505f80ae" ]
[ "model_gtt/run_pl_gtt.py" ]
[ "import argparse\nimport glob\nimport pandas as pd\nimport logging\nimport os\nimport json\nfrom collections import OrderedDict\nfrom eval import eval_tf\n\nimport numpy as np\nimport torch\nfrom seqeval.metrics import f1_score, precision_score, recall_score, accuracy_score\nfrom torch.nn import CrossEntropyLoss\nf...
[ [ "torch.stack", "torch.load", "torch.nn.Softmax", "torch.save", "torch.tensor", "numpy.argmax", "torch.nn.CrossEntropyLoss", "torch.utils.data.TensorDataset", "torch.topk", "torch.cuda.is_available", "torch.index_select", "numpy.concatenate", "torch.bmm", "to...
simonsimon006/tensorflow-wavelets
[ "21a095bf0048ae2488ca5ae4961d2cbfe94263a9" ]
[ "Development/models/DWT2.py" ]
[ "import os\nimport cv2\nimport math\nimport pywt\nimport numpy as np\nfrom utils import mse\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nfrom tensorflow.keras.datasets import mnist, cifar10\n\n# os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # for tensor flow warning\n# os...
[ [ "tensorflow.pad", "tensorflow.stack", "tensorflow.add_n", "tensorflow.reshape", "tensorflow.keras.Sequential", "tensorflow.expand_dims", "tensorflow.zeros_like", "tensorflow.nn.conv2d", "numpy.int32", "tensorflow.repeat", "numpy.expand_dims", "tensorflow.keras.layer...
chetansurwade/great_expectations
[ "f488d861f3c00c73a6181d6bd5788fb8895079d9" ]
[ "tests/conftest.py" ]
[ "import datetime\nimport locale\nimport logging\nimport os\nimport random\nimport shutil\nimport sys\nimport warnings\nfrom typing import Dict, List, Optional\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom freezegun import freeze_time\nfrom ruamel.yaml import YAML\n\nimport great_expectations as ge...
[ [ "pandas.read_csv", "pandas.DataFrame", "numpy.random.normal" ] ]
drudd/pandas
[ "99922b9175c4ca6acb0f42dd17c01c507cbd94d6" ]
[ "pandas/core/algorithms.py" ]
[ "\"\"\"\nGeneric data algorithms. This module is experimental at the moment and not\nintended for public consumption\n\"\"\"\nfrom __future__ import division\nfrom warnings import warn\nimport numpy as np\n\nimport pandas.core.common as com\nimport pandas.algos as algos\nimport pandas.hashtable as htable\nimport pa...
[ [ "pandas.hashtable.value_count_int64", "pandas.core.common.isnull", "pandas.hashtable.mode_int64", "numpy.asarray", "pandas.hashtable.mode_object", "pandas.core.common._asarray_tuplesafe", "numpy.isscalar", "pandas.core.common.is_float_dtype", "pandas.algos.arrmap_float64", ...
flaght/zipline
[ "15b8832421e2b1ba98ec9938ceb794f64ad581b5", "0848a8a4862fd8bbe7ba64654e6bc731b4b622b7" ]
[ "tests/test_perf_tracking.py", "tests/test_api_shim.py" ]
[ "#\n# Copyright 2016 Quantopian, Inc.\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...
[ [ "numpy.testing.assert_allclose", "numpy.array", "pandas.Timestamp", "numpy.float64", "pandas.DataFrame.from_dict" ], [ "numpy.arange", "pandas.Timestamp", "numpy.testing.assert_array_equal" ] ]
steven-murray/powerbox
[ "09809f3fe9e2b25dfb2f956ca4c2d4d40a0ac693" ]
[ "tests/test_power.py" ]
[ "import numpy as np\nimport os\nimport inspect\nimport sys\n\nLOCATION = \"/\".join(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))).split(\"/\")[:-1])\nsys.path.insert(0, LOCATION)\n\nfrom powerbox import PowerBox, get_power\n\n\ndef test_power1d():\n p = [0] * 40\n for i in range(40...
[ [ "numpy.array", "numpy.allclose", "numpy.all", "numpy.ones_like" ] ]
jesserobertson/cogj
[ "25f1d85023764ef0cc459a8a715b1b678f971858" ]
[ "setup_extensions.py" ]
[ "\"\"\" file: setup_extensions.py (cogj)\n author: Jess Robertson, @jesserobertson\n date: Saturday, 16 March 2019\n\n description: Set up Cython extensions for CO-GJ\n\"\"\"\n\nfrom pathlib import Path\nfrom logging import getLogger\nfrom multiprocessing import cpu_count\n\nimport numpy\nfrom setup...
[ [ "numpy.get_include" ] ]
CAVED123/Tensorforce
[ "823177f77f9047b1e71eccfffc08315ed1636878" ]
[ "tensorforce/core/optimizers/solvers/line_search.py" ]
[ "# Copyright 2018 Tensorforce Team. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b...
[ [ "tensorflow.abs", "tensorflow.maximum", "tensorflow.control_dependencies", "tensorflow.math.logical_and" ] ]
spirit-code/aiida-spirit
[ "7a0c0ca7406f958599b691a410201137f9fb94e9" ]
[ "tests/test_calculations.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\" Tests for calculations\n\n\"\"\"\nimport os\nimport numpy as np\nfrom aiida.plugins import CalculationFactory\nfrom aiida.orm import Dict\nfrom aiida.engine import run, run_get_node\nfrom aiida_spirit.tools.helpers import prepare_test_inputs\n\nfrom . import TEST_DIR\n\n\ndef test_i...
[ [ "numpy.std", "numpy.mean" ] ]
heather999/lenstronomy
[ "8102fe026c1f3ba6e81d8a1f59cceb90e68430b4" ]
[ "lenstronomy/ImSim/differential_extinction.py" ]
[ "from lenstronomy.LightModel.light_model import LightModel\nimport numpy as np\n\n__all__ = ['DifferentialExtinction']\n\n\nclass DifferentialExtinction(object):\n \"\"\"\n class to compute an extinction (for a specific band/wavelength). This class uses the functionality available in\n the LightModel modul...
[ [ "numpy.exp" ] ]
forestriveral/floris
[ "02c31e121283ad6ccae987cfa3aa1bf1e4b43014" ]
[ "examples/visualization/subtract_inflow.py" ]
[ "# Copyright 2021 NREL\n\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the License. You may obtain a copy of\n# the License at http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, soft...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
ConsenSys/handel
[ "bc3f6f8194db140a1067ab157fc6bb1fb53a0144" ]
[ "simul/plots/failing_time.py" ]
[ "#!/usr/bin/env python\n\n## This script generate the graphs that compares handel signature \n## generation with different number of failing nodes for a fixed \n## number of total nodes, and a fixed threshold 51%\n##\nimport sys\n\nimport matplotlib.pyplot as plt\nimport pandas as pd\nplt.figure(figsize=(4,2))\nfro...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ] ]
sakibguy/models
[ "7214e17eb425963ec3d0295be215d5d26deaeb32" ]
[ "official/nlp/tools/export_tfhub_lib_test.py" ]
[ "# Copyright 2022 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.io.gfile.GFile", "numpy.ones_like", "tensorflow.executing_eagerly", "tensorflow.RaggedTensorSpec", "tensorflow.ragged.constant", "tensorflow.Graph", "tensorflow.constant", "tensorflow.test.main", "tensorflow.saved_model.load", "tensorflow.compat.v1.Session", ...
good5dog5/Speaker-Diarization
[ "4cc38f77a2f2c24ce086323aa37098f6cd0f7f10" ]
[ "ghostvlad/generate_embeddings.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import print_function\nimport os\nimport sys\nimport numpy as np\nimport librosa\n\nimport toolkits\nimport random\n\n# ===========================================\n# Parse the argument\n# ===========================================\nimport argparse\np...
[ [ "numpy.savez", "numpy.expand_dims", "numpy.array", "numpy.std", "numpy.concatenate", "numpy.random.randint", "numpy.linalg.norm", "numpy.unique", "numpy.mean" ] ]
fzyzcjy/ncnn
[ "42e71609508fde1bd54d9d9de6ca5522ee3bcf37" ]
[ "tools/pnnx/tests/test_nn_BatchNorm2d.py" ]
[ "# Tencent is pleased to support the open source community by making ncnn available.\n#\n# Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n#\n# Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\n# in compliance with the License. You may obtain a...
[ [ "torch.nn.BatchNorm2d", "torch.manual_seed", "torch.rand", "torch.equal", "torch.jit.trace" ] ]
ofgulban/iphigen
[ "47c972a5852677e01ab0b120f69d004abc57e478" ]
[ "iphigen/iphigen_nifti.py" ]
[ "\"\"\"MRI data processing with retinex and balance methods.\"\"\"\n\nfrom __future__ import division\nimport os\nimport numpy as np\nimport nibabel as nb\nfrom iphigen import core, utils\nfrom iphigen.ui import user_interface, display_welcome_message\nimport iphigen.config as cfg\n\n\ndef main():\n \"\"\"Iphige...
[ [ "numpy.sum", "numpy.asarray" ] ]
johnruth96/privacy-justifiable-fairness
[ "3f5ae92d791df1827cbc8720cf5e7aa33ceed7aa" ]
[ "experiments/evaluate.py" ]
[ "import os\n\nimport pandas as pd\n\nfrom experiments.conf import Config\nfrom fairness import measure_fairness\nfrom privacy.models import get_l_distinct, get_k\n\n\ndef evaluate_experiment(conf: Config):\n # Load setup\n setup = conf.get_setup()\n A = setup[\"A\"]\n I = setup[\"I\"]\n O = setup[\"O...
[ [ "pandas.read_csv", "pandas.MultiIndex.from_tuples" ] ]
Yidansong/SchNet
[ "49a1e6031f50d79a83ea21148b8e8cbcabdaabb7" ]
[ "src/schnet/nn/utils.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.ops.array_grad import _TileGrad\nfrom tensorflow.python.framework import ops\n\n\ndef shape(x):\n if isinstance(x, tf.Tensor):\n return x.get_shape().as_list()\n return np.shape(x)\n\n\n@ops.RegisterGradient(\"TileDense\")\ndef tile_g...
[ [ "tensorflow.python.ops.array_grad._TileGrad", "numpy.shape", "tensorflow.python.framework.ops.RegisterGradient", "tensorflow.convert_to_tensor" ] ]
Banconxuan/RTS3D
[ "6d2738501eaf90f019eeaa22254cd9756f8d3364" ]
[ "src/lib/models/embedding_space_generater.py" ]
[ "# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Bin Xiao (Bin.Xiao@microsoft.com)\n# Modified by Xingyi Zhou\n# ------------------------------------------------------------------------------\n\nfrom __futur...
[ [ "torch.stack", "torch.nonzero", "torch.linspace", "torch.exp", "torch.norm", "torch.nn.functional.grid_sample", "torch.meshgrid", "torch.cat" ] ]
FelixNeutatz/auto-sklearn
[ "b5d141603332041475ed746aa1640334f5561aea" ]
[ "autosklearn/pipeline/components/data_preprocessing/imputation/categorical_imputation.py" ]
[ "from ConfigSpace.configuration_space import ConfigurationSpace\nfrom autosklearn.pipeline.components.base import AutoSklearnPreprocessingAlgorithm\nfrom autosklearn.pipeline.constants import DENSE, SPARSE, UNSIGNED_DATA, INPUT\nfrom ConfigSpace.hyperparameters import CategoricalHyperparameter, UniformIntegerHyperp...
[ [ "numpy.unique", "sklearn.model_selection.train_test_split" ] ]
helloworldpark/PyEMD
[ "d28481b3244f317c196dbfe92af7e2d776b64382" ]
[ "PyEMD/EMD_matlab.py" ]
[ "#!/usr/bin/python\r\n# coding: UTF-8\r\n#\r\n# Author: Dawid Laszuk\r\n# Contact: laszukdawid@gmail.com\r\n#\r\n# Edited: 11/05/2017\r\n#\r\n# Feel free to contact for any information.\r\n\r\nfrom __future__ import division, print_function\r\n\r\nimport logging\r\nimport numpy as np\r\nimport time\r\n\r\nfrom...
[ [ "numpy.save", "scipy.interpolate.interp1d", "numpy.diff", "numpy.any", "numpy.append", "numpy.abs", "numpy.cos", "numpy.where", "numpy.round", "numpy.nonzero", "numpy.linspace", "numpy.mean", "numpy.ceil", "numpy.zeros", "numpy.array", "numpy.linalg....
simpla-fusion/spdb
[ "be6667eb6c7d464f68b0fd51ca2a8f021581eb84" ]
[ "examples/obsolete/putslice_eq.py" ]
[ "# Definition of the class structures in file imas.py\nimport imas\nimport numpy\nimport sys\nimport os\n\n'''\nThis sample program will create a pulse file (shot 13, run 1) and will\nput an example of equilibirium IDS using put_slice methods.\n'''\n\n# This routine reads an array of pfsystems IDSs in the database,...
[ [ "numpy.empty", "numpy.zeros" ] ]
ChuanTianML/learn_gnmt
[ "19e97e04feaecd7682abaf6247a0f9e3f37f9892" ]
[ "nmt/utils/common_test_utils.py" ]
[ "# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.python.ops.lookup_ops.index_table_from_tensor", "tensorflow.constant", "tensorflow.python.ops.lookup_ops.index_to_string_table_from_tensor" ] ]
floyebolu/GPy
[ "d493b200642196c6d211ea1bcb052f3fbf396f24" ]
[ "GPy/plotting/gpy_plot/latent_plots.py" ]
[ "#===============================================================================\n# Copyright (c) 2015, Max Zwiessele\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 conditions are met:\n#\n# * Redistributio...
[ [ "numpy.ones", "numpy.zeros", "numpy.argmax", "numpy.log", "numpy.array", "numpy.unique" ] ]
swpucwf/Deeplearning
[ "be19885d52b7ce8782949d931a1b2994de36679f" ]
[ "OpenCV/video_flow.py" ]
[ "import numpy as np\nimport cv2\n\ncap = cv2.VideoCapture('car.mp4')\n\n# params for ShiTomasi corner detection\nfeature_params = dict(maxCorners=100,\n qualityLevel=0.3,\n minDistance=7,\n blockSize=7)\n\n# Parameters for lucas kanade optical flow\nlk_...
[ [ "numpy.zeros_like", "numpy.random.randint" ] ]
vita-epfl/pedestrian-transition-dataset
[ "7e1b723a37289850b5ef8628e6881845a24912f9" ]
[ "src/dataset/loader.py" ]
[ "import os\nimport copy\nimport PIL\nimport torch\nimport torchvision\nimport numpy as np\nimport math\n\nimport logging\nfrom typing import List\n\nLOG = logging.getLogger(__name__)\n\n\ndef define_path(use_jaad=True, use_pie=True, use_titan=True):\n \"\"\"\n Define the correct paths to datasets'annotations ...
[ [ "torch.zeros", "torch.rand", "torch.stack", "torch.tensor" ] ]
mizolotu/DonkeyCarExperiments
[ "3d6be742915efe51c0f5abda4c69a4349a555373" ]
[ "reinforcement_learning/her/utils.py" ]
[ "from collections import OrderedDict\n\nimport numpy as np\nfrom reinforcement_learning.gym import spaces\n\n# Important: gym mixes up ordered and unordered keys\n# and the Dict space may return a different order of keys that the actual one\nKEY_ORDER = ['observation', 'achieved_goal', 'desired_goal']\n\n\nclass HE...
[ [ "numpy.concatenate" ] ]
JuliaChae/faster-rcnn.pytorch
[ "220005b5dbed1dd7e5abcfb85eee9f976a8a5f58" ]
[ "lib/detection_metric/Evaluator.py" ]
[ "###########################################################################################\n# #\n# Evaluator class: Implements the most popular metrics for object detection #\n# ...
[ [ "numpy.sum", "matplotlib.pyplot.legend", "numpy.cumsum", "numpy.divide", "numpy.argwhere", "numpy.zeros", "matplotlib.pyplot.pause", "matplotlib.pyplot.grid", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.close", "matplotlib.pyplot.plot", ...
mindspore-ai/models
[ "9127b128e2961fd698977e918861dadfad00a44c", "9127b128e2961fd698977e918861dadfad00a44c", "9127b128e2961fd698977e918861dadfad00a44c" ]
[ "official/nlp/transformer/export.py", "research/cv/meta-baseline/preprocess.py", "research/cv/ras/src/resnet50.py" ]
[ "# Copyright 2020-2022 Huawei Technologies Co., Ltd\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 applica...
[ [ "numpy.ones" ], [ "numpy.save", "numpy.random.seed" ], [ "numpy.sqrt", "numpy.ones", "numpy.zeros" ] ]
PPACI/Devoxx19-TensorflowJS
[ "4096c8ea460af8a9f8a36df01e88309568318ab8" ]
[ "python/02_train.py" ]
[ "from PIL import Image\nimport numpy\nfrom tensorflow.python.keras.preprocessing.image import ImageDataGenerator\nfrom tensorflow.python.keras.applications.mobilenet import MobileNet\nfrom tensorflow.python.keras.models import Model\nfrom tensorflow.python.keras.layers import Dense, Dropout, BatchNormalization\nfro...
[ [ "tensorflow.python.keras.layers.Dense", "tensorflow.python.keras.applications.mobilenet.MobileNet", "tensorflow.python.keras.models.Model", "tensorflow.python.keras.optimizers.Adam", "tensorflow.python.keras.preprocessing.image.ImageDataGenerator", "tensorflow.python.keras.layers.Dropout" ...
fbrundu/scCODA
[ "5508a0419d4a46e33897a5df69ba6d4e1753fadd" ]
[ "sccoda/model/dirichlet_models.py" ]
[ "\"\"\"\nDirichlet-multinomial models for statistical analysis of compositional changes in single-cell data.\n\nFor further reference, see:\nBüttner, Ostner et al.: scCODA: A Bayesian model for compositional single-cell data analysis\n\n:authors: Johannes Ostner\n\"\"\"\nimport numpy as np\nimport time\nimport warn...
[ [ "numpy.sum", "tensorflow.zeros", "numpy.matmul", "numpy.zeros", "tensorflow.ones", "numpy.exp", "numpy.count_nonzero", "numpy.size", "tensorflow.cast", "tensorflow.exp", "tensorflow.matmul", "tensorflow.convert_to_tensor", "tensorflow.random.normal", "numpy....
ylimit/ModelDiff
[ "f509bd2a1de20138aeb5cf105f99597a279f6f0b" ]
[ "utils.py" ]
[ "import os\nimport os.path as osp\nimport sys\nimport time\nimport argparse\nfrom pdb import set_trace as st\nimport json\nimport functools\n\nimport torch\nimport numpy as np\nimport torchvision\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom torchvision import transfor...
[ [ "torch.utils.data.DataLoader", "torch.load", "torch.zeros_like", "torch.nn.LogSoftmax", "numpy.linalg.norm" ] ]
TomLiu59/AI-Final-Project
[ "160cb39f7a6c2d51a5f131c70a2ef4677a6d554e" ]
[ "main.py" ]
[ "import numpy as np\nimport pprint\nimport tensorflow as tf\nimport os\nfrom datetime import datetime\n\nfrom model import AlternatingAttention\nimport data_helper\nimport train\nimport test1\nimport sys\n\nflags = tf.app.flags;\n\nflags.DEFINE_integer(\"embedding_dim\", 384, \"Dimensionality of character embedding...
[ [ "tensorflow.app.run", "tensorflow.device", "numpy.max", "tensorflow.train.Saver", "tensorflow.ConfigProto" ] ]
ShuoZ9379/Integration_SIL_and_MBL
[ "d7df6501a665d65eb791f7fd9b8e85fd660e6320" ]
[ "algos/mbl_copos2_sil/run.py" ]
[ "import multiprocessing\nimport os.path as osp\nimport gym,sys\nfrom collections import defaultdict\nimport tensorflow as tf\nimport numpy as np\nimport pickle\nfrom baselines.common.vec_env import VecFrameStack,VecEnv, VecNormalize\nfrom baselines.run import parse_cmdline_kwargs, build_env, configure_logger, get_d...
[ [ "tensorflow.variable_scope", "numpy.zeros", "tensorflow.global_variables_initializer" ] ]
mrtucar/keras-unet-collection
[ "38ac652f33799502df1933c805c04e366ee05c3d" ]
[ "keras_unet_collection/_model_swin_unet_2d.py" ]
[ "\nfrom __future__ import absolute_import\n\nfrom keras_unet_collection.layer_utils import *\nfrom keras_unet_collection.transformer_layers import patch_extract, patch_embedding, SwinTransformerBlock, patch_merging, patch_expanding\n\nfrom tensorflow.keras.layers import Input, Dense\nfrom tensorflow.keras.models im...
[ [ "tensorflow.keras.layers.Input" ] ]
warcraft12321/Hyperfoods
[ "b995cd7afe10fcbd338158c80f53ce637bfffc0c", "b995cd7afe10fcbd338158c80f53ce637bfffc0c" ]
[ "src/torch/nn/grad.py", "src/torch/utils/data/distributed.py" ]
[ "\"\"\"Gradient interface\"\"\"\n\nimport torch\nfrom .modules.utils import _single, _pair, _triple\n\n\ndef _grad_input_padding(grad_output, input_size, stride, padding, kernel_size):\n input_size = list(input_size)\n k = grad_output.dim() - 2\n\n if len(input_size) == k + 2:\n input_size = input_s...
[ [ "torch.conv_transpose2d", "torch.conv1d", "torch.conv_transpose3d", "torch.conv2d", "torch.conv3d", "torch.conv_transpose1d" ], [ "torch.distributed.get_rank", "torch.Generator", "torch.distributed.get_world_size" ] ]
vonkaenelerik/self-supervised-poisson-gaussian
[ "7ebb4527fa79ace7d5de8c28fb484ef1a5cd1c96" ]
[ "test_mydat.py" ]
[ "import numpy as np\nfrom skimage.metrics import peak_signal_noise_ratio\nfrom nets import *\nfrom scipy.optimize import minimize\n\nimport os\nfrom os import listdir\nfrom os.path import join\nfrom imageio import imread, imwrite\nimport glob\nfrom tqdm import trange\n\nimport argparse\nparser = argparse.ArgumentPa...
[ [ "numpy.squeeze", "numpy.quantile", "numpy.stack", "numpy.log", "numpy.maximum", "numpy.mean" ] ]
ryanjmccall/sb_ml_eng_capstone
[ "dfa87dcbd741c6f502b6cd0eb8f31203568c09a2" ]
[ "modules/module_5_3_2/data/population.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nimport pandas as pd\nimport os\n\ndata_file = os.path.join(os.path.dirname(__file__),'Top5000population.csv')\n\ndata = pd.read_csv(data_file, header=None, thousands=',',sep=',',\n names=['city','state','pop'],\n encoding='iso-8859-1')\n\ndata['city'] = da...
[ [ "pandas.read_csv" ] ]
kovenock/FATES_Parameter_Selection
[ "eb38cc96b3cb6c02ae71426b6351e60b16ed8a56" ]
[ "psfxns/annmeans.py" ]
[ "import netCDF4 as nc4\nimport numpy as np\n\n\ndef annual_mean_model(filepath, var, varfiletype, nyrs, conv_factor):\n \"\"\"Calculate time series of model annual means for one variable.\n \n :param filepath (str): the file path and name for the data file\n :param var (str): the name of the variable to...
[ [ "numpy.reshape" ] ]
DFNaiff/BVBQ
[ "48f0eb624483f67b748d791efc0c06ddfb6e0646" ]
[ "bvbq/interface.py" ]
[ "# -*- coding: utf-8 -*-\n# pylint: disable=E1101\n\"\"\"\n Deprecated. Use named_interface.BVBQMixMVN.\n Won't be documented due to this\n\"\"\"\nimport torch\n\nfrom . import utils\nfrom . import bvbq\nfrom . import distributions\nfrom . import gp\nfrom . import acquisition\nfrom . import metrics\n\n\nclass...
[ [ "torch.ones", "torch.vstack" ] ]
YoNyeoSeok/refinenet-pytorch
[ "34dfa49a141630247aef1d5d2424c823ecba46c7" ]
[ "train/training.py" ]
[ "import sys\nsys.path.append('/home/user/research/refinenet-pytorch')\nimport os\nimport numpy as np\nimport tqdm\nimport argparse\nimport math\nimport random\nfrom PIL import Image\n\nimport torch\nimport torch.nn as nn\nimport datasets as ds\nfrom torchvision import transforms as trf\nfrom models.refinenet_resnet...
[ [ "torch.utils.data.DataLoader", "numpy.vectorize", "torch.no_grad", "torch.nn.CrossEntropyLoss", "torch.from_numpy", "numpy.array", "torch.nn.functional.interpolate" ] ]
alexanderkell/temporal_granularity
[ "f29b294beb360d8d66c6fedf78bbf9ae84055b24" ]
[ "test/test_metrics/test_multi_year_metrics.py" ]
[ "from pathlib import Path\nimport pandas as pd\nfrom src.metrics.multi_year_metrics import MultiYearMetrics\nimport pytest\nimport logging\n\nlogging.basicConfig(level=logging.DEBUG)\nlogger = logging.getLogger(__name__)\n\nproject_dir = Path(\"__file__\").resolve().parents[1]\n\n\n@pytest.fixture\ndef define_multi...
[ [ "pandas.to_datetime" ] ]
Frognar/Super-Resolution
[ "406b909d71e156aa11ee589698744e3ad9abfee7" ]
[ "nn/block/upsample_blocks.py" ]
[ "import torch.nn as nn\nfrom torch.nn.functional import interpolate\n\n\nclass PixelShuffleUpscaleBlock(nn.Module):\n def __init__(self, in_channels=64, kernel_size=3, upscale_factor=2):\n super().__init__()\n\n self.block = nn.Sequential(\n nn.Conv2d(in_channels=in_channels,\n ...
[ [ "torch.nn.PixelShuffle", "torch.nn.PReLU", "torch.nn.Conv2d", "torch.nn.functional.interpolate", "torch.nn.LeakyReLU" ] ]
TannerGilbert/Machine-Learning-Explained
[ "5309f44a38ce862f3f177e8d5de2e60eea44637b" ]
[ "Optimizers/adam/code/adam.py" ]
[ "# based on https://ruder.io/optimizing-gradient-descent/#adam\n# and https://github.com/eriklindernoren/ML-From-Scratch/blob/master/mlfromscratch/deep_learning/optimizers.py#L106\n\nimport numpy as np\n\n\nclass Adam:\n \"\"\"Adam - Adaptive Moment Estimation\n Parameters:\n -----------\n learning_rate...
[ [ "numpy.sqrt", "numpy.power", "numpy.shape" ] ]
mustelideos/td-opswtw-competition-rl
[ "afbd6603b74f09c133d5d68e587fc93387ca93ba" ]
[ "models/neural_net.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.init as init\nimport torch.nn.functional as F\nfrom torch.utils.checkpoint import checkpoint\n\nimport math\nimport numpy as np\n\n# ------------------------------------------------------------------------------\n# Transformer model from: https://github.com/JayP...
[ [ "torch.ones", "torch.FloatTensor", "torch.nn.Linear", "torch.load", "torch.nn.Dropout", "torch.split", "torch.utils.checkpoint.checkpoint", "torch.nn.init.xavier_uniform_", "torch.nn.Softmax", "torch.nn.functional.softmax", "torch.zeros", "torch.nn.LSTMCell", "t...
michelebucelli/cardioemulator
[ "0ce8d5fce017a7251865ab01fdf3d0653490b60f" ]
[ "example/circulation_closed_loop.py" ]
[ "import numpy as np\nimport pandas as pd\nimport json\nimport csv\nimport time\nfrom scipy.integrate import RK45, solve_ivp\n\nclass circulation_closed_loop:\n \"\"\"\n Closed loop circulation model.\n\n References\n ----------\n F. Regazzoni, M. Salvador, P. C. Africa, M. Fedele, L. Dede', A. Quarte...
[ [ "numpy.arctan", "pandas.DataFrame", "numpy.mod", "numpy.arange", "numpy.log10", "numpy.round" ] ]
kim95175/detr
[ "342947185153e1f599b47da423a0c49329bbe055" ]
[ "main.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport argparse\nimport datetime\nimport json\nimport random\nimport time\nfrom pathlib import Path\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader, DistributedSampler\n\nimport datasets\nimport util.misc as utils\...
[ [ "torch.utils.data.DataLoader", "torch.hub.load_state_dict_from_url", "torch.load", "torch.utils.data.BatchSampler", "torch.manual_seed", "torch.utils.data.DistributedSampler", "numpy.random.seed", "torch.utils.data.SequentialSampler", "torch.nn.parallel.DistributedDataParallel"...
oguzhangur96/automl-benchmark
[ "785b4d762164dd251b7c5e63131579113c2dc2c2" ]
[ "autogluon/taxi_trip_duration.py" ]
[ "# %% [markdown]\n# This is a simple notebook for Autogluon AutoMl prediction.\n# MLflow used as tracking tool since experiments take long time complete\n# and it is hard to manage too many experiments.\n#%%\n# Importing necessary libraries\nimport os\nimport re\nimport random\nimport string\nimport math\nimport pa...
[ [ "numpy.sqrt", "pandas.read_pickle", "sklearn.model_selection.train_test_split", "sklearn.metrics.mean_squared_log_error" ] ]
lebrice/continuum
[ "7fa9048361b5821b61fa8ec1ac535c2438329626" ]
[ "continuum/task_set.py" ]
[ "from typing import Tuple, Union\n\nimport numpy as np\nfrom PIL import Image\nfrom torch.utils.data import Dataset as TorchDataset\nfrom torchvision import transforms\n\nfrom continuum.viz import plot\n\n\nclass TaskSet(TorchDataset):\n \"\"\"A task dataset returned by the CLLoader.\n\n :param x: The data, e...
[ [ "numpy.random.RandomState", "numpy.concatenate", "numpy.unique" ] ]
FerdinandEiteneuer/ReinforcementLearning
[ "15c75d7f984bd0a8a25b9df822113d8837aa4a93" ]
[ "utils/memory.py" ]
[ "\"\"\"\nMemory\n\"\"\"\nimport numpy as np\nimport os\n\nfrom utils import export\n\n\n@export\nclass NumpyArrayMemory:\n \"\"\"\n Datastructure for all the experiences (states, actions, rewards, next_states)\n the agent saw.\n \"\"\"\n def __init__(self, size, input_shape, nb_actions, data_dir):\n\...
[ [ "numpy.save", "numpy.any", "numpy.load", "numpy.zeros" ] ]
KEVINYZY/python-tutorial
[ "d0f7348e1da4ff954e3add66e1aae55d599283ee" ]
[ "17tensorflow/mnist/__init__.py" ]
[ "# -*- coding: utf-8 -*-\n# Author: XuMing <shibing624@126.com>\n# Data: 17/10/10\n# Brief: \nimport tensorflow as tf\nimport numpy as np\n\n# 使用 NumPy 生成假数据(phony data), 总共 100 个点.\nx_data = np.float32(np.random.rand(2, 100)) # 随机输入\ny_data = np.dot([0.100, 0.200], x_data) + 0.300\n\n# 构造一个线性模型\n#\nb = tf.Variable...
[ [ "tensorflow.zeros", "tensorflow.global_variables_initializer", "tensorflow.matmul", "tensorflow.random_uniform", "numpy.random.rand", "tensorflow.train.GradientDescentOptimizer", "tensorflow.Session", "tensorflow.square", "numpy.dot" ] ]
joybhallaa/pandas
[ "1779155552631a30d4bb176dec70b8cc477defd7" ]
[ "pandas/core/internals/concat.py" ]
[ "from __future__ import annotations\n\nfrom collections import defaultdict\nimport copy\nimport itertools\nfrom typing import TYPE_CHECKING, Dict, List, Sequence, cast\n\nimport numpy as np\n\nfrom pandas._libs import internals as libinternals\nfrom pandas._typing import ArrayLike, DtypeObj, Manager, Shape\nfrom pa...
[ [ "pandas.core.dtypes.cast.ensure_dtype_can_hold_na", "numpy.ones", "numpy.find_common_type", "numpy.diff", "numpy.dtype", "pandas.core.arrays.DatetimeArray", "pandas.core.internals.managers.BlockManager", "pandas.core.dtypes.common.is_float_dtype", "pandas.core.internals.array_m...
ankitshaw/DenGa
[ "92dfb0f3760c30dd9a32d650da92d5c3276099d1" ]
[ "denga/genda.py" ]
[ "\nimport denga.augment as au\nimport pandas as pd\n\nclass Genda():\n\n\tdef __init__(self,filepath): \n\t\tself.filepath = filepath\n\t\tself.dataset = None\n\t\ttry:\n\t\t\tself.dataset = pd.read_csv(self.filepath, header= None, error_bad_lines=False)\n\t\texcept:\n\t\t\traise Exception(\"ERROR: File Missing\")...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
ABernard27/PROJET-groupe-3
[ "a9ab9d80c10724ded9e20751fda018a7ed05589b" ]
[ "Coberny/graph_min_cost/best_price_path.py" ]
[ "import pandas as pd\nimport networkx as nx\nfrom networkx.algorithms import dijkstra_path\nimport itertools\nimport time\nimport datetime as dt\n# import matplotlib.pyplot as plt\n\n\n# Retourne la liste de toutes les villes du dataframe\ndef GetListOfcolnames(data):\n listofColnames = list(data.columns)[1:]\n ...
[ [ "pandas.read_csv" ] ]
sdementen/pandas
[ "e23e6f164209167c0fba0d32c862c5e75e6d4a8a" ]
[ "pandas/io/pytables.py" ]
[ "\"\"\"\nHigh level interface to PyTables for reading and writing pandas data structures\nto disk\n\"\"\"\n\n# pylint: disable-msg=E1101,W0613,W0603\nfrom datetime import datetime, date\nimport time\nimport re\nimport copy\nimport itertools\nimport warnings\nimport os\n\nfrom pandas.types.common import (is_list_lik...
[ [ "pandas.types.common.is_categorical_dtype", "pandas.types.common._ensure_int64", "pandas.Series", "pandas.compat.iteritems", "pandas.formats.printing.adjoin", "pandas.core.algorithms.unique", "pandas.compat.u_safe", "numpy.asarray", "pandas.tslib.get_timezone", "pandas.io.c...
BioinfoTongLI/deepBlink
[ "aa819b71f380507f9fcfa0664ab0f5a8eca4b209" ]
[ "tests/test_augment.py" ]
[ "\"\"\"Unittests for the deepblink.augment module.\"\"\"\n# pylint: disable=missing-function-docstring\n\nfrom hypothesis import given\nfrom hypothesis.extra.numpy import arrays\nimport numpy as np\nimport pytest\n\nfrom deepblink.augment import augment_batch_baseline\nfrom deepblink.augment import flip\nfrom deepb...
[ [ "numpy.sum", "numpy.zeros" ] ]
ethz-asl/data-driven-dynamics
[ "decf4bec19c9fc4a1789f5eb4d6e6003774c75d6" ]
[ "Tools/parametric_model/src/models/multirotor_model.py" ]
[ "\"\"\"\n *\n * Copyright (c) 2021 Manuel Yves Galliker\n * 2021 Autonomous Systems Lab ETH Zurich\n * All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributi...
[ [ "numpy.diag" ] ]
rhoposit/tacotron2
[ "2dad8df5ea50459789e16d9effb83fc2a25e42ed" ]
[ "tacotron/models.py" ]
[ "# ==============================================================================\n# Copyright (c) 2018, Yamagishi Laboratory, National Institute of Informatics\n# Author: Yusuke Yasuda (yasuda@nii.ac.jp)\n# All rights reserved.\n# ==============================================================================\n\"\"...
[ [ "tensorflow.metrics.mean", "tensorflow.summary.scalar", "tensorflow.minimum", "tensorflow.summary.merge_all", "tensorflow.clip_by_global_norm", "tensorflow.get_collection", "tensorflow.to_float", "tensorflow.train.AdamOptimizer", "tensorflow.expand_dims", "tensorflow.estima...
ChristopherChudzicki/mitx-grading-library
[ "1d9a7107f26b5e0ebe24deb552cf943779693e18" ]
[ "mitxgraders/helpers/calc/mathfuncs.py" ]
[ "\"\"\"\nmathfuncs.py\n\nContains mathematical functions for use in interpreting formulas.\n\nContains some helper functions used in grading formulae:\n* within_tolerance\n\nDefines:\n* DEFAULT_FUNCTIONS\n* DEFAULT_VARIABLES\n* DEFAULT_SUFFIXES\n* METRIC_SUFFIXES\n\"\"\"\nfrom __future__ import print_function, divi...
[ [ "numpy.arctanh", "scipy.special.gamma", "numpy.tanh", "numpy.transpose", "numpy.arccosh", "numpy.arcsinh", "numpy.arccos", "numpy.cos", "numpy.complex", "numpy.sinh", "numpy.tan", "numpy.linalg.norm", "numpy.arctan2", "numpy.cosh", "numpy.arcsin", "n...
Moetaz-M-Mokhtar/ITIintake40_FaceRecognition
[ "570ceb5d1353efa8b8754243ee8d5db36a951998" ]
[ "detection/docker/model_handler_cpu.py" ]
[ "# Copyright 2018 Amazon.com, Inc. or its affiliates. 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# A copy of the License is located at\n# http://www.apache.org/licenses/LICENSE-2.0\n# or in the \"...
[ [ "numpy.round", "numpy.max", "numpy.min", "numpy.frombuffer" ] ]
zxc1342802/leijmtrader
[ "f24d5593d8708e48f2a9180d9469a6c2af93a08d" ]
[ "examples/strategies/king_keltner_strategy.py" ]
[ "from jiamtrader.app.cta_strategy import (\n CtaTemplate,\n StopOrder,\n TickData,\n BarData,\n TradeData,\n OrderData,\n BarGenerator,\n ArrayManager,\n)\n\nimport pandas_ta as ta\nimport pandas as pd\n\nclass KingKeltnerStrategy(CtaTemplate):\n \"\"\"\"\"\"\n\n author = \"用Python的交易员...
[ [ "pandas.Series" ] ]
abhishekmaha23/synthetic_data_generation_attempt
[ "99ee858cdf405641fd0e2797bfc14c1a736547eb" ]
[ "util/utils.py" ]
[ "import matplotlib.pyplot as plt\nfrom datetime import datetime\nimport numpy as np\nimport torch\nimport os\nimport time\nfrom scipy.ndimage.filters import gaussian_filter1d\nfrom itertools import repeat\nimport copy\nimport gym\n# import torch.multiprocessing as multiprocessing\nimport multiprocessing\nimport pic...
[ [ "torch.no_grad", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.plot", "scipy.ndimage.filters.gaussian_filter1d", "matplotlib.pyplot.xticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.gca", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.use", "...
ngbsLab/Korean-Speech-Recognition
[ "3867bf7d23222da6812c9b98a93d3c6f7b3c80fc" ]
[ "package/loss.py" ]
[ "import torch\nimport torch.nn as nn\n\nclass LabelSmoothingLoss(nn.Module):\n \"\"\"\n Provides Label-Smoothing loss.\n\n Args:\n class_num (int): the number of classfication\n ignore_index (int): Indexes that are ignored when calculating loss\n smoothing (float): ratio of smoothing (...
[ [ "torch.sum", "torch.zeros_like", "torch.no_grad" ] ]
bhevencious/EvalNE
[ "a62bd11901ea891535f6cb2a05e7abb65b1f3e6f" ]
[ "evalne/evaluation/pipeline.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Author: Mara Alexandru Cristian\n# Contact: alexandru.mara@ugent.be\n# Date: 18/12/2018\n\n# The manager module contains functions and classes for reading, parsing and using a configuration file to\n# run a complete evaluation of network embedding methods.\n\nfrom ...
[ [ "sklearn.tree.DecisionTreeClassifier", "sklearn.linear_model.LogisticRegressionCV", "sklearn.svm.LinearSVC", "sklearn.linear_model.LogisticRegression" ] ]
GiovanniCalore/BigGAN-Tensorflow-master
[ "1fcf72fc8b9cbfdd047b9641f656afcfd0972604" ]
[ "metrics/perceptual_path_length.py" ]
[ "# Copyright (c) 2019, NVIDIA Corporation. All rights reserved.\n#\n# This work is made available under the Nvidia Source Code License-NC.\n# To view a copy of this license, visit\n# https://nvlabs.github.io/stylegan2/license.html\n\n\"\"\"Perceptual Path Length (PPL).\"\"\"\n\nimport numpy as np\nimport tensorflow...
[ [ "tensorflow.math.acos", "numpy.logical_and", "tensorflow.device", "tensorflow.math.cos", "tensorflow.math.sin", "tensorflow.square", "numpy.concatenate", "tensorflow.transpose", "tensorflow.reduce_sum", "numpy.percentile", "numpy.mean" ] ]
rupei/probability
[ "4aa1ee652853a19c4e80d39216c3fa535ed3e589" ]
[ "tensorflow_probability/python/internal/backend/numpy/numpy_array.py" ]
[ "# Copyright 2018 The TensorFlow Probability Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a...
[ [ "numpy.sum", "numpy.take", "numpy.issubdtype", "numpy.moveaxis", "numpy.ndindex", "numpy.transpose", "numpy.reshape", "numpy.expand_dims", "numpy.where", "numpy.linspace", "numpy.repeat", "numpy.arange", "numpy.roll", "numpy.squeeze", "numpy.conjugate", ...
foobug/suzieq
[ "c5927616a0e1a1fd9283f2a3eeb120d24ff0f2b5" ]
[ "suzieq/poller/services/evpnVni.py" ]
[ "import re\nimport numpy as np\n\nfrom suzieq.poller.services.service import Service\nfrom suzieq.utils import (convert_rangestring_to_list,\n convert_macaddr_format_to_colon)\n\n\nclass EvpnVniService(Service):\n \"\"\"evpnVni service. Different class because output needs to be munged\"...
[ [ "numpy.delete" ] ]
PriyankaH21/astropy
[ "159fb9637ce4acdc60329d20517ed3dc7ba79581" ]
[ "astropy/nddata/tests/test_utils.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nimport pytest\nimport numpy as np\nfrom numpy.testing import assert_allclose\n\nfrom ...tests.helper import assert_quantity_allclose\nfrom ..utils import (extract_array, add_array, subpixel_indices,\n block_reduce, block_replica...
[ [ "numpy.ones", "numpy.zeros", "numpy.cos", "numpy.copy", "numpy.arange", "numpy.all", "numpy.isnan", "numpy.array", "numpy.sin", "numpy.testing.assert_allclose" ] ]
mateussangalli/SE2DINNets
[ "c4d9b6d2577a5044c243d0eb80ebe5879a7673c9" ]
[ "train_SE2DINNet.py" ]
[ "import tensorflow as tf\nimport numpy as np\nfrom tensorflow.keras import layers, regularizers\nfrom tensorflow.keras.utils import to_categorical\nimport matplotlib.pyplot as plt\nimport os\nimport argparse\n\nfrom SE2DIN import *\n\n\nfrom load_data import load_data\n\n\nmnist_rot_dir = 'mnist_rot'\nmnist_12k_dir...
[ [ "tensorflow.keras.models.Sequential", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.layers.Dropout", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.keras.layers.ReLU", "tensorflow.keras.regularizers.l2", "tensorflow.keras.layers.GlobalMaxPooling2D", "t...
Ayon134/code_for_Kids
[ "d90698bb38efe5e26c31f02bd129bfdadea158e2" ]
[ "lst.py" ]
[ "import cv2\nimport io\nfrom PIL import Image, ImageEnhance\nimport pytesseract\nfrom wand.image import Image as wi\nimport re\nimport pandas as pd\nfrom PyPDF2 import PdfFileWriter, PdfFileReader\nfrom pdf2image import convert_from_path\n\n\nclaim = '15232353'\nfile = \"a.pdf\"\npages_to_keep = [0]\ninfile = PdfFi...
[ [ "pandas.DataFrame" ] ]
giangtranml/framgia-training
[ "c7fb343bd43b1bceb241b447ff956febb99c94a8" ]
[ "decision_tree/decision_tree.py" ]
[ "\"\"\"\nAuthor: Giang Tran.\n\"\"\"\n\nimport numpy as np\nfrom math import log2\n\n\nclass NodeDT:\n \"\"\"\n Class Node represents in Decision Tree\n \"\"\"\n\n def __init__(self, X, y, feature_name):\n self.feature_name = feature_name\n self.X = X\n self.y = y\n self.is_l...
[ [ "pandas.read_csv", "sklearn.tree.DecisionTreeClassifier", "numpy.logical_and", "numpy.asarray", "numpy.unique" ] ]
mnemocron/TelegramChatStats
[ "10b9ebb97bfb28f835fd05050f03dcb10525f7a3" ]
[ "telegram-statistics.py" ]
[ "#! /usr/bin/python3\n\n#_*_ coding: utf-8 _*_\n\n'''\n@file \t\ttelegram-statistics.py\n@author \tSimon Burkhardt - github.com/mnemocron\n@date \t\t2018.10.01\n\nPost about this code:\nhttps://www.reddit.com/r/LongDistance/comments/9mgcol/oc_chat_statistics_from_telegram_using_python/\n\nInspiration:\nhttps://www....
[ [ "pandas.DataFrame.from_dict" ] ]
bentzinir/ray
[ "39b84166f88e271b279bd0b3ce56f81d24a1852c" ]
[ "rllib/agents/sac/sac_ensemble_tf_model_unstack.py" ]
[ "from gym.spaces import MultiDiscrete\nimport numpy as np\n\nfrom ray.rllib.models.tf.tf_modelv2 import TFModelV2\nfrom ray.rllib.utils.framework import try_import_tf\n\ntf = try_import_tf()\n\n\nclass SACEnsembleTFModel(TFModelV2):\n \"\"\"Extension of standard TFModel for SAC.\n\n Data flow:\n obs ->...
[ [ "numpy.log", "numpy.expand_dims", "numpy.product", "numpy.prod" ] ]
TamasFlorin/YOLO3-4-Py
[ "d7cc4d67c7eb9168a30ce9716ed64024fc1e1f8f" ]
[ "setup.py" ]
[ "import tempfile\nfrom distutils.command.build import build\nfrom distutils.command.clean import clean\nimport sys\nimport numpy as np # TODO: Need a mechanism to ensure numpy is already installed\nimport shutil\n\n# Compile using .cpp files if cython is not present\ntry:\n from Cython.Distutils import build_ext...
[ [ "numpy.get_include" ] ]
sheepolata/GraphEngine
[ "853447e42dcd09154cdc5ac0b8e00c493445a389" ]
[ "ggraph.py" ]
[ "# import the pygame module, so you can use it\nimport pygame\nfrom pygame.locals import *\nimport warnings\nimport random\nimport numpy as np\nimport math\nfrom scipy.spatial import Delaunay\n\nimport delaunaytriangulation as dt\nimport graphmodel as gm\nimport drawer\nimport utils\n\nclass gNode(gm.Node):\n\n ...
[ [ "numpy.array" ] ]
inesnolas/Rank-based-loss_ICASSP22
[ "3ebe7345dc26b8fa74543725a51b43b7170c58cc" ]
[ "run_example.py" ]
[ "import models.SingleLayer_net as single_layer\nimport loss_functions.rank_based_loss as rbl\n# import wandb\nimport torch\nimport utils.data_functions as df\nimport os\nimport json\nimport pandas as pd\nimport csv\n\n\nos.environ['CUDA_VISIBLE_DEVICES'] = '3'\n# wandb.init(project='example')\n\nexp_name = 'example...
[ [ "torch.utils.data.DataLoader", "torch.load" ] ]