repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
sabuj7177/TensorFI2
[ "6272a3951793255815506f143748bdd9345c1d2f" ]
[ "experiments/layer-states/vgg16-imagenet.py" ]
[ "import os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n\nimport tensorflow as tf\n\nimport numpy as np\nimport random\nfrom tensorflow.keras.preprocessing.image import load_img, img_to_array\nfrom tensorflow.keras.applications.vgg16 import preprocess_input, decode_predictions\n\nimport time, sys, math\n\nfrom src im...
[ [ "tensorflow.keras.preprocessing.image.load_img", "tensorflow.keras.preprocessing.image.img_to_array", "tensorflow.keras.applications.vgg16.decode_predictions", "tensorflow.keras.applications.VGG16", "tensorflow.keras.applications.vgg16.preprocess_input" ] ]
aaita92/qiskit-aqua
[ "8681045790123eefc347dfd05dee547bddc3d2df" ]
[ "qiskit/aqua/components/uncertainty_models/univariate_variational_distribution.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2019.\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.\...
[ [ "numpy.sum", "numpy.array", "numpy.conj", "numpy.zeros" ] ]
kencan7749/particles_detection_fsr
[ "9845eb58da0d948461c5d548e81e5ce4e9b790a0" ]
[ "point_classification/2_learning/train_cluster/121_train_big_dataset_dual_point_cloud_geometry.py" ]
[ "# TensorFlow and tf.keras\nimport tensorflow as tf\nimport tensorflow.contrib as tfcontrib\nfrom tensorflow.python.keras import layers\nfrom tensorflow.python.keras import losses\nfrom tensorflow.python.keras import models\nfrom tensorflow.python.keras import backend as K\nfrom tensorflow.python.client import sess...
[ [ "tensorflow.keras.callbacks.TensorBoard", "numpy.concatenate", "tensorflow.python.keras.layers.MaxPooling2D", "tensorflow.python.keras.losses.binary_crossentropy", "tensorflow.python.keras.layers.Input", "numpy.zeros", "tensorflow.python.keras.layers.Conv2D", "tensorflow.python.ker...
windj007/timelog-utils
[ "dc85bc04365355226c0bafe9227d60db632de5a3" ]
[ "redmine_import_timelog.py" ]
[ "#!/usr/bin/env python\n\nimport argparse, os, pandas, yaml, datetime, pytz, functools, redmine\n\n\ndef get_config(config_file):\n with open(config_file, 'r') as f:\n return yaml.load(f)\n\n\ndef get_redmine_client(config):\n return redmine.Redmine(config['redmine-base-address'],\n ...
[ [ "pandas.read_csv", "pandas.Series" ] ]
ppeigne/optimizers
[ "42eed8adb010ca0549cb269fab5e21f2e1693279" ]
[ "optimizers/activations.py" ]
[ "import numpy as np\n\ndef sigmoid(z: np.ndarray) -> np.ndarray:\n return 1 / (1 + np.exp(-z))\n\ndef relu(z: np.ndarray) -> np.ndarray:\n return np.maximum(0, z)\n\ndef leaky_relu(z: np.ndarray, rate: float = .01) -> np.ndarray:\n return np.maximum(z * rate, z)\n" ]
[ [ "numpy.exp", "numpy.maximum" ] ]
cfeenstra67/Quantum_Harmonic_Oscillator_Sim
[ "b36a26ce1e2853d5f9fa47b94dfb01c694b58d72" ]
[ "script/QHO_Demo.py" ]
[ "#!/usr/local/bin/python3\n\nimport wx\nfrom wx.lib.scrolledpanel import ScrolledPanel\n\nimport matplotlib as mpl\nimport matplotlib.gridspec as gridspec\nmpl.use('WXAgg')\nfrom matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas\nfrom matplotlib.backends.backend_wx import NavigationToolbar2...
[ [ "matplotlib.use", "matplotlib.animation.FuncAnimation", "matplotlib.backends.backend_wxagg.FigureCanvasWxAgg", "numpy.exp", "numpy.arange", "matplotlib.figure.Figure", "scipy.special.eval_hermite", "matplotlib.gridspec.GridSpec" ] ]
shimbay/tensorflow
[ "3c83fac462fd7938590ec69861d0d3691432e661" ]
[ "tensorflow/python/framework/ops.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.client.pywrap_tf_session.TF_OperationGetAttrInt", "tensorflow.python.framework.device.is_device_spec", "tensorflow.core.framework.attr_value_pb2.AttrValue.ListValue", "tensorflow.python.tf2.enabled", "tensorflow.python.util.memory.dismantle_ordered_dict", "tensorflow.pyt...
RWTH-EBC/EHDO
[ "7b03262fba126adf829b6ad1ad6b800db05ae880" ]
[ "optimization_model/clustering_medoid.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n\nEHDO - ENERGY HUB DESIGN OPTIMIZATION Tool\n\nDeveloped by: E.ON Energy Research Center, \n Institute for Energy Efficient Buildings and Indoor Climate, \n RWTH Aachen University, \n Germany\n \nC...
[ [ "numpy.max", "numpy.array", "numpy.zeros_like", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.tile", "numpy.min", "numpy.abs", "numpy.cumsum" ] ]
zhangyu233/mvscode
[ "883b2ba1a2ed61198a331f83d5ec7813b7204ef3" ]
[ "DTUmesh.py" ]
[ "import open3d as o3d\nimport numpy as np\nfrom sklearn import preprocessing\npath = \"E:\\ztt\\data\\MVS\\Points_MVS\\Points\\camp\"\n\n\n\nif __name__ == \"__main__\":\n\n meshpath =\"E:\\ztt\\data\\MVS\\SampleSet\\SampleSet\\MVS Data\\Surfaces\\camp\"\n #\n # mesh = o3d.io.read_triangle_mesh(meshpath + ...
[ [ "numpy.asarray", "sklearn.preprocessing.MinMaxScaler" ] ]
hologerry/diffvg
[ "3ef584606d414c075f2a2d2d29ae9e9c14a66ac0" ]
[ "apps/single_open_curve_thickness.py" ]
[ "from subprocess import call\nimport pydiffvg\nimport torch\n# import skimage\n\npydiffvg.set_print_timing(True)\n\n# Use GPU if available\npydiffvg.set_use_gpu(torch.cuda.is_available())\n\ncanvas_width, canvas_height = 256, 256\nnum_control_points = torch.tensor([2])\npoints = torch.tensor([[120.0, 30.0], # base...
[ [ "torch.cuda.is_available", "torch.optim.Adam", "torch.tensor" ] ]
tonyD1999/haralick-labeling-visualized
[ "beeb8acaa57f2ff0793618acdc08666ab8a17f32" ]
[ "duc_algo.py" ]
[ "from pathlib import Path\n\nimport numpy as np\n\nfrom utils import neighborhood_values\nfrom visualizer import HaralickVisualizer\n\n\ndef ccl_8(image, display=False):\n def pad_with(vector, pad_width, iaxis, kwargs):\n pad_value = kwargs.get('padder', 0)\n vector[:pad_width[0]] = pad_value\n ...
[ [ "numpy.sum", "numpy.pad", "numpy.zeros" ] ]
fengzhang427/HEP
[ "c0188bb3c69f2d5f8842f6ee2987b6fa5eb46241" ]
[ "models/LUM_model.py" ]
[ "from abc import ABC\n\nfrom torch import nn\nimport torch\nfrom models.NDM_model import Conv2dBlock\ntry:\n from itertools import izip as zip\nexcept ImportError:\n pass\n\n\nclass DecomNet(nn.Module, ABC):\n def __init__(self, params):\n super(DecomNet, self).__init__()\n self.norm = params...
[ [ "torch.sigmoid", "torch.cat", "torch.max", "torch.nn.ConvTranspose2d", "torch.nn.ReLU" ] ]
jonaths/dqn-grid
[ "c7a23a482046ac82042bff7126cb373eb57bec8d" ]
[ "tiny_dqn.py" ]
[ "from __future__ import division, print_function, unicode_literals\n\n# Handle arguments (before slow imports so --help can be fast)\nimport argparse\n\nparser = argparse.ArgumentParser(\n description=\"Train a DQN net to play MsMacman.\")\nparser.add_argument(\"-n\", \"--number-steps\", type=int, default=400000...
[ [ "numpy.random.rand", "tensorflow.group", "tensorflow.clip_by_value", "tensorflow.one_hot", "tensorflow.global_variables_initializer", "numpy.max", "tensorflow.train.Saver", "tensorflow.Variable", "tensorflow.variable_scope", "numpy.random.randint", "numpy.argmax", "...
gusseppe/pymach
[ "0266d5608702b8c951f4782966fcca8f2b4fe67c" ]
[ "pymach/core/fselect.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n# Author: Gusseppe Bravo <gbravor@uni.pe>\n# License: BSD 3 clause\n\"\"\"\nThis module provides a few of useful functions (actually, methods)\nfor feature selection the dataset which is to be studied.\n\n\"\"\"\nfrom __future__ import print_function\nimport numpy as n...
[ [ "sklearn.ensemble.ExtraTreesRegressor", "sklearn.ensemble.ExtraTreesClassifier", "sklearn.pipeline.FeatureUnion" ] ]
TuanNguyen27/numpyro
[ "b4ba9f1dd7e1e2d12ee67bebd4e5872fad69f770" ]
[ "test/contrib/test_tfp.py" ]
[ "# Copyright Contributors to the Pyro project.\n# SPDX-License-Identifier: Apache-2.0\n\nimport inspect\n\nfrom numpy.testing import assert_allclose\nimport pytest\n\nfrom jax import random\nimport jax.numpy as jnp\n\nimport numpyro\nimport numpyro.distributions as dist\nfrom numpyro.infer import MCMC, NUTS\n\n\n# ...
[ [ "numpy.testing.assert_allclose" ] ]
Photon26/wrs-main_0614
[ "c0d0e38deac9785e9c382305f65f3ac5f221787d" ]
[ "motion/trajectory/trapezoid.py" ]
[ "import math\nimport numpy as np\n\n\nclass TrajTrap(object):\n\n def __init__(self):\n self.fit = self._fit_max_acc\n self.predict = self._predict_max_acc\n\n def _fit_max_acc(self, conf0, spd0, conf1, spd1):\n # print(conf0, conf1)\n # assume max speed and check if it is needed i...
[ [ "numpy.logical_not", "numpy.zeros_like", "numpy.ones_like", "numpy.array", "numpy.exp2", "numpy.logical_and", "matplotlib.pyplot.subplots", "numpy.sign", "numpy.any", "matplotlib.pyplot.show" ] ]
m-szalay/Cirq
[ "1bd083a87fdf49212f347d88f15713e90cc72f8f" ]
[ "cirq/ops/pauli_string_test.py" ]
[ "# Copyright 2018 The Cirq Developers\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 o...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.random.choice", "numpy.zeros", "numpy.ones", "numpy.exp", "numpy.eye", "numpy.arange", "numpy.conj", "numpy.sqrt", "numpy.diag", "numpy.kron" ] ]
katchke/FaceAI
[ "30d8217460217529224606106860489e9de47704" ]
[ "face_detect_multi_scale.py" ]
[ "__author__ = 'Rahul'\n# -*- coding: utf-8 -*-\n\n# Detect faces from an image and crop them\n\nimport numpy as np\n\nimport os\nimport cv2\nimport multiprocessing as mp\nimport urllib2\n\n\nclass Image(object):\n def __init__(self, path):\n # Uncomment if image path is on disk\n # self.filename = ...
[ [ "numpy.ndarray", "numpy.ndim", "numpy.append" ] ]
ianwonilkim/gct634-2020
[ "e671cb4949fa1d3944937e01ace9e4fdd2b914b0" ]
[ "hw3/train.py" ]
[ "import argparse\nfrom datetime import datetime\nfrom pathlib import Path\nfrom collections import defaultdict\n\nimport numpy as np\nimport torch as th\nimport torch.nn as nn\nfrom torch.nn.utils import clip_grad_norm_\nfrom torch.optim.lr_scheduler import StepLR\nfrom torch.utils.data import DataLoader\nfrom tqdm...
[ [ "torch.device", "torch.optim.lr_scheduler.StepLR", "torch.nn.utils.clip_grad_norm_", "torch.no_grad", "numpy.mean", "numpy.std", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.nn.BCEWithLogitsLoss" ] ]
AriJordan/IML_project
[ "5f303931a2c2c4de907b84dfe1047afe6e0cf221" ]
[ "iml2020/examples/utilities/plot_helpers.py" ]
[ "import numpy as np\nfrom scipy import linalg\n\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\n# from plt import cm\nfrom matplotlib import rc\nimport time\nimport IPython\n\n# rc('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']})\n# rc('text', usetex=True)\n\n\ndef make_meshgrid(x, y, h=...
[ [ "numpy.ones_like", "numpy.dot", "scipy.linalg.eigh", "numpy.min", "matplotlib.patches.Ellipse", "matplotlib.pyplot.draw", "matplotlib.pyplot.gcf", "numpy.max", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.subplots", "numpy.arange", "numpy.sqrt", "matplotlib....
sophiakrix/bio2bel
[ "0db93f0f130f6d746692cef2caa36b5c63185a7a" ]
[ "src/bio2bel/sources/biogrid.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"This script downloads and parses BioGRID data and maps the interaction types to BEL.\"\"\"\n\nimport os\nimport pandas as pd\n\nfrom bio2bel.utils import ensure_path\nimport pybel.dsl\nfrom pybel import BELGraph\n\nSEP = '\\t'\n\nBIOGRID2BEL_MAPPER = {\n # increases\n 'synthe...
[ [ "pandas.read_csv" ] ]
imec-int/federated-learning-lib
[ "1b2dc964de01cd23f357edbce7527ec1bcfc2cd3" ]
[ "lib/ibmfl/aggregator/fusion/spahm_fusion_handler.py" ]
[ "\"\"\"\nLicensed Materials - Property of IBM\nRestricted Materials of IBM\n20190891\n© Copyright IBM Corp. 2021 All Rights Reserved.\n\"\"\"\n\"\"\"\nModule to where fusion algorithms are implemented.\n\"\"\"\nimport logging\nimport numpy as np\nfrom scipy.optimize import linear_sum_assignment\n\nfrom ibmfl.model....
[ [ "numpy.array", "numpy.delete", "numpy.log", "numpy.minimum", "numpy.copy", "numpy.ones", "numpy.random.permutation", "scipy.optimize.linear_sum_assignment", "numpy.arange", "numpy.outer", "numpy.hstack", "numpy.vstack", "numpy.maximum" ] ]
tyang92/TextGAN-PyTorch
[ "8d6de6e67af13899c00d3ac4e00591718be58f04" ]
[ "instructor/real_data/relgan_instructor.py" ]
[ "# -*- coding: utf-8 -*-\n# @Author : William\n# @Project : TextGAN-william\n# @FileName : relgan_instructor.py\n# @Time : Created at 2019-04-25\n# @Blog : http://zhiweil.ml/\n# @Description : \n# Copyrights (C) 2018. All Rights Reserved.\n\nimport torch\nimport torch.nn.functional a...
[ [ "torch.nn.functional.one_hot" ] ]
HiroIshida/PyMCubes
[ "8308f654dc48d5f9451158cbcf01fa0d2419c656" ]
[ "test_smoothing.py" ]
[ "\n\nimport pytest\n\nimport numpy as np\n\nimport mcubes\n\n\ndef test_sphere():\n\n # Create sphere with radius 25 centered at (50, 50, 50)\n x, y, z = np.mgrid[:100, :100, :100]\n levelset = np.sqrt((x - 50)**2 + (y - 50)**2 + (z - 50)**2) - 25\n\n # vertices, triangles = mcubes.marching_cubes(levels...
[ [ "numpy.zeros", "numpy.sum", "numpy.random.uniform", "numpy.abs", "numpy.sqrt", "numpy.all" ] ]
frostinassiky/2D-TAN
[ "9eb5aec0007dbf5de4d78347cf2ccfc523638637" ]
[ "lib/datasets/tacos.py" ]
[ "\"\"\" Dataset loader for the TACoS dataset \"\"\"\nimport os\nimport json\n\nimport h5py\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\nimport torch.utils.data as data\nimport torchtext\n\nfrom . import average_to_fixed_length\nfrom core.eval import iou\nfrom core.config import config\n\ncl...
[ [ "torch.zeros", "torch.nn.functional.normalize", "torch.nn.Embedding.from_pretrained", "torch.arange", "torch.from_numpy", "torch.ones", "torch.tensor" ] ]
omry/dynamicslearn
[ "fdc19728da95ba9566722b28da40f32f5c4d250e" ]
[ "learn/trainer.py" ]
[ "import os\nimport sys\n\nsys.path.append(os.getcwd())\n\n# Our infrastucture files\n# from utils_data import * \n# from utils_nn import *\nfrom learn.utils.data import *\nfrom learn.utils.nn import *\n\n# neural nets\nfrom learn.models.model_general_nn import GeneralNN\nfrom learn.models.model_ensemble_nn import E...
[ [ "torch.save", "matplotlib.pyplot.title", "matplotlib.pyplot.subplot" ] ]
kungfumas/bahasa-alami
[ "24ad2cb0c537ece11a0f7af376ef778a3c2839ca" ]
[ "Section 7 - Text Classification/Text Classification Part 8 - Testing model performance.py" ]
[ "# Text Classifiation using NLP\n\n# Importing the libraries\nimport numpy as np\nimport re\nimport pickle \nimport nltk\nfrom nltk.corpus import stopwords\nfrom sklearn.datasets import load_files\nnltk.download('stopwords')\n\n\n# Importing the dataset\nreviews = load_files('txt_sentoken/')\nX,y = reviews.data,rev...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.model_selection.train_test_split", "sklearn.linear_model.LogisticRegression", "sklearn.datasets.load_files", "sklearn.feature_extraction.text.TfidfTransformer" ] ]
tydcg/pythonlearn
[ "05da4ad0c81b919a6ca55e0b926af3a01475d861" ]
[ "other3d.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D, art3d\nfrom matplotlib.animation import FuncAnimation\n\n\ndef init_faces(N):\n f = []\n for r in range(N - 1):\n for c in range(N - 1):\n v0 = r * N + c\n f.append([v0, v0 + 1, v0 + N +...
[ [ "numpy.array", "numpy.sin", "matplotlib.pyplot.figure", "numpy.dstack", "matplotlib.pyplot.show", "numpy.linspace" ] ]
bkornpob/kbastroutils
[ "89bdf8f395234a22a8b1386f028892b07559022e" ]
[ "kbastroutils/grismapcorr.py" ]
[ "import numpy as np\nfrom scipy.interpolate import interp2d\nimport copy\n\nclass GrismApCorr:\n def __init__(self):\n TABLE = {'HST-WFC3-IR-G102': \n {'ref': 'ISR WFC3-2011-05'\n ,'filter': 'G102'\n ,'scale': 0.13\n ,'scaleunit': 'arcsec/...
[ [ "numpy.array", "numpy.copy", "numpy.where", "numpy.isfinite", "scipy.interpolate.interp2d" ] ]
sjleake/bcdi
[ "bf071ad085a11622158e1e651857a8a172c51cf1" ]
[ "tests/utils/test_utilities.py" ]
[ "# -*- coding: utf-8 -*-\n\n# BCDI: tools for pre(post)-processing Bragg coherent X-ray diffraction imaging data\n# (c) 07/2017-06/2019 : CNRS UMR 7344 IM2NP\n# (c) 07/2019-05/2021 : DESY PHOTON SCIENCE\n# (c) 06/2021-present : DESY CFEL\n# authors:\n# Jerome Carnis, carnis_jerome@yahoo.fr\n\nim...
[ [ "numpy.ones" ] ]
aharker619/ena_experiment_analysis
[ "40c80f16e131cabe92af453926fa6a5051bdb78c" ]
[ "in_vivo/filo_const_analysis.py" ]
[ "# Compare different filopodia density depending on categorization values for filopodia\n# Change length/width parameters for classifying filopodia, see if result changes\n\nimport os\nimport scipy.io as sio\nfrom scipy import stats\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib....
[ [ "pandas.DataFrame", "matplotlib.pyplot.xlabel", "scipy.io.loadmat", "scipy.stats.ttest_ind", "matplotlib.pyplot.figure", "pandas.Series", "matplotlib.pyplot.xticks", "matplotlib.pyplot.subplot" ] ]
vgolfier/Dashboard_Uber_Prize
[ "ff25a571a618edfef4300ba222549c19f8bb4495" ]
[ "Dashboard_Uber_Prize/submission.py" ]
[ "import pdb\nimport math\nimport numpy as np \nfrom os import listdir\nfrom os.path import dirname, join\nimport pandas as pd \n# import seaborn as sns \n\nfrom bokeh.models import ColumnDataSource\nfrom bokeh.palettes import Dark2, Category10, Category20, Plasma256, YlOrRd\n\nHOURS = [str(h) for h in range(24)]\nR...
[ [ "pandas.cut", "numpy.zeros", "pandas.merge", "pandas.DataFrame", "pandas.melt", "numpy.floor" ] ]
Gnostikoi/active-semi-supervised-clustering
[ "429e19a6fe5f8cd1005c0bcbed0bc4ca18c32064" ]
[ "active_semi_clustering/active/pairwise_constraints/min_max.py" ]
[ "import numpy as np\n\nfrom ...exceptions import MaximumQueriesExceeded\nfrom .explore_consolidate import ExploreConsolidate\n\n\nclass MinMax(ExploreConsolidate):\n def _consolidate(self, neighborhoods, X, oracle):\n n = X.shape[0]\n\n skeleton = set()\n for neighborhood in neighborhoods:\n...
[ [ "numpy.percentile", "numpy.zeros" ] ]
luca-morreale/neural_surface_maps
[ "08275190fc8b2b2bf17c5be695c125f1806ff649" ]
[ "utils/show.py" ]
[ "\nimport trimesh\n\nimport matplotlib as mpl\nfrom matplotlib import pyplot as plt\nfrom matplotlib.tri import Triangulation\n\nmpl.rcParams['agg.path.chunksize'] = 10000\n\n\ndef show_mesh(filename, source, out, faces, pp_loss=None):\n np_uvs = source.cpu().numpy()\n np_verts = out.cpu().numpy()\n np_f...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.triplot", "matplotlib.pyplot.axis" ] ]
chamberm/Detect
[ "a0381f98116346a1135560ad7192ec2dac741b69" ]
[ "Detect/models/PCA.py" ]
[ "from __future__ import division, print_function, absolute_import\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport streamlit as st\nimport pandas as pd\nfrom sklearn.decomposition import PCA\nimport seaborn as sns\n\ndef save(model):\n pass\n\ndef covar_matrix(data, verbose=False):\n covariance_...
[ [ "numpy.array", "numpy.cov", "pandas.DataFrame", "numpy.linalg.inv", "numpy.mean", "numpy.allclose", "numpy.linalg.cholesky", "sklearn.decomposition.PCA" ] ]
TommyLike/mindspore
[ "930a1fb0a8fa9432025442c4f4732058bb7af592", "930a1fb0a8fa9432025442c4f4732058bb7af592", "930a1fb0a8fa9432025442c4f4732058bb7af592", "930a1fb0a8fa9432025442c4f4732058bb7af592" ]
[ "tests/ut/python/communication/test_data_parallel_resnet.py", "tests/vm_impl/vm_me.py", "tests/ut/python/pynative_mode/test_cell_bprop.py", "tests/ut/python/parallel/test_one_weight_parameter.py" ]
[ "# Copyright 2020 Huawei Technologies Co., Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l...
[ [ "numpy.ones", "numpy.zeros" ], [ "numpy.dot", "numpy.minimum", "numpy.not_equal", "numpy.exp", "numpy.mean", "numpy.where", "numpy.max", "scipy.special.softmax", "numpy.less", "numpy.argmax", "numpy.transpose", "numpy.sqrt", "numpy.greater", "num...
skoltech-nlp/coqas
[ "bf0d8d3d1fffa0039114d7d64bacc020f5085c66" ]
[ "src/layers/layer_char_embeddings.py" ]
[ "\"\"\"class implements character-level embeddings\"\"\"\nimport string\nimport torch\nimport torch.nn as nn\nfrom src.layers.layer_base import LayerBase\nfrom src.seq_indexers.seq_indexer_char import SeqIndexerBaseChar\n\n\nclass LayerCharEmbeddings(LayerBase):\n \"\"\"LayerCharEmbeddings implements character-l...
[ [ "torch.zeros" ] ]
phanxuanphucnd/conformer
[ "a14562ef118c7539ebeade469d0e164ffb5f57a1", "a14562ef118c7539ebeade469d0e164ffb5f57a1" ]
[ "conformer/models/conformer/encoder.py", "conformer/decode/ensemble.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport torch\nimport torch.nn as nn\n\nfrom torch import Tensor\nfrom typing import Tuple\n\nfrom arizona_asr.models.encoder import TransducerEncoder\nfrom arizona_asr.models.convolutional import Conv2dSubsampling\nfrom arizona_asr.models.modules import ResidualConnectionModule, Linear\n...
[ [ "torch.nn.Dropout", "torch.nn.LayerNorm" ], [ "torch.nn.Linear", "torch.FloatTensor", "torch.no_grad", "torch.nn.ELU" ] ]
lixin940207/bert4keras
[ "91e4b6e710fb54ce6e762cfe71c716a23b28e8fd" ]
[ "examples/task_sentiment_albert.py" ]
[ "#! -*- coding:utf-8 -*-\n# 情感分析例子,加载albert_zh权重(https://github.com/brightmart/albert_zh)\n\nimport json\nimport numpy as np\nfrom random import choice\nimport re, os, codecs\nfrom bert4keras.backend import set_gelu\nfrom bert4keras.utils import Tokenizer, load_vocab\nfrom bert4keras.bert import build_bert_model\nf...
[ [ "numpy.random.shuffle" ] ]
KPF-newstrust/ntrust-lab
[ "14162f96013c11109e983b2330bbcd986dff538e" ]
[ "utils/clustering.py" ]
[ "import sys, os\nimport re, csv\n\nimport tensorflow as tf\nfrom tensorflow.contrib.tensorboard.plugins import projector\nimport numpy as np\nimport pickle\nfrom sklearn.cluster import DBSCAN\nfrom sklearn import metrics\nfrom konlpy.tag import Mecab\n\n\ndef visualize(sess, varname, X, meta_file):\n model_path ...
[ [ "numpy.array", "numpy.zeros", "sklearn.metrics.adjusted_mutual_info_score", "tensorflow.Variable", "tensorflow.train.Saver", "tensorflow.logging.info", "numpy.save", "numpy.load", "tensorflow.contrib.tensorboard.plugins.projector.visualize_embeddings", "sklearn.metrics.silh...
softwaresaved/jamie
[ "b854e22966cc03e2ff316d1d25b636cdcce233d9" ]
[ "jamie/types.py" ]
[ "# Custom types and enums for use in Jamie\nimport re\nimport json\nimport numpy as np\nimport pandas as pd\nfrom bson.json_util import loads\nimport datetime\nfrom enum import Enum, auto\nfrom typing import Optional, List\nfrom dataclasses import dataclass, asdict\n\n\ndef _get_mongo_date(record, key):\n if key...
[ [ "pandas.read_csv" ] ]
zhykoties/Hierarchical-Actor-Critc-HAC-
[ "622bdfddeac964110496668164c949b2dee1dbf9" ]
[ "ant_environments/ant_reacher_3_levels/agent.py" ]
[ "import numpy as np\nfrom layer import Layer\nfrom environment import Environment\nimport pickle as cpickle\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\nimport os\nimport pickle as cpickle\n\n# Below class instantiates an agent\nclass Agent():\n def __init__(self,FLAGS, env, agent_params):\n\n ...
[ [ "tensorflow.compat.v1.global_variables_initializer", "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.train.Saver", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.trainable_variables", "numpy.absolute", "tensorflow.compat.v1.train.latest_checkpoint" ] ]
leozz37/makani
[ "c94d5c2b600b98002f932e80a313a06b9285cc1b", "c94d5c2b600b98002f932e80a313a06b9285cc1b" ]
[ "analysis/control/actuator_util.py", "analysis/force_balance_loop/tools/fbl_load_csim_database.py" ]
[ "# Copyright 2020 Makani Technologies 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l...
[ [ "numpy.matrix", "numpy.asarray", "numpy.zeros", "numpy.size" ], [ "scipy.interpolate.RectBivariateSpline", "numpy.asarray", "numpy.zeros" ] ]
alucardxh/zvt
[ "02a2c64828146f4e15e702150f26a5ab6647a91c" ]
[ "zvt/recorders/em/actor/em_stock_top_ten_recorder.py" ]
[ "# -*- coding: utf-8 -*-\nfrom typing import List\n\nimport pandas as pd\n\nfrom zvt.api.utils import to_report_period_type, value_to_pct\nfrom zvt.contract import ActorType\nfrom zvt.contract.api import df_to_db\nfrom zvt.contract.recorder import TimestampsDataRecorder\nfrom zvt.domain import Stock, ActorMeta\nfro...
[ [ "pandas.DataFrame.from_records" ] ]
KazuhisaFujita/AlphaDDA
[ "664742567883cf3e08c2c53b3bce3112b8cc0560" ]
[ "AlphaDDA1/Othello/AlphaZero_mcts.py" ]
[ "#---------------------------------------\n#Since : 2019/04/10\n#Update: 2021/11/16\n# -*- coding: utf-8 -*-\n#---------------------------------------\nimport numpy as np\nfrom copy import deepcopy\nimport random\nimport math\nfrom nn import NNetWrapper as nnet\nfrom parameters import Parameters\nfrom Othello_bitbo...
[ [ "numpy.array", "numpy.random.rand", "numpy.zeros", "numpy.sum", "numpy.exp" ] ]
urialon/lingvo
[ "0819730882bfaa68d2eeb702e13d4c943172d5ff", "0819730882bfaa68d2eeb702e13d4c943172d5ff" ]
[ "lingvo/core/base_model.py", "lingvo/core/sendrecv.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.group", "tensorflow.assign_add", "tensorflow.control_dependencies", "tensorflow.logging.warning", "tensorflow.cast", "tensorflow.no_op", "tensorflow.trainable_variables", "tensorflow.contrib.model_pruning.Pruning", "tensorflow.logging.info", "tensorflow.colocate...
hdoupe/Tax-Cruncher
[ "e263bcf8643d747d85855bfc2af2faba519a9ace" ]
[ "cs-config/cs_config/functions.py" ]
[ "import os\nimport json\nimport traceback\nimport paramtools\nimport pandas as pd\nimport inspect\nfrom .outputs import credit_plot, rate_plot, liability_plot\nfrom .constants import MetaParameters\nfrom . import inputs\nfrom bokeh.models import ColumnDataSource\nfrom taxcrunch.cruncher import Cruncher, CruncherPar...
[ [ "pandas.concat" ] ]
shijun18/TMLI-PLAN
[ "0097d5674852eba75487b153600fc1cd5518b2a8" ]
[ "model/att_unet.py" ]
[ "import torch.nn as nn\nfrom typing import Optional, Union, List\nfrom .model_config import MODEL_CONFIG\nfrom .decoder.att_unet import AttUnetDecoder\nfrom .get_encoder import build_encoder\nfrom .base_model import SegmentationModel\nfrom .lib import SynchronizedBatchNorm2d\nBatchNorm2d = SynchronizedBatchNorm2d\n...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.Identity", "torch.nn.UpsamplingBilinear2d", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ] ]
missakaherath/RoBERTaABSA
[ "6772fdd892684d8d044a6a1cf815ae5d4a8dcd89" ]
[ "ASGCN/models/ascnn.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom layers.dynamic_rnn import DynamicLSTM\n\nclass ASCNN(nn.Module):\n def __init__(self, embedding_matrix, opt):\n super(ASCNN, self).__init__()\n self.opt = opt\n self.embed = nn...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.Conv1d", "torch.tensor", "torch.matmul", "torch.sum" ] ]
anubhakabra/MoH-Hate-Speech-Detection
[ "042e98fef3035b515cf8ab9c772ff39bd240a3a3" ]
[ "model/model.py" ]
[ "import datetime\n\nimport keras\nimport numpy as np\nimport tokenization\nimport tensorflow as tf\nimport tensorflow_hub as hub\n\nfrom config import *\n\n\ndef model_train(model_type, train, test, is_training=False):\n\n if model_type == \"bert\":\n bert_layer = hub.KerasLayer(mBERT_MODULE_URL, trainabl...
[ [ "numpy.array", "tensorflow.keras.layers.Input", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.callbacks.EarlyStopping" ] ]
TrueNobility303/rainbow
[ "b976f1629fd30a28aaae68f7a453e4d5f2b5b59d" ]
[ "6_dist.py" ]
[ "import os\nfrom typing import Dict, List, Tuple\nimport gym\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom net.replay import ReplayBuffer \nfrom net.utils import initial_seed\n\ninitial_seed(42)\n\n#REF...
[ [ "torch.nn.Linear", "torch.device", "matplotlib.pyplot.subplot", "matplotlib.pyplot.savefig", "torch.no_grad", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "torch.linspace", "numpy.mean", "matplotlib.pyplot.figure", "torch.nn.ReLU", "torch.FloatTensor", "...
bitwhys/mining-social-web
[ "8d84c85a415d63bd53b8eb441a4258dc914f4d9f" ]
[ "packt-social-media-mining/Chap04/facebook_top_posts_plot.py" ]
[ "# Chap04/facebook_top_posts_plot.py\nimport json\nfrom argparse import ArgumentParser\nimport numpy as np\nimport pandas as pd\nimport dateutil.parser\nimport matplotlib.pyplot as plt\nfrom datetime import datetime\n\n\ndef get_parser():\n parser = ArgumentParser()\n parser.add_argument('--page')\n return...
[ [ "pandas.DatetimeIndex", "pandas.DataFrame", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "matplotlib.pyplot.bar", "matplotlib.pyplot.xticks" ] ]
VedPatwardhan/pytorch-lightning
[ "623dc974f56505cfdb6a7c62ad75780229e101de" ]
[ "tests/checkpointing/test_model_checkpoint.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.stack", "torch.optim.lr_scheduler.StepLR", "torch.tensor", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.load", "torch.randn" ] ]
JDACS4C-IMPROVE/TGSA
[ "cdd9903b889112b04325bec9f61935d05d9e9179" ]
[ "heterogeneous_graph.py" ]
[ "import os\nos.environ[\"CUDA_DEVICE_ORDER\"] = \"PCI_BUS_ID\"\n\nimport torch\nimport numpy as np\nimport pickle\nfrom models.TGDRP import TGDRP\nfrom utils import *\nfrom rdkit import DataStructs,Chem\nfrom rdkit.Chem import AllChem\nfrom scipy.stats import pearsonr\nimport argparse\n\ndir = './data/similarity_au...
[ [ "numpy.zeros_like", "scipy.stats.pearsonr", "numpy.argwhere" ] ]
hellloxiaotian/DudeNet
[ "ec46e6a6bd8f3cdefdb1aeb9eb74e3a961bd0266" ]
[ "gray/dataset.py" ]
[ "import os\nimport os.path\nimport numpy as np\nimport random\nimport h5py\nimport torch\nimport cv2\nimport glob\nimport torch.utils.data as udata\nfrom utils import data_augmentation\n\ndef normalize(data):\n return data/255.\n\ndef Im2Patch(img, win, stride=1):\n k = 0\n endc = img.shape[0]\n endw = ...
[ [ "numpy.array", "numpy.zeros", "numpy.random.randint", "torch.Tensor", "numpy.expand_dims" ] ]
WipadaChan/AzureMachineLearningGallery
[ "43b089074fc7090ab6449c1f29e29522af5ecdde" ]
[ "components/naive_bayes/naive_bayes_score_eval/naive_bayes_score_eval.py" ]
[ "import os\nimport sys\nimport argparse\nimport pandas as pd\nimport numpy as np\nfrom pathlib import Path\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.feature_extraction.text import TfidfTransformer\nfrom sklearn.naive_bayes import MultinomialNB\nfrom sklearn.pipeline import Pipeline\...
[ [ "pandas.DataFrame", "sklearn.metrics.confusion_matrix", "sklearn.metrics.accuracy_score", "pandas.Series" ] ]
waiting-gy/Caltech_Pedestrian
[ "bd57a85a5fd4965616fe52f20a990abe8e28dda8" ]
[ "data/coco.py" ]
[ "from .config import HOME\nimport os\nimport os.path as osp\nimport sys\nimport torch\nimport torch.utils.data as data\nimport torchvision.transforms as transforms\nimport cv2\nimport numpy as np\n\n#COCO_ROOT = osp.join(HOME, 'data/coco/')\n#COCO_ROOT = \"/mnt/Younggao/coco/\"\nCOCO_ROOT = \"/kaggle/input/CaltechP...
[ [ "numpy.array", "numpy.expand_dims", "torch.from_numpy" ] ]
tejasurya/Text_Classification_using_Neural_Networks
[ "d4852780e6c86843aee768d306d19428c8cb9c7f" ]
[ "Simple Text classifiers/Text Classification on Brown Corpus/B_classifier-Seq1.py" ]
[ "from numpy import asarray\nfrom numpy import zeros\nimport pandas as pd\nimport os\nfrom keras.datasets import reuters\n\nfrom keras.preprocessing.text import Tokenizer\nfrom keras.preprocessing.sequence import pad_sequences\nfrom keras import backend as K\nfrom keras.utils.generic_utils import get_custom_objects\...
[ [ "numpy.asarray", "numpy.zeros", "sklearn.metrics.precision_score", "sklearn.metrics.f1_score", "sklearn.metrics.recall_score" ] ]
thieu1995/mealpy
[ "7694c18e1514909f6727163a3e0899dd36822867" ]
[ "mealpy/math_based/SCA.py" ]
[ "#!/usr/bin/env python\n# ------------------------------------------------------------------------------------------------------%\n# Created by \"Thieu Nguyen\" at 17:44, 18/03/2020 %\n# ...
[ [ "numpy.sin", "numpy.random.uniform", "numpy.cos" ] ]
liyang990803/CSCI-103
[ "6f84fbc242be90f7a9c3a58bdcc6f54352e4ae5a" ]
[ "CS231n - Convolutional Neural Networks for Visual Recognition/Assignments/assignment1/cs231n/classifiers/linear_svm.py" ]
[ "import numpy as np\nfrom random import shuffle\n\ndef svm_loss_naive(W, X, y, reg):\n \"\"\"\n Structured SVM loss function, naive implementation (with loops).\n\n Inputs have dimension D, there are C classes, and we operate on minibatches\n of N examples.\n\n Inputs:\n - W: A numpy array of shape (D, C) con...
[ [ "numpy.sum", "numpy.arange", "numpy.zeros", "numpy.maximum" ] ]
lbechberger/LearningPsychologicalSpaces
[ "24fbf266f70874df394e08dfa9c53abecca19c00" ]
[ "code/mds/similarity_spaces/create_baseline_spaces.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreate random baseline spaces for later comparison with MDS results.\n\nCreated on Mon Sep 7 14:20:40 2020\n\n@author: lbechberger\n\"\"\"\n\nimport pickle, argparse\nimport numpy as np\nfrom itertools import zip_longest\nfrom code.util import normalize_vectors\n\nparser = argpars...
[ [ "numpy.random.seed", "numpy.array", "numpy.copy", "numpy.random.shuffle" ] ]
jgericardo/pytorch-playground
[ "49609ec10f024f4d871a531b53968dc2b3167f93" ]
[ "scripts/train_ann.py" ]
[ "# PyTorch Playground\n# Copyright (C) 2021 Justin Gerard Ricardo\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as published\n# by the Free Software Foundation, either version 3 of the License, or\n# (at your option) any lat...
[ [ "torch.from_numpy" ] ]
SamueleFerracin/pennylane
[ "67835d8dbd99a320165c76e7c25d24e3af3a266b" ]
[ "tests/templates/test_layers/test_simplified_twodesign.py" ]
[ "# Copyright 2018-2021 Xanadu Quantum Technologies Inc.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by ap...
[ [ "numpy.allclose", "numpy.random.random", "numpy.random.randn" ] ]
PauloJPS/ComputationalVision
[ "31bdfdf9222417a3ccd92b8d30e845f0b35f1ced" ]
[ "edgeDetection/LOG.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nimport os \n\nclass filters():\n def __init__(self, image, sigma):\n self.sigma = sigma \n self.n = image.size[0]\n self.image = image\n image = image.convert('L')\n image = image.resize((256, 256), Im...
[ [ "numpy.exp", "numpy.fft.fft2", "numpy.zeros" ] ]
synthesized-io/fairlens
[ "cd6dd0d38226a39a7d1b626d6bb86481c0b84f0f" ]
[ "tests/test_significance.py" ]
[ "import numpy as np\nimport pandas as pd\nimport pytest\n\nfrom fairlens.metrics.distance import BinomialDistance, MeanDistance\nfrom fairlens.metrics.significance import binominal_proportion_p_value as bin_prop\nfrom fairlens.metrics.significance import bootstrap_binned_statistic as bootstrap_binned\nfrom fairlens...
[ [ "numpy.linalg.norm", "pandas.DataFrame", "numpy.arange", "pandas.Series", "pandas.read_csv" ] ]
tommyvsfu1/ADL2019_ReinforcementLearning
[ "45e1e3bdef129efd85ed1856f88a255c129f571e" ]
[ "mario_env.py" ]
[ "\"\"\"\n\n### NOTICE ###\nYou DO NOT need to upload this file\n\n\"\"\"\n\nimport numpy as np\nfrom collections import deque\nimport gym\nfrom gym import spaces\nfrom PIL import Image\nimport cv2\n\n#from nes_py.wrappers import BinarySpaceToDiscreteSpaceEnv\nfrom nes_py.wrappers import JoypadSpace\nimport gym_supe...
[ [ "numpy.concatenate", "numpy.stack", "numpy.reshape", "numpy.expand_dims" ] ]
tddschn/Easy-Graph
[ "2cdecbde0b67a0c106e2bcf82d13c6fcd0b4c5d8" ]
[ "easygraph/functions/graph_embedding/line.py" ]
[ "from easygraph.utils.alias import create_alias_table, alias_sample\nfrom easygraph.utils.index_of_node import get_relation_of_index_and_node\nfrom easygraph.utils import *\nimport math\nimport random\n\nimport numpy as np\n\n\ndef line_loss(y_true, y_pred):\n import tensorflow as tf\n from tensorflow.python....
[ [ "numpy.array", "tensorflow.python.keras.backend.sigmoid", "tensorflow.python.keras.layers.Input", "numpy.zeros", "tensorflow.python.keras.layers.Embedding", "tensorflow.reduce_max", "numpy.arange", "tensorflow.reduce_sum", "tensorflow.python.keras.models.Model" ] ]
avcopan/mechdriver
[ "63069cfb21d6fdb6d0b091dfe204b1e09c8e10a1" ]
[ "routines/es/_routines/wells.py" ]
[ "\"\"\"\nFind a TS from the grid as well as associated vdW wells\n\"\"\"\n\nimport numpy\nimport automol\nimport elstruct\nimport autofile\nfrom routines.es._routines import _util as util\nfrom routines.es._routines import geom\nfrom routines.es import runner as es_runner\nfrom lib import filesys\nfrom lib.phydat i...
[ [ "numpy.random.rand" ] ]
failyang/tensorflow-examples
[ "48da6cd25138d448a4ddf7710e8abab0392c453c" ]
[ "c3d/data_gen.py" ]
[ "import numpy as np\nfrom tensorflow import keras\nimport cv2\nimport os\nimport matplotlib.pyplot as plt\nimport tensorflow as tf\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\nfrom data_helper import calculateRGBdiff, readfile_to_dict\nfrom tensorflow.python.keras.utils.data_utils import Se...
[ [ "tensorflow.keras.preprocessing.image.ImageDataGenerator", "numpy.empty", "numpy.zeros", "numpy.random.shuffle", "numpy.random.uniform", "numpy.random.randint" ] ]
loxacom123/AutoML
[ "8c5952467915f77d84705325b58b5dc9f3541d61" ]
[ "dataloaders/utils.py" ]
[ "import json\nfrom PIL import Image\nimport os\nfrom pycocotools.coco import COCO\nimport numpy as np\nimport cv2\n\n\ndef change_coco_image_sizes_with_annotations(path_to_dataset, min_side):\n os.chdir(path_to_dataset)\n\n folder_paths = ['train2017', 'val2017']\n for folder_path in folder_paths:\n ...
[ [ "numpy.array" ] ]
Michael-Hsu/pytorch-tutorial-1
[ "caabba7636c2baeed064b12cf484aecb3f8d3551" ]
[ "tutorials/03-advanced/image_captioning/sample.py" ]
[ "import torch\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport argparse\nimport pickle\nimport os\nfrom torchvision import transforms\nfrom build_vocab import Vocabulary\nfrom model import EncoderCNN, DecoderRNN\nfrom PIL import Image\n\n# Device configuration\ndevice = torch.device('cuda' if torch.cuda...
[ [ "matplotlib.pyplot.show", "torch.cuda.is_available", "numpy.asarray", "torch.load" ] ]
esalesky/NMTGMinor
[ "b6eafff21f5aabb874720e6df30cd6b91c339a7c" ]
[ "onmt/modules/LSTMLM/Models.py" ]
[ "import numpy as np\nimport torch, math\nimport torch.nn as nn\nfrom onmt.modules.Transformer.Models import TransformerDecodingState\nfrom onmt.modules.BaseModel import NMTModel, Reconstructor, DecoderState\nimport onmt\nfrom onmt.modules.WordDrop import embedded_dropout\n#~ from onmt.modules.Checkpoint import chec...
[ [ "torch.cat", "torch.nn.LSTM", "torch.gt" ] ]
ayushgupta9198/photo_video_upscale_to_any_size
[ "467a8e1c6e3000952df0b0c6478594427db0ac06" ]
[ "infer-video.py" ]
[ "from argparse import ArgumentParser\nfrom tensorflow import keras\nimport numpy as np\nimport cv2\nimport os\n\nparser = ArgumentParser()\n\n\ndef main():\n args = parser.parse_args()\n\n model = keras.models.load_model('models/generator.h5')\n inputs = keras.Input((None, None, 3))\n output = model(inp...
[ [ "numpy.expand_dims", "tensorflow.keras.models.load_model", "tensorflow.keras.Input", "tensorflow.keras.models.Model" ] ]
shikashyam/BigDataSystemsCoursework
[ "d7f9cabbfb18b0e3303292b65af1ffd530e24ccc" ]
[ "Assignment3/src/data/catalog_search.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Mar 10 14:24:15 2022\n\n@author: shshyam\n\"\"\"\n\nfrom importlib.resources import path\nimport h5py\nimport boto3\nfrom botocore.handlers import disable_signing\nfrom os import walk\nimport os\nimport pandas as pd\nfrom geopy import distance...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
fabrien/aye-saac
[ "3416786caee874d4632bf98366b5a83fe4838e0b" ]
[ "ayesaac/services/object_detection/main.py" ]
[ "from pprint import pprint\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom ayesaac.services.common import QueueManager\nfrom ayesaac.services.common.crypter import decode\nfrom ayesaac.utils.config import Config\nfrom ayesaac.utils.logger import get_logger\n\nfrom .coco_category_index import coco_category_in...
[ [ "tensorflow.convert_to_tensor" ] ]
cnyeh/pyscf
[ "95d852c9d18099a55207bb8da0155902c824c2aa" ]
[ "pyscf/mcscf/casci.py" ]
[ "#!/usr/bin/env python\n# Copyright 2014-2020 The PySCF Developers. 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/LIC...
[ [ "numpy.dot", "numpy.empty", "numpy.zeros", "numpy.copy", "numpy.ones", "numpy.where", "numpy.einsum", "numpy.all" ] ]
epimap/covid19_datasets
[ "c58e7e2083d1432517b6504d3fad6212f4263d27" ]
[ "covid19_datasets/uk_area_stats.py" ]
[ "import pandas as pd\nimport numpy as np\nimport datetime\nfrom .constants import DATE_COLUMN_NAME\n\nimport logging\n_log = logging.getLogger(__name__)\n\n\nUK_CASES_PATH = 'https://api.coronavirus.data.gov.uk/v2/data?areaType=TOREPLACE&metric=cumCasesBySpecimenDate&metric=newCasesBySpecimenDate&metric=cumCasesByS...
[ [ "pandas.read_csv", "numpy.sort", "numpy.setdiff1d", "pandas.concat" ] ]
jasoncin/dewarp-deskew-stn
[ "050170fadceb9d98508aec6a855ea36b9b06cb74" ]
[ "ops.py" ]
[ "import tensorflow as tf\nimport tensorflow.contrib as tf_contrib\nimport numpy as np\nfrom transformer import spatial_transformer_network as stn\n\n# Xavier : tf_contrib.layers.xavier_initializer()\n# He : tf_contrib.layers.variance_scaling_initializer()\n# Normal : tf.random_normal_initializer(mean=0.0, stddev=0....
[ [ "tensorflow.contrib.layers.batch_norm", "tensorflow.constant_initializer", "tensorflow.nn.conv2d", "tensorflow.contrib.layers.fully_connected", "tensorflow.python.ops.array_ops.where", "tensorflow.reshape", "tensorflow.clip_by_value", "tensorflow.losses.mean_squared_error", "te...
eytanadler/OpenMDAO
[ "c9d2eb2444241d6551ba9a1853436de5dd673687", "c9d2eb2444241d6551ba9a1853436de5dd673687" ]
[ "openmdao/core/problem.py", "openmdao/utils/array_utils.py" ]
[ "\"\"\"Define the Problem class and a FakeComm class for non-MPI users.\"\"\"\n\nimport sys\nimport pprint\nimport os\nimport logging\nimport weakref\nimport time\n\nfrom collections import defaultdict, namedtuple, OrderedDict\nfrom fnmatch import fnmatchcase\nfrom itertools import product\n\nfrom io import StringI...
[ [ "scipy.sparse.issparse", "numpy.isnan", "numpy.linalg.norm", "numpy.asarray", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.any", "numpy.prod" ], [ "numpy.max", "numpy.full", "scipy.sparse.coo_matrix", "numpy.asarray", "numpy.zeros", "numpy.ones",...
tamiresdatascience/napari
[ "deec4259e8e92bd6b42e11107e8f3dd6b756ad46" ]
[ "napari/_tests/test_viewer.py" ]
[ "import os\n\nimport numpy as np\nimport pytest\n\nfrom napari import Viewer, layers\nfrom napari._tests.utils import (\n add_layer_by_type,\n check_view_transform_consistency,\n check_viewer_functioning,\n layer_test_data,\n)\nfrom napari.utils._tests.test_naming import eval_with_filename\n\n\ndef _get...
[ [ "numpy.count_nonzero", "numpy.random.rand", "numpy.zeros", "numpy.random.seed", "numpy.sum", "numpy.random.randint", "numpy.random.random" ] ]
rskene/phat
[ "84a946e1e638642f36ce5fd81dc85aa89f7b66f0" ]
[ "src/phat/learn/dists.py" ]
[ "\"\"\"\nTensorflow does not support scipy, therefore, all distributions in \nphat/dists.py must be replicated via tensorflow_probability \n\"\"\"\n\nimport numpy as np\n\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nimport tensorflow_probability as tfp\nfrom tensorflo...
[ [ "tensorflow.convert_to_tensor", "tensorflow.size", "tensorflow.shape", "tensorflow.where", "tensorflow.equal", "tensorflow.math.less", "tensorflow.ones_like", "tensorflow.math.log", "tensorflow.TensorShape", "tensorflow.ones", "tensorflow.constant", "tensorflow.math...
Drizzy3D/OCROnWebpages
[ "35a5faea5f682f669adf2016a7e28d3329c72da8" ]
[ "evaluation/visualise.py" ]
[ "from optparse import OptionParser\nfrom pathlib import Path\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib\nimport json\nimport re\nimport csv\nfrom matplotlib import rcParams\nimport collections\n\nrcParams['font.family'] = 'serif'\nrcParams['font.sans-serif'] = ['Palatino']\nrcParams['fo...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.pyplot.barh", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.tight_layout", "numpy.arange", ...
itruonghai/mmaction2
[ "ea94bfd9d2e43289a123276d3ec11d0deb887357" ]
[ "mmaction/models/recognizers/base.py" ]
[ "from abc import ABCMeta, abstractmethod\nfrom collections import OrderedDict\n\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.runner import auto_fp16\n\nfrom .. import builder\n\n\nclass BaseRecognizer(nn.Module, metaclass=ABCMeta):\n \"\"\"Bas...
[ [ "torch.distributed.is_available", "torch.distributed.is_initialized", "torch.distributed.get_world_size", "torch.nn.functional.softmax" ] ]
economicnetwork/archon
[ "2090d0568f198e08c0c6f0ae535ab06630e1db9b" ]
[ "examples/bitmex/pandas.py" ]
[ "from numpy import array\nimport archon.broker as broker\nimport archon.exchange.exchanges as exc\nimport archon.exchange.bitmex.bitmex as mex\nimport archon.exchange.exchanges as exc\nimport archon.exchange.bitmex.bitmex as mex\nimport datetime\nfrom archon.brokerservice.brokerservice import Brokerservice\nfrom ut...
[ [ "pandas.DataFrame" ] ]
tsetimmy/kusanagi
[ "868b301b6064af7d21f0f716aa4390e402f2e2ec", "868b301b6064af7d21f0f716aa4390e402f2e2ec" ]
[ "kusanagi/utils/distributions.py", "kusanagi/base/ExperienceDataset.py" ]
[ "import numpy as np\n\n\nclass Distribution(object):\n '''\n Base class for distribution. Useful for estimating and sampling\n initial state distributions\n '''\n def fit(data):\n raise NotImplementedError\n\n def sample(self, n_samples=1):\n raise NotImplementedError\n\n ...
[ [ "numpy.array", "numpy.random.randn", "numpy.tile", "numpy.linalg.cholesky" ], [ "numpy.concatenate", "numpy.array", "numpy.zeros" ] ]
zhh2005757/slambook2_in_Docker
[ "f0e71327d196cdad3b3c10d96eacdf95240d528b" ]
[ "slambook2/3rdparty/Pangolin/pyexamples/SimpleVideo.py" ]
[ "import sys\r\nfrom pathlib import Path\r\nimport os\r\nfrom matplotlib import pyplot as plt\r\nimport argparse\r\nimport numpy as np\r\nimport time\r\n\r\n\r\n# add pangolin to PYTHONPATH\r\nhomeDir = str(Path.home())\r\nsys.path.append(os.path.join(homeDir, 'ws/Pangolin/build/src'))\r\n\r\n# import pypangolin\r\n...
[ [ "numpy.squeeze" ] ]
beer-asr/gsm
[ "5722d9271b57f119ed5477895c8fc94c92e46b57" ]
[ "plotting.py" ]
[ "\nimport numpy as np\n\ndef plot_shaded_area(fig, xy1, xy2, **kwargs):\n upper_band = np.append(xy1[:,0], xy2[:, 0][::-1])\n lower_band = np.append(xy1[:,1], xy2[:, 1][::-1])\n fig.patch(upper_band, lower_band, **kwargs)\n \ndef create_upper_semicircle(radius, npoints):\n angles = np.linspace(0, np....
[ [ "numpy.append", "numpy.sin", "numpy.eye", "numpy.cos", "numpy.linalg.cholesky", "numpy.linspace" ] ]
eltoto1219/multimodal-pretraining
[ "c5ca38c4f22901b6a94280b973f4a49dce4a828f" ]
[ "src/tasks/gqa_model.py" ]
[ "# coding=utf-8\n# Copyleft 2019 project LXRT.\n\nimport torch.nn as nn\n\nfrom param import args\nfrom lxrt.entry import LXRTEncoder\nfrom lxrt.modeling import BertLayerNorm, GeLU\n\n# Max length including <bos> and <eos>\nMAX_GQA_LENGTH = 20\n\n\nclass GQAModel(nn.Module):\n def __init__(self, num_answers):\n ...
[ [ "torch.nn.Linear" ] ]
nagnath001/reconcile-a-report-using-pandas
[ "f5bd3b62650b9c4976bb0814cd2a2255a09e5d7b" ]
[ "code.py" ]
[ "# --------------\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\n# Code starts here\ndf=pd.read_csv(path)\ndf['state']=df['state'].str.lower()\ndf['total']=df['Jan']+df['Feb']+df['Mar']\nsum_row=df[[\"Jan\",\"Feb\",\"Mar\",\"total\"]].sum()\ndf_final=df.append(...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.read_html" ] ]
uro1012/MIALab
[ "49c68613fa2f7b3f349df63f973f1d6f8549ef9b" ]
[ "exercise/exercise_rf.py" ]
[ "\"\"\"A decision forest toy example.\n\nTrains and evaluates a decision forest classifier on a 2-D point cloud.\n\"\"\"\n\nimport argparse\nimport datetime\nimport os\nimport sys\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import ListedColormap\nimport sklearn.ensemble as sk_ense...
[ [ "matplotlib.pyplot.contourf", "sklearn.ensemble.RandomForestClassifier", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "sklearn.metrics.accuracy_score", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "numpy.arange", "matplotlib.py...
nurshafa/uaspemkom
[ "f370621ba81f21fc31c139f9ab0ac5dbb75c384e" ]
[ "main_streamlit.py" ]
[ "#Nur Shafa Erinda / 12220150 / UAS\r\n\r\n#import data dan modul yang diperlukan\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport json, requests\r\nimport streamlit as st\r\nfrom PIL import Image\r\n\r\nst.set_page_config(layout=\"wide\")\r\nst.set_option('deprecation.showPyplotGlobalUse', False...
[ [ "matplotlib.pyplot.show", "pandas.read_csv" ] ]
hsteffens/image-recognition
[ "5c465f2a4812dd56b822bf20f37123357c4cf054" ]
[ "HOG/training.py" ]
[ "import cv2\nimport pandas as pd\nimport numpy\nimport os\n\n\ndef getdataset(items, path, size, classification):\n for x in range(1, size):\n image = cv2.imread(path + '{:03d}'.format(x) + '.bmp')\n if image is None:\n continue\n dim = (64, 128)\n image = cv2.resize(image,...
[ [ "pandas.DataFrame.from_records", "numpy.append" ] ]
conan7882/variational-autoencoder
[ "4960f252784a7dd2fbe203d7dad65938b57ee9c2" ]
[ "experiment/vae_mnist.py" ]
[ "#!/usr/bin/env python\r\n# -*- coding: utf-8 -*-\r\n# File: vae_mnist.py\r\n# Author: Qian Ge <geqian1001@gmail.com>\r\n\r\nimport os\r\nimport sys\r\nimport numpy as np\r\nimport tensorflow as tf\r\nimport platform\r\nimport scipy.misc\r\nimport argparse\r\nimport matplotlib.pyplot as plt\r\n\r\nsys.path.append('...
[ [ "tensorflow.summary.FileWriter", "numpy.reshape", "tensorflow.Session", "tensorflow.train.Saver", "matplotlib.pyplot.figure", "tensorflow.ConfigProto", "tensorflow.variable_scope", "matplotlib.pyplot.show", "tensorflow.global_variables_initializer", "numpy.squeeze" ] ]
kennetms/Accenture_Hybrid_Guided_VAE
[ "aae3c02d614b2ea7ceeebc9e70ef4f7a4b69ee2c" ]
[ "decolle/base_model.py" ]
[ "#!/bin/python\n# -----------------------------------------------------------------------------\n# -----------------------------------------------------------------------------\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch\nimport numpy as np\nfrom itertools import chain\nfrom collections import...
[ [ "torch.zeros", "torch.sigmoid", "torch.nn.ModuleList", "torch.nn.Sigmoid", "torch.no_grad", "torch.nn.Parameter", "torch.nn.ReLU", "torch.abs", "torch.ones", "torch.tensor", "numpy.sqrt", "torch.empty", "torch.Tensor" ] ]
huan/addons
[ "2de92d51297c7cfa631512dea4eaa3cc32530164" ]
[ "tensorflow_addons/optimizers/average_wrapper.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.group", "tensorflow.keras.optimizers.get", "tensorflow.keras.optimizers.serialize", "tensorflow.control_dependencies" ] ]
stevemandala/botorch
[ "4c094b8fe46513f895ce7c4409ff40f34fa9ddd6" ]
[ "test/models/test_utils.py" ]
[ "#! /usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport warnings\n\nimport torch\nfrom botorch import settings\nfrom botorch.exceptions import InputDataErro...
[ [ "torch.Size", "torch.rand", "torch.rand_like", "torch.tensor", "torch.equal", "torch.randn" ] ]
alal9987/keras-deeplab-v3-plus
[ "bab1a66021ce446ad601ee6a0a89ca9a156151e6" ]
[ "metrics.py" ]
[ "import numpy as np\nimport settings\nimport tensorflow as tf\nimport tensorflow.keras.backend as K\nfrom tensorflow.compat.v1 import to_int32\ntf.config.experimental_run_functions_eagerly(True)\n\n_IS_TF_2 = True\n\n\ndef Jaccard(y_true, y_pred):\n nb_classes = K.int_shape(y_pred)[-1]\n iou = []\n pred_pi...
[ [ "tensorflow.keras.backend.argmax", "tensorflow.keras.backend.int_shape", "tensorflow.keras.backend.sum", "tensorflow.where", "tensorflow.argmax", "tensorflow.config.experimental_run_functions_eagerly", "tensorflow.keras.backend.mean", "tensorflow.keras.backend.equal", "tensorfl...
jyu00/qiskit-aer
[ "de5a91171c9e2111ad94fa564abbd9922e7303a0" ]
[ "test/terra/backends/qasm_simulator/qasm_snapshot.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2019.\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 modificatio...
[ [ "numpy.allclose", "numpy.isclose", "numpy.random.default_rng" ] ]
charliezou/muzero-general
[ "342e35fcdb97cd200d8b4534b0546eee1da8c04e", "342e35fcdb97cd200d8b4534b0546eee1da8c04e" ]
[ "trainer.py", "games/lunarlander.py" ]
[ "import time\n\nimport numpy\nimport ray\nimport torch\n\nimport models\n\n\n@ray.remote\nclass Trainer:\n \"\"\"\n Class which run in a dedicated thread to train a neural network and save it\n in the shared storage.\n \"\"\"\n\n def __init__(self, initial_weights, config):\n self.config = con...
[ [ "torch.nn.LogSoftmax", "torch.device", "numpy.array", "numpy.zeros_like", "numpy.random.seed", "torch.manual_seed", "torch.tensor", "numpy.abs" ], [ "numpy.array", "numpy.sign", "torch.cuda.is_available", "numpy.abs", "numpy.clip", "numpy.sqrt" ] ]
Osarez7/models
[ "841df8f136ea712d5505caf71db19fa5dee3ac1d" ]
[ "official/nlp/data/tagging_data_lib.py" ]
[ "# Copyright 2020 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.io.gfile.GFile", "tensorflow.train.Features", "tensorflow.io.TFRecordWriter" ] ]