repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
smly/Landmark2019-1st-and-3rd-Place-Solution
[ "9839c9cbc6bec15e69e91d1d7c8be144531d5a33" ]
[ "src/FishNet/utils/profile.py" ]
[ "import torch\nfrom torch.autograd.variable import Variable\nimport numpy as np\n\n\nUSE_GPU = torch.cuda.is_available()\n\n\ndef calc_flops(model, input_size):\n global USE_GPU\n\n def conv_hook(self, input, output):\n batch_size, input_channels, input_height, input_width = input[0].size()\n ou...
[ [ "torch.rand", "torch.cuda.is_available" ] ]
l-tang/sui
[ "b5a5ecd744b836bb13d2ec1f2a52bc263eb2fbb4" ]
[ "sui/dl/pnn.py" ]
[ "\"\"\"Product-based Neural Networks\nhttps://arxiv.org/pdf/1611.00144.pdf\nDate: 14/Jul/2020\nAuthor: Li Tang\n\"\"\"\nimport tensorflow as tf\nfrom tensorflow.keras.layers import Activation, BatchNormalization, Dense, Dropout\n\nfrom .initializers import get_init\nfrom .losses import get_loss\nfrom .optimizers im...
[ [ "tensorflow.convert_to_tensor", "tensorflow.concat", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.Embedding", "tensorflow.keras.layers.Dense", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.einsum", "tensorflow.keras.layers.BatchNormalization", "ten...
christiancosgrove/cs767hw4
[ "4a3a1e2eeee448ab5b8eadfcf5d5becf7268630e" ]
[ "parlai/agents/transformer/polyencoder.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n# hack to make sure -m transformer/generator works as expected\n\"\"\"\nPoly-encoder Agent.\n\"\"\"\nfrom .bien...
[ [ "torch.nn.CrossEntropyLoss", "torch.nn.init.uniform_", "torch.nn.Parameter", "torch.empty", "torch.cat", "torch.sum", "torch.nn.init.normal_", "torch.nn.DataParallel" ] ]
aleozlx/rpi-ledstrip-audio
[ "ab42f4815534115b98ca74aafe18f3ac293d566d" ]
[ "main.py" ]
[ "# official sample\n# https://python-sounddevice.readthedocs.io/en/0.3.14/examples.html#real-time-text-mode-spectrogram\n\nimport argparse\nimport math\nimport shutil\nimport socket\nimport numpy as np\nimport sounddevice as sd\nfrom matplotlib import cm\n\nusage_line = ' press <enter> to quit, +<enter> or -<enter>...
[ [ "matplotlib.cm.plasma", "numpy.fft.rfft", "numpy.clip" ] ]
AluminiumOxide/pytorch_base_-tutorial
[ "a6d3bea6070c7c774dcd7c55d94b0a1441548c8b" ]
[ "note5_3_nn_pool.py" ]
[ "import torch\r\nimport torchvision\r\nfrom torch import nn\r\nfrom torch.nn import MaxPool2d\r\nfrom torch.utils.data import DataLoader\r\nfrom torch.utils.tensorboard import SummaryWriter\r\n\r\ndataset = torchvision.datasets.CIFAR10(\"./CIFAR10\", train=False, download=True,transform=torchvision.transforms.ToTen...
[ [ "torch.nn.MaxPool2d", "torch.utils.data.DataLoader", "torch.utils.tensorboard.SummaryWriter" ] ]
tbs-lab/pycodes
[ "2ab296d9ebde6efd5bcefb905721d319e866cd69" ]
[ "DirectMethods/solver.py" ]
[ "# -*- coding: utf-8 -*-\nimport numpy as np\nimport scipy.linalg as spla\n\nfrom util import genp_factorize, gepp_factorize\nfrom butterfly import build_recursive_butterfly\n\n\ndef forward(L, b):\n \"\"\"Return a solution x of a linear system Lx = b with forward\n substitution.\n\n Arguments:\n L ...
[ [ "numpy.dot", "numpy.array", "numpy.identity", "scipy.linalg.solve_triangular" ] ]
alan-cueva/wefe
[ "4c155c11c7836d05fb8d951f36ae1fc2d37c3655" ]
[ "wefe/metrics/RND.py" ]
[ "\"\"\"Relative Norm Distance (RND) metric implementation.\"\"\"\r\nfrom typing import Any, Callable, Dict, List, Tuple, Union\r\n\r\nimport numpy as np\r\nfrom sklearn.metrics.pairwise import cosine_similarity\r\nfrom wefe.metrics.base_metric import BaseMetric\r\nfrom wefe.preprocessing import get_embeddings_from_...
[ [ "numpy.average", "numpy.subtract", "sklearn.metrics.pairwise.cosine_similarity" ] ]
gunjanpatil/keras_imagenet
[ "5bc50245d8061e634fda291f1d22a581ee329eb5" ]
[ "models/efficientnet.py" ]
[ "# Copyright 2019 The TensorFlow Authors, Pavel Yakubovskiy, Björn Barz. 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/license...
[ [ "tensorflow.keras.backend.backend", "tensorflow.keras.layers.Conv2D", "tensorflow.python.keras.backend.is_keras_tensor", "tensorflow.keras.layers.DepthwiseConv2D", "tensorflow.keras.backend.sigmoid", "tensorflow.keras.backend.image_data_format", "tensorflow.keras.models.Model", "te...
xingularity/yellowbrick
[ "d13065786b25323558c493222d39b67f6b5243d9" ]
[ "yellowbrick/utils/helpers.py" ]
[ "# yellowbrick.utils.helpers\n# Helper functions and generic utilities for use in Yellowbrick code.\n#\n# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>\n# Created: Fri May 19 10:39:30 2017 -0700\n#\n# Copyright (C) 2017 District Data Labs\n# For license information, see LICENSE.txt\n#\n# ID: helpers...
[ [ "numpy.log", "numpy.true_divide", "numpy.isfinite", "numpy.asarray", "numpy.arange", "numpy.in1d", "numpy.all", "numpy.isscalar", "numpy.errstate" ] ]
KonduitAI/ImportTests
[ "1b05adac04d1b04fe4492d3fd35f3c4573774ceb" ]
[ "tests/OLD/mathops/test_partition_stitch_misc.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom tfoptests.persistor import TensorFlowPersistor\nfrom tfoptests.test_graph import TestGraph\n\n'''\nNo training.\nTensor Transforms with rearranging values and some random ops\n'''\n\n\nclass TensorRearrange(TestGraph):\n def __init__(self, *args, **kwargs):\n ...
[ [ "tensorflow.transpose", "tensorflow.count_nonzero", "tensorflow.divide", "tensorflow.div", "tensorflow.dynamic_stitch", "tensorflow.random_normal", "numpy.random.uniform", "tensorflow.trace" ] ]
robolableonardo/franka_ros
[ "b9b60e8a8316593b6a82d3bfa48a5b89155f42a5" ]
[ "franka_example_controllers/scripts/interactive_marker.py" ]
[ "#!/usr/bin/env python\n\nimport rospy\nimport tf.transformations\nimport numpy as np\n\nfrom interactive_markers.interactive_marker_server import \\\n InteractiveMarkerServer, InteractiveMarkerFeedback\nfrom visualization_msgs.msg import InteractiveMarker, \\\n InteractiveMarkerControl\nfrom geometry_msgs.ms...
[ [ "numpy.reshape", "numpy.linalg.norm" ] ]
cdyfng/pyalgotrade
[ "c9e8d950c8d911d5f1bed7d821c4cf6fd37f3a3c" ]
[ "pyalgotrade/technical/linreg.py" ]
[ "# PyAlgoTrade\n#\n# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz\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# Unle...
[ [ "numpy.asarray", "scipy.stats.linregress" ] ]
pzejdl/hls4ml
[ "d1e4b22d05a9d12dd23fb92280e35857fc8e9b69" ]
[ "hls4ml/model/hls_model.py" ]
[ "from __future__ import print_function\nimport six\nimport re\nimport numpy as np\nfrom enum import Enum\nfrom collections import OrderedDict\n\nfrom .templates import get_config_template, get_function_template\n\nclass HLSConfig(object):\n def __init__(self, config):\n self.config = config\n\n sel...
[ [ "numpy.log2", "numpy.ones_like", "numpy.nditer", "numpy.min", "numpy.transpose", "numpy.max", "numpy.log10", "numpy.zeros_like", "numpy.count_nonzero", "numpy.prod", "numpy.where" ] ]
oitoku/goshichigo
[ "d9e323ee023838907faf9af58ab2056e16224bc9" ]
[ "scratch/haiku_maker.py" ]
[ "import numpy as np\nfrom nltk.corpus import cmudict\nfrom nltk.corpus import stopwords\nfrom nltk.tokenize import word_tokenize\nstopWords = set(stopwords.words('english'))\n\n\nd = cmudict.dict()\ndef nsyl(word):\n\t\"\"\"Count syllables, or -1 if not found\"\"\"\n\ttry:\n\t\treturn [len(list(y for y in x if y[-1...
[ [ "numpy.random.rand" ] ]
lewisjared/scmdataframe
[ "d8893235b3d2898a21ef8cc45bb04d94c6b038fe" ]
[ "tests/integration/test_processing.py" ]
[ "import datetime as dt\nimport os.path\nimport re\n\nimport numpy as np\nimport pandas as pd\nimport pandas.testing as pdt\nimport pint.errors\nimport pytest\n\nimport scmdata.processing\nfrom scmdata import ScmRun\nfrom scmdata.errors import MissingRequiredColumnError, NonUniqueMetadataError\nfrom scmdata.testing ...
[ [ "pandas.MultiIndex.from_frame", "pandas.testing.assert_series_equal", "pandas.Series", "pandas.isnull", "pandas.DataFrame", "numpy.round", "pandas.testing.assert_frame_equal", "pandas.MultiIndex.from_product", "numpy.array" ] ]
sys-bio/roadrunner
[ "f0a757771ef0e337ddf7409284910e1627c3ad71" ]
[ "rrplugins/examples/python/parameter_minimization/telChiSquareAsFunctionOfTwoParameters.py" ]
[ "#-------------------------------------------------------------------------------\n# Purpose: Example demonstrating how to calculate the ChiSquare, using the\n# ChiSquare plugin, as a function of a TWO model parameters.\n#\n# This example are using example data in the file TwoParameters.dat, which is\n# generated u...
[ [ "matplotlib.pyplot.clabel", "numpy.linspace", "matplotlib.pyplot.title", "matplotlib.pyplot.contour", "matplotlib.pyplot.xlabel", "numpy.meshgrid", "numpy.zeros", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
353622088/tianchi
[ "e1f378e5fd783eb4cfbfaf8ecdd944b8fcfdd733" ]
[ "nets/inception_v4.py" ]
[ "# Copyright 2016 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 required...
[ [ "tensorflow.variable_scope", "tensorflow.nn.softmax", "tensorflow.concat", "tensorflow.reduce_mean" ] ]
Tobby666/polars
[ "8cedd5edf4c1056a255c2fb29c3cb5d173068e32" ]
[ "py-polars/polars/internals/series.py" ]
[ "import sys\nfrom datetime import date, datetime, timedelta\nfrom numbers import Number\nfrom typing import (\n Any,\n Callable,\n Dict,\n List,\n Optional,\n Sequence,\n Tuple,\n Type,\n Union,\n overload,\n)\n\nimport numpy as np\n\ntry:\n import pyarrow as pa\n\n _PYARROW_AVAI...
[ [ "numpy.log", "numpy.arctan", "numpy.power", "numpy.arcsin", "numpy.ascontiguousarray", "numpy.cos", "numpy.arccos", "numpy.sin", "numpy.tan", "numpy.argwhere", "numpy.log10", "numpy.array", "numpy.exp" ] ]
dumpmemory/deduplicate-text-datasets
[ "ad86c7f65ac626581fe3a4277106309bc6b50c23" ]
[ "scripts/make_suffix_array.py" ]
[ "# Copyright 2021 Google LLC\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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to ...
[ [ "numpy.log" ] ]
WGW101/habitat_sim2real
[ "04be5215af53122f166d6dfdfb131af3619d10a0" ]
[ "test/test_habitat_lab_citi.py" ]
[ "#!/usr/bin/env python3\n\nimport habitat\nimport cv2\nimport quaternion\nimport numpy\n\ncfg = habitat.get_config(\"configs/locobot_pointnav_citi_sim.yaml\")\nsim_cls = habitat.registry.get_simulator(cfg.SIMULATOR.TYPE)\nsim = sim_cls(cfg.SIMULATOR)\n\nobs = sim.reset()\nwhile True:\n state = sim.get_agent_stat...
[ [ "numpy.rad2deg" ] ]
AIRI-Institute/DeepCT
[ "8e23fda101bd4a2bce2c98c5a73d97072a3892de" ]
[ "src/deepct_model_multi_ct_q_mpi.py" ]
[ "\"\"\"\nDeepCT architecture without Sigmoid layer \nfor multiple cell type per position computation at once\nwith quantitative features (TODO: Add our names).\n\"\"\"\nimport os\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch import mean\nfrom torch.nn import MSELoss\nfrom torch.utils.tensor...
[ [ "torch.nn.BatchNorm1d", "torch.nn.Dropout", "torch.cat", "torch.eye", "torch.nn.MaxPool1d", "torch.nn.Linear", "torch.no_grad", "numpy.floor", "torch.nn.Conv1d", "torch.nn.ReLU" ] ]
anthonyivol/muzero-general
[ "ddeb263d7ca1653122fbaec5ab54824215280b2a" ]
[ "games/spiel.py" ]
[ "import datetime\nimport os\n\nimport numpy\nimport torch\n\nfrom .abstract_game import AbstractGame\n\n\n# This is a Game wrapper for open_spiel games. It allows you to run any game in the open_spiel library.\n\ntry:\n import pyspiel\n\nexcept ImportError:\n import sys\n sys.exit(\"You need to install ope...
[ [ "torch.cuda.is_available" ] ]
annahung31/REMI_PyTorch
[ "8ad15ff57f0a94633fc14b92ce533607c693569a" ]
[ "src/data.py" ]
[ "import os\r\nfrom collections import Counter\r\nfrom glob import glob\r\nimport numpy as np\r\nimport pickle\r\nimport utils\r\nfrom tqdm import tqdm\r\nimport string\r\nimport random\r\ndef extract_event(file_path):\r\n note_items, ticks_per_beat = utils.read_midi(file_path)\r\n note_items = utils.quantize_...
[ [ "numpy.load", "numpy.array", "numpy.save" ] ]
trpreston5/EXtra-data
[ "ca3b59894ae5ea519725e2834ec818ad3b859922" ]
[ "extra_data/tests/test_stacking.py" ]
[ "import numpy as np\nimport pytest\n\nfrom extra_data import RunDirectory, stack_data, stack_detector_data\nfrom extra_data.stacking import StackView\n\ndef test_stack_data(mock_fxe_raw_run):\n test_run = RunDirectory(mock_fxe_raw_run)\n tid, data = test_run.train_from_id(10000, devices=[('*/DET/*', 'image.da...
[ [ "numpy.zeros" ] ]
ahmad-sulehari/LabEngine
[ "9444dce96954c546333d5aecc92a06c3bfd19aa5" ]
[ "venv/Lib/site-packages/numpy/testing/_private/noseclasses.py" ]
[ "# These classes implement a doctest runner plugin for nose, a \"known failure\"\n# error class, and a customized TestProgram for NumPy.\n\n# Because this module imports nose directly, it should not\n# be used except by nosetester.py to avoid a general NumPy\n# dependency on nose.\nfrom __future__ import division, ...
[ [ "numpy.set_printoptions", "numpy.core._multiarray_tests.get_fpu_mode", "numpy.get_printoptions" ] ]
wx-b/NerfingMVS
[ "8c8f96244146b929a1495caf2719c090b48ac082" ]
[ "utils/depth_priors_utils.py" ]
[ "import torch\n\ndef compute_depth_loss(depth_pred, depth_gt, mask_gt):\n loss_list = []\n for pred, gt, mask in zip(depth_pred, depth_gt, mask_gt):\n log_pred = torch.log(pred[mask])\n log_target = torch.log(gt[mask])\n alpha = (log_target - log_pred).sum()/mask.sum()\n log_diff =...
[ [ "torch.stack", "torch.abs", "torch.log" ] ]
hoangtuanvu/rad_chestxray
[ "b29c2bf98ae41d85258b21674e8826847a0cc647" ]
[ "models/feature_extraction/inceptionresnetv2.py" ]
[ "from __future__ import print_function, division, absolute_import\nimport torch\nimport torch.nn as nn\nimport torch.utils.model_zoo as model_zoo\nfrom models.attention_map import BamBlock\n\n__all__ = ['InceptionResNetV2', 'inceptionresnetv2']\n\npretrained_settings = {\n 'inceptionresnetv2': {\n 'imagen...
[ [ "torch.cat", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.Linear", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.utils.model_zoo.load_url" ] ]
cokezrr/transformers
[ "794889f0aea28df30efe9d35358ed8cf335cc2f3" ]
[ "src/normalization/MPN.py" ]
[ "'''\n@file: MPNCOV.py\n@author: Jiangtao Xie\n@author: Peihua Li\nPlease cite the paper below if you use the code:\n\nPeihua Li, Jiangtao Xie, Qilong Wang and Zilin Gao. Towards Faster Training of Global Covariance Pooling Networks by Iterative Matrix Square Root Normalization. IEEE Int. Conf. on Computer Vision a...
[ [ "torch.sqrt", "torch.eye", "torch.ones", "torch.zeros" ] ]
zhaox1n/spark
[ "1f150b9392706293946278dd35e8f5a5016ed6df" ]
[ "python/pyspark/pandas/indexes/numeric.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "pandas.api.types.is_hashable", "pandas.Float64Index", "pandas.Int64Index" ] ]
KelSolaar/colour-science
[ "6c68f40544a0214614c4d01c2c3290e86406d9ad" ]
[ "colour/appearance/ciecam02.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCIECAM02 Colour Appearance Model\n================================\n\nDefines *CIECAM02* colour appearance model objects:\n\n- :class:`colour.appearance.InductionFactors_CIECAM02`\n- :attr:`colour.VIEWING_CONDITIONS_CIECAM02`\n- :class:`colour.CAM_Specification_CIECAM02`\n- ...
[ [ "numpy.radians", "numpy.maximum", "numpy.sqrt", "numpy.abs", "numpy.absolute", "numpy.linalg.inv", "numpy.isfinite", "numpy.isnan", "numpy.cos", "numpy.sin", "numpy.sign", "numpy.arctan2", "numpy.searchsorted", "numpy.exp", "numpy.array", "numpy.wher...
EricaXia/privacy
[ "a74561c929dfd01bc5f417ca42f8c7a100b349dc" ]
[ "tensorflow_privacy/privacy/analysis/privacy_ledger.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.compat.v1.Variable", "tensorflow.compat.v1.equal", "tensorflow.compat.v1.math.ceil", "tensorflow.compat.v1.assign", "tensorflow.compat.v1.nest.map_structure", "tensorflow.compat.v1.control_dependencies", "tensorflow.compat.v1.zeros", "tensorflow.compat.v1.executing_eage...
dnyaneshb25/dnyaneshbhonde
[ "f182448af374732e5b13c58fbcd62867310959ef" ]
[ "Code/YOLO/darkflow/darkflow/dark/layer.py" ]
[ "from ..utils import loader\nimport numpy as np\n\nclass Layer(object):\n\n def __init__(self, *args):\n self._signature = list(args)\n self.type = list(args)[0]\n self.number = list(args)[1]\n\n self.w = dict() # weights\n self.h = dict() # placeholders\n self.wshape = ...
[ [ "numpy.prod" ] ]
ENSYSTRA/EU-SES
[ "174b61aa9b3e0ffdcb843fa3c16c47c0c1175afd" ]
[ "euses/model.py" ]
[ "import geopandas as gpd\nimport pandas as pd\nimport sys\nimport ruamel.yaml\nfrom geopy import distance\nyaml = ruamel.yaml.YAML()\nfrom . import parameters as pr\nimport os\n\nvre_dic = {'Wind':['onshore_wind',5],'Solar':['rooftop_pv',170],'Wind Offshore':['offshore_wind',5.36]}\n\ndc_links = pd.read_csv('data/l...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
vatsalag99/mapping_self-harm_risk_twitter
[ "262c36f994c909714a738686b025633d832bc596" ]
[ "app/Data Processing .py" ]
[ "\n# coding: utf-8\n\n# In[1]:\n\n\nimport warnings\nwarnings.filterwarnings(\"ignore\")\nimport ftfy\nimport matplotlib.pyplot as plt\nimport nltk\nimport numpy as np\nimport pandas as pd\nimport re\nimport time\n\nfrom math import exp\nfrom numpy import sign\n\nfrom sklearn.metrics import classification_report, ...
[ [ "pandas.read_csv", "numpy.zeros", "numpy.nditer", "pandas.DataFrame" ] ]
cschupbach/tmdb
[ "8ccf72f8d2e83b5605eff81a06a12961819b40c7" ]
[ "src/data/processed/process.py" ]
[ "import pandas as pd\nimport ast\nfrom datetime import datetime as dt\nfrom utils import parse\nfrom utils import edit_tools as tools\nfrom utils import networks\nfrom utils import finalize\n\n\ndef process_series_data():\n df = pd.read_csv('../../../data/raw/series.csv')\n df['network_id'] = parse.dict_colum...
[ [ "pandas.read_csv", "pandas.to_datetime" ] ]
filmackay/flypy
[ "d64e70959c5c8af9e914dcc3ce1068fb99859c3a" ]
[ "flypy/lib/arrays/tests/test_array.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import print_function, division, absolute_import\n\nimport unittest\nfrom flypy import jit\n\nimport numpy as np\n\nclass TestArrayAttributes(unittest.TestCase):\n\n def test_array_create(self):\n @jit\n def identity(a):\n return a\n\n a =...
[ [ "numpy.all", "numpy.arange", "numpy.array", "numpy.empty" ] ]
YoungjuNa-KR/Gaze_estimator_implementation
[ "c7b84189c263456c648829bc399a5edb2ec17bb8" ]
[ "utils/utils_image.py" ]
[ "import os\nimport math\nimport random\nimport numpy as np\nimport torch\nimport cv2\nfrom torchvision.utils import make_grid\nfrom datetime import datetime\n# import torchvision.transforms as transforms\nimport matplotlib.pyplot as plt\nfrom skimage.measure import compare_ssim\n\n'''\nmodified by Kai Zhang (github...
[ [ "torch.abs", "numpy.dot", "numpy.expand_dims", "numpy.squeeze", "numpy.flipud", "torch.sum", "numpy.mean", "torch.FloatTensor", "matplotlib.pyplot.tight_layout", "numpy.arange", "numpy.matmul", "torch.from_numpy", "numpy.copy", "numpy.float32", "matplotl...
MuyanXiao/models
[ "819ea3479f0754b34cab9d23ed0a3f9242d85bf6" ]
[ "research/deeplab/eval.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 requi...
[ [ "tensorflow.metrics.mean_iou", "tensorflow.not_equal", "tensorflow.Graph", "tensorflow.reshape", "tensorflow.equal", "tensorflow.contrib.metrics.aggregate_metric_map", "tensorflow.zeros_like", "tensorflow.gfile.MakeDirs", "tensorflow.logging.info", "tensorflow.logging.set_v...
rlckd159/deep-graph-matching-consensus
[ "1656cdae27c705a0aa6d2912a24e566b8b86e1b0" ]
[ "examples/pascal.py" ]
[ "import os.path as osp\n\nimport argparse\nimport torch\nfrom torch_geometric.datasets import PascalVOCKeypoints as PascalVOC\nimport torch_geometric.transforms as T\nfrom torch_geometric.data import DataLoader\n\nfrom dgmc.utils import ValidPairDataset\nfrom dgmc.models import DGMC, SplineCNN\n\nparser = argparse....
[ [ "torch.stack", "torch.utils.data.ConcatDataset", "torch.no_grad", "torch.cuda.is_available" ] ]
matthew-brett/THINGSvision
[ "f42aedec34bbe15f2d28e08f3c3666319d42bdec" ]
[ "thingsvision/cornet/cornet_r.py" ]
[ "from collections import OrderedDict\nimport torch\nfrom torch import nn\n\n\nHASH = '5930a990'\n\n\nclass Flatten(nn.Module):\n\n \"\"\"\n Helper module for flattening input tensor to 1-D for the use in Linear modules\n \"\"\"\n\n def forward(self, x):\n return x.view(x.size(0), -1)\n\n\nclass I...
[ [ "torch.zeros", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.AdaptiveAvgPool2d", "torch.nn.GroupNorm", "torch.nn.ReLU" ] ]
alxyok/kosmoss
[ "d471c8d7c9c171a99a1094f46a229e2aa415ab3b" ]
[ "src/kosmoss/hyperopt/graphs.py" ]
[ "import numpy as np\nimport os.path as osp\nfrom pytorch_lightning import LightningDataModule\nimport torch\nfrom torch_geometric.data import Dataset\nfrom torch_geometric.loader import DataLoader\nfrom typing import List, Tuple\n\nfrom kosmoss import CONFIG, DATA_PATH, METADATA\nfrom kosmoss.dataproc.flows import ...
[ [ "numpy.arange" ] ]
hellozhaojian/transformers
[ "2355176f1ab306ada8956a06c79e9d07def57cad" ]
[ "pre-train/bert_with_tpu.py" ]
[ "# encoding: utf-8\n# Copyright 2019 The DeepNlp 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 ...
[ [ "tensorflow.contrib.cluster_resolver.TPUClusterResolver", "tensorflow.contrib.tpu.TPUConfig", "tensorflow.train.latest_checkpoint", "tensorflow.contrib.tpu.TPUEstimator" ] ]
jdowlingmedley/pyomeca
[ "6cedcb0350140094e50e76afd2fa60d13005a485" ]
[ "tests/test_object_creation.py" ]
[ "import numpy as np\nimport pytest\nimport xarray as xr\n\nfrom pyomeca import Analogs, Markers, Angles, Rototrans\nfrom ._constants import ANALOGS_DATA, MARKERS_DATA, EXPECTED_VALUES\nfrom .utils import is_expected_array\n\n\ndef test_analogs_creation():\n dims = (\"channel\", \"time\")\n array = Analogs()\n...
[ [ "numpy.eye" ] ]
LDMDS/LDMDS-CME-TenYearFutures-CNN
[ "558d341750283e2867eda6cb2d473a197300bd31" ]
[ "PredictModel.py" ]
[ "from keras.models import Sequential\nfrom keras.layers import Convolution2D\nfrom keras.layers import MaxPooling2D\nfrom keras.layers import Flatten\nfrom keras.layers import Dense\nimport numpy as np\nfrom keras.preprocessing import image\nfrom keras.models import model_from_json\n#import pdb\n#from pprint import...
[ [ "numpy.expand_dims" ] ]
hyunwoongko/bert2bert-summarization
[ "69f90250cde5e66b132ad2f359d970c959f1a754" ]
[ "test.py" ]
[ "import json\nimport sys\n\nimport torch\nfrom tqdm import tqdm\n\nfrom transformers import EncoderDecoderConfig, BertConfig, EncoderDecoderModel\nfrom bert2bert import KoBertTokenizer\n\n\n@torch.no_grad()\ndef inference():\n step = sys.argv[1]\n encoder_config = BertConfig.from_pretrained(\"monologg/kobert\...
[ [ "torch.no_grad", "torch.load" ] ]
raybellwaves/xESMF
[ "77e5d0839089ff0b9daa3c9e2d9fc82cfab2f07f" ]
[ "xesmf/frontend.py" ]
[ "\"\"\"\nFrontend for xESMF, exposed to users.\n\"\"\"\n\nimport warnings\n\nimport cf_xarray as cfxr\nimport numpy as np\nimport scipy.sparse as sps\nimport xarray as xr\nfrom xarray import DataArray, Dataset\n\nfrom .backend import Grid, LocStream, Mesh, add_corner, esmf_regrid_build, esmf_regrid_finalize\nfrom ....
[ [ "numpy.asarray", "numpy.array", "numpy.expand_dims", "numpy.meshgrid" ] ]
ai-se/parGALE
[ "2922e7e5f382c795b1f58d9e45be54b88d2ed1eb" ]
[ "utils/lib.py" ]
[ "\"\"\"\nStandard library files and operators\n\"\"\"\nfrom __future__ import print_function, division\nimport random\nimport sys, os\nsys.path.append(os.path.abspath(\".\"))\nimport math\nimport numpy as np\n\n# Constants\nEPS = 0.00001\nPI = math.pi\n\n\n\nclass O:\n \"\"\"\n Default class which everything exte...
[ [ "numpy.mean", "numpy.percentile" ] ]
xwind-h/gluon-nlp
[ "01727fc5f6be9b3329571bd688a340067408ad88" ]
[ "src/gluonnlp/data/utils.py" ]
[ "# coding: utf-8\n\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the...
[ [ "numpy.arange", "numpy.random.shuffle", "numpy.ceil" ] ]
jhunkeler/pysiaf
[ "5b6d00f43b438405924811ac0d76e030bed2803c" ]
[ "pysiaf/tests/test_nirspec.py" ]
[ "#!/usr/bin/env python\n\"\"\"Test NIRSpec transformations internally and against the test dataset delivered by IDT.\n\nAuthors\n-------\n\n Johannes Sahlmann\n\n\"\"\"\n\nimport os\n\nfrom astropy.io import fits\nfrom astropy.table import Table\nimport numpy as np\nimport pylab as pl\n# import pytest\n\n\n\nfro...
[ [ "numpy.abs", "numpy.linspace" ] ]
vuducmanh1407/sign-language-translation
[ "8df83befcf2896ad23dbcf7f34eb22a6884495fb" ]
[ "modules/embeddings.py" ]
[ "import numpy as np\nfrom turtle import forward\nimport torch\nimport torch.nn as nn\n\nclass WordEmbedding(nn.Module):\n \n def __init__(\n self,\n embedding_size=300,\n hidden_size=512,\n pretrained_embedding=None,\n device=None\n ):\n\n super(WordEmbedding, ...
[ [ "torch.nn.Softmax", "numpy.array", "torch.Tensor" ] ]
abhijit810/Twitter-ETL-Airflow
[ "c9da4c33f82585609fc49885937620dfdea51bab" ]
[ "airflow/dags/Twitter_DAG.py" ]
[ "from datetime import datetime, timedelta\nfrom airflow import DAG\nfrom airflow.operators.bash_operator import BashOperator\nfrom airflow.operators.python_operator import PythonOperator\nfrom airflow.contrib.hooks.cassandra_hook import CassandraHook\nimport pandas as pd\n\nfrom airflow.models import Variable\n\nfr...
[ [ "pandas.json_normalize", "pandas.Series", "pandas.DataFrame" ] ]
zhanghhong/efficientdet-tf2-zhh
[ "0ff4d5e2cc60746740ad4309fb90031867e84db9" ]
[ "utils/utils.py" ]
[ "import math\r\nimport warnings\r\n\r\nimport numpy as np\r\nfrom PIL import Image\r\nfrom tensorflow import keras\r\n\r\n\r\ndef letterbox_image(image, size):\r\n iw, ih = image.size\r\n w, h = size\r\n scale = min(w/iw, h/ih)\r\n nw = int(iw*scale)\r\n nh = int(ih*scale)\r\n\r\n image = image.re...
[ [ "numpy.log", "numpy.maximum", "numpy.minimum", "numpy.min", "numpy.unique", "numpy.arange", "numpy.ones", "numpy.concatenate", "numpy.max", "numpy.apply_along_axis", "numpy.argmax", "numpy.shape", "numpy.argsort", "numpy.exp", "numpy.zeros" ] ]
cefect/myCanFlood
[ "84dfcee10d86d6fb3edbe5e3ce452f3f15ca6919" ]
[ "canflood/hlpr/plug.py" ]
[ "'''\nCreated on Feb. 25, 2020\n\n@author: cefect\n\n\nhelper functions for use in plugins\n'''\n\n\n\n#==============================================================================\n# imports------------\n#==============================================================================\n#python\nimport logging, con...
[ [ "pandas.DataFrame", "pandas.DataFrame.from_dict" ] ]
Thunderbrook/Paddle
[ "4870c9bc99c6bd3b814485d7d4f525fe68ccd9a5" ]
[ "python/paddle/fluid/dygraph/nn.py" ]
[ "# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.array", "numpy.prod" ] ]
BradhamLab/transPipe
[ "7a4fb14492f14114e3a90daca7237a41131365ad" ]
[ "scripts/python/utils.py" ]
[ "import itertools\nimport os\nimport re\nimport subprocess as sbp\n\nimport numpy as np\nimport yaml\n\n\ndef link_ids_to_input(data_dir, sample_regex, replicate_regex=''):\n \"\"\"\n Link sample ids to data files.\n\n Args:\n data_dir (string): parent directory containing all sample-specific\n ...
[ [ "numpy.log2" ] ]
tinlun/cs350-convex-hull
[ "93e63a7383085cea5a068ad4d5d510469cd0d321" ]
[ "utils.py" ]
[ "import numpy as np\n\ndef left_most_point(points):\n '''\n Takes in the array of points, and returns the point\n furthest on the left side.\n '''\n leftMost = np.array([])\n for point in points:\n if leftMost.size == 0 or point[0] < leftMost[0]:\n leftMost = point\n return le...
[ [ "numpy.dot", "numpy.array", "numpy.lexsort", "numpy.linalg.norm" ] ]
hhf1357924680/RL-FIN
[ "be8dc15e1b6890551eae5637c179d23521956f58" ]
[ "RL_2020_ENSEMBLE.py" ]
[ "import warnings # python运行代码的时候,经常会碰到代码可以正常运行但是会提出警告,不想看到这些不重要的警告,所以使用控制警告输出\n\nwarnings.filterwarnings(\"ignore\") # 使用警告过滤器来控制忽略发出的警告\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib # python中类似于MATLAB的绘图工具,是一个2D绘图库\nimport matplotlib.pyplot as plt\nimport datetime # datetime模块提供了各种类,用于操作日期和时间\n...
[ [ "matplotlib.pyplot.plot", "pandas.read_csv", "matplotlib.pyplot.savefig", "pandas.DataFrame" ] ]
ykosuke0508/interdependence-model
[ "4bb10a8b0c89c8e79d054820b08e0955aee4bb8b" ]
[ "proposed_method/interdependence_model.py" ]
[ "# -*- coding:utf-8 -*-\nimport numpy as np\nimport sys\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nimport sklearn.svm as svm\nimport pandas as pd\nimport copy\nimport time\nimport random\nfrom operator import itemgetter\nimport sklearn.ensemble as ensemble\nimport scipy.optimize as optimize\nfrom...
[ [ "numpy.log", "numpy.ones_like", "numpy.minimum", "numpy.tile", "numpy.linalg.norm", "numpy.all", "numpy.delete", "numpy.copy", "numpy.insert", "numpy.exp", "numpy.random.uniform", "numpy.array", "numpy.where", "numpy.zeros" ] ]
anthonysimeonov/uois
[ "5c3bd855f3e24ca4816179de3ca36c3246f29e84" ]
[ "src/uois/cluster.py" ]
[ "import numpy as np\nimport torch\n\nfrom abc import ABC, abstractmethod\n\n# my libraries\nfrom .util import utilities as util_\n\n\n### Mean-Shift Clustering (PyTorch) ###\n\ndef euclidean_distances(x, y):\n \"\"\" Computes pairwise distances\n \n @param x: a [n x d] torch.FloatTensor of datapoin...
[ [ "torch.mm", "torch.ones", "torch.empty", "torch.mode", "torch.zeros", "torch.min", "torch.argmin", "torch.multinomial", "torch.tensor", "torch.unique", "torch.index_select", "numpy.random.randint" ] ]
eric-bonfadini/rasa_nlu
[ "eba7abcac4bda325b25fcab13a54f9676a04f562" ]
[ "rasa/core/policies/ted_policy.py" ]
[ "from __future__ import annotations\nimport logging\n\nfrom rasa.engine.recipes.default_recipe import DefaultV1Recipe\nfrom pathlib import Path\nfrom collections import defaultdict\nimport contextlib\n\nimport numpy as np\nimport tensorflow as tf\nfrom typing import Any, List, Optional, Text, Dict, Tuple, Union, Ty...
[ [ "tensorflow.convert_to_tensor", "tensorflow.device", "numpy.expand_dims", "tensorflow.concat", "tensorflow.zeros", "tensorflow.reduce_sum", "tensorflow.stack", "tensorflow.cast", "numpy.squeeze", "numpy.max", "numpy.any", "tensorflow.pad", "tensorflow.nn.gelu", ...
kmnhan/nexpy
[ "b5fb72b3c1ae2580e5d5504fbc5bd2f2cd13d98b" ]
[ "src/nexpy/readers/readtxt.py" ]
[ "# -----------------------------------------------------------------------------\n# Copyright (c) 2013-2021, NeXpy Development Team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file COPYING, distributed with this software.\n# --------------------------------------...
[ [ "numpy.genfromtxt" ] ]
gmbrandt/banzai
[ "af6ddb529e8c35eaa87abf67372160f2dd99050b" ]
[ "banzai/tests/utils.py" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\nimport pytest\nfrom banzai.utils import image_utils\nimport numpy as np\nfrom datetime import datetime\n\n\nclass FakeImage(object):\n def __init__(self, nx=101, ny=103, image_multiplier=1.0,\n ccdsum='2 2', epoc...
[ [ "numpy.meshgrid", "numpy.arange", "numpy.ones", "numpy.exp", "numpy.zeros" ] ]
mkuiper/deepmind-research
[ "1642ae3499c8d1135ec6fe620a68911091dd25ef" ]
[ "density_functional_approximation_dm21/density_functional_approximation_dm21/neural_numint.py" ]
[ "# Copyright 2021 DeepMind Technologies Limited.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applic...
[ [ "tensorflow.compat.v1.stack", "tensorflow.compat.v1.expand_dims", "tensorflow.compat.v1.disable_v2_behavior", "numpy.einsum", "tensorflow.compat.v1.reduce_sum", "numpy.stack", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.compat.v1.gradients", "tensorflow.com...
EelaNagarajQC/fletcher
[ "c5b675524abb88d3c3dbbce5876d3c305248fca5" ]
[ "fletcher/algorithms/string.py" ]
[ "from functools import singledispatch\nfrom typing import Any, List, Tuple\n\nimport numpy as np\nimport pyarrow as pa\n\nfrom fletcher._algorithms import _buffer_to_view, _merge_valid_bitmaps\nfrom fletcher._compat import njit\nfrom fletcher.algorithms.utils.chunking import (\n _calculate_chunk_offsets,\n _c...
[ [ "numpy.uint8", "numpy.zeros", "numpy.empty" ] ]
TheoSaify/Yolo-Detector
[ "f1ac387370982de323a4fc09109c57736b8ce8d6" ]
[ "MorphologicalTrans.py" ]
[ "import cv2\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\n\r\n\r\n\r\n\r\n###############################Erosion#########################\r\n# it erodes away the boundaries of foreground object\r\n\r\n\r\nimg = cv2.imread('C://Users//alsaifyt//Desktop//PythonOpenCvScripts//j.png',0)\r\nkernel = n...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "matplotlib.pyplot.title", "numpy.ones", "matplotlib.pyplot.subplot", "matplotlib.pyplot.xticks", "matplotlib.pyplot.show" ] ]
vonum/style-transfer
[ "0cd9bcb3fa680298de727141824dfc201b7dc666" ]
[ "losses.py" ]
[ "import tensorflow as tf\n\ndef mean_squared_error(a, b):\n return tf.reduce_mean(tf.square(a - b))\n\ndef sum_squared_error(a, b):\n return tf.reduce_sum(tf.square(a - b))\n\ndef gram_matrix(tensor):\n shape = tensor.get_shape()\n\n # Get the number of feature channels for the input tensor,\n # which is assum...
[ [ "tensorflow.reshape", "tensorflow.transpose", "tensorflow.square", "tensorflow.image.total_variation" ] ]
leolapidus/Concrete_Design_Tool
[ "7553f50d3db05e3a6c290e35acdc5d8bd1c51130" ]
[ "FE_code/single_load.py" ]
[ "\"\"\"This module only contains the single load element.\n\n\"\"\"\n\nimport numpy as np\n\nfrom FE_code.element import Element\n\nclass SingleLoad(Element):\n \"\"\"Creates a Single Load on the Nodes of the Element\n \n Attributes\n ----------\n node : object `Node`\n object of the class Nod...
[ [ "numpy.array" ] ]
masunder/3DSRCNN-pytorch-1
[ "74355561e94b9cbe947af7a87830846928d49d9f" ]
[ "generate_subblocks.py" ]
[ "\n# -*- coding: utf-8 -*-\n\nimport torch\nfrom torch.autograd import Variable\nimport numpy as np\nimport argparse\nimport utils\nimport os\ntorch.nn.Module.dump_patches = True\n##该程序相当于是拼接,只有全部生成了子图片(3d_vdsr_xxx),才能成功生成完整图像\nparser = argparse.ArgumentParser(description=\"PyTorch VDSR\")\nparser.add_argument(\"--...
[ [ "torch.autograd.Variable", "numpy.zeros", "torch.Tensor", "torch.load" ] ]
carolmanderson/NeMo
[ "ec6591e76ab5d33e050e0dded25bed43d5d6c3e4" ]
[ "nemo/collections/nlp/models/duplex_text_normalization/duplex_tn.py" ]
[ "# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.average" ] ]
maumueller/ann-benchmarks-edml19
[ "e598caa74ddbcae6c269f249c1e16c97c4642f7d" ]
[ "ann_benchmarks/datasets.py" ]
[ "import h5py\nimport numpy\nimport os\nimport random\nimport sys\ntry:\n from urllib import urlretrieve\nexcept ImportError:\n from urllib.request import urlretrieve # Python 3\n\n\ndef download(src, dst):\n if not os.path.exists(dst):\n # TODO: should be atomic\n print('downloading %s -> %s....
[ [ "numpy.product", "sklearn.random_projection.GaussianRandomProjection", "numpy.array", "sklearn.feature_extraction.text.TfidfTransformer", "numpy.zeros", "scipy.sparse.lil_matrix" ] ]
fpvc040/OverlapPredator
[ "16b2007711126dc337d48049b0c1a56c23f4bc78" ]
[ "Fast_GR_cupoch/point_cloud_alignment.py" ]
[ "import numpy as np\nimport copy\nimport time\nimport open3d as o3d\n\ndef preprocess_point_cloud(pcd, voxel_size):\n print(\":: Downsample with a voxel size %.3f.\" % voxel_size)\n pcd_down = pcd.voxel_down_sample(voxel_size)\n\n radius_normal = voxel_size * 2\n print(\":: Estimate normal with search r...
[ [ "numpy.asarray" ] ]
alexisicte/aviate
[ "91e357ed9cb234c878a12a8f18391c3c33f6b357" ]
[ "venv/lib/python3.8/site-packages/mne/channels/channels.py" ]
[ "# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Matti Hämäläinen <msh@nmr.mgh.harvard.edu>\n# Denis Engemann <denis.engemann@gmail.com>\n# Andrew Dykstra <andrew.r.dykstra@gmail.com>\n# Teon Brooks <teon.brooks@gmail.com>\n# Daniel McCloy <dan.mccloy@gmai...
[ [ "numpy.swapaxes", "numpy.take", "numpy.abs", "numpy.unique", "numpy.asarray", "numpy.memmap", "scipy.spatial.Delaunay", "scipy.io.loadmat", "scipy.sparse.csr_matrix", "numpy.concatenate", "numpy.prod", "numpy.repeat", "numpy.array", "numpy.sum", "scipy.s...
laitalaj/cvpce
[ "7509e7d7783039f39a88edc6e411333bcf6fb2af", "7509e7d7783039f39a88edc6e411333bcf6fb2af", "7509e7d7783039f39a88edc6e411333bcf6fb2af" ]
[ "cvpce/planogram_adapters.py", "cvpce/models/proposals.py", "cvpce/cli/datasets/gp.py" ]
[ "import json\n\nimport torch\nimport networkx as nx\n\ndef _get_object(planogram, graph, node):\n return planogram['objects'][graph.nodes[node]['ogg']]\n\ndef _process_dir(d): # Flip for compliance w/ detections\n res = d.upper()\n if 'N' in res:\n return res.replace('N', 'S')\n if 'S' in res:\n ...
[ [ "torch.tensor" ], [ "torch.nn.init.calculate_gain", "torch.nn.init.constant_", "torch.nn.Conv2d", "torch.nn.init.xavier_normal_", "torch.zeros_like", "torch.is_tensor", "torch.nn.Tanh", "torch.nn.functional.mse_loss", "torch.nn.Upsample", "torch.nn.functional.interp...
BoweiY/P-CNN
[ "99cb38c3217bce215afefc39228e8d63f30aef9f" ]
[ "lib/datasets/voc_eval.py" ]
[ "# --------------------------------------------------------\n# Fast/er R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Bharath Hariharan\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future...
[ [ "numpy.maximum", "numpy.minimum", "numpy.arange", "numpy.cumsum", "numpy.sort", "numpy.finfo", "numpy.concatenate", "numpy.max", "numpy.argmax", "numpy.where", "numpy.argsort", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
leeminsu87/KoBERT
[ "8ebf43f2a1fa2c4deb6b7a63a089c5904c8feda3" ]
[ "kobert/pytorch_kobert.py" ]
[ "# coding=utf-8\n# Copyright 2019 SK T-Brain 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...
[ [ "torch.device", "torch.LongTensor" ] ]
zzz2010/Contrib
[ "d351d83da718145cef9f6c98598f7fedc027efe5", "d351d83da718145cef9f6c98598f7fedc027efe5" ]
[ "biggan/paddorch/paddorch/linalg.py", "MARS/test_single_stream.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ...
[ [ "numpy.float" ], [ "numpy.squeeze", "numpy.array" ] ]
huggingface/optimum-graphcore
[ "356832240a3ae7744ea909a39c949d4067d01ba6" ]
[ "optimum/graphcore/models/t5/modeling_t5.py" ]
[ "# Copyright 2022 The HuggingFace 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 ...
[ [ "torch.no_grad", "torch.nn.CrossEntropyLoss", "torch.ones", "torch.cuda.set_device" ] ]
fuine/nDES
[ "895671d8982ff408725ebab6f83fc1b2c42680cc" ]
[ "gpu_utils/benchmark_selective_matmul.py" ]
[ "import torch\nfrom timerit import Timerit\nimport numpy as np\nfrom numpy.random import shuffle\nfrom gpu_utils import poor_selective_matmul, create_sorted_weights_for_matmul\n\nnp.random.seed(42)\n\n\ndef benchmark_torch():\n device = torch.device(\"cuda:0\")\n t1 = Timerit(num=200, verbose=2)\n total = ...
[ [ "numpy.random.seed", "torch.zeros", "numpy.arange", "numpy.random.shuffle", "torch.tensor", "torch.rand", "torch.device" ] ]
DominickZhang/NAS-FCOS
[ "1f7281478430eaed028e2cc2dfa8be226c63939b" ]
[ "maskrcnn_benchmark/nas/modeling/layer_factory.py" ]
[ "\"\"\"Different custom layers\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom maskrcnn_benchmark.layers.dcn_v2 import DCN\n\ndef conv3x3(in_planes, out_planes, stride=1, groups=1, bias=False, dilation=1):\n \"3x3 convolution with padding\"\n return nn.Conv2d(in_planes, out...
[ [ "torch.nn.Sequential", "torch.nn.ReLU6", "torch.ones", "torch.cat", "torch.nn.Conv2d", "torch.nn.functional.interpolate", "torch.nn.BatchNorm2d", "torch.nn.GroupNorm", "torch.nn.ReLU" ] ]
stnava/superiq
[ "a13befe5f525bbef02cd095031952db62c5d054e" ]
[ "applications/evaluate_OASIS_TRT_20_BF.py" ]
[ "import os\n# set number of threads - this should be optimized for your compute instance\nmynt=\"16\"\nos.environ[\"TF_NUM_INTEROP_THREADS\"] = mynt\nos.environ[\"TF_NUM_INTRAOP_THREADS\"] = mynt\nos.environ[\"ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS\"] = mynt\n\nimport os.path\nfrom os import path\nimport glob as glob...
[ [ "tensorflow.keras.models.load_model", "pandas.DataFrame" ] ]
co2meal/-bnpy-dev
[ "8f297d8f3e4a56088d7755134c329f63a550be9e" ]
[ "bnpy/deletemove/DCollector.py" ]
[ "\"\"\"\nFunctions for collecting a target dataset for a delete move.\n\n- addDataFromBatchToPlan\n- getDataSubsetRelevantToPlan\n\"\"\"\n\nimport numpy as np\nimport DeleteLogger\n\n\ndef addDataFromBatchToPlan(Plan, hmodel, Dchunk, LPchunk,\n uIDs=None,\n maxUID...
[ [ "numpy.hstack", "numpy.arange", "numpy.flatnonzero", "numpy.logical_or", "numpy.ceil", "numpy.zeros", "numpy.sum" ] ]
quantummind/quantum
[ "fd952d0362c5445eef0da4437fb3e5ebb16b7948" ]
[ "tensorflow_quantum/python/layers/circuit_executors/expectation_test.py" ]
[ "# Copyright 2020 The TensorFlow Quantum 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# Unl...
[ [ "tensorflow.convert_to_tensor", "tensorflow.keras.Input", "tensorflow.keras.layers.Dense", "tensorflow.keras.initializers.RandomNormal", "tensorflow.test.main", "tensorflow.keras.Model", "tensorflow.subtract", "tensorflow.keras.optimizers.Adam", "tensorflow.optimizers.Adam", ...
Rapixar/hivemind
[ "bb759e23eec9c3d63b2763428bcdb8687ee055d3" ]
[ "hivemind/server/task_pool.py" ]
[ "\"\"\"\nTask pool is responsible for receiving tasks and grouping them together for processing (but not processing itself)\n\"\"\"\nimport ctypes\nimport multiprocessing as mp\nimport multiprocessing.context\nimport os\nimport threading\nimport time\nimport uuid\nfrom collections import namedtuple\nfrom concurrent...
[ [ "torch.split_with_sizes", "torch.set_num_threads", "torch.cat" ] ]
fairscape/hctsa-analysis-replication-code
[ "16148637cad2d360065ecb8815f4962e6848213b" ]
[ "merge-normalize-dataframe.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn import linear_model\nfrom sklearn.svm import l1_min_c\nimport time\nimport json\n\nhr = pd.read_csv('/data/HR_daily_samples.csv')\nhr = hr.add_prefix('HR_')\n\nprint('Read in HR')\n\nsp = pd.read_csv('/data/SPO2_daily_samples.cs...
[ [ "numpy.ceil", "pandas.merge", "pandas.read_csv" ] ]
gbetegon88/dataiku-contrib
[ "4683a9e08a3706a163810bf104bf6464025e235e" ]
[ "deeplearning-image-gpu/custom-recipes/deeplearning-image-extract/recipe.py" ]
[ "import dataiku\nimport pandas as pd\nfrom dataiku.customrecipe import *\nfrom keras.models import load_model, Model\nimport numpy as np\nimport json\nimport os\nimport glob\nimport dl_image_toolbox_utils as utils\nimport constants\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"\"\n\n####################################...
[ [ "numpy.array", "pandas.DataFrame" ] ]
makeesyai/makeesy-deep-learning
[ "172f8a4301d6b60927824a56648d60559ba3f14e" ]
[ "self_attention/deconstructing_multihead_attn.py" ]
[ "from scipy.special import softmax\nimport numpy as np\n\n\"\"\"\nRNN and LSTM\nhttps://colab.research.google.com/github/mrm8488/shared_colab_notebooks/blob/master/basic_self_attention_.ipynb\n\nAttentions\nhttps://www.youtube.com/watch?v=S27pHKBEp30\n\nPosition Embeddings\nhttps://www.youtube.com/watch?v=dichIcUZf...
[ [ "numpy.array", "scipy.special.softmax", "numpy.stack", "numpy.transpose" ] ]
amasotti/homer-skipgram-lemmata
[ "56c59a53b0c9f2c61354259e739dcfad6d443624" ]
[ "skipgram_homer.py" ]
[ "# -*- coding: utf-8 -*-\n__author__ = 'Antonio Masotti'\n__date__ = 'january 2021'\n\n\"\"\"\nAll the main functions needed to train the model.\nDefined here to make train_skipgram.py more readable\n\n\"\"\"\n\n# Imports\nimport json\nimport random\n\nimport matplotlib.pyplot as plt # for loss plotting\nimport nu...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.save", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "numpy.load", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
FighterLYL/autograd
[ "2c675bb44d706f9d30993e6389b18ccafe7213e4" ]
[ "examples/lstm.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import print_function\nimport autograd.numpy as np\nimport autograd.numpy.random as npr\nfrom autograd import value_and_grad\nfrom autograd.util import quick_grad_check\nfrom scipy.optimize import minimize\nfrom six.moves import range\n\nclass WeightsParser(o...
[ [ "scipy.optimize.minimize" ] ]
brb-reallife/Stocksera
[ "726f969ce74f8e8916ae0942c669be2c16b4d6b1" ]
[ "scheduled_tasks/economy/get_upcoming_events_date.py" ]
[ "import os\nimport sys\nimport json\nimport sqlite3\nimport tabula\nimport pandas as pd\nfrom datetime import datetime, timedelta\n\nsys.path.append(os.path.join(os.path.dirname(__file__), '../..'))\n\nfrom scheduled_tasks.economy.ychart_connection import ychart_data\n\nconn = sqlite3.connect(r\"database/database.d...
[ [ "pandas.to_datetime", "pandas.read_html" ] ]
jkurian49/hate-speech-detection
[ "22e12eb4fecdef857b1cc5d94dea76d66241608e" ]
[ "hate_speech_detection.py" ]
[ "#Author: Tommy Pawelski\n#Created: July 13th 2018\n\nimport pandas as pd\nimport numpy as np\nimport nltk\nimport string\nimport csv\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.ensemble import VotingClassifier\nfrom mlxtend.classifier import StackingCVClassifier\n\n### LOAD IN ORIGINAL DATA...
[ [ "pandas.read_csv", "sklearn.metrics.confusion_matrix", "sklearn.model_selection.train_test_split", "sklearn.ensemble.VotingClassifier", "sklearn.metrics.f1_score" ] ]
shenweihai1/rolis-eurosys2022
[ "59b3fd58144496a9b13415e30b41617b34924323" ]
[ "third-party/paxos/scripts/figure.py" ]
[ "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nxxx = [1, 2, 4, 8, 16, 32]\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib.ticker import FuncFormatter\n\nSTR_CONCURRENT_REQS_PER_SERVER = \"Concurrent reqs/server\"\nSTR_THROUGHPUT = \"Throughput\"\nSTR_NUMBER_O...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.ylim", "numpy.arange", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.concatenate", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.errorbar", "matplotlib.pyplot.bar", "matplotlib.p...
utiasSTARS/manipulator_learning
[ "9a0e0c66c0a3c07124331f010bd04bb52eaf95bb" ]
[ "manipulator_learning/learning/imitation/collect_utils.py" ]
[ "import h5py\nimport numpy as np\nimport os\nimport shutil\n\n\nclass HDF5Dataset:\n def __init__(self, data_dir, example_obs):\n if type(example_obs) == dict:\n self.dict_obs = True\n self.names = list(example_obs.keys())\n self.img_names = []\n for n in self.n...
[ [ "numpy.array" ] ]
donlee90/cs231n
[ "f3dbf849d2f40efbefe8d63bc8c95c295cd0eaf4" ]
[ "assignment3/cs231n/classifiers/rnn.py" ]
[ "from builtins import range\nfrom builtins import object\nimport numpy as np\n\nfrom cs231n.layers import *\nfrom cs231n.rnn_layers import *\n\n\nclass CaptioningRNN(object):\n \"\"\"\n A CaptioningRNN produces captions from image features using a recurrent\n neural network.\n\n The RNN receives input v...
[ [ "numpy.sqrt", "numpy.ones", "numpy.argmax", "numpy.random.randn", "numpy.array", "numpy.zeros" ] ]
tcstewar/fcg
[ "7d0692234fb6ff31fa8823e64b72fce264241eea" ]
[ "fcg/html.py" ]
[ "import numpy as np\nimport fcg\n\ndef create_color(seed):\n rng = np.random.RandomState(seed=seed)\n return '#%02x%02x%02x' % (rng.uniform(64,255), rng.uniform(64,255), rng.uniform(64,255))\n\ndef as_span(s):\n return '<span style=\"background-color: %s;\">%s</span>' % (create_color(id(s)), s._id)\ndef as...
[ [ "numpy.random.RandomState" ] ]
CiceroAraujo/SB
[ "637cc4bc63c952f058c316b2b1fbfbb5cd6250c8" ]
[ "packs/solvers/solvers_trilinos/solvers_tril.py" ]
[ "from PyTrilinos import Epetra, AztecOO\nimport numpy as np\nimport scipy.sparse as sp\n# IFPACK.PrintSparsity(Matrix, \"matrix.ps\")\n\n\nclass solverTril:\n\n def __init__(self, p=1):\n self._comm = Epetra.PyComm()\n self._params = dict()\n # self.set_parameters()\n\n def solve_linear_...
[ [ "numpy.array", "scipy.sparse.find" ] ]
NunoEdgarGFlowHub/zipline
[ "459366c17ac918576daf21ba9cf5706399eea988" ]
[ "zipline/data/data_portal.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.nanmax", "numpy.amax", "pandas.isnull", "pandas.Timestamp", "numpy.isnan", "numpy.around", "numpy.amin", "numpy.nanmin", "pandas.Timedelta", "pandas.DataFrame", "pandas.tslib.normalize_date", "numpy.nansum", "numpy.array", "numpy.sum" ] ]
H-Park/stable-baselines
[ "d056fbf23e25a41bb30b458bb6ebea3864ef2afa" ]
[ "stable_baselines/common/hvac_action_mask_skeleton.py" ]
[ "import gym\nimport numpy as np\nfrom gym.spaces import Discrete, MultiDiscrete\n\nimport math\nfrom pprint import pprint as pp\nfrom scipy import linalg\nfrom scipy import integrate\nfrom scipy import interpolate\n\nimport os\nimport warnings\n\nimport stable_baselines.common.hvac_data.hvac_environment as Environm...
[ [ "numpy.divmod", "numpy.array", "numpy.transpose", "numpy.random.choice" ] ]
DominicBroadbentCompass/bayesian-coresets-optimization
[ "3657f2ebfc4f0e6b36f5c651b0651f06d7e3d6b1" ]
[ "experiments/tests/not_yet_updated/test_base/test_opt.py" ]
[ "import warnings\n\nimport numpy as np\nfrom bayesiancoresets.base import OptimizationCoreset\n\nwarnings.filterwarnings('ignore',\n category=UserWarning) # tests will generate warnings (due to pathological data design for testing), just ignore them\nnp.seterr(all='raise')\nnp.set_printoptio...
[ [ "numpy.seterr", "numpy.set_printoptions", "numpy.zeros", "numpy.random.seed" ] ]
chriscline/mne-python
[ "ced882efa2455b94094f430c62fef95d825d984e" ]
[ "tutorials/forward/25_automated_coreg.py" ]
[ "\"\"\"\n=============================================\nUsing an automated approach to coregistration\n=============================================\n\nThis example shows how to use the coregistration functions to perform an\nautomated MEG-MRI coregistration via scripting.\n\n.. warning:: The quality of the coregis...
[ [ "numpy.max", "numpy.mean", "numpy.min" ] ]
z430/pycochleagram
[ "45420d969047781933a91281592f46befcc3f48f" ]
[ "pycochleagram/tests/test_erbfilter_unity.py" ]
[ "import os\nimport sys\nsys.path.insert(1, os.path.join(sys.path[0], '..'))\nimport numpy as np\n\nimport erbfilter as erb\n\n\ndef test_erb_filts_unity(mode='grid', verbose=0):\n \"\"\"Test that the squard ERB filterbank sums to 1.\n\n This is intended to check the generalization of 1x, 2x and 4x filter\n o...
[ [ "numpy.ones_like", "numpy.sum", "numpy.random.randint" ] ]