repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
longhongc/mobile-industrial-manipulator
[ "f1004e4c996005c3231e4ec7d2b998102f7575a8" ]
[ "scripts/mim_kinematic.py" ]
[ "import signal\nimport sys\nimport numpy as np\nfrom math import pi, sin, cos, atan2, asin, acos, sqrt\n\n# gravity constant\ng = 9.8\n\nclass MIM_Arm: \n\n l1 = 0.0867\n l2 = 0.6127\n l3 = 0.5722\n l4 = 0.1157\n k1 = 0.1639\n k2 = 0.0912\n\n def __init__(self, init_config):\n # initial...
[ [ "numpy.matrix", "numpy.hstack", "numpy.transpose", "numpy.cross", "numpy.array", "numpy.vstack" ] ]
paulwong16/TrafficMapForecasting
[ "793b55b203c4cbb89cce62b77a3e43b4df05b638", "793b55b203c4cbb89cce62b77a3e43b4df05b638" ]
[ "utils/earlystopping.py", "models/deep_resunet_fusion.py" ]
[ "import numpy as np\nimport torch\n\n\nclass EarlyStopping:\n \"\"\"Early stops the training if validation loss doesn't improve after a given patience.\"\"\"\n\n def __init__(self, logdir, patience=7, verbose=False, delta=0):\n \"\"\"\n Args:\n patience (int): How long to wait after l...
[ [ "torch.save" ], [ "torch.nn.Conv2d", "torch.cat" ] ]
ClazyCoder/YSGStereoVision
[ "e238af72ed0929b620b44a2ff8328658f3600efc" ]
[ "captureChArUco.py" ]
[ "import cv2 as cv\nimport numpy as np\nfrom cv2 import aruco\nimport cameramodule.cameramodule as cm\nimport os\nimport datetime\nimport json\n\nIMGSIZE = (640,480)\ncriteria = (cv.TERM_CRITERIA_EPS + cv.TERM_CRITERIA_MAX_ITER, 100, 0.00001)\n\ndef main():\n if not os.path.isdir('./ChAruco_captures'):\n o...
[ [ "numpy.asarray" ] ]
beaulima/thelper
[ "c389352c3541d18bb9d8255d6d3efe295ff1d71b" ]
[ "thelper/train/segm.py" ]
[ "\"\"\"Segmentation trainer/evaluator implementation module.\"\"\"\nimport logging\nfrom typing import AnyStr, Optional # noqa: F401\n\nimport torch\nimport torch.optim\n\nimport thelper.concepts\nimport thelper.typedefs as typ # noqa: F401\nimport thelper.utils\nfrom thelper.train.base import Trainer\n\nlogger =...
[ [ "torch.mean", "torch.cat", "torch.eq", "torch.unsqueeze", "torch.no_grad", "torch.FloatTensor", "torch.nn.functional.interpolate" ] ]
kerengaiger/ai2v
[ "55a71e1d5a91841b84356a9806889b37ec9c66e6" ]
[ "models/ai2v_model.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport torch as t\nimport torch.nn as nn\nfrom tqdm import tqdm\nimport datetime\n\nfrom torch import FloatTensor as FT\n\n\nclass MultiHeadAttention(nn.Module):\n def __init__(self, embedding_size, window_size, device, num_h, d_k=50, d_v=50):\n super(MultiH...
[ [ "torch.softmax", "numpy.power", "torch.zeros", "torch.zeros_like", "torch.nn.CosineSimilarity", "torch.nn.Embedding", "torch.tensor", "torch.nn.Linear", "torch.matmul", "torch.mul", "torch.FloatTensor", "torch.nn.ReLU", "torch.ones_like" ] ]
LeonardoAlchieri/Top-Of-Youtube
[ "ec2fc3f2a40afd5ffe831136c75b2951b4b74341" ]
[ "testQuerying/testEnrichScrapingWithKaggle.py" ]
[ "import pandas as pd\nimport pymongo\nimport json\nimport re\nimport base64\nfrom sqlalchemy import create_engine\nimport pymysql\nfrom pymongo import UpdateOne\nfrom pymongo import UpdateMany\nfrom mpi4py import MPI\nimport sys\nimport logging\nimport bcolors\nimport os\nimport shutil\nfrom apiclient.discovery imp...
[ [ "pandas.DataFrame" ] ]
sbam13/open_lth
[ "d8c8d450cc8229afed54b26f77b91c3fe0c3f339" ]
[ "datasets/test/test_imagedataset_and_dataloader.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\r\n\r\n# This source code is licensed under the MIT license found in the\r\n# LICENSE file in the root directory of this source tree.\r\n\r\nimport numpy as np\r\n\r\nfrom datasets import base, cifar10\r\nfrom testing import test_case\r\n\r\n\r\nclass TestImageDat...
[ [ "numpy.max", "numpy.sum" ] ]
Haftom2323/USGSg_3DEP_Interface
[ "22ab16be411541853d4ecdc551a639d3003e48af" ]
[ "visualize.py" ]
[ "from get_data import get_raster_terrain\n\nimport geopandas as gpd\nimport imageio\nimport pandas as pd\nimport pathlib\nimport matplotlib.pyplot as plt\nimport mapclassify as mc\nimport numpy as np\nimport laspy\nimport rasterio\nfrom rasterio import mask\nimport folium\n\n## Plot raster/tif image\n# ------------...
[ [ "matplotlib.pyplot.colorbar", "numpy.log1p", "matplotlib.pyplot.subplots", "matplotlib.pyplot.axis" ] ]
mdylan2/single-cell-explorer
[ "775e59fcf5c105bbe70edd17dbf1d2153c4f662c" ]
[ "server/tests/unit/common/fbs/test_matrix.py" ]
[ "import unittest\nimport pandas as pd\nimport numpy as np\nfrom scipy import sparse\nfrom parameterized import parameterized_class\nimport json\n\nfrom server.tests import decode_fbs\nfrom server.common.fbs.matrix import encode_matrix_fbs, decode_matrix_fbs\nfrom server.common.utils.type_conversion_utils import get...
[ [ "pandas.Series", "numpy.arange", "numpy.dtype", "numpy.ones", "pandas.DataFrame", "numpy.all", "numpy.array", "numpy.zeros" ] ]
JuliaTagBot/BenchFourierFlows.jl
[ "5b36232ad6f0ac5b3be9c2ed2e59622e17566b94" ]
[ "dedalus/dedalus_decaying2Dturbulence.py" ]
[ "import numpy as np\nimport time, logging\n\nfrom mpi4py import MPI\nfrom dedalus import public as de\nfrom dedalus.extras import plot_tools\n\nfrom numpy import pi\n\n# Parameters\nLx = Ly = 2 * pi\nnx = ny = 256\ndealias = 1\nnu = 0.\ndt = 0.001\nstop_iteration = 5000\nstartup_iterations = 10\n\nlogger = logging....
[ [ "numpy.exp", "numpy.sqrt", "numpy.random.RandomState" ] ]
buxiangzhiren/VQ-Diffusion_office
[ "a431c5e5622971b50e7fdd43ac7d8e4432001863" ]
[ "image_synthesis/data/utils/comm.py" ]
[ "\"\"\"\nThis file contains primitives for multi-gpu communication.\nThis is useful when doing distributed training.\n\"\"\"\n\nimport pickle\n\nimport torch\nimport torch.distributed as dist\n# from diffdist.functional import all_gather as better_all_gather\n\n\nclass Comm(object):\n def __init__(self, local_ra...
[ [ "torch.ByteTensor", "torch.LongTensor", "torch.cat", "torch.distributed.all_gather", "torch.zeros_like", "torch.distributed.is_initialized", "torch.distributed.barrier", "torch.distributed.reduce", "torch.distributed.is_available", "torch.no_grad", "torch.stack", "t...
anupamme/CheXpert-Federated
[ "afef9d4b477716c289a23b80d7e59b6f36da72a1" ]
[ "transfer.py" ]
[ "'''This script goes along the blog post\n\"Building powerful image classification models using very little data\"\nfrom blog.keras.io.\nIt uses data that can be downloaded at:\nhttps://www.kaggle.com/c/dogs-vs-cats/data\nIn our setup, we:\n- created a data/ folder\n- created train/ and validation/ subfolders insid...
[ [ "numpy.array" ] ]
vbsteja/code
[ "0c8f4dc579f5de21b6c55fe6e65c3c8eb5473687" ]
[ "Python/ML_DL/ML/tensorflow_examples.py" ]
[ "#first program in tensorflow\n\nimport numpy as np\nimport tensorflow as tf\nfrom matplotlib import pyplot as plt\n\n# Model parameters\nW = tf.Variable([.3], tf.float32)\nb = tf.Variable([-.3], tf.float32)\n\n# Model input and output\nx = tf.placeholder(tf.float32)\nlinear_model = W * x + b\ny = tf.placeholder(tf...
[ [ "tensorflow.Variable", "tensorflow.placeholder", "tensorflow.global_variables_initializer", "tensorflow.train.GradientDescentOptimizer", "tensorflow.Session", "tensorflow.square" ] ]
EtienneDavid/FROST
[ "1cea124d69f07e3ac7e3ad074059d29c0849254c" ]
[ "TF-FROST/boss.py" ]
[ "# Copyright 2019 Google LLC\n# Modified 2020 by authors of BOSS paper\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# Un...
[ [ "tensorflow.concat", "tensorflow.control_dependencies", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.train.ExponentialMovingAverage", "tensorflow.nn.l2_loss", "tensorflow.group", "tensorflow.summary.scalar", "tensorflow.math.argmax", "tensorflow.boolean_mask", ...
omri123/rotational-unit-of-memory
[ "e796c841e1e837df09497ba77c3bc285db47d02d", "e796c841e1e837df09497ba77c3bc285db47d02d" ]
[ "tasks/LM/ptb_iterator.py", "tasks/summarization/decode.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.gfile.GFile", "numpy.array", "numpy.zeros" ], [ "tensorflow.train.Saver", "tensorflow.logging.info" ] ]
astrojose9/fulmar
[ "62a79fb9b7ab01e5b7b3acadaca8e4f0db0e0e2f" ]
[ "fulmar/estimators.py" ]
[ "import astropy.units as u\nimport numpy as np\n\nimport warnings\nfrom fulmar.utils import (\n FulmarWarning\n)\n\n\ndef estimate_planet_mass(\n R_p,\n rho_p):\n \"\"\"\n Estimates the mass of an exoplanet from its radius and density.\n\n Parameters\n ----------\n R_p : `~astropy.un...
[ [ "numpy.sin", "numpy.sqrt", "numpy.power" ] ]
Nuri-benbarka/PCDet
[ "8da66ead3bb1120db2fa919187948c8c134e85ae" ]
[ "pcdet/utils/calibration.py" ]
[ "import numpy as np\n\n\ndef get_calib_from_file(calib_file):\n with open(calib_file) as f:\n lines = f.readlines()\n\n obj = lines[2].strip().split(' ')[1:]\n P2 = np.array(obj, dtype=np.float32)\n obj = lines[3].strip().split(' ')[1:]\n P3 = np.array(obj, dtype=np.float32)\n obj = lines[4...
[ [ "numpy.dot", "numpy.min", "numpy.matmul", "numpy.ones", "numpy.max", "numpy.array", "numpy.zeros" ] ]
tobinsouth/covid19-forecasting-aus
[ "c42f2cfe423eddc7ddeb95a85a3ccf189269b6b2" ]
[ "model/EpyReff/run_estimator.py" ]
[ "###\n# Run EpyReff on NNDSS data\n###\n\nprint('Running EpyReff on NNDSS data')\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nfrom epyreff import *\n\nfrom sys import argv\nfrom scipy.stats import gamma\n\n## parameters\ntau = 4\np...
[ [ "pandas.to_datetime", "numpy.random.gamma", "matplotlib.use", "scipy.stats.gamma.pdf", "matplotlib.pyplot.subplots", "pandas.DataFrame", "matplotlib.pyplot.close", "pandas.DataFrame.from_dict" ] ]
AfonsoSeguro/IDS_Comportamental
[ "83145f815b67b2d501eb3744367aaea9b5d11cba" ]
[ "Algoritmo_genetico/Agente.py" ]
[ "import numpy as np\nfrom tensorflow import keras\nfrom tensorflow.keras import layers\nfrom random import random\n\n\nclass Agente:\n def __init__(self, createModel, mutation_rate = 0.2, model = None):\n self.createModel = createModel\n if(model == None): self.model = createModel()\n else: ...
[ [ "tensorflow.keras.models.load_model", "tensorflow.keras.losses.sparse_categorical_crossentropy" ] ]
Jsevillamol/ctlearn
[ "80461412c8d6bd124a7d8abf65af372e69ab0ed1" ]
[ "ctalearn/build_model.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Oct 27 10:22:03 2018\n\n@author: jsevillamol\n\"\"\"\n\nimport yaml, argparse\nfrom contextlib import redirect_stdout\n\nfrom tensorflow.keras.models import Model\nimport tensorflow.keras.layers as ll\nfrom tensorflow.keras.regularizers import...
[ [ "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.CuDNNLSTM", "tensorflow.keras.layers.Lambda", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "tensorflow.keras.regularizers.l2", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.BatchNormalizat...
Liang-ZX/maskrcnn-benchmark
[ "84562b5b1dda871a76d793e5d74297d6fbfe429b" ]
[ "maskrcnn_benchmark_mine/modeling/roi_heads/keypoint_head/loss.py" ]
[ "import torch\nfrom torch.nn import functional as F\n\nfrom maskrcnn_benchmark.modeling.matcher import Matcher\n\nfrom maskrcnn_benchmark.modeling.balanced_positive_negative_sampler import (\n BalancedPositiveNegativeSampler,\n)\nfrom maskrcnn_benchmark.structures.boxlist_ops import boxlist_iou\nfrom maskrcnn_be...
[ [ "torch.nn.functional.cross_entropy", "torch.nonzero" ] ]
GuoqingZhou-LANL/hippynn
[ "e3c31b3dc77369bd24ed575005b6385796ba04b0", "e3c31b3dc77369bd24ed575005b6385796ba04b0" ]
[ "hippynn/layers/physics.py", "hippynn/databases/SNAPJson.py" ]
[ "\"\"\"\nLayers for physical operations\n\"\"\"\nimport warnings\n\nimport torch\n\nfrom . import pairs\nfrom . import indexers\n\n\nclass Gradient(torch.nn.Module):\n def __init__(self,sign):\n super().__init__()\n assert sign in (-1,1), \"Sign of gradient must be +1 (gradient) or -1 (force)\"\n ...
[ [ "torch.norm", "torch.erfc", "torch.zeros", "torch.det", "torch.zeros_like", "torch.eye", "torch.tensor", "torch.arange", "torch.autograd.grad" ], [ "numpy.asarray", "numpy.stack" ] ]
covernal/mask-rcnn-tensorflow
[ "8d5e6c8adcf1ea5208f361ec29287696ff80cc98", "8d5e6c8adcf1ea5208f361ec29287696ff80cc98" ]
[ "MaskRCNN/utils/box_ops.py", "tensorpack/tfutils/collection.py" ]
[ "# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# SPDX-License-Identifier: Apache-2.0\n# -*- coding: utf-8 -*-\n# File: box_ops.py\n\nimport tensorflow as tf\n\nfrom tensorpack.tfutils.scope_utils import under_name_scope\n\n\n\"\"\"\nThis file is modified from\nhttps://github.com/tensorf...
[ [ "tensorflow.boolean_mask", "tensorflow.truediv", "tensorflow.transpose", "tensorflow.maximum", "tensorflow.equal", "tensorflow.squeeze", "tensorflow.expand_dims", "tensorflow.zeros_like", "tensorflow.split" ], [ "tensorflow.get_collection", "tensorflow.get_default_g...
katwinkl3/locomotion
[ "b9c93552608cdaf41a2c0bc9c9e14e8286abc3ea" ]
[ "locomotion/animal.py" ]
[ "import os\nimport sys\nimport csv\nimport re\nimport math\nimport numpy as np\nimport json\nfrom math import ceil, exp, log, sin, asin, pi, acosh, cosh, sinh, cos, acos, atanh, tanh\nfrom numpy import min, mean, std, array, linalg, dot, cross\nfrom scipy.optimize import minimize_scalar\n\n\nSMOOTH_RANGE = 5 #techn...
[ [ "numpy.std", "numpy.array", "numpy.mean" ] ]
glmcdona/stable-baselines3-contrib
[ "91f9b1ed34fbaa9243a044ea67aa4c677663bfc2" ]
[ "sb3_contrib/tqc/policies.py" ]
[ "import warnings\nfrom typing import Any, Dict, List, Optional, Tuple, Type, Union\n\nimport gym\nimport torch as th\nfrom stable_baselines3.common.distributions import SquashedDiagGaussianDistribution, StateDependentNoiseDistribution\nfrom stable_baselines3.common.policies import BaseModel, BasePolicy, register_po...
[ [ "torch.nn.Sequential", "torch.cat", "torch.nn.Linear", "torch.set_grad_enabled", "torch.clamp", "torch.nn.Hardtanh" ] ]
liuruoze/Thought-SC2
[ "b3cfbeffbfa09b952c596805d2006af24613db2d", "b3cfbeffbfa09b952c596805d2006af24613db2d" ]
[ "TG-zerg and TG-Terran/Terran/lib/utils.py", "TG-zerg and TG-Terran/Zerg/data_reduce/sample_data.py" ]
[ "import os\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport scipy.ndimage as ndimage\nfrom pysc2.lib import actions as sc2_actions\nfrom pysc2.lib import features\nimport lib.transform_pos as T\nfrom lib import config as C\n\n_MINIMAP_SELECTED = features.MINIMAP_FEATURES.selected.index\n_UNIT_TYPE = f...
[ [ "matplotlib.pyplot.imshow", "numpy.amax", "numpy.logical_and", "scipy.ndimage.generate_binary_structure", "numpy.concatenate", "numpy.all", "scipy.ndimage.binary_dilation", "numpy.array", "numpy.zeros", "numpy.sum", "matplotlib.pyplot.show" ], [ "numpy.random.sh...
balaz94/FRI-RL-SC2
[ "eaf2103265a999a16e786da134810681bf0266a0" ]
[ "utils/init.py" ]
[ "import torch.nn.init as init\n\ndef weights_init_xavier(layer):\n classname = layer.__class__.__name__\n if classname.find('Conv') != -1 or classname.find('Linear') != -1:\n init.xavier_uniform_(layer.weight)\n init.zeros_(layer.bias)\n\ndef weights_init_orthogonal_head(layer):\n classname =...
[ [ "torch.nn.init.zeros_", "torch.nn.init.orthogonal_", "torch.nn.init.xavier_uniform_" ] ]
clwatkins/sec_edgar_parser
[ "6ccf74eae14407e64ad033bb74d422d7f1c91495" ]
[ "secparse/sec_parse.py" ]
[ "import sys\nimport platform\nimport time\nimport os\nimport multiprocessing\nfrom typing import List, Union, Optional\n\nfrom numpy import ndarray\nfrom sqlalchemy import distinct, func, and_\nimport feedparser\nimport requests as rq\nfrom ssl import SSLError\nfrom urllib3.exceptions import MaxRetryError\nfrom xlr...
[ [ "pandas.read_sql_table", "pandas.merge", "pandas.read_csv", "pandas.ExcelFile" ] ]
Maarten-vd-Sande/gimmemotifs
[ "eab24de5a6835f71a957417d879ec5d6c8caebb7" ]
[ "gimmemotifs/report.py" ]
[ "# Copyright (c) 2009-2019 Simon van Heeringen <simon.vanheeringen@gmail.com>\n#\n# This module is free software. You can redistribute it and/or modify it under\n# the terms of the MIT License, see the file COPYING included with this\n# distribution.\n\"\"\"Reports (graphical and text) for motifs statistics.\"\"\"\...
[ [ "pandas.Series", "pandas.read_table", "numpy.log10", "pandas.cut", "pandas.core.indexing._non_reducing_slice" ] ]
tommylee3003/SDBSCAN
[ "b7b1f5f5aacdd2bdd69935ede58bd61cc6121a9c" ]
[ "fastkNN.py" ]
[ "from annoy import AnnoyIndex\r\nimport numpy as np\r\nfrom scipy.sparse import csr_matrix\r\n\r\n\r\nclass fastkNN:\r\n def __init__(self, n_neighbors, n_trees=5, metric='euclidean', return_distance=False):\r\n self.n_neighbors = n_neighbors\r\n self.n_trees = n_trees\r\n self.metric = metr...
[ [ "numpy.asarray", "numpy.arange", "numpy.ravel", "numpy.ones" ] ]
Actis92/pytorch_tabular
[ "78dabf5e7b97d8ff24db4bc83d9d0a2273941bbe" ]
[ "pytorch_tabular/feature_extractor.py" ]
[ "# Pytorch Tabular\n# Author: Manu Joseph <manujoseph@gmail.com>\n# For license information, see LICENSE.TXT\nfrom collections import defaultdict\n\nimport pandas as pd\nfrom sklearn.base import BaseEstimator, TransformerMixin\nfrom tqdm.autonotebook import tqdm\n\nfrom pytorch_tabular.models import NODEModel, TabN...
[ [ "torch.cat" ] ]
aikonbrasil/CarND-Advanced-Lane-Lines
[ "9fa0dcfcb2ead8629ea8cbd911c45e6940a7124e" ]
[ "main.py" ]
[ "import numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\nimport matplotlib.image as mpimg\nimport glob\nfrom math import fabs\n# Import everything needed to edit/save/watch video clips\nfrom moviepy.editor import VideoFileClip\nfrom IPython.display import HTML\nglobal objpoints\nglobal imgpoints\nglobal sr...
[ [ "numpy.polyfit", "numpy.linspace", "numpy.arctan2", "matplotlib.image.imread", "numpy.int", "numpy.concatenate", "numpy.zeros_like", "numpy.max", "numpy.mean", "numpy.square", "numpy.hstack", "numpy.uint8", "numpy.copy", "numpy.argmax", "numpy.float32", ...
andrewtarzia/MCHammer
[ "983ffb374bf14fcda57141cbf53e2239481ec587" ]
[ "tests/collapser/test_collapser.py" ]
[ "import numpy as np\nfrom mchammer import get_atom_distance\n\n\ndef test_c_get_subunit_distances(\n collapser,\n coll_molecule,\n coll_subunits,\n coll_su_dists,\n coll_position_matrix,\n):\n test = coll_molecule.with_position_matrix(coll_position_matrix)\n for i, dist in enumerate(collapser._...
[ [ "numpy.equal", "numpy.isclose" ] ]
skyseed-berlin/unsupervised-segmentation
[ "2a0078ca871e7c8d87a9905330670c5ae2d35ae8" ]
[ "src/main_spatial_pooling.py" ]
[ "from src.models.spatial_pooling import SpatialPooling\nimport argparse\nimport cv2 as cv\nimport numpy as np \n\ndef main(input_img, window_size, target_segment, output):\n\n \"\"\"\n Takes pre-segmented input image and saves a greyscale output image reflecting\n the percentage of target segment (...
[ [ "numpy.array" ] ]
FGeri/kornia
[ "92fa259601679031dc59c82ffe6862a1b5c8878a", "92fa259601679031dc59c82ffe6862a1b5c8878a" ]
[ "kornia/losses/tversky.py", "kornia/geometry/epipolar/projection.py" ]
[ "from typing import Optional\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom kornia.utils import one_hot\n\n# based on:\n# https://github.com/kevinzakka/pytorch-goodies/blob/master/losses.py\n\n\ndef tversky_loss(input: torch.Tensor, target: torch.Tensor,\n alpha: flo...
[ [ "torch.mean", "torch.nn.functional.softmax", "torch.sum", "torch.is_tensor" ], [ "torch.svd", "torch.cat", "torch.zeros_like", "torch.stack", "torch.distributions.Uniform", "torch.ones_like", "torch.nn.functional.pad" ] ]
WenjinW/PGL
[ "ce6f64caeb409572750550ce183577b26598d8d0" ]
[ "pgl/utils/helper.py" ]
[ "# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.max", "numpy.zeros", "numpy.cumsum" ] ]
urkax/CollageNet
[ "337098b40afbf0b3c8514f80a9953a797988938d" ]
[ "code/EC2_VAE/model.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch.distributions import Normal\n\n\nclass VAE(nn.Module):\n def __init__(self,\n roll_dims,\n hidden_dims,\n rhythm_dims,\n condition_dims,\n z1_dims,...
[ [ "torch.cat", "torch.nn.GRU", "torch.zeros_like", "torch.nn.Linear", "torch.FloatTensor", "torch.rand", "torch.cuda.is_available", "torch.distributions.Normal", "torch.stack", "torch.nn.GRUCell" ] ]
carmanzhang/cornac
[ "215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3", "215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3", "215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3" ]
[ "cornac/models/cdl/cdl.py", "cornac/models/cvaecf/recom_cvaecf.py", "cornac/models/global_avg/recom_global_avg.py" ]
[ "# Copyright 2018 The Cornac Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required...
[ [ "tensorflow.compat.v1.square", "tensorflow.compat.v1.nn.dropout", "tensorflow.compat.v1.train.AdamOptimizer", "tensorflow.compat.v1.get_variable", "tensorflow.compat.v1.multiply", "tensorflow.compat.v1.trainable_variables", "tensorflow.compat.v1.gather", "tensorflow.compat.v1.zeros...
gipfelen/dgcnn
[ "59e58fe3da69517d4d2a270c7ddb52697963253a" ]
[ "tensorflow/part_seg/affordance_net.py" ]
[ "import os\nfrom os.path import join as opj\nimport numpy as np\nfrom torch.utils.data import Dataset\n#from utils.provider import rotate_point_cloud_SO3, rotate_point_cloud_y\nimport pickle as pkl\nfrom sklearn.model_selection import train_test_split\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\ndatase...
[ [ "numpy.matmul", "sklearn.model_selection.train_test_split", "numpy.concatenate", "numpy.max", "numpy.argmax", "numpy.mean", "numpy.where", "numpy.sum" ] ]
seangholson/lqubo
[ "05bf1dd03cf76349b981a543e751217beb4a1b0b" ]
[ "perm_LQUBO/results/plot_tsp_convergence.py" ]
[ "import pandas as pd\nimport matplotlib.pyplot as plt\n\nsize_domain = {'tsp': ['4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20']}\n\nknown_num_iterations = 100\niteration_domain = [(i+1)*5 for i in range(int(known_num_iterations/5))]\n\nconvergence_data = {'tsp': {\n ...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
UCSD-SEELab/smarthomeDeploymentCode
[ "7d9be41b5229f84402c25e7d66b9b3626af5dad6" ]
[ "Library/deployModels/HLdeployer/loadModel.py" ]
[ "import tensorflow as tf\nfrom tensorflow.python.framework import tensor_util\nimport numpy as np\n\nclass loadModel():\n def __init__(self, conf):\n assert \"sensor\" in conf.keys(), \"Sensor name needs to be given\"\n assert \"modelDir\" in conf.keys(), \"Unable to find Model directory\"\n\n ...
[ [ "tensorflow.import_graph_def", "tensorflow.gfile.GFile", "tensorflow.placeholder", "tensorflow.Session", "tensorflow.GraphDef", "numpy.array" ] ]
NijatZeynalov/Fuel-consumption-of-vehicles
[ "e7af523bb976b75d8f5f6c7ac797af105b149ae7" ]
[ "explot_data_analysis.py" ]
[ "import pandas as pd\r\nimport seaborn as sns\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nfrom scipy import stats\r\nfrom scipy.stats import norm, skew\r\n\r\nfrom sklearn.preprocessing import RobustScaler, StandardScaler\r\nfrom sklearn.linear_model import LinearRegression, Ridge, Lasso, Elasti...
[ [ "pandas.read_csv", "numpy.abs", "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
knu2xs/ba-tools
[ "74e2731ea9eb6ab8c9a93574ccbd3b5c9d549a5e" ]
[ "src/ba_tools/analysis.py" ]
[ "\"\"\"\nMethods to analyze hypotehtical scenarios.\n\"\"\"\n\nimport arcgis\nimport arcpy\nfrom arcgis.geometry import Point\nimport logging\nimport pandas as pd\nimport pathlib\nfrom tempfile import gettempdir\n\nfrom ._data import data\nfrom . import proximity\nfrom .utils import get_dataframe, get_logger, get_d...
[ [ "pandas.concat", "pandas.read_csv", "pandas.DataFrame" ] ]
SidsMav2000/Handwritten-Digit-Recognition
[ "81492cb49b4bed4631947e6ae6391f0bfebc9a2a" ]
[ "gui_digit_recognizer.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri May 8 12:43:12 2020\r\n\r\n@author: Siddharth\r\n\"\"\"\r\n\r\nfrom keras.models import load_model\r\nfrom tkinter import *\r\nimport tkinter as tk\r\nimport win32gui\r\nfrom PIL import ImageGrab, Image\r\nimport numpy as np\r\n\r\nmodel = load_model('mnist.h5')...
[ [ "numpy.array", "numpy.argmax" ] ]
YeeU/InverseRenderNet
[ "88851168b10f4bca9d35c7341a4a67b59fea98c2" ]
[ "model/loss_layer.py" ]
[ "# formulate loss function based on supplied ground truth and outputs from network\n\nimport importlib\nimport tensorflow as tf\nimport numpy as np\nimport os\nfrom model import SfMNet, lambSH_layer, pred_illuDecomp_layer, sup_illuDecomp_layer, reproj_layer\n\ndef loss_formulate(albedos, nm_pred, am_sup, nm_gt, inp...
[ [ "tensorflow.concat", "tensorflow.reduce_sum", "tensorflow.diag", "tensorflow.losses.absolute_difference", "tensorflow.where", "tensorflow.nn.conv2d", "tensorflow.boolean_mask", "tensorflow.while_loop", "tensorflow.greater", "tensorflow.get_collection", "tensorflow.tile"...
ivallesp/simplestELM
[ "d724f1d64f500c7612457f8d169fda9b39c25d90" ]
[ "example.py" ]
[ "# -*- coding: utf-8 -*-\n__author__ = 'ivanvallesperez'\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.datasets import load_diabetes\nfrom sklearn.ensemble import RandomForestRegressor\nfrom skle...
[ [ "sklearn.ensemble.RandomForestRegressor", "numpy.expand_dims", "sklearn.tree.DecisionTreeRegressor", "numpy.random.seed", "matplotlib.pyplot.title", "sklearn.metrics.mean_absolute_error", "sklearn.datasets.load_diabetes", "sklearn.model_selection.train_test_split", "pandas.Data...
hanskyy/simple-rl
[ "5d0ff35af21eb656057a4130742c34c3bf01eecb" ]
[ "Algorithm/A2C_mountain_car.py" ]
[ "import gym\nimport numpy as np\nimport tensorflow as tf\n\n\nclass Memory(object):\n def __init__(self):\n self.ep_obs, self.ep_act, self.ep_rwd = [], [], []\n\n def store_transition(self, obs0, act, rwd):\n self.ep_obs.append(obs0)\n self.ep_act.append(act)\n self.ep_rwd.append(r...
[ [ "tensorflow.clip_by_value", "tensorflow.distributions.Normal", "tensorflow.reduce_mean", "numpy.squeeze", "tensorflow.placeholder", "tensorflow.layers.dense", "tensorflow.global_variables_initializer", "numpy.zeros_like", "tensorflow.Session", "tensorflow.square", "tens...
alngo/linear_regression
[ "695d838d31fd2a41c98a8153e50c53a97159f282" ]
[ "libml/utils/csv.py" ]
[ "# **************************************************************************** #\n# #\n# ::: :::::::: #\n# csv.py :+: :+: ...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
finbarrtimbers/ai-workbox-screencasts-deep-learning
[ "a55e70a50854cb65e29792eadd8c5f7ac370a44d" ]
[ "tensorflow/checkpointing.py" ]
[ "import tensorflow as tf\nfrom tensorflow.examples.tutorials.mnist import input_data\n\n# We load the MNIST dataset using a helper function; in future lessons we'll\n# cover how to load other datasets\nmnist = input_data.read_data_sets(\"MNIST_data/\", one_hot=True)\n\ndef create_mnist_model():\n # create tf var...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.matmul", "tensorflow.InteractiveSession", "tensorflow.cast", "tensorflow.placeholder", "tensorflow.constant_initializer", "tensorflow.global_variables_initializer", "tensorflow.train.GradientDescentOptimizer", "tens...
marcosroriz/uaibus
[ "336cca6d278dbe5dab143eafbcaa11a8ef72f68b", "336cca6d278dbe5dab143eafbcaa11a8ef72f68b" ]
[ "uaibus/uaipreprocess.py", "uaibus/uainn.py" ]
[ "#!/bin/env python\n# import pudb\n# pu.db\n\nimport csv\nimport datetime\nimport logging\nimport click\nimport sys\nimport numpy as np\nfrom collections import defaultdict\nfrom math import asin, atan2, cos, radians, sin, sqrt\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\n\ndef dista...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.rc", "matplotlib.pyplot.figure" ], [ "sklearn.neural_network.MLPClassifier", "sklearn.externals.joblib.dump", "pandas.concat", "pandas.read_csv", "pandas.crosstab", "sklearn.metrics.confusion_matrix", "sklearn.preprocessing.S...
shawnwang-tech/TraverseNet
[ "8e27957f798d5a71e4c8975fa03f41f704607e23" ]
[ "module/astgcn_block.py" ]
[ "# -*- coding:utf-8 -*-\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\n\n\nclass Spatial_Attention_layer(nn.Module):\n '''\n compute spatial attention scores\n '''\n def __init__(self, DEVICE, in_channels, num_of_vertices, num_of_timesteps):\n super(Spatial_Attention_l...
[ [ "torch.nn.functional.softmax", "torch.sigmoid", "torch.cat", "torch.zeros", "torch.nn.Conv2d", "torch.nn.LayerNorm", "torch.matmul", "torch.nn.functional.relu", "torch.FloatTensor" ] ]
chenjianqu/RAFT
[ "a0d44278287e335f27577c9c2f8912bafbbe471c" ]
[ "core/utils/utils.py" ]
[ "import typing\n\nimport torch\nimport torch.nn.functional as F\nimport numpy as np\nfrom scipy import interpolate\n\n\nclass InputPadder:\n \"\"\" Pads images such that dimensions are divisible by 8 \"\"\"\n def __init__(self, dims, mode='sintel'):\n self.ht, self.wd = dims[-2:]\n pad_ht = (((s...
[ [ "torch.cat", "numpy.arange", "torch.arange", "numpy.stack", "torch.from_numpy", "torch.nn.functional.grid_sample", "torch.nn.functional.interpolate", "scipy.interpolate.griddata", "torch.stack", "torch.nn.functional.pad" ] ]
mhw32/prototransformer-public
[ "710b531e16d8ba6f62488e366c0cfe6ce72f8ad2" ]
[ "src/agents/nlp.py" ]
[ "import os\nimport numpy as np\nfrom tqdm import tqdm\nfrom itertools import chain\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom transformers import (\n RobertaConfig,\n RobertaModel,\n get_linear_schedule_with_warmup,\n)\nfrom src.utils import utils\nfrom src.models.codelst...
[ [ "torch.mean", "torch.nn.functional.softmax", "torch.sigmoid", "torch.ones", "torch.nn.functional.log_softmax", "torch.zeros", "torch.load", "torch.round", "torch.sum", "torch.nn.Linear", "numpy.std", "torch.nn.functional.relu", "torch.log", "torch.bmm", ...
Pikaurd/CLUT-from-images
[ "3a3d0776527927018bf0f7abe6985e56c5bc022e" ]
[ "main.py" ]
[ "#!/usr/bin/env python3\n\nfrom typing import Tuple\nfrom functools import partial, lru_cache\nfrom math import floor\n\nimport imageio\nimport scipy.misc\nimport numpy as np\n\n\nwidth = 512\nheight = 512\nchannels = 3\n\n\ndef generate_identify_color_matrix():\n img = np.zeros((width, height, channels), dtype=...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "numpy.zeros" ] ]
dougalsutherland/POT
[ "faa4744597f93e7005bd48729441562e092e3ab6" ]
[ "examples/plot_OTDA_classes.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n========================\nOT for domain adaptation\n========================\n\n\"\"\"\n\nimport matplotlib.pylab as pl\nimport ot\n\n\n\n\n#%% parameters\n\nn=150 # nb samples in source and target datasets\n\nxs,ys=ot.datasets.get_data_classif('3gauss',n)\nxt,yt=ot.datasets.get_da...
[ [ "matplotlib.pylab.scatter", "matplotlib.pylab.title", "matplotlib.pylab.subplot", "matplotlib.pylab.figure", "matplotlib.pylab.imshow", "matplotlib.pylab.legend" ] ]
jack139/tongjian
[ "5827ae9ddbde744474f3058675c16a7749378507" ]
[ "utils/prepare_data_ts.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport re\nimport codecs\nimport pandas as pd\nimport numpy as np\nfrom sklearn import preprocessing\nimport jiebazhc as jieba\nfrom . import utils\n\nX_BLANK = 'blank'\ny_BLANK = '让我想想'\n\n# 诗句分词\ndef pre_load(filename):\n content = utils.load_content_lines(filename)\n\n f = codec...
[ [ "sklearn.preprocessing.LabelEncoder", "pandas.DataFrame" ] ]
Mdlglobal-atlassian-net/tensorboard
[ "67801ef8e4f22550b0babb893f4383af36473a26" ]
[ "tensorboard/plugins/projector/projector_plugin.py" ]
[ "# Copyright 2016 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...
[ [ "numpy.fromfile", "numpy.array" ] ]
arminrest/HSTkilonova_exptimes
[ "0ab77eeac6aaee2e9068ffc2f9d3bd8ff250302d", "0ab77eeac6aaee2e9068ffc2f9d3bd8ff250302d" ]
[ "tools.py", "calcExpTimes.py" ]
[ "#!/usr/bin/env python\nimport os, string, re, sys, math, types, pickle,six\nfrom subprocess import Popen, PIPE, STDOUT\nimport datetime\ntry:\n import astropy.io.fits as pyfits\nexcept ImportError:\n import pyfits\n \ntry: \n from configparser import SafeConfigParser\nexcept:\n from ConfigParser imp...
[ [ "numpy.zeros", "numpy.sqrt" ], [ "numpy.arange" ] ]
Notselwyn/NEAT-Car-Racing
[ "74e272c6ce0c1fc6ca978dae45970765f644d711" ]
[ "stats.py" ]
[ "from http.server import BaseHTTPRequestHandler, HTTPServer\r\nimport json\r\nimport matplotlib.pyplot as plt\r\n\r\nglobal avg_performance_list\r\nglobal best_performance_list\r\nglobal genome_count_list\r\nglobal gen_performance_list\r\nglobal manager\r\n\r\n\r\nclass Graph:\r\n def __init__(self, title, ylabe...
[ [ "matplotlib.pyplot.ion", "matplotlib.pyplot.subplots" ] ]
cjy513203427/SML_Assignment
[ "630e5b73d2ce222f4adb29f91d2ee3007f8972ff" ]
[ "assignment3/code/lr_1c.py" ]
[ "# -*- encoding: utf-8 -*-\n'''\n@File : lr_1c.py \n@Modify Time @Author @Desciption\n------------ ------- -----------\n2021/7/5 18:30 Jonas None\n'''\nimport math\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ntrain_data = np.loadtxt(\"lin_reg_train.txt\")\ntest_d...
[ [ "numpy.log", "numpy.sqrt", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "numpy.linalg.inv", "numpy.min", "numpy.matmul", "numpy.ones", "numpy.max", "numpy.loadtxt", "numpy.transpose", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "numpy.ze...
sjtututu/QAStrategy
[ "ed6548d6bd2c4cf086ac021fc10f2107921950f0" ]
[ "QAStrategy/qactabase.py" ]
[ "import datetime\nimport json\nimport os\nimport re\nimport sys\nimport threading\nimport time\nimport copy\nimport uuid\n\nimport pandas as pd\nimport pymongo\nimport requests\nfrom qaenv import (eventmq_amqp, eventmq_ip, eventmq_password, eventmq_port,\n eventmq_username, mongo_ip, mongo_uri)\n\...
[ [ "pandas.concat", "pandas.to_datetime", "pandas.DataFrame" ] ]
mahuangxu/ray
[ "891648ea9ecd8e80921e075e05f8499cc323887f" ]
[ "rllib/agents/dqn/dqn_tf_policy.py" ]
[ "\"\"\"TensorFlow policy class used for DQN\"\"\"\n\nfrom typing import Dict\n\nimport gym\nimport numpy as np\nimport ray\nfrom ray.rllib.agents.dqn.distributional_q_tf_model import \\\n DistributionalQTFModel\nfrom ray.rllib.agents.dqn.simple_q_tf_policy import TargetNetworkMixin\nfrom ray.rllib.models import ...
[ [ "numpy.ones_like" ] ]
salbertson/QUANTAXIS
[ "d701749c02fe2da0d78f19836a15843b8b811c67" ]
[ "QUANTAXIS/QASU/save_tdx.py" ]
[ "# coding:utf-8\n#\n# The MIT License (MIT)\n#\n# Copyright (c) 2016-2018 yutiansut/QUANTAXIS\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including withou...
[ [ "pandas.DataFrame.from_items" ] ]
airanmehr/Utils
[ "f97d704bb075b249d2b0dde5473327249f9deef4" ]
[ "EE.py" ]
[ "import numpy as np\nimport pandas as pd\ncomaleName = r'\\sc{Clear}'\nclass EE:\n @staticmethod\n def fx(x, s=0.0, h=0.5):\n Z=(1 + s) * x ** 2 + 2 * (1 + h * s) * x * (1 - x) + (1 - x) ** 2\n if Z>0:\n return ((1 + s) * x ** 2 + (1 + h * s) * x * (1 - x)) / (Z)\n else:\n ...
[ [ "numpy.log", "numpy.exp", "pandas.Series" ] ]
DS1SQM/OPKR086_test4
[ "db60403de9fd5a80580b75fd852aea538d9fd83a" ]
[ "selfdrive/car/hyundai/spdcontroller.py" ]
[ "#this was initiated by atom(conan)\n#partially modified by opkr\nimport math\nimport numpy as np\n\nfrom cereal import log\nimport cereal.messaging as messaging\n\nfrom selfdrive.config import Conversions as CV\nfrom selfdrive.controls.lib.speed_smoother import speed_smoother\nfrom selfdrive.controls.lib.long_mpc ...
[ [ "numpy.abs", "numpy.min", "numpy.isnan", "numpy.arange", "numpy.gradient", "numpy.mean" ] ]
swaldtmann/squid_accel_log_analyzer
[ "c7dee8b633f90c8a7be2a29426f898a700d70e0d" ]
[ "panda_parser.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport pandas as pd\n\nlog_data = open('./data/access.log', 'r')\nfields = ['ts', 'elapsed', 'remhost', 'status', 'bytes',\n 'method', 'url', 'rfc931', 'peerstatus', 'type']\nsplit_list = list()\n\n\nfor line in log_data:\n ls = line.split()\n l_type...
[ [ "pandas.to_datetime", "pandas.Grouper", "pandas.DataFrame", "pandas.ExcelWriter" ] ]
SolomidHero/vcc20_baseline_cyclevae
[ "983f4852cefc525013b2168429934a5c46d45484" ]
[ "baseline/src/parallel_wavegan/models/melgan.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright 2020 Tomoki Hayashi\n# MIT License (https://opensource.org/licenses/MIT)\n\n\"\"\"MelGAN Modules.\"\"\"\n\nimport logging\n\nimport numpy as np\nimport torch\n\nfrom parallel_wavegan.layers import ResidualStack\n\n\nclass MelGANGenerator(torch.nn.Module):\n \"\"\"MelGAN g...
[ [ "torch.nn.Sequential", "torch.nn.utils.weight_norm", "torch.nn.ModuleList", "torch.nn.utils.remove_weight_norm", "torch.nn.Tanh", "numpy.prod", "torch.nn.Conv1d", "torch.nn.ConvTranspose1d" ] ]
notha99y/Multimodal_human_actions
[ "6612b23aa8edeae9bf5a603552ccacf870d444ac" ]
[ "src/show_videos.py" ]
[ "'''\nScript to show the animation of the dataset\n\nParameters\n----------\n num: int\n TODO add in the action, subject, and trial\n\nReturns\n-------\n video of the choosen num\n'''\n\n\ndef show_depth_video(depth_info, frame_rate=50):\n '''\n Returns and animated video of the depth data\n\n Par...
[ [ "matplotlib.pyplot.imshow", "scipy.io.loadmat", "matplotlib.pyplot.subplots", "matplotlib.pyplot.axes", "matplotlib.animation.FuncAnimation", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
vikasverma1077/GraphNorm
[ "17723c2cc19795125c339dcc898039121d1fbdf2" ]
[ "GraphNorm_ws/gnn_ws/gnn_example/model/Norm/norm.py" ]
[ "import torch\r\nimport torch.nn as nn\r\nimport numpy as np\r\n\r\n\r\ndef get_norm(norm, ch, affine=True, twod=True):\r\n \"\"\"Get activation functions from the opt file.\"\"\"\r\n\r\n if norm == 'none':\r\n return nn.Identity()\r\n elif norm == 'batch':\r\n if twod:\r\n return nn.BatchNorm2d(ch, a...
[ [ "torch.nn.BatchNorm1d", "torch.ones", "numpy.sqrt", "torch.Tensor", "torch.zeros", "torch.randn", "torch.arange", "torch.nn.LayerNorm", "torch.nn.Linear", "torch.nn.Identity", "torch.rand", "numpy.prod", "torch.nn.BatchNorm2d", "torch.chunk", "torch.nn.i...
ryoherisson/torch-classifier
[ "decf4dae0bc9e26cb5cda4ab85fad481e0b9331b" ]
[ "dataloader/dataloader.py" ]
[ "\"\"\"DataLoader class\"\"\"\nfrom typing import List\nfrom pathlib import Path\n\nimport pandas as pd\n\nimport torch.utils.data as data\n\nfrom dataloader.utils import make_data_list\nfrom dataloader.dataset import Dataset\nfrom dataloader.transform import DataTransform\n\nclass DataLoader:\n \"\"\"Data Loade...
[ [ "torch.utils.data.DataLoader" ] ]
dongyan1024/overtime
[ "4f722a823585890026fe9584ba5985963b2a586c" ]
[ "overtime/components/nodes.py" ]
[ "\r\nimport math\r\nimport pandas as pd\r\n\r\n\r\n\r\nclass Node:\r\n \"\"\"\r\n A class to represent a node on a graph.\r\n\r\n Parameter(s):\r\n -------------\r\n label : String\r\n A label for the node.\r\n graph : Graph\r\n A valid Graph class/subclas...
[ [ "pandas.read_csv" ] ]
astrofrog/sunpy
[ "c658f7013a300b78e4cbf2146c2bcb98db32d788" ]
[ "sunpy/gui/ui/mainwindow/widgets/figure_canvas.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nPlot widgets for the PlotMan\nsubclassed from the matplotlib FigureCanvasQTAgg\n\nAuthor: Matt Earnshaw <matt@earnshaw.org.uk>\n\"\"\"\n\nimport sunpy\nimport matplotlib\nfrom PyQt4.QtGui import QSizePolicy\nfrom matplotlib.backends.backend_qt4agg import Figure...
[ [ "matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg.updateGeometry", "matplotlib.colors.LogNorm", "matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg.setSizePolicy", "matplotlib.figure.Figure", "matplotlib.colors.Normalize", "matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg.__init_...
jaswinder9051998/zoofs
[ "63aa216248ac3677ee87df5172912cd73918f7cc" ]
[ "zoofs/greywolfoptimization.py" ]
[ "from zoofs.baseoptimizationalgorithm import BaseOptimizationAlgorithm\nimport numpy as np\nimport pandas as pd\nimport logging as log\nimport plotly.graph_objects as go\nimport scipy\nimport time\nimport warnings\n\n\nclass GreyWolfOptimization(BaseOptimizationAlgorithm):\n \"\"\" \n Attributes\n ...
[ [ "numpy.random.random", "numpy.ones", "numpy.random.uniform", "numpy.argsort", "numpy.array", "numpy.where" ] ]
mingo-x/tensorpack
[ "0ab28b75e54ab1a807b8d047d3c3414017242eed" ]
[ "examples/FasterRCNN/basemodel.py" ]
[ "# -*- coding: utf-8 -*-\n# File: basemodel.py\n\nfrom contextlib import contextmanager, ExitStack\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.contrib.framework import add_model_variable\n\nfrom tensorpack.tfutils import argscope\nfrom tensorpack.tfutils.scope_utils import auto_reuse_variable_scop...
[ [ "tensorflow.nn.relu", "tensorflow.get_variable", "tensorflow.nn.batch_normalization", "tensorflow.constant", "tensorflow.shape", "numpy.asarray", "tensorflow.stack", "tensorflow.nn.moments", "tensorflow.reshape", "tensorflow.contrib.framework.add_model_variable", "tenso...
rkube/fourier_neural_operator
[ "14c1f870ce8b2033883a22c4d45cea7d12cce69f" ]
[ "scripts/eval.py" ]
[ "import torch\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport matplotlib.pyplot as plt\nfrom utilities3 import *\nimport operator\nfrom functools import reduce\nfrom functools import partial\n\nfrom timeit import default_timer\nimport scipy.io\n\ntorch.manual_seed(0)\nnp.random.s...
[ [ "numpy.random.seed", "torch.zeros", "torch.load", "torch.manual_seed", "numpy.linspace", "torch.utils.data.TensorDataset", "torch.rfft", "torch.nn.Linear", "torch.nn.functional.relu", "torch.no_grad", "torch.rand", "torch.nn.Conv1d", "torch.device", "torch.n...
jatervon/ultra-short-cognitive-load-detection
[ "b3abc35d353bd7ba63d4412e3a066294fc8467ba" ]
[ "xgb_hyperopt.py" ]
[ "import os\nimport numpy as np\nimport pickle\nimport argparse\nfrom statsmodels.stats.weightstats import DescrStatsW\n\nfrom sklearn.model_selection import cross_val_score\nfrom sklearn.metrics import accuracy_score\nfrom xgboost import XGBClassifier\n\nfrom utils import personal_normalisation, cv_indices_nfolds\n...
[ [ "numpy.array", "sklearn.metrics.accuracy_score" ] ]
dribnet/glow
[ "853b0fa8eb521392a661e1cdfa13378db3aa05ab" ]
[ "model.py" ]
[ "import tensorflow as tf\n\nimport tfops as Z\nimport optim\nimport numpy as np\nfrom tensorflow.contrib.framework.python.ops import add_arg_scope\ntry:\n import horovod.tensorflow as hvd\nexcept ImportError:\n from train import hvd\n\n\n'''\nf_loss: function with as input the (x,y,reuse=False), and as output...
[ [ "numpy.diag", "tensorflow.get_variable", "tensorflow.concat", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.equal", "numpy.random.randn", "tensorflow.nn.conv2d", "numpy.reshape", "tensorflow.floor", "tensorflow.gradients", "tensorflow.name_scope", "ten...
srvasude/jax
[ "fcb05915b5a106dbfad5162eb11064a9a5e430a2", "fcb05915b5a106dbfad5162eb11064a9a5e430a2" ]
[ "tests/pmap_test.py", "tests/sharded_jit_test.py" ]
[ "# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.linalg.matrix_power", "numpy.concatenate", "numpy.max", "numpy.random.randn", "numpy.mean", "numpy.roll", "numpy.swapaxes", "numpy.arange", "numpy.sin", "numpy.float32", "numpy.repeat", "numpy.zeros", "numpy.min", "numpy.random.rand", "numpy.array...
CITlabRostock/citlab-article-separation-new
[ "814364bf81552eefbe0ce60bbb9ec9e8ca63baf4" ]
[ "article_separation/image_segmentation/net_post_processing/textblock_net_post_processor_old.py" ]
[ "import logging\nimport os\n\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom python_util.geometry.rectangle import Rectangle\nfrom python_util.image_processing.image_stats import get_rotation_angle\nfrom scipy.ndimage import interpolation as inter\n\nlogger = logging.getLogger(\"TextBlockNetP...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.set_cmap", "scipy.ndimage.interpolation.rotate", "matplotlib.pyplot.subplot", "numpy.array", "numpy.zeros", "numpy.sum", "matplotlib.pyplot.show" ] ]
MelleStarke/MAS_B06
[ "fbedc7459006c0915428f0122d923dd41b57b51e" ]
[ "src/agents/util/mathstuffs.py" ]
[ "import pandas as pd\nimport numpy as np\n\ndef perform_TOPSIS(df, supplier_names):\n score = []\n nn = []\n pp = []\n\n # Hard-coded weights and impact for now.\n # weights = [0.2125, 0.1802, 0.0868, 0.1048, 0.0462, 0.0745, 0.0389, 0.0722, 0.0518, 0.0411, 0.0562, 0.035]\n a = pd.read_csv(\"../age...
[ [ "pandas.read_csv", "numpy.matmul", "numpy.linalg.norm" ] ]
callat-qcd/project_fkfpi
[ "364bc40cf936261b5d2a84374f51327646e60d41" ]
[ "fit_fkfpi.py" ]
[ "#!/usr/bin/env python3\n# python libraries\nimport os, sys, shutil, copy\nimport matplotlib.pyplot as plt\nimport numpy as np\n# Peter Lepage's libraries\nimport gvar as gv\nimport lsqfit\n\n# FK / Fpi libraries\nsys.path.append('utils')\nimport io_utils\nimport chipt\nimport analysis\nimport plotting\n\n''' Write...
[ [ "matplotlib.pyplot.ioff", "numpy.log", "matplotlib.pyplot.ion", "matplotlib.pyplot.show" ] ]
dy-Doing/FAE
[ "8b03941106a0f0f3c21ccfef1dc959a54115c6ee" ]
[ "FAE/FeatureAnalysis/FeatureSelector.py" ]
[ "from abc import ABCMeta,abstractmethod\nimport numpy as np\nfrom copy import deepcopy\nimport pandas as pd\nfrom random import randrange,seed\nimport os\nimport numbers\nimport csv\n\nfrom sklearn.feature_selection import SelectKBest, f_classif, RFE\nfrom sklearn.decomposition import PCA\nimport pymrmr\nfrom sklea...
[ [ "pandas.concat", "numpy.absolute", "numpy.sqrt", "sklearn.feature_selection.f_classif", "numpy.unique", "numpy.power", "numpy.linalg.norm", "pandas.DataFrame", "numpy.stack", "numpy.max", "numpy.shape", "sklearn.svm.SVC", "numpy.zeros", "numpy.sum" ] ]
cdyangzhenyu/X2Paddle
[ "6d6d18e576bdea941180f29d30ca1a702192496d" ]
[ "x2paddle/decoder/tf_decoder.py" ]
[ "# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless r...
[ [ "tensorflow.python.framework.tensor_util.MakeNdarray", "tensorflow.import_graph_def", "numpy.random.seed", "numpy.random.random_sample", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.compat.v1.Session", "tensorflow.global_variables_initializer", "numpy.argwhere",...
dsanno/chainer-neural-style
[ "2424ff10d7fd3fb8d838874df6f706ab1fb41edb" ]
[ "src/image_analogy.py" ]
[ "import argparse\nimport numpy as np\nfrom scipy import linalg\nfrom PIL import Image\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser(description='Transfer image using Image Analogy color transfer')\n parser.add_argument('style_image', type=str, help='Style image file path')\n parser.add_a...
[ [ "numpy.diag", "numpy.cov", "numpy.mean", "scipy.linalg.eig" ] ]
ZhaomingXie/RLAlg
[ "dff9fc9be9417797ded428fc706cd779e638f7bf" ]
[ "model.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport torch.multiprocessing as mp\nfrom torch.distributions import Normal, Categorical\nimport math\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\nclass Act...
[ [ "torch.nn.functional.softmax", "torch.ones", "torch.max", "torch.Tensor", "torch.zeros", "torch.cat", "torch.randn", "torch.nn.ModuleList", "torch.exp", "torch.nn.Linear", "torch.distributions.Categorical", "torch.cuda.is_available", "torch.distributions.Normal"...
Behery/marioai
[ "adbe1625e9acad55dde057a8df3cb2a7036f7eff" ]
[ "marioai/utils.py" ]
[ "import numpy\n\n__all__ = ['extractObservation']\n\n\npowsof2 = (1, 2, 4, 8, 16, 32, 64, 128,\n 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072)\n\ndef decode(estate):\n \"\"\"\n decodes the encoded state estate, which is a string of 61 chars\n \"\"\"\n# powsof2 = ...
[ [ "numpy.empty" ] ]
meng-zha/Det3D
[ "0cabfec8cb243e407506fad0bd57675f4410b0fb" ]
[ "det3d/datasets/lvx/lvx_common.py" ]
[ "import pathlib\nimport pickle\nimport re\nimport numpy as np\nimport open3d as o3d\n\nfrom collections import OrderedDict\nfrom pathlib import Path\nfrom skimage import io\nfrom tqdm import tqdm\n\nfrom det3d.core import box_np_ops\n\n\ndef _read_imageset_file(path):\n with open(path, \"r\") as f:\n line...
[ [ "numpy.split", "numpy.expand_dims", "numpy.asarray", "numpy.arange", "numpy.ones", "numpy.concatenate", "numpy.transpose", "numpy.array", "numpy.zeros" ] ]
ashamraeva/cvxpy
[ "9e320f9c96c9232860d83a5756567ac6401dd51e" ]
[ "cvxpy/atoms/affine/cumsum.py" ]
[ "\"\"\"\nCopyright 2013 Steven Diamond\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to i...
[ [ "scipy.sparse.csc_matrix", "numpy.zeros", "numpy.cumsum" ] ]
yu-sakana/dartspose
[ "7d65beaf037840511fac18cde8da07e5656c94e6", "7d65beaf037840511fac18cde8da07e5656c94e6" ]
[ "py_scripts/part_dtw.py", "tf_pose/def_estimator.py" ]
[ "import numpy as np\nimport pylab as plt\nimport pandas as pd\nimport matplotlib.gridspec as gridspec\n\ndef normalization(p):\n min_p = p.min()\n max_p = p.max()\n nor = (p - min_p) / (max_p - min_p)\n return nor\n\ndef plot_path(paths, A, B, D):\n plt.figure(figsize=(5,5))\n gs = gridspec.GridSpec(2, 2,...
[ [ "pandas.read_csv", "numpy.isnan", "numpy.argmin", "matplotlib.gridspec.GridSpec", "numpy.array", "numpy.zeros" ], [ "tensorflow.compat.v1.get_default_graph", "tensorflow.import_graph_def", "tensorflow.nn.pool", "tensorflow.io.gfile.GFile", "tensorflow.compat.v1.glob...
amykhoover/pyribs
[ "4e8a8c714bae0c722691554592cc050c9ad7e7b6", "4e8a8c714bae0c722691554592cc050c9ad7e7b6" ]
[ "benchmarks/cvt_add.py", "ribs/emitters/_gaussian_emitter.py" ]
[ "\"\"\"Compare performance of adding to the CVTArchive with and without k-D tree.\n\nIn CVTArchive, we use a k-D tree to identify the cell by finding the nearest\ncentroid to a solution in behavior space. Though a k-D tree is theoretically\nmore efficient than brute force, constant factors mean that brute force can...
[ [ "numpy.random.uniform", "numpy.random.randn", "matplotlib.pyplot.subplots" ], [ "numpy.expand_dims", "numpy.array", "numpy.maximum", "numpy.random.default_rng" ] ]
asonnino/key-transparency
[ "7d182abf1555f34a0efbdcd9a22c5cb7744ea1e5" ]
[ "scripts/benchmark/plot.py" ]
[ "from collections import defaultdict\nfrom re import findall, search, split\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as tick\nfrom glob import glob\nfrom itertools import cycle\n\nfrom benchmark.utils import PathMaker\nfrom benchmark.config import PlotParameters\nfrom benchmark.aggregate import Lo...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.yticks", "matplotlib.pyplot.gca", "matplotlib.pyplot.ylim", "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xticks", "matplotlib.pyplot.figure" ] ...
brauliobarahona/RAPT-dataset
[ "ec842544fe8af39d2f44604c06784b4dd6e24108" ]
[ "notebooks/House_B.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[ ]:\n\n\nimport sys\nsys.path.insert(0,\"./../\") #so we can import our modules properly\n\n\n# In[ ]:\n\n\n# iPhython\nfrom IPython.core.display import display, HTML\ndisplay(HTML(\"<style>.container { width:90% !important; }</style>\"))\n\nfrom matplotlib import rcP...
[ [ "pandas.read_hdf", "numpy.nonzero", "matplotlib.pyplot.subplots", "numpy.any", "numpy.sum" ] ]
flaviovdf/ecmlpkdd-analytics-challenge-2014
[ "2e3cb71fec863bde97d2e7f1712beb240ba9ab33" ]
[ "baselines.py" ]
[ "#-*- coding: utf8\nfrom __future__ import division, print_function\n\nfrom gcv_ols import OLS\n\nfrom rbf import RidgeRBFModel\n\nfrom sklearn import cross_validation\nfrom sklearn import grid_search\n\nimport myio\nimport numpy as np\n\ndef rbf(X, Y):\n for sigma in [0.001, 0.01, 0.1, 1, 10, 100, 1000]:\n ...
[ [ "numpy.where" ] ]
LeonieWeissweiler/EvalCharRNN
[ "b7830f53a3e256b28b80ddc6381fca14532a06aa" ]
[ "src/data_huge.py" ]
[ "#!/usr/bin/python3\r\nimport sys\r\nimport numpy as np\r\nimport regex\r\nimport os\r\n\r\ndata_dir = \"../data/wikipedia/\"\r\nletters = regex.compile(r'[^\\p{L}\\p{M}]')\r\nnumbers = regex.compile(r'[0-9]+')\r\nspaces = regex.compile(r'\\s+')\r\n\r\nsmall_count_token = 7474100\r\nsmall_count_type = 348843\r\n\...
[ [ "numpy.array", "numpy.save" ] ]
sbuschjaeger/Pysembles
[ "7e69b0975a7d4373242c7026ade6c5fdbad4fe67" ]
[ "pysembles/Metrics.py" ]
[ "import numpy as np\nimport pandas as pd\nimport torch\nimport scipy\n\nimport torch\nfrom torch import nn\nfrom torch.autograd import Variable\nimport torchvision\nimport torchvision.transforms as transforms\n\nfrom sklearn.metrics import make_scorer, accuracy_score\n\nfrom pysembles.Utils import TransformTensorDa...
[ [ "torch.nn.functional.softmax", "torch.cat", "torch.nn.functional.one_hot", "torch.eye", "torch.tensor", "numpy.concatenate", "torch.no_grad", "numpy.mean", "torch.stack", "torch.autograd.Variable" ] ]
sdrogers/ms2ldaviz
[ "ba311bc80891da595d2d6cef4abda95ab583c201" ]
[ "ms2ldaviz/basicviz/views/views_lda_multi.py" ]
[ "import json\nimport math\n\nimport jsonpickle\nimport networkx as nx\nimport numpy as np\nfrom django.http import HttpResponse, Http404\nfrom django.shortcuts import render\nfrom networkx.readwrite import json_graph\nfrom scipy.stats import ttest_ind\n\nfrom basicviz.forms import AlphaCorrelationForm, AlphaDEForm\...
[ [ "numpy.dot", "numpy.log", "numpy.sqrt", "numpy.linalg.norm", "numpy.array", "scipy.stats.ttest_ind" ] ]
underdogliu/audio
[ "38e530d77e5a194d4e5f91356cc1a191207a3b29" ]
[ "examples/pipeline_wavernn/processing.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass NormalizeDB(nn.Module):\n r\"\"\"Normalize the spectrogram with a minimum db value\"\"\"\n\n def __init__(self, min_level_db, normalization):\n super().__init__()\n self.min_level_db = min_level_db\n self.normalization = normalization\n\n ...
[ [ "torch.clamp" ] ]
msk-mind/data-processing
[ "282b5bd594cb5bf1ef2a7fdf56fca9bea5ad7102" ]
[ "pyluna-pathology/luna/pathology/cli/dsa/utils.py" ]
[ "from random import randint\n\nimport numpy as np\nfrom skimage import measure\nimport seaborn as sns\n\n\ndef get_color(name, line_colors={}, fill_colors={}, alpha = 100):\n \"\"\"Get colors for cells/regions based on discrete categories.\n\n Args:\n name (string): feature name e.g. Stroma, Tumor\n ...
[ [ "numpy.where" ] ]
tony10101105/virtual-try-on-model
[ "d2cdc00ecdda3a4e40cb2a45b18c394953d7f28c" ]
[ "utils.py" ]
[ "import os\nimport torch\nimport torchvision\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision import datasets, transforms\nfrom torchvision.utils import save_image\nfrom torch.autograd import Variable\nfrom torch.utils.data.dataset import Dataset\nfrom PIL import Image\nimport argparse\n\n\...
[ [ "torch.load" ] ]
HouchangX-AI/Helmet-Detection
[ "3c8c3edaf435fbd011b41f74a3417c44f66f52b6" ]
[ "yolo.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nClass definition of YOLO_v3 style detection model on image and video\n\"\"\"\n\nimport colorsys\nimport os\nfrom timeit import default_timer as timer\n\nimport numpy as np\nfrom keras import backend as K\nfrom keras.models import load_model\nfrom keras.layers import Input\nfrom PIL...
[ [ "numpy.expand_dims", "numpy.random.seed", "numpy.asarray", "numpy.random.shuffle", "numpy.floor", "numpy.array" ] ]