repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
whyecofiliter/EAP | [
"a0bc95410633dfa1afa260534f7b6e5845981e3f"
] | [
"fama_macbeth.py"
] | [
"'''\nFama-Macbeth Regerssion Fama-Macbeth 回归\nFollowing Two step 分为两步\n1. specify the model and take cross-sectional regression 确定模型,进行截面回归 \n2. take the time-series average of regress coefficient 对系数在时间序列上取平均\n\nFor more academic reference: \nEmpirical Asset Pricing: The Cross Section of Stock Returns. Bali, Engl... | [
[
"pandas.to_datetime",
"numpy.array",
"numpy.log",
"numpy.round",
"numpy.set_printoptions",
"numpy.exp",
"numpy.mean",
"numpy.shape",
"scipy.stats.ttest_1samp",
"numpy.where",
"numpy.std",
"numpy.var",
"numpy.around",
"numpy.unique"
]
] |
ivankeller/discrepancy | [
"1e4806e4c9cdbb16ff3c1af9c591a110c4db7828"
] | [
"distances/distances.py"
] | [
"import numpy as np\nimport sys\n\nclass Point(object):\n \"\"\"\"A point in the plane.\n \n Attributes\n ----------\n x, y : float\n Point coodinates\n \n \"\"\"\n def __init__(self, x, y):\n self.x = x\n self.y = y\n \n\nclass Distance(object):\n \"\"\"Di... | [
[
"numpy.zeros",
"numpy.tile",
"numpy.min",
"numpy.arange",
"numpy.abs",
"numpy.sqrt",
"numpy.repeat"
]
] |
thunlp/Open-QA | [
"e8faddca287c81cb52ac904ba8980734ea40a03c"
] | [
"main.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"Main OpenQA training and testing script.\"\"\"\n\nimport argparse\nimport torch\nimport numpy as np\nimport json\nimport os\nimport sys\nimport subprocess\nimport logging\nimport random\n\nimport regex as re\n\nsys_dir = '/data/disk2/private/linyankai/OpenQA... | [
[
"torch.cuda.manual_seed",
"torch.is_tensor",
"numpy.random.seed",
"torch.manual_seed",
"torch.utils.data.sampler.SequentialSampler",
"torch.cuda.set_device",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.utils.data.DataLoader",
"torch.Tensor"
]
] |
vslaykovsky/google-research | [
"0e175c510fe2b4650f105e1d344de06394f45f9a"
] | [
"non_semantic_speech_benchmark/export_model/model_export_utils.py"
] | [
"# coding=utf-8\n# Copyright 2021 The Google Research 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 requ... | [
[
"tensorflow.io.gfile.GFile",
"tensorflow.train.latest_checkpoint",
"numpy.zeros",
"numpy.testing.assert_array_equal",
"tensorflow.io.gfile.walk",
"tensorflow.train.load_checkpoint",
"tensorflow.io.gfile.exists",
"tensorflow.lite.TFLiteConverter.from_keras_model",
"tensorflow.sa... |
BinLiu777/NeuralDialog-LAED | [
"746a4834a1b5566011ccc0c40f45c8deaf0e3c67"
] | [
"laed/dataset/data_loaders.py"
] | [
"# Copyright (C) 2017 Tiancheng Zhao, Carnegie Mellon University\nfrom __future__ import print_function\nimport numpy as np\nfrom laed.utils import Pack\nfrom laed.dataset.dataloader_bases import DataLoader\n\n\n# Stanford Multi Domain\nclass SMDDataLoader(DataLoader):\n def __init__(self, name, data, config)... | [
[
"numpy.max",
"numpy.array",
"numpy.empty",
"numpy.zeros",
"numpy.min",
"numpy.mean",
"numpy.argsort"
]
] |
mvaenskae/cil-2018-road-segmentation | [
"512db116f064da519a8ad20483b7dcda7567d596"
] | [
"data/submission_to_mask.py"
] | [
"#!/usr/bin/env python3\n\nimport os\nimport sys\nfrom PIL import Image\nimport math\nimport matplotlib.image as mpimg\nimport numpy as np\n\nlabel_file = 'submission.csv'\n\nh = 16\nw = h\nimgwidth = 608\nimgheight = imgwidth\nnc = 3\n\nprediction_tags = [105, 106, 107, 108, 10, 115, 116, 11, 121, 122, 123, 124, 1... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
akashAD98/Computer_Vision_projects | [
"2d7594e2cd223f050075b11051a69e7606908d2f"
] | [
"social_distancing.py"
] | [
"import cv2\nimport datetime\nimport imutils\nimport numpy as np\nfrom centroidtracker import CentroidTracker\nfrom itertools import combinations\nimport math\n\nprotopath = \"H:/CV projects/AIComputerVision-master/model files/generic object detection model/MobileNetSSD_deploy.prototxt\"\nmodelpath = \"H:/CV projec... | [
[
"numpy.array",
"numpy.minimum",
"numpy.where",
"numpy.arange",
"numpy.argsort",
"numpy.maximum"
]
] |
RafaelGoncalves8/pytorch-lightning | [
"7285613974bb3f87c9cde4bd6ddd074d0769ef82",
"7285613974bb3f87c9cde4bd6ddd074d0769ef82"
] | [
"pytorch_lightning/metrics/regression/mean_squared_error.py",
"tests/metrics/regression/test_mean_error.py"
] | [
"import torch\nfrom typing import Any, Callable, Optional, Union\n\nfrom pytorch_lightning.metrics.metric import Metric\n\n\nclass MeanSquaredError(Metric):\n \"\"\"\n Computes mean squared error.\n\n Args:\n compute_on_step:\n Forward only calls ``update()`` and return None if this is se... | [
[
"torch.sum",
"torch.tensor",
"torch.pow"
],
[
"torch.manual_seed",
"torch.rand",
"torch.randn"
]
] |
airbus/decomon | [
"f3668fbd8edd0def4e23aa0634eebfec58349c35"
] | [
"tests/dense_layer.py"
] | [
"# Test unit for decomon with Dense layers\nfrom __future__ import absolute_import\nimport pytest\nimport numpy as np\nfrom decomon.layers.decomon_layers import DecomonDense, to_monotonic\nfrom tensorflow.keras.layers import Dense\nfrom . import (\n get_tensor_decomposition_1d_box,\n get_standart_values_1d_bo... | [
[
"numpy.ones_like",
"tensorflow.python.keras.backend.epsilon",
"numpy.testing.assert_almost_equal",
"tensorflow.keras.layers.Dense",
"tensorflow.python.keras.backend.set_epsilon",
"tensorflow.python.keras.backend.function"
]
] |
svakulenk0/transformer_rankers | [
"49435e4ec5abc8cb745ccc4b4b1354963a78ba50"
] | [
"transformer_rankers/datasets/preprocess_crr.py"
] | [
"from IPython import embed\nimport pandas as pd\nimport json\nimport re\n\ndef read_crr_tsv_as_df(path, nrows=-1, add_turn_separator=True):\n \"\"\"\n Transforms conversation response ranking tsv file to a pandas DataFrame.\n\n The format is label \\t utterance_1 \\t utterance_2 \\t ...... \\t candidate_re... | [
[
"pandas.DataFrame"
]
] |
pidan1231239/SR-Stereo | [
"63452cdacd45df4566120f353003272d15b099af",
"63452cdacd45df4566120f353003272d15b099af"
] | [
"models/Stereo/RawPSMNet_TieCheng/submodule.py",
"models/SR/RawEDSR/edsr.py"
] | [
"from __future__ import print_function\nimport torch\nimport torch.nn as nn\nimport torch.utils.data\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport math\nimport numpy as np\nimport pdb\ndef convbn(in_planes, out_planes, kernel_size, stride, pad, dilation):\n\n return nn.Sequential(... | [
[
"torch.cat",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.Conv3d",
"torch.nn.BatchNorm3d",
"torch.sum"
],
[
"torch.nn.ReLU",
"torch.nn.Sequential"
]
] |
ChristophRaab/prototorch_models | [
"75a39f5b03110a56b3d93ee00b3397858f4222a3"
] | [
"examples/gtlvq_moons.py"
] | [
"\"\"\"Localized-GTLVQ example using the Moons dataset.\"\"\"\n\nimport argparse\n\nimport prototorch as pt\nimport pytorch_lightning as pl\nimport torch\n\nif __name__ == \"__main__\":\n # Command-line arguments\n parser = argparse.ArgumentParser()\n parser = pl.Trainer.add_argparse_args(parser)\n args... | [
[
"torch.zeros",
"torch.utils.data.DataLoader"
]
] |
LipatJob/pytorch-YOLOv4 | [
"ba91f3c7a3e54a557e045d4276ac08d0a85afbee"
] | [
"dataset.py"
] | [
"# -*- coding: utf-8 -*-\n'''\n@Time : 2020/05/06 21:09\n@Author : Tianxiaomo\n@File : dataset.py\n@Noice :\n@Modificattion :\n @Author :\n @Time :\n @Detail :\n\n'''\nimport os\nimport random\nimport sys\n\nimport cv2\nimport numpy as np\n\nimport torch\nfrom to... | [
[
"torch.zeros",
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.random.seed",
"numpy.random.shuffle",
"numpy.mean",
"numpy.where",
"matplotlib.pyplot.show",
"numpy.clip",
"torch.as_tensor"
]
] |
JeffreyBradley772/ML-Work | [
"c6c96c8a8c467eb12ae6e98c385dcf833f36744c"
] | [
"LogisticRegModel.py"
] | [
"#Jeffrey Bradley\r\n#9/11/2020\r\n\r\n\r\n# import statements\r\nfrom tensorflow.keras.datasets import fashion_mnist\r\nfrom sklearn.model_selection import train_test_split\r\nimport tensorflow as tf\r\n\r\n#10 classes (of clothing) -> 0-9\r\n#784 features\r\n#weight matrix so that each feature is a percentage of ... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.GradientTape",
"tensorflow.random.normal",
"tensorflow.argmax",
"tensorflow.equal",
"tensorflow.matmul",
"tensorflow.keras.datasets.fashion_mnist.load_data",
"tensorflow... |
junzhin/Science_Research_Project | [
"39eab889b76ee87dc2182f238329157bc1390e58",
"39eab889b76ee87dc2182f238329157bc1390e58"
] | [
"code/version2.0/examples/domain_adaptation/classification/source_only.py",
"code/version2.0/utils/utils.py"
] | [
"import random\nimport time\nimport warnings\nimport sys\nimport argparse\nimport shutil\nimport os.path as osp\n\nimport torch\nimport torch.nn as nn\nimport torch.backends.cudnn as cudnn\nfrom torch.optim import SGD\nfrom torch.optim.lr_scheduler import LambdaLR\nfrom torch.utils.data import DataLoader\nimport to... | [
[
"torch.nn.Sequential",
"torch.no_grad",
"torch.manual_seed",
"torch.nn.functional.cross_entropy",
"torch.cuda.is_available",
"torch.utils.data.DataLoader"
],
[
"torch.cat",
"torch.randperm",
"torch.cuda.is_available",
"torch.eye",
"torch.LongTensor",
"torch.topk... |
adyomin/torchbeast | [
"3616c342a08b9c2a6a938a8b5b84baa2eddad321"
] | [
"tests/core_agent_state_env.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\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 app... | [
[
"numpy.zeros"
]
] |
Karl-Krauth/robust-adaptive-lqr | [
"ab711507d7633fe57ee19dc66b64348570ee0c9e"
] | [
"python/examples.py"
] | [
"import numpy as np\nfrom scipy import linalg as ln\n\ndef chained_integrator_dynamics(dt=0.1, n=2, decay=1, amplification = 1, fullB=False):\n ''' forward euler discretization of\n dx_i/dt = x_{i+1}; dx_n/dt = u\n with added decay of states or amplification\n of integration terms '''\n i... | [
[
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"numpy.eye",
"numpy.diag"
]
] |
chouki-zhang/Digit-chemical-lab | [
"c2b6d8d26df9df5c5e25a4c3f62ab02f105e8ee1"
] | [
"tests/datatools/test_dataset.py"
] | [
"# Copyright (c) 2019. TsumiNa. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\nfrom os import remove\nfrom pathlib import Path\n\nimport joblib\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom xenonpy.datatools import... | [
[
"pandas.DataFrame",
"numpy.array"
]
] |
slimaneaymen/Malaria-Detection | [
"4b94ed005a660dc89794d6544810a3f4fb68e2b5"
] | [
"libraries/fonction_compteur_segmentation.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jul 9 12:13:10 2019\n\n@author: gourgue\n\"\"\"\n#%%\nimport numpy as np\n\nfrom scipy import ndimage as ndi\nfrom scipy.io import savemat\n\nimport matplotlib.pyplot as plt\n\nfrom fonction_compteur_affiche import plot\nfrom fonction_compteur_datagenerator im... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.zeros",
"scipy.ndimage.label",
"numpy.sum",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"scipy.io.savemat",
"numpy.where",
"numpy.unique",
"numpy.ma.masked_array",
"numpy.linspace",
"numpy.ma.masked_where",
... |
nasioutz/DeepHash | [
"963ca74037f0694955571a178d2fb0bc380e9706"
] | [
"DeepHash/data_provider/image/__init__.py"
] | [
"# =============================================================================\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... | [
[
"numpy.asarray"
]
] |
joaovicentesouto/INE5454 | [
"e6bf904ed2360baf5b4069a502cf20b83041dd2a"
] | [
"gui/demoari/MongoWrapper.py"
] | [
"\nfrom pymongo import MongoClient\nimport pandas as pd\nimport numpy as np\nimport re\n\nclass MongoWrapper:\n def __init__(self):\n self._client = MongoClient(host=['localhost:27017'])\n print('Mongo initiation: OK')\n\n def query(self, names, categories, gt, min_rating, orderBy, sortR... | [
[
"pandas.DataFrame"
]
] |
thobauma/dace | [
"668e4c49e476437e1ea3b272e9dbefca2b92d2e7"
] | [
"tests/gpu_multi/nccl/nccl_reduce_inplace_test.py"
] | [
"# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.\nimport dace\nimport numpy as np\nimport pytest\n\nfrom dace.sdfg import nodes, infer_types\nfrom dace import dtypes\nimport dace.libraries.nccl as nccl\nfrom dace.config import Config\n\nN = dace.symbol('N')\nroot_device = dace.symbol('ro... | [
[
"numpy.ndarray",
"numpy.unique"
]
] |
neerajkulk/sunpy | [
"864b451f648f30583e38d5a73b8f8c88dc0fd928"
] | [
"sunpy/visualization/animator/base.py"
] | [
"import abc\nfrom functools import partial\n\nimport matplotlib.animation as mplanim\nimport matplotlib.pyplot as plt\nimport matplotlib.widgets as widgets\nimport mpl_toolkits.axes_grid1.axes_size as Size\nimport numpy as np\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\n\nimport astropy.units as u\n\n_... | [
[
"matplotlib.pyplot.colorbar",
"matplotlib.widgets.Button",
"matplotlib.animation.FuncAnimation",
"matplotlib.widgets.Slider",
"numpy.asarray",
"numpy.array",
"matplotlib.pyplot.sca",
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.gca"
... |
MGarrod1/unobserved_spin_influence | [
"7bc3a304e1e09cf6cfaddb50ec3203ecc8808cbe"
] | [
"Figure_2_threeblock/figS2-simulations.py"
] | [
"\"\"\"\n\nComputes the magnetization as a function of the\ninverse temperature for a three block SBM with\nexternal fields using:\na) Block level mean-field approximation\nb) Full graph mean-field approximation\nc) Monte Carlo simulations with Metropolis\nHastings dynamics\n\nVariant which focuses on studying the ... | [
[
"numpy.random.choice",
"numpy.asarray",
"numpy.random.seed",
"numpy.ones",
"numpy.random.uniform",
"numpy.linspace"
]
] |
musically-ut/memorize | [
"e5847c7fa8bdc5bd3cf9f7b5650541fd6be7bb55"
] | [
"plot_utils.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib\n\nSPINE_COLOR = 'grey'\ndef latexify(fig_width=None, fig_height=None, columns=1, largeFonts=False,font_scale=1):\n \"\"\"Set up matplotlib's RC params for LaTeX plotting.\n Call this before plotting a figure.\n\n Parameters\n -----... | [
[
"matplotlib.pyplot.rcParams.update",
"matplotlib.rcParams.update",
"numpy.sqrt"
]
] |
MaToeStudent/gcp_docker_example | [
"ecdf8128da1c85d0397f4fc62d4f061cf6530fc1"
] | [
"main.py"
] | [
"from sklearn import datasets, svm, metrics\nfrom sklearn.model_selection import train_test_split\n\n\nif __name__ == '__main__':\n digits = datasets.load_digits()\n\n # flatten the images\n n_samples = len(digits.images)\n data = digits.images.reshape((n_samples, -1))\n\n # Create a classifier: a su... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.metrics.classification_report",
"sklearn.datasets.load_digits",
"sklearn.svm.SVC"
]
] |
radekosmulski/NVTabular | [
"d106197f343a5e2eb39a47f03cd220481ef40559"
] | [
"tests/unit/loader/test_tf_dataloader.py"
] | [
"#\n# Copyright (c) 2021, NVIDIA CORPORATION.\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 applicabl... | [
[
"numpy.array",
"numpy.isclose",
"numpy.random.rand",
"numpy.asarray",
"numpy.random.RandomState",
"numpy.random.randint",
"sklearn.metrics.roc_auc_score"
]
] |
toshi-k/kaggle-champs-scalar-coupling | [
"b0f6a99bbb23328030ee3ce5a6a416b84fa8ed60",
"b0f6a99bbb23328030ee3ce5a6a416b84fa8ed60"
] | [
"source/02_triplet_update/lib/calc_score.py",
"source/02_triplet_update/lib/generate_batches.py"
] | [
"from logging import getLogger\n\nimport numpy as np\n\n\ndef calc_score(df_truth, pred):\n\n logger = getLogger('root')\n\n target_types = list(set(df_truth['type']))\n\n diff = df_truth['scalar_coupling_constant'] - np.sum(pred, axis=1)\n diff_fc = df_truth['fc'] - pred[:, 0]\n diff_sd = df_truth['... | [
[
"numpy.sum",
"numpy.abs",
"numpy.log"
],
[
"numpy.append"
]
] |
yux94/Pathology | [
"5a145b5ee106d32b08dbce57f395f4d62e5ece06"
] | [
"bin/xml2mask_2.py"
] | [
"import openslide\nimport xml.etree.ElementTree as ET\nimport numpy as np\nfrom skimage.draw import polygon\nfrom multiprocessing import Pool\nimport cv2\nimport logging\n\n\ndef camelyon16xml2json(inxml, level):\n \"\"\"\n Convert an annotation of camelyon16 xml format into a json format.\n\n Arguments:\n... | [
[
"numpy.round",
"numpy.asarray",
"numpy.zeros"
]
] |
jspark1105/tbb_test | [
"bab983acda8186b518653a7a60bfefbaaa905177"
] | [
"c2_bench/mlp_caffe2.py"
] | [
"# Pre-requisites\n# 1. Install Anaconda\n# wget https://repo.continuum.io/archive/Anaconda3-5.0.0-Linux-x86_64.sh -O anaconda3.sh\n# chmod +x anaconda3.sh\n# ./anaconda3.sh -b -p ~/local/anaconda3\n# 2. Create and activate PyTorch env\n# ~/local/anaconda3/bin/conda create -yn pytorch\n# source ~/local/anaconda3/bi... | [
[
"numpy.ceil",
"numpy.array",
"numpy.random.rand",
"numpy.random.seed",
"numpy.set_printoptions",
"numpy.ones",
"numpy.transpose",
"numpy.fromstring"
]
] |
sherrym/tensorflow | [
"fa2bd03c87d760420cb18967d120510b64710b82"
] | [
"tensorflow/tensorboard/backend/tensorboard.py"
] | [
"# Copyright 2015 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.python.summary.event_multiplexer.EventMultiplexer",
"tensorflow.python.platform.status_bar.SetupStatusBarInsideGoogle",
"tensorflow.python.platform.logging.error",
"tensorflow.python.platform.flags.DEFINE_integer",
"tensorflow.python.platform.flags.DEFINE_boolean",
"tensorflow.... |
PiotrekGa/mtd-learn | [
"e0897aa291970671a37be4301d444124bd38e591"
] | [
"mtdlearn/preprocessing/src.py"
] | [
"import numpy as np\r\nfrom sklearn.base import TransformerMixin, BaseEstimator\r\nfrom typing import Optional, Union, Tuple\r\n\r\n\r\nclass PathEncoder(TransformerMixin, BaseEstimator):\r\n\r\n \"\"\"\r\n Encoding of string paths into NumPy array\r\n\r\n Parameters\r\n ----------\r\n order: int\r\n... | [
[
"numpy.array",
"numpy.char.split",
"numpy.vectorize",
"numpy.unique"
]
] |
morikatron/PPO | [
"2240540526c6d3ae6606573a562b9b3656a44b89"
] | [
"algo/ppo.py"
] | [
"import tensorflow as tf\nEPS = 1e-8\n\n\nclass PPO(tf.Module):\n \"\"\"\n ニューラルネットワークが絡む推論、学習の2つの計算を行うクラスです。\n @tf.functionデコレータは実行時に関数をグラフにコンパイルしてくれるもので、学習の高速化・GPUでの実行を可能にします。\n \"\"\"\n def __init__(self, num_actions, input_shape, config):\n super(PPO, self).__init__(name='ppo_model')\n ... | [
[
"tensorflow.square",
"tensorflow.abs",
"tensorflow.convert_to_tensor",
"tensorflow.minimum",
"tensorflow.GradientTape",
"tensorflow.where",
"tensorflow.one_hot",
"tensorflow.math.log",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Model",
"tensorflow.clip_by_norm",... |
SiegeLordEx/probability | [
"1a12ee773199bec0ad6d49333e268f98e4b731be"
] | [
"tensorflow_probability/python/experimental/mcmc/preconditioned_hmc_test.py"
] | [
"# Copyright 2020 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.fill",
"tensorflow.compat.v2.math.ceil",
"tensorflow.compat.v2.sqrt",
"tensorflow.compat.v2.reduce_sum",
"tensorflow.compat.v2.linalg.eigvalsh",
"tensorflow.compat.v2.test.main",
"tensorflow.compat.v2.reduce_min",
"tensorflow.compat.v2.linalg.sqrtm",
"tens... |
uetke/UUTrap | [
"38d1f954c89df1f8b68ad9f155ffc611cdb92004"
] | [
"Scripts/scanplot.py"
] | [
"import pylab as plt\nimport numpy as np\n\nitrt=101\nnm=input(\"File name: \")\nnum_lines = sum(1 for line in open(nm))\nli=np.sqrt(num_lines/2)\nprint(li)\nx,y,z= np.loadtxt(nm, delimiter='\\t').T\nyb,xb,zb=[],[],[]\nyf,xf,zf=[],[],[]\nfor i in range(itrt):\n for j in range(itrt):\n k = (2 * i + 1) * 10... | [
[
"numpy.loadtxt",
"numpy.asarray",
"numpy.sqrt"
]
] |
agclark12/invasion_counter_v1 | [
"845b543f33569af8caab2ce0989fa6ee508fd440"
] | [
"MyQgraphics_widget_v2.py"
] | [
"#!/opt/local/bin/python\n\n__author__ = \"Andrew G. Clark\"\n__date__ = \"2015\"\n__copyright__ = \"Copyright 2015, Andrew Clark\"\n__maintainer__ = \"Andrew G. Clark\"\n__email__ = \"andrew.clark@curie.fr\"\n__status__ = \"Production\"\n\n\"\"\" Custom widget for displaying and interacting with\nimages using PyQT... | [
[
"numpy.max",
"numpy.array",
"numpy.ones",
"numpy.zeros"
]
] |
frank-wei/pytorch | [
"339e45ba39e8fdb0f4cf29ad89bb9952a79d8027"
] | [
"torch/nn/modules/module.py"
] | [
"from collections import OrderedDict, namedtuple\nimport itertools\nimport warnings\nimport functools\n\nimport torch\nfrom ..parameter import Parameter\nimport torch.utils.hooks as hooks\n\nfrom torch import Tensor, device, dtype\nfrom typing import Union, Tuple, Any, Callable, Iterator, Set, Optional, overload, T... | [
[
"torch._C._log_api_usage_once",
"torch.no_grad",
"torch.typename",
"torch._C._get_tracing_state",
"torch.overrides.is_tensor_like",
"torch.utils.hooks.BackwardHook",
"torch.nn.parameter.is_lazy",
"torch.utils.hooks.RemovableHandle",
"torch.__future__.get_overwrite_module_params... |
systemallica/mercs | [
"39e999620ab989abb29310488dcd30354d029490"
] | [
"mercs/composition/CompositeModel.py"
] | [
"import numpy as np\nfrom sklearn.preprocessing import normalize\n\nfrom mercs.algo.inference import compute\n\nVERBOSITY = 0\n\n\nclass CompositeModel(object):\n \"\"\"\n Builds a model from the diagram generated by the inference algorithm.\n Sets the desc and targ ids, feature imps, classes and predictio... | [
[
"numpy.array",
"numpy.stack",
"sklearn.preprocessing.normalize"
]
] |
snitraMnolraM/package-processing-Image | [
"791f965f94e52be2e952725737fea3e86926b71a"
] | [
"processing_image/utils/plot.py"
] | [
"import matplotlib.pyplot as plt\n\n\ndef plot_image(image):\n plt.figure(figsize=(12, 4))\n plt.imshow(image, cmap='gray')\n plt.axis('off')\n plt.show()\n\ndef plot_result(*args):\n number_images = len(args)\n fig, axis = plt.subplots(nrows=1, ncols = number_images, figsize=(12, 4))\n names_l... | [
[
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
lucidworks/nlpaug | [
"8e47fa39200db17f4dc1d61567af1419bc389071"
] | [
"test/augmenter/spectrogram/test_time_masking.py"
] | [
"import unittest\nimport os\nfrom dotenv import load_dotenv\nimport numpy as np\n\nfrom nlpaug.util import AudioLoader\nimport nlpaug.augmenter.spectrogram as nas\n\n\nclass TestTimeMasking(unittest.TestCase):\n @classmethod\n def setUpClass(cls):\n env_config_path = os.path.abspath(\n os.pa... | [
[
"numpy.count_nonzero"
]
] |
bhagemeier/heat | [
"b362b61a558c4a69cd9a884051b5efcc74f494da"
] | [
"heat/core/tests/test_communication.py"
] | [
"import numpy as np\nimport unittest\nimport torch\nimport os\nimport heat as ht\n\nif os.environ.get(\"DEVICE\") == \"gpu\" and torch.cuda.is_available():\n ht.use_device(\"gpu\")\n torch.cuda.set_device(torch.device(ht.get_device().torch_device))\nelse:\n ht.use_device(\"cpu\")\ndevice = ht.get_device().... | [
[
"numpy.array",
"torch.arange",
"torch.equal",
"torch.ones",
"torch.cuda.set_device",
"torch.cuda.is_available",
"torch.tensor",
"numpy.arange",
"torch.zeros_like",
"torch.empty"
]
] |
paulapbrooks/rt-cloud | [
"7eb54ee5ebb95a7b2fc62e3364110e6bad3da8ce"
] | [
"rtCommon/dicomNiftiHandler.py"
] | [
"# PURPOSE: anonmyize dicom data\n\nimport os\nimport glob\nfrom subprocess import call\nfrom nilearn.image import new_img_like\nfrom nibabel.nicom import dicomreaders\nimport nibabel as nib\nimport numpy as np\nfrom rtCommon.readDicom import readDicomFromBuffer, readRetryDicomFromFileInterface\nfrom rtCommon.fileC... | [
[
"numpy.arange",
"numpy.zeros",
"numpy.shape",
"numpy.argwhere"
]
] |
chemlove/plip | [
"52a440f444b4ea73e4c138f577559b4c09bb28db"
] | [
"plip/test/test_basic_functions.py"
] | [
"# coding=utf-8\n\"\"\"\nProtein-Ligand Interaction Profiler - Analyze and visualize protein-ligand interactions in PDB files.\ntest_basic_functions.py - Unit Tests for basic functionality.\nCopyright 2014-2015 Sebastian Salentin\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use ... | [
[
"numpy.radians"
]
] |
ntdosch/flopy | [
"63ce93d23eb028017cccf6a83a9180560ba36f77"
] | [
"flopy/utils/modpathfile.py"
] | [
"\"\"\"\nModule to read MODPATH output files. The module contains two\nimportant classes that can be accessed by the user.\n\n* EndpointFile (ascii endpoint file)\n* PathlineFile (ascii pathline file)\n\n\"\"\"\n\nimport itertools\nimport collections\nimport numpy as np\n\nfrom numpy.lib.recfunctions import appe... | [
[
"numpy.array",
"numpy.zeros",
"numpy.lib.recfunctions.append_fields",
"numpy.where",
"numpy.arange",
"numpy.lib.recfunctions.stack_arrays",
"numpy.in1d",
"numpy.dtype",
"numpy.unique"
]
] |
dudqls1994/BNN-kd | [
"3056e6b502b63dc3afab1aa01a21dfb4f3cd5d55"
] | [
"models/bireal.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.utils.model_zoo as model_zoo\nimport torch.nn.functional as F\n\n\n__all__ = ['birealnet18', 'birealnet34']\n\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"\"\"3x3 convolution with padding\"\"\"\n return nn.Conv2d(in_planes, out_planes, kernel_size=3, ... | [
[
"torch.nn.Linear",
"torch.rand",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.clamp",
"torch.sign",
"torch.nn.Conv2d",
"torch.nn.PReLU",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.functional.conv2d"
]
] |
cuicheng01/tpu | [
"ff08f107f3d4d85e064d4953c463bdb3abd9f595"
] | [
"models/experimental/detection/main.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.logging.set_verbosity",
"tensorflow.gfile.Exists",
"tensorflow.logging.info",
"tensorflow.gfile.MakeDirs",
"tensorflow.app.run",
"tensorflow.contrib.training.checkpoints_iterator"
]
] |
monokim/CheesyBullets | [
"eeb5a79a69936701ff7962b846e6310f7df91cb0"
] | [
"gym_game/envs/game.py"
] | [
"import numpy as np\nimport time\nimport random\nimport math\nimport pygame\nimport cv2\n\nscreen_width = 768\nscreen_height = 768\n\nclass Player:\n size = 8\n alive = True\n def __init__(self, screen):\n self.screen = screen\n self.position = [screen_width / 2, screen_height / 2]\n s... | [
[
"numpy.ascontiguousarray"
]
] |
technocreep/FEDOT | [
"c11f19d1d231bd9c1d96d6e39d14697a028f6272"
] | [
"test/unit/utilities/test_pipeline_import_export.py"
] | [
"import json\nimport os\nimport shutil\n\nimport numpy as np\nimport pytest\nfrom sklearn.metrics import mean_absolute_error\n\nfrom fedot.core.pipelines.node import PrimaryNode, SecondaryNode\nfrom fedot.core.pipelines.pipeline import Pipeline\nfrom fedot.core.pipelines.template import PipelineTemplate, extract_su... | [
[
"numpy.int32",
"sklearn.metrics.mean_absolute_error",
"numpy.isclose",
"numpy.array_equal"
]
] |
manifest/jax | [
"d82341d95f418fe2a03cfe691b21813e4309eff7"
] | [
"tests/lax_numpy_test.py"
] | [
"# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.diag_indices",
"numpy.triu_indices_from",
"numpy.tile",
"numpy.trim_zeros",
"numpy.resize",
"numpy.tensordot",
"numpy.tril_indices",
"numpy.unique",
"numpy.random.random",
"numpy.logspace",
"numpy.full_like",
"numpy.bincount",
"numpy.count_nonzero",
"... |
jaraujo98/SinglePartitionAdaptiveQLearning | [
"4084a27fdbfcfefd31e9be3f82628bdc50244998"
] | [
"test_RL_difference.py"
] | [
"\"\"\"\nCodebase for the paper: How Many Random Seeds? Statistical Power Analysis in Deep Reinforcement Learning Experiments.\nHere we implement five functions:\n\n1) welch_test: performs Welch's t-test at significance level alpha. Wraps around ttest_ind function of scipy. See\nfunction documentation.\n\n2) bootst... | [
[
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"scipy.stats.ttest_ind",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.rc",
"numpy.sign",
"numpy.random.shuffle",
"numpy.loadtxt",
... |
asappresearch/texrel | [
"dff447a99d56f2f92284df866fa01e7762dc6eac"
] | [
"texrel/create_dataset.py"
] | [
"\"\"\"\nUses the new generators, which contain the relevant spaces, for both training and holdout,\nrather than injecting the spaces from outside.\n\"\"\"\nimport argparse\nfrom typing import Tuple, List, Type\nfrom os.path import expanduser as expand\nimport time\n\nimport torch\nimport numpy as np\n\nfrom ulfs i... | [
[
"torch.zeros",
"numpy.random.RandomState"
]
] |
dmerthe/expyriments | [
"33e94921c978b3bbe658cffaf0335d4d5a0bf87c"
] | [
"examples/Keithley 2400 Experiment/keithley_2400_voltages_generator.py"
] | [
"import numpy as np\nimport pandas as pd\n\nvoltages = np.concatenate([\n np.arange(0,21),\n np.arange(20,-21,-1),\n np.arange(-20,1)\n])\n\ndf = pd.DataFrame({'Voltages': voltages})\n\ndf.to_csv('keithley_2400_voltages.csv',index=False)\n"
] | [
[
"pandas.DataFrame",
"numpy.arange"
]
] |
niopeng/pytorch-CycleGAN-and-pix2pix | [
"2371b2d75972e8b195a978c67f892560878a312b"
] | [
"datasets/combine_A_and_B.py"
] | [
"import os\nimport numpy as np\nimport cv2\nimport argparse\nfrom multiprocessing import Pool\n\n\ndef image_write(path_A, path_B, path_AB):\n im_A = cv2.imread(path_A, 1) # python2: cv2.CV_LOAD_IMAGE_COLOR; python3: cv2.IMREAD_COLOR\n im_B = cv2.imread(path_B, 1) # python2: cv2.CV_LOAD_IMAGE_COLOR; python3: ... | [
[
"numpy.concatenate"
]
] |
nhatnxn/layout_GateGCN | [
"66ead2482fc5148668cfc776e0a3ac03d916e897"
] | [
"models/text_detect/craft.py"
] | [
"\"\"\"\nCopyright (c) 2019-present NAVER Corp.\nMIT License\n\"\"\"\n\nfrom collections import namedtuple\n\n# -*- coding: utf-8 -*-\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.nn.init as init\nfrom torchvision import models\nfrom torchvision.models.vgg import model_urls\n\n... | [
[
"torch.cat",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.init.xavier_uniform_",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
ankitshah009/tf2-gnn | [
"3c763274f6586fb8d4cf3d74e3e0fd03b970b43f"
] | [
"tf2_gnn/layers/gnn.py"
] | [
"\"\"\"GNN Encoder class.\"\"\"\nfrom itertools import count\nfrom typing import Any, Dict, NamedTuple, List, Tuple, Optional\n\nimport tensorflow as tf\nfrom dpu_utils.tf2utils import MLP\n\nfrom tf2_gnn.utils.param_helpers import get_activation_function\nfrom .message_passing import (\n MessagePassing,\n Me... | [
[
"tensorflow.TensorSpec",
"tensorflow.TensorShape",
"tensorflow.function",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.LayerNormalization",
"tensorflow.name_scope",
"tensorflow.nn.dropout"
]
] |
hjaipingguo/UrlDetect | [
"2ab35902e4fa3de7fd0ab28a6a23d5c27d13c63d"
] | [
"model/train.py"
] | [
"# -*- coding: utf-8 -*-\nimport data_helper\nimport word2vec_helpers\nimport tensorflow as tf\nimport os ,time, datetime\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom URLCNN import *\nimport tempfile\n# Parameters\n# =======================================================\n\n# Da... | [
[
"tensorflow.flags.DEFINE_integer",
"tensorflow.global_variables_initializer",
"tensorflow.flags.DEFINE_string",
"tensorflow.Variable",
"tensorflow.global_variables",
"tensorflow.train.global_step",
"tensorflow.train.Saver",
"tensorflow.flags.DEFINE_float",
"tensorflow.ConfigPro... |
JingyueLu/GNN_branching | [
"3ad7841220f2540505ac3cce31e4b19f133e4870"
] | [
"plnn/network_linear_approximation.py"
] | [
"import gurobipy as grb\nimport math\nimport torch\n\nfrom itertools import product\nfrom plnn.modules import View, Flatten\nfrom torch import nn\nfrom torch.nn import functional as F\n\nclass LinearizedNetwork:\n\n def __init__(self, layers):\n '''\n layers: A list of Pytorch layers containing onl... | [
[
"torch.nonzero",
"torch.min",
"torch.max",
"torch.nn.Sequential",
"torch.no_grad",
"torch.enable_grad",
"torch.clamp",
"torch.tensor",
"torch.Tensor",
"torch.nn.functional.conv2d",
"torch.set_num_threads"
]
] |
ihs-nick/mlrun | [
"a7189da2a8f044950e6df3fe0488291939abe83a"
] | [
"tests/api/api/test_grafana_proxy.py"
] | [
"import os\nfrom datetime import datetime, timedelta\nfrom random import randint\nfrom typing import Optional\n\nimport pandas as pd\nimport pytest\nfrom fastapi.testclient import TestClient\nfrom pytest import fail\nfrom sqlalchemy.orm import Session\nfrom v3io.dataplane import RaiseForStatus\nfrom v3io_frames imp... | [
[
"pandas.DataFrame"
]
] |
varman-m/eeg_notebooks_doc | [
"7a520c4f8ac3a44f4f18dc025b5e5d40049c9f2b"
] | [
"motivations/measurements/plot_BandRatios.py"
] | [
"\"\"\"\nBand Ratio Measures\n===================\n\nExploring how band ratio measures relate to periodic & aperiodic activity.\n\"\"\"\n\n###################################################################################################\n# Introduction\n# ------------\n#\n# Band ratios measures are a relatively c... | [
[
"numpy.mean",
"matplotlib.pyplot.subplots"
]
] |
ywjleft/SVBRDF_from_Video | [
"8cabbbe922496efa9c49523bd82cced2a11c4436"
] | [
"flow/losses_flow.py"
] | [
"import tensorflow as tf\n\ndef L1loss(x, y): # shape(# batch, h, w, 2)\n return tf.reduce_mean(tf.reduce_sum(tf.norm(x-y, ord = 1, axis = 3), axis = (1,2)))\n\ndef L2loss(x, y): # shape(# batch, h, w, 2)\n return tf.reduce_mean(tf.reduce_sum(tf.norm(x-y, ord = 2, axis = 3), axis = (1,2)))\n\n# end point erro... | [
[
"tensorflow.norm",
"tensorflow.shape",
"tensorflow.name_scope",
"tensorflow.image.resize_nearest_neighbor"
]
] |
Jefflin413/Machine-Learning | [
"0505e2408a99000c75108b095945f44bd70adb6e"
] | [
"DQN/DQN.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nimport gym\n\n# For saving the results as gif\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport imageio\n\n# Hyper Parameters\nBATCH_SIZE = 32\nLR = 0.01 \n# Greedy policy, sometimes the computer w... | [
[
"torch.nn.Linear",
"numpy.random.choice",
"torch.nn.MSELoss",
"numpy.zeros",
"torch.max",
"torch.FloatTensor",
"numpy.hstack",
"numpy.random.uniform",
"numpy.random.randint",
"torch.nn.functional.relu"
]
] |
mazpie/mime | [
"b3e5a8a9e1815120eebc7ec4a5b70a8701f74317"
] | [
"metaworld/envs/mujoco/sawyer_xyz/sawyer_window_open.py"
] | [
"import numpy as np\nfrom gym.spaces import Box\n\nfrom metaworld.envs.env_util import get_asset_full_path\nfrom metaworld.envs.mujoco.sawyer_xyz.base import SawyerXYZEnv, _assert_task_is_set\n\n\nclass SawyerWindowOpenEnv(SawyerXYZEnv):\n\n def __init__(self):\n\n liftThresh = 0.02\n hand_low = (... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.exp",
"numpy.abs",
"numpy.hstack"
]
] |
wx-b/learning-from-human-preferences | [
"a36d19d9e5a1cf77148b9a58e045e917265c73df"
] | [
"drlhp/deprecated/a2c/common/vec_env/subproc_vec_env.py"
] | [
"import numpy as np\nfrom multiprocessing import Process, Pipe\nfrom drlhp.deprecated.a2c.common.vec_env import VecEnv\n\ndef worker(remote, env_fn_wrapper):\n env = env_fn_wrapper.x()\n while True:\n cmd, data = remote.recv()\n if cmd == 'step':\n ob, reward, done, info = env.step(da... | [
[
"numpy.stack"
]
] |
nikicc/anaconda-recipes | [
"9c611a5854bf41bbc5e7ed9853dc71c0851a62ef"
] | [
"numpy-1.12/run_test.py"
] | [
"import os\nimport sys\nimport numpy\n\nassert numpy.__version__ == '1.12.1'\n\nhas_mkl = not int(os.getenv('NOMKL', 0))\nprint('HAS MKL: %r' % has_mkl)\nmkl_version = getattr(numpy, '__mkl_version__', None)\nprint('MKL VERSION: %s' % mkl_version)\nassert has_mkl == bool(mkl_version)\n\nimport numpy.core.multiarray... | [
[
"numpy.test"
]
] |
Fassial/Air-Writing-with-TL | [
"9b9047c5bd5aef3a869e2d5166be1c0cf0c5ccf0"
] | [
"network/PCA.py"
] | [
"import numpy as np\n\nclass PCA:\n\tdef __init__(self, target_dimension = 3):\n\t\tself.target_dimension = target_dimension\n\n\tdef process(self, features):\n\t\tself.features = features\n\t\tdots = self.features\n\n\t\tcov = np.cov(np.matrix(dots).T)\n\n\t\teigenvalue, feature_vector = np.linalg.eig(cov)\n\n\t\t... | [
[
"numpy.matrix",
"numpy.linalg.eig",
"numpy.argsort"
]
] |
kkummer/RixsToolBox | [
"48e220035697c9a85eaa3fe79307593aa5558065"
] | [
"RTB_Math.py"
] | [
"#!/usr/bin/env python\r\n#-*- coding: utf-8 -*-\r\n\r\n#/*##########################################################################\r\n# Copyright (C) 2016 K. Kummer, A. Tamborino, European Synchrotron Radiation \r\n# Facility\r\n#\r\n# This file is part of the ID32 RIXSToolBox developed at the ESRF by the ID32\r... | [
[
"matplotlib.pyplot.errorbar",
"numpy.min",
"numpy.exp",
"numpy.add.reduce",
"numpy.interp",
"numpy.take",
"numpy.polynomial.Polynomial",
"numpy.arange",
"numpy.vstack",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.argsort",
"matplotlib.py... |
FrederikLehn/modpy | [
"19ab18547e06e93fabfbd7f7b2f0f07ff0e70db3"
] | [
"modpy/optimize/tests/test_quadprog.py"
] | [
"import numpy as np\r\nfrom numpy.testing import assert_, assert_raises, assert_array_almost_equal\r\n\r\nfrom modpy.tests.test_util import run_unit_test\r\nfrom modpy.optimize import quadprog\r\n\r\n\r\nclass TestQuadProg:\r\n def test_unconstrained_result(self):\r\n H = np.array([(6., 2., 1.),\r\n ... | [
[
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.eye",
"numpy.testing.assert_array_almost_equal"
]
] |
shnhrtkyk/semantic3dnet | [
"8d093eb8cd1c2b6ac0e6c57c85a33f960bdddb0d"
] | [
"pointnet/model.py"
] | [
"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nimport sys\nimport os\n\nclass ConvBlock(nn.Module):\n def __init__(self, in_channels, out_channels, kernel_size, with_se=False, normalize=True, num_cls=3, num_scale=5):\n super().__init__()\n\n self.num_... | [
[
"torch.nn.Linear",
"torch.rand",
"torch.nn.Dropout",
"torch.nn.Softmax",
"torch.nn.Sequential",
"torch.nn.LeakyReLU",
"torch.nn.MaxPool3d",
"torch.nn.functional.log_softmax",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d",
"numpy.argmax",
"torch.nn.Conv3d",
"torch.flat... |
clairett/fast-bert | [
"506771b930aa70e7ca2852e5e8ebb14656d97bfa"
] | [
"fast_bert/prediction.py"
] | [
"import os\nimport torch\nfrom .data_cls import BertDataBunch\nfrom .data_ner import BertNERDataBunch\nfrom .learner_cls import BertLearner\nfrom .learner_ner import BertNERLearner\n\nfrom transformers import AutoTokenizer\n\nimport warnings\n\nwarnings.filterwarnings(\"ignore\", message=\"numpy.dtype size changed\... | [
[
"torch.device",
"torch.cuda.is_available"
]
] |
uncharted-distil/simon | [
"26e4e54e6de455bde8ee1a24634d060e1ec7babb"
] | [
"Simon/dev/main_transfer_to_datalake_pip.py"
] | [
"import csv\nimport time\nimport os.path\nimport numpy as np\n\nimport azure_utils.client as client\nimport graphutils.getConnection as gc\nfrom FetchLabeledData import *\n\nfrom Simon import *\nfrom Simon.Encoder import *\nfrom Simon.DataGenerator import *\nfrom Simon.LengthStandardizer import *\n\ndef main(checkp... | [
[
"numpy.transpose"
]
] |
de-code/layered-vision | [
"5cb34ed2fb787fb1e3a8dd7ee7f4f932fe81c038"
] | [
"layered_vision/filters/warp_perspective.py"
] | [
"import logging\nfrom typing import NamedTuple\n\nimport numpy as np\nimport cv2\n\nfrom layered_vision.utils.image import ImageArray, get_image_size, has_alpha\nfrom layered_vision.filters.api import AbstractOptionalChannelFilter\nfrom layered_vision.config import LayerConfig\n\n\nLOGGER = logging.getLogger(__name... | [
[
"numpy.allclose",
"numpy.issubdtype",
"numpy.float32",
"numpy.full_like"
]
] |
CasualGANPapers/Make-A-Scene | [
"4457ef91ccf4a345f3178cf821f12b49df616b6d"
] | [
"losses/discriminator.py"
] | [
"\"\"\"\nPatchGAN Discriminator (https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/master/models/networks.py#L538)\n\"\"\"\n\nimport torch.nn as nn\n\n\ndef weights_init(m):\n classname = m.__class__.__name__\n if classname.find('Conv') != -1:\n nn.init.normal_(m.weight.data, 0.0, 0.02)\n ... | [
[
"torch.nn.init.constant_",
"torch.nn.Sequential",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d",
"torch.nn.init.normal_",
"torch.nn.Conv2d"
]
] |
SachsLab/indl | [
"531d2e0c2ee765004aedc553af40e258262f86cb"
] | [
"indl/old_reference/test_kl_passthrough.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport tensorflow.keras.layers as tfkl\nimport tensorflow_probability as tfp\ntfd = tfp.distributions\ntfpl = tfp.layers\n\n\nN_LATENT = 5\nprior = tfd.Independent(tfd.Normal(loc=np.zeros((N_LATENT,), dtype=np.float32),\n scale=np.ones(... | [
[
"numpy.ones",
"numpy.zeros",
"tensorflow.keras.layers.Input",
"tensorflow.keras.layers.Dense"
]
] |
HCIILAB/Scene-Text-Recognition-Recommendations | [
"1a95ea5b48c5f805469053d8515d09eef636c297"
] | [
"Framework/lib/loss/sequenceCrossEntropyLoss.py"
] | [
"from __future__ import absolute_import\n\nimport torch\nfrom torch import nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\n\ndef to_contiguous(tensor):\n if tensor.is_contiguous():\n return tensor\n else:\n return tensor.contiguous()\n\ndef _assert_no_grad(variable):\n assert not ... | [
[
"torch.zeros",
"torch.sum",
"torch.nn.functional.log_softmax"
]
] |
hubert-he/FATE | [
"6758e150bd7ca7d6f788f9a7a8c8aea7e6500363",
"ea1e94b6be50c70c354d1861093187e523af32f2"
] | [
"python/fate_arch/_standalone.py",
"python/federatedml/local_baseline/local_baseline.py"
] | [
"#\n# Copyright 2019 The Eggroll 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# Unles... | [
[
"numpy.random.RandomState"
],
[
"sklearn.linear_model.LogisticRegression",
"numpy.array",
"numpy.zeros"
]
] |
rishabhchhillar/Facial-Keypoints-Detection | [
"c8fb7db7b4743a753e9234e6236bcdd6b0f6de77"
] | [
"models.py"
] | [
"## TODO: define the convolutional neural network architecture\n\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.nn.functional as F\n# can use the below import should you choose to initialize the weights of your Net\nimport torch.nn.init as I\n\nfrom torchvision import models... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d"
]
] |
WeiLi9811/PyABSA | [
"e1595784b8c978c1e91c0d8139a0a4dc36ac5965"
] | [
"pyabsa/core/apc/prediction/sentiment_classifier.py"
] | [
"# -*- coding: utf-8 -*-\n# file: sentiment_classifier.py\n# author: yangheng <yangheng@m.scnu.edu.cn>\n# Copyright (C) 2020. All Rights Reserved.\nimport json\nimport os\nimport pickle\nimport random\n\nimport numpy\nimport torch\nfrom findfile import find_file\nfrom termcolor import colored\nfrom torch.utils.data... | [
[
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.no_grad",
"torch.softmax",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.load"
]
] |
michanN/disaster-response-pipeline | [
"106c7cee2471deaa6efd2209fc85a6b6c093ee89"
] | [
"app/run.py"
] | [
"import json\nimport plotly\nimport pandas as pd\n\nfrom nltk.stem import WordNetLemmatizer\nfrom nltk.tokenize import word_tokenize\n\nfrom flask import Flask\nfrom flask import render_template, request, jsonify\nfrom plotly.graph_objs import Bar\nfrom sklearn.externals import joblib\nfrom sqlalchemy import create... | [
[
"sklearn.externals.joblib.load",
"pandas.read_sql_table"
]
] |
seongkiem/wqu | [
"ecb0a74cb90d4926cb48f56a97b9c412c3581ad8"
] | [
"env/EnvMultipleStock_train.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom gym.utils import seeding\nimport gym\nfrom gym import spaces\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport pickle\n\n# shares normalization factor\n# 100 shares per trade\nHMAX_NORMALIZE = 100\n# initial amount of money we have in o... | [
[
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"numpy.where",
"numpy.argsort"
]
] |
dylanfinkbeiner/disentangled_bert | [
"84c9ef5d2536c9724279f47a4e2b9c09ecd3002c"
] | [
"jiant/preprocess.py"
] | [
"\"\"\"Preprocessing functions and pipeline\n\nThe pipeline is three steps\n 1) create / load tasks, which includes\n a) load raw data\n b) tokenize raw data\n 2) create / load all vocabularies (word, char, task-specific target vocabs)\n a) count tokens of a vocab\n b) take the N m... | [
[
"torch.FloatTensor",
"numpy.random.randn"
]
] |
AnnaMag/Line-simplification | [
"00ef0e368c911f67694fa94c24677ca8747127ea"
] | [
"code/make_plots.py"
] | [
"#! /usr/bin/env python\n\"\"\"\nCreated on Mon Jan 4 2016\nAnna M. Kedzierska\n\"\"\"\nfrom matplotlib import pyplot\nfrom shapely.geometry import LineString\nfrom descartes.patch import PolygonPatch\n\nBLUE = '#6699cc'\nGRAY = '#999999'\n\ndef lines_multiplot(list_in, list_out, out_name):\n line_in = LineStrin... | [
[
"matplotlib.pyplot.figure"
]
] |
Rubtsowa/modin | [
"6550939753c76e896ef2bfd65bb9468d6ad161d7"
] | [
"modin/pandas/test/dataframe/test_join_sort.py"
] | [
"# Licensed to Modin Development Team under one or more contributor license agreements.\n# See the NOTICE file distributed with this work for additional information regarding\n# copyright ownership. The Modin Development Team licenses this file to you under the\n# Apache License, Version 2.0 (the \"License\"); you... | [
[
"matplotlib.use",
"pandas.DataFrame",
"numpy.random.uniform",
"numpy.arange",
"pandas.Series"
]
] |
ugiete/PPD-2021-1 | [
"acf96eb0fac0213b488f2e678122ac2897999446"
] | [
"Trabalho-1.1/src/utils.py"
] | [
"from random import randint\nimport matplotlib.pyplot as plt\n\ndef generate_list(length: int) -> list:\n \"\"\"Generate a list with given length with random integer values in the interval [0, length]\n\n Args:\n length (int): List length\n\n Returns:\n list: List generated with random values... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.bar"
]
] |
sadjadasghari/CIHP_PGN | [
"94e77d8fe87fef6e012810d64ec74083f5c258ea"
] | [
"labelbox_tfrecord.py"
] | [
"import sys\nfrom json import load\nfrom math import floor\nimport os\nfrom PIL import Image\nimport requests\nimport tensorflow as tf\n\n\ndef fail_for_missing_file():\n print('You must provide the path to export.json file.')\n sys.exit(1)\n\n\nif __name__ == '__main__':\n\n if len(sys.argv) < 2:\n ... | [
[
"tensorflow.data.TFRecordDataset",
"tensorflow.FixedLenFeature",
"tensorflow.Session",
"tensorflow.name_scope",
"tensorflow.image.decode_image"
]
] |
DLwbm123/OCMIST | [
"be3c1a61e5c86d25181b214b8e1fde2b2bd8a551"
] | [
"unet3d/prediction.py"
] | [
"import os\n\nimport nibabel as nib\nimport numpy as np\nimport tables\n\nfrom .training import load_old_model\nfrom .utils import pickle_load\nfrom .utils.patches import reconstruct_from_patches, get_patch_from_3d_data, compute_patch_indices\nfrom .augment import permute_data, generate_permutation_keys, reverse_pe... | [
[
"numpy.max",
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.mean",
"numpy.argmax",
"numpy.unique"
]
] |
syheliel/CyberBattleSim-1 | [
"611f0dde9fbfabc411b40a92446c71ff7052480a"
] | [
"cyberbattle/agents/baseline/agent_wrapper.py"
] | [
"# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n\n\"\"\"Agent wrapper for CyberBattle envrionments exposing additional\nfeatures extracted from the environment observations\"\"\"\nimport numpy\n\nfrom cyberbattle._env.cyberbattle_env import EnvironmentBounds\nfrom typing import Optional,... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.random.choice",
"numpy.zeros",
"numpy.minimum",
"numpy.sum",
"numpy.nonzero",
"numpy.shape",
"numpy.unravel_index",
"numpy.where",
"numpy.prod",
"numpy.all",
"numpy.int32",
"numpy.ravel_multi_index"
]
] |
IMPLabUniPr/UniParma-at-semeval-2021-task-5 | [
"0d28ae739c2f3928443d229d25a95fb5af51fda1"
] | [
"bow_model/prepare_data/train.py"
] | [
"import pandas as pd\nfrom ast import literal_eval\nfrom pprint import pprint\nfrom nltk.tokenize import TweetTokenizer\nimport re\n\ntTokenizer = TweetTokenizer()\n\ndef csv_to_df(data):\n\ttrain = pd.read_csv(\"tsd_\" + data + \".csv\")\n\ttrain[\"spans\"] = train.spans.apply(literal_eval)\n\treturn train\n\ndef ... | [
[
"pandas.read_csv"
]
] |
keurfonluu/ToughMeshio | [
"9f374f5c72df4d76bf63ae4f87f2f2d4e52c81e0"
] | [
"toughio/_io/output/tough/_tough.py"
] | [
"from __future__ import with_statement\n\nfrom functools import partial\n\nimport numpy as np\n\nfrom ...._common import get_label_length, open_file\nfrom ..._common import read_record\nfrom .._common import to_output\n\n__all__ = [\n \"read\",\n]\n\n\ndef read(filename, file_type, file_format, labels_order, lab... | [
[
"numpy.array"
]
] |
uiyunkim-private/recommendation-model | [
"11c4ae9be91c04e9f8564f4edab2bd021f364e11"
] | [
"model_trainer/src/main/python/server/app.py"
] | [
"import pandas as pd\nfrom flask import Flask, request, jsonify\nimport json\nimport numpy as np\nfrom src.main.python.feature_extractor.feature_extractor import FeatureExtractor\nfrom src.main.python.model.logistic_regression import LogisticRegressionModel\nfrom src.main.python.utils.aws import build_s3\n\n\ndef m... | [
[
"pandas.DataFrame.from_dict",
"numpy.rot90",
"numpy.array",
"numpy.argmax"
]
] |
pandat8/ML4LocalBranch_extend | [
"2fb38b12556ea5e62a0313f617e98cd163eaaf7f"
] | [
"dataset.py"
] | [
"import torch\nfrom pyscipopt import Model\nfrom torch.utils.data import Dataset\n\nclass InstanceDataset(Dataset):\n def __init__(self, mip_files, sol_files):\n self.mip_files = mip_files\n self.sol_files = sol_files\n\n def __len__(self):\n return len(self.mip_files)\n\n def __getite... | [
[
"torch.is_tensor"
]
] |
UoA-CARES/BuilT | [
"8c4787f8fb0542f92946cabc213c0caaa594bf38"
] | [
"built/trainer_base.py"
] | [
"from built.evaluation_scheduler import EvaluationScheduler\nimport os\nimport math\nimport time\nimport logging\nimport torch\nimport tqdm\nimport numpy as np\nimport wandb\nimport pandas as pd\n\nfrom torch.utils.tensorboard import SummaryWriter\nfrom torch.utils.data import DataLoader\nfrom collections import de... | [
[
"torch.cat",
"torch.cuda.synchronize",
"torch.no_grad",
"numpy.mean",
"torch.cuda.is_available",
"torch.set_grad_enabled"
]
] |
EnzoGolfetti/Projeto_concessao_credito_ML | [
"befb7bb2706a08a65abd95eacab0aef53e50af52"
] | [
"streamlit_files/utils.py"
] | [
"from sklearn.preprocessing import OneHotEncoder\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.base import BaseEstimator, TransformerMixin\nimport pandas as pd\n\n#Replicando a classe Transformer para realizar pré-processamento das infos do cliente\nclass Transformer(BaseEstimator, TransformerMixin)... | [
[
"sklearn.preprocessing.OneHotEncoder",
"sklearn.preprocessing.MinMaxScaler",
"pandas.concat"
]
] |
sauyon/BentoML | [
"ff702f1fc1ee7cc4cf7aab2e67d1e27512858fe4"
] | [
"tests/integration/frameworks/test_tensorflow_v2_impl.py"
] | [
"from typing import Any\nfrom typing import List\nfrom typing import Union\nfrom typing import Callable\nfrom typing import Optional\nfrom typing import TYPE_CHECKING\n\nimport numpy as np\nimport pytest\nimport tensorflow as tf\nimport tensorflow_hub as hub\n\nimport bentoml\nfrom tests.utils.helpers import assert... | [
[
"tensorflow.compat.v1.placeholder",
"tensorflow.TensorSpec",
"numpy.array",
"tensorflow.compat.v1.get_default_graph",
"tensorflow.ragged.constant",
"tensorflow.constant",
"tensorflow.config.list_physical_devices",
"tensorflow.train.Checkpoint"
]
] |
aluo-x/shape2prog | [
"1177e5205b99bb293e353688b564c94a14211c75"
] | [
"synthesize_shapes.py"
] | [
"from __future__ import print_function\n\nimport os\nimport h5py\nimport numpy as np\n\nfrom programs.program_table_1 import generate_batch as table_gen1\nfrom programs.program_table_2 import generate_batch as table_gen2\nfrom programs.program_table_3 import generate_batch as table_gen3\nfrom programs.program_table... | [
[
"numpy.sum",
"numpy.vstack",
"numpy.asarray",
"numpy.zeros"
]
] |
BouchardLab/ReachMaster | [
"074ff58e2bfeddd8141de2eddc4aa11de2e58d7a"
] | [
"software/ReachSplitter/repro_plotting.py"
] | [
"import pandas as pd\nimport pdb\nimport matplotlib.pyplot as plt\nimport cv2\n\n\nclass ReproPlots:\n def __init__(self, reprojection_filename):\n load_reprojections(reprojection_filename)\n return\n\n\ndef load_reprojections(self, reprojection_filename):\n self.reprojections = pd.read_hdf(repr... | [
[
"matplotlib.pyplot.plot",
"pandas.read_hdf",
"matplotlib.pyplot.close"
]
] |
Whoo-jl/Pyramid-Attention-Networks | [
"ec20b3fecf590bebc7188eac03a571e69aa6088f"
] | [
"CAR/code/data/common.py"
] | [
"import random\n\nimport numpy as np\nimport skimage.color as sc\n\nimport torch\n\ndef get_patch(*args, patch_size=96, scale=1, multi=False, input_large=False):\n ih, iw = args[0].shape[:2]\n print('heelo')\n print(args[0].shape)\n\n if not input_large:\n p = 1 if multi else 1\n tp = p * ... | [
[
"numpy.concatenate",
"numpy.expand_dims",
"torch.from_numpy"
]
] |
ishine/DPSL-ASR | [
"fabb66cbd7f24f7a05c64f5b7e87af154f39ceb2"
] | [
"espnet2/enh/espnet_model1.py"
] | [
"from functools import reduce\nfrom itertools import permutations\nfrom typing import Dict\nfrom typing import Optional\nfrom typing import Tuple\nimport logging\nimport torch\nfrom torch_complex.tensor import ComplexTensor\nfrom typeguard import check_argument_types\n\nfrom espnet2.enh.abs_enh import AbsEnhancemen... | [
[
"torch.stack",
"torch.min",
"torch.arange",
"torch.norm",
"torch.pow",
"torch.log10",
"torch.ones",
"torch.tensor",
"torch.sum"
]
] |
pmuilu/ocr_crnn | [
"b1dc549871247324868de2613c030af764be6f83"
] | [
"dataset.py"
] | [
"import os\nimport torch\nimport torchvision\nimport numpy as np\nfrom PIL import Image, ImageOps\nfrom torch.utils.data import Dataset, DataLoader\n\nclass OCRDataset(Dataset):\n def __init__(self, root_dir, transform=None):\n self.root_dir = root_dir\n files = os.listdir(self.root_dir)\n\n ... | [
[
"torch.is_tensor",
"numpy.array",
"numpy.append"
]
] |
LieGroupie/FiberedAE | [
"0796591fc89d9630c64cc29375c35ca24a30d277"
] | [
"fiberedae/utils/persistence.py"
] | [
"import torch\n\ndef save_model(model, optimizers, training_history, meta_data, condition_encoding, model_creation_args, filename):\n optimizers_states = {}\n for name, opt in optimizers.items():\n if opt is None :\n optimizers_states[name] = None \n else :\n optimizers_sta... | [
[
"torch.load"
]
] |
aashish24/ParaViewGeophysics | [
"d9a71ffd21a57fa0eb704c5f6893ec9b1ddf6da6"
] | [
"src/filters/filter_lat_lon_to_cartesian.py"
] | [
"Name = 'LatLonToCartesian'\nLabel = 'Lat Lon To Cartesian'\nFilterCategory = 'CSM Geophysics Filters'\nHelp = 'Help for the Test Filter'\n\nNumberOfInputs = 1\nInputDataType = 'vtkTable'\nOutputDataType = 'vtkTable'\nExtraXml = ''\n\n\nProperties = dict(\n Radius=6371.0,\n lat_i=1,\n lon_i=0,\n)\n\n# TODO... | [
[
"numpy.array",
"numpy.empty"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.