repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
speglich/devito
[ "f535a44dff12de2837eb6e3217a65ffb2d371cb8" ]
[ "tests/test_dimension.py" ]
[ "from itertools import product\n\nimport numpy as np\nfrom sympy import And\nimport pytest\n\nfrom conftest import skipif\nfrom devito import (ConditionalDimension, Grid, Function, TimeFunction, SparseFunction, # noqa\n Eq, Operator, Constant, Dimension, SubDimension, switchconfig,\n ...
[ [ "numpy.allclose", "numpy.sum", "numpy.all", "numpy.zeros" ] ]
Bartdoekemeijer/FLORIS
[ "be3c9fbb559354b5bf848792d84caff90606ed05" ]
[ "tests/reg_tests/cumulative_curl_regression_test.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...
[ [ "numpy.array", "numpy.allclose", "numpy.arange", "numpy.zeros" ] ]
MarcusJones/kaggle_petfinder_adoption
[ "2d745b48405f4d4211b523eae272b9169fcf9fa2" ]
[ "reference_kernels/kernel.py" ]
[ "import gc\r\nimport glob\r\nimport json\r\nimport matplotlib.pyplot as plt\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport scipy as sp\r\nimport lightgbm as lgb\r\n\r\nfrom collections import Counter\r\nfrom functools import partial\r\nfrom math import sqrt\r\nfrom joblib import Parallel, delayed\r\nfro...
[ [ "pandas.Series", "numpy.random.seed", "numpy.asarray", "numpy.copy", "sklearn.decomposition.NMF", "pandas.DataFrame.from_dict", "numpy.isfinite", "sklearn.feature_extraction.text.TfidfVectorizer", "sklearn.decomposition.TruncatedSVD", "sklearn.model_selection.KFold", "n...
bstellato/cvxpy
[ "c954bcfd14f9b131bd55d5c1028e667297a53f76" ]
[ "cvxpy/cvxcore/tests/python/364A_scripts/act_management.py" ]
[ "from cvxpy import Maximize, Problem, Variable, hstack, vstack\nimport numpy as np\nimport time\n\n\n# Create two scalar optimization variables.\n\nANSWERS = []\nTIME = 0\n\nA = np.array([ [1, 2, 0, 1], \\\n[0, 0, 3, 1], \\\n[0, 3, 1, 1], \\\n[2, 1, 2, 5], \\\n[1, 0, 3, 2] ])\n\nA_star = hstack(A,A)\n\nc_max = np.a...
[ [ "numpy.array" ] ]
titania7777/3D-ResNets-PyTorch
[ "45921588bcf70f1b4ace424e754c48c0b5501ad6" ]
[ "main.py" ]
[ "from pathlib import Path\nimport json\nimport random\nimport os\n\nimport numpy as np\nimport torch\nfrom torch.nn import CrossEntropyLoss\nfrom torch.optim import SGD, lr_scheduler\nimport torch.multiprocessing as mp\nimport torch.distributed as dist\nfrom torch.backends import cudnn\nimport torchvision\n\nfrom o...
[ [ "torch.utils.data.DataLoader", "torch.nn.SyncBatchNorm.convert_sync_batchnorm", "torch.optim.SGD", "torch.load", "torch.utils.data.distributed.DistributedSampler", "torch.multiprocessing.spawn", "torch.manual_seed", "torch.save", "numpy.random.seed", "torch.distributed.init...
IntoxicatedDING/stdn
[ "1bb9555114c762b09ad65eb16c59b134e1dccb56" ]
[ "data/voc0712.py" ]
[ "\"\"\"VOC Dataset Classes\n\nOriginal author: Francisco Massa\nhttps://github.com/fmassa/vision/blob/voc_dataset/torchvision/datasets/voc.py\n\nUpdated by: Ellis Brown, Max deGroot\n\"\"\"\n'''\nAdapted from https://github.com/amdegroot/ssd.pytorch\n'''\nfrom .config import HOME\nimport os.path as osp\nimport sys\...
[ [ "numpy.array", "numpy.expand_dims", "torch.from_numpy" ] ]
hazananayurt/viref
[ "f7b5a2278d9211104ea2293077e2b85d7466d63a" ]
[ "viref/model.py" ]
[ "import torch\nfrom torch import optim\nfrom torch.nn import Parameter\nimport torch.nn.functional as F\n\nclass Encoder(torch.nn.Module):\n\tdef __init__(self, input_size, hidden_size, num_layers, dropout):\n\t\tsuper(Encoder, self).__init__()\n\t\t\n\t\tself.input_size = input_size\n\t\tself.hidden_size = hidden_...
[ [ "torch.nn.functional.log_softmax", "torch.nn.LSTM", "torch.nn.Linear", "torch.nn.Softmax", "torch.nn.functional.relu", "torch.cat" ] ]
XiaoJake/DS-Net
[ "8400da1bd7c7b1ccf4d5c6782b86372957e79a6b" ]
[ "network/model_zoo.py" ]
[ "# -*- coding:utf-8 -*-\n# author: Hong Fangzhou\n# @file: model_zoo.py\n# @time: 2020/09/26 17:05\n\nfrom .modules import BEV_Unet\nfrom .modules import PointNet\nfrom .modules import spconv_unet\nfrom .modules import pytorch_meanshift\nfrom .loss import instance_losses\nfrom .loss import lovasz_losses\nfrom utils...
[ [ "torch.nn.functional.softmax", "torch.argsort", "torch.no_grad", "torch.cat", "numpy.logical_and", "torch.nn.functional.pad", "numpy.isin", "torch.from_numpy", "torch.unique", "numpy.unique", "numpy.zeros", "torch.argmax", "numpy.max", "numpy.array", "nu...
vinitra/keras-onnx
[ "17d86705f566bee56307abd13a60b79776a58c0e" ]
[ "applications/nightly_build/test_deep_speech.py" ]
[ "###############################################################################\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n##########################################################################...
[ [ "numpy.random.rand" ] ]
schmocker/Pyjamas
[ "52a72d6e8b915f77a2194d4e7d53c46d0ec28c17" ]
[ "Models/Electricity_Market/Tiers/V001/model.py" ]
[ "from pyjamas_core import Supermodel\nfrom pyjamas_core.util import Input, Output, Property\nfrom datetime import datetime, timedelta\nfrom Models._utils.time import datetime2utc_time, utc_time2datetime\nimport numpy as np\nfrom pytz import timezone\nimport json\nfrom scipy.interpolate import griddata\nimport panda...
[ [ "numpy.array", "numpy.multiply", "numpy.unique", "numpy.append" ] ]
Leon-Francis/Script-role-emotion-recognition
[ "e80b8366f1e868b6611c149ad18945a994784b3d" ]
[ "train.py" ]
[ "import torch\nimport tqdm\nfrom torch.utils.data import DataLoader\nimport torch.nn.functional as F\nfrom torch import optim, nn\nfrom dataset import Script_dataset\nfrom config import TrainingConfig, CONFIG_PATH\nfrom model import BaseModel\nfrom tools import logging, get_time\nfrom datetime import datetime\nimpo...
[ [ "torch.utils.data.DataLoader", "torch.optim.lr_scheduler.LambdaLR", "torch.save", "torch.no_grad", "torch.nn.BCEWithLogitsLoss", "torch.optim.lr_scheduler.ReduceLROnPlateau" ] ]
granttremblay/aoide
[ "ea25bdf92013f7dc3b254e261039c43e697ee901" ]
[ "aoide/make_sky_mask.py" ]
[ "#!/usr/bin/env python\n'''\nAoide | Reduction & Analysis of MUSE observations\n-------------------------------------------------\nDr. Grant R. Tremblay | Harvard-Smithsonian Center for Astrophysics\ngrant.tremblay @ cfa.harvard.edu\n\nSee the README associated with this repository for documentation & examples.\n''...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "numpy.zeros" ] ]
serge-m/jina
[ "9c9af3cd2982daabc75dd3d3e2f380e17c21aac0" ]
[ "tests/unit/executors/evaluators/rank/test_recall.py" ]
[ "import numpy as np\nimport pytest\n\nfrom jina.executors.evaluators.rank.recall import RecallEvaluator\n\n\n@pytest.mark.parametrize(\n 'eval_at, expected',\n [\n (0, 0.0),\n (1, 0.2),\n (2, 0.4),\n (3, 0.4),\n (5, 0.4),\n (100, 0.4)\n ]\n)\ndef test_recall_evalua...
[ [ "numpy.testing.assert_almost_equal" ] ]
HaowenWeiJohn/RealityNavigationRealTimeInference
[ "cef6906d939f56c88ea38e4394f13f35f055e3d9" ]
[ "utils/data_utils.py" ]
[ "import os\nfrom pathlib import Path\n\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy.interpolate import interp1d\nfrom scipy.signal import resample\n\nfrom utils.sig_proc_utils import notch_filter, baseline_correction\n\n\ndef window_slice(data, window_size, stride, channel_mode='chan...
[ [ "numpy.eye", "numpy.transpose", "numpy.interp", "numpy.zeros", "numpy.squeeze", "numpy.moveaxis", "numpy.copy", "numpy.expand_dims", "numpy.max", "numpy.min", "numpy.array" ] ]
stefanv/dipy
[ "4d4518861a796502826f053c17161487db126487" ]
[ "doc/examples/tractography_clustering.py" ]
[ "\"\"\" \n\n=============================\nTractography Clustering\n=============================\n\nOverview\n========\n\n**This example gives a tour of clustering related features of dipy.**\n\nFirst import the necessary modules\n----------------------------------\n\n``numpy`` is for numerical computation\n\n\"\"...
[ [ "numpy.random.rand" ] ]
dougalsutherland/cvxpy
[ "34349b5e41c124a6a1e32426e68af95b5044498c" ]
[ "cvxpy/reductions/solvers/qp_solvers/qp_solver.py" ]
[ "\"\"\"\nCopyright 2017 Robin Verschueren\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed t...
[ [ "scipy.sparse.csc_matrix", "scipy.sparse.csr_matrix", "numpy.array", "numpy.concatenate", "scipy.sparse.vstack" ] ]
jpjuvo/RSNA-MICCAI-Brain-Tumor-Classification
[ "a8a4e9257b7475bc328870504edd18fdd9ec9d2f" ]
[ "src/seg_model_utils/torchio_transforms.py" ]
[ "import torch\nimport torchio as tio\nimport numpy as np\n\ndef load_tio_image(fn):\n \"\"\"\n ScalarImage(shape: (c, w, h, d))\n dtype: torch.DoubleTensor\n \"\"\"\n arr = np.load(fn).swapaxes(0,3)\n return tio.ScalarImage(tensor=arr)\n\ndef arr_2_tio_image(arr):\n \"\"\"\n ScalarImage(shap...
[ [ "numpy.load", "numpy.expand_dims" ] ]
levitsky/biosaur2
[ "5cc8474906408c58ff043af722607c1452aa444f" ]
[ "biosaur2/utils.py" ]
[ "from pyteomics import mzml\nimport numpy as np\nfrom collections import defaultdict, Counter\nfrom os import path\nimport math\nfrom scipy.optimize import curve_fit\nimport logging\nlogger = logging.getLogger(__name__)\nfrom .cutils import get_fast_dict, get_and_calc_apex_intensity_and_scan\n\nclass MS1OnlyMzML(mz...
[ [ "numpy.histogram", "numpy.argsort", "numpy.median", "numpy.exp", "numpy.arange", "numpy.log10", "numpy.array", "numpy.average" ] ]
kaczmarj/robustness
[ "79d371fd799885ea5fe5553c2b749f41de1a2c4e" ]
[ "robustness/attack_steps.py" ]
[ "\"\"\"\n**For most use cases, this can just be considered an internal class and\nignored.**\n\nThis module contains the abstract class AttackerStep as well as a few subclasses. \n\nAttackerStep is a generic way to implement optimizers specifically for use with\n:class:`robustness.attacker.AttackerModel`. In genera...
[ [ "torch.irfft", "torch.randn_like", "torch.rand_like", "torch.sign", "torch.clamp" ] ]
MourabitElBachir/visual-recognition-server-control-back
[ "859b385480e16de16cc4c4adb57f49e98bfd3ade" ]
[ "object_detection/builders/optimizer_builder.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.contrib.opt.MovingAverageOptimizer", "tensorflow.summary.scalar" ] ]
while0l1/ranzcr2020
[ "64edbcbe638e7d52cd831e9edd40c72e96a7e3a0" ]
[ "load_dataset.py" ]
[ "from sklearn.model_selection import GroupKFold\nimport pandas as pd\nimport cv2\nimport os\nimport numpy as np\nimport ast\nimport torch\nimport albumentations\nfrom config import CFG\nfrom torch.utils.data import DataLoader\n\nclass RanzcrDataset(object):\n def __init__(self, root, df, mode='test', transforms=...
[ [ "torch.utils.data.DataLoader", "numpy.zeros", "pandas.read_csv", "sklearn.model_selection.GroupKFold", "torch.tensor", "numpy.int32", "pandas.merge" ] ]
jimthompson5802/ludwig
[ "8a369328a3f839d9cdb3710be315952c7891d7c0" ]
[ "tests/ludwig/encoders/test_text_encoders.py" ]
[ "import pytest\nimport torch\n\nfrom ludwig.encoders import text_encoders\n\n\n@pytest.mark.parametrize(\"use_pretrained\", [False])\n@pytest.mark.parametrize(\"reduce_output\", [None, \"sum\"])\n@pytest.mark.parametrize(\"max_sequence_length\", [20])\ndef test_albert_encoder(use_pretrained: bool, reduce_output: st...
[ [ "torch.rand", "torch.randint" ] ]
ZitongYu/Flex-Modal-FAS
[ "b5aad6aae1737ea5746ee7ae7330eb9893043095" ]
[ "Load_FAS_MultiModal.py" ]
[ "from __future__ import print_function, division\nimport os\nimport torch\nimport pandas as pd\n#from skimage import io, transform\nimport cv2\nimport numpy as np\nimport random\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms\nimport pdb\nimport math\nimport os \n...
[ [ "numpy.ones", "numpy.zeros", "pandas.read_csv", "torch.from_numpy", "numpy.clip", "numpy.array", "numpy.random.randint" ] ]
AtreyeeS/gammapy
[ "a3b47c3da08900a833f0360e0374203e054cadfc" ]
[ "gammapy/datasets/flux_points.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport logging\nimport numpy as np\nfrom astropy import units as u\nfrom astropy.table import Table\nfrom astropy.visualization import quantity_support\nfrom gammapy.modeling.models import DatasetModels\nfrom gammapy.utils.scripts import make_name, m...
[ [ "numpy.sum", "numpy.nanmax", "matplotlib.pyplot.figure", "matplotlib.pyplot.gca", "numpy.nanmin", "matplotlib.gridspec.GridSpec" ] ]
NeolithEra/mbin
[ "27e9aea4ed67a48cc2d993a0fbd142a651e9ee7b" ]
[ "mbin/controls.py" ]
[ "import os,sys\nimport optparse\nimport logging\nfrom pbcore.io.align.CmpH5IO import CmpH5Reader\nfrom pbcore.io import openIndexedAlignmentFile\nfrom pbcore.io.BasH5IO import BasH5Reader\nimport glob\nimport numpy as np\nimport logging\nimport shutil\nimport pickle\nimport math\nimport mbin\nimport motif_tools\n\n...
[ [ "numpy.sum", "numpy.dot", "numpy.atleast_2d", "numpy.loadtxt" ] ]
kishorecbe/Tensorflow-Solutions
[ "a158766633bc20ca4289096e4a5454a9e0d04e51" ]
[ "research/MCNN/model/mcnn_model.py" ]
[ "import multiprocessing\n\nimport tensorflow as tf\nfrom tensorflow.contrib import estimator\nfrom tensorflow.contrib import lookup\nfrom model import commons\n\n__author__ = 'KKishore'\n\nhead = estimator.binary_classification_head()\n\n\ndef parse_csv_row(row):\n columns = tf.decode_csv(row, record_defaults=co...
[ [ "tensorflow.data.TextLineDataset", "tensorflow.sparse_tensor_to_dense", "tensorflow.keras.layers.Concatenate", "tensorflow.reshape", "tensorflow.keras.layers.GlobalMaxPool1D", "tensorflow.slice", "tensorflow.train.get_global_step", "tensorflow.estimator.export.ServingInputReceiver"...
serig/Jupyter-notebook-with-Flask
[ "f6cc37517e10fcd5de5229fe5264192c578faf5f" ]
[ "app.py" ]
[ "from flask import Flask, render_template\r\n# import os\r\n\r\napp = Flask(__name__)\r\n\r\n\r\n@app.route('/plot/')\r\ndef plot():\r\n from IPython.core.display import display, HTML\r\n from string import Template\r\n import pandas as pd\r\n import json\r\n\r\n # d3js = HTML('<script src=\"d3_jupyt...
[ [ "pandas.read_csv", "pandas.merge" ] ]
dblyon/cmapPy
[ "abd4349f28af6d035f69fe8c399fde7bef8dd635" ]
[ "cmapPy/pandasGEXpress/tests/python2_tests/test_parse_gctx.py" ]
[ "import logging\nimport unittest\nimport os\nimport pandas as pd\nimport numpy as np\nimport h5py\n\nimport pandas.util.testing as pandas_testing\nimport cmapPy.pandasGEXpress.setup_GCToo_logger as setup_logger\nimport cmapPy.pandasGEXpress.GCToo as GCToo\nimport cmapPy.pandasGEXpress.parse_gctx as parse_gctx\nimpo...
[ [ "pandas.util.testing.assert_frame_equal", "pandas.DataFrame" ] ]
eifuentes/swae-pytorch
[ "763f771c1d4860f71819af48d4f21a8a29a689d5" ]
[ "examples/mnist.py" ]
[ "import argparse\nimport os\n\nimport matplotlib as mpl\nmpl.use('Agg')\nimport matplotlib.pyplot as plt\nimport torch\nimport torch.optim as optim\nimport torchvision.utils as vutils\nfrom swae.distributions import rand_cirlce2d, rand_ring2d, rand_uniform2d\nfrom swae.models.mnist import MNISTAutoencoder\nfrom swa...
[ [ "torch.cuda.manual_seed", "matplotlib.pyplot.figure", "torch.manual_seed", "torch.no_grad", "matplotlib.pyplot.xlim", "torch.cuda.is_available", "matplotlib.pyplot.ylim", "matplotlib.pyplot.close", "matplotlib.use", "torch.device", "torch.cat", "matplotlib.pyplot.sc...
aviadlazar/FLS
[ "03f1ec28adf3b15810ef2c2ac5e024697c3d0bff" ]
[ "tool/tv_reference/coco_eval.py" ]
[ "import json\r\nimport tempfile\r\n\r\nimport numpy as np\r\nimport copy\r\nimport time\r\nimport torch\r\nimport torch._six\r\n\r\nfrom pycocotools.cocoeval import COCOeval\r\nfrom pycocotools.coco import COCO\r\nimport pycocotools.mask as mask_util\r\n\r\nfrom collections import defaultdict\r\n\r\nfrom . import u...
[ [ "torch.stack", "numpy.asarray", "numpy.max", "numpy.min", "numpy.array", "numpy.concatenate", "numpy.unique" ] ]
bbw7561135/PlasmaEDU
[ "aba2a00c04413bdf26c74f9e5c515644a517b728" ]
[ "bfield/python/ex03_plot_loopxyz_magnitude.py" ]
[ "################################################################################\n#\n# BFIELD\n#\n# Simple example of plot of the magnitude of the magnetic field\n# produced by a current loop, using its Cartesian components\n#\n#\n###############################################################################...
[ [ "numpy.sqrt", "numpy.transpose", "numpy.zeros", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "numpy.array", "matplotlib.pyplot.colorbar", "numpy.meshgrid", "numpy.linspace",...
djoker07/facial_keipoint_detection
[ "112564b12330b0b18be8665a70c92c09e3434ce8" ]
[ "models.py" ]
[ "## TODO: define the convolutional neural network architecture\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n# can use the below import should you choose to initialize the weights of your Net\nimport torch.nn.init as I\n\n\nclass Net(nn.Module):\n\n def __init__(self):\n super(N...
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Conv2d", "torch.nn.Dropout" ] ]
BranYang/pandas
[ "1033e8b1195d4071253889ada60523832285354c" ]
[ "pandas/tests/extension/decimal/test_decimal.py" ]
[ "import decimal\n\nimport numpy as np\nimport pandas as pd\nimport pandas.util.testing as tm\nimport pytest\n\nfrom pandas.tests.extension import base\n\nfrom .array import DecimalDtype, DecimalArray, make_data\n\n\n@pytest.fixture\ndef dtype():\n return DecimalDtype()\n\n\n@pytest.fixture\ndef data():\n retu...
[ [ "pandas.Series", "pandas.util.testing.assert_raises_regex", "pandas.DataFrame", "pandas.util.testing.assert_series_equal", "pandas.util.testing.assert_frame_equal" ] ]
sethuiyer/mlhub
[ "6be271c0070a0c0bb90dd92aceb344e7415bb1db" ]
[ "Pokemon Identifier/poketype.py" ]
[ "import pickle\nimport pandas as pd \nfrom sklearn.utils import resample\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.svm import LinearSVC\nimport os \n\nclass PokemonTypeIdentifier():\n \"\"\"\n This class identifies the pokemon type of a user given pokemon name.\n \"\"\"...
[ [ "pandas.read_csv", "sklearn.svm.LinearSVC", "sklearn.feature_extraction.text.TfidfVectorizer", "pandas.concat", "sklearn.utils.resample", "pandas.factorize" ] ]
feynmanliang/beanmachine
[ "5dea2b9f6387f2f7fd1e53b0915a1b8405f2b46b" ]
[ "src/beanmachine/ppl/legacy/inference/abstract_infer.py" ]
[ "# Copyright (c) Meta Platforms, Inc. and affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport logging\nimport platform\nimport random\nfrom abc import ABCMeta, abstractmethod\nfrom typing import ClassVar, Dict, List\n...
[ [ "torch.multiprocessing.get_context", "torch.manual_seed", "torch.randint" ] ]
UWaterloo-ASL/LAS_Gym
[ "916043d59aeca3deb8875abb280dcecbdcd50f0f" ]
[ "ArchiveTestCode/Red Light Excited Visitor Simulator/LivingArchitectureEnv.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue May 8 16:12:32 2018\n\n@author: jack.lingheng.meng\n\"\"\"\ntry:\n import vrep\nexcept:\n print ('--------------------------------------------------------------')\n print ('\"vrep.py\" could not be imported. This means very probably ...
[ [ "numpy.zeros", "numpy.clip", "numpy.array", "numpy.where", "numpy.mean" ] ]
Keck-DataReductionPipelines/KCWI_DRP
[ "5073a137a8edddf9ff894aef445f877d7186a355" ]
[ "kcwidrp/primitives/FluxCalibrate.py" ]
[ "from keckdrpframework.primitives.base_primitive import BasePrimitive\nfrom kcwidrp.primitives.kcwi_file_primitives import kcwi_fits_writer, \\\n kcwi_fits_reader, get_master_name, strip_fname\nfrom kcwidrp.core.kcwi_correct_extin import kcwi_correct_extin\n\nimport os\nimport numpy as np\nfrom scipy.interpolate...
[ [ "numpy.arange", "scipy.interpolate.interp1d" ] ]
shmouses/EELSpecNet
[ "a9aa085782a08e903e718012d5ce5979c18f7d23" ]
[ "main.py" ]
[ "import EELSpecNet\nimport GenerateData as gene\nimport tensorflow as tf\nimport numpy as np\nimport tensorflow.experimental.numpy as tnp\ntnp.experimental_enable_numpy_behavior()\n\ndef main():\n\n model = EELSpecNet.EELSpecNetModel_CNN_10D(2048)\n op = tf.keras.optimizers.Adam(learning_rate=5e-5)\n model...
[ [ "numpy.save", "tensorflow.keras.optimizers.Adam", "tensorflow.experimental.numpy.asarray", "numpy.shape", "tensorflow.experimental.numpy.experimental_enable_numpy_behavior" ] ]
MarcoGorelli/pymc
[ "75ea2a80cb27773e93b7b207043077953940e6ff" ]
[ "pymc/distributions/shape_utils.py" ]
[ "# Copyright 2021 The PyMC Developers\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 appli...
[ [ "numpy.broadcast_to", "numpy.asarray", "numpy.atleast_1d" ] ]
zouguojian/FDN-Learning
[ "ef89cb7d6654d5ac2425621ec6b330652a281f16" ]
[ "data_/data_save.py" ]
[ "# -- coding: utf-8 --\n\nimport os\nimport csv\n\ndef go_though(open_file):\n for root, dirs, files in os.walk(r''+str(open_file)):\n for file in files:\n # # 获取文件所属目录\n # print(root)\n # 获取文件路径\n print(os.path.join(root, file))\n\ndef re_hour(hour):\n if le...
[ [ "pandas.read_excel", "numpy.reshape" ] ]
rcaneill/xgcm-1
[ "b68a4c70fdb8ade2e7462a958c810a07b0fbcfdb" ]
[ "xgcm/test/test_metrics_ops_single_axis.py" ]
[ "from __future__ import print_function\nimport pytest\nimport xarray as xr\nimport numpy as np\n\nfrom xgcm.grid import Grid, Axis\nfrom xgcm.test.datasets import datasets_grid_metric\n\n\n@pytest.mark.parametrize(\"funcname\", [\"interp\", \"diff\", \"min\", \"max\", \"cumsum\"])\n@pytest.mark.parametrize(\"grid_t...
[ [ "numpy.arange", "numpy.ones" ] ]
syth0le/mat_mod_labs
[ "9c87e771beb75566bb824e34f4520e8b2ca0a4ce" ]
[ "lab_2/graphics.py" ]
[ "import numpy as np\nfrom matplotlib import pyplot as plt\nfrom scipy import interpolate\nfrom abc import ABCMeta, abstractmethod\n\nfrom utils.sorting import bubble_sort\n\n\nclass ABSMethods(metaclass=ABCMeta):\n def __init__(self, function):\n self.function = function\n\n @abstractmethod\n def dr...
[ [ "numpy.linalg.solve", "matplotlib.pyplot.title", "scipy.interpolate.splev", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "scipy.interpolate.splrep", "numpy.min", "numpy.max", "numpy.array", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.p...
w86763777/Pytorch-Unified-FID-IS-Score
[ "6a2620d6da0faa66bb798aa47c7e0e49ef2032b6" ]
[ "pytorch_gan_metrics/calc_fid_stats.py" ]
[ "import argparse\nimport os\n\nimport numpy as np\nfrom torch.utils.data import DataLoader\n\nfrom . import ImageDataset\nfrom .core import get_inception_feature\n\n\ndef calc_and_save_stats(path, output, batch_size):\n dataset = ImageDataset(path, exts=['png', 'jpg'])\n loader = DataLoader(dataset, batch_siz...
[ [ "torch.utils.data.DataLoader", "numpy.cov", "numpy.mean", "numpy.savez_compressed" ] ]
NeelGhoshal/probability
[ "df96f3d56eff92c6b06fbac68dc58e095e28fed6" ]
[ "tensorflow_probability/python/math/psd_kernels/exponentiated_quadratic.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...
[ [ "tensorflow.compat.v2.exp", "tensorflow.compat.v2.shape", "tensorflow.compat.v2.convert_to_tensor", "tensorflow.compat.v2.math.squared_difference", "tensorflow.compat.v2.TensorShape", "tensorflow.compat.v2.name_scope", "tensorflow.compat.v2.broadcast_static_shape", "tensorflow.comp...
jonaswagner2826/MECH6327
[ "2b55aaf6f9e1bcf5cc684f5c853cadec26acf9d2" ]
[ "InClass&Examples/InClass_20210303.py" ]
[ "\n\n\n\"\"\"\nIn Class Ex:\nConstrained \\infty-norm minimization\n\nProblem:\n minimize:\n \\norm{x}_\\infty\n subject to:\n A x \\leq b\n\nNotes:\n \\norm{x}_\\infty = \\max_i \\abs{x_i}\n = \\max_i \\{x_i, -x_i\\}\n = \\max_i \\{x_1, \\dots, x_n, -x_1...
[ [ "numpy.random.rand" ] ]
yotamitai/Agent-Disagreements
[ "858583db448c5621273824527f1f4181ebf55a2b" ]
[ "disagreements/disagreement.py" ]
[ "from copy import deepcopy\n\nimport cv2\nimport imageio\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom os.path import join\nfrom PIL import ImageFont, ImageDraw, Image\n\nfrom disagreements.common.utils import make_clean_dirs, save_image, create_video\nfrom disagreements.logging_info import log\nfrom d...
[ [ "numpy.asarray", "numpy.argmax", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "numpy.array" ] ]
mumingpo/590op-final-project
[ "95851d2f430cdc24b9d834c6a50b069fc637a8ed" ]
[ "src/data_utils.py" ]
[ "import numpy as np\n\ndef read_data(path, M, N, offset=0):\n \"\"\"\n Read u.data in the default format.\n The memory cost associated with a [943, 1682] matrix of floats are not big,\n so we can still do this.\n \"Might\" run into trouble for larger datasets,\n where we will need to handle things in batches....
[ [ "numpy.full", "numpy.zeros" ] ]
Alessi0X/GraKeL
[ "222fcdde4071afebeb3d7bd724b1f979ede8df7f" ]
[ "grakel/kernels/kernel.py" ]
[ "\"\"\"The main class file representing a kernel.\"\"\"\n# Author: Ioannis Siglidis <y.siglidis@gmail.com>\n# License: BSD 3 clause\nimport collections\nimport warnings\nimport copy\n\nimport numpy as np\n\nfrom sklearn.base import BaseEstimator\nfrom sklearn.base import TransformerMixin\nfrom sklearn.exceptions im...
[ [ "sklearn.utils.validation.check_is_fitted", "sklearn.externals.joblib.delayed", "sklearn.externals.joblib.Parallel", "numpy.diagonal", "numpy.outer", "numpy.triu" ] ]
atharvamh/Predicting-IDC-in-Breast-Cancer
[ "b9b4dff53256042947749c0ad0ba0536e9984a5a" ]
[ "data_preprocess.py" ]
[ "import os\nimport numpy as np\nimport pandas as pd\nimport cv2\nimport matplotlib.pyplot as plt\nimport fnmatch\n\nfrom sklearn.model_selection import train_test_split\nfrom glob import glob\n\nimagePatches = glob('./IDC_regular_ps50_idx5/**/*.png',recursive = True)\n\ndef multiplot():\n plt.rcParams['figure.figs...
[ [ "numpy.sum", "matplotlib.pyplot.axis", "pandas.DataFrame", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.subplot", "numpy.array", "sklearn.model_selection.train_test_split", "numpy.mean" ] ]
BBarrow31500/molssi-best-practices
[ "737d46aaab087bb9d5c45d2d76bc6f2e879fa060" ]
[ "molecool/io/xyz.py" ]
[ "\"\"\"\nThis module reads and writes xyz files.\n\"\"\"\n\nimport os\nimport numpy as np\n\ndef open_xyz(file_location):\n \n # Open an xyz file and return symbols and coordinates.\n xyz_file = np.genfromtxt(fname=file_location, skip_header=2, dtype='unicode')\n symbols = xyz_file[:,0]\n coords = (x...
[ [ "numpy.genfromtxt" ] ]
paroj/async-ev-cnn
[ "f7e70e75b07f43afef8ffd7eaf6f43ddefab0ae0" ]
[ "cython_setup.py" ]
[ "from sys import platform\nfrom distutils.core import setup\nfrom distutils.extension import Extension\nfrom Cython.Build import cythonize\nimport numpy\n\n\next_modules = [\n Extension(\n \"src.libs.cutils\",\n [\"src/libs/cutils.pyx\"],\n extra_compile_args=['/openmp' if platform == \"win3...
[ [ "numpy.get_include" ] ]
ryanpdwyer/sigutils
[ "341513f403dee0b2c49e9630c86f0483c0d2d359" ]
[ "sigutils/plot.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n\n- We should have plotting functions\n\n bode_ba(ba, ...)\n Takes an analog transfer function in ba form\n bode_z(b, a=1, fs, ...)\n Takes a digital transfer function in z form. Is fs, nyq, or dt preferred?\n bode_zpk(zpk, fs?, ...)\n Use zpk form (or...
[ [ "numpy.sum", "numpy.cumsum", "numpy.zeros", "matplotlib.pyplot.Circle", "numpy.logical_and", "numpy.isclose", "numpy.abs", "matplotlib.pyplot.subplots", "numpy.atleast_1d", "numpy.arange", "scipy.signal.lfilter", "scipy.signal.ss2zpk", "scipy.signal.tf2zpk", ...
cplan082-tech/project_csi4103
[ "987d19deacc8cb36c473adf33335fc63ae4aab10" ]
[ "datasets/plot.py" ]
[ "import csv\nimport math\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef read_csv_file(name):\n file = open(name)\n type(file)\n csvreader = csv.reader(file)\n\n header = []\n header = next(csvreader) #First line of CSV is name of headers\n\n \"Populates array with rows from CSV [[shou...
[ [ "matplotlib.pyplot.gcf", "matplotlib.pyplot.axis", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter" ] ]
shahviraj/pgdgan
[ "97fb63547144f02d76ef0c384b9e2fbbb90c9d50" ]
[ "src/dcgan_utils.py" ]
[ "# Files of this project is modified versions of 'https://github.com/AshishBora/csgm', which\n#comes with the MIT licence: https://github.com/AshishBora/csgm/blob/master/LICENSE\n\n\"\"\"Utils for the DCGAN model\nFile based on : https://github.com/carpedm20/DCGAN-tensorflow/blob/master/utils.py\nIt comes with the ...
[ [ "numpy.array", "numpy.zeros" ] ]
LYHTHU/MixMatch-pytorch
[ "a738cc95aae88f76761aeeb405201bc7ae200e7d" ]
[ "dataset/cifar10.py" ]
[ "import numpy as np\nfrom PIL import Image\n\nimport torchvision\nimport torch\n\nclass TransformTwice:\n def __init__(self, transform):\n self.transform = transform\n\n def __call__(self, inp):\n out1 = self.transform(inp)\n out2 = self.transform(inp)\n return out1, out2\n\ndef ge...
[ [ "numpy.random.shuffle", "numpy.random.randn", "numpy.where", "torch.from_numpy", "numpy.random.rand", "numpy.array", "numpy.pad", "numpy.random.randint" ] ]
lvwuyunlifan/Tensorflow_to_learn_DL
[ "c534f36b580990342219b300c418ae13c070b9a5" ]
[ "chapter4/defined_cross.py" ]
[ "#--*--coding: utf-8 --*--\n\nimport tensorflow as tf\nfrom numpy.random import RandomState\n\n\nbacth_size = 8\n\n# 两个输入节点\nx = tf.placeholder(tf.float32, shape=[None, 2], name='x-input')\n# 回归问题一般只有一个输出节点\ny_ = tf.placeholder(tf.float32, shape=[None, 1], name='y-output')\n\n# 定义了一个单层的神经网络前向传播的过程, 这里就是简单的加权和\nw1 =...
[ [ "tensorflow.placeholder", "tensorflow.greater", "tensorflow.global_variables_initializer", "tensorflow.train.AdamOptimizer", "tensorflow.matmul", "numpy.random.RandomState", "tensorflow.Session", "tensorflow.random_normal" ] ]
ramaneswaran/quickvision
[ "ff494ea9c6ae09c129603b35236f314b25d56d27" ]
[ "quickvision/datasets/classification.py" ]
[ "# Add code for Mapping using dataframe containaing id and target.\n# Port from pytorch_cnn_trainer\n# https://github.com/oke-aditya/pytorch_cnn_trainer\n\nimport torchvision\nfrom torchvision import datasets\nfrom torch.utils.data import Dataset\nimport os\nimport torch\nfrom PIL import Image\n\n__all__ = [\"creat...
[ [ "torch.utils.data.random_split" ] ]
bakwadunka/dunka3
[ "265ec0964087bac524da9a3f3b07bc483a466c63" ]
[ "utils.py" ]
[ "import os\nimport pickle\nimport torch\nimport numpy as np\n\ndef save(toBeSaved, filename, mode='wb'):\n dirname = os.path.dirname(filename)\n if not os.path.exists(dirname):\n os.makedirs(dirname)\n file = open(filename, mode)\n pickle.dump(toBeSaved, file)\n file.close()\n\ndef load(filena...
[ [ "numpy.sum" ] ]
lalonderodney/D-Caps
[ "47050505170472abe1ea36e50903ea06054fcf07" ]
[ "utils.py" ]
[ "import os\nimport errno\n\nimport tensorflow as tf\nfrom keras import backend as K\n\ndef safe_mkdir(dir_to_make: str) -> None:\n '''\n Attempts to make a directory following the Pythonic EAFP strategy which prevents race conditions.\n\n :param dir_to_make: The directory path to attempt to make.\n :ret...
[ [ "tensorflow.identity", "tensorflow.local_variables_initializer", "tensorflow.control_dependencies" ] ]
antofuller/configaformers
[ "293253cd35d96c8a24c4004ba3d24fc6dc85a260" ]
[ "norm_module.py" ]
[ "import torch\nfrom torch import nn\nfrom utils import set_default\n\n\n# This module is dedicated to Norm Macdonald\n# Implementations from https://github.com/lucidrains/x-transformer\n\nclass RMSNorm(nn.Module):\n def __init__(self, dim, eps=1e-8):\n super().__init__()\n self.scale = dim ** -0.5\...
[ [ "torch.einsum", "torch.ones", "torch.nn.LayerNorm", "torch.norm" ] ]
achilleas-k/mne-python
[ "0078e1af13a92ab47498dd167bc5ec73be864427" ]
[ "mne/tests/test_cov.py" ]
[ "# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# Denis Engemann <denis.engemann@gmail.com>\n#\n# License: BSD (3-clause)\n\nimport os.path as op\nimport itertools as itt\n\nfrom numpy.testing import (assert_array_almost_equal, assert_array_equal,\n assert_...
[ [ "numpy.eye", "scipy.linalg.norm", "numpy.diff", "numpy.testing.assert_equal", "numpy.invert", "numpy.any", "numpy.argsort", "numpy.testing.assert_array_equal", "numpy.abs", "numpy.random.RandomState", "numpy.testing.assert_array_almost_equal", "numpy.all", "nump...
masap/optuna
[ "f56cea87c4771d53b39f441e727d733dd1785557" ]
[ "optuna/samplers/_tpe/parzen_estimator.py" ]
[ "from typing import Callable\nfrom typing import Dict\nfrom typing import NamedTuple\nfrom typing import Optional\nfrom typing import Tuple\nfrom typing import TYPE_CHECKING\n\nimport numpy as np\n\nfrom optuna import distributions\nfrom optuna._imports import _LazyImport\nfrom optuna.distributions import BaseDistr...
[ [ "numpy.sqrt", "numpy.sum", "numpy.cumsum", "numpy.empty", "numpy.zeros", "numpy.argsort", "numpy.asarray", "numpy.exp", "numpy.arange", "numpy.clip", "numpy.log", "numpy.maximum", "numpy.inner", "numpy.full", "numpy.round", "numpy.minimum" ] ]
ericlearning/Progressive-Image-Translation-Network
[ "972c54dfdbc4c065328f7fc54b2b47c2cefcc609" ]
[ "others/paired/progressive/dataset.py" ]
[ "import os\nimport torch\nimport random\nimport numpy as np\nfrom torchvision import datasets, transforms\nfrom torch.utils.data import DataLoader\nfrom PIL import Image\n\nclass Dataset():\n\tdef __init__(self, train_dir, basic_types = None, shuffle = True):\n\t\tself.train_dir = train_dir\n\t\tself.basic_types = ...
[ [ "torch.utils.data.DataLoader" ] ]
lim0606/pytorch-ardae-rl
[ "6e861d8f09ee27fa8f7b42d1eb209788c93395fa" ]
[ "main_ardae.py" ]
[ "\"\"\"\nPyTorch code for SAC-AR-DAE. Copied and modified from PyTorch code for SAC-NF (Mazoure et al., 2019): https://arxiv.org/abs/1905.06893\n\"\"\"\n\nimport os\nimport sys\nimport argparse\nimport time\nimport datetime\nimport itertools\nimport random\nimport pickle\nimport glob\n\nimport gym\nimport numpy as ...
[ [ "numpy.random.uniform", "torch.median", "torch.cuda.manual_seed", "torch.manual_seed", "pandas.DataFrame", "numpy.random.seed", "torch.var", "torch.cuda.is_available", "torch.mean", "torch.random.manual_seed", "numpy.mean" ] ]
rezeck/grf_transport
[ "64d68dc18b950575c19e44d91ade87b01a1e9ab0" ]
[ "script/eval_1_mean_plot.py" ]
[ "#!/usr/bin/env python\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport scipy.stats\nimport sys\n\n\ndef mean_confidence_interval(data, confidence=0.95):\n a = 1.0 * np.array(data)\n n = len(a)\n m, se = np.mean(a), scipy.stats.sem(a)\n h = se * scipy.stats.t.ppf((1 + confidence) / 2., n-1...
[ [ "numpy.load", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "numpy.array", "numpy.mean" ] ]
jizhouh/deepcell-tf
[ "491ece59f5024d73429477ebdcb437a6e67d766b" ]
[ "deepcell/running.py" ]
[ "# Copyright 2016-2021 The Van Valen Lab at the California Institute of\n# Technology (Caltech), with support from the Paul Allen Family Foundation,\n# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.\n# All rights reserved.\n#\n# Licensed under a modified Apache License, Version 2.0 (the \...
[ [ "numpy.pad", "tensorflow.keras.backend.image_data_format" ] ]
wumpus/poliastro
[ "6ef314f3b80528018ce489fd51d26db106daac91" ]
[ "src/poliastro/twobody/angles.py" ]
[ "\"\"\"Angles and anomalies.\n\n\"\"\"\nimport numpy as np\nfrom astropy import coordinates, units as u\n\nfrom poliastro import constants\nfrom poliastro.core.angles import (\n D_to_M as D_to_M_fast,\n D_to_nu as D_to_nu_fast,\n E_to_M as E_to_M_fast,\n E_to_nu as E_to_nu_fast,\n F_to_M as F_to_M_fa...
[ [ "numpy.sin" ] ]
jfc43/robust-attribution-regularization
[ "fad85f40d4b1c2efcd851c32216b4549e7122421" ]
[ "GTSRB/eval_attribution_attack.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom datetime import datetime\nimport numpy as np\nimport shutil\nimport json\nimport math\nimport os\nimport sys\nimport time\n\nimport tensorflow as tf\nimport gtsrb_input\nfrom model import Model\n\...
[ [ "tensorflow.contrib.framework.get_or_create_global_step", "numpy.zeros", "numpy.argmin", "numpy.random.seed", "tensorflow.train.latest_checkpoint", "tensorflow.train.Saver", "tensorflow.Session", "tensorflow.ConfigProto", "numpy.mean" ] ]
weixiong-zheng-berkeley/BART-lite
[ "ead39f757acab936af815352262080318163debb" ]
[ "mesh.py" ]
[ "import matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib import cm\n\nimport numpy as np\n\nclass Mesh(object):\n def __init__(self, mesh_cells, domain_upper, mat_map):\n assert type(mesh_cells) == int, \"mesh_cells must be an int\"\n self._mesh_params = {'x_cell':...
[ [ "numpy.zeros", "matplotlib.pyplot.figure", "numpy.reshape", "numpy.arange", "matplotlib.pyplot.show" ] ]
PaulWang1905/tensorflow
[ "ebf12d22b4801fb8dab5034cc94562bf7cc33fa0" ]
[ "tensorflow/python/training/experimental/loss_scale.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.math_ops.equal", "tensorflow.python.ops.variable_scope.variable", "tensorflow.python.training.tracking.base.TrackableReference", "tensorflow.python.util.tf_export.tf_export", "tensorflow.python.ops.math_ops.maximum", "tensorflow.python.framework.ops.get_default_graph...
quickgrid/Chunkmogrify
[ "10fb9ab3eef0fb50cec0e474ab48333032ee3c3b" ]
[ "styleclip_mapper.py" ]
[ "import math\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch.nn import Module\n\ndef fused_leaky_relu(input, bias, negative_slope=0.2, scale=2 ** 0.5):\n rest_dim = [1] * (input.ndim - bias.ndim - 1)\n input = input.cuda()\n if input.ndim == 3:\n return (\n ...
[ [ "torch.load", "torch.nn.functional.linear", "torch.randn", "torch.zeros_like", "torch.nn.Sequential", "torch.zeros", "torch.cat", "torch.mean" ] ]
RomaKoks/collie_recs
[ "bc8979c8dbf68deefb030336d50f07f788cf1667" ]
[ "collie/metrics.py" ]
[ "from typing import Any, Callable, Iterable, List, Optional, Tuple, Union\nimport warnings\n\nimport numpy as np\nimport pytorch_lightning\nfrom scipy.sparse import csr_matrix\nimport torch\nfrom torchmetrics import Metric\nfrom torchmetrics.functional import auroc\nfrom tqdm.auto import tqdm\n\nimport collie\nfrom...
[ [ "torch.no_grad", "torch.tensor", "torch.arange", "torch.cuda.is_available", "torch.isnan", "torch.sigmoid", "numpy.unique" ] ]
RausellLab/tiresias
[ "2acca303a0f6b4b1be784f597a59c1a883dbe43d" ]
[ "src/pipeline/validation/loocv/bagging_logistic_regression.py" ]
[ "import ray\nimport mlflow\nimport torch\nfrom src.models import Bagging\nfrom src.models import LogisticRegression\nfrom src.evaluation import loocv\nfrom src.utils import data_loaders\nfrom src.utils import data_savers\nfrom src.utils import mlflow as u_mlflow\n\n\nRUN_NAME = \"Bagging Logistic Regression\"\nMODE...
[ [ "torch.cat" ] ]
iwasakishuto/Keras-Imitation
[ "8ac0cd7c8912d49d13b19a0182ad534c0781fbfe" ]
[ "kerasy/initializers.py" ]
[ "# coding: utf-8\nimport re\nimport numpy as np\nfrom scipy import stats\nfrom abc import ABCMeta, abstractmethod\n\nfrom .utils import mk_class_get\nfrom .utils import handleKeyError\nfrom .utils import handleRandomState\n\nclass KerasyAbstInitializer(metaclass=ABCMeta):\n def __init__(self):\n self.name...
[ [ "numpy.ones", "numpy.eye", "numpy.zeros", "numpy.linalg.svd", "scipy.stats.truncnorm", "numpy.prod", "numpy.sqrt", "numpy.full" ] ]
kartik-hegde/mindmappings
[ "e96f2a287da2a93c4af0794a3bab1211bc95ba0a" ]
[ "mindmappings/costModel/timeloop/model_cnn.py" ]
[ "import random\nimport itertools\nimport subprocess as sp\nimport os\nimport shutil\nfrom subprocess import STDOUT\nimport os, sys\nimport numpy as np\n\nfrom mindmappings.parameters import Parameters\nfrom mindmappings.costModel.timeloop.timeloop import Timeloop\nfrom mindmappings.utils.utils import factors, repli...
[ [ "numpy.array" ] ]
Krishna00111/Machine-Learning-from-Scratch
[ "5d6f5b1a2096acbb57a060385e471123b77b9a68" ]
[ "mlfromscratch/supervised_learning/bayesian_regression.py" ]
[ "from __future__ import print_function, division\r\nimport numpy as np\r\nfrom scipy.stats import chi2, multivariate_normal\r\nfrom mlfromscratch.utils import mean_squared_error, train_test_split, polynomial_features\r\n\r\n\r\n\r\nclass BayesianRegression(object):\r\n \"\"\"Bayesian regression model. If poly_de...
[ [ "numpy.empty", "numpy.shape", "numpy.linalg.pinv", "scipy.stats.chi2.rvs", "numpy.percentile", "numpy.mean" ] ]
matthew-brett/statsmodels
[ "915c9dc2d762c5592ac17a7cf5f1cc957fcbde1c", "915c9dc2d762c5592ac17a7cf5f1cc957fcbde1c" ]
[ "scikits/statsmodels/datasets/stackloss/data.py", "scikits/statsmodels/nonparametric/bandwidths.py" ]
[ "\"\"\"Stack loss data\"\"\"\n\n__all__ = ['COPYRIGHT','TITLE','SOURCE','DESCRSHORT','DESCRLONG','NOTE', 'load']\n\n\n__docformat__ = 'restructuredtext'\n\nCOPYRIGHT = \"\"\"This is public domain. \"\"\"\nTITLE = __doc__\nSOURCE = \"\"\"\nBrownlee, K. A. (1965), \"Statistical Theory and Methodology in\...
[ [ "numpy.array", "numpy.column_stack" ], [ "scipy.stats.scoreatpercentile", "numpy.std" ] ]
vutuanhai237/QuantumTomographyProject
[ "78058e3faece2209e46c9f9e16a1c38cdb33e7e2" ]
[ "codes/qtm/qcompilation.py" ]
[ "import qtm.base\nimport qtm.optimizer\nimport qtm.loss\nimport qtm.utilities\nimport numpy as np\nimport typing, types\nimport qiskit\nimport matplotlib.pyplot as plt\n\nclass QuantumCompilation():\n def __init__(self) -> None:\n self.u = None\n self.vdagger = None\n self.is_trained = False...
[ [ "numpy.array", "numpy.savetxt" ] ]
snoopycrimecop/scripts
[ "7ec5df31e83f1fda7efc02aca3f3426174547308" ]
[ "omero/util_scripts/Combine_Images.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n-----------------------------------------------------------------------------\n Copyright (C) 2006-2014 University of Dundee. All rights reserved.\n\n\n This program is free software; you can redistribute it and/or modify\n it under the terms of the GNU Ge...
[ [ "numpy.zeros" ] ]
yecharlie/keras-retinanet
[ "abcc99ecb75293b895b4e1be274ddc84e76f9c84" ]
[ "keras_retinanet/bin/evaluate.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\nUnless requ...
[ [ "tensorflow.ConfigProto", "tensorflow.Session" ] ]
ishatserka/MachineLearningAndDataAnalysisCoursera
[ "c54661f13857d5bcb0095ba2fb12f5a403a4a70f" ]
[ "venv/Lib/site-packages/pybrain2/rl/learners/valuebased/interface.py" ]
[ "__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'\n\nfrom pybrain.utilities import abstractMethod\nfrom pybrain.structure.modules import Table, Module, TanhLayer, LinearLayer, BiasUnit\nfrom pybrain.structure.connections import FullConnection\nfrom pybrain.structure.networks import FeedForwardNetwork\nfrom pyb...
[ [ "scipy.asarray" ] ]
joshz123/tensorflow
[ "7841ca029060ab78e221e757d4b1ee6e3e0ffaa4", "7841ca029060ab78e221e757d4b1ee6e3e0ffaa4" ]
[ "tensorflow/python/keras/layers/serialization.py", "tensorflow/python/ops/linalg/linalg_impl.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.python.keras.utils.generic_utils.deserialize_keras_object", "tensorflow.python.keras.utils.generic_utils.serialize_keras_object", "tensorflow.python.util.tf_inspect.isclass", "tensorflow.python.util.tf_export.keras_export", "tensorflow.python.tf2.enabled" ], [ "tensorflow.p...
zanzibar7/python-skyfield
[ "332038d49ea5814061336cd70cad1d819e630f2b" ]
[ "skyfield/tests/test_earth_satellites.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom numpy import array\nfrom skyfield import api\nfrom skyfield.api import EarthSatellite, load\nfrom skyfield.constants import AU_KM, AU_M\nfrom skyfield.sgp4lib import TEME_to_ITRF\nfrom skyfield.timelib import julian_date\n\nline1 = '1 25544U 98067A 18184.80969102 .00001614 00000...
[ [ "numpy.array" ] ]
yamasampo/alignmentrs
[ "5f963d13ac2db72f4ef23b462de0836526f590b7" ]
[ "alignmentrs/aln/mixins/serde.py" ]
[ "from collections import OrderedDict, ChainMap\nfrom copy import deepcopy\nimport os\nimport json\nimport pickle\nimport re\nimport io\n\nimport pandas\n\nfrom libalignmentrs.alignment import SeqMatrix\nfrom libalignmentrs.readers import fasta_to_dict\nfrom alignmentrs.utils import to_intlist\n\n\n__all__ = [\n ...
[ [ "pandas.DataFrame" ] ]
lmmentel/mendeleev
[ "f6ac866c831e3041910ae97a7177301b1be5b3e7" ]
[ "mendeleev/vis/seaborn.py" ]
[ "from typing import Tuple\nimport seaborn as sns\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n\ndef heatmap(\n elements: pd.DataFrame,\n prop: str,\n style: str = \"whitegrid\",\n figsize: Tuple[int] = (16, 10),\n cmap: str = \"RdBu_r\",\n lw: int = 1,\n output: ...
[ [ "matplotlib.pyplot.savefig" ] ]
baoy-nlp/DSS-VAE
[ "855f5722301b2d22aef622e7bb8fef74a759f9de" ]
[ "dss_vae/structs/distance_tree.py" ]
[ "import re\n\nimport nltk\nimport numpy\n\nword_tags = ['CC', 'CD', 'DT', 'EX', 'FW', 'IN', 'JJ', 'JJR',\n 'JJS', 'LS', 'MD', 'NN', 'NNS', 'NNP', 'NNPS', 'PDT',\n 'POS', 'PRP', 'PRP$', 'RB', 'RBR', 'RBS', 'RP',\n 'SYM', 'TO', 'UH', 'VB', 'VBD', 'VBG', 'VBN', 'VBP',\n ...
[ [ "numpy.argmax" ] ]
AlexLJC/MLTetris
[ "dc47321746bcd67989cb7190941827c317036d6b" ]
[ "python/TetrisDRL.py" ]
[ "# Import\nimport tensorflow as tf\nimport numpy as np\nimport pandas as pd\nfrom collections import deque\nimport random\n\nimport tetris as tetris\n\n\n# Hyperparameter \n\nnum_episodes = 500\nnum_exploration_episodes = 100\nmax_len_episode = 1000\nbatch_size = 40\nlearning_rate = 0.005\ngamma = 0.95\ninitial_eps...
[ [ "tensorflow.keras.models.Sequential", "tensorflow.keras.optimizers.Adam", "numpy.reshape", "numpy.argmax", "numpy.random.random", "tensorflow.keras.layers.Dense", "numpy.array" ] ]
rocketbot-cl/recognition
[ "cca8a87070ccaca3a26e37345c36ab1bf836e258" ]
[ "libs/imutils/feature/rootsift.py" ]
[ "# import the necessary packages\r\nfrom __future__ import absolute_import\r\nimport numpy as np\r\nimport cv2\r\nfrom ..convenience import is_cv2\r\n\r\nclass RootSIFT:\r\n\tdef __init__(self):\r\n\t\t# initialize the SIFT feature extractor for OpenCV 2.4\r\n\t\tif is_cv2():\r\n\t\t\tself.extractor = cv2.Descripto...
[ [ "numpy.sqrt" ] ]
Purple-PI/rlstructures
[ "9b201b083715bbda2f3534b010c84e11dfc0a1c7" ]
[ "rlstructures/deprecated/batchers/buffers.py" ]
[ "#\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\n\nimport torch\nimport torch.multiprocessing as mp\nfrom rlstructures import TemporalDictTensor, DictTensor\n\n\nclass Buffer:...
[ [ "torch.Size", "torch.tensor", "torch.multiprocessing.Queue", "torch.zeros", "torch.device", "torch.cat" ] ]
pvaneck/tfjs-converter
[ "074ed3252fab3d913679d5415a5e530efd4966b3" ]
[ "python/tensorflowjs/converters/keras_h5_conversion_test.py" ]
[ "# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed t...
[ [ "numpy.ones", "numpy.zeros", "tensorflow.keras.Model", "tensorflow.keras.layers.Dense", "tensorflow.keras.Input" ] ]
wangxr0526/RetroPrime
[ "a765b670b72fbfd512d0d437da8f27a95f9f0554", "a765b670b72fbfd512d0d437da8f27a95f9f0554" ]
[ "retroprime/data_process/clean_uspto.py", "retroprime/transformer_model/onmt/modules/position_ffn_h.py" ]
[ "from __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import division\n\nimport argparse\n\nimport numpy as np\nimport random\nimport csv\nimport os\nimport sys\nimport re\nfrom tqdm import tqdm\nfrom rdkit import Chem\nimport pickle as cp\n\n\ndef get_rxn_smiles(prod, reac...
[ [ "numpy.random.seed" ], [ "torch.nn.ReLU", "torch.nn.Dropout" ] ]
liuchangtai1996/MLIP
[ "ec217d592b8c51e98729d8c2b2abe1b2d918e14f" ]
[ "code/resnet_approach/prepare.py" ]
[ "import numpy as np\r\nimport cv2\r\n\r\ndef load_batch(ls,od,data_path,batch_size,which_batch):\r\n image_list=[]\r\n for i in range(which_batch*batch_size,(which_batch+1)*batch_size):\r\n image=[]\r\n image.append(cv2.imread(data_path+ls[od[i]]+'_red.png',0))\r\n image.append(cv2.imread...
[ [ "numpy.asarray" ] ]
19tony97/Autonomous_vheicle_drivingProject
[ "3938b132e11f7705bff2c2004ee80e1f87438565" ]
[ "behavioural_planner.py" ]
[ "#!/usr/bin/env python3\n\nimport numpy as np\nimport math\n\nfrom obstacle_detection import check_for_obs\n\n# State machine states\nFOLLOW_LANE = 0\nDECELERATE_TO_STOP = 1\nSTAY_STOPPED = 2\n# Stop speed threshold\nSTOP_THRESHOLD = 0.02\n# Number of cycles before moving from stop sign.\n\nSEMAPHORE = 3\n\nSTOP_CO...
[ [ "numpy.sqrt", "numpy.divide", "numpy.linalg.norm", "numpy.dot" ] ]
QuintonWeenink/pso
[ "f6fbb4c5889745d5747b367ecb3c9833805d9963" ]
[ "mlpy/particleSwarmOptimization/structure/particle.py" ]
[ "import numpy as np\n\nclass Particle(object):\n def __init__(self, bounds, weight, cognitiveConstant, socialConstant):\n self.position = None # particle position\n self.velocity = None # particle velocity\n\n self.best_position = None # best position individual\n self.best_error =...
[ [ "numpy.array", "numpy.random.random" ] ]
JeremieMelo/pytorch-onn
[ "670996112277a6c19c7da400afbe0a4ce45ad5de" ]
[ "examples/core/models/mzi_cnn.py" ]
[ "\"\"\"\nDescription:\nAuthor: Jiaqi Gu (jqgu@utexas.edu)\nDate: 2021-06-07 03:43:40\nLastEditors: Jiaqi Gu (jqgu@utexas.edu)\nLastEditTime: 2021-06-07 03:43:40\n\"\"\"\n\nfrom torchonn.op.mzi_op import project_matrix_to_unitary\nfrom typing import List, Union\n\nimport torch\nfrom torch import Tensor, nn\nfrom tor...
[ [ "torch.nn.BatchNorm2d", "torch.flatten", "torch.nn.AdaptiveAvgPool2d", "torch.device", "torch.nn.Sequential", "torch.nn.ReLU" ] ]
888yzbt888/Pensieve-multiagent
[ "b5409c949a4855afedc910de5dd6eabe076567cc" ]
[ "demo/demo.py" ]
[ "import time\nimport bisect\nimport cv2 as cv\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\nfrom matplotlib import gridspec\n\n\nVIDEO_FILE = 'la_luna.mp4'\nRL_BITRATE_FILE = './rl_bitrate'\nRL_BUFFER_FILE = './rl_buffer'\nMPC_BITRATE_FILE = './mpc_bitrate'\nMPC_BUF...
[ [ "numpy.ones", "matplotlib.pyplot.figure", "matplotlib.pyplot.subplot", "matplotlib.animation.FuncAnimation", "matplotlib.gridspec.GridSpec" ] ]
caoyi0905/Surprise
[ "1a707b32a3a68b0eb3f23b829b57604a131e00f7" ]
[ "tests/test_dataset.py" ]
[ "\"\"\"\nModule for testing the Dataset class.\n\"\"\"\n\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\nimport os\nimport random\n\nimport pytest\nimport pandas as pd\n\nfrom surprise import BaselineOnly\nfrom surprise import Dataset\nfrom surprise im...
[ [ "pandas.DataFrame" ] ]
jfw225/ptlib
[ "a78ef707ed09aa9c1f1b1157a20e3d9d3fb04c4d" ]
[ "tests/queue_test.py" ]
[ "import cv2\nimport pickle\nimport numpy as np\n\nimport ptlib as pt\nfrom ptlib.core.metadata import MetadataManager\nfrom ptlib.core.queue import Queue\n\n\nclass VideoIngest(pt.Task):\n # variables here are static\n NUM_WORKERS = 1\n\n VIDEO_PATH = \"C:\\\\Users\\\\Owner\\\\Videos\\\\Battlefield 2042 Op...
[ [ "numpy.zeros" ] ]
vipksmosar/habr_rss_parse
[ "91fa3df3db3a1416348237919824696239d4cb29" ]
[ "airflow/airflow_own/plugins/WRITER.py" ]
[ "import os\ntry:\n import pandas as pd\nexcept:\n os.system('pip3 install pandas')\n import pandas as pd\ntry:\n import psycopg2\nexcept:\n os.system('pip3 install psycopg2-binary')\n import psycopg2\nimport numpy as np\nfrom psycopg2.extensions import register_adapter, AsIs\npsycopg2.extensions.r...
[ [ "pandas.DataFrame", "pandas.concat", "pandas.read_parquet" ] ]
where-is-brett/tensorflow
[ "5da8599b2cf9edfb9fac4431c705501bf7ceccd8", "5da8599b2cf9edfb9fac4431c705501bf7ceccd8" ]
[ "tensorflow/lite/testing/op_tests/unroll_batch_matmul.py", "tensorflow/python/keras/layers/preprocessing/image_preprocessing.py" ]
[ "# Copyright 2019 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.lite.testing.zip_test_utils.create_tensor_data", "tensorflow.lite.testing.zip_test_utils.register_make_test_function", "tensorflow.compat.v1.matmul", "tensorflow.compat.v1.compat.v1.placeholder", "tensorflow.lite.testing.zip_test_utils.make_zip_of_tests", "tensorflow.compat.v1....