repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
yucoian/OpenQA | [
"3316c1d4e4c57881a32453069d0ea23bf2fe6f5e"
] | [
"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"
]
] |
Himanshirocks/EmbodiedQA | [
"3b93d453f5397108c08b2feeffa9ef21be91fd8d"
] | [
"data/question-gen/engine.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport csv\nimport random\nimport argparse\nimport operator\nimport numpy as np\nimport os, sys, json\... | [
[
"numpy.random.seed",
"numpy.prod"
]
] |
TexTecGo/Student_Api | [
"9d065415f77357be2e2b24b138333ce4c38901cf"
] | [
"func/predict_func.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on 2018/5/20 \n\n@author: susmote\n\"\"\"\nimport urllib\nimport requests\nimport urllib.request\nimport numpy as np\nfrom PIL import Image\nfrom sklearn.externals import joblib\nimport os\n\n\ndef verify(url, model):\n \"\"\"\n :param url: 验证码地址\n :param save: 是否保... | [
[
"sklearn.externals.joblib.load",
"numpy.empty",
"numpy.asarray"
]
] |
ornlneutronimaging/braggedgemodeling | [
"6bf49b008cae5707f3c950e4a4d574211f201976"
] | [
"tests/test_texture_Fe.py"
] | [
"#!/usr/bin/env python\n# Jiao Lin <jiao.lin@gmail.com>\n\ninteractive = False\n\nimport os, numpy as np\nfrom bem import xscalc, diffraction, xtaloriprobmodel as xopm\nfrom bem.matter import bccFe\n\nthisdir = os.path.dirname(__file__)\n\ndef test_bccFe():\n lambdas = np.arange(0.05, 5, 0.01)\n T = 300\n ... | [
[
"numpy.array",
"numpy.isclose",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.arange",
"matplotlib.pyplot.show"
]
] |
breedlun/clearplot | [
"3b2b40e393ca6d0ff66d482e74d936da7bd78a73"
] | [
"doc/source/examples/no_axis_arrows/no_axis_arrows.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Apr 18 15:04:55 2015\n\n@author: Ben\n\"\"\"\nimport clearplot.params\nimport clearplot.plot_functions as pf\nimport numpy as np\n\nclearplot.params.axis_arrow_bool = False\n\nx = np.arange(0,10,0.01)\ny = np.sqrt(x)\n\npf.plot('no_axis_arrows.png', x, y, \\\n x_l... | [
[
"numpy.arange",
"numpy.sqrt"
]
] |
HenryLee97/isl | [
"0eb357bd45c5ce3ab3ef060deb84707975049d37"
] | [
"isl/loss/mlp.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass MLPLossTrainer(nn.Module):\n\n def __init__(self, n_class: int, n_layers: int = 3, hidden_size: int = 20, last_sigmoid: bool = False) -> nn.Module:\n super(MLPLossTrainer, self).__init__()\n\n self.n_class = n_class\n ... | [
[
"torch.nn.Linear",
"torch.sigmoid",
"torch.cat",
"torch.nn.functional.one_hot",
"torch.nn.Sequential",
"torch.nn.ReLU"
]
] |
adidinchuk/tf-neural-net | [
"e81db6fad7c31bf9f4e9981f77953dc2e23ca45a"
] | [
"data.py"
] | [
"'''\nBy adidinchuk. adidinchuk@gmail.com.\nhttps://github.com/adidinchuk/tf-neural-net\n'''\n\nimport hyperparams as hp\nimport numpy as np\n\n\ndef import_data(name, headers=False):\n\n file_name = hp.data_dir + '\\\\' + name\n\n with open(file_name) as fp:\n lines = fp.read().split(\"\\n\")\n\n i... | [
[
"numpy.sum",
"numpy.count_nonzero",
"numpy.transpose",
"numpy.unique"
]
] |
junmeng6025/aima-python | [
"ab2b15388ec69a4508db52c605225f65423b88df"
] | [
"junmeng_gki21csp/utils.py"
] | [
"\"\"\"Provides some utilities widely used by other modules\"\"\"\n\nimport bisect\nimport collections\nimport collections.abc\nimport heapq\nimport operator\nimport os.path\nimport random\nimport math\nimport functools\nfrom statistics import mean\n\nimport numpy as np\nfrom itertools import chain, combinations\n\... | [
[
"numpy.tanh"
]
] |
Wastedzz/deep_gcns_torch | [
"e74e16b98d7b27b585832575453ff9ff1a5d20d4"
] | [
"examples/ogb/ogbg_ppa/main.py"
] | [
"import torch\nfrom torch_geometric.data import DataLoader\nimport torch.optim as optim\nfrom model import DeeperGCN\nfrom tqdm import tqdm\nfrom args import ArgsInit\nfrom utils.ckpt_util import save_ckpt\nfrom utils.data_util import add_zeros, extract_node_feature\nimport logging\nfrom functools import partial\ni... | [
[
"torch.device",
"torch.cat",
"torch.no_grad",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss"
]
] |
Mele-Lab/2020_GenomeBiology_CisTransMPRA | [
"55da814dee39f232b746deb6c8110cd15d77c3dd"
] | [
"analysis/01__mpra/03__activs_general/03__activs_general.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # 03__activs_general\n# \n# in this notebook, i look at activities of TSSs in native contexts (human seqs in hESCs, mouse seqs in mESCs) compared to negative and positive controls. i also look at diffs in activity between tiles\n\n# In[1]:\n\n\nimport warnings\nwarnings.... | [
[
"pandas.isnull",
"pandas.read_table",
"numpy.isnan",
"numpy.asarray",
"numpy.random.seed",
"scipy.stats.spearmanr",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"numpy.log1... |
gxdai/CarND-Semantic-Segmentation | [
"78240ad8cfe45b9e4a4336ee1ad923614ba1f17f"
] | [
"main.py"
] | [
"#!/usr/bin/env python3\nimport os.path\nimport tensorflow as tf\nimport helper\nimport warnings\nfrom distutils.version import LooseVersion\nimport project_tests as tests\n\n\n# Check TensorFlow Version\nassert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You a... | [
[
"tensorflow.Session",
"tensorflow.test.gpu_device_name"
]
] |
ebrahimebrahim/easyreg | [
"f767e68af8c2f230f45ef8a5219db9d8ff2b17f0"
] | [
"easyreg/test_expr.py"
] | [
"from time import time\nfrom .net_utils import get_test_model\nimport os\nimport numpy as np\n\n\ndef test_model(opt,model, dataloaders):\n\n model_path = opt['tsk_set']['path']['model_load_path']\n if isinstance(model_path, list):\n for i, path in enumerate(model_path):\n __test_model(opt,m... | [
[
"numpy.array",
"numpy.zeros"
]
] |
PatrikDurdevic/Deep-Learning | [
"a29e16df1361f045bb0aff6df16d3aa02b7d5877"
] | [
"Tensorflow Basics/Dense_MNIST.py"
] | [
"import tensorflow as tf\nfrom tensorflow import keras\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n(train_images, train_labels), (test_images, test_labels) = tf.keras.datasets.mnist.load_data()\n\ntrain_images = train_images / 255\ntest_images = test_images / 255\n\nmodel = keras.Sequential([\n ker... | [
[
"tensorflow.keras.layers.Dense",
"matplotlib.pyplot.xticks",
"numpy.max",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"numpy.argmax",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplot",
"tensorflow.keras.datasets.mnist.load_data",
"matplotlib.pyplot.titl... |
YuTingLiu/EfficientDet-TOD | [
"598c2700d761180f19bb87ea807e32fbf16e74fa"
] | [
"inference_quad.py"
] | [
"from model import efficientdet\nimport cv2\nimport os\nimport numpy as np\nimport time\nfrom utils import preprocess_image\nfrom utils.anchors import anchors_for_shape, AnchorParameters\nimport os.path as osp\n\nos.environ['CUDA_VISIBLE_DEVICES'] = '0'\n\nphi = 1\nweighted_bifpn = False\nmodel_path = 'checkpoints/... | [
[
"numpy.zeros",
"numpy.exp",
"numpy.where",
"numpy.random.randint",
"numpy.clip",
"numpy.expand_dims"
]
] |
bdforbes/pandas | [
"aefae55e1960a718561ae0369e83605e3038f292"
] | [
"pandas/tests/scalar/test_nat.py"
] | [
"from datetime import datetime, timedelta\nimport operator\n\nimport numpy as np\nimport pytest\nimport pytz\n\nfrom pandas._libs.tslibs import iNaT\nimport pandas.compat as compat\n\nfrom pandas.core.dtypes.common import is_datetime64_any_dtype\n\nfrom pandas import (\n DatetimeIndex,\n Index,\n NaT,\n ... | [
[
"pandas.offsets.YearEnd",
"pandas.DatetimeIndex",
"pandas.offsets.Day",
"pandas.offsets.Minute",
"pandas.core.dtypes.common.is_datetime64_any_dtype",
"pandas.NaT.to_datetime64",
"pandas.Timestamp",
"numpy.empty",
"pandas.Timedelta",
"pandas._testing.round_trip_pickle",
... |
tobiasraabe/respy_for_ma | [
"405f40851b176705fe924220fba606263d47f3d6"
] | [
"development/modules/auxiliary_shared.py"
] | [
"import argparse\nimport os\nimport random\nimport socket\nimport string\nimport subprocess\nimport sys\nfrom pathlib import Path\nfrom string import Formatter\n\nimport numpy as np\n\nfrom development.modules.clsMail import MailCls\nfrom development.modules.config import PACKAGE_DIR\n\n\ndef update_class_instance(... | [
[
"numpy.array"
]
] |
LSSTDESC/qp | [
"00ce24c749ca1ae1adfa124c31642ba5f6c36a12"
] | [
"tests/test_utils.py"
] | [
"\"\"\"\nUnit tests for PDF class\n\"\"\"\nimport numpy as np\nimport unittest\nimport qp\n\nfrom qp import test_data\n\nclass UtilsTestCase(unittest.TestCase):\n \"\"\" Test the utility functions \"\"\"\n\n def setUp(self):\n \"\"\"\n Make any objects that are used in multiple tests.\n \... | [
[
"numpy.ones",
"numpy.exp",
"numpy.allclose",
"numpy.random.uniform",
"numpy.sqrt",
"numpy.linspace",
"numpy.squeeze",
"numpy.expand_dims"
]
] |
naigamshah/NBEATS | [
"7a85b36256f46ac39ba252c70b4ed2783531d75c"
] | [
"examples/trainer_pytorch.py"
] | [
"import os\nfrom argparse import ArgumentParser\n\nimport matplotlib.pyplot as plt\nimport torch\nfrom data import get_m4_data, dummy_data_generator\nfrom torch import optim\nfrom torch.nn import functional as F\n\nfrom nbeats_pytorch.model import NBeatsNet\n\nCHECKPOINT_NAME = 'nbeats-training-checkpoint.th'\n\n\n... | [
[
"torch.device",
"matplotlib.pyplot.savefig",
"torch.no_grad",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"torch.tensor",
"torch.load",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplot"
]
] |
LSDOlab/csdl | [
"04c2c5764f6ca9b865ec87ecfeaf6f22ecacc5a3"
] | [
"csdl/examples/valid/ex_bracketed_search_bracketed_array_define_model_inline.py"
] | [
"def example(Simulator):\n from csdl import Model, ScipyKrylov, NewtonSolver, NonlinearBlockGS\n import numpy as np\n from csdl.examples.models.quadratic_function import QuadraticFunction\n from csdl.examples.models.quadratic_function import QuadraticFunction\n from csdl.examples.models.quadratic_wih... | [
[
"numpy.array"
]
] |
zejiangp/EBERT | [
"07489e5e95d0a7bbd05314333b6b368697df71cd"
] | [
"custom_utils/cutils.py"
] | [
"import torch\nimport numpy as np\n\ndef single_head_flops(length, config, ratio):\n L = length\n d = config.hidden_size\n # q, k, v: (L x d) (d x 64) -> (L x 64)\n flops_qkv = (L * 64 * d * 2) * 3\n # attn: (L x 64) (64 x L) -> (L x L)\n flops_attn = L * L * 64 * 2\n # attn * v: (L x L) (L x 6... | [
[
"numpy.sum"
]
] |
constantinpape/ome-ngff-implementations | [
"67b4e0f3cc7cc0f0c62aa8f9fbba1072d0f54b37"
] | [
"single_image/package_example_data.py"
] | [
"import json\nimport os\n\nimport imageio\nimport h5py\nimport numpy as np\nimport zarr\n\n\n# collect the example data from the kreshuk lab and convert it to tifs\n# to collect all example data in the same format and prepare for packaging it\ndef package_examples():\n os.makedirs(\"./example_data\", exist_ok=Tr... | [
[
"numpy.concatenate"
]
] |
microopus/cvat | [
"77264252c0f37c681dbbddc1a6877961f8f99930"
] | [
"cvat/apps/engine/media_extractors.py"
] | [
"# Copyright (C) 2019-2020 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\nimport os\nimport tempfile\nimport shutil\nimport zipfile\nimport io\nimport itertools\nimport struct\nimport re\nfrom abc import ABC, abstractmethod\n\nimport av\nimport numpy as np\nfrom pyunpack import Archive\nfrom PIL import Ima... | [
[
"numpy.array",
"numpy.asarray"
]
] |
rickdr/Data-analysis-DNN-testing | [
"a6b049ba218843c3ea9edf318f13a6f192b7a440"
] | [
".history/project/data_coverage/coverage_methods_20220218003450.py"
] | [
"import torch\nfrom matplotlib import pyplot as plt\nimport numpy as np\n\nfrom sklearn.multiclass import OneVsOneClassifier\nfrom sklearn.svm import SVC\nfrom sklearn.metrics import accuracy_score\n\ndef num_per_target(targets):\n target_count = {}\n for target in targets:\n for key in target:\n ... | [
[
"torch.linalg.norm",
"torch.stack"
]
] |
pdx-cs-sound/harmony | [
"435cdabd85139317cd0e8bce7a25904a3257d30b"
] | [
"harmony.py"
] | [
"#!/usr/bin/python3\n# Copyright © 2019 Bart Massey\n# [This program is licensed under the \"MIT License\"]\n# Please see the file LICENSE in the source\n# distribution of this software for license terms.\n\n\nimport numpy as np\nimport resamp\nimport wavio\n\n# Combine a sample with a copy shifted up a third and a... | [
[
"numpy.array",
"numpy.fft.rfft",
"numpy.dot",
"numpy.fft.rfftfreq",
"numpy.hamming",
"numpy.argmax",
"numpy.abs"
]
] |
ryujaehun/chameleon | [
"e9f480ece508e05eae7698d621aa7bfd2dc63221"
] | [
"optimization_tvm/tune_relay_cuda.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.random.uniform"
]
] |
mnpinto/FWIe | [
"b131cc19af8810df4f8170eb97f95bf40511f1d6"
] | [
"fwie/core.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified).\n\n__all__ = ['chi', 'time_from_wrf', 'coords_from_wrf', 'chi_from_wrf', 'wrf2msg']\n\n# Cell\nimport numpy as np\nfrom pathlib import Path\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom netCDF4 import Dataset\nimp... | [
[
"numpy.zeros_like",
"numpy.nanmean"
]
] |
achawkins/Forsteri | [
"882d684d22d1f1d23ab03fde0b513ec95ac78251"
] | [
"forsteri/process/model.py"
] | [
"#!/usr/bin/python\n\n\"\"\"\nGraphical User Interface\n\nCopyright (c) 2014, 2015 Andrew Hawkins\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without l... | [
[
"numpy.array",
"numpy.dot",
"numpy.isnan",
"numpy.ones",
"numpy.shape",
"numpy.column_stack"
]
] |
neviim/sklearn | [
"fa1e7d9afedcfcba2c0d21573c72b2b8933c0abd"
] | [
"src/smv_working_file.py"
] | [
"'''\n Neste tutorial em python de aprendizado de máquina, apresentarei as Máquinas de \n vetores de suporte. Isso é usado principalmente para classificação e é capaz de \n executar a classificação para dados dimensionais grandes. Também mostrarei como \n carregar conjuntos de dados diretamente do módul... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.metrics.accuracy_score",
"sklearn.datasets.load_breast_cancer"
]
] |
renier/qiskit-nature | [
"a06f378a219d650d96e16db96d763ea4aec9cfc2"
] | [
"qiskit_nature/properties/second_quantization/electronic/integrals/two_body_electronic_integrals.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or ... | [
[
"numpy.abs",
"numpy.einsum",
"numpy.kron",
"numpy.zeros"
]
] |
julien-c/gradio | [
"5eaa4b1e8b8971d1973b596b3d53aaa99739a07c"
] | [
"demo/main_note.py"
] | [
"# Demo: (Audio) -> (Label)\n\nimport gradio as gr\nimport numpy as np\nfrom scipy.fftpack import fft\nimport matplotlib.pyplot as plt\nfrom math import log2, pow\n\nA4 = 440\nC0 = A4*pow(2, -4.75)\nname = [\"C\", \"C#\", \"D\", \"D#\", \"E\", \"F\", \"F#\", \"G\", \"G#\", \"A\", \"A#\", \"B\"]\n \ndef get_pitch... | [
[
"numpy.sum",
"numpy.linspace",
"scipy.fftpack.fft",
"numpy.abs"
]
] |
zhyhan/AD3DMIL | [
"33abbf6810dce79cfedd18650e0e6e7b6d2e7122"
] | [
"model/model_resnet_i3d.py"
] | [
"#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n# vim:fenc=utf-8\n#\n# Copyright © 2019-12-04 19:25 qiang.zhou <theodoruszq@gmail.com>\n#\n# Distributed under terms of the MIT license.\n\n\"\"\" ResNet only. \"\"\"\n\nimport torch\nimport torch.nn as nn\nfrom model.stem_helper import VideoModelStem\nfrom model.re... | [
[
"torch.nn.MaxPool3d",
"torch.FloatTensor"
]
] |
msoeken/aqua | [
"af6a459621bcee90ed832a644ef9220644b84b03"
] | [
"qiskit_aqua/translators/ising/tsp.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright 2018 IBM.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli... | [
[
"numpy.zeros",
"numpy.random.seed",
"numpy.random.uniform",
"numpy.hypot",
"numpy.abs",
"numpy.log2"
]
] |
PVirie/aknowthai | [
"922ab4a7a5c799e67073d36a5366daac76beda43"
] | [
"src/util.py"
] | [
"import numpy as np\nimport math\nfrom PIL import Image\nimport matplotlib.pyplot as plt\n\n\"\"\"We use PIL for representing images.\"\"\"\n\n\ndef image_to_numpy(img):\n return np.array(img) / 255.0\n\n\ndef rgb2gray(rgb):\n return np.dot(rgb[..., :3], [0.299, 0.587, 0.114])\n\n\ndef image_to_FC1(img):\n ... | [
[
"matplotlib.pyplot.ion",
"numpy.dot",
"numpy.savetxt",
"numpy.array",
"numpy.uint8",
"numpy.transpose",
"matplotlib.pyplot.show",
"numpy.expand_dims"
]
] |
PredOptwithSoftConstraint/PredOptwithSoftConstraint | [
"c0ec41a8c2c48034851cf04cd848013ceba1dd40"
] | [
"resource_provisioning/calc.py"
] | [
"import numpy as np\nfrom config import *\nimport gurobipy\nfrom scipy.optimize import minimize, LinearConstraint\nfrom util import *\nfrom torch.optim import SGD\nfrom torch.autograd import Variable\nimport gurobipy as gp\nfrom gurobipy import GRB\nimport torch.nn as nn\nimport cvxpy as cp\nfrom cvxpylayers.torch ... | [
[
"numpy.zeros_like",
"numpy.zeros"
]
] |
KingShark1/pytorch_RVAE | [
"953b458bca0fe608bccebf5dba6655f37cbdbeba"
] | [
"train.py"
] | [
"import argparse\nimport os\n\nimport numpy as np\nimport torch as t\nfrom torch.optim import Adam\n\nfrom utils.batch_loader import BatchLoader\nfrom utils.parameters import Parameters\nfrom model.rvae import RVAE\n\nif __name__ == \"__main__\":\n\n if not os.path.exists('data/word_embeddings.npy'):\n ra... | [
[
"numpy.random.normal",
"numpy.array",
"torch.load"
]
] |
corbt/city-weather | [
"e188e2655d3e641ec9551af2ec799f47f25fab50"
] | [
"cluster.py"
] | [
"import numpy as np\nimport pandas as pd\nimport re\nfrom sklearn.cluster import MiniBatchKMeans\n\ndef reverse_south(dataset):\n # The following code reverses the year for the southern hemisphere.\n # This allows northern and southern climates to be compared\n cols = dataset.columns\n first_months = [c... | [
[
"pandas.read_csv",
"sklearn.cluster.MiniBatchKMeans"
]
] |
LuyaoXu/text | [
"1a054e2b2babeb7d95c2eb463dbc2db221a21f16"
] | [
"tensorflow_text/python/ops/wordpiece_tokenizer.py"
] | [
"# coding=utf-8\n# Copyright 2020 TF.Text 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 appl... | [
[
"tensorflow.python.compat.compat.forward_compatible",
"tensorflow.python.ops.ragged.ragged_tensor.is_ragged",
"tensorflow.python.eager.monitoring.Counter",
"tensorflow.python.ops.ragged.ragged_tensor.convert_to_tensor_or_ragged_tensor",
"tensorflow.python.ops.array_ops.stack",
"tensorflow.... |
fishmingyu/cogdl | [
"f6f33c666feb874f13eb43a8adc5db7c918778ec",
"f6f33c666feb874f13eb43a8adc5db7c918778ec"
] | [
"examples/custom_dataset.py",
"cogdl/datasets/han_data.py"
] | [
"import torch\n\nfrom cogdl.experiments import experiment\nfrom cogdl.data import Graph\nfrom cogdl.datasets import NodeDataset, generate_random_graph\n\n\nclass MyNodeClassificationDataset(NodeDataset):\n def __init__(self, path=\"data.pt\"):\n super(MyNodeClassificationDataset, self).__init__(path)\n\n ... | [
[
"torch.zeros",
"torch.randint",
"torch.randn"
],
[
"numpy.array",
"torch.cat",
"numpy.zeros",
"torch.max",
"torch.arange",
"torch.save",
"torch.from_numpy",
"torch.ones",
"numpy.eye",
"numpy.argmax",
"torch.load"
]
] |
honeypotz-eu/cortex | [
"7c2b5b07f9dbf9bf56def8a6e3a60763e271bd39"
] | [
"examples/pytorch/iris-classifier/model.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.19.*, run `git checkout -b 0.19` or switch to the `0.19` branch on GitHub)\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import V... | [
[
"torch.nn.Linear",
"torch.nn.Softmax",
"torch.max",
"sklearn.metrics.accuracy_score",
"sklearn.model_selection.train_test_split",
"torch.Tensor",
"torch.nn.CrossEntropyLoss",
"sklearn.datasets.load_iris"
]
] |
winnerineast/morph-net | [
"620eeb07f47ea1d40c105a96d5fea639d329c6ff"
] | [
"morph_net/framework/conv_source_op_handler_test.py"
] | [
"\"\"\"Tests for regularizers.framework.conv_source_op_handler.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom absl.testing import parameterized\n\nimport mock\nfrom morph_net.framework import conv_source_op_handler\nfrom morph_net.frame... | [
[
"tensorflow.zeros",
"tensorflow.test.main",
"tensorflow.get_default_graph"
]
] |
doublechenching/hpi | [
"68675bbd06497e41593526d7d4f58001d758c29d"
] | [
"hpi_keras/train_inception_resnet.py"
] | [
"#encoding: utf-8\nfrom __future__ import print_function\nfrom keras import backend as K\nfrom config import config as cfg\nfrom training import init_env, get_number_of_steps\ngpus = '0'\ninit_env(gpus)\nn_gpus = len(gpus.split(','))\ncfg.batch_size = cfg.batch_size * n_gpus\nimport os\nimport numpy as np\nfrom pro... | [
[
"numpy.random.seed",
"tensorflow.set_random_seed",
"tensorflow.device"
]
] |
wuhaoqiu/engr597-stable | [
"284ab9efae8361c139d330313abb831bfea9e5b9"
] | [
"mysite/mlmodels/chatbot/model_chatbot.py"
] | [
"#author:Haoqiu Wu Time 19.3.11\nimport pickle\nimport os\n\n\nfile_qrDict = 'qrDict.pk'\nfile_sentenceTokens = 'sentenceTokens.pk'\nfile_ql = 'ql.pk'\n\n# read local serialized clean dataset\nwith open(os.path.join(os.path.dirname(__file__), '../picklized_files/'+file_qrDict) ,'rb') as f:\n qrDict = pickle.load... | [
[
"numpy.argmax",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.metrics.pairwise.cosine_similarity"
]
] |
Johnathan-Xie/CenterTrack | [
"273e4090239a53fedee49da6d3e33c3c82c517d1"
] | [
"src/tools/convert_nuScenes.py"
] | [
"# Copyright (c) Xingyi Zhou. All Rights Reserved\n'''\nnuScenes pre-processing script.\nThis file convert the nuScenes annotation into COCO format.\n'''\nimport json\nimport numpy as np\nfrom tqdm import tqdm\nimport os\nimport cv2\nimport copy\nimport matplotlib.pyplot as plt\nfrom nuscenes.nuscenes import NuScen... | [
[
"numpy.array",
"numpy.dot",
"numpy.eye",
"numpy.arctan2",
"matplotlib.pyplot.show",
"numpy.linalg.inv"
]
] |
taroogura/Person_reID_baseline_pytorch | [
"45db6f990aad49fc218089f59500364b83cd3f79"
] | [
"demo.py"
] | [
"import argparse\nimport scipy.io\nimport torch\nimport numpy as np\nimport os\nfrom torchvision import datasets\nimport matplotlib\nmatplotlib.use('agg')\nimport matplotlib.pyplot as plt\nimport subprocess\n#######################################################################\n# Evaluate\nparser = argparse.Argum... | [
[
"matplotlib.use",
"numpy.append",
"matplotlib.pyplot.subplot",
"torch.FloatTensor",
"matplotlib.pyplot.title",
"torch.mm",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.pause",
"numpy.argsort",
"numpy.argwhere",
"numpy.intersect1d",
"numpy.in1d",
"matplotlib.py... |
Timothy102/Brain-FMRI | [
"25ae74d4537c698930db455ccf494454f7f3d542"
] | [
"visualize.py"
] | [
"import torch\nimport os\nimport sys\nimport cv2\nimport shutil\nimport matplotlib.pyplot as plt\n\nfrom torch.cuda import init\n\nfrom Code.utils.initialize import initfolder \nfrom Code.utils.data_loader import transformation\n\n\ndef parseArguments():\n parser = argparse.ArgumentParser()\n parser.add_argum... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"torch.load"
]
] |
heholek/librephotos | [
"4f41a61d9685a3165c857b695a2440895d8746dd"
] | [
"api/places365/places365.py"
] | [
"# PlacesCNN to predict the scene category, attribute, and class activation map in a single pass\n# by Bolei Zhou, sep 2, 2017\n# last modified date: Dec. 27, 2017, migrating everything to python36 and latest pytorch and torchvision\nimport os\n\nimport numpy as np\nimport torch\nfrom PIL import Image\nfrom torch.a... | [
[
"numpy.array",
"torch.nn.functional.softmax",
"numpy.load",
"numpy.mean",
"numpy.argsort",
"torch.load"
]
] |
tomash1234/robot-arm-filler | [
"ebce0d7a89c2512d3672522227c53d1a7ef6f74d"
] | [
"python/arm_controller.py"
] | [
"\"\"\"\nArm Controller Module\n\n This module contains classes to communication with the board and basic inverse kinematics.\n\n https://github.com/tomash1234/robot-arm-filler\n\"\"\"\n\nimport socket\nimport numpy as np\n\nfrom kinematics import Kinematics\n\n\"\"\" Servo motors indexes \"\"\"\nSERVO_BASE =... | [
[
"numpy.array",
"numpy.arccos",
"numpy.linalg.norm",
"numpy.dot",
"numpy.rad2deg",
"numpy.arctan2",
"numpy.sqrt",
"numpy.abs",
"numpy.deg2rad"
]
] |
Grayson-Orr/grade-pdf-generator | [
"17279281a70c015fd4e7950741495b415883174c"
] | [
"graphs/checkpoint_graph.py"
] | [
"import sys\nimport json\nimport matplotlib.pyplot as plt\n\n\ndef label(bar):\n for b in bar:\n height = b.get_height()\n plt.text(b.get_x() + b.get_width() / 2, height,\n height, ha='center', va='bottom')\n\n\njson_input = sys.argv[1]\nstdnt_cp_total = []\ntitle = {'prog-four-grad... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xticks"
]
] |
AlanJie/Spders | [
"f1324a948b4753dfdc2d69acc49639373b36852d"
] | [
"apple/visualize.py"
] | [
"import jieba\nfrom PIL import Image\nimport numpy as np\nfrom wordcloud import WordCloud\nimport matplotlib.pyplot as plt\n\nMASK_IMG = 'apple.jpg'\nFONT_PATH = 'font/simsun.ttc'\nFILE_PATH = 'comments.txt'\n\ndef cut_word():\n with open(FILE_PATH, encoding='utf8') as f:\n comments = f.read()\n wo... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
luoxier/CycleGAN_Tensorlayer | [
"38faad7ea1e0657e2570caa1d928d71182521535"
] | [
"main.py"
] | [
"import os\nimport pprint\nimport numpy as np\nimport tensorflow as tf\nimport tensorlayer as tl\nfrom tensorlayer.layers import *\nfrom tensorlayer.prepro import *\nfrom random import shuffle\n# from model_upsampling import *\nfrom model_deconv import *\n\nimport argparse\nfrom collections import namedtuple\n\npp ... | [
[
"tensorflow.abs",
"tensorflow.train.AdamOptimizer",
"numpy.asarray",
"tensorflow.assign",
"tensorflow.Session",
"tensorflow.Variable",
"tensorflow.ones_like",
"tensorflow.ConfigProto",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"numpy.sqrt",
"tensorflow.... |
NovaSBE-DSKC/predict-campaing-sucess-rate | [
"fec339aee7c883f55d64130eb69e490f765ee27d"
] | [
"src/data_curation/pre_processing/country.py"
] | [
"import pycountry\nimport numpy as np\nimport pandas as pd\nimport json\nimport settings\n\nfrom dskc import dskc_clean\n\ndef reduce_cardinality(data, colname, percentile):\n series = pd.value_counts(data[colname])\n mask = (series/series.sum() * 100).lt(percentile)\n\n return np.where(data[colname].isin(... | [
[
"pandas.value_counts"
]
] |
MrXJC/deepspeech.pytorch | [
"6379c18d3f56cad8896a51d45166ea979423e0bf"
] | [
"data/Chinese/primewords_md_2018_set1.py"
] | [
"# -*- coding: utf-8 -*-\nimport argparse\nimport os\nimport io\nimport shutil\nimport tarfile\nimport wget\nimport pandas as pd\nfrom pypinyin import pinyin, lazy_pinyin, Style\nimport subprocess\nimport json\nDATA = 'primewords_md_2018_set1'\nDATA_URL = ''\nDATA_TGZ = DATA + '.tar.gz'\nMANIFESTS = 'manifests'\nDA... | [
[
"pandas.DataFrame"
]
] |
HalforcNull/Research_PatternRecognition | [
"e9cbe8df75ae775e0ed813ac4956973b4e857979"
] | [
"Code/human_cellline_ExcludeOne_NormalizedTraining.py"
] | [
"from os import listdir\nfrom os.path import isfile, isdir, join\nfrom sklearn.naive_bayes import GaussianNB\n\nimport csv\nimport datetime\nimport numpy as np\nimport pickle\n\ndataFolder = '/home/yaor/research/human_matrix_cell_line/'\nmodelFolder = '/home/yaor/research/models_human_matrix_cell_line/'\n\ndef norm... | [
[
"numpy.sum",
"numpy.array",
"numpy.apply_along_axis",
"sklearn.naive_bayes.GaussianNB"
]
] |
Milton-Hu/Human-Pose-Estimation-and-Evaluation-for-Rehabilitation | [
"d559ac1a43041e4dc6bf9452d47860c1afe0ce56"
] | [
"datasets/coco.py"
] | [
"import copy\nimport json\nimport math\nimport os\nimport pickle\n\nimport cv2\nimport numpy as np\nimport pycocotools\n\nfrom torch.utils.data.dataset import Dataset\n\n# BODY_PARTS_KPT_IDS = [[1, 8], [8, 9], [9, 10], [1, 11], [11, 12], [12, 13], [1, 2], [2, 3], [3, 4], [2, 16],\n# [1, 5], [5... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
wxmgcs/learn_computer_vision | [
"311df17a127a2388c9384202e420ea822b07bf63",
"311df17a127a2388c9384202e420ea822b07bf63"
] | [
"ps/test23.py",
"chapter4/segmentation.py"
] | [
"# (1)、nRGB = RGB + (RGB - Threshold) * Contrast / 255\n# 公式中,nRGB表示图像像素新的R、G、B分量,RGB表示图像像素R、G、B分量,\n# Threshold为给定的阈值,Contrast为处理过的对比度增量。\n# Photoshop对于对比度增量,是按给定值的正负分别处理的:\n# 当增量等于-255时,是图像对比度的下端极限,\n# 此时,图像RGB各分量都等于阈值,图像呈全灰色,灰度图上只有1条线,即阈值灰度;\nimport matplotlib.pyplot as plt\nfrom skimage import io\n\n\nfile_name... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure"
],
[
"matplotlib.pyplot.colorbar",
"numpy.zeros",
"numpy.where",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow"
]
] |
KonstantinKlepikov/Hands-On-Genetic-Algorithms-with-Python | [
"ee5e7c5f8274a7ce22c3b528f86fa2bb1695e686"
] | [
"Chapter11/01-reconstruct-with-polygons.py"
] | [
"from deap import base\nfrom deap import creator\nfrom deap import tools\n\nimport random\nimport numpy\nimport os\n\nimport image_test\nimport elitism_callback\n\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n# problem related constants\nPOLYGON_SIZE = 3\nNUM_OF_POLYGONS = 100\n\n# calculate total numb... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel"
]
] |
IbrahimBRammaha/cudf | [
"57ddd5ed0cd7a24500adfc208a08075843f70979"
] | [
"python/cudf/cudf/tests/test_scan.py"
] | [
"from itertools import product\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom cudf.core.dataframe import DataFrame, Series\nfrom cudf.tests.utils import assert_eq, gen_rand\n\nparams_dtype = [np.int8, np.int16, np.int32, np.int64, np.float32, np.float64]\n\nparams_sizes = [0, 1, 2, 5]\n\n\ndef _g... | [
[
"pandas.DataFrame",
"pandas.Series"
]
] |
hannesbend/Coloring.AI-breathingAIwebdemo | [
"aa6824e3ed6af72eaae3c090921fd53d166f5fc4"
] | [
"serverMediaPulse.py"
] | [
"from socket import socket, AF_INET, SOCK_STREAM\nfrom threading import Thread\nimport numpy as np\nimport zlib\nimport struct\nimport cv2\nfrom detector.processor import getCustomPulseApp\n\nHOST = input(\"Enter Host IP\\n\")\nPORT_VIDEO = 3000\nPORT_AUDIO = 4000\nlnF = 640*480*3\nCHUNK = 1024\nBufferSize = 4096\n... | [
[
"numpy.array"
]
] |
xiaoxstz/PyOpenGL-Tutorial | [
"f3f023fd20cbe6bda49a76ff66b5d5cefd8d5280"
] | [
"Tut 01 Hello Triangle/tut1.py"
] | [
"# Mario Rosasco, 2016\r\n# adapted from tut1.cpp, Copyright (C) 2010-2012 by Jason L. McKesson\r\n# This file is licensed under the MIT License.\r\n\r\nfrom OpenGL.GLUT import *\r\nfrom OpenGL.GLU import *\r\nfrom OpenGL.GL import *\r\nfrom array import array\r\nimport numpy as np\r\nfrom framework import *\r\n\r\... | [
[
"numpy.array"
]
] |
fernandezcuesta/pySMSCMon | [
"625bbd967625992386befeb274a9506b0fe5bea1"
] | [
"test/unit_tests/test_genreport.py"
] | [
"#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\n*t4mon* - T4 monitoring **test functions** for gen_report.py\n\"\"\"\nfrom __future__ import absolute_import\n\nimport base64\nimport imghdr\nimport tempfile\n\nimport six\n\nimport pandas as pd\nfrom t4mon.gen_report import Report, gen_report\n\nfrom . impo... | [
[
"pandas.DataFrame"
]
] |
Robin-WZQ/NER-in-PKU-corpus | [
"4cb595e5031ca58af001cf1e5a1533ed6f53d9fa"
] | [
"train_val_test.py"
] | [
"import torch\r\nfrom sklearn.metrics import f1_score, precision_score, recall_score\r\nimport warnings\r\nwarnings.filterwarnings(\"ignore\")\r\nfrom tensorboardX import SummaryWriter\r\n\r\n\r\ndef train(device,train_iter,optimizor,criterion,n_epoches,batch_size,net,val_iter):\r\n '''\r\n 训练函数\r\n '''\r\... | [
[
"sklearn.metrics.precision_score",
"sklearn.metrics.f1_score",
"sklearn.metrics.recall_score"
]
] |
physimals/vaby_models_cvr | [
"798d347653fa31b1de8072674ddbc2dbafea8ad7"
] | [
"examples/glm_example.py"
] | [
"import sys\nimport os\n\nfrom vaby.data import DataModel\nfrom vaby.utils import setup_logging\nfrom vaby_models_cvr import CvrPetCo2Model\n\nimport numpy as np\npco2 = np.loadtxt(\"pco2.txt\")\n\noptions = {\n \"regressors\" : pco2,\n \"tr\" : 0.8,\n \"save_mean\" : True,\n #\"save_free_energy_history... | [
[
"numpy.loadtxt"
]
] |
clarkandrew/jesse | [
"527952a74bc76f76cf3a2d25755386f8db285885"
] | [
"jesse/utils.py"
] | [
"import math\nfrom decimal import Decimal\nfrom typing import Union\n\nimport numpy as np\nimport pandas as pd\n\nimport jesse.helpers as jh\nfrom jesse.enums import timeframes\n\n\ndef anchor_timeframe(timeframe: str) -> str:\n \"\"\"\n Returns the anchor timeframe. Useful for writing\n dynamic strategies... | [
[
"pandas.to_datetime",
"numpy.logical_or",
"numpy.delete",
"numpy.array",
"numpy.full",
"numpy.logical_and",
"numpy.diff",
"numpy.mean",
"numpy.std",
"numpy.where",
"numpy.clip",
"numpy.all"
]
] |
Teppei-Kanayama/myChainer | [
"6ffbfd8479768ca8b580c98788c5b1ba1fd3aee8"
] | [
"tests/chainer_tests/functions_tests/math_tests/test_maximum.py"
] | [
"import unittest\n\nimport chainer\nimport numpy\n\nfrom chainer import cuda\nfrom chainer import functions\nfrom chainer import gradient_check\nfrom chainer import testing\nfrom chainer.testing import attr\nfrom chainer.testing import condition\nfrom chainer.utils import type_check\n\n\n@testing.parameterize(*test... | [
[
"numpy.ndindex",
"numpy.random.uniform",
"numpy.maximum"
]
] |
franzmueller/wradlib | [
"6680d357dd6b19511f687727020fc37bc47c968d"
] | [
"wradlib/georef/polar.py"
] | [
"#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n# Copyright (c) 2011-2020, wradlib developers.\n# Distributed under the MIT License. See LICENSE.txt for more info.\n\n\"\"\"\nPolar Grid Functions\n^^^^^^^^^^^^^^^^^^^^\n\n.. autosummary::\n :nosignatures:\n :toctree: generated/\n\n {}\n\"\"\"\n__all__ = [\n ... | [
[
"numpy.tile",
"numpy.where",
"numpy.radians",
"numpy.sort",
"numpy.broadcast_to",
"numpy.max",
"numpy.empty",
"numpy.interp",
"numpy.logical_and",
"numpy.arange",
"numpy.append",
"numpy.array",
"numpy.zeros",
"numpy.roll",
"numpy.stack",
"numpy.inter... |
JanWeldert/freeDOM | [
"242fc7e76943bb47f2d7cca3f56f77606f260e40"
] | [
"freedom/reco/postfit.py"
] | [
"\"\"\"\nProvides \"postfit\" functions. Postfits analyze the minimizer samples\nto provide alternative parameter estimates and uncertainty estimates\n\"\"\"\n\n__author__ = \"Aaron Fienberg\"\n\nimport numpy as np\nfrom numpy.polynomial import polynomial as poly, Polynomial\nfrom scipy.spatial import ConvexHull\nf... | [
[
"numpy.sin",
"numpy.arccos",
"numpy.asarray",
"numpy.argmin",
"numpy.polynomial.polynomial.polyfit",
"numpy.copy",
"numpy.std",
"numpy.any",
"numpy.stack",
"numpy.polynomial.Polynomial",
"numpy.arctan2",
"numpy.sqrt",
"numpy.abs",
"numpy.average",
"numpy... |
Michaeldbydbcl/deepxde | [
"e55bcbbf9d95964cfc766885da382d9821f169c9"
] | [
"examples/mf_L2H_Ex2/GP_mf_L2H_Ex2.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport GPy\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport emukit.multi_fidelity\nimport emukit.test_functions\nfrom emukit.model_wrappers.gpy_model_wrappers import GPyMultiOutputWrapper\n... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"numpy.sqrt",
"matplotlib.pyplot.scatter"
]
] |
syakhmi/cs236-proj | [
"086bcec467a2461122c6b1cc8026cca41c2b439c"
] | [
"models/embedders.py"
] | [
"from transformers import *\n\nfrom utils.pixelcnnpp_utils import *\nimport pdb\nfrom torch.nn.utils import weight_norm as wn\nfrom tqdm import tqdm\nfrom torch.nn.utils.rnn import pad_sequence\n\n\ndef bert_encoder():\n return BERTEncoder()\n\n\ndef class_embedding(n_classes, embedding_dim):\n return nn.Embe... | [
[
"torch.nn.utils.rnn.pad_sequence"
]
] |
rishi1111/vaex | [
"b3516201d04e9277b8918dadab9df33a7c83c01a"
] | [
"tests/ml/lightgbm_test.py"
] | [
"import sys\nimport pytest\npytest.importorskip(\"lightgbm\")\n\nimport numpy as np\nimport lightgbm as lgb\nimport vaex.ml.lightgbm\nimport vaex.ml.datasets\nfrom vaex.utils import _ensure_strings_from_expressions\n\n\n# the parameters of the model\nparams = {\n 'learning_rate': 0.1, # learning rate\n 'm... | [
[
"numpy.array",
"numpy.argmax",
"numpy.sqrt",
"numpy.testing.assert_equal"
]
] |
naver-ai/cgl_fairness | [
"00d3bec233c9b3e0f88496118abaed8321ca3159"
] | [
"trainer/trainer_factory.py"
] | [
"\"\"\"\ncgl_fairness\nCopyright (c) 2022-present NAVER Corp.\nMIT license\n\"\"\"\nimport torch\nimport numpy as np\nimport os\nimport torch.nn as nn\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau, MultiStepLR, CosineAnnealingLR\nfrom sklearn.metrics import confusion_matrix\nfrom utils import make_log_nam... | [
[
"torch.zeros",
"torch.cat",
"torch.argmax",
"torch.min",
"numpy.zeros",
"torch.max",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.unique",
"torch.no_grad",
"scipy.io.savemat",
"torch.optim.lr_scheduler.MultiStepLR",
"torch.tensor",
"torch.optim.lr_schedu... |
Palour/cnn_mnist | [
"e546176c0cf6c574c3624926192a8932a8a2a390"
] | [
"cnn_conv2d_3_mnist.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Jun 23 15:10:07 2019\n\n@author: zixks\n\"\"\"\n\nimport tensorflow as tf\nfrom tensorflow.examples.tutorials.mnist import input_data\n\n# \nx = tf.placeholder(tf.float32, [None, 784])\ny = tf.placeholder(tf.float32, [None, 10])\n\n\ndef wb_va... | [
[
"tensorflow.train.AdamOptimizer",
"tensorflow.nn.conv2d",
"tensorflow.nn.relu",
"tensorflow.initialize_all_variables",
"tensorflow.argmax",
"tensorflow.Session",
"tensorflow.Variable",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.reshape",
"t... |
lnls-fac/apsuite | [
"f96b0c6ce2314d6cd6e0b2d14d33e4b5a588e9a1"
] | [
"apsuite/commisslib/meas_touschek_lifetime.py"
] | [
"\"\"\".\"\"\"\nimport time as _time\nfrom functools import partial as _partial\nfrom threading import Event as _Event\n\nimport numpy as _np\nimport numpy.polynomial.polynomial as _np_pfit\nimport matplotlib.pyplot as _mplt\nimport matplotlib.gridspec as _mgs\nimport scipy.optimize as _scy_opt\nimport scipy.integr... | [
[
"numpy.max",
"numpy.array",
"numpy.isnan",
"scipy.optimize.curve_fit",
"numpy.log",
"numpy.polynomial.polynomial.polyval",
"numpy.polynomial.polynomial.polyfit",
"numpy.sum",
"scipy.integrate.cumtrapz",
"matplotlib.pyplot.figure",
"numpy.nanmean",
"matplotlib.pyplot... |
rahil1304/News-Companion | [
"0aaa453674c89ff07298f11f1b390a640672281d"
] | [
"News-companion/Un-Fake(Web)/News/NewsCompanion/views.py"
] | [
"from django.shortcuts import render\r\nfrom django.http import HttpResponse, HttpResponseRedirect\r\n# Create your views here.\r\nfrom newspaper import Article\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nimport re\r\n\r\nfrom keras.models import Sequential\r\nfrom keras.l... | [
[
"tensorflow.ConfigProto",
"numpy.array",
"tensorflow.Session",
"numpy.random.randn"
]
] |
FRidh/auraliser | [
"f20f037ca131299d1a584ea640bb39d83b5ceb26"
] | [
"bin/read_from_wav.py"
] | [
"\"\"\"\nExample that shows how to unapply the Doppler shift to an existing wav file.\n\"\"\"\n\n\nimport sys\nsys.path.append('..')\n\n\nimport numpy as np\n\n#from auraliser import Signal\n\nfrom auraliser.signal import Signal\nfrom auraliser.model import Model, Source, Receiver\n\nimport matplotlib as mpl\nmpl.r... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.arctan",
"matplotlib.rc"
]
] |
petermao/iri2016 | [
"065355a78b8950efab3c9bdd688f2c07de2086e6"
] | [
"src/iri2016/plots.py"
] | [
"import xarray\nfrom matplotlib.pyplot import figure\n\n\ndef timeprofile(iono: xarray.Dataset):\n\n fig = figure(figsize=(16, 12))\n axs = fig.subplots(3, 1, sharex=True).ravel()\n\n fig.suptitle(\n f\"{str(iono.time[0].values)[:-13]} to \"\n f\"{str(iono.time[-1].values)[:-13]}\\n\"\n ... | [
[
"matplotlib.pyplot.figure"
]
] |
xiaohu2015/tflearn | [
"30ed136f9ac3c48fa41a693fd27c6112bbc6e489"
] | [
"tflearn/variables.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import division, print_function, absolute_import\n\nimport tensorflow as tf\nimport tflearn\n\n\n@tf.contrib.framework.add_arg_scope\ndef variable(name, shape=None, dtype=tf.float32, initializer=None,\n regularizer=None, trainable=True, collections=None, device=... | [
[
"tensorflow.get_default_session",
"tensorflow.assign",
"tensorflow.get_variable",
"tensorflow.device",
"tensorflow.add_to_collection",
"tensorflow.get_collection"
]
] |
shankarganesh1234/MLProjects | [
"7a9273f0f0d43994dfdee6dc44214f0dd2d92352"
] | [
"Bitcoin/BitcoinPrices.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom sklearn import linear_model\nfrom sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error\nimport matplotlib.pyplot as plt\n\npath = \"/Users/shankarganesh/files/bitcoin/bitcoin_dataset.csv\"\n\ndata = pd.read_csv(path, parse_dates=[\"Date\"], index_co... | [
[
"numpy.array",
"sklearn.metrics.mean_squared_error",
"sklearn.linear_model.LinearRegression",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"numpy.corrcoef",
"matplotlib.pyplot.subplots",
"numpy.mean",
"sklearn.metrics.mean_absolute_error",
"numpy.append",
"sklearn.metr... |
iN1k1/deep-pyramidal-representations-peron-re-identification | [
"18eacd3b7bde2c4767ba290b655cb0f5c72ed8fe"
] | [
"src/datamanager/datasetreid.py"
] | [
"from .dataset import Dataset\nfrom . import utils as datautils\nfrom ..utils import misc\nimport math\nimport os\nimport numpy as np\nimport copy\nfrom operator import itemgetter\n\n\nclass DatasetReID(Dataset):\n def __init__(self, name, root_folder, load=True, im_size=None, in_memory=False, keep_aspect_ratio=... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.random.permutation",
"numpy.where",
"numpy.unique"
]
] |
andreazanetti/Paddle | [
"bc379ca3d5895eadbc1748bc5b71606011563ee1"
] | [
"python/paddle/fluid/contrib/mixed_precision/bf16/amp_utils.py"
] | [
"# Copyright (c) 2021 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#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unles... | [
[
"numpy.reshape",
"numpy.array",
"numpy.asarray"
]
] |
Riser6/yolox | [
"2cd60d94528ef9195dc68cd3204d63c3f61d990a",
"2cd60d94528ef9195dc68cd3204d63c3f61d990a"
] | [
"yolox/exp/yolox_base.py",
"exps/custom/yolox_m_coat_voc.py"
] | [
"#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.\n\nimport os\nimport random\n\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\n\nfrom .base_exp import BaseExp\n\n\nclass Exp(BaseExp):\n def __init__(self):\n super().__init_... | [
[
"torch.distributed.get_world_size",
"torch.nn.functional.interpolate",
"torch.optim.SGD",
"torch.utils.data.SequentialSampler",
"torch.LongTensor",
"torch.utils.data.DataLoader",
"torch.utils.data.distributed.DistributedSampler",
"torch.distributed.barrier",
"torch.distributed.... |
xdevdev/ClapToChange | [
"eed6e5c8facfa157e99fb2cc4417453311535c92"
] | [
"ASR research/frequency estimator.py"
] | [
"import pyaudio\r\nimport time\r\nimport numpy as np\r\nimport math\r\nimport matplotlib.pyplot as plt\r\n\r\nFORMAT = pyaudio.paInt16\r\nCHANNELS = 1\r\nRATE = 64000\r\nCHUNK = 1024\t# 1024\r\n\r\nall_pitches = []\r\n\r\nstream_buffer = []\r\n\r\np = pyaudio.PyAudio()\r\n\r\ndef empty_frame(length):\r\n\t\"\"\"Ret... | [
[
"numpy.pad",
"numpy.zeros",
"numpy.sum",
"numpy.min",
"numpy.mean",
"numpy.ediff1d",
"numpy.dtype",
"numpy.convolve"
]
] |
Avin0323/CINN | [
"607f85ef89f65ba92ef7d91ca5e3ad33681f6ec2",
"607f85ef89f65ba92ef7d91ca5e3ad33681f6ec2"
] | [
"tutorials/net_builder.py",
"python/cinn/auto_schedule/cost_model/xgb_cost_model.py"
] | [
"# Copyright (c) 2021 CINN Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b... | [
[
"numpy.random.random"
],
[
"numpy.concatenate"
]
] |
KofClubs/DeepMG | [
"fef1905b4757ff3e23592f799d34d756972340fd"
] | [
"geometry_translation/models/losses.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass SoftDiceLoss(nn.Module):\n def __init__(self):\n super(SoftDiceLoss, self).__init__()\n pass\n\n def forward(self, y_pred, y_true):\n smooth = 1.0 # may change\n i = torch.sum(y_true)\n j = torch.sum(y_pred)\n intersect... | [
[
"torch.sum"
]
] |
chy7074646/mmdetection | [
"68589d36f67ce3e05e0c5cd936b6e7fa72a1101a"
] | [
"mmdet/models/detectors/htc.py"
] | [
"import torch\nimport torch.nn.functional as F\n\nfrom .cascade_rcnn import CascadeRCNN\nfrom .. import builder\nfrom ..registry import DETECTORS\nfrom mmdet.core import (bbox2roi, bbox2result, build_assigner, build_sampler,\n merge_aug_masks)\n\n\n@DETECTORS.register_module\nclass HybridTask... | [
[
"torch.cat",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.no_grad"
]
] |
pbogomolov1967/outliers_and_similarity | [
"101d170e1f49ae7ae93aa5eb6434d92ae9fce8f3"
] | [
"similarity.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\nfrom sklearn.cluster import KMeans\nfrom sklearn.datasets import make_blobs\nfrom sklearn.metrics import euclidean_distances\n\nfrom util_distances_in_clusters import plot_kmeans, annotate_data_points2\n\n\ndef run_sim_nb():\n\n # Generate data\n np.rand... | [
[
"numpy.max",
"sklearn.datasets.make_blobs",
"numpy.zeros",
"numpy.random.seed",
"sklearn.cluster.KMeans",
"sklearn.metrics.euclidean_distances",
"numpy.average",
"matplotlib.pyplot.show"
]
] |
subhamroy007/beta_codes | [
"d6399639d3dde194c3fc5f509a9bb39cafb3a9bc"
] | [
"my_network.py"
] | [
"#in this version og neural network sgc is implemented along mith multiclass\r\n#classification using softmax activation and categorical cross entropy loss\r\n\r\n\r\n#import necessery libraries\r\nimport numpy as np\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport random\r\nimport math\r\n\r\n\r... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.random.randn",
"numpy.exp",
"numpy.log10"
]
] |
SufiyanDilawarkhan/Domain-Classification-Of-Customer-Messages-using-NLP | [
"b0ad90df2740308d0d1f3d0903e8e8df3aa1cc27"
] | [
"code.py"
] | [
"# --------------\nimport pandas as pd\r\nimport os\r\nimport numpy as np\r\nimport warnings\r\nwarnings.filterwarnings(\"ignore\")\r\n\r\n\r\n# path_train : location of test file\r\n# Code starts here\r\n\r\ndf = pd.read_csv(path_train)\r\n\r\nprint (df.head())\r\n\r\ndef label_race(row):\r\n if row['food'] == ... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.metrics.accuracy_score",
"sklearn.naive_bayes.MultinomialNB",
"sklearn.linear_model.LogisticRegression",
"numpy.argmax",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
... |
JacobARose/pyleaves | [
"27b4016c850148981f3d021028c9272f18df121d"
] | [
"pyleaves/utils/callback_utils.py"
] | [
"# @Author: Jacob A Rose\n# @Date: Wed, July 22nd 2020, 9:51 pm\n# @Email: jacobrose@brown.edu\n# @Filename: callback_utils.py\n\n\n'''\nCreated (7/22/2020) by Jacob A Rose\n-This script was originally located at pyleaves.train.callbacks\n-All scripts that reference original location should be transitioned to he... | [
[
"tensorflow.reduce_min",
"tensorflow.compat.v1.summary.histogram",
"tensorflow.python.framework.ops.inside_function",
"tensorflow.compat.v1.keras.callbacks.ModelCheckpoint",
"tensorflow.contrib.summary.image",
"tensorflow.python.eager.context.executing_eagerly",
"tensorflow.compat.v1.s... |
Ocete/TFG | [
"baf0853276aef8f6fd6c5cccbe69ede7ca7987c3"
] | [
"dwave/2 - simulated/2.py"
] | [
"# ref: https://github.com/prince-ph0en1x/QuASeR/blob/819fcfa85a3a9486ee27a95808f245e51ab1d5de/QA_DeNovoAsb/denovo_009.py\n\n\"\"\"\nExplore embedding\n\"\"\"\n\nimport numpy as np\nimport math\nimport matplotlib.pyplot as plt\nimport networkx as nx\nimport sys\nimport time\nfrom collections import defaultdict\n\ni... | [
[
"numpy.linalg.norm",
"numpy.zeros"
]
] |
MyPyDavid/ECpy | [
"b74842b64eca86d2181067fdb22bfa8fa4b2c8bb"
] | [
"src/elchempy/indexer/EC_index.py"
] | [
"\"\"\" Collects the files of index files of a folder\"\"\"\n\nfrom pathlib import Path\nfrom collections import Counter\nfrom functools import wraps\n\nimport datetime\nfrom typing import Tuple, List, Dict, Union, Collection\n\n# import re\n# import copy\n\nimport logging\n\nlogger = logging.getLogger(__name__)\nl... | [
[
"pandas.read_feather"
]
] |
gcfntnu/small-rna | [
"459f946dfb338017e8beb350da215aaac6a37c59",
"459f946dfb338017e8beb350da215aaac6a37c59"
] | [
"rules/bfq/scripts/plot_highly_expressed.py",
"rules/bfq/scripts/plotpca.py"
] | [
"#!/usr/bin env python\n\nimport sys\nimport argparse\nimport warnings\nwarnings.filterwarnings(\"ignore\", message=\"numpy.dtype size changed\")\n\nimport yaml\nimport pandas as pd\nimport numpy as np\nimport scanpy as sc\n\nfrom scipy.sparse import issparse\n\ndef higly_expressed_yaml(adata, n_top=10, biotype=Non... | [
[
"scipy.sparse.issparse",
"numpy.argsort"
],
[
"matplotlib.use",
"numpy.ceil",
"pandas.DataFrame",
"pandas.concat",
"matplotlib.pyplot.ioff",
"numpy.floor"
]
] |
anshulparihar/scikit-learn | [
"3bb138f87964dde5f25846f4380afba012cf26bc"
] | [
"sklearn/utils/extmath.py"
] | [
"\"\"\"\nExtended math utilities.\n\"\"\"\n# Authors: Gael Varoquaux\n# Alexandre Gramfort\n# Alexandre T. Passos\n# Olivier Grisel\n# Lars Buitinck\n# Stefan van der Walt\n# Kyle Kastner\n# Giorgio Patrini\n# License: BSD 3 clause\n\nimport warnings\n\... | [
[
"numpy.dot",
"numpy.copy",
"scipy.linalg.svd",
"numpy.rollaxis",
"numpy.exp",
"numpy.where",
"numpy.cumsum",
"numpy.issubdtype",
"numpy.max",
"numpy.full",
"numpy.sqrt",
"scipy.sparse.csr_matrix",
"numpy.empty_like",
"numpy.atleast_2d",
"scipy.sparse.iss... |
Carlitosh/PyKrige | [
"8d837ac60a03ecdc28ee034384c429c32c4c28f8"
] | [
"pykrige/ok3d.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\n__doc__ = \"\"\"\nPyKrige\n=======\n\nCode by Benjamin S. Murphy and the PyKrige Developers\nbscott.murphy@gmail.com\n\nSummary\n-------\nContains class Ordinar... | [
[
"numpy.concatenate",
"scipy.spatial.cKDTree",
"numpy.dot",
"numpy.meshgrid",
"numpy.fill_diagonal",
"numpy.zeros",
"numpy.array",
"numpy.absolute",
"numpy.sum",
"numpy.nonzero",
"matplotlib.pyplot.figure",
"numpy.ma.array",
"numpy.amax",
"numpy.amin",
"n... |
melling/kaggle | [
"3071082d27293750140b5ece9ed0c3135925ecac"
] | [
"PredictFutureSales/xgboost_example01/build_model.py"
] | [
"# Kaggle Score: 0.91993, 3022/10421, Top 29%\n\nimport pickle\nimport time\nimport gc\nimport numpy as np\nimport pandas as pd\n\nfrom xgboost import XGBRegressor\n\n## Reread test\n\ntest = pd.read_csv('test_modified.csv').set_index('ID')\n\n# Part 2, xgboost\n\ndata = pd.read_pickle('data.pkl')\n\n# Select perfe... | [
[
"pandas.read_pickle",
"pandas.DataFrame",
"pandas.read_csv"
]
] |
stanford-iprl-lab/Concept2Robot | [
"a5c6f40198634f167823f8c864f9d89bcf312db6"
] | [
"rl/master.py"
] | [
"import copy\nimport numpy as np\nimport os\nimport sys\nimport time\nnp.set_printoptions(precision=4,suppress=False)\n\nimport importlib\nimport glob\nimport imageio\nimport math\nimport datetime\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\n\nimport torchvision.models as models\nimport torch\nimport t... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.ConvTranspose1d",
"torch.nn.init.constant_",
"numpy.set_printoptions",
"torch.tanh",
"torch.FloatTensor",
"torch.nn.ReLU",
"torch.nn.init.normal_",
"torch.nn.Conv2d",
"torch.transpose",
"numpy.linspace"
]
] |
benjisidi/transformer-explainability | [
"8c0278a152ef29e26cb479850afebcbfb013d5c8"
] | [
"plot_attr_histograms.py"
] | [
"from matplotlib import pyplot as plt\nfrom utils.compare_gradients import get_cos_similarites_batch, get_n_best_matches\nfrom utils.process_data import encode, pad_to_equal_length\nfrom utils.compute_gradients import (\n get_layer_gradients,\n get_layer_integrated_gradients,\n)\nfrom transformers import Auto... | [
[
"numpy.max",
"numpy.histogram",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"numpy.load",
"numpy.min",
"numpy.mean",
"numpy.save",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.hist",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"matplot... |
KhondokerTanvirHossain/stock-market-exchange-prediction | [
"9cd2e9c94b38692473d4113ecbad96e3408fbeb1"
] | [
"ccbg.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nfrom sklearn.preprocessing import MinMaxScaler\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.layers import LSTM\nfrom keras.layers import Dropout\nfrom keras.models import model_from_json\nimport math\nfrom... | [
[
"numpy.array",
"sklearn.metrics.mean_squared_error",
"numpy.reshape",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylabel",
"sklearn.preprocessing.MinMaxScaler",
"matplotlib.pyplot.show"
]
... |
beliveau-lab/PaintSHOP_pipeline | [
"2e7b3ebd172d8904695e4b46855d1e632c4a7dcd"
] | [
"workflow/scripts/append_max_kmers.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jun 26 10:01:32 2019\n\n@author: hershe\n\nA script to append the max kmer count for a given probe to the BED row of the\nprobe. Written for use in my OligoServer/PaintSHOP Snakemake prediction \npipeline.\n\n\"\"\"\n\nimport pandas as pd\n\n#... | [
[
"pandas.read_csv"
]
] |
murlock/hsds | [
"9f5fc3cdb64017d07e34eb422eee5398553d213c"
] | [
"hsds/util/arrayUtil.py"
] | [
"##############################################################################\n# Copyright by The HDF Group. #\n# All rights reserved. #\n# ... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.prod",
"numpy.frombuffer",
"numpy.int32"
]
] |
diffunity/kpmg-corona-blue | [
"93c063933981009af8d661b9b91dda5e2ebf68ab"
] | [
"model_video/src/model.py"
] | [
"# code partially from: https://github.com/siqueira-hc/Efficient-Facial-Feature-Learning-with-Wide-Ensemble-based-Convolutional-Neural-Networks\nimport os\nimport sys\nimport json\nimport yaml\nimport logging\nimport requests\n\nimport torch\nimport numpy as np\nfrom tqdm import tqdm\nimport face_recognition\nimpor... | [
[
"numpy.ndarray"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.