repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
qx-teo/covidcast-indicators
[ "6eabe62748a206b5e6d65f9e11c65ef1c76cdb0a" ]
[ "cdc_covidnet/delphi_cdc_covidnet/covidnet.py" ]
[ "\"\"\"\nGenerate COVID-NET sensors.\n\nAuthor: Eu Jing Chua\nCreated: 2020-06-12\n\"\"\"\n\nimport json\nimport logging\nimport os\nfrom typing import Tuple, List\nfrom multiprocessing import cpu_count, Pool\n\nimport requests\nimport pandas as pd\n\nfrom .api_config import APIConfig\n\nclass CovidNet:\n \"\"\"...
[ [ "pandas.to_datetime", "pandas.DataFrame.from_records", "pandas.concat" ] ]
microsoft/msrflute
[ "4eda3eaccd2c7e76b412668a9a6d7b1571209372" ]
[ "extensions/RL/RL.py" ]
[ "# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT license.\n\nimport logging\nimport os\nimport json\nimport random\nimport torch\nimport torch.nn as nn\nimport numpy as np\nfrom collections import OrderedDict\nfrom utils import ( make_lr_scheduler,\n print_rank,\n ...
[ [ "numpy.concatenate", "torch.nn.Linear", "torch.rand", "torch.nn.MSELoss", "torch.nn.Softmax", "numpy.zeros", "torch.nn.Sequential", "torch.from_numpy", "torch.nn.ReLU", "torch.nn.BatchNorm1d", "torch.load", "torch.sum" ] ]
Spico197/REx
[ "bb3cdb845765a63e9bd18070068af52a1b2db3f3" ]
[ "rex/modules/ffn.py" ]
[ "from typing import Optional, Iterable\n\nimport torch\nimport torch.nn as nn\n\nfrom rex.modules.dropout import SharedDropout\n\n\nclass FFN(nn.Module):\n \"\"\"\n Multi-layer feed-forward neural networks\n\n Args:\n input_dim: input dimension\n output_dim: output dimension\n mid_dims...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.Identity", "torch.nn.Sequential", "torch.nn.LeakyReLU", "torch.nn.init.orthogonal_", "torch.nn.init.zeros_" ] ]
shiyeli/machine_learn
[ "3975c678d985c468deecd03560d882e9d316bb63" ]
[ "projects/nets/resnet_utils.py" ]
[ "# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\r\n#...
[ [ "tensorflow.pad", "tensorflow.variable_scope" ] ]
cevheri/superset
[ "34542db3b615ff556281f80410f322f41f5a97a6" ]
[ "superset/connectors/druid/models.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...
[ [ "pandas.DataFrame" ] ]
bencoster/DAIN
[ "9699f6ded59da7f6f273e2f453f4f73e2aa1d81e" ]
[ "load_functions/prepare_split_aug_images.py" ]
[ "from skimage import io\nimport numpy as np\nfrom tqdm import tqdm\nimport shutil\nimport os\nfrom aicsimageio import AICSImage, imread\nimport shutil\nimport time\nimport numpy\nimport random\nfrom aicsimageio import AICSImage, imread\nfrom aicsimageio.writers import png_writer \nfrom tqdm import tqdm\nfrom google...
[ [ "numpy.rot90", "numpy.fliplr" ] ]
GuoQuanhao/Contrib
[ "9069366559d0353c96075ed573222f3fbdfabafe" ]
[ "UGATIT-Paddle-master/utils.py" ]
[ "import os\r\nimport cv2\r\nimport numpy as np\r\nfrom paddle.fluid.layers import sigmoid_cross_entropy_with_logits, reduce_sum, reduce_mean, clip, pad2d, relu, \\\r\n leaky_relu, tanh, interpolate\r\nfrom paddle.fluid.dygraph import SpectralNorm,Layer\r\n\r\n\"\"\" tools\"\"\"\r\n\r\n\r\ndef check_folder(log_di...
[ [ "numpy.max", "numpy.uint8", "numpy.min" ] ]
qingziguanjun/AIStudy
[ "70ab93e9dd09f0f545936ba0eb95f21f87920d4c" ]
[ "MachineLearning/tutorials_python/introductory/customizing.py" ]
[ "\"\"\"\nCustomizing Matplotlib with style sheets and rcParams\n=====================================================\n\nTips for customizing the properties and default styles of Matplotlib.\n\nUsing style sheets\n------------------\n\nThe ``style`` package adds support for easy-to-switch plotting \"styles\" with\n...
[ [ "matplotlib.pyplot.style.context", "matplotlib.pyplot.plot", "numpy.random.randn", "matplotlib.rc", "matplotlib.pyplot.style.use", "matplotlib.pyplot.show", "numpy.linspace" ] ]
howardpen9/eth_analytics
[ "9ec2583b864fb41519c654a754218530c944ccf6" ]
[ "defi_historical/lending/liquidations.py" ]
[ "import pandas as pd \nimport plotly.graph_objects as go\nfrom plotly.subplots import make_subplots\n\n#import plotly.express as px\n\n# Users over time \naave_liquidations = pd.read_csv('data/aave_liquidations.csv') \ncompound_liquidations = pd.read_csv('data/compound_liquidations.csv') \n\naave_liquidations = a...
[ [ "pandas.read_csv" ] ]
zzong2006/space-filling-curve-with-RF-learning
[ "30823745dae91240c0977185fb1831c9b4771a40" ]
[ "deprecated/main(ActorCritic).py" ]
[ "import sys\nimport torch\nimport torch.nn as nn\nfrom torch import optim\nimport torch.nn.functional as F\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom itertools import combinations\nfrom utils import *\nfrom torch.autograd import Variable\nfrom multiprocessing import Process, Pipe\n\n'''\n * 08-22 : ...
[ [ "torch.nn.Linear", "torch.cat", "numpy.random.choice", "numpy.mean", "torch.ones", "torch.cuda.is_available", "numpy.concatenate", "numpy.zeros_like", "numpy.empty", "matplotlib.pyplot.subplots", "numpy.arange", "matplotlib.pyplot.tight_layout", "numpy.sqrt", ...
rohithredd94/Computer-Vision-using-OpenCV
[ "9238a3284158f566461782e1410a5bf3ef88c03b" ]
[ "Harris-Corners/harris_corners.py" ]
[ "import cv2\nimport numpy as np\nimport sys\nimport random\nfrom collections import OrderedDict\n\nimgs = ['transA.jpg', 'transB.jpg', 'simA.jpg', 'simB.jpg']\n\ndef calc_grad(img, k_sobel, norm,k):\n if k == 'x':\n grad = cv2.Sobel(img, cv2.CV_64F, 1, 0, k_sobel)\n elif k == 'y':\n grad = cv2.S...
[ [ "numpy.array", "numpy.zeros", "numpy.linalg.det", "numpy.nonzero", "numpy.float32", "numpy.hstack" ] ]
codeforfrankfurt/PolBotCheck
[ "cef5136008301dcb16eb06dc5f18d00510c77f35" ]
[ "polbotcheck/plots/front_back_link.py" ]
[ "import sys\nfrom os import path\nsys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )\n\nimport db\nimport seaborn as sns\nimport pandas as pd\nimport numpy as np\n\n# takes data (that should come from the backend) and creates the output we would like to have\n# on the front end.\n\ndef follow...
[ [ "numpy.array", "pandas.Series" ] ]
ACTCollaboration/moby2
[ "b0f6bd6add7170999eb964d18f16d795520426e9" ]
[ "python/tod/flags.py" ]
[ "from __future__ import print_function\nfrom __future__ import absolute_import\nfrom past.builtins import basestring\nimport moby2\nimport numpy as np\n\nfrom moby2.tod import TODCuts, CutsVector\nfrom moby2.util import HDFArchive\n\nclass TODFlags:\n \"\"\"\n Manages the association of a set of flags to each...
[ [ "numpy.any", "numpy.array", "numpy.arange", "numpy.zeros" ] ]
WenRichard/Customer-Chatbot
[ "48508c40574ffac8ced414a5bea799e2c85341ca" ]
[ "smart-chatbot-zero/Recall/recall_model.py" ]
[ "# -*- coding: utf-8 -*-\n# @Time : 2019/4/3 16:48\n# @Author : Alan\n# @Email : xiezhengwen2013@163.com\n# @File : tmodel.py\n# @Software: PyCharm\n\nimport pandas as pd\nimport matplotlib as mpl\nimport numpy as np\nfrom nltk.probability import FreqDist\nimport time\n\nfrom .jiebaSegment import *\nfrom ....
[ [ "numpy.array", "pandas.read_csv" ] ]
uyhcire/hexit
[ "d35a712e34e751cb754397240d284bb0a48b6b5b" ]
[ "neural/train.py" ]
[ "import os\nimport random\n\nimport tensorflow as tf\nimport training_game_pb2\n\n\nRESIDUAL_FILTERS = 16\nRESIDUAL_BLOCKS = 2\nLEARNING_RATE = 0.1\n\n\ndef get_data():\n inputs = []\n policy_targets = []\n value_targets = []\n\n i = 0\n while os.path.exists('training_games/{}'.format(i)):\n p...
[ [ "tensorflow.keras.optimizers.SGD", "tensorflow.keras.layers.Input", "tensorflow.Session", "tensorflow.keras.backend.set_session", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "tensorflow.saved_model.builder.SavedModelBuilder" ] ]
LonelyTItor/TransAnomaly
[ "dd33ef87cbf786a73d5af320c57fb3cc285ca1ea" ]
[ "myTest.py" ]
[ "from utils import load_cifar10, load_cats_vs_dogs, load_fashion_mnist, load_cifar100\nimport numpy as np\nimport os\n\ndest_dir = './res/cifar10/'\n\nfile_list = os.listdir(dest_dir)\nfile_lists = [file for file in file_list if file[-3:] =='npz']\nprint(file_lists)\n\nfor file in file_lists:\n a = np.load(dest_...
[ [ "numpy.load" ] ]
AbdelkaderMH/sarcasm_wanlp
[ "76850cea42b72b6a0da74532dd8eaa90a926630b" ]
[ "losses.py" ]
[ "import numpy as np\nimport torch.nn as nn\nimport torch\nimport torch.nn.functional as F\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\n\nclass ModelMultitaskLoss(nn.Module):\n def __init__(self):\n super(ModelMultitaskLoss, self).__init__()\n self.eta = nn.Parameter...
[ [ "torch.nn.functional.one_hot", "torch.cuda.is_available", "torch.tensor", "torch.nn.functional.softmax", "torch.exp", "torch.nn.CrossEntropyLoss" ] ]
chuyj/saliency
[ "878680dd326f983b051fc33dd6212f28f1d9a7a7" ]
[ "saliency/integrated_gradients_test.py" ]
[ "# Copyright 2019 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "numpy.array", "tensorflow.python.platform.googletest.main", "tensorflow.Graph", "tensorflow.Session", "tensorflow.placeholder", "tensorflow.sin" ] ]
sargas/scipy
[ "3dcb7b2d5da7fcd9529137aa96b7a771cd47f111" ]
[ "scipy/optimize/tests/test_tnc.py" ]
[ "\"\"\"\nUnit tests for TNC optimization routine from tnc.py\n\"\"\"\n\nfrom numpy.testing import (assert_allclose, assert_equal, TestCase,\n run_module_suite)\n\nfrom scipy import optimize\nimport numpy as np\nfrom math import pow\n\nclass TestTnc(TestCase):\n \"\"\"TNC non-linear opti...
[ [ "numpy.matrix", "numpy.testing.run_module_suite", "numpy.array", "numpy.sin", "numpy.cos", "scipy.optimize.fmin_tnc", "scipy.optimize.minimize" ] ]
ivangarrera/MachineLearning
[ "c13584cdcb7c4df1ab2814cf42a3c2bd3c203e75" ]
[ "src/features/basic_data_cleaning.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport pandas as pd\n\n\nclass BasicCleaning:\n @classmethod\n def CleanData(cls, path_to_data, var):\n data_set = pd.read_csv(path_to_data, sep=',')\n \n # Convert string to datetime\n data_set['TimeStemp'] = pd.to_datetime(data_set['TimeStemp'])\n ...
[ [ "pandas.to_datetime", "pandas.read_csv" ] ]
mskcc/ACCESS-Pipeline
[ "3441040dfaecba58150c13a95a6a93657b00778a" ]
[ "python_tools/pipeline_kickoff/create_title_file_from_samplesheet.py" ]
[ "#!/usr/bin/env python\nimport xlrd\nimport argparse\nimport pandas as pd\n\nfrom python_tools.constants import *\n\n# Suppress pandas copy warning\npd.options.mode.chained_assignment = None\n\n##################################\n# Pipeline Kickoff Step #1\n#\n# This module is used to create a title file with the i...
[ [ "pandas.read_csv", "pandas.read_excel" ] ]
davmre/autoreparam
[ "c25340f272209278d336627cca42e139c0e4c961" ]
[ "util.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.ones", "numpy.mean", "tensorflow.reshape", "tensorflow.compat.v1.placeholder", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.python.ops.parallel_for.pfor", "numpy.nan_to_num", "tensorflow.concat", "tensorflow.compat.v1.train.AdamOptimizer", "t...
sfvnDTU/deep_detektor
[ "3413b805b1d108480358a3f50ec5bb18b1d6845b" ]
[ "run_files/loo_cv.py" ]
[ "from pathlib import Path\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport xarray as xr\nfrom sklearn.model_selection import LeaveOneOut\n\nfrom models.model_base import DetektorModel\nfrom project_paths import ProjectPaths\nfrom evaluations import Accuracy, F1, TruePositives, TrueNegatives, FalsePosi...
[ [ "sklearn.model_selection.LeaveOneOut", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "numpy.where", "numpy.squeeze" ] ]
marsggbo/hyperbox
[ "91dcd04ad30164bcb12209d818df18961fa3f347" ]
[ "hyperbox/networks/mobilenet/mobile_net.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport math\r\n\r\nfrom hyperbox.mutables.spaces import OperationSpace\r\nfrom hyperbox.utils.utils import load_json\r\n\r\nfrom hyperbox.networks.base_nas_network import BaseNASNetwork\r\nfrom hyperbox.networks.mobilenet.mobile_ops import *\r\nfrom hyperbox.networks.mobile...
[ [ "torch.nn.AdaptiveAvgPool2d", "torch.nn.ModuleList" ] ]
shatadru99/archai
[ "8501080f8ecc73327979c02387e02011efb4c335" ]
[ "archai/common/trainer.py" ]
[ "# Copyright (c) Microsoft Corporation.\r\n# Licensed under the MIT license.\r\n\r\nfrom typing import Callable, Tuple, Optional\r\n\r\nimport torch\r\nfrom torch import nn, Tensor\r\nfrom torch.optim.optimizer import Optimizer\r\nfrom torch.optim.lr_scheduler import _LRScheduler\r\nfrom torch.utils.data import Dat...
[ [ "torch.tensor", "torch.chunk" ] ]
PaNOSC-ViNYL/wofrysrw
[ "0b69374d1820b13f553dc53cd957f8727c127f41" ]
[ "wofrysrw/beamline/optical_elements/gratings/srw_grating.py" ]
[ "import numpy\n\nfrom syned.beamline.optical_elements.gratings.grating import Grating\nfrom syned.beamline.shape import Ellipse, Rectangle, Circle\n\nfrom wofrysrw.beamline.optical_elements.srw_optical_element import SRWOpticalElementWithAcceptanceSlit\nfrom wofrysrw.propagator.wavefront2D.srw_wavefront import Wave...
[ [ "numpy.sin", "numpy.cos" ] ]
avilay/utils
[ "8c8d5f61173622e4d1c76094ad877c6d097f0972" ]
[ "ml/bindata.py" ]
[ "import os\nfrom collections import namedtuple\nfrom pathlib import Path\nfrom tempfile import NamedTemporaryFile\nfrom urllib.parse import urlsplit, urlunsplit\n\nimport numpy as np\nimport pandas as pd\nimport sklearn.datasets as skdata\nfrom google.cloud import storage\nfrom google.cloud.exceptions import NotFou...
[ [ "pandas.read_csv", "sklearn.datasets.make_classification" ] ]
ethanfuerst/nba_vis
[ "9996eb72a451565dddcbed76cadec9229d55fcbd" ]
[ "nba_data.py" ]
[ "import numpy as np\nimport pandas as pd\nimport requests\nimport re\nimport time\nimport os\nfrom bs4 import BeautifulSoup\nfrom nba_api.stats.endpoints import leaguestandings\n\n\ndef get_colors(teamname):\n if teamname == 'New Orleans Pelicans':\n teamname = 'New Orleans Pelicans Team'\n URL = f\"ht...
[ [ "pandas.read_html" ] ]
pygeo/geoval
[ "48a21abb8de974328af6a16a70710a85713fda64" ]
[ "tests/test_data.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nThis file is part of GEOVAL.\n(c) 2012- Alexander Loew\nFor COPYING and LICENSE details, please refer to the LICENSE file\n\"\"\"\n\nimport sys\nsys.path.append('..')\n\nimport unittest\n\nfrom geoval.core import GeoData\nfrom geoval.region import RegionPolygon\n\nimport os\nimport...
[ [ "matplotlib.pylab.date2num", "numpy.ones_like", "scipy.stats.linregress", "scipy.stats.mstats.scoreatpercentile", "matplotlib.pylab.show", "numpy.random.random", "numpy.arange", "numpy.sqrt", "scipy.stats.mstats.spearmanr", "matplotlib.pylab.plot", "numpy.array", "n...
Y-F-Acoustics/Python_DSP_Study
[ "2e0232d6875c6109321c8b3a90d3b62ce3fc200a" ]
[ "03_Chapter3/01_Section1/Script3-1-1.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Nov 29 00:44:57 2021\r\n\r\n@author: yuki1\r\n\"\"\"\r\nimport math\r\nimport numpy as np\r\nfrom scipy import signal\r\nimport matplotlib.pyplot as plt\r\n\r\n# Generate the Signal\r\nx = np.array([1, 1, 1, 1, 0, 0, 0, 0])\r\nn = np.arange(0, len(x))\r\n\r\n# Pl...
[ [ "numpy.max", "numpy.array", "numpy.fft.fftshift", "numpy.min", "matplotlib.pyplot.figure", "numpy.fft.fft", "numpy.abs", "scipy.signal.freqz", "numpy.linspace" ] ]
rjhanes/biosteam
[ "ee345ac0b14ce4de9b38ac5a467588d2f854da71" ]
[ "build/lib/biosteam/units/_multi_effect_evaporator.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Aug 23 21:43:13 2018\n\n@author: yoelr\n\"\"\"\nimport numpy as np\nimport biosteam as bst\nfrom .. import Unit, Stream\nfrom scipy.optimize import brentq\nfrom . import Mixer, HXutility\nfrom ._flash import Evaporator_PV, Evaporator_PQ\nfrom .designtools import vacu...
[ [ "scipy.optimize.brentq" ] ]
vzhuang/rlpyt
[ "3abf873e4bae0cd9cccbb9e5c9cc4c875710f6b6" ]
[ "rlpyt/distributions/gaussian.py" ]
[ "\nimport torch\nimport math\n\nfrom rlpyt.distributions.base import Distribution\nfrom rlpyt.utils.collections import namedarraytuple\nfrom rlpyt.utils.tensor import valid_mean\n\nEPS = 1e-8\n\nDistInfo = namedarraytuple(\"DistInfo\", [\"mean\"])\nDistInfoStd = namedarraytuple(\"DistInfoStd\", [\"mean\", \"log_std...
[ [ "torch.clamp", "torch.tensor", "torch.ones_like", "torch.zeros_like", "torch.tanh", "torch.log", "torch.exp", "torch.sum" ] ]
redjerdai/lazy_graph
[ "a6d32a235bc68728077971224d975bcea3f88c3a" ]
[ "graph_skeleton.py" ]
[ "# Lazy Miner v.0.1.6\n# @author: redjerdai\n# TODO: Add graphviz configuration options [10]\nimport numpy\nimport pandas\n\nimport os\nos.environ[\"PATH\"] += os.pathsep + 'E:\\\\RAMP-EXTERNAL\\\\IP-02\\\\OSTRTA\\\\graphviz-2.38\\\\release\\\\bin'\nfrom graphviz import Digraph\n\n# TODO: make nodes and edges class...
[ [ "numpy.full", "numpy.array", "numpy.quantile", "pandas.DataFrame", "pandas.Series" ] ]
elton-souza/IGTI-Python
[ "2633dd70af8403a6ab52f8f97ee53063dbb0ef77" ]
[ "2 - Analise de Dados/Aula 6.py" ]
[ "#Regressão linear numpy\n\n#Visualização de dados\nfrom matplotlib import pyplot as plt\n\n#dados\nx = [1, 2 ,3 ,4 , 5, 6]\ny = [10, 50 , 100, 150, 200, 250]\n\n#plot dos dados\nplt.figure(figsize=(10,5))\nplt.plot(x,y,'o',label = 'Dados originais')\nplt.legend()\nplt.xlabel(\"x\")\nplt.ylabel(\"Y\")\nplt.grid()\n...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
semeraro/yt
[ "aad3cfa3b4ebab7838352ab467275a27c26ff363" ]
[ "yt/frontends/gadget/simulation_handling.py" ]
[ "import glob\nimport os\n\nimport numpy as np\nfrom unyt import dimensions, unyt_array\nfrom unyt.unit_registry import UnitRegistry\n\nfrom yt.data_objects.time_series import DatasetSeries, SimulationTimeSeries\nfrom yt.funcs import only_on_root\nfrom yt.loaders import load\nfrom yt.utilities.cosmology import Cosmo...
[ [ "numpy.array", "numpy.digitize" ] ]
isears/addons
[ "e18fcfc5cce8a8176189ce0e21416936fd588f35" ]
[ "tensorflow_addons/layers/spectral_normalization.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.initializers.TruncatedNormal", "tensorflow.keras.backend.learning_phase", "tensorflow.TensorShape", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.keras.layers.InputSpec", "tensorflow.name_scope", "tensorflow.keras.utils.register_keras_serializable" ] ]
shadowk29/ising2d
[ "6e42efc7738b066bbfb6cc9f0d7c79a24ee86325" ]
[ "example_data.py" ]
[ "from ising2d import ising2d\nimport numpy as np\n\ndef main():\n tauneg = -np.array([10**n for n in np.linspace(-2, -0.26, 8)])\n taupos = np.array([10**n for n in np.linspace(-2, -0.12, 8)])\n tau = np.append(tauneg, taupos)\n tau = np.append(tau, 0)\n temperatures = 2/np.log(1+np.sqrt(2))*(1+tau)\...
[ [ "numpy.linspace", "numpy.sqrt", "numpy.append" ] ]
densechen/DIP
[ "957de1d3e4e8b663ce305e896c7a82a0bd044301" ]
[ "utils/utils.py" ]
[ "'''\nDescripttion: densechen@foxmail.com\nversion: 0.0\nAuthor: Dense Chen\nDate: 1970-01-01 08:00:00\nLastEditors: Dense Chen\nLastEditTime: 2020-08-12 20:45:43\n'''\nimport math\nfrom collections import Counter, OrderedDict, namedtuple\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom PI...
[ [ "torch.cat", "torch.acos", "torch.stack", "torch.nn.functional.l1_loss", "torch.norm", "torch.any", "torch.autograd.Variable", "torch.clamp", "torch.bmm", "torch.cross", "torch.index_select", "torch.exp", "torch.clamp_min" ] ]
lamkina/OpenMDAO
[ "280bea25449ce2e64637e45b9b4f9f872796afec" ]
[ "openmdao/core/tests/test_indep_var_comp.py" ]
[ "\"\"\"IndepVarComp tests used in the IndepVarComp feature doc.\"\"\"\nimport unittest\nimport numpy as np\n\nimport openmdao.api as om\nfrom openmdao.utils.assert_utils import assert_near_equal, assert_warning, assert_warnings\nfrom openmdao.warnings import OMDeprecationWarning\n\n\nclass TestIndepVarComp(unittest...
[ [ "numpy.array", "numpy.zeros" ] ]
mjamroz/gluon-cv
[ "5966f657df51e90df04aa592890241079a835604" ]
[ "docs/tutorials/segmentation/demo_icnet.py" ]
[ "\"\"\"7. Test with ICNet Pre-trained Models for Multi-Human Parsing\n======================================\n\nThis is a quick demo of using GluonCV ICNet model for multi-human parsing on real-world images.\nPlease follow the `installation guide <../index.html>`_ to install MXNet and GluonCV if not yet.\n\"\"\"\ni...
[ [ "matplotlib.pyplot.show", "matplotlib.image.imread", "matplotlib.pyplot.imshow" ] ]
JasmineSamadi/ORSuite
[ "e2b2b0a5b497ea6566e794dcef1f176081fca4ce" ]
[ "or_suite/agents/resource_allocation/equal_allocation.py" ]
[ "import numpy as np\nfrom .. import Agent\n\n\n\"\"\" Agent which implements several heuristic algorithms\"\"\"\n\n\nclass equalAllocationAgent(Agent):\n\n def __init__(self, epLen, env_config):\n \"\"\"\n Args:\n epLen: number of steps\n func: function used to decide action\n...
[ [ "numpy.sum", "numpy.copy", "numpy.zeros" ] ]
yradeva93/estimagic
[ "77d840ba01748314b35be8117c99460a1944062f" ]
[ "estimagic/tests/logging/test_database_utilities.py" ]
[ "import pickle\nfrom datetime import datetime\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nimport sqlalchemy\nfrom numpy.testing import assert_array_equal\nfrom sqlalchemy import Float\nfrom sqlalchemy import PickleType\n\nfrom estimagic.logging.database_utilities import append_row\nfrom estimagic.log...
[ [ "pandas.DataFrame", "numpy.testing.assert_array_equal", "numpy.ones", "numpy.arange" ] ]
Soooooda/flask-vue-crud
[ "c6e5cc87baec96911b44e37103e334819e2eedc5" ]
[ "server/utils/inference.py" ]
[ "from typing import Optional, Union\n\nimport numpy as np\nimport pandas as pd\nimport torch\nfrom torch.utils.data import DataLoader\nfrom tqdm import tqdm\n\n\ndef process_dataloader(model, dataloader, input_key: Optional[str] = None,\n output_key: Optional[Union[str, int]] = None, method: O...
[ [ "numpy.array", "torch.utils.data.DataLoader", "torch.no_grad" ] ]
DongYongfei36/End-to-end-ASR-Pytorch
[ "4c82b8fab4aa45faaa16402e615655a219398346" ]
[ "src/module.py" ]
[ "import torch\nimport numpy as np\nimport torch.nn as nn\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\n\n\nclass VGGExtractor(nn.Module):\n ''' VGG extractor for ASR described in https://arxiv.org/pdf/1706.02737.pdf'''\n\n def __init__(self, input_dim):\n super(VGGExtractor...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "torch.nn.LayerNorm", "numpy.zeros", "torch.nn.Softmax", "torch.nn.Conv1d", "torch.nn.MaxPool2d", "torch.from_numpy", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.tanh" ] ]
jdro10/ESTG-ML-Spam-Detection
[ "76bbaacf276f9218574325a4c2f82b5be9cd1da9" ]
[ "rest_api/controllers/controller.py" ]
[ "import joblib\nimport csv\nimport numpy as np\nimport wordninja as wn\nimport re\nfrom nltk.corpus import stopwords\nfrom nltk.tokenize import word_tokenize\nfrom nltk.stem import WordNetLemmatizer\nimport unidecode\n\nstopwords = set(stopwords.words('english'))\nwordnet_lemmatizer = WordNetLemmatizer()\n\n\ndef r...
[ [ "numpy.array" ] ]
ZamyDZ/Master-Thesis-Development-of-a-Deep-RL-Model-for-simulated-Driving-2D-Vector-Space
[ "8aaecb8bd565456ce365c9865ed809deed4c6231" ]
[ "docker/src/basis_ddqn.py" ]
[ "import sys\nimport gym\nimport random\nimport numpy as np\nimport cv2\nimport skimage as skimage\nimport skimage as skimage\nfrom skimage import transform, color, exposure\nfrom skimage.transform import rotate\nfrom skimage.viewer import ImageViewer\nfrom collections import deque\nfrom keras.layers import Dense\n#...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.random.rand", "numpy.zeros", "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.ConfigProto", "tensorflow.compat.v1.Session", "numpy.stack", "numpy.argmax", "numpy.random.uniform", "numpy.append"...
lzkelley/zcode
[ "55a63693fe3ad744957d7ce2d74fb4c8e09ea8ba" ]
[ "zcode/astro/gws.py" ]
[ "\"\"\"Gravitational Waves related functions\n\nReferences:\n- EN07 : [Enoki & Nagashima 2007](https://ui.adsabs.harvard.edu/abs/2007PThPh.117..241E/abstract)\n- Sesana+2004 : [Sesana+2004](http://adsabs.harvard.edu/abs/2004ApJ...611..623S)\n\"\"\"\n\n\nimport numpy as np\n\nfrom zcode.constants import NWTG, SPLC\n...
[ [ "numpy.square", "numpy.power", "numpy.sqrt", "numpy.clip", "numpy.moveaxis" ] ]
ahmedezzat85/SNPX_ML
[ "7316b0d46d39d2335b3095527a3ac81be208928d" ]
[ "python/snpx/snpx_tf/arch/mlp.py" ]
[ "from __future__ import absolute_import\n\nimport tensorflow as tf\nfrom . tf_net import TFNet\n\nclass MLP(TFNet):\n \"\"\"\n \"\"\"\n def __init__(self, data, data_format, num_classes, is_train=True):\n dtype = data.dtype.base_dtype\n super(MLP, self).__init__(dtype, data_format, train=is_t...
[ [ "tensorflow.identity" ] ]
cndrip/sklearn100
[ "bfaa54f7fe8e16ea66655159ccacbcb61086a434" ]
[ "code/019.py" ]
[ "from numpy.lib.npyio import load\nfrom sklearn.datasets import load_iris\nimport pandas as pd\n\niris=load_iris()\ndata=iris[\"data\"]\nprint(type(data.shape)) # (150,4)\ntarget=iris[\"target\"]\n\nprint(pd.Series(target).unique()) # [0,1,2]\n\n# vdata=pd.DataFrame(data=iris[\"data\"],columns=iris[\"feature_names\...
[ [ "sklearn.datasets.load_iris", "pandas.Series" ] ]
zhbli/pytorch-faster-rcnn
[ "de3f5a4db43e04a60e13578ad5bb09aa9834abd8" ]
[ "tools/test_net.py" ]
[ "# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Zheqi he, Xinlei Chen, based on code from Ross Girshick\n# --------------------------------------------------------\nfrom __future__ import absolute_import...
[ [ "torch.load" ] ]
0xdarkman/RL-Bitcoin-trading-bot
[ "f2a908adfaa38cc4f5e3441de7c775e1bb2a5151" ]
[ "RL-Bitcoin-trading-bot_6/RL-Bitcoin-trading-bot_6.py" ]
[ "#================================================================\n#\n# File name : RL-Bitcoin-trading-bot_6.py\n# Author : PyLessons\n# Created date: 2021-02-08\n# Website : https://pylessons.com/\n# GitHub : https://github.com/pythonlessons/RL-Bitcoin-trading-bot\n# Description : Trad...
[ [ "numpy.concatenate", "numpy.array", "numpy.expand_dims", "numpy.random.choice", "numpy.zeros", "numpy.sum", "numpy.stack", "numpy.random.randint", "numpy.average", "numpy.hstack", "pandas.read_csv", "numpy.squeeze", "numpy.vstack" ] ]
vatch123/GeneNet
[ "19ed9ddc7f1d3a883095744ba7059fd26f4e1b89" ]
[ "data.py" ]
[ "\"\"\"\nThis module deals loading and transforming data\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\n\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import normalize\n\nfrom keras.utils import to_categorical\n\n\ndef load_data(filepath):\n \"\"\"\n This function load...
[ [ "sklearn.model_selection.train_test_split", "numpy.array", "pandas.read_csv", "sklearn.preprocessing.normalize" ] ]
ofirnachum/uncertainty_gbm
[ "6596750286324e58f1d872e4634abe3fa4901bd7" ]
[ "regressor.py" ]
[ "__doc__ = \"\"\"Gradient Boosted Regression Trees for heteroscedastic data.\"\"\"\n\nimport loss\n\nfrom sklearn.ensemble import gradient_boosting\n\nclass UncertaintyGBM(gradient_boosting.BaseGradientBoosting):\n \"\"\"GBM for maximizing likelihood of an observed y(x) by predicting\n a normal distribution d...
[ [ "sklearn.ensemble.gradient_boosting.check_array" ] ]
eym55/power_grid_sim
[ "35822a2d2f09c00a38841e0bf3395bc5ea0ddbaa" ]
[ "run_game.py" ]
[ "import gym\nfrom environments.defender_game import PowerGrid\nimport pypsa\nimport numpy as np\nfrom agents import RandomAgent,DQNAgent\nfrom environments.defender_game_v1 import PowerGridV1\nimport pickle\n\n\nnp.random.seed(10)\nnetwork = pypsa.Network('networks/sample_grid.nc')\nLINES = network.lines.shape[0]\n...
[ [ "numpy.random.seed", "numpy.ones", "numpy.mean" ] ]
LolaSegura/quadruped_ctrl
[ "6a2625eb2ebb6a819e2ca925b8021f2f0e8b3afa" ]
[ "scripts/walking_simulation.py" ]
[ "#!/usr/bin/env python\n\nimport concurrent\nimport ctypes\nimport cv2\nimport math\nimport numpy as np\nimport os\nimport pybullet as p\nimport pybullet_data\nimport random\nimport rospkg\nimport rospy\nimport tf2_ros\nimport threading\nimport numpy as np\n\nfrom cv_bridge import CvBridge\nfrom nav_msgs.msg import...
[ [ "numpy.uint8", "numpy.array", "numpy.zeros", "numpy.stack", "numpy.arange", "numpy.isfinite", "numpy.sqrt", "numpy.meshgrid", "numpy.mat" ] ]
EduardoAcacio/DataScienceGraficos
[ "0294ade9c4e507f44a42190bc8a9ddacf500fe42" ]
[ "Graficos/graficoScatterplotLinhaReta.py" ]
[ "import matplotlib.pyplot as pyplot\n\nx1 = [1,100]\ny1 = [1,100]\n\nx2 = [1,2,3,22,5,3,32,52,2,5,3,32,5]\ny2 = [2,3,4,1,16,4,13,23,4,1,16,4,45]\n\ntitulo = \"Grafico de Scatterplot\"\neixox = \"Eixo X\"\neixoy = \"Eixo Y\"\n\npyplot.title(titulo)\npyplot.xlabel(eixox)\npyplot.ylabel(eixoy)\n\npyplot.scatter(x2, y2...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.scatter" ] ]
hcoura/color-extractor
[ "a69fc4a9a8b7c90d292f954d289c84a38323eda6" ]
[ "color_extractor/image_to_color.py" ]
[ "import numpy as np\n\nfrom .back import Back\nfrom .cluster import Cluster\nfrom .name import Name\nfrom .resize import Resize\nfrom .selector import Selector\nfrom .skin import Skin\nfrom .task import Task\n\n\nclass ImageToColor(Task):\n def __init__(self, samples, labels, settings=None):\n\n if settin...
[ [ "numpy.zeros" ] ]
harsul/SiamYolact
[ "62a76f34e279a7673f51b284e679372d273839b6" ]
[ "reid/reid.py" ]
[ "import keras\nfrom keras.models import Sequential, Model\nfrom keras.applications.xception import Xception, preprocess_input\nfrom keras.layers import Dense, Dropout, Input, Flatten, concatenate\nfrom os.path import isfile, isdir, join\nfrom os import makedirs\nfrom pak.util import download as dl\nimport cv2\nimpo...
[ [ "numpy.expand_dims", "numpy.zeros" ] ]
PGE310-Students/assignment13
[ "e0b6781c6b8e0bc95cc9f3850623eca04733df11" ]
[ "test.py" ]
[ "#!/usr/bin/env python\n\n# Copyright 2020-2021 John T. Foster\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 requi...
[ [ "numpy.array", "numpy.linalg.inv", "numpy.linalg.solve" ] ]
abaheti95/DC-NeuralConversation
[ "14f3c03adfb7379b48a325c0b3416eee39af7fdb" ]
[ "preprocess.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport argparse\nimport os\nimport glob\nimport sys\n\nimport torch\n\nimport onmt.io\nimport opts\n\n\ndef check_existing_pt_files(opt):\n # We will use glob.glob() to find sharded {train|valid}.[0-9]*.pt\n # when training, so check to avoid tampering with e...
[ [ "torch.manual_seed", "torch.save" ] ]
ycjungSubhuman/linearRegressorDemo
[ "f32d19e97a4c5555a0a98080a393c3c8ba29c187" ]
[ "tester.py" ]
[ "import itertools\nimport numpy as np\nfrom scipy.stats import f_oneway\n\ndef _getRMSE(targetFunction, validateX, validateT):\n N = validateT.shape[0]\n return np.sqrt(sum([(validateT[i] - targetFunction(validateX[i]))**2 for i in range(N)]) / N)\n\ndef _normalize(X):\n result = X.copy()\n mins = np.am...
[ [ "scipy.stats.f_oneway", "numpy.ndenumerate", "numpy.zeros", "numpy.split", "numpy.amax", "numpy.amin" ] ]
ivirshup/scMetaImmune
[ "3eec62cc61e6fb1cfaf1dcc31679900f6ff8b084" ]
[ "scripts/retrieve_jb_bams.py" ]
[ "import requests\nimport json\nfrom hashlib import md5\nimport requests\nimport pandas as pd\nfrom argparse import ArgumentParser\nfrom pathlib import Path\n\ndef download_file_from_google_drive(id, destination, checksum=None):\n \"\"\"\n Retrieves a public file from google drive.\n\n If the file is too la...
[ [ "pandas.read_table" ] ]
Hiwyl/keras_cnn_finetune
[ "f424302a72c8d05056a9af6f9b293003acb8398d" ]
[ "binary_test.py" ]
[ "'''\r\n@Author : lance\r\n@Email : wangyl306@163.com\r\n '''\r\n\r\n\r\nfrom keras.models import load_model\r\nfrom keras_preprocessing.image import ImageDataGenerator\r\nfrom sklearn.metrics import confusion_matrix\r\nimport numpy as np\r\n\r\n\r\n\r\ndef mytest(path,steps,input_shape):\r\n #导入数据\r\n ...
[ [ "numpy.hstack", "numpy.array", "numpy.sum", "sklearn.metrics.confusion_matrix" ] ]
ricardowiest/Data_Science-Machine_Learning
[ "b03687b5e2ea383a1eaac614637e42336b9d4633" ]
[ "Machine Learning e Data Science com Python ATUALIZADO/Secao 10 - Redes neurais artificiais/keras_credit_data.py" ]
[ "import pandas as pd\n\nbase = pd.read_csv('credit_data.csv')\nbase.loc[base.age < 0, 'age'] = 40.92\n \nprevisores = base.iloc[:, 1:4].values\nclasse = base.iloc[:, 4].values\n\nfrom sklearn.preprocessing import Imputer\nimputer = Imputer(missing_values = 'NaN', strategy = 'mean', axis = 0)\nimputer ...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.preprocessing.StandardScaler", "sklearn.metrics.accuracy_score", "sklearn.model_selection.train_test_split", "pandas.read_csv", "sklearn.preprocessing.Imputer" ] ]
kamikaze0923/SATNET
[ "16dda5846d3d7a0c846a6f48b49f63f896b1b224" ]
[ "exps/sudoku.py" ]
[ "#!/usr/bin/env python3\n#\n# Partly derived from:\n# https://github.com/locuslab/optnet/blob/master/sudoku/train.py \n\nimport argparse\n\nimport os\nimport shutil\nimport csv\n\nimport numpy as np\nimport numpy.random as npr\n#import setproctitle\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as opt...
[ [ "torch.cuda.init", "torch.ones", "torch.set_printoptions", "torch.cuda.is_available", "torch.load", "torch.topk", "torch.sum", "torch.manual_seed", "torch.abs", "torch.utils.data.DataLoader", "torch.zeros_like", "torch.max", "torch.cuda.get_device_name", "to...
mackelab/sbibm
[ "b9781c610a1a80d2de014ee46a29cf061fb6074a" ]
[ "sbibm/tasks/gaussian_linear_uniform/task.py" ]
[ "import logging\nfrom pathlib import Path\nfrom typing import Callable, Dict, List, Optional, Tuple\n\nimport numpy as np\nimport pyro\nimport torch\nfrom pyro import distributions as pdist\n\nfrom sbibm.tasks.simulator import Simulator\nfrom sbibm.tasks.task import Task\n\n\nclass GaussianLinearUniform(Task):\n ...
[ [ "torch.cat", "torch.eye", "torch.ones" ] ]
sibonyves/amuse
[ "5557bf88d14df1aa02133a199b6d60c0c57dcab7" ]
[ "src/amuse/ext/grid_remappers.py" ]
[ "import numpy\n\nfrom amuse.units import units\n\nfrom amuse.units.quantities import is_quantity, value_in, to_quantity\n\nfrom amuse.datamodel import UnstructuredGrid, StructuredGrid,StructuredBaseGrid\n\ntry:\n import matplotlib\n from matplotlib import tri\n if not hasattr(tri, \"LinearTriInterpolator\"):\n ...
[ [ "numpy.zeros", "matplotlib.tri.Triangulation", "numpy.any", "numpy.arange", "numpy.clip", "numpy.column_stack", "matplotlib.tri.LinearTriInterpolator", "numpy.floor" ] ]
alisiahkoohi/survae_flows
[ "e1747b05524c7ab540a211ed360ab3e67bc3e96d" ]
[ "survae/transforms/surjections/dequantization_variational.py" ]
[ "import torch\nfrom survae.distributions import ConditionalDistribution\nfrom survae.transforms.surjections import Surjection\n\n\nclass VariationalDequantization(Surjection):\n '''\n A variational dequantization layer.\n This is useful for converting discrete variables to continuous [1, 2].\n\n Forward...
[ [ "torch.tensor" ] ]
marcelotrevisani/acorns
[ "682749b0963ffc0a3998a7065ef505fc95123f50" ]
[ "tests/updated_hessian_test_suite_random.py" ]
[ "import sys\nimport math\nimport torch\nfrom timeit import default_timer as timer\nimport os\nimport json\nfrom subprocess import PIPE, run\nimport numpy as np\nimport shutil\nfrom datetime import datetime\n\nsys.path.append('tests/python_test_utils')\n\nsys.path.append('src')\n\nimport forward_diff\nimport tapenad...
[ [ "numpy.random.rand", "numpy.reshape", "numpy.zeros" ] ]
jieguangzhou/AIChallenger_SentimentAnalysis
[ "4dcd10c2e12bd266fb19c6b5cf50346766a4a37b" ]
[ "hah_classification/data.py" ]
[ "from collections import Counter\nimport logging\nimport random\nimport numpy as np\nimport jieba\nfrom hah_classification.develop.IO import read_file, write_file\nimport pandas as pd\nimport os\n\nlogger = logging.getLogger(__file__)\nlogger.setLevel(logging.INFO)\n\nPAD_IDX = 0\nUNK_IDX = 1\n\nCOLUMNS = ['locatio...
[ [ "numpy.array", "pandas.read_csv", "numpy.where" ] ]
OpenXAIProject/Subsampling_aliasing_artifact_eliminator
[ "6a009ef5620bc3f541441ae688c44eac7670913b" ]
[ "test/generator_test.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.utils.data\nimport h5py\nimport numpy as np\nimport scipy.io as sio\nimport matplotlib.pyplot as plt\nfrom skimage.transform import resize\nimport os\nos.environ['CUDA_VISIBLE_DEVICES']='2'\n\n\n# Hyper-parameters\nlatent_size = 5184\nhidden_size = 1728\nimage_size...
[ [ "torch.nn.Linear", "torch.device", "numpy.zeros", "numpy.sum", "matplotlib.pyplot.title", "numpy.mean", "matplotlib.pyplot.figure", "torch.nn.ReLU", "torch.cuda.is_available", "torch.tensor", "torch.load", "numpy.abs", "matplotlib.pyplot.show", "matplotlib.p...
sambitmishra0628/PSP-GNM
[ "4c7cdcde05a3c10664bee82b389af1db4c2961b8" ]
[ "scripts/psp_gnm.py" ]
[ "\"\"\"\nProtein stability change upon point mutations using a weighted Gaussian network model\n\nKey steps:\n 1. Coarse-grain a protein structure using only the alpha carbons\n 2. Model the coarse-grained protein structure as a weighted \nGaussian Network Model (GNM)\n 3. The interactions between amino ac...
[ [ "numpy.max", "numpy.isnan", "numpy.zeros", "scipy.linalg.eigh", "pandas.DataFrame", "numpy.sum", "numpy.ones", "numpy.tile", "numpy.exp", "numpy.shape", "numpy.diagonal", "numpy.multiply", "numpy.where", "pandas.concat", "numpy.outer", "pandas.read_c...
Felihong/ml-practices
[ "5193d14e01884ea2d808f621e758c2f645d1980c" ]
[ "ada-boost/AdaBoost.py" ]
[ "import numpy as np\n''' wir packen 3 Klassifizieren Algorithmen in unsere Klassenpool '''\nimport ClassiferPool.FischerDiskriminante as fischer\nimport ClassiferPool.Perzeptron as perzeptron\nimport ClassiferPool.KNN as knn\n\n\ndef initial_weight_data(data):\n return np.ones((len(data), 1))\n\n\ndef initial_we...
[ [ "numpy.matrix", "numpy.zeros", "numpy.argmin", "numpy.log", "numpy.sum", "numpy.exp", "numpy.transpose", "numpy.amin" ] ]
SHK2018/Gasyori100knock
[ "3fab0a2906ac99a37281269e1618e8ac74629dfa" ]
[ "Question_91_100/answers/answer_96.py" ]
[ "import cv2\nimport numpy as np\n\nnp.random.seed(0)\n\n\n# get HOG\ndef HOG(img):\n # Grayscale\n def BGR2GRAY(img):\n gray = 0.2126 * img[..., 2] + 0.7152 * img[..., 1] + 0.0722 * img[..., 0]\n return gray\n\n # Magnitude and gradient\n def get_gradXY(gray):\n H, W = gray.shape\n\...
[ [ "numpy.random.normal", "numpy.array", "numpy.pad", "numpy.zeros_like", "numpy.dot", "numpy.zeros", "numpy.minimum", "numpy.random.seed", "numpy.ones", "numpy.tile", "numpy.exp", "numpy.where", "numpy.arctan", "numpy.arange", "numpy.random.randint", "...
romanramirezmena/keras-retinanet
[ "0879dcd2573f04a9ef7f8aa472d8223d58fbd272" ]
[ "keras_retinanet/bin/train.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless ...
[ [ "tensorflow.keras.callbacks.TensorBoard", "tensorflow.device", "tensorflow.keras.optimizers.Adam", "tensorflow.keras.callbacks.ReduceLROnPlateau", "tensorflow.keras.callbacks.EarlyStopping" ] ]
yelojakit/qiskit-terra
[ "05355b103817dcd7aae0839a485b7ce28fb354a5" ]
[ "qiskit/visualization/matplotlib.py" ]
[ "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017, 2018.\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...
[ [ "numpy.sin", "matplotlib.get_backend", "matplotlib.patches.Polygon", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.patches.Circle", "numpy.abs", "numpy.cos", "matplotlib.patches.Rectangle", "matplotlib.patches.Arc" ] ]
kipoi/kipoi
[ "56825e141daa2cb7d94ac33809603b75704d12a7" ]
[ "example/models/tal1_model/dataloader.py" ]
[ "\"\"\"DeepSEA dataloader\n\"\"\"\n# python2, 3 compatibility\nfrom __future__ import absolute_import, division, print_function\n\nimport numpy as np\nimport pandas as pd\nimport pybedtools\nfrom pybedtools import BedTool\nfrom kipoi.data import Dataset\nfrom kipoi.metadata import GenomicRanges\nimport linecache\ni...
[ [ "numpy.where", "numpy.array", "numpy.zeros", "pandas.read_csv" ] ]
brs1977/page_dewarp
[ "b642fe921ec561570611a24e942e365258cf448a" ]
[ "page_dewarp.py" ]
[ "#!/usr/bin/env python\n######################################################################\n# page_dewarp.py - Proof-of-concept of page-dewarping based on a\n# \"cubic sheet\" model. Requires OpenCV (version 3 or greater),\n# PIL/Pillow, and scipy.optimize.\n#####################################################...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.dot", "numpy.zeros_like", "numpy.zeros", "numpy.minimum", "numpy.sum", "numpy.ones", "numpy.polyval", "numpy.arange", "numpy.arctan2", "numpy.abs", "numpy.linspace", "numpy.meshgrid", "numpy.vstack" ] ]
AllSafeCyberSecur1ty/Nuclear-Engineering
[ "302d6dcc7c0a85a9191098366b076cf9cb5a9f6e" ]
[ "pyne/tests/test_activation_responses.py" ]
[ "import os\nimport warnings\nfrom nose.tools import assert_equal, assert_almost_equal, assert_true\nfrom nose.plugins.skip import SkipTest\nimport numpy as np\nfrom numpy.testing import assert_array_equal\nimport multiprocessing\nimport filecmp\nimport sys\nfrom shutil import copyfile\nimport tables as tb\n\nfrom p...
[ [ "numpy.empty" ] ]
harveenchadha/bol
[ "0f720813107ab2f41e895917cd0359e8c0738dd1" ]
[ "bol/data/wav2vec2/_wav2vec2_ts_dataloader.py" ]
[ "import torch\nfrom torch.utils.data import Dataset\nfrom bol.utils.helper_functions import read_wav_file, convert_to_tensor\nfrom bol.utils.resampler import resample_using_sox\n\n\ndef get_batch_encoder_input(batch_samples):\n # features = [get_feature(batch_sample[0]) for batch_sample in batch_samples]\n fe...
[ [ "torch.utils.data.DataLoader" ] ]
ErikHumphrey/sustain-seq2seq
[ "c4787f0ca1047d01385e4fa4ffde59c6a8ab4cc4" ]
[ "models/components/encoders/LSTMEncoder.py" ]
[ "import os, sys\nsys.path.insert(0, '../../..')\n\nimport torch\nimport torch.nn as nn\n\nclass Encoder(nn.Module):\n def __init__(self, vocab_size, emb_dim, hidden_dim, num_layers, lstm_dropout, dropout, device):\n \"\"\"\n Creates an Encoder model.\n\n Args:\n vocab_size (int): ...
[ [ "torch.nn.Dropout", "torch.nn.utils.rnn.pad_packed_sequence", "torch.nn.Embedding", "torch.nn.utils.rnn.pack_padded_sequence" ] ]
dpgrote/WarpX
[ "038af1cc1ebf250d0633f21d4a2579c1bad03f34" ]
[ "Examples/Tests/photon_pusher/analysis_photon_pusher.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright 2019 Luca Fedeli, Maxence Thevenet, Weiqun Zhang\n#\n#\n# This file is part of WarpX.\n#\n# License: BSD-3-Clause-LBNL\n\nimport yt\nimport numpy as np\nimport os\nimport sys\nsys.path.insert(1, '../../../../warpx/Regression/Checksum/')\nimport checksumAPI\n\n#This script chec...
[ [ "numpy.array", "numpy.linalg.norm" ] ]
yasarc4/Auto_time_series
[ "5a9aa5c535fbe09a4cc59e44124a5de435ac5059" ]
[ "utils/dataloader.py" ]
[ "import pandas as pd\n\ndef load_csv(path, max_rows = None, date_col='txn_dttm', ts_col='amt_atmcam'):\n df = pd.read_csv(path)\n df = df[[date_col, ts_col]]\n df[date_col] = pd.to_datetime(df[date_col])\n df = df.sort_values(date_col).reset_index(drop=True)\n if max_rows==None:\n return df\n ...
[ [ "pandas.to_datetime", "pandas.read_csv" ] ]
anntzer/h5py
[ "7a413101ccaf2a8ac853c36aa887ada4e8955d98" ]
[ "setup_build.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\n Implements a custom Distutils build_ext replacement, which handles the\n full extension module build process, from api_gen to C compilation and\n linking.\n\"\"\"\n\ntry:\n from setuptools import Extension\nexcept ImportError:\n from distutils.extension import Extens...
[ [ "numpy.get_include" ] ]
ENSYSTRA/geokit
[ "510ec5c3fe3c034f1dff776c813eb28c6cd07c40" ]
[ "geokit/core/location.py" ]
[ "import re\nimport numpy as np\nfrom osgeo import ogr\nimport pandas as pd\n\nfrom . import util as UTIL\nfrom . import srs as SRS\nfrom . import geom as GEOM\n\n\nclass GeoKitLocationError(UTIL.GeoKitError):\n pass\n\n\nLocationMatcher = re.compile(\n r\"\\((?P<lon> *[0-9.-]+ *),(?P<lat> *[0-9.-]+ *)\\)\")\n...
[ [ "numpy.median", "numpy.array", "numpy.column_stack", "sklearn.cluster.KMeans" ] ]
Leo-xxx/model-optimization
[ "0e0e618f72c510b4a45fd7ada8eae2c060ac58b3" ]
[ "tensorflow_model_optimization/python/core/quantization/keras/quant_ops.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.math_ops.maximum", "tensorflow.python.ops.variable_scope.variable_scope", "tensorflow.python.ops.variable_scope.get_variable", "tensorflow.python.ops.math_ops.reduce_max", "tensorflow.python.ops.state_ops.assign", "tensorflow.python.ops.math_ops.minimum", "tensor...
gzli929/ContactTracing
[ "7be34c9e2ebbd305bef9d4c2ab91beb7b23bed91" ]
[ "scripts/SegDegree/combined_seg_degree.py" ]
[ "# %%\nimport numpy as np\nfrom ctrace import PROJECT_ROOT\nfrom ctrace.simulation import InfectionState\nfrom ctrace.exec.param import GraphParam, SIRParam, FileParam, ParamBase, LambdaParam\nfrom ctrace.exec.parallel import CsvWorker, MultiExecutor, CsvSchemaWorker\nfrom ctrace.recommender import SegDegree\nimpor...
[ [ "numpy.arange" ] ]
sudipg4112001/BenchmarkTransferLearning
[ "4e4ed3db9fc0554bc995af7cc04aeae89e90c381" ]
[ "models.py" ]
[ "import os\nimport numpy as np\nfrom sklearn.metrics import confusion_matrix\nfrom sklearn.metrics.ranking import roc_auc_score\n\nimport torch\nimport torch.nn as nn\nimport torchvision.models as models\n\nimport resnet_wider\nimport densenet\n\n\n\ndef ClassificationNet(arch_name, num_class, conv=None, weight=Non...
[ [ "torch.nn.Linear", "torch.save", "torch.load", "torch.nn.Sigmoid" ] ]
harsh2912/attendance-system
[ "89f3eff43a109861a12fb8e58a39495a628fef52" ]
[ "deploy/detector.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom scipy import misc\nimport sys\nimport os\nimport argparse\n#import tensorflow as tf\nimport numpy as np\nimport mxnet as mx\nimport random\nimport cv2\nimport sklearn\nfrom sklearn.decomposition i...
[ [ "numpy.array" ] ]
aasensio/DeepLearning
[ "71838115ce93e0ca96c8314cff3f07de1d64c235" ]
[ "multiframe_star/training/trainResnet.py" ]
[ "import numpy as np\nimport h5py\nimport numpy as np\nimport platform\nimport os\nimport json\nimport sys\nimport argparse\nimport scipy.ndimage as nd\nimport pickle\nfrom contextlib import redirect_stdout\nfrom ipdb import set_trace as stop\n\nos.environ[\"KERAS_BACKEND\"] = \"tensorflow\"\n\nif (platform.node() !...
[ [ "tensorflow.ConfigProto", "tensorflow.Session" ] ]
ciguaran/pymc
[ "7cdc070571d91c8919e39bbb9eb39ea3cd227386" ]
[ "pymc/distributions/continuous.py" ]
[ "# Copyright 2020 The PyMC 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "scipy.stats.norm.rvs", "scipy.interpolate.InterpolatedUnivariateSpline", "numpy.asarray", "numpy.log", "numpy.zeros", "scipy.stats.t.rvs", "scipy.stats.rice.rvs", "numpy.abs", "scipy.stats.skewnorm.rvs", "numpy.all", "numpy.searchsorted", "numpy.sqrt", "scipy.s...
NimrodShabtay/KAIR
[ "d744959d75c22b016543dc65c04922ea4b59894f" ]
[ "main_train_psnr.py" ]
[ "import os.path\nimport math\nimport argparse\nimport time\nimport random\nimport numpy as np\nfrom collections import OrderedDict\n\nimport logging\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data.distributed import DistributedSampler\nimport torch\nimport matplotlib.pyplot as plt\n\nfrom utils impo...
[ [ "torch.cuda.manual_seed_all", "numpy.random.seed", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.utils.data.distributed.DistributedSampler" ] ]
qixiuai/FATE
[ "6d50af65b96b5b226afda30dfa8e4a1e5746952d" ]
[ "python/federatedml/evaluation/metrics/classification_metric.py" ]
[ "import copy\nimport sys\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.metrics import precision_score\nfrom sklearn.metrics import recall_score\n\nROUND_NUM = 6\n\n\ndef neg_pos_count(labels: np.ndarray, pos_label: int):\n pos_num = ((labels == pos_label) + ...
[ [ "numpy.max", "numpy.quantile", "numpy.array", "numpy.isnan", "numpy.log", "numpy.min", "sklearn.metrics.accuracy_score", "numpy.arange", "pandas.concat", "pandas.IntervalIndex.from_arrays", "sklearn.metrics.precision_score", "numpy.flip", "sklearn.metrics.recall...
morris-frank/unnamed-source-separation
[ "e23af1761e8fdd587a67b307eaee800b02f5bccf" ]
[ "thesis/train.py" ]
[ "import os\nimport time\nfrom collections import defaultdict\nfrom datetime import datetime\nfrom statistics import mean\nfrom typing import Dict, List, Optional\n\nimport torch\nfrom colorama import Fore\nfrom torch import optim\nfrom torch.nn.utils import clip_grad_value_\nfrom torch.utils import data\nfrom torch...
[ [ "torch.isnan", "torch.save", "torch.no_grad", "torch.linspace", "torch.optim.lr_scheduler.MultiStepLR", "torch.isinf", "torch.nn.DataParallel" ] ]
gbc-sid/MTMFI-VOS
[ "b26dbfad515ebf61b4f6316d166f11735b5dcb9a" ]
[ "lib/training_datasets.py" ]
[ "from pathlib import Path\nimport json\nfrom collections import OrderedDict as odict\nfrom easydict import EasyDict as edict\nfrom PIL import Image\nfrom tqdm import tqdm\nimport cv2\nimport numpy as np\nimport random\n\nimport torch\nimport torch.nn.functional as F\nfrom torch.utils.data import Dataset\n\n\nclass ...
[ [ "numpy.max", "numpy.random.choice", "numpy.zeros", "torch.save", "torch.nn.functional.interpolate", "numpy.where", "numpy.invert", "numpy.arange", "torch.load", "numpy.unique", "torch.as_tensor", "numpy.expand_dims" ] ]
glisses/segmentation-and-uncertainty-estimation-on-CityScapes
[ "aed35e61383817579271b67748fb0e33866c09d6" ]
[ "UNet/CityScapes_epistemic_and_aleatoric.py" ]
[ "import tensorflow as tf\nimport datetime\nimport os\nimport h5py\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport glob\n\nimport tf_slim as slim\nimport Visualize\nimport utils\n\nimages = glob.glob('./Train_rgb/*_rgb.png') # tf.io.glob.glob\nlabels = glob.glob('./Train_seg/*_seg.png')\n\nimage_names ...
[ [ "numpy.array", "tensorflow.concat", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.keras.layers.Input", "tensorflow.argmax", "numpy.random.permutation", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.Dropout", "tensorflow.keras.Model", "tensorflow.ker...
otiliastr/coarse-to-fine-curriculum
[ "00fe0ad58dd2a5871958307f7791d93003b6310b" ]
[ "src/data/dataset.py" ]
[ "import numpy as np\n\nfrom .preprocessing import no_preproc, split_train_val\n\n__author__ = 'Otilia Stretcu'\n\n\nclass Dataset(object):\n def __init__(self, name, features, labels, indices_train, indices_test, indices_val,\n num_classes=None, feature_preproc_fn=no_preproc, class_names=None):\n...
[ [ "numpy.concatenate", "numpy.prod", "numpy.arange", "numpy.random.RandomState" ] ]
caryleo/self-critical.pytorch
[ "3f83a01e5cf75dfcdb6ca06602dfab363b626d51" ]
[ "tools/train.py" ]
[ "\"\"\"\n原始实现:\n 1. 初始化训练迭代信息,并在必要的时候从既有保存文件中加载\n 2. 初始化日志,实现文件日志和tensorboard日志,并在必要的时候从既有保存文件中加载\n 3. 初始化模型,并在必要的时候从既有保存文件中加载\n 4. 初始化并配置数据加载器,并在必要的时候加载迭代状态\n 5. 完成训练,在必要的时候保存当前模型迭代信息,以及在必要的时候完成模型的选择评估\n 6. 在合适的时候对现有模型进行保存\n新增实现:\n 1. 新增了训练阶段信息,1为经典训练阶段,2为Finetune阶段\n 2. 将既有的训练流程调整为经典训练阶段,新...
[ [ "torch.cuda.synchronize", "torch.utils.tensorboard.SummaryWriter", "torch.nn.DataParallel" ] ]
faithlierheimer/sqlalchemy-challenge
[ "79d81ebe1159442486edf114adeffc03fba80de3" ]
[ "flaskapp.py" ]
[ "#Import flask\nfrom flask import Flask, jsonify, request\n\n#Import dependencies for queries to include in endpoints\n############################\nfrom matplotlib import style\nstyle.use('seaborn')\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport datetime as dt\nimport pprint as p...
[ [ "pandas.DataFrame", "matplotlib.style.use" ] ]
ucl-tbr-group-project/regression
[ "ab02f62cdf83ffc43d9b8e88b0c1833190d65b95" ]
[ "tbr_reg/metrics/mae.py" ]
[ "from sklearn.metrics import mean_absolute_error\n\nfrom .basic_metric import RegressionMetric\n\n\nclass MAEFactory:\n def __init__(self):\n self.id = MAE().id\n\n def init_metric(self):\n return MAE()\n\n\nclass MAE(RegressionMetric):\n '''Mean absolute error, implemented by SciKit.'''\n\n ...
[ [ "sklearn.metrics.mean_absolute_error" ] ]