repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
normster/vissl
[ "fc914adc9bc3209d7861c13922a2a1c76d5bddde" ]
[ "extra_scripts/datasets/create_resisc45_data_files.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport argparse\nimport os\nimport random\nimport shutil\n\nfrom torch.utils.data import DataLoader\nfrom tqdm import tqdm\n\n\nRESIS...
[ [ "torch.utils.data.DataLoader" ] ]
arkilpatel/SVAMP
[ "81e568ca3f1b1f4026758db24c05acd4ce2eeb9c" ]
[ "code/rnn_seq2seq/src/utils/sentence_processing.py" ]
[ "import logging\r\nimport pdb\r\nimport torch\r\nfrom glob import glob\r\nfrom torch.autograd import Variable\r\nimport numpy as np\r\n# Ignore warnings\r\nimport warnings\r\nwarnings.filterwarnings(\"ignore\")\r\n\r\n\r\ndef sent_to_idx(voc, sent, max_length):\r\n\tidx_vec = []\r\n\tfor w in sent.split(' '):\r\n\t...
[ [ "torch.LongTensor", "torch.tensor" ] ]
pradeep-vishnu/pcv
[ "b88e706f8c7a8649b29ea848ba8c7fbb5dfde359" ]
[ "panoptic/pcv/gaussian_smooth/vis.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom ipywidgets import Output\nfrom matplotlib.patches import Circle\n\nfrom panoptic.pcv.gaussian_smooth.prob_tsr import MakeProbTsr\nfrom panoptic.pcv.components.snake import Snake\n\nfrom panoptic.vis import Visualizer as BaseVisualizer\n\n\nclass Plot():\n ...
[ [ "numpy.where", "numpy.array", "matplotlib.patches.Circle", "matplotlib.pyplot.figure" ] ]
winderai/pachyderm-seldon
[ "03e9affbdfaa2bdde4b20c3197f1620e99fcea9e" ]
[ "repo/ExplainerTraining/explainer_test.py" ]
[ "import argparse\n\nimport dill\nimport numpy as np\nimport pandas as pd\nimport joblib\n\nnp.random.seed(112)\n\nparser = argparse.ArgumentParser()\nparser.add_argument('data_file_path', type=str)\nparser.add_argument('explainer_path', type=str)\nparser.add_argument('detector_path', type=str)\nargs = parser.parse_...
[ [ "numpy.random.seed", "pandas.read_csv" ] ]
imoneoi/fixed_tianshou
[ "c0bc8e00cad25739ec80a52afd5e0ff296b11dd4" ]
[ "examples/mujoco/mujoco_npg.py" ]
[ "#!/usr/bin/env python3\n\nimport os\nimport gym\nimport torch\nimport pprint\nimport datetime\nimport argparse\nimport numpy as np\nfrom torch import nn\nfrom torch.optim.lr_scheduler import LambdaLR\nfrom torch.utils.tensorboard import SummaryWriter\nfrom torch.distributions import Independent, Normal\n\nfrom tia...
[ [ "numpy.max", "numpy.ceil", "torch.nn.init.constant_", "numpy.random.seed", "torch.distributions.Normal", "numpy.min", "torch.manual_seed", "torch.cuda.is_available", "torch.load", "numpy.sqrt", "torch.optim.lr_scheduler.LambdaLR", "torch.nn.init.zeros_", "torch....
brunzema/uitvbo
[ "3d71f94cfe452678ff2c9c8fbea1eef4d8a233f5" ]
[ "src/kernels/costum_kernels.py" ]
[ "import gpytorch\nimport torch\nfrom gpytorch.constraints import Interval\nimport time\n\n\nclass TemporalKernelB2P(gpytorch.kernels.Kernel):\n is_stationary = True\n\n def __init__(self, epsilon=0.08, **kwargs): # 0.01\n super().__init__(**kwargs)\n\n self.epsilon = epsilon\n\n # this is th...
[ [ "torch.cat", "torch.min", "torch.tile", "torch.meshgrid", "torch.empty", "torch.exp", "torch.pow" ] ]
gokejian/Multi-Agent-DQJL
[ "1da9ea647db369c10904fc8580c3515e66f264d6" ]
[ "roadEnv.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Author: Haoran Su\nEmail: hs1854@nyu.edu\n\"\"\"\nimport vehicle_env\nimport numpy as np\nimport generate\n\n# Action is now defined that index of vehicle start to yield at given step\n# Under this scheme, only one vehicle can yield at each step\n# action = -1 if no vehicle is yieldi...
[ [ "numpy.random.normal" ] ]
YixiaoZhang/Accuracy-and-Robustness
[ "4ed2b8ee72af4dad892b0d5187625a4bbd2150fa" ]
[ "cifar.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport os\nimport pickle\nimport gzip\nimport pickle\nimport urllib.request\n\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Activation, Flatten\nfrom keras.layers import Conv2D, MaxPooling2D\nfrom keras.utils import np_utils\nfrom keras....
[ [ "numpy.identity", "numpy.array", "numpy.fromstring", "numpy.zeros" ] ]
BlueBrain/sonata
[ "f6040cd4fdccd9e5536e57322f11e6ce5805e773" ]
[ "src/pysonata/sonata/io/population.py" ]
[ "# Copyright 2017. Allen Institute. All rights reserved\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the\n# following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and ...
[ [ "pandas.DataFrame", "numpy.array", "pandas.Series" ] ]
bradh/tk_builder
[ "15bde02b93a67acf46ad485e7cc345cfe3bcd540" ]
[ "tk_builder/widgets/image_canvas.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nThis module provides functionality for\n\"\"\"\n\nimport PIL.Image\nfrom PIL import ImageTk\nimport platform\nimport time\nimport tkinter\nimport tkinter.colorchooser as colorchooser\nfrom typing import Union, Tuple, List, Dict\n\nimport numpy\nfrom scipy.linalg import norm\n\nfrom...
[ [ "numpy.square", "numpy.max", "numpy.zeros_like", "numpy.array", "numpy.asarray", "numpy.setdiff1d", "numpy.min", "scipy.linalg.norm", "numpy.cross", "numpy.asanyarray" ] ]
mozga-intel/tvm
[ "544724439efb9a795c92bd7ec9f7929e41c843c6" ]
[ "tests/python/unittest/test_target_texture_codegen_opencl.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'); you...
[ [ "numpy.random.uniform", "numpy.zeros" ] ]
JSybrandt/HypergraphEmbedding
[ "4ca8b5156d45e49f2de7f3af48a3cfe3c69b8a26" ]
[ "utilities/visualize_hg.py" ]
[ "#!/usr/bin/env python3\n\nimport matplotlib as mpl\nmpl.use('Agg')\nimport matplotlib.pyplot as plt\n\nimport argparse\nfrom pathlib import Path\nfrom hypergraph_embedding import Hypergraph\nfrom hypergraph_embedding.hypergraph_util import ToBlockDiagonal\nfrom hypergraph_embedding.hypergraph_util import CompressR...
[ [ "matplotlib.use", "matplotlib.pyplot.figure" ] ]
MariaMich/Hacktoberfest2019-2
[ "a1a1756fa4594ab9965405e0361a5125b1d4dd48" ]
[ "Python/Enigma_Logo/enigma_logo_encrypt.py" ]
[ "import numpy as np \r\nimport cv2\r\nimport random\r\n \r\nimg = cv2.imread('enigma_logo@3.png', cv2.IMREAD_UNCHANGED)\r\nheight, width, a = img.shape\r\n#print(img.shape)\r\n#img = cv2.resize(img, (int(width * .6),int(height * .6)), interpolation = cv2.INTER_AREA)\r\n#height, width, a = img.shape\r\n\r\nframe_hei...
[ [ "numpy.zeros" ] ]
rxwsxn/imantics
[ "76d81036d8f92854d63ad9938dd76c718f8b482e" ]
[ "imantics/dataset.py" ]
[ "import random\nimport numpy as np\n\nfrom .annotation import Annotation\nfrom .category import Category\nfrom .basic import Semantic\nfrom .image import Image\n\n\nclass Dataset(Semantic):\n @classmethod\n def from_xml(cls, xml_folder, name=\"XML Dataset\"):\n extensions = (\"jpg\",\"JPG\",\"png\")\n\...
[ [ "numpy.array", "numpy.split" ] ]
JessikaSmith/language_model
[ "9b0765c9b3daeb331b48dc5b12a7d1130276022a" ]
[ "classification/classification_xgboost.py" ]
[ "from language_model import QRNN\n\nimport sklearn\nimport hyperopt\nfrom hyperopt import STATUS_OK, fmin, hp, tpe\nimport xgboost as xgb\nimport numpy as np\nimport pandas as pd\nimport pickle\n\nfrom metrics import calculate_all_metrics\n\nfrom sklearn.metrics import roc_auc_score\n\nfrom matplotlib import pyplot...
[ [ "numpy.array", "tensorflow.Session", "tensorflow.ConfigProto", "numpy.arange", "pandas.read_csv", "sklearn.metrics.roc_auc_score" ] ]
tjdbsrud/vissl
[ "b647c256447af7ea66655811849be1f642377db8" ]
[ "extra_scripts/datasets/create_stanford_cars_data_files.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport argparse\nimport os\nimport shutil\n\nfrom scipy import io\nfrom torch.utils.data import DataLoader\nfrom torchvision.datasets...
[ [ "torch.utils.data.DataLoader" ] ]
gokart23/allennlp
[ "0cf98c27d7e6fd1244e7335115e3fc64c9d5850a" ]
[ "allennlp/modules/elmo.py" ]
[ "import json\nimport logging\nimport warnings\nfrom typing import Any, Dict, List, Union\n\nimport numpy\nimport torch\nfrom overrides import overrides\nfrom torch.nn.modules import Dropout\n\nfrom allennlp.common import FromParams\nfrom allennlp.common.checks import ConfigurationError\nfrom allennlp.common.file_ut...
[ [ "torch.nn.Linear", "numpy.concatenate", "torch.cat", "numpy.array", "numpy.zeros", "torch.max", "torch.nn.Conv1d", "torch.nn.modules.Dropout", "torch.FloatTensor", "numpy.transpose", "torch.transpose" ] ]
eric-czech/codex
[ "23e880d483bf4c57809ebbd214640f6246c8fd37" ]
[ "python/pipeline/codex/exec/pipeline.py" ]
[ "\"\"\"CODEX preprocessing pipeline core logic\n\nThis is not intended to be run directly but rather used by mutliple external\ninterfaces to implement the core process that comprises CODEX processing.\n\"\"\"\nimport os, logging, itertools, queue\nimport numpy as np\nfrom os import path as osp\nfrom threading impo...
[ [ "numpy.array", "scipy.stats.describe" ] ]
zhuangdizhu/ReAgent
[ "e6d1e5c8f8c9f0896b957c06d6fb089dc76dd17b", "e6d1e5c8f8c9f0896b957c06d6fb089dc76dd17b" ]
[ "reagent/training/ranking/seq2slate_trainer.py", "reagent/training/dqn_trainer_base.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\nimport logging\nfrom typing import List, Optional, Tuple\n\nimport reagent.core.types as rlt\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom reagent.core.dataclasses import field\nfrom reage...
[ [ "torch.zeros", "torch.max", "torch.FloatTensor", "torch.nn.functional.mse_loss", "torch.tensor", "torch.zeros_like", "torch.mean", "torch.sum" ], [ "torch.cat", "torch.arange", "torch.max", "torch.gather", "torch.no_grad", "torch.nn.functional.mse_loss",...
JoaoCarabetta/SimulaCovid
[ "36961cfe2b7fb3545e7653c499add4fb36757d7d" ]
[ "src/models/seir.py" ]
[ "from scipy.integrate import odeint\nimport pandas as pd\nimport numpy as np\n\n# The SIR model differential equations.\ndef SEIR(y, t, N, beta, gamma, sigma):\n\n S, E, I, R = y\n dSdt = - beta * S * I / N\n dEdt = beta * S * I / N - sigma * E\n dIdt = sigma * E - gamma * I\n dRdt = gamma * I\n ...
[ [ "pandas.DataFrame", "scipy.integrate.odeint", "numpy.linspace" ] ]
nicoloabrate/serpent-tools
[ "682fa6be3155c233b5f13aa4d106fe2b1a5b1b09" ]
[ "serpentTools/parsers/microxs.py" ]
[ "\"\"\"Parser responsible for reading the ``mdx[i].m`` files\"\"\"\n\nfrom collections import namedtuple\n\nfrom numpy import array\n\nfrom serpentTools.engines import KeywordParser\nfrom serpentTools.utils import (\n splitValsUncs, str2vec,\n VEC_REGEX, SCALAR_REGEX, FIRST_WORD_REGEX,\n)\nfrom serpentTools.p...
[ [ "numpy.array" ] ]
aimagelab/camel
[ "67cb06210165b7953248ef38c36fc51d7240fb5e" ]
[ "models/transformer/attention.py" ]
[ "import numpy as np\nimport torch\nfrom torch import nn\nfrom models.containers import Module\n\n\nclass ScaledDotProductAttention(nn.Module):\n \"\"\"\n Scaled dot-product attention\n \"\"\"\n\n def __init__(self, d_model, d_k, d_v, h):\n '''\n :param d_model: Output dimensionality of the...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.LayerNorm", "torch.cat", "torch.relu", "torch.nn.init.constant_", "torch.FloatTensor", "torch.nn.init.xavier_uniform_", "torch.softmax", "torch.nn.init.normal_", "numpy.sqrt", "torch.matmul" ] ]
haofanwang/cleverhans
[ "1c92191f076d90b9dd0b4e072f819d855ccc9109" ]
[ "cleverhans/attacks/elastic_net_method.py" ]
[ "\"\"\"The ElasticNetMethod attack.\n\"\"\"\n\nimport logging\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom cleverhans.attacks.attack import Attack\nfrom cleverhans.compat import reduce_sum, reduce_max\nfrom cleverhans.model import Model, CallableModelWrapper, wrapper_warning_logits\nfrom cleverhans import...
[ [ "numpy.copy", "numpy.mean", "numpy.dtype", "tensorflow.cast", "tensorflow.train.GradientDescentOptimizer", "tensorflow.subtract", "tensorflow.Variable", "tensorflow.global_variables", "tensorflow.negative", "numpy.argmax", "numpy.sqrt", "tensorflow.add", "tensor...
Chrisa142857/AR_microscope
[ "a3293cbb1301aed801214e06a51be4a49a187dbc" ]
[ "10X/models.py" ]
[ "from __future__ import division\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\n\nfrom utils.parse_config import *\nfrom utils.utils import build_targets, to_cpu, non_max_suppression\n\nimport matplotlib.pyplot as plt\nimport matplot...
[ [ "torch.sigmoid", "numpy.array", "torch.cat", "torch.nn.MSELoss", "torch.nn.ModuleList", "torch.arange", "torch.nn.Sequential", "torch.nn.functional.interpolate", "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.nn.ZeroPad2d", "torch.from_numpy", "torch.nn.BC...
danilopeixoto/feast
[ "57d134355364654a2275b477b3b82b149f0779ca" ]
[ "sdk/python/tests/integration/registration/test_registry.py" ]
[ "# Copyright 2021 The Feast 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ...
[ [ "pandas.DataFrame" ] ]
MKFMIKU/PFFNet
[ "e506010a7cf00a32e77681845bdaf78ba88b027d" ]
[ "psnr_ssim.py" ]
[ "#!/usr/bin/env python\nimport argparse\nimport utils\nfrom PIL import Image\nimport numpy as np\nimport scipy.misc\n\n\nparser = argparse.ArgumentParser(description=\"PyTorch DeepDehazing\")\nparser.add_argument(\"--data\", type=str, default=\"output\", help=\"path to load data images\")\nparser.add_argument(\"--g...
[ [ "numpy.square", "numpy.log10", "numpy.mean" ] ]
czbiohub/dotblotr
[ "42418e168e436b935be41638072ebc55a9c2cfbe" ]
[ "dotblotr/viz/qc.py" ]
[ "from os import path\nfrom typing import Tuple\n\nimport cv2\nimport matplotlib\nfrom matplotlib import pyplot as plt\nimport pandas as pd\nfrom skimage import io\n\n\ndef plot_detected_dots(\n results_table:pd.DataFrame,\n strip_id:str,\n image_directory:str,\n image_extension:str = '.t...
[ [ "matplotlib.pyplot.subplots" ] ]
ansj11/NormalizeConvBNReLU
[ "f773f2ef65cc3c23786376897ae83347fffa0572" ]
[ "main.py" ]
[ "'''Train CIFAR10 with PyTorch.'''\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.backends.cudnn as cudnn\n\nimport torchvision\nimport torchvision.transforms as transforms\n\nimport os\nimport argparse\n\nfrom models import *\nfrom utils import prog...
[ [ "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.no_grad", "torch.save", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load", "torch.nn.CrossEntropyLoss", "torch.nn.DataParallel" ] ]
mseitzer/DLTK
[ "3237aa6c7ed63aa177ca90eafcc076d144155a34" ]
[ "dltk/core/modules/activations.py" ]
[ "from __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\nimport tensorflow as tf\n\nfrom dltk.core.modules.base import AbstractModule\n\n\ndef leaky_relu(x, leakiness):\n \"\"\" Leaky RELU\n\n Parameters\n ----------\n x : tf.Tensor\n inpu...
[ [ "tensorflow.maximum", "tensorflow.constant_initializer" ] ]
D-Bits/Exchange-Rates-Pipeline
[ "308b1fbb6eca5ec390ec8934f036026bb90dc1e4" ]
[ "dags/update_rates.py" ]
[ "from airflow import DAG \nfrom airflow.operators.python_operator import PythonOperator\nfrom airflow.operators.postgres_operator import PostgresOperator\nfrom datetime import datetime, date\nfrom requests import get\nfrom os import getenv\nimport pandas as pd\n\n\ndefault_args = {\n \"owner\": \"airflow\",\n ...
[ [ "pandas.DataFrame" ] ]
Louis1124/keras
[ "4584ed2a120c18cca53ea7cf2a3764dd18421821" ]
[ "keras/feature_column/dense_features_v2.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.v2.name_scope", "tensorflow.python.util.tf_export.keras_export" ] ]
safdark/advanced-lane-lines
[ "27edcc444ac532e84749d667fc579970d2059aff" ]
[ "src/operations/thresholder.py" ]
[ "'''\nCreated on Dec 23, 2016\n\n@author: safdar\n'''\nfrom operations.baseoperation import Operation\nimport numpy as np \nimport cv2\nfrom utils.utilities import drawlines, extractlanes\nfrom utils.plotter import Image\nfrom utils.plotter import Graph\n\n\n# Supported operations\n# - Color -> InRange -> 0/1\n#...
[ [ "numpy.max", "numpy.zeros_like", "numpy.uint8", "numpy.bitwise_or.reduce", "numpy.bitwise_and.reduce", "numpy.arctan2", "numpy.sqrt", "numpy.absolute" ] ]
martius-lab/cid-in-rl
[ "005074a82e5cb26dff2a44bab3546af24cc57c2c" ]
[ "cid/influence_estimation/datasets.py" ]
[ "from collections import OrderedDict\nfrom typing import Callable, Dict, Sequence, Set\n\nimport gin\nimport numpy as np\nimport torch\nimport torch.utils.data.dataloader\n\n\n@gin.configurable(blacklist=['memory'])\nclass ForwardGoalDataset(torch.utils.data.Dataset):\n \"\"\"Dataset using achieved goals of tran...
[ [ "numpy.concatenate", "numpy.array", "numpy.linalg.norm", "numpy.random.RandomState", "numpy.sum", "numpy.ones", "numpy.roll" ] ]
ivanwilliammd/I3DR-Net
[ "356d9a3d821d22c375b0bcc42ae488fe6e520e21" ]
[ "utils/model_utils.py" ]
[ "#!/usr/bin/env python\n# Official implementation code for \"Lung Nodule Detection and Classification from Thorax CT-Scan Using RetinaNet with Transfer Learning\" and \"Lung Nodule Texture Detection and Classification Using 3D CNN.\"\n# Adapted from of [medicaldetectiontoolkit](https://github.com/pfjaeger/medicalde...
[ [ "torch.cat", "torch.stack", "numpy.random.choice", "numpy.minimum", "torch.nn.LeakyReLU", "torch.nn.init.kaiming_normal_", "torch.nn.BatchNorm2d", "numpy.where", "torch.exp", "torch.nn.BatchNorm3d", "numpy.concatenate", "numpy.full", "numpy.log", "torch.Floa...
harir91/alpaca-trade-api-python
[ "5bbcee7eaa85a91ffc3484fc08ec2fb4a03e1ce5" ]
[ "alpaca_trade_api/entity_v2.py" ]
[ "from enum import Enum\nimport pandas as pd\nfrom .entity import Bar, Entity, Trade, Quote, _NanoTimestamped\nfrom typing import Dict\n\ntrade_mapping_v2 = {\n \"i\": \"id\",\n \"S\": \"symbol\",\n \"c\": \"conditions\",\n \"x\": \"exchange\",\n \"p\": \"price\",\n \"s\": \"size\",\n \"t\": \"t...
[ [ "pandas.DataFrame", "pandas.DatetimeIndex" ] ]
bonchinchi/PinSout
[ "e1f8882e20dcb714faaa4ba350569a6c7315a3aa" ]
[ "src/sem_seg/model/log_6cls_test16/train.py" ]
[ "import argparse\nimport math\nimport h5py\nimport numpy as np\nimport tensorflow as tf\nimport socket\n\nimport os\nimport sys\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nROOT_DIR = os.path.dirname(BASE_DIR)\nsys.path.append(BASE_DIR)\nsys.path.append(ROOT_DIR)\nsys.path.append(os.path.join(ROOT_DIR, '...
[ [ "tensorflow.global_variables_initializer", "tensorflow.cast", "numpy.concatenate", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.argmax", "tensorflow.Variable", "numpy.argmax", "numpy.array", "tensorflow.minimum", "tensorflo...
allenwang28/lingvo
[ "26d3d6672d3f46d8f281c2aa9f57166ef6296738" ]
[ "lingvo/core/attention_util_test.py" ]
[ "# Lint as: python3\n# Copyright 2020 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...
[ [ "numpy.dot", "numpy.random.rand", "numpy.ones_like", "numpy.argmin", "numpy.tile", "numpy.exp", "numpy.random.random", "numpy.concatenate", "numpy.random.binomial", "numpy.arange", "numpy.sqrt", "numpy.expand_dims", "numpy.array", "numpy.zeros", "numpy.e...
hoangle96/CS539_project
[ "20f704398a8bdb3ab709cef45ed861898fd4d1dd" ]
[ "tri/undreamt/undreamt/encoder.py" ]
[ "# Copyright (C) 2018 Mikel Artetxe <artetxem@gmail.com>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\...
[ [ "torch.zeros", "torch.cat", "torch.stack", "torch.nn.GRU", "torch.nn.utils.rnn.pad_packed_sequence", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.Embedding" ] ]
dheeraj7596/SCDV
[ "329b13a413318262f1888d872d8e33b30217cbc7" ]
[ "Reuters/FastText.py" ]
[ "#!/usr/bin/env python\nimport pandas as pd\nimport nltk.data\nimport logging\nfrom gensim.models import FastText\nfrom KaggleWord2VecUtility import KaggleWord2VecUtility\nimport time\nimport sys\nimport csv\n\nif __name__ == '__main__':\n\n start = time.time()\n # The csv file might contain very huge fields,...
[ [ "pandas.read_pickle" ] ]
nishitanand/mixtext
[ "82e13b297ba913cc8ab80da312edbe56e466a691" ]
[ "code/mixtext.py" ]
[ "import torch\nimport torch.nn as nn\nfrom pytorch_transformers import *\nfrom transformers.modeling_bert import BertEmbeddings, BertPooler, BertLayer\nimport geoopt\n\nclass BertModel4Mix(BertPreTrainedModel):\n def __init__(self, config):\n super(BertModel4Mix, self).__init__(config)\n self.embed...
[ [ "torch.nn.Linear", "torch.nn.Tanh", "torch.ones_like", "torch.zeros_like", "torch.mean" ] ]
MrPec/project-teachable
[ "c000067c2033efc0725a606ed6a0c479a5f96a45" ]
[ "embedding.py" ]
[ "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.concatenate", "numpy.pad", "numpy.matmul", "numpy.asarray", "numpy.stack", "numpy.argpartition" ] ]
MihailoIsakov/fishfish
[ "ddce2a4f0834d70a9673ff3b50e802e72c5b928c" ]
[ "lasagne/init.py" ]
[ "\"\"\"\nFunctions to create initializers for parameter variables.\n\nExamples\n--------\n>>> from lasagne.layers import DenseLayer\n>>> from lasagne.init import Constant, Glorot\n>>> l1 = DenseLayer((100,20), num_units=50, W=GlorotUniform(), b=Constant(0.0))\n\"\"\"\n\nimport numpy as np\n\nfrom .utils import floa...
[ [ "numpy.random.normal", "numpy.zeros", "numpy.ones", "numpy.random.shuffle", "numpy.prod", "numpy.random.uniform", "numpy.arange", "numpy.sqrt", "numpy.linalg.svd" ] ]
fengjiaxin/Home_Credit_Default_Risk
[ "3407e76b4e5cfb8dd6056d24675b80fe0e82c123" ]
[ "20180520/StackingBaseline/StackingBaseline.py" ]
[ "# coding:utf-8\n\nimport os\nimport numpy as np\nimport pandas as pd\nfrom xgboost import XGBClassifier\nfrom category_encoders import LeaveOneOutEncoder\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.ensemble import ExtraTreesClassifier\nfrom sklearn.ensemble import RandomForestClassifier\nfro...
[ [ "numpy.random.seed", "sklearn.ensemble.RandomForestClassifier", "sklearn.linear_model.LogisticRegression", "sklearn.ensemble.ExtraTreesClassifier", "sklearn.ensemble.GradientBoostingClassifier" ] ]
011000101101/VRAR_project
[ "7b0be02517de3e3975c9a697e4d6353c3fd6225f" ]
[ "classifier_subsystem/save_samples_as_tfrecords.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport os\nimport pickle\nfrom sklearn.model_selection import train_test_split\n\nfrom utils.params import *\nimport utils.classify_util as classify_utils\n\n# load training data\nwith open(\"../bin_blobs/kanji_image_samples_augmentes.pkl\", 'rb') as f:\n image_sampl...
[ [ "sklearn.model_selection.train_test_split" ] ]
yongfang117/data_process
[ "c77af1b336ec8b7f61b538ea43dd03ee005a5227" ]
[ "DataProcess/DataVisible/temper.py" ]
[ "# coding:utf8\n\n\"\"\"\nDescription:matplotlib绘制复杂图\nAuthor:伏草惟存\nPrompt: code in Python3 env\n\"\"\"\n\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport csv\nfrom datetime import datetime\n#加入中文显示\nimport matplotlib.font_manager as fm\n# 解决中文乱码,本案例使用宋体字\nmyfont=fm.FontProperties(fname=r\"C:\\\\Windows...
[ [ "matplotlib.font_manager.FontProperties", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
partev/statsmodels
[ "00096d3b668926ed5c2059e24a9cc3157daaa562" ]
[ "statsmodels/distributions/copula/tests/test_copula.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jan 14 23:32:57 2021\n\nAuthor: Josef Perktold\nLicense: BSD-3\n\n\"\"\"\nfrom statsmodels.compat.scipy import SP_LT_15\n\nimport numpy as np\nfrom numpy.testing import assert_allclose, assert_array_almost_equal\nimport pytest\nfrom scipy import stats\n\nfrom statsmo...
[ [ "numpy.testing.assert_allclose", "numpy.array", "scipy.stats.kendalltau", "numpy.log", "numpy.random.RandomState", "numpy.percentile", "numpy.ones", "numpy.random.default_rng", "numpy.mean", "numpy.testing.assert_array_almost_equal", "scipy.stats.genextreme", "numpy...
piyushghai/deep-learning-models
[ "eebc5007a9f60540a98ed8ea5f9fbd5786b21db9" ]
[ "models/vision/detection/awsdet/datasets/utils.py" ]
[ "# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# SPDX-License-Identifier: Apache-2.0\n# -*- coding: utf-8 -*-\nimport cv2\nimport numpy as np\n\n###########################################\n#\n# Utility Functions for \n# Image Preprocessing and Data Augmentation\n#\n####################...
[ [ "numpy.ceil", "numpy.zeros", "numpy.fliplr" ] ]
DavidMcDonald1993/mim
[ "b55ea1c23ffd1aaf3c395480cbc6673dc6b4cf6a" ]
[ "scrapers/endole/endole_selenium_scraper.py" ]
[ "\nimport sys\nimport os.path\nsys.path.insert(1, \n os.path.abspath(\n os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir))) \n\nfrom urllib.parse import quote\n\n# import web driver\nfrom selenium import webdriver\nfrom selenium.webdriver.common.keys import Keys\nfrom selenium.common...
[ [ "pandas.isnull", "pandas.DataFrame" ] ]
dmitryvinn/vissl-1
[ "1d8befefbbeabf9fec6a34b4581080d4221fde9d" ]
[ "projects/fairness_indicators/harmful_label_associations/inference_label_assoc_openimages_miap_test.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport torchvision.transforms as T\nfrom fvcore.common.file...
[ [ "numpy.array", "pandas.DataFrame", "numpy.ones", "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
zhengwsh/text-classification
[ "df91cb0aebc76f12006d9d380a4a3c049446e83c" ]
[ "text_rnn.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\n\nclass TextRNN(object):\n \"\"\"\n A RNN for text classification/regression.\n Uses an embedding layer, followed by a recurrent, fully-connected (and softmax) layer.\n \"\"\"\n def __init__(\n self, model_type, sequence_length, num_classes, vocab_...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.expand_dims", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.argmax", "tensorflow.random_uniform", "tensorflow.nn.l2_loss", "tensorflow.constant", "tensorflow.nn.xw_plus_b", "tensorflow.reduce_max", ...
iamsg08/Joing-Parsing-and-Generation-for-Abstractive-Summarization
[ "a432e6e78ac1b3016c2a5f8788a613772b11da40" ]
[ "layers/searcher/AStar.py" ]
[ "#==============================#\n# System Import #\n#==============================#\nimport copy, heapq\n\n#==============================#\n# Platform Import #\n#==============================#\nimport numpy as np\nimport torch\nfrom torch.autograd import Variable\n\n#===============...
[ [ "torch.cuda.is_available", "torch.LongTensor", "numpy.asarray", "numpy.log" ] ]
IMBINGO95/FairMOT
[ "c496e911a89870a9b6988d93f80e680d01ee8afc" ]
[ "CalibrateTransfer/class_set.py" ]
[ "import numpy as np\nclass CalibrateParameter():\n \"\"\"相机的标定参数\"\"\"\n def __init__(self,rotation_vector = None, translation_vector = None, cameraMatrix = None, distCoeffs = None, read_from_file = False):\n ''' If read_from_file == True, then creat a empty class!'''\n if read_from_file :\n ...
[ [ "numpy.zeros" ] ]
karthikmudaliar/SentimentalAnalytics
[ "4b829030733c8852b67614730a22bdd66b7208ff" ]
[ "emojiAnalyzer.py" ]
[ "'''\nCreated on 04-Feb-2019\n\n@author: Teerta shetty\n'''\n\nimport csv\nimport spacy\nimport tweepy\nimport re\nimport pandas as pd\nimport pymysql\n\n\nfrom time import sleep\nfrom vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer\nimport vaderSentiment.vaderSentiment as vs\nimport emoji\n\nconnec...
[ [ "pandas.DataFrame" ] ]
rsenthilkumar6/ludwig
[ "8545f51470c2e2b8ef0dfb5ae5d313793728fae0" ]
[ "tests/integration_tests/utils.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) 2019 Uber Technologies, 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# Unl...
[ [ "numpy.allclose", "pandas.DataFrame", "pandas.read_csv" ] ]
taesiri/ANCNet
[ "28b1c887c2016b06c9639f93e79752dcb6ec3a23" ]
[ "eval_pf_pascal.py" ]
[ "from __future__ import print_function, division\nimport os\nfrom os.path import exists\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import Dataset, DataLoader\nfrom collections import OrderedDict\n\nfrom lib.model import ImMatchNet\nfrom lib.pf_dataset import PFPascalDataset\nfro...
[ [ "numpy.isnan", "numpy.mean", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.load" ] ]
shangqigao/BayeSR
[ "62ca44e15e7cb04b18ac30807abc6b188c361d5c" ]
[ "src/bayesr_kernels.py" ]
[ "'''\nCreated on Apr 30, 2020\n\n@author: Shangqi Gao\n'''\nimport sys\nsys.path.append('../')\nimport os \nimport time\nimport argparse\nimport cv2\nimport numpy as np\nimport tensorflow as tf\nfrom tqdm import tqdm\nfrom skimage import io, color\nfrom PIL import Image\nfrom scipy.io import loadmat, savemat\n\nfro...
[ [ "numpy.random.normal", "tensorflow.train.Saver", "tensorflow.gfile.MakeDirs", "numpy.swapaxes", "tensorflow.gfile.DeleteRecursively", "numpy.arange", "numpy.sqrt", "numpy.around", "tensorflow.app.run", "tensorflow.get_collection", "numpy.expand_dims", "tensorflow.gf...
az123zx123/large_scale_neurons_simulation
[ "a01ec24ec0adb1d17cf15172b22e5df5a5f192ac" ]
[ "function/plot_raster.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Apr 17 14:30:00 2020\r\nModified on Sat May 9th 2020\r\n\r\n@author: li xiang, Song Mo\r\n\"\"\"\r\n\r\nimport csv\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\ndef plot_raster(file_name,store_location):\r\n y = []\r\n with open(file_name,...
[ [ "matplotlib.pyplot.savefig", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
meliketoy/cellnet.pytorch
[ "f1cf32d0158783d701a31f1a35c3dfbc1ab8e0e3" ]
[ "3_classifier/BCCD_inference.py" ]
[ "# ************************************************************\n# Author : Bumsoo Kim, 2018\n# Github : https://github.com/meliketoy/cellnet.pytorch\n#\n# Korea University, Data-Mining Lab\n# Deep Convolutional Network Fine tuning Implementation\n#\n# Description : BCCD_inference.py\n# The main code for BCCD infer...
[ [ "torch.autograd.Variable", "torch.no_grad", "numpy.exp", "torch.cuda.is_available", "torch.load", "torch.randn" ] ]
zlijingtao/DAC20_reconstruction
[ "c928cda1c8e492c05110d6c219c1ed529924e127" ]
[ "models/vgg_cifar10_binary.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn import init\nimport math\nimport torchvision.transforms as transforms\nfrom torch.autograd import Function\nfrom .binarized_modules import get_centroid, get_quantized,DtoA_3bit,AtoD_3bit\n\nclass Binarize(torch.autograd.Function):...
[ [ "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal", "torch.nn.functional.linear", "torch.nn.BatchNorm1d", "torch.nn.functional.conv2d" ] ]
fyancy/SSMN
[ "9a807d7e926fc6ff347cfd19ffbb6462b6a49dea" ]
[ "Comparison/venv/Include/DaNN_main.py" ]
[ "import torch\nimport random\nimport numpy as np\nimport torch.nn as nn\nimport mmd\nimport visdom\nimport os\nimport matplotlib.pyplot as plt\nfrom models.DaNN_model import DaNN\nfrom proto_data_utils.Data_generator_normalize import data_generate\nfrom proto_data_utils.train_utils import weights_init, weights_init...
[ [ "torch.zeros", "torch.cat", "torch.eq", "torch.max", "numpy.sum", "torch.no_grad", "torch.optim.lr_scheduler.ExponentialLR", "torch.randperm", "numpy.mean", "torch.nn.functional.log_softmax", "torch.cuda.device_count", "torch.from_numpy", "torch.mean", "torc...
facexteam/pytorch-cifar
[ "48abfba662dc41b6f35b70f54f543af658f56be8" ]
[ "tools/fix_fc_cosine_and_angles.py" ]
[ "#!/usr/bin/env python\n# maintainer: zhaoyafei (https://github.com/walkoncross, zhaoyafei0210@gmail.com)\n\nfrom __future__ import print_function\n\nimport os\nimport os.path as osp\nimport numpy as np\nimport torch\n\nimport shutil\n\n\ndef fix_train_fc_log(fname, rename=False, verbose=False):\n fn, ext = osp....
[ [ "numpy.mat", "torch.eye", "torch.from_numpy" ] ]
umanlp/DS-TOD
[ "d0821a05a2a9fd1639a5453b5d4d896d607c53df" ]
[ "downstream/models/BERT_DST_Picklist.py" ]
[ "import os.path\nimport math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom torch.nn import CrossEntropyLoss\nfrom torch.nn import CosineEmbeddingLoss\nimport numpy as np\n\nfrom transformers import *\n\ndef _gelu(x):\n \"\"\" Original Implementation of the gelu activation function...
[ [ "torch.nn.Linear", "torch.nn.Embedding", "numpy.array", "torch.nn.Embedding.from_pretrained", "torch.cat", "torch.max", "torch.tensor", "torch.nn.CrossEntropyLoss" ] ]
gkucsko/NeMo
[ "c1ae0a7744d9a0ac206f61b2883ce00c9b8339b9", "c1ae0a7744d9a0ac206f61b2883ce00c9b8339b9" ]
[ "nemo/collections/asr/models/clustering_diarizer.py", "nemo/collections/asr/parts/preprocessing/segment.py" ]
[ "# Copyright (c) 2020, 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...
[ [ "torch.empty", "torch.cuda.is_available", "torch.cuda.amp.autocast", "torch.softmax" ], [ "numpy.pad", "numpy.mean", "numpy.any", "numpy.log10", "numpy.iinfo" ] ]
ethanhezhao/NBVAE
[ "d546f56e0b3ed39ea3d1421ae929e5f3cbe3c3dd" ]
[ "nb_vae.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom scipy import special\n\n\nclass NegativeBinomialVAE():\n\n def __init__(self, arch, lr=1e-3, random_seed=None):\n\n self.decoder_arch = arch\n\n self.encoder_arch = arch[::-1]\n\n self.lr = lr\n self.random_seed = random_seed\n\n ...
[ [ "tensorflow.exp", "tensorflow.shape", "tensorflow.train.AdamOptimizer", "tensorflow.truncated_normal_initializer", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.matmul", "tensorflow.train.Saver", "scipy.special.expit", "numpy.exp", "tensorflow.placeholder", ...
pgraafstra/pastas
[ "c065059e1df5b6c8e4afeb5278de2ef70fdf726c" ]
[ "pastas/read/waterbase.py" ]
[ "\"\"\"\nThis file contains the import routine for import of groundwater observations\nfrom RWS Waterbase / WaterInfo database. (http://waterinfo.rws.nl/)\n\nAuthor: R.A. Collenteur, Artesia Water 2017\n\n\"\"\"\n\nfrom pandas import read_csv\n\nfrom ..timeseries import TimeSeries\n\n\ndef read_waterbase(fname, loc...
[ [ "pandas.read_csv" ] ]
adityaiitb/pyprof2
[ "b2ac33876a2ab5bbd41595f0692a0fc936e7d8b7" ]
[ "pyprof2/prof/blas.py" ]
[ "from collections import OrderedDict\nfrom utility import Utility\nfrom base import OperatorLayerBase\nimport numpy as np\n\nTC_GEMMS = [\"884gemm\", \"1688gemm\"]\n\nclass Addmm(OperatorLayerBase):\n\n\tdef __init__(self, d):\n\t\tmarker = eval(d.argMarker[0])\n\t\tmod = marker['mod']\n\t\top = marker['op']\n\t\ta...
[ [ "numpy.empty", "numpy.broadcast" ] ]
pvk-developer/ATM
[ "959751fb9246963c56bf77bc92d00fcadd062d6a" ]
[ "atm/metrics.py" ]
[ "from __future__ import absolute_import, division, unicode_literals\n\nfrom builtins import range\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.metrics import (\n accuracy_score, average_precision_score, cohen_kappa_score, f1_score, matthews_corrcoef,\n precision_recall_curve, roc_auc_score, roc_cu...
[ [ "numpy.isnan", "sklearn.model_selection.StratifiedKFold", "sklearn.metrics.precision_recall_curve", "pandas.DataFrame", "sklearn.metrics.matthews_corrcoef", "sklearn.metrics.accuracy_score", "sklearn.metrics.average_precision_score", "numpy.argsort", "numpy.column_stack", "...
qscgy/TransMorph_Transformer_for_Medical_Image_Registration
[ "9abfc4387e51667e1c8860d4ce37658325e75b5a", "9abfc4387e51667e1c8860d4ce37658325e75b5a" ]
[ "IXI/Baseline_Transformers/models/PVT.py", "IXI/Baseline_Transformers/train_CoTr.py" ]
[ "'''\r\nPyramid vision transformer for Image Registration\r\n\r\nPaper:\r\nChen, J., Du, Y., He, Y., Segars, P. W., Li, Y., & Frey, E. C. (2021).\r\nTransMorph: Transformer for Unsupervised Medical Image Registration. arXiv preprint arXiv:2111.10480.\r\n\r\nOriginal PVT code was retrieved from:\r\nhttps://github.co...
[ [ "torch.nn.Linear", "torch.cat", "torch.stack", "torch.nn.LeakyReLU", "torch.nn.AvgPool3d", "torch.meshgrid", "torch.nn.BatchNorm3d", "torch.nn.LayerNorm", "torch.nn.init.constant_", "torch.distributions.normal.Normal", "torch.unsqueeze", "torch.nn.Conv3d", "torc...
TharinduDR/MultiTransQuest
[ "90c24ec99d7418b77b46fc32a2ae9369d72347ad" ]
[ "examples/common/draw.py" ]
[ "import matplotlib.pyplot as plt\nimport pandas as pd\nfrom sklearn.metrics import mean_absolute_error\n\nfrom examples.common.normalizer import fit\nfrom multitransquest.evaluation import pearson_corr, spearman_corr, rmse\n\n\ndef draw_scatterplot(data_frame, real_column, prediction_column, path, topic):\n data...
[ [ "pandas.Series", "matplotlib.pyplot.figure" ] ]
Abdullahzz/cv
[ "5b6378063787232785416369d761e23535389b2a" ]
[ "gokPrj/gokWebApi.py" ]
[ "import os\nfrom werkzeug.utils import secure_filename\nfrom flask import Flask, flash, request, redirect, url_for\nfrom PIL import Image\nimport io\nimport base64\nimport mimetypes\nfrom flask import Flask, request, make_response, jsonify, render_template, redirect, url_for\nimport numpy as np\nimport cv2 as cv\n\...
[ [ "numpy.frombuffer" ] ]
stevenliu216/rob535-perception-project
[ "6b247a3a0eff41ee83b14496632263fa0b176011" ]
[ "utils/utils.py" ]
[ "#! /usr/bin/python3\nfrom glob import glob\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef rot(n):\n n = np.asarray(n).flatten()\n assert(n.size == 3)\n\n theta = np.linalg.norm(n)\n if theta:\n n /= theta\n K = np.array([[0, -n[2], n...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.sin", "numpy.asarray", "matplotlib.pyplot.subplots", "numpy.identity", "numpy.cos", "numpy.clip" ] ]
yt7589/codis
[ "0b480b1d93235593503d34fe7c76b6188479f328" ]
[ "ann/roi_heads.py" ]
[ "import torch\r\n\r\nimport torch.nn.functional as F\r\nfrom torch import nn\r\n\r\nfrom torchvision.ops import boxes as box_ops\r\nfrom torchvision.ops import misc as misc_nn_ops\r\nfrom torchvision.ops import roi_align\r\n\r\nimport ann.pt_utils as det_utils\r\n\r\n\r\ndef fastrcnn_loss(class_logits, box_regressi...
[ [ "torch.zeros", "torch.nonzero", "torch.cat", "torch.nn.functional.smooth_l1_loss", "torch.stack", "torch.arange", "torch.nn.functional.interpolate", "torch.nn.functional.cross_entropy", "torch.nn.functional.softmax", "torch.zeros_like", "torch.nn.functional.pad" ] ]
KIT-IAI/SmartDataRepresentations
[ "2d88381a88b4acfa84df231b05ec66fc5a927179" ]
[ "src/pywatts/model_handler_module.py" ]
[ "import os\nfrom enum import Enum\nfrom datetime import datetime\nfrom typing import Dict\n\nimport numpy as np\nimport pandas as pd\n\nimport torch\nfrom torch.utils.data import DataLoader, Dataset\n\nfrom pytorch_lightning import Trainer\nfrom pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint\nfro...
[ [ "pandas.to_datetime", "torch.no_grad", "torch.utils.data.DataLoader", "numpy.datetime64" ] ]
ktanidis2/Modified_CosmoSIS_for_galaxy_number_count_angular_power_spectra
[ "07e5d308c6a8641a369a3e0b8d13c4104988cd2b" ]
[ "cosmosis-standard-library/likelihood/planck2015/plc-2.0/src/python/clik/cldf.py" ]
[ "from builtins import range\nfrom builtins import object\nimport os\nimport os.path as osp\nimport shutil as shu\ntry:\n import pyfits as pf\nexcept Exception as e:\n pass\n\nimport re\nimport numpy as nm\n\n\ndef pack256(*li):\n rr = \"\"\n for l in li:\n rr += l + '\\0' * (256 - len(l))\n re...
[ [ "numpy.array" ] ]
PierreExeter/custom_gym_envs
[ "2b6a1c16a4198c8d9fa64f10fe09a041826ac81a" ]
[ "gym_envs/3_particle_goal_oriented/continuous_goal_oriented_particle.py" ]
[ "import os\nimport copy\nimport numpy as np\n\nimport gym\nfrom gym import error, spaces\nfrom gym.utils import seeding\nfrom collections import OrderedDict\n\n\ndef goal_distance(goal_a, goal_b):\n assert goal_a.shape == goal_b.shape\n return np.linalg.norm(goal_a - goal_b, axis=-1)\n\n\nclass ParticleEnv(gy...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.ceil", "numpy.multiply", "numpy.clip" ] ]
emedvedev/aocr
[ "2ef51cba4770b86fccd34bae4e77d8f3eda3e797" ]
[ "aocr/util/bucketdata.py" ]
[ "from __future__ import absolute_import\n\nimport numpy as np\n\n\nclass BucketData(object):\n def __init__(self):\n self.data_list = []\n self.label_list = []\n self.label_list_plain = []\n self.comment_list = []\n\n def append(self, datum, label, label_plain, comment):\n s...
[ [ "numpy.array", "numpy.ones", "numpy.zeros" ] ]
OddballSports-tv/obies-scoreboard
[ "1df2a6346f41eafc937f218728cb39ecc44f4a5c" ]
[ "views/bocce/bocceui.py" ]
[ "# imports\nimport sys\nimport os\n\n# add the parent directory (absolute, not relative) to the sys.path\n# (this makes the games package imports work)\nsys.path.append(os.path.abspath(os.pardir))\n\n# PyQt imports\nfrom PyQt5 import QtCore, QtWidgets\nfrom PyQt5 import uic, QtGui, QtTest\nfrom PyQt5.QtGui import Q...
[ [ "numpy.zeros" ] ]
abkfenris/safewaters
[ "214d23b2a1d94b1ca2ad0ff3c482d34693b92065" ]
[ "safewaters.py" ]
[ "#!/usr/bin/env python\nimport requests\nimport pandas as pd\n\nrows = []\n\nfor i in range(26):\n response = requests.get(f\"https://brookfieldwaterpublishingapi.azurewebsites.net/riversystems/{i}/facilities?withEverything=false\")\n data = response.json()\n for facility in data:\n if facility['Wat...
[ [ "pandas.DataFrame" ] ]
marketler/GFW_vessel_scoring
[ "16a141e78258dcc9bab458d5ebd8fad6d2721816" ]
[ "scripts/predict.py" ]
[ "import vessel_scoring.models\nimport vessel_scoring.utils\nimport gpsdio\nimport numpy\nimport sys\n\nmodels = vessel_scoring.models.load_models()\n\nmodel = sys.argv[1]\ninput = sys.argv[2]\noutput = sys.argv[3]\n\nif input.endswith(\".msg\"):\n with gpsdio.open(output, \"w\") as fout:\n with gpsdio.ope...
[ [ "numpy.savez", "numpy.load" ] ]
Bhaskarkvvsr/cortex
[ "f569791613ea8b8cff226c3585839d37b9b6a5b5" ]
[ "examples/pytorch/sentiment-analyzer/predictor.py" ]
[ "# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.20.*, run `git checkout -b 0.20` or switch to the `0.20` branch on GitHub)\n\nimport torch\nfrom transformers import pipeline\n\n\nclass PythonPredictor:\n def __init__(self...
[ [ "torch.cuda.is_available" ] ]
pythonProjectLearn/TensorflowLearning
[ "7a72ebea060ce0a0db9a00994e4725ec5d84c10a" ]
[ "ch19_FFM/FFM.py" ]
[ "# encoding:utf-8\n\"\"\"\ntf.truncated_normal(shape, mean, stddev) :shape表示生成张量的维度,mean是均值,stddev是标准差。\n这个函数产生正太分布,均值和标准差自己设定。这是一个截断的产生正太分布的函数,就是说产生正太分布的值如果与均值的差值大于两倍的标准差,那就重新生成。\n和一般的正太分布的产生随机数据比起来,这个函数产生的随机数与均值的差距不会超过两倍的标准差,但是一般的别的函数是可能的。\n\ntf.convert_to_tensor()\n将python的数据类型转换成TensorFlow可用的tensor数据类型\n\n# 矩阵逻...
[ [ "tensorflow.exp", "tensorflow.multiply", "numpy.random.choice", "tensorflow.get_default_graph", "tensorflow.gather_nd", "tensorflow.Session", "tensorflow.Variable", "tensorflow.train.Saver", "tensorflow.truncated_normal", "tensorflow.constant", "numpy.random.randint", ...
Singlesnail/vedo
[ "b2e2cfc3453bbd118b6c81a2227b8ce6f1d22b7b" ]
[ "examples/pyplot/np_matrix.py" ]
[ "\"\"\"Visualize a n\\dotm numpy matrix\"\"\"\nfrom vedo.pyplot import matrix, show\nimport numpy as np\n\nn, m = (6, 5)\nM = np.eye(n, m)/2 + np.random.randn(n, m)*0.1\nprint(M)\n\nmat = matrix(M,\n cmap='Reds',\n title='My numpy Matrix',\n xtitle='Genes of group A',\n ...
[ [ "numpy.random.randn", "numpy.eye" ] ]
eternalding/tf-CMT
[ "67ae5bcc60d985a11d55e06247ac8ed3d62643d5" ]
[ "tf_CMT/model.py" ]
[ "import tensorflow as tf\n\nfrom tf_CMT.Basic_blocks import CNN_Block, LocalPerceptionUnitLayer, InvertedResidualFFNLayer\nfrom tf_CMT.LWMHSA import LightWeightMHSALayer\n\nclass CMT_Model(tf.keras.Model):\n def __init__(self, Block_num = [3,3,16,3], K=5, n_heads = 8, head_dim = 128, filters = 256, num_classes=1...
[ [ "tensorflow.keras.layers.LayerNormalization", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.GlobalAveragePooling2D", "tensorflow.keras.layers.Softmax" ] ]
AmeyaWagh/3D_object_recognition
[ "bf65d27d1bbf40a6e522dd6a4d1ee9a6cee44dec" ]
[ "scripts/trainer.py" ]
[ "#! /usr/bin/env python\nimport rospkg\nimport numpy as np\nimport os\nimport pcl\nimport cv2\nfrom robot_vision_helper.DataHandler import DataHandler\nfrom robot_vision_helper.GASD import GASD\nfrom robot_vision_helper.CNNModel import *\nimport time \nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d imp...
[ [ "matplotlib.pyplot.show", "numpy.array", "numpy.random.randint", "matplotlib.pyplot.figure" ] ]
csa0001/Refinery
[ "0d5de8fc3d680a2c79bd0e9384b506229787c74f" ]
[ "refinery/bnpy/bnpy-dev/tests/merge/AbstractBaseTestForHDP.py" ]
[ "\nimport numpy as np\nimport unittest\n\nimport bnpy\nfrom bnpy.learnalg import MergeMove\nfrom scipy.special import digamma\nimport copy\n\n######################################################### Make Data\n#########################################################\ndef MakeData(K=4, D=2500, nWordsPerDoc=50):\n ...
[ [ "numpy.dot", "numpy.zeros", "numpy.random.RandomState", "numpy.sum", "numpy.ones", "numpy.hstack", "scipy.special.digamma" ] ]
RobbiNespu/hyperboria
[ "74776166158d07b199677f9738862e5f1fa54367" ]
[ "nexus/meta_api/rescorers/classic_rescorer.py" ]
[ "import asyncio\nimport base64\nimport datetime\nimport io\nimport time\n\nimport lightgbm as lgbm\nimport numpy as np\nfrom nexus.nlptools.language_detect import detect_language\n\nfrom .base import Rescorer\n\n# ToDo: deduplicate code\n\n\ndef convert_scoring_to_vec_current_version(\n original_score,\n sche...
[ [ "numpy.array", "numpy.savez_compressed" ] ]
vsoch/caliper-analysis
[ "f7809779fb8e132acd2cfdc0984a24f4f914bd9d" ]
[ "tensorflow_v0.11/3_NeuralNetworks/autoencoder.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\" Auto Encoder Example.\nUsing an auto encoder on MNIST handwritten digits.\nReferences:\n Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. \"Gradient-based\n learning applied to document recognition.\" Proceedings of the IEEE,\n 86(11):2278-2324, November 1998.\nLinks:\n ...
[ [ "tensorflow.set_random_seed", "tensorflow.initialize_all_variables", "numpy.random.seed", "tensorflow.random.set_seed", "tensorflow.train.RMSPropOptimizer", "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "tensorflow.Session", "tensorflow.matmul", "tensorflow.p...
lod531/FixedEffectModel
[ "039a902b34310e652bbd3a21ba0ec663f175dd38" ]
[ "FixedEffectModelPyHDFE/OLSFixed.py" ]
[ "from FixedEffectModelPyHDFE.Forg import forg\nimport time\nimport pandas as pd\nfrom statsmodels.iolib.tableformatting import (gen_fmt, fmt_2)\nfrom statsmodels.iolib.table import SimpleTable\nfrom itertools import zip_longest\nfrom statsmodels.compat.python import lrange, lmap, lzip\nfrom scipy.stats import t\n\n...
[ [ "pandas.DataFrame", "scipy.stats.t.ppf", "pandas.ExcelWriter" ] ]
strawberrypie/gluon-ts
[ "1d27423478f1dc4621f81c4659d8ba78f88ee89b" ]
[ "src/gluonts/dataset/repository/_m4.py" ]
[ "# Copyright 2018 Amazon.com, Inc. or its affiliates. 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# A copy of the License is located at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# or ...
[ [ "numpy.hstack", "pandas.read_csv", "numpy.isnan" ] ]
timo/zasim
[ "54d8eb329af73700bf0df2be6e753e309e9d8191" ]
[ "zasim/config.py" ]
[ "\"\"\"This module implements different ways to create configurations.\n\nThe idea behind the API is, to let the user set any settings in the constructor\nof any Configuration instance and to let the Target instance pass a size\nhint and datatype when generating the config.\n\nThis way, the Target doesn't have to k...
[ [ "numpy.array", "numpy.ones", "numpy.random.rand", "numpy.zeros" ] ]
nitchith/CarND-Advanced-Lane-Lines
[ "8e9e4d369f95f2076aa3b99c9015ac95c20037fc" ]
[ "code/utils.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport cv2\n\ndef utils_plot(img, rows, cols, idx, title, cmap=None, fontsize=20):\n ax = plt.subplot(rows, cols, idx)\n ax.set_title(title, fontsize=fontsize)\n plt.imshow(img, cmap=cmap)\n return\n" ]
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.subplot" ] ]
cuongngm/MASTER-pytorch
[ "f21ba5adbf027f8d6bc35cf465a7b4dd045c61f1" ]
[ "utils/label_util.py" ]
[ "# -*- coding: utf-8 -*-\n# @Author: Wenwen Yu\n# @Created Time: 10/4/2020 14:24\n\nimport collections\nfrom pathlib import Path\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\n\n# from .keys import keys\n\nSTRING_MAX_LEN = 100\nVOCABULARY_FILE_NAME = 'keys.txt'\n\n\nclass LabelConverte...
[ [ "torch.zeros", "torch.LongTensor" ] ]
LeoChan0814/Python-Machine-Learning-Cookbook
[ "ced231713c8c82acc17d9bb9beb59a2db5db389c" ]
[ "Chapter01/preprocessing.py" ]
[ "import numpy as np\nfrom sklearn import preprocessing\n\ndata = np.array([[ 3, -1.5, 2, -5.4],\n [ 0, 4, -0.3, 2.1],\n [ 1, 3.3, -1.9, -4.3]])\n\n# mean removal\ndata_standardized = preprocessing.scale(data)\nprint('\\nMean =', data_standardized.mean(axis=0))\nprint('Std deviati...
[ [ "numpy.array", "sklearn.preprocessing.scale", "sklearn.preprocessing.normalize", "sklearn.preprocessing.MinMaxScaler", "sklearn.preprocessing.Binarizer", "sklearn.preprocessing.OneHotEncoder" ] ]
abbasidaniyal/Paddle
[ "c3527f5526ee96398760cbef11d7de48f41fe998" ]
[ "python/paddle/fluid/tests/unittests/test_unstack_op.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.random.random", "numpy.reshape", "numpy.split" ] ]
wkerzendorf/tardis
[ "c9e35423738f3bf6741aa5e89d4e1f3b45033708" ]
[ "tardis/montecarlo/setup_package.py" ]
[ "#setting the right include\nfrom setuptools import Extension\nimport numpy as np\nimport os\nfrom astropy_helpers.setup_helpers import get_distutils_option\n\nfrom glob import glob\n\nif get_distutils_option('with_openmp', ['build', 'install', 'develop']) is not None:\n compile_args = ['-fopenmp', '-W', '-Wall'...
[ [ "numpy.get_include" ] ]
mj-will/nessai
[ "e1ccc791a332565af372d14e5986920d552e1294" ]
[ "tests/test_nested_sampler/test_flow_proposal.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nTest the functions related to when the flow should be trained or reset and\ntraining itself.\n\"\"\"\nimport datetime\nimport numpy as np\nimport pytest\nfrom unittest.mock import call, MagicMock\nfrom nessai.nestedsampler import NestedSampler\n\n\ndef test_configure_flow_reset_fal...
[ [ "numpy.array", "numpy.arange" ] ]
anantgupt/GraphAssociation
[ "514ebe3b532eb211384915354ce89fdc276c0395" ]
[ "TSP19simpack/utils/Extract_Results/create_fig7b.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Feb 6 11:57:27 2019\nUse this code to edit figures saved using pickle dump\n@author: anantgupta\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport pickle as pl\nimport numpy as np\n\n# Load figure from disk and display\ndef cf7b(mode = 'Relax...
[ [ "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots" ] ]
LucaNicosia/suzieq
[ "c281807ea2c4f44a9d6cd6c80fd5b71277b3cdcd" ]
[ "suzieq/poller/worker/services/inventory.py" ]
[ "import re\nimport numpy as np\nfrom suzieq.poller.worker.services.service import Service\n\n\nclass InventoryService(Service):\n \"\"\"Inventory service\"\"\"\n\n def _clean_data_common(self, processed_data, _):\n return processed_data\n\n def _clean_eos_data(self, processed_data, _):\n new_...
[ [ "numpy.delete" ] ]
rartino/hands-on-2
[ "8f31b978f295a761dc0a7ae093184b3dbfa7e199" ]
[ "dscribe/dscribe/descriptors/mbtr.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Copyright 2019 DScribe developers\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ap...
[ [ "numpy.concatenate", "scipy.sparse.coo_matrix", "numpy.array", "numpy.full", "numpy.linalg.norm", "numpy.zeros", "numpy.arange", "scipy.sparse.lil_matrix", "numpy.linspace" ] ]
Kevin-Chen0/deep-reinforcement-learning
[ "9715e29e66208d5fb0689fd7799f3bf33e0f914c" ]
[ "p2_continuous-control/test_run.py" ]
[ "import gym\nimport random\nimport torch\nimport numpy as np\nfrom collections import deque\nimport matplotlib.pyplot as plt\nfrom pyvirtualdisplay import Display\nfrom unityagents import UnityEnvironment\n\n# initialize environment\nenv = UnityEnvironment(file_name=\"Reacher_Linux_NoVis/Reacher.x86_64\")\n# get th...
[ [ "matplotlib.pyplot.xlabel", "numpy.mean", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]