repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
IBM/urcanet | [
"ce3f41eba23c24506ea2cf9e77cd3898a4eafbaf"
] | [
"orca/modules/bert.py"
] | [
"import torch\nimport torch.nn as nn\n\nfrom pytorch_pretrained_bert.modeling import BertEncoder, BertPooler, BertLayerNorm, BertPreTrainedModel\n\nclass BertEmbeddingsModified(nn.Module):\n \"\"\"Construct the embeddings from word, position and token_type embeddings.\n \"\"\"\n def __init__(self, config):... | [
[
"torch.ones_like",
"torch.zeros_like",
"torch.nn.Embedding",
"torch.arange",
"torch.nn.Dropout"
]
] |
One-sixth/check_cuda_numerical_stability | [
"0229632f81e8558436132eb0a9d8e8c2b332cb81"
] | [
"_check_cuda_numerical_stability.py"
] | [
"'''\n用于检测cuda运算错误\n'''\n\nimport torch\nimport torch.nn as nn\nfrom torch.backends import cudnn\nimport argparse\nimport time\nimport math\n\n\ndef ConvBnAct(in_ch, out_ch, ker_sz, stride, pad, act=nn.Identity(), group=1, dilation=1):\n return nn.Sequential(nn.Conv2d(in_ch, out_ch, ker_sz, stride, pad, groups=g... | [
[
"torch.nn.BatchNorm2d",
"torch.set_grad_enabled",
"torch.randn",
"torch.device",
"torch.nn.Conv2d",
"torch.abs",
"torch.nn.Identity",
"torch.nn.ELU",
"torch.cat",
"torch.nn.ConvTranspose2d"
]
] |
mrzhuzhe/mmdetection | [
"c04ca2c2a65500bc248a5d2ab6ace5b15f00064d"
] | [
"mmdet/models/losses/ae_loss.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\r\nimport mmcv\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\nfrom ..builder import LOSSES\r\n\r\n\r\n@mmcv.jit(derivate=True, coderize=True)\r\ndef ae_loss_per_image(tl_preds, br_preds, match):\r\n \"\"\"Associative Embedding L... | [
[
"torch.eye",
"torch.cat",
"torch.nn.functional.relu"
]
] |
PhilippRue/ase-notebook | [
"46205d7e1b0e5a48a3ca61d84d4ee877eea19e62"
] | [
"ase_notebook/atoms_convert.py"
] | [
"\"\"\"Module for serializing ``ase.Atoms``.\"\"\"\n# TODO very recent versions of ase.Atoms have `todict` and `fromdict` methods, ands\n# see: https://gitlab.com/ase/ase/atoms.py and\n# https://gitlab.com/ase/ase/blob/master/ase/io/jsonio.py\nimport datetime\nimport json\n\nimport ase\nfrom ase.constraints import ... | [
[
"numpy.array",
"numpy.iscomplexobj",
"numpy.empty"
]
] |
ChengShusss/spt | [
"f68e6b317ae64237aec5d0a058064804a28996d1"
] | [
"src/_test/testSimply.py"
] | [
"#!/usr/local/bin/python3\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\n\n# Setup, and create the data to plot\ny = np.random.rand(100000)\ny[50000:] *= 2\ny[np.geomspace(10, 50000, 400).astype(int)] = -1\nmpl.rcParams['path.simplify'] = True\n\nmpl.rcParams['path.simplify_thresh... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"numpy.random.rand",
"numpy.geomspace"
]
] |
upc-arco/PCA-DIRIE-Pruning | [
"697ce664786e9791c7cf8911e642b3e6e70d7b98"
] | [
"transformer/ffn_layer.py"
] | [
"# Copyright 2021 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.nn.dropout"
]
] |
batucimenn/eyeTrackingUsingOpenCV | [
"4f6c3249cb52f04208405a9ac48ccf41d0d38364"
] | [
"eyeTrackingUsingOpenCV.py"
] | [
"import cv2\r\nimport numpy as np\r\nimport dlib\r\nimport time\r\nimport matplotlib.pyplot as plt\r\nfrom math import hypot,ceil\r\n\r\n#cap = cv2.VideoCapture(\"projectvideo.mp4\")\r\ncap = cv2.VideoCapture(0)\r\nliste=[]\r\ndetector = dlib.get_frontal_face_detector()\r\npredictor = dlib.shape_predictor(\"shape_p... | [
[
"numpy.zeros",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"numpy.min",
"matplotlib.pyplot.ylim",
"numpy.max",
"matplotlib.pyplot.xlabel"
]
] |
jtegedor/poliastro | [
"48c854a4ad5500116f7c09ca171f77a60e2de04b"
] | [
"src/poliastro/twobody/propagation.py"
] | [
"\"\"\"The following script holds the different high level functions for the\ndifferent propagators available at poliastro:\n\n+-------------+------------+-----------------+-----------------+\n| Propagator | Elliptical | Parabolic | Hyperbolic |\n+-------------+------------+-----------------+-----------... | [
[
"numpy.array",
"numpy.abs"
]
] |
p517332051/face_benchmark | [
"c76c2b2142ecf65b7bace4b007a33fa4e795d2d0"
] | [
"maskrcnn_benchmark/data/datasets/FaceDataset.py"
] | [
"import os\nimport numpy as np\nimport torch\nimport torch.utils.data as data\nimport random\nimport tqdm\nfrom PIL import Image\nclass FaceDataset(data.Dataset):\n def __init__(self, data_dir, ann_file, transforms=None, augmenter=None,im_info=[112,96]):\n assert transforms is not None\n\n self.roo... | [
[
"numpy.random.randint",
"numpy.asarray"
]
] |
peternara/DeepHash | [
"c6f4c6733f619718d437bf39ef9fb6854476f20c"
] | [
"DeepHash/model/dtq/util.py"
] | [
"import numpy as np\nimport math\nfrom distance.npversion import distance\n\nclass Dataset(object):\n def __init__(self, dataset, output_dim, code_dim):\n self._dataset = dataset\n self.n_samples = dataset.n_samples\n self._train = dataset.train\n self._output = np.zeros((self.n_sampl... | [
[
"numpy.random.shuffle",
"numpy.zeros",
"numpy.invert",
"numpy.argmin",
"numpy.any",
"numpy.random.choice",
"numpy.copy",
"numpy.argmax",
"numpy.arange",
"numpy.where",
"numpy.array",
"numpy.concatenate",
"numpy.split"
]
] |
fredriko/search_with_machine_learning_course | [
"85670d7adf337fede418fa5665b3c5ee80e42b2b"
] | [
"index_queries.py"
] | [
"import click\nimport pandas as pd\nfrom opensearchpy import OpenSearch\nfrom opensearchpy.helpers import bulk\n\nimport logging\n\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.INFO)\nlogging.basicConfig(format='%(levelname)s:%(message)s')\n\n\ndef get_opensearch():\n host = 'localhost'\n por... | [
[
"pandas.read_csv",
"pandas.to_datetime"
]
] |
blester125/baseline | [
"4ad4147d4a88a42b309c6784a95b0b9f1faa2c60"
] | [
"baseline/tf/seq2seq/training/datasets.py"
] | [
"import tensorflow as tf\nfrom baseline.tf.tfy import TRAIN_FLAG\nfrom eight_mile.utils import listify\nfrom baseline.utils import get_model_file, get_metric_cmp\nfrom baseline.train import create_trainer, register_training_func\nfrom baseline.tf.seq2seq.training.utils import to_tensors, SHUF_BUF_SZ, NUM_PREFETCH\n... | [
[
"tensorflow.compat.v1.data.get_output_types",
"tensorflow.reduce_max",
"tensorflow.compat.v1.data.get_output_shapes"
]
] |
preller/morpheus | [
"ba10271c6ace5aff3b35509ab5fbf42bcd6750b6"
] | [
"morpheus/classifier.py"
] | [
"# MIT License\n# Copyright 2018 Ryan Hausen\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, ... | [
[
"numpy.argsort",
"numpy.dstack",
"tensorflow.compat.v1.disable_eager_execution",
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.train.Saver",
"numpy.transpose",
"numpy.logical_and",
"numpy.logical_not",
"numpy.where",
"numpy.mean",
"tensorflow.compat.v1.Sessi... |
KDD2022-MSCMT/MSCMT | [
"6a3e1e6230aa519a57345f6dbb0731b3ed6fe1ce"
] | [
"object_detector/mrcnn/config.py"
] | [
"\n\nimport math\nimport numpy as np\n\n\n# Base Configuration Class\n# Don't use this class directly. Instead, sub-class it and override\n# the configurations you need to change.\n\nclass Config(object):\n \"\"\"Base configuration class. For custom configurations, create a\n sub-class that inherits from this... | [
[
"numpy.array"
]
] |
janEbert/pySDC | [
"167d78c4118bc3a5a446ec973fe65fb35db94471"
] | [
"pySDC/playgrounds/Boris/spiraling_particle_ProblemClass.py"
] | [
"\nimport numpy as np\n\nfrom pySDC.core.Problem import ptype\nfrom pySDC.implementations.datatype_classes.particles import particles, fields, acceleration\n\n\nclass planewave_single(ptype):\n \"\"\"\n Example implementing a single particle spiraling in a trap\n \"\"\"\n\n def __init__(self, cparams, d... | [
[
"numpy.cross",
"numpy.linalg.norm"
]
] |
sausagecy/Relation-Shape-CNN | [
"a91ac768cd720773359dda9b3e234815f88d88b4"
] | [
"utils/pointnet2_modules.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport utils.pointnet2_utils as pointnet2_utils\nimport utils.pytorch_utils as pt_utils\nfrom typing import List\nimport numpy as np\nimport time\nimport math\n\nclass _PointnetSAModuleBase(nn.Module):\n\n def __init__(self):\n super... | [
[
"torch.sum",
"torch.cuda.manual_seed_all",
"torch.nn.init.constant_",
"torch.randn",
"torch.manual_seed",
"torch.nn.Conv1d",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.cat"
]
] |
chuanglaipv/realtime_object_detection_xavier | [
"694c91db953a2e18440fcdcf5f38df90ba063bfc"
] | [
"lib/detection_nms_v1.py"
] | [
"import numpy as np\nfrom tf_utils import visualization_utils_cv2 as vis_util\nfrom lib.session_worker import SessionWorker\nfrom lib.load_graph_nms_v1 import LoadFrozenGraph\nfrom lib.load_label_map import LoadLabelMap\nfrom lib.mpvariable import MPVariable\nfrom lib.mpvisualizeworker import MPVisualizeWorker, vis... | [
[
"numpy.squeeze",
"tensorflow.ConfigProto",
"numpy.zeros"
]
] |
ricklupton/py-bem | [
"026b2b82b6f09d57b213cfe17aa849dbdf3c7b71"
] | [
"bem/fast_interpolation.py"
] | [
"\"\"\"\nFrom http://stackoverflow.com/a/13504757\n\"\"\"\n\nfrom scipy.interpolate import interp1d\nfrom scipy.interpolate._fitpack import _bspleval\nimport numpy as np\n\n\nclass fast_interpolation:\n def __init__(self, x, y, axis=-1):\n assert len(x) == y.shape[axis]\n self.x = x\n self.y... | [
[
"numpy.empty_like",
"scipy.interpolate.interp1d",
"scipy.interpolate._fitpack._bspleval"
]
] |
noelevans/playground | [
"da529e967a15bcb217fff091ac0ec5c4dc1821ce"
] | [
"kaggle/sf-crime/logistic_regressions.py"
] | [
"from sklearn.linear_model import LogisticRegression\n\n\nclass MultivariateLogisticOvrModel(object):\n\n def model_and_predict(self, X_train, y_train, X_test):\n model = LogisticRegression(dual=True, fit_intercept=True, \n multi_class='ovr')\n model.fit(X_train, y... | [
[
"sklearn.linear_model.LogisticRegression"
]
] |
Onkar627/cupy | [
"8eef1ad5393c0a92c5065bc05137bf997f37044a"
] | [
"cupyx/scipy/ndimage/_measurements.py"
] | [
"import warnings\n\nimport numpy\n\nimport cupy\nfrom cupy import _core\nfrom cupy import _util\n\n\ndef label(input, structure=None, output=None):\n \"\"\"Labels features in an array.\n\n Args:\n input (cupy.ndarray): The input array.\n structure (array_like or None): A structuring element that... | [
[
"numpy.add.reduce",
"numpy.asarray",
"numpy.indices",
"numpy.array",
"numpy.where"
]
] |
bolcom/probability | [
"4a11efad1ecd8a1336e4c9fdb0105efbf2375ad7",
"4a11efad1ecd8a1336e4c9fdb0105efbf2375ad7"
] | [
"tensorflow_probability/python/mcmc/replica_exchange_mc.py",
"tensorflow_probability/python/optimizer/sgld_test.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.stack",
"tensorflow.compat.v2.shape",
"tensorflow.compat.v2.size",
"tensorflow.compat.v2.unstack",
"tensorflow.compat.v2.convert_to_tensor",
"tensorflow.compat.v2.reshape",
"tensorflow.compat.v2.range",
"tensorflow.compat.v2.TensorArray",
"tensorflow.compa... |
TencentYoutuResearch/PersonReID-ACT | [
"264b1b43f9424c297638ebf6f8f8ace09512ed29"
] | [
"selftrainingCT.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function, absolute_import\nimport argparse\nimport time\nimport os.path as osp\nimport os\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom torch.nn import init\nfrom torch.backends import cudnn\nfrom torch.utils.data impor... | [
[
"torch.pow",
"numpy.round",
"torch.nn.functional.normalize",
"torch.manual_seed",
"sklearn.cluster.DBSCAN",
"numpy.random.seed",
"numpy.asarray",
"torch.from_numpy",
"numpy.sort",
"torch.nn.DataParallel",
"numpy.nonzero",
"numpy.triu"
]
] |
Diego-II/Datadriven-GPVAD | [
"ef033eb317553dc60464e07d8b5ba4f67bcf4a8d"
] | [
"utils.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport collections\nimport sys\nfrom loguru import logger\nfrom pprint import pformat\nfrom typing import List\n\nimport numpy as np\nimport pandas as pd\nimport scipy\nimport six\nimport sklearn.preprocessing as pre\nimport torch\nimport tqdm\nimport yaml\n\nimpor... | [
[
"numpy.zeros_like",
"numpy.ones",
"scipy.ndimage.median_filter",
"numpy.random.permutation",
"sklearn.preprocessing.MultiLabelBinarizer",
"numpy.where",
"numpy.logical_xor",
"sklearn.preprocessing.minmax_scale",
"torch.nn.Sequential",
"numpy.apply_along_axis",
"sklearn.... |
benJephunneh/opticspy | [
"a0b841f60f7c053b05444c0e8886cd4a99c4d082"
] | [
"opticspy/test/PSF.py"
] | [
"import numpy as np\nfrom numpy import sqrt as sqrt\nfrom numpy import cos as cos\nfrom numpy import sin as sin\nimport matplotlib.pyplot as plt\nfrom matplotlib import cm as cm\nfrom matplotlib.ticker import LinearLocator as LinearLocator\nfrom matplotlib.ticker import FormatStrFormatter as FormatStrFormatter\nfro... | [
[
"numpy.fft.fftshift",
"numpy.zeros",
"matplotlib.pyplot.figure",
"matplotlib.ticker.LinearLocator",
"matplotlib.pyplot.set_cmap",
"numpy.exp",
"matplotlib.ticker.FormatStrFormatter",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show",
"numpy.sqrt",
"numpy.meshgrid",
... |
yangzhou95/learn-tensorflow | [
"6def45659ebf7aa9f74f1efe1ff6465b8db5ee93"
] | [
"read_csv.py"
] | [
"# read csv to model\nimport tensorflow as tf\nimport numpy as np\nimport os\n\n\ndef read_csv(batch_size, file_name, record_defaults=1):\n fileName_queue=tf.train.string_input_producer(os.path.dirname(__file__)+\"/\"+file_name)\n reader = tf.TextLineReader(skip_header_lines=1)\n key, value=reader.read(fil... | [
[
"tensorflow.decode_csv",
"tensorflow.TextLineReader",
"tensorflow.train.shuffle_batch"
]
] |
HusseinLezzaik/Consensus-Algorithm-for-2-Mobile-Robots | [
"ecdb28793cc1f5fa6cded752908105ec37e9bfc7"
] | [
"Real Topology Graph/GNN Model 2/Fully Connected Graph/test_n3_cyclic.py"
] | [
"\"\"\"\n\nConsensus Algorithm for 3 Mobile robots using MLP Model Cyclic Graph Implementation\n\nScene: Robot 1, Robot 2, Robot 3\n\nInputs: Mx, My, Phix, Phiy\nOutputs: Ux, Uy\n\n\"\"\"\nimport torch\nimport MLP_Model\nimport math\nimport numpy as np\nimport rclpy\nfrom rclpy.node import Node\nfrom tf2_msgs.msg i... | [
[
"numpy.array",
"numpy.linalg.inv",
"numpy.dot",
"torch.load"
]
] |
thunlp/MetaAdaptRank | [
"5e80520b003b0a3a5fad817edf65cf76222438dd"
] | [
"metaranker/losses/pairwise.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.autograd import Variable\n\nclass PairWise(nn.Module):\n def __init__(\n self, \n margin=1\n ):\n super(PairWise, self).__init__()\n self.tanh = nn.Tanh()\n self.loss_fct = nn.MarginRankingLoss(\n margin=margin, \n ... | [
[
"torch.nn.MarginRankingLoss",
"torch.nn.Tanh"
]
] |
WLM1ke/poptimizer | [
"084ac14ca6212a5b14bea5bbc9bb575da077ffb0"
] | [
"poptimizer/portfolio/optimizer.py"
] | [
"\"\"\"Оптимизатор портфеля.\"\"\"\nimport numpy as np\nimport pandas as pd\nfrom scipy import stats\n\nfrom poptimizer import config\nfrom poptimizer.portfolio import metrics\nfrom poptimizer.portfolio.portfolio import CASH, Portfolio\n\n\nclass Optimizer:\n \"\"\"Предлагает сделки для улучшения метрики портфел... | [
[
"scipy.stats.bootstrap",
"pandas.concat"
]
] |
Olek-Donaldson/astropy | [
"ed9ec69007bd540bcf476def57c5231e5e7c1240"
] | [
"astropy/modeling/tests/test_models.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n\"\"\"\nTests for model evaluation.\nCompare the results of some models with other programs.\n\"\"\"\n# pylint: disable=invalid-name, no-member\nimport pytest\nimport numpy as np\n\nfrom numpy.testing import assert_allclose, assert_equal\n\nfrom as... | [
[
"numpy.vstack",
"numpy.logspace",
"numpy.diff",
"numpy.random.seed",
"numpy.cos",
"numpy.arange",
"numpy.random.RandomState",
"numpy.random.rand",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.sin",
"numpy.meshgrid",
"numpy.linspace",
"numpy.isnan"
... |
davidbrochart/pythran | [
"24b6c8650fe99791a4091cbdc2c24686e86aa67c"
] | [
"pythran/tests/cases/lapl3d.py"
] | [
"#runas: import numpy as np ; N = 500 ; X = np.random.randn(N,N,3); laplacien(X)\n#pythran export laplacien(float64[][][3])\n\nimport numpy as np\ndef laplacien(image):\n out_image = np.abs(4*image[1:-1,1:-1] -\n image[0:-2,1:-1] - image[2:,1:-1] -\n ... | [
[
"numpy.max",
"numpy.abs"
]
] |
richardrl/ray | [
"cf53b351471716e7bfa71d36368ebea9b0e219c5"
] | [
"rllib/agents/dqn/tests/test_dqn.py"
] | [
"import numpy as np\nimport unittest\n\nimport ray\nimport ray.rllib.agents.dqn as dqn\nfrom ray.rllib.utils.framework import try_import_tf\nfrom ray.rllib.utils.test_utils import check, framework_iterator, \\\n check_compute_action\n\ntf = try_import_tf()\n\n\nclass TestDQN(unittest.TestCase):\n @classmethod... | [
[
"numpy.array",
"numpy.std"
]
] |
oliver0922/yolo3dstereo | [
"24c37c4574eedd85593a0060b7c317b3e08c0460"
] | [
"visualDet3D/data/kitti/kittidata.py"
] | [
"'''\nFile Created: Sunday, 17th March 2019 3:58:52 pm\nAuthor: Peng YUN (pyun@ust.hk)\nCopyright 2018 - 2019 RAM-Lab, RAM-Lab\n'''\nimport os\nimport math\nimport numpy as np\nfrom numpy.linalg import inv\nfrom .utils import read_image, read_pc_from_bin, _lidar2leftcam, _leftcam2lidar, _leftcam2imgplane\n# KITTI\n... | [
[
"numpy.array",
"numpy.zeros"
]
] |
side-projects-42/INTERVIEW-PREP-COMPLETE | [
"627a3315cee4bbc38a0e81c256f27f928eac2d63"
] | [
"notes-n-resources/Data-Structures-N-Algo/_DS-n-Algos/_Another-One/sorts/random_normaldistribution_quicksort.py"
] | [
"from __future__ import print_function\nfrom random import randint\nfrom tempfile import TemporaryFile\nimport numpy as np\nimport math\n\n\ndef _inPlaceQuickSort(A, start, end):\n count = 0\n if start < end:\n pivot = randint(start, end)\n temp = A[end]\n A[end] = A[pivot]\n A[piv... | [
[
"numpy.random.normal",
"numpy.save",
"numpy.load"
]
] |
itayhubara/AcceleratedSparseNeuralTraining | [
"425897dec9c7ef185841d7000c4418ebb1c95896"
] | [
"prune/pruning_method_utils.py"
] | [
"import torch\n\n\ndef validate_tensor_shape_2d_4d(t):\n shape = t.shape\n if len(shape) not in (2, 4):\n raise ValueError(\n \"Only 2D and 4D tensor shapes are supported. Found \"\n \"Found tensor of shape {} with {} dims\".format(shape, len(shape))\n )\n\n\ndef pad_inner_... | [
[
"torch.zeros",
"torch.cat"
]
] |
SamIlic/Web-Scraping | [
"fae1e0b000adda18abff44e4c60fbad77e872314"
] | [
"ERC/ERC/spiders/ICOBench.py"
] | [
"# -*- coding: utf-8 -*-\nimport scrapy # needed to scrape\nimport xlrd # used to easily import xlsx file \nimport json\nimport re\nimport pandas as pd\nimport numpy as np\nfrom openpyxl import load_workbook\nimport datetime\n#from datetime import timedelta\n\n\n\n\nclass ICObench(scrapy.Spider):\n name = 'ICO... | [
[
"pandas.read_excel"
]
] |
BeylierMPG/Reinforcement-Learning | [
"17495386e36a27c5fc617e24221baf0fc5743c91"
] | [
"algos/models/ddqn_cnn.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.autograd as autograd \nimport torch.nn.functional as F\n\n\nclass DDQNCnn(nn.Module):\n def __init__(self, input_shape, num_actions):\n super(DDQNCnn, self).__init__()\n self.input_shape = input_shape\n self.num_actions = num_actions\n ... | [
[
"torch.nn.Linear",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.zeros"
]
] |
lepoeme20/vision | [
"eac3dc7bab436725b0ba65e556d3a6ffd43c24e1"
] | [
"torchvision/prototype/datasets/utils/_internal.py"
] | [
"import enum\nimport functools\nimport gzip\nimport io\nimport lzma\nimport mmap\nimport os\nimport os.path\nimport pathlib\nimport pickle\nimport platform\nfrom typing import BinaryIO\nfrom typing import (\n Sequence,\n Callable,\n Union,\n Any,\n Tuple,\n TypeVar,\n Iterator,\n Dict,\n ... | [
[
"scipy.io.loadmat",
"torch.distributed.get_rank",
"torch.distributed.get_world_size",
"torch.distributed.is_available",
"torch.distributed.is_initialized",
"torch.utils.data.get_worker_info",
"numpy.frombuffer"
]
] |
USEPA/LCIAformatter | [
"e803dccf81b1f7d7441e576909cdac3f823b40ce"
] | [
"lciafmt/recipe.py"
] | [
"# recipe.py (lciafmt)\n# !/usr/bin/env python3\n# coding=utf-8\n\"\"\"\nThis module contains functions needed to compile LCIA methods from the\nReCiPe model\n\"\"\"\n\nimport pandas as pd\nimport openpyxl\n\nimport lciafmt.cache as cache\nimport lciafmt.df as dfutil\nimport lciafmt.xls as xls\n\nfrom .util import ... | [
[
"pandas.read_csv",
"pandas.Series",
"pandas.DataFrame",
"pandas.concat"
]
] |
youngwoon/robot-learning | [
"70da64466fd02dc4cfc97ad9e123c893fc17acd3"
] | [
"networks/encoder.py"
] | [
"\"\"\"\nCode reference:\n https://github.com/MishaLaskin/rad/blob/master/encoder.py\n\"\"\"\n\nimport gym.spaces\nimport torch\nimport torch.nn as nn\n\nfrom .utils import CNN, MLP, flatten_ac\n\n\nclass Encoder(nn.Module):\n def __init__(self, config, ob_space):\n super().__init__()\n\n self._en... | [
[
"torch.nn.ModuleDict",
"torch.cat"
]
] |
benduffy1/MONAI | [
"2fef7ff5c064a9ff6b6d6b4f2323180afed99934"
] | [
"monai/networks/blocks/dints_block.py"
] | [
"# Copyright (c) MONAI Consortium\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to in... | [
[
"torch.nn.Upsample"
]
] |
awsm-research/LineVul | [
"246baf18c1932094564a10c9b81efb21914b2978"
] | [
"bow_rf/rf_main.py"
] | [
"import pandas as pd\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.metrics import f1_score, precision_score, recall_score\nimport pickle\nimport numpy as np\n\n\n# load train, val data\ntrain = pd.read_csv('../data/big-vul_dataset/tra... | [
[
"pandas.read_csv",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.metrics.f1_score",
"sklearn.metrics.precision_score",
"pandas.concat",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.recall_score"
]
] |
robcalon/PyETM | [
"323418ad57b2df7d47f2495919c943db28ca55cc"
] | [
"pyETM/curves/hourly_hydrogen_curves.py"
] | [
"import io\nimport pandas\n\nclass HourlyHydrogenCurves:\n \n @property\n def hourly_hydrogen_curves(self):\n \n # get hourly hydrogen curves\n if self._hourly_hydrogen_curves is None:\n self.get_hourly_hydrogen_curves()\n \n return self._hourly_hydrogen_curves... | [
[
"pandas.read_csv"
]
] |
mengwanguc/torchvision-meng | [
"395942756b0b29053d25b50cdef86f709601453e"
] | [
"torchvision/models/squeezenet.py"
] | [
"import time\nimport torch\nimport torch.nn as nn\nimport torch.nn.init as init\nfrom .utils import load_state_dict_from_url\nfrom typing import Any\n\n__all__ = ['SqueezeNet', 'squeezenet1_0', 'squeezenet1_1']\n\nmodel_urls = {\n 'squeezenet1_0': 'https://download.pytorch.org/models/squeezenet1_0-a815701f.pth',... | [
[
"torch.nn.MaxPool2d",
"torch.nn.init.constant_",
"torch.nn.AdaptiveAvgPool2d",
"torch.flatten",
"torch.nn.init.normal_",
"torch.nn.Conv2d",
"torch.nn.init.kaiming_uniform_",
"torch.nn.ReLU",
"torch.nn.Dropout"
]
] |
ncilfone/mabwiser | [
"329125d4110312d6001e9486e1cb3490a90565c4"
] | [
"tests/test_lints.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport datetime\nimport math\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.preprocessing import StandardScaler\n\nfrom mabwiser.mab import LearningPolicy\nfrom tests.test_base import BaseTest\n\n\nclass LinTSTest(BaseTest):\n\n def test_alpha0_0001(self):\n arm, mab ... | [
[
"numpy.array",
"pandas.DataFrame",
"numpy.asarray",
"sklearn.preprocessing.StandardScaler"
]
] |
BrianOfrim/boja | [
"6571fbbfb7f015e96e80e822d9dc96b4636b4119"
] | [
"vision/predict/predict_spin.py"
] | [
"import os\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport PySpin\nimport torch\nimport torchvision.transforms.functional as F\n\nfrom .._file_utils import get_highest_numbered_file\nfrom .._image_utils import RGB8Image, draw_bboxes\nfrom .. import _models\nfrom .._s3_utils import ... | [
[
"matplotlib.pyplot.pause",
"torch.load",
"torch.no_grad",
"matplotlib.pyplot.subplots",
"torch.cuda.is_available",
"matplotlib.pyplot.get_cmap",
"matplotlib.use",
"torch.device"
]
] |
tolleybot/tensorflow-face-detection | [
"97ddd30107efa87184e1d26d61a747b7a58cf0f8"
] | [
"server.py"
] | [
"from imagezmq import imagezmq\nimport argparse\nimport numpy as np\nimport tensorflow as tf\nimport cv2\nimport time\n\nfrom utils import label_map_util\nfrom utils import visualization_utils_color as vis_util\n\n# Path to frozen detection graph. This is the actual model that is used for the object detection.\nPAT... | [
[
"numpy.squeeze",
"tensorflow.gfile.GFile",
"tensorflow.Graph",
"numpy.expand_dims",
"tensorflow.Session",
"tensorflow.import_graph_def",
"tensorflow.ConfigProto",
"tensorflow.GraphDef"
]
] |
chrisburr/hist | [
"d10132ab8d03f41152f0b934a18291ce699453b2"
] | [
"src/hist/basehist.py"
] | [
"# -*- coding: utf-8 -*-\nfrom .axestuple import NamedAxesTuple\nfrom .quick_construct import MetaConstructor\nfrom .utils import set_family, HIST_FAMILY\nfrom .storage import Storage\n\nimport warnings\nimport functools\nimport operator\nimport histoprint\n\nimport numpy as np\nimport boost_histogram as bh\n\nfrom... | [
[
"numpy.where"
]
] |
GZHermit/video_analyst | [
"6233b19320e3d07b95fb1f782efd89b052a8cf4e"
] | [
"demo/main/video/sot_video.py"
] | [
"# -*- coding: utf-8 -*\n\nfrom paths import ROOT_PATH # isort:skip\nfrom videoanalyst.config.config import cfg\nfrom videoanalyst.config.config import specify_task\nfrom videoanalyst.model import builder as model_builder\nfrom videoanalyst.pipeline import builder as pipeline_builder\nfrom videoanalyst.utils impor... | [
[
"torch.device"
]
] |
jarekczek/codeforces | [
"6214d75991979c12e6e315a3eff7de21a57fae56"
] | [
"python/plot_colors.py"
] | [
"from datetime import date\nimport dateutil.parser\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\ndf = pd.read_csv('colors_2010_2022_6.txt', delimiter=\"\\t\")\ndf = df[df['reportDate'] >= '2018']\nprint(df.head())\n#df = df.set_index('reportDate')\ndates = sorted(df['reportDate'].unique())\nprint(dates)\... | [
[
"pandas.read_csv",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.plot"
]
] |
nbren12/nn_atmos_param | [
"cb138f0b211fd5743e56ad659aec38c082d2b3ac"
] | [
"lib/torch/loss.py"
] | [
"import torch\nfrom toolz import curry\n\n\n@curry\ndef weighted_loss(weight, x, y):\n # return torch.mean(torch.pow(x - y, 2).mul(weight.float()))\n return torch.mean(torch.abs(x - y).mul(weight.float()))\n\n\n@curry\ndef dynamic_loss(truth, pred, weights=None):\n x = truth['prognostic']\n y = pred['pr... | [
[
"torch.abs"
]
] |
Vrekrer/magdynlab | [
"f5149d3213a37c7c18f39876c3e2367fc7deb9e8"
] | [
"controllers/resistance_controller.py"
] | [
"# coding=utf-8\n\n# Author: Diego González Chávez\n# email : diegogch@cbpf.br / diego.gonzalez.chavez@gmail.com\n#\n# Resistance Controller\n#\n# TODO:\n# Make documentation\n\nimport time\nimport numpy\n\n__all__ = ['ResistanceController']\n\n\nclass ResistanceController(object):\n\n# Controllador de SourceMet... | [
[
"numpy.polyfit",
"numpy.linspace",
"numpy.zeros"
]
] |
phc-health/covid-data-model | [
"13c5084d631cf2dd33a7fe558c212dbd32b686e6"
] | [
"tests/libs/datasets/timeseries_test.py"
] | [
"import dataclasses\nimport datetime\nimport io\nimport pathlib\nimport pickle\n\nimport pytest\nimport pandas as pd\nimport numpy as np\nimport structlog\n\nfrom datapublic.common_fields import CommonFields\nfrom datapublic.common_fields import DemographicBucket\nfrom datapublic.common_fields import FieldName\nfro... | [
[
"pandas.Series",
"pandas.Index",
"pandas.DataFrame",
"pandas.to_datetime",
"pandas.MultiIndex.from_tuples",
"pandas.testing.assert_series_equal",
"pandas.to_timedelta",
"pandas.testing.assert_frame_equal"
]
] |
amanvell/faro | [
"2c4e5b86406937e1dd3fa9f339cfbca2325d98d6"
] | [
"src/faro/FaceWorker.py"
] | [
"'''\nMIT License\n\nCopyright 2019 Oak Ridge National Laboratory\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, co... | [
[
"numpy.array",
"numpy.dot",
"scipy.spatial.distance_matrix"
]
] |
ishank-arora/venmo-emoji | [
"209f53b4f90b9d8737c609e6cd5f16d0f5cf25d4"
] | [
"topicModellingWhite.py"
] | [
"import csv\nfrom collections import Counter\nimport emoji\nfrom emoji import unicode_codes\nimport pickle\nimport re\nimport pandas\nimport string\nfrom num2words import num2words\nfrom nltk.tokenize import word_tokenize\nfrom nltk.corpus import stopwords\nfrom nltk.stem import PorterStemmer\nfrom nltk.stem import... | [
[
"pandas.read_csv",
"numpy.random.seed"
]
] |
bjlkeng/sandbox | [
"c95653618b7be5022b0a8e217a4e5667badb2449"
] | [
"notebooks/label_refinery/imagenet_utils.py"
] | [
"\"\"\"Utilities for ImageNet data preprocessing & prediction decoding.\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport json\nimport warnings\nimport numpy as np\n\n# from . import get_keras_submodule\n\n# backend = get_keras_submodul... | [
[
"numpy.array"
]
] |
reagames/ipcamstreamer | [
"a0b6782e228659d526c91e12255c9fd62c694471"
] | [
"ipcamstreamer.py"
] | [
"#ip camera openCV streamer for DLink DCS-932L\n\n\n\n\nimport cv2\nimport urllib \nimport numpy as np\nimport sys\n\n#stream=urllib.urlopen('http://admin:CmasQp123@192.168.1.46:8088/mjpeg.cgi?user=admin&password=CmasQp123&channel=0&.mjpg')\n\nstream=urllib.urlopen('http://admin:CmasQp123@192.168.1.46/mjpeg.cgi?use... | [
[
"numpy.fromstring"
]
] |
Thinklab-SJTU/DCL_RetinaNet_Tensorflow | [
"1d14c9800c3eb1975e8832978f7a263783d171ec",
"1d14c9800c3eb1975e8832978f7a263783d171ec"
] | [
"libs/detection_oprations/proposal_opr_csl_tsne.py",
"libs/configs/DOTA1.0/dcl/cfgs_res101_dota_dcl_v1.py"
] | [
"# encoding: utf-8\nfrom libs.configs import cfgs\nfrom libs.box_utils import bbox_transform\nfrom libs.box_utils import nms_rotate\nimport tensorflow as tf\nimport numpy as np\n\nfrom libs.box_utils.coordinate_convert import coordinate_present_convert, coords_regular\n\n\ndef postprocess_detctions(rpn_bbox_pred, r... | [
[
"tensorflow.stack",
"tensorflow.reshape",
"tensorflow.unstack",
"tensorflow.ones_like",
"tensorflow.greater",
"tensorflow.argmax",
"tensorflow.concat",
"tensorflow.gather",
"tensorflow.py_func"
],
[
"tensorflow.random_normal_initializer",
"tensorflow.constant_initia... |
mikofski/sktime | [
"87bdf36dbc0990f29942eb6f7fa56a8e6c5fa7b7"
] | [
"sktime/forecasting/base/adapters/_pmdarima.py"
] | [
"# -*- coding: utf-8 -*-\n# !/usr/bin/env python3 -u\n# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)\n\"\"\"Implements adapter for pmdarima forecasters to be used in sktime framework.\"\"\"\n\n__author__ = [\"mloning\", \"hyang1996\", \"kejsitake\", \"fkiraly\"]\n__all__ = [\"_PmdArimaAdapt... | [
[
"pandas.MultiIndex.from_product",
"pandas.Series",
"pandas.DataFrame"
]
] |
nalderto/otter-grader | [
"a4714bf48df07b7eb8b3c41530ce7a778fd42c98"
] | [
"test/test_grade.py"
] | [
"#################################\n##### Tests for otter grade #####\n#################################\n\nimport os\nimport unittest\nimport subprocess\nimport json\nimport re\nimport pandas as pd\n\nfrom unittest import mock\nfrom subprocess import PIPE\nfrom glob import glob\n\nfrom otter.argparser import get_p... | [
[
"pandas.read_csv"
]
] |
cjhsieh/pecos | [
"6d5a657945f0a70f13dcf3afec224713cd2deb4d"
] | [
"pecos/core/base.py"
] | [
"# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance\n# with the License. A copy of the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"lic... | [
[
"numpy.ones",
"numpy.zeros",
"scipy.sparse.csc_matrix",
"scipy.sparse.csr_matrix",
"scipy.sparse.coo_matrix"
]
] |
breandan/tensorflow | [
"7509bad95200e1baed4eb488dbeaaa2c505a2824",
"7509bad95200e1baed4eb488dbeaaa2c505a2824"
] | [
"tensorflow/contrib/learn/python/learn/dataframe/transforms/batch.py",
"tensorflow/python/lib/io/tf_record.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.training.input.shuffle_batch",
"tensorflow.python.training.input.batch"
],
[
"tensorflow.python.util.compat.as_bytes"
]
] |
thegodone/gcnn_keras | [
"2009b9ab9a07c1a369849478812fcc2cb9799945"
] | [
"kgcnn/literature/GAT.py"
] | [
"import tensorflow as tf\nimport tensorflow.keras as ks\n\nfrom kgcnn.layers.casting import ChangeTensorType\nfrom kgcnn.layers.conv.attention import AttentionHeadGAT\nfrom kgcnn.layers.keras import Concatenate, Dense, Average, Activation\nfrom kgcnn.layers.mlp import MLP\nfrom kgcnn.layers.pool.pooling import Pool... | [
[
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Input"
]
] |
kne42/napari | [
"d61d0be0ef8ea622dd3d6acd270c0529816c11ec"
] | [
"napari/layers/points/_tests/test_points.py"
] | [
"from copy import copy\nfrom itertools import cycle, islice\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom vispy.color import get_colormap\n\nfrom napari._tests.utils import check_layer_world_data_extent\nfrom napari.layers import Points\nfrom napari.layers.points._points_utils import points_to_squ... | [
[
"numpy.testing.assert_equal",
"numpy.random.seed",
"numpy.asarray",
"numpy.add",
"numpy.testing.assert_allclose",
"numpy.vstack",
"numpy.append",
"numpy.isin",
"numpy.unique",
"numpy.repeat",
"numpy.all",
"numpy.ix_",
"numpy.empty",
"pandas.DataFrame",
"... |
hpgit/HumanFoot | [
"f9a1a341b7c43747bddcd5584b8c98a0d1ac2973"
] | [
"DartWalkingFoot/main_DartTrackingFoot1.py"
] | [
"from fltk import *\nimport copy\nimport os.path\nfrom cPickle import load\n# import time\nimport numpy as np\n\nimport sys\nif \"..\" not in sys.path:\n sys.path.append(\"..\")\n\nfrom PyCommon.modules.ArticulatedBody import hpBipedFeedback as hbf\n\nfrom PyCommon.modules.Math import mmMath as mm\nfrom PyCommon... | [
[
"numpy.eye",
"numpy.zeros",
"numpy.argmin",
"numpy.inner",
"numpy.cross",
"numpy.isnan",
"numpy.array",
"numpy.around",
"numpy.dot",
"numpy.linalg.norm"
]
] |
bradduy/computer_vision | [
"cfe97e84a5e216819497405a79ef2ef0ca2b95fe"
] | [
"Data Science/MachineLearningFromPytorch.py"
] | [
"import torch\n\n# f = w * x\n\n# f = 2 * x\nX = torch.tensor([1,2,3,4], dtype=torch.float32) # training sample\nY = torch.tensor([2,4,6,8], dtype=torch.float32) # testing sample\n\nw = torch.tensor(0.0, dtype=torch.float32, requires_grad=True)\n\n#model prediction\ndef forward(x):\n return w * x\n\n# loss = MSE... | [
[
"torch.no_grad",
"torch.tensor"
]
] |
nirbhayjm/rlpyt | [
"a2741201bbf33f5408306198d220d90f8f7b7250"
] | [
"rlpyt/models/pg/atari_lstm_model.py"
] | [
"import torch\nimport torch.nn.functional as F\n\nfrom rlpyt.models.conv2d import Conv2dHeadModel\nfrom rlpyt.utils.collections import namedarraytuple\nfrom rlpyt.utils.tensor import infer_leading_dims, restore_leading_dims\n\nRnnState = namedarraytuple(\n \"RnnState\", [\"h\", \"c\"]\n) # For downstream nameda... | [
[
"torch.nn.LSTM",
"torch.nn.Linear"
]
] |
PeppeSaccardi/pytorch-lightning | [
"046110797227c352126c779c207e076ce9682eae"
] | [
"tests/checkpointing/test_trainer_checkpoint.py"
] | [
"# Copyright The PyTorch Lightning team.\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... | [
[
"torch.optim.lr_scheduler.StepLR"
]
] |
nschmucker/Sundial | [
"3c1ef3ac422314b7d811c842065f0992a8ff8aeb"
] | [
"sundial.py"
] | [
"\"\"\"\nsundial.py\nThis file contains code to run an indoor sundial\nDeveloped on Python 3.7.3 / Raspberry Pi 4\nNathaniel Schmucker\n\"\"\"\n\nfrom busio import I2C\nfrom board import SCL, SDA\nfrom adafruit_pca9685 import PCA9685\nfrom adafruit_motor import servo\n\nfrom pysolar.solar import get_altitude, get_a... | [
[
"scipy.optimize.fsolve"
]
] |
sangyx/graph-tricks | [
"618bea55e221a9a3caedbe73aaa584303e583a98"
] | [
"benchmark/pyg/model.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch_geometric.nn import MessagePassing\nimport torch.nn.functional as F\nfrom torch_geometric.nn import global_mean_pool, GCNConv, SAGEConv\nfrom torch_geometric.utils import degree\n\nfrom ogb.graphproppred.mol_encoder import AtomEncoder, BondEncoder\n\n### GIN convolut... | [
[
"torch.nn.init.xavier_uniform_",
"torch.nn.Linear",
"torch.nn.init.constant_",
"torch.nn.functional.dropout",
"torch.nn.BatchNorm1d",
"torch.nn.Embedding",
"torch.nn.functional.relu",
"torch.nn.ModuleList",
"torch.nn.ReLU",
"torch.Tensor"
]
] |
rjpower/tensorflow-io | [
"39aa0b46cfaa403121fdddbd491a03d2f3190a87"
] | [
"tensorflow_io/cifar/__init__.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.util.all_util.remove_undocumented"
]
] |
usccolumbia/deeperGATGNN | [
"24ee53b23d1559040b7aab971768434753b582ff"
] | [
"matdeeplearn/models/super_mpnn.py"
] | [
"import torch\r\nfrom torch import Tensor\r\nimport torch.nn.functional as F\r\nfrom torch.nn import Sequential, Linear, ReLU, BatchNorm1d, GRU\r\nimport torch_geometric\r\nfrom torch_geometric.nn import (\r\n Set2Set,\r\n global_mean_pool,\r\n global_add_pool,\r\n global_max_pool,\r\n NNConv,\r\n ... | [
[
"torch.nn.Linear",
"torch.nn.functional.dropout",
"torch.add",
"torch.nn.GRU",
"torch.nn.ModuleList",
"torch.nn.ReLU"
]
] |
foocker/Image2Katex | [
"775efd6a68168fe46572e5017a861321c342e623"
] | [
"models/decoder.py"
] | [
"'''\nFilename: decoder.py\nProject: models\nFile Created: Wednesday, 11th July 2018 3:37:09 pm\nAuthor: xiaofeng (sxf1052566766@163.com)\n--------------------------\nLast Modified: Sunday, 2nd December 2018 4:09:59 pm\nModified By: xiaofeng (sxf1052566766@163.com)\n---------------------------\nCopyright: 2018.06 -... | [
[
"tensorflow.squeeze",
"tensorflow.contrib.rnn.GRUCell",
"tensorflow.shape",
"tensorflow.variable_scope"
]
] |
tareknaous/visual-clustering | [
"73ab04b560c72917ddb5ad69594afee59ebd44d7"
] | [
"dataset.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn import datasets\n\n#blobs\nn_samples = 1500\nblobs = datasets.make_blobs(n_samples=n_samples, centers=4, random_state=3)\n# plt.scatter(blobs[0][:,0],blobs[0][:,1])\n# plt.show()\n\ncluster_0_points = []\ncluster_1_points = []\ncluster_2_points = []... | [
[
"scipy.spatial.ConvexHull",
"matplotlib.pyplot.show",
"numpy.array",
"matplotlib.pyplot.plot",
"sklearn.datasets.make_blobs"
]
] |
wgfi110/athena | [
"e704884ec6a3a947769d892aa267578038e49ecb"
] | [
"athena/data/datasets/base.py"
] | [
"# coding=utf-8\n# Copyright (C) 2019 ATHENA AUTHORS; Xiangang Li; Shuaijiang Zhao\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... | [
[
"tensorflow.device",
"tensorflow.compat.v2.data.Dataset.from_generator"
]
] |
wangbingok1118/SSD_Pytorch | [
"8d3f924671cec367c3c420eba2f002cc5b5181bb"
] | [
"demo.py"
] | [
"import os\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"1,0\"\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\nimport torch.nn.init as init\nimport argparse\nfrom torch.autograd import Variable\nimport torch.utils.data as data\nfrom data import COCODetection, VOC... | [
[
"torch.load",
"numpy.empty",
"numpy.concatenate",
"torch.no_grad",
"torch.set_default_tensor_type",
"numpy.array",
"numpy.where",
"numpy.unique"
]
] |
inaccel/TF2 | [
"1a3ce4c63675a30156bfcf3a1b9682154ef13183"
] | [
"TransForm_Kit/Quantization/debug/Pytorch-ResNet50-Log2QuantizeLoad-FPGA_Quantize-Batch-2.py"
] | [
"\n# coding: utf-8\n\n\nimport math\nimport struct\nimport cv2\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.utils.model_zoo as model_zoo\nimport torch.utils.data as data\nimport torchvision\nimport torchvision.models as tvmodel\nimport torchvision.transforms as transforms\nimport torchvisi... | [
[
"numpy.ones",
"numpy.sum",
"torch.sqrt",
"numpy.lib.pad",
"torch.cuda.is_available",
"torch.nn.Conv2d",
"torch.nn.init.kaiming_normal_",
"torch.round",
"torch.nn.DataParallel",
"torch.Tensor",
"numpy.int8",
"torch.nn.MaxPool2d",
"torch.ones",
"torch.load",
... |
franklu2014/foocat | [
"5d452996ba139693fcbcda05c7500b24b9d1ad50"
] | [
"foocat/foocat.py"
] | [
"import pandas as pd\n\n\ndef catbind(a, b):\n \"\"\"\n Concatenates two pandas categoricals.\n\n Parameters\n ----------\n a : pandas.core.arrays.categorical.Categorical\n A pandas categorical.\n b : pandas.core.arrays.categorical.Categorical\n A pandas categorical that you wish to conc... | [
[
"pandas.Categorical"
]
] |
Hzfinfdu/BBT_CPM | [
"ee095727c714902fa6f8f5deebf1c30dc1956520"
] | [
"mpu/layers.py"
] | [
"# coding=utf-8\n# Copyright (c) 2019, 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... | [
[
"torch.empty",
"torch.nn.functional.embedding",
"torch.split",
"torch.nn.functional.linear",
"torch.no_grad",
"torch.cat",
"torch.Tensor"
]
] |
wjj19950828/tvm | [
"9c63f4fc318652f6fff68342da2d11b26592a3e0"
] | [
"tests/python/frontend/pytorch/test_forward.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"torch.nn.ReflectionPad1d",
"torch.addcdiv",
"torch.rand",
"torch.masked_fill",
"torch.jit.save",
"torch.nn.Conv2d",
"torch.meshgrid",
"torch.cat",
"torch.neg",
"torch.jit.trace",
"torch.nn.ConstantPad2d",
"torch.nn.BatchNorm3d",
"torch.randn",
"torch.take",... |
Mehrad0711/bootleg | [
"f812b6200eb84b0163d353f0d4f73308a921fcfa"
] | [
"bootleg/layers/attn_networks.py"
] | [
"\"\"\"Attention networks.\"\"\"\nimport logging\n\nimport torch\nimport torch.nn as nn\n\nimport bootleg.utils.model_utils\nfrom bootleg.layers.helper_modules import MLP, AttnBlock, NormAndSum, SelfAttnBlock\nfrom bootleg.symbols.constants import (\n BERT_WORD_DIM,\n DISAMBIG,\n KG_BIAS_LOAD_CLASS,\n M... | [
[
"torch.sum",
"torch.bmm",
"torch.nn.Softmax",
"torch.zeros_like",
"torch.tensor",
"torch.eye",
"torch.zeros",
"torch.nn.ModuleDict",
"torch.cat"
]
] |
lightbooster/models | [
"833900b085a353712010c26c66ae9111246b5ac7"
] | [
"official/nlp/modeling/models/bert_classifier_test.py"
] | [
"# Copyright 2021 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.constant",
"tensorflow.test.main",
"tensorflow.keras.Input"
]
] |
MathMachado/tensorflow | [
"56afda20b15f234c23e8393f7e337e7dd2659c2d"
] | [
"tensorflow/python/ops/math_grad.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.ops.gen_math_ops.xlogy",
"tensorflow.python.ops.math_ops.lgamma",
"tensorflow.python.ops.gen_math_ops.reciprocal_grad",
"tensorflow.python.ops.math_ops.negative",
"tensorflow.python.ops.math_ops.zeta",
"tensorflow.python.ops.array_ops.tile",
"tensorflow.python.ops.ma... |
shunsvineyard/shunsvineyard | [
"5ef44847da95e8ad881622d2c3571a3aceb1b20c"
] | [
"pocket-learning-algorithm-and-feature-engineering/iris_example.py"
] | [
"# Copyright © 2017, 2019 by Shun Huang. All rights reserved.\n# Licensed under MIT License.\n# See LICENSE in the project root for license information.\n\n\"\"\"An example of supervised learning uses the Iris data set.\nhttps://archive.ics.uci.edu/ml/datasets/Iris\nAttribute Information:\n0. sepal length in cm \n1... | [
[
"matplotlib.pyplot.legend",
"numpy.append",
"pandas.read_csv",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.scatter"
]
] |
changgoo/pyathena-1 | [
"c461ac3390d773537ce52393e3ebf68a3282aa46"
] | [
"pyathena/tigress_xco/plt_tigress_xco.py"
] | [
"#!/usr/bin/env python\n\nimport os\nimport sys\nimport time\n\nimport os.path as osp\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nfrom matplotlib import gridspec\nimport numpy as np\nimport xarray as xr\nfrom mpi4py import MPI\n\nfrom .load_sim_tigress_xco import LoadSimTIGRESSXCOAll\nfrom ..util.sp... | [
[
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.gridspec.GridSpecFromSubplotSpec",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gcf",
"numpy.logical_and",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.t... |
kkleidal/GatedPixelCNNPyTorch | [
"286298a0cd81ed2f6cb918fd39ce4da2c0e92802"
] | [
"models/components/pixelcnn.py"
] | [
"# Loosely derived from https://github.com/jzbontar/pixelcnn-pytorch/blob/master/main.py\n# and moreso derived from https://github.com/rampage644/wavenet/blob/master/wavenet/models.py\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\ni... | [
[
"torch.nn.Linear",
"torch.nn.functional.tanh",
"torch.nn.functional.sigmoid",
"torch.randn",
"torch.rand",
"torch.autograd.Variable",
"torch.nn.functional.relu",
"torch.cumsum",
"torch.from_numpy",
"torch.nn.Conv2d",
"torch.nn.ModuleList",
"torch.max",
"torch.ze... |
zhengye1995/datafountain_siweituxin_autodriver_det | [
"2c2df76fb9942ddc334730cc5bc447be66440e22"
] | [
"tools/convert_datasets/trans_txt2json.py"
] | [
"# *utf-8*\nimport os\nimport json\nimport numpy as np\nfrom tqdm import tqdm\nimport cv2\n\ndefect_name2label = {\n 'red': 1, 'green': 2, 'yellow': 3, 'red_left': 4, 'red_right': 5, 'yellow_left': 6, 'yellow_right': 7,\n 'green_left': 8, 'green_right': 9, 'red_forward': 10, 'green_forward': 11, 'yellow_forwa... | [
[
"numpy.asarray"
]
] |
Mrpatekful/supervised-translation | [
"d03db6a0fc25900fd42b8057a12adad0b8d025f8"
] | [
"src/model.py"
] | [
"\"\"\"\n@author: Patrik Purgai\n@copyright: Copyright 2019, supervised-translation\n@license: MIT\n@email: purgai.patrik@gmail.com\n@date: 2019.04.04.\n\"\"\"\n\n# pylint: disable=no-member\n# pylint: disable=not-callable\n\nimport torch\nimport random\n\nfrom torch.nn.modules import (\n Module, M... | [
[
"torch.nn.functional.log_softmax",
"torch.nn.Linear",
"torch.nn.functional.embedding",
"torch.nn.functional.linear",
"torch.bmm",
"torch.nn.functional.softmax",
"torch.tensor",
"torch.nn.Embedding",
"torch.nn.GRU",
"torch.zeros",
"torch.cat",
"torch.nn.Dropout"
]
... |
jiruifu-jerry0219/UpperLimbEstimator | [
"d62deef93419934dcb33e43707dd0634a235fb9a"
] | [
"ArtificialNeuralNetwork/model.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport torch.utils.data as Data\nimport torch.optim as optim\nfrom torch.utils.data import Dataset, DataLoader, WeightedRandomSampler\n\nclass MultipleRegression(nn.Module):\n def __init__(self, num_featur... | [
[
"torch.nn.Sigmoid",
"torch.nn.Linear"
]
] |
anonymousGithub2023/ECCV | [
"7c4b862c898aa6a591bc7f32f95c5900e0492490"
] | [
"collect_latency.py"
] | [
"import torch\nimport os\nimport numpy as np\n\nfrom utils import *\n\nl2_res = np.zeros([6, 7])\nlinf_res = np.zeros([6, 7])\n\nresDir = 'res'\nif not os.path.isdir(resDir):\n os.mkdir(resDir)\nfor model_file in MODEL_FILE_LIST:\n task_name = model_file.split('.')[0]\n for attack_name in ['L2', 'Linf']:\n... | [
[
"torch.load",
"numpy.zeros",
"numpy.savetxt",
"numpy.array",
"numpy.concatenate"
]
] |
youqingxiaozhua/OpenSelfSup | [
"ab8fc27c6b43679317eaf312b85461ba490606af"
] | [
"openselfsup/models/backbones/resnet.py"
] | [
"import torch.nn as nn\nimport torch.utils.checkpoint as cp\nfrom mmcv.cnn import constant_init, kaiming_init\nfrom mmcv.runner import load_checkpoint\nfrom torch.nn.modules.batchnorm import _BatchNorm\n\nfrom openselfsup.utils import get_root_logger\nfrom ..registry import BACKBONES\nfrom ..utils import build_conv... | [
[
"torch.nn.MaxPool2d",
"torch.utils.checkpoint.checkpoint",
"torch.nn.ReLU",
"torch.nn.Sequential"
]
] |
unhold/game-and-watch-patch | [
"dc33f2228d7c791a746502aef27a5331c0076503"
] | [
"patches/tileset.py"
] | [
"from io import BytesIO\nfrom math import ceil\n\nimport numpy as np\nfrom PIL import Image\n\nfrom .exception import ParsingError\n\n_BLOCK_SIZE = 16\n_BLOCK_PIXEL = _BLOCK_SIZE * _BLOCK_SIZE\n\nPALETTE_OFFSETS = [\n 0xB_EC68,\n 0xB_EDA8,\n 0xB_EEE8,\n 0xB_F028,\n 0xB_F168,\n]\n\n\ndef bytes_to_tile... | [
[
"numpy.zeros",
"numpy.argmin",
"numpy.fliplr",
"numpy.array",
"numpy.linalg.norm",
"numpy.frombuffer"
]
] |
JeanOlivier/Labber-PSICT | [
"f6d831823ec7c8373fd562b6d1247f7e438f1ee5"
] | [
"PSICT_extras/PSICT_MultiPulse/PSICT_MultiPulse.py"
] | [
"#!/usr/bin/env python\n\nimport InstrumentDriver\nimport numpy as np\n\nimport os\nimport logging\nfrom datetime import datetime\n\nfrom PSICT_MultiPulse_tools import delistifyPulseDefs\nfrom waveforms_handling import generatePulse, calculateWaveform, gen_pulse_sequence\n\n\nclass Driver(InstrumentDriver.Instrumen... | [
[
"numpy.array"
]
] |
keklarup/POET_AiPoetry | [
"ff197564ab13d0e2001093bc2b803d538dd52f59"
] | [
"app.py"
] | [
"# -*- coding: utf-8 -*-\n# app.py\n\nfrom flask import Flask, request, render_template\nimport pickle\nimport gzip\nimport numpy as np\nimport AiPoems\n\n#start up cell -- import necessary metadata for model\nwith open('tokenizer.pickle', 'rb') as handle:\n tokenizer = pickle.load(handle)\nwith gzip.GzipFile('p... | [
[
"numpy.load"
]
] |
AntonYermilov/progue | [
"7f382208c9efc904cff9d8df4750606039801d45"
] | [
"game/model/entity/character/hero.py"
] | [
"from dataclasses import dataclass\nfrom typing import Dict\n\nimport numpy as np\n\nfrom game import Position\nfrom game.model.entity.damage import Damageable, Damage, DamageType\nfrom game.model.entity.inventory.inventory_keeper import InventoryKeeper\nfrom game.model.entity.item.item import Item\nfrom .character... | [
[
"numpy.random.choice"
]
] |
qureshinomaan/habitat-sim | [
"df2540b658d0444e84bbc7a0c3fb995f8d523b52"
] | [
"tests/test_controls.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport attr\nimport hypothesis\nimport magnum as mn\nimport numpy as np\nimport pytest\nimport quaternion # ... | [
[
"numpy.random.uniform",
"numpy.allclose",
"numpy.arctan2",
"numpy.quaternion",
"numpy.array",
"numpy.linalg.norm",
"numpy.deg2rad"
]
] |
readthedocs-assistant/tabmat | [
"c2d82db1901afb0ea79806f26ee66068d553b3e6"
] | [
"src/tabmat/dense_matrix.py"
] | [
"from typing import List, Optional, Union\n\nimport numpy as np\n\nfrom .ext.dense import (\n dense_matvec,\n dense_rmatvec,\n dense_sandwich,\n transpose_square_dot_weights,\n)\nfrom .matrix_base import MatrixBase\nfrom .util import (\n check_matvec_out_shape,\n check_transpose_matvec_out_shape,\... | [
[
"numpy.sqrt",
"numpy.ix_",
"numpy.issubdtype",
"numpy.asarray"
]
] |
vishalbelsare/RLScore | [
"713f0a402f7a09e41a609f2ddcaf849b2021a0a7"
] | [
"rlscore/test/test_learner/test_query_rankrls.py"
] | [
"import numpy as np\nimport numpy.linalg as la\nfrom numpy.testing import assert_allclose\nimport unittest\n\nfrom rlscore.learner import QueryRankRLS\nfrom rlscore.kernel import GaussianKernel, PolynomialKernel\n\n\ndef mapQids(qids):\n \"\"\"Maps qids to running numbering starting from zero, and partitions\n ... | [
[
"numpy.sum",
"numpy.ones",
"numpy.eye",
"numpy.ix_",
"numpy.zeros",
"numpy.random.seed",
"numpy.random.randn",
"numpy.where",
"numpy.max",
"numpy.random.rand",
"numpy.testing.assert_allclose",
"numpy.sqrt",
"numpy.dot",
"numpy.array"
]
] |
marwahaha/QTensor | [
"936d078825a6418f9d32d2c176332422d8a4c137"
] | [
"qtensor/tests/test_simulators.py"
] | [
"import qtensor\nfrom qtensor import CirqQAOAComposer, QtreeQAOAComposer\nfrom qtensor import QAOAQtreeSimulator\nfrom qtensor.Simulate import CirqSimulator, QtreeSimulator\nfrom qtensor.FeynmanSimulator import FeynmanSimulator\nimport numpy as np\nimport networkx as nx\n\nnp.random.seed(42)\n\n\ndef get_test_probl... | [
[
"numpy.array",
"numpy.random.seed",
"numpy.real",
"numpy.imag"
]
] |
Prakadeeswaran05/Simple-Tf-ObjectDetection-SemanticSegmentation-ROS | [
"f119f0f8394c324c8453d540f4dfa495e34ee001"
] | [
"notcv_bridge.py"
] | [
"#! /usr/bin/env python\nimport sys\nimport numpy as np\nfrom sensor_msgs.msg import Image\n\ndef imgmsg_to_cv2(img_msg):\n if img_msg.encoding != \"bgr8\":\n rospy.logerr(\"This Coral detect node has been hardcoded to the 'bgr8' encoding. Come change the code if you're actually trying to implement a new... | [
[
"numpy.ndarray",
"numpy.dtype"
]
] |
ipanepen/sagemaker-scikit-learn-container | [
"3214b0d36955fed0b6338b997b26bcc883f7b883"
] | [
"test/unit/test_serving.py"
] | [
"# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"l... | [
[
"numpy.testing.assert_equal",
"numpy.ones",
"numpy.array",
"numpy.array_equal"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.