repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
grohith327/EasyGAN
[ "cbbff0283eda08f2d056215574f798e976d3ece0" ]
[ "simplegan/datasets/load_pix2pix_datasets.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport os\nimport cv2\nimport glob\nfrom tqdm import tqdm\n\n\"\"\"\nDatasets are retrieved from: https://people.eecs.berkeley.edu/~tinghuiz/projects/pix2pix/datasets/\n\"\"\"\n\n__all__ = [\"pix2pix_dataloader\"]\n\n\nclass pix2pix_dataloader:\n\n r\"\"\"A dataloade...
[ [ "tensorflow.shape", "tensorflow.keras.utils.get_file", "tensorflow.io.read_file", "tensorflow.random.uniform", "tensorflow.image.random_crop", "tensorflow.image.flip_left_right", "tensorflow.stack", "tensorflow.image.resize", "tensorflow.image.decode_jpeg", "tensorflow.cast...
Annarien/GravitationalLenses
[ "c2606aacc62d2534fb199f5228dc21c0ea604251" ]
[ "ForThesis/Corrected Results/res/Exp1/20201104_run_01.py" ]
[ "\"\"\"\nThis is file performs the convolutional neural network algorithm, in which the k fold is performed as well.\nThe results were saved in a csv file.\n\"\"\"\n\nimport os\nimport sys\nimport random\nfrom datetime import datetime\nimport numpy as np\nimport tensorflow\nfrom astropy.io import fits\nfrom astropy...
[ [ "sklearn.metrics.confusion_matrix", "tensorflow.python.keras.layers.convolutional.Conv2D", "tensorflow.python.keras.callbacks.ModelCheckpoint", "numpy.mean", "tensorflow.python.keras.optimizers.Adam", "sklearn.utils.shuffle", "numpy.count_nonzero", "sklearn.model_selection.Stratifi...
roger1993/classic_algorithm
[ "7b0cda39d6c48b76f2b12ad74a31ffb19776c0e7" ]
[ "jiaojian_temp_match/jj_temp.py" ]
[ "# import the necessary packages\nimport numpy as np\nimport argparse\nimport glob\nimport cv2\nfrom matplotlib import pyplot as plt\n \n# construct the argument parser and parse the arguments\nap = argparse.ArgumentParser()\nap.add_argument(\"-t\", \"--template\", required=True, help=\"Path to template image\")\na...
[ [ "numpy.where" ] ]
johndpope/finetune
[ "8cdc2a29104f3f2f6e032a9496b3c4e251ac028c", "8cdc2a29104f3f2f6e032a9496b3c4e251ac028c" ]
[ "tests/test_general_api.py", "finetune/lm_entailment.py" ]
[ "import os\nimport unittest\n\nfrom pathlib import Path\n\n# required for tensorflow logging control\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n\nimport tensorflow as tf\nimport pandas as pd\nimport enso\nfrom enso.download import generic_download\n\nfrom finetune import LanguageModelGeneralAPI\nimport numpy as np\...
[ [ "numpy.random.random", "pandas.read_csv", "tensorflow.reset_default_graph" ], [ "sklearn.model_selection.train_test_split", "scipy.stats.spearmanr" ] ]
zzc-tongji/gwu-csci-6554-computer-graphic-2
[ "dfbb16369878802f57a4c280e71cfd3ac28b41e7" ]
[ "lab4/window.py" ]
[ "from OpenGL.GL import *\nfrom OpenGL.GLU import *\nfrom OpenGL.GLUT import *\nfrom scipy.interpolate import interp2d\nimport datetime\nimport numpy as np\n\nfrom aet import AET\nfrom display import Display\nfrom light import Light\nfrom shading import Shading\nfrom space import Space\nfrom texture import Texture\n...
[ [ "numpy.array", "scipy.interpolate.interp2d" ] ]
dliangsta/metal
[ "49c568e33b36f5e0887bd977dca936b7def02ad7" ]
[ "tests/metal/end_model/test_end_model.py" ]
[ "import os\nimport unittest\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom metal.end_model import EndModel, LogisticRegression\nfrom metal.end_model.identity_module import IdentityModule\nfrom metal.metrics import METRICS\n\n\nclass EndModelTest(unittest.TestCase):\n @classmethod\n def set...
[ [ "torch.nn.Linear", "torch.stack", "numpy.random.seed", "torch.tensor", "numpy.random.random" ] ]
ryfeus/aws-inference-benchmark
[ "1a726ecbfffa931493c17ce73a81ec06db2f59ba" ]
[ "lambda-tflite/compileTFLiteInception.py" ]
[ "import tensorflow as tf\nfrom tensorflow.keras.applications.inception_v3 import InceptionV3\nimport numpy as np\nfrom time import process_time\n\nmodel = InceptionV3(weights='imagenet')\nmodel.save(\"InceptionV3.h5\")\n\nconverter = tf.lite.TFLiteConverter.from_keras_model_file('InceptionV3.h5',\n\tinput_shapes={'...
[ [ "tensorflow.keras.applications.inception_v3.InceptionV3", "tensorflow.lite.TFLiteConverter.from_keras_model_file" ] ]
mlbileschi/tensorflow
[ "8702c47666ffe3940d1171516f5feb47ccc625b1" ]
[ "tensorflow/python/ops/image_ops_impl.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.array_ops.identity", "tensorflow.python.ops.math_ops.less", "tensorflow.python.ops.array_ops.ones", "tensorflow.python.ops.array_ops.unstack", "tensorflow.python.ops.math_ops.reduce_all", "tensorflow.python.ops.gen_image_ops.decode_image", "numpy.log", "tenso...
ocetintas/evolutionary_art
[ "2c63f68c2f5e8afcc19d3900d1aff01410c0583b" ]
[ "classes.py" ]
[ "import numpy as np\r\nimport cv2\r\nimport random\r\nfrom copy import deepcopy\r\nfrom operator import attrgetter\r\n\r\n\r\n# Check if the circle is in the boundary of the image frame\r\ndef CheckBoundaries(x, y, radius):\r\n # Case 1: x < 0\r\n if x < 0:\r\n if y < 0:\r\n return (x+radius...
[ [ "numpy.full", "numpy.add", "numpy.random.binomial", "numpy.ones", "numpy.subtract" ] ]
lagrassa/pipescrew
[ "6ec162f2f1e48fa0a21a3dd708ef4875c4cbd148" ]
[ "planorparam/env/nav_env.py" ]
[ "import pygame\nfrom obstacle import line_world_obstacles, Obstacle, two_openings_obstacles, Quicksand\nimport numpy as np\nfrom gym.spaces import Box\nfrom Box2D import *\npygame.init()\n\n# convert to Box2D\n\n\"\"\"\n2D gridworld. obstacles are represented as Obstacle\nThey need to be boxes. Origin is the top ri...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.zeros", "numpy.ones", "numpy.clip" ] ]
HCY123902/Bert-BiLSTM-CRF-pytorch
[ "427b76a17ffac7980742af38785d81bf18661307" ]
[ "utils.py" ]
[ "# -*- encoding: utf-8 -*-\n'''\n@File : utils.py\n@Time : 2019/11/07 22:11:33\n@Author : Cao Shuai\n@Version : 1.0\n@Contact : caoshuai@stu.scu.edu.cn\n@License : (C)Copyright 2018-2019, MILAB_SCU\n@Desc : None\n'''\n\nimport os\nimport numpy as np\nimport logging\nimport torch\nfrom torch....
[ [ "numpy.array" ] ]
gengoai/mono-repo
[ "50e95c16579aaa8a4ee0776582964868b5625415" ]
[ "python/apollo/blocks/base.py" ]
[ "from typing import Any, Union, List, Dict, Iterable\n\nimport numpy as np\n\n\n# ---------------------------------------------------------------------------------------------------\n# Base Block Types\n# ---------------------------------------------------------------------------------------------------\n\n\nclass ...
[ [ "numpy.pad" ] ]
ManuelMBaumann/elastic_benchmarks
[ "bf231661e9dc79cec5fa1e9603de03d01edff2e3" ]
[ "marmousi2.py" ]
[ "from __future__ import print_function, division\n\nimport matplotlib\nmatplotlib.use('agg')\n\nfrom nutils import *\nimport scipy\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy import sparse\nimport obspy\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\n\n\n@log.title\ndef makeplots( dom...
[ [ "matplotlib.use", "scipy.sparse.isspmatrix", "numpy.array", "matplotlib.pyplot.colorbar", "numpy.zeros", "matplotlib.pyplot.spy", "matplotlib.pyplot.gca", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "numpy.eye", "matplotlib.pyplot.ylabel", "numpy.amin", ...
gianscarpe/vipm-project
[ "2d9384173a8741e4e56439a06f2fd837b5e1ce4e" ]
[ "matcher/train_classification_model.py" ]
[ "import torch\nfrom torch import optim\nimport torch.nn.functional as F\nfrom torchvision import transforms\nfrom matcher.models import ClassificationNet\nfrom matcher.dataset import ClassificationDataset\nfrom torch.utils.data import DataLoader\nfrom torch.nn import CrossEntropyLoss\nimport time\nimport os\nimport...
[ [ "torch.no_grad", "torch.squeeze", "torch.cuda.is_available", "torch.tensor", "torch.utils.data.DataLoader", "torch.load", "torch.nn.functional.softmax", "numpy.average", "torch.nn.CrossEntropyLoss" ] ]
CHEN-yongquan/Asteroid_CPO_seeker
[ "b180d08228e51a11b87d0a579023f7f09e332a7c" ]
[ "RL_lib/Policies/AWR/policy_awr2.py" ]
[ "\n\"\"\"\n\n Implements AWR PPO variants\n \n\"\"\"\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport rl_utils\nimport advantage_utils\nfrom time import time\nimport sklearn.utils\n \nclass Policy(object):\n \"\"\" NN-based policy approximation \"\"\"\n def ...
[ [ "numpy.concatenate", "numpy.max", "numpy.zeros", "numpy.median", "torch.save", "numpy.ones", "torch.no_grad", "numpy.min", "numpy.mean", "torch.from_numpy", "numpy.where", "numpy.std", "torch.load", "torch.mean" ] ]
fyabc/Toys
[ "3b2abd4fb2be986a8be6ed83897f7ba7fad6929e" ]
[ "LearnTensorFlow/alex_net.py" ]
[ "#! /usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\n\nfrom libs.models.cnn.alex_net import inference\nfrom libs.utils.basic import time_tensorflow_run\nfrom libs.utils.constants import floatX\n\n__author__ = 'fyabc'\n\n\ndef run_benchmark():\n batch_size = 32\n num_batches = 100\n\n op...
[ [ "tensorflow.Graph", "tensorflow.Session", "tensorflow.gradients", "tensorflow.nn.l2_loss", "tensorflow.global_variables_initializer", "tensorflow.random_normal" ] ]
micahkwok/pypkgs_mk
[ "1dd6e846385c185055612b83148db5077cf3268f" ]
[ "tests/test_pypkgs_mk.py" ]
[ "from pypkgs_mk import __version__\nfrom pypkgs_mk import pypkgs_mk\n\nimport pandas as pd\n\ndef test_version():\n assert __version__ == '0.1.0'\n\ndef test_catbind():\n a = pd.Categorical([\"character\", \"hits\", \"your\", \"eyeballs\"])\n b = pd.Categorical([\"but\", \"integer\", \"where it\", \"counts...
[ [ "pandas.Categorical" ] ]
kcrumb/EfficientDet
[ "cdc2ac4099c28ee89c2dd77bbcd36b0a589799b4" ]
[ "generators/csv_.py" ]
[ "\"\"\"\nCopyright 2017-2018 yhenon (https://github.com/yhenon/)\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...
[ [ "numpy.max", "numpy.concatenate", "numpy.empty", "numpy.min", "numpy.argsort" ] ]
sameerpawar/CarND-Advanced-lane-lines
[ "1ca61c5e1ee5d0d32c3bee0a3aec4cf3dc2dbe81" ]
[ "lane_lines_temp.py" ]
[ "'''\nChoices made\n1. histogram computation height: Think of robustness in a sense sometimes the lanes will not be in lower few pixel part.\n1. [also addressed in lecture 35 with convolution) leftx_base, rightx_base are taken at \"midpoint\" using \"max\". Both chocies can be thought again, \ne.g., instead of max ...
[ [ "numpy.concatenate", "numpy.int", "numpy.array", "numpy.sum", "numpy.mean", "numpy.argmax", "numpy.polyfit", "numpy.dstack" ] ]
Huanghongru/fairseq
[ "d80ad54f75186adf9b597ef0bcef005c98381b9e" ]
[ "fairseq/trainer.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nTrain a network across multiple GPUs.\n\"\"\"\n\nfrom collections import OrderedDict\nimport contextlib\nfrom itertools impo...
[ [ "torch.cuda.manual_seed", "torch.no_grad", "torch.cuda.device", "torch.cuda.device_count", "torch.manual_seed", "torch.cuda.empty_cache", "torch.cuda.is_available", "torch.cuda.get_device_capability", "torch.distributed.all_reduce", "torch.cuda.DoubleTensor" ] ]
ShankarNara/shogun
[ "8ab196de16b8d8917e5c84770924c8d0f5a3d17c" ]
[ "applications/tapkee/samples/dm.py" ]
[ "import shogun as sg\nimport data\nimport numpy as np\n\n# load data\nfeature_matrix = data.swissroll()\n# create features instance\nfeatures = sg.RealFeatures(feature_matrix)\n\n# create Diffusion Maps converter instance\nconverter = sg.DiffusionMaps()\n\n# set target dimensionality\nconverter.set_target_dim(2)\n#...
[ [ "numpy.dot" ] ]
edwinjiang703/ruiqi_aiops
[ "ce10eae41cb15ee3d1f07692d5c92491a3fca9bf" ]
[ "time_series_detector/test.py" ]
[ "# -*- coding: utf-8 -*-\n# @Time : 2019/4/11 10:07 PM\n# @Author : Edwin\n# @File : test.py\n# @Software: PyCharm\n\n\nfrom time_series_detector import detect\nimport pandas as pd\nimport warnings\nimport matplotlib.pyplot as plt\nfrom ora_dual import models\nimport os,time,datetime\nimport pandas\n\nwarnin...
[ [ "pandas.DataFrame", "pandas.set_option" ] ]
totti0223/deepstomata
[ "e4f5dd5d1a65232ed13f6bea6f4d1f02d1494558" ]
[ "deepstomata/stomata_model.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\nfrom math import sqrt\nMOVING_AVERAGE_DECAY = 0.9999\n\n\ndef tf_inference(images, BATCH_SIZE, image_size, NUM_CLASSES):\n\n def _variable_with_weight_decay(name, shape, stddev, wd):\n var = tf.get_variable(name, shape=shape, init...
[ [ "tensorflow.constant_initializer", "tensorflow.nn.relu", "tensorflow.nn.conv2d", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.nn.l2_loss", "tensorflow.variable_scope", "tensorflow.truncated_normal_initializer", "tensorflow.nn.bias_add", "tensorflow.nn.max_pool", ...
RileyWClarke/flarubin
[ "eb7b1ee21c828523f8a5374fe4510fe6e5ec2a2a" ]
[ "rubin_sim/maf/metrics/cadenceMetrics.py" ]
[ "import numpy as np\nfrom .baseMetric import BaseMetric\n\n__all__ = ['TemplateExistsMetric', 'UniformityMetric',\n 'RapidRevisitUniformityMetric', 'RapidRevisitMetric','NRevisitsMetric', 'IntraNightGapsMetric',\n 'InterNightGapsMetric', 'VisitGapMetric']\n\n\nclass fSMetric(BaseMetric):\n \"...
[ [ "numpy.minimum.accumulate", "numpy.roll", "numpy.diff", "numpy.where", "numpy.arange", "numpy.sort", "numpy.abs", "numpy.size", "numpy.searchsorted", "numpy.unique" ] ]
eric-erki/datacube-core
[ "952fabcdda89d58479ef5962ad40ed85f9da7913" ]
[ "datacube_apps/pixeldrill.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nInteractive Pixel Drill for AGDCv2.\n\n\"\"\"\n# pylint: disable=import-error, wrong-import-position\n# Unavoidable with TK class hierarchy.\n# pylint: disable=too-many-ancestors, redefined-builtin\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\...
[ [ "matplotlib.use", "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.rcParams.get", "numpy.isnan", "numpy.nanmax", "pandas.DataFrame", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.backends.backend_tkagg.NavigationToolbar2TkAgg.__init__", "matplotl...
LaudateCorpus1/ml-equivariant-neural-rendering
[ "44e5bfc6ebf479ea2b7bf25dddf94e05637e4fc8" ]
[ "misc/quantitative_evaluation.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom misc.dataloaders import create_batch_from_data_list\n\n\ndef get_dataset_psnr(device, model, dataset, source_img_idx_shift=64,\n batch_size=10, max_num_scenes=None):\n \"\"\"Returns PSNR for each scene in a dataset by comparing the view pre...
[ [ "torch.nn.functional.mse_loss", "torch.Tensor", "torch.mean", "torch.log10" ] ]
LorenzoM1997/Multiclass-classifier
[ "06dd0d855282cc22389073cdad5968f7e3ac8a5d" ]
[ "TA classifier tensorflow.py" ]
[ "#personal best: 53.6424% accurancy\r\n\r\nimport numpy as np\r\nimport tensorflow as tf\r\n\r\ndef get_data():\r\n \r\n X = np.array([[0,0,0]])\r\n y = np.array([[0,0,0]])\r\n \r\n # to work properly, you must have the file tae_datatset.txt in the same folder\r\n input_file = open(\"tae_dataset.t...
[ [ "numpy.array", "numpy.delete", "tensorflow.zeros", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.argmax", "tensorflow.random_uniform", "tensorflow.matmul", "tensorflow.placeholder", "numpy.append", "tensorflow.train.GradientDescentOptimizer", "tensorflo...
rhjmoore/dask
[ "8943efd28a5106e4617a706062c2a3b05b0355e7" ]
[ "dask/dataframe/groupby.py" ]
[ "import collections\nimport itertools as it\nimport operator\nimport warnings\n\nimport numpy as np\nimport pandas as pd\n\nfrom ..base import tokenize\nfrom ..highlevelgraph import HighLevelGraph\nfrom ..utils import M, derived_from, funcname, itemgetter\nfrom .core import (\n DataFrame,\n Series,\n _extr...
[ [ "numpy.array", "pandas.Grouper", "numpy.isscalar", "pandas.MultiIndex.from_product", "numpy.sqrt", "pandas.concat", "pandas.Series" ] ]
philipco/benchmark-pytorch
[ "d75da8224279a2c468f0b03c4582e668ffe07d68" ]
[ "Trainer.py" ]
[ "\"\"\"\nCreated by Philippenko, 17th February 2022.\n\"\"\"\nfrom datetime import datetime\nimport random\n\nimport numpy as np\nimport torch\n\nimport torch.nn as nn\nimport torch.optim as optim\nfrom pympler import asizeof\nfrom torch.backends import cudnn\n\nfrom Timer import Timer\nfrom DeepLearningRunLogger i...
[ [ "torch.cuda.manual_seed", "torch.cuda.manual_seed_all", "torch.max", "numpy.random.seed", "torch.no_grad", "torch.manual_seed", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss", "torch.nn.DataParallel" ] ]
caoquan95/6D-pose-project
[ "98c3debc7e8ebcc0c78c54ebb37859fe5d9876db" ]
[ "lib/knn/__init__.py" ]
[ "import unittest\nimport gc\nimport operator as op\nimport functools\nimport torch\nfrom torch.autograd import Variable, Function\n# from lib.knn import knn_pytorch as knn_pytorch\nfrom lib.knn.knn_pytorch import knn_pytorch\n\nclass KNearestNeighbor(Function):\n \"\"\" Compute k nearest neighbors for each query p...
[ [ "torch.is_tensor", "torch.rand", "torch.empty" ] ]
butyuhao/SimCLR
[ "fa0d47f91f52d496634e34b57af47d725dd7290d" ]
[ "run.py" ]
[ "import argparse\nimport torch\nimport torch.backends.cudnn as cudnn\nfrom torchvision import models\nfrom data_aug.contrastive_learning_dataset import ContrastiveLearningDataset\nfrom models.resnet_simclr import ResNetSimCLR\nfrom simclr import SimCLR\n\nmodel_names = sorted(name for name in models.__dict__\n ...
[ [ "torch.device", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.cuda.device" ] ]
isazi/kernel_tuner
[ "5571bbcd2b48f32b4af249f5dd48cf64afaac22b" ]
[ "test/test_util_functions.py" ]
[ "from __future__ import print_function\n\nfrom collections import OrderedDict\nimport os\nimport json\nimport warnings\n\nimport numpy as np\nimport pytest\nfrom pytest import raises\n\nfrom .context import skip_if_no_cuda, skip_if_no_opencl\n\nfrom kernel_tuner.interface import Options\nimport kernel_tuner.core as...
[ [ "numpy.array", "numpy.float16", "numpy.uint16", "numpy.int64", "numpy.byte", "numpy.float64", "numpy.float32", "numpy.uint64", "numpy.int32", "numpy.ubyte" ] ]
AdityaTewari/first_expts
[ "f2cf97a58bd2443764f41651d746cc33c55632bd" ]
[ "sample.py" ]
[ "#!/usr/bin/env python \n\nfrom __future__ import print_function, division\n\nimport logging\nimport theano\nimport theano.tensor as T\nimport cPickle as pickle\n\nimport numpy as np\nimport os\n\nfrom PIL import Image\nfrom blocks.main_loop import MainLoop\nfrom blocks.model import Model\nfrom blocks.config import...
[ [ "numpy.dstack", "numpy.zeros", "numpy.random.RandomState" ] ]
Rishav1/PySyft
[ "f620ee12727b52b19a317f263789830b57ee2539" ]
[ "test/torch/tensors/test_gc.py" ]
[ "\"\"\"All the tests relative to garbage collection of all kinds of remote or local tensors\"\"\"\nimport time\n\nimport torch\n\nfrom syft.frameworks.torch.tensors.decorators.logging import LoggingTensor\nfrom syft.workers.websocket_server import WebsocketServerWorker\nfrom syft.workers.websocket_client import Web...
[ [ "torch.Tensor", "torch.tensor" ] ]
FasahatSiddiqui/Read-VGG-json-and-COCO-json-labeling-files
[ "b30ad19397018dbd4c9e33bb4733431086f128a9" ]
[ "json_data_labelling.py" ]
[ "import numpy as np\nimport cv2\nimport os\nfrom matplotlib import pyplot as plt\nimport json\nfrom skimage.draw import polygon\n\ndef json_mask(file_name,json_filename,file_extension, dir):\n img = cv2.imread(os.path.join(dir,'train_data',file_name),1)\n mask = np.zeros((img.shape[0],img.shape[1]))\n \n with o...
[ [ "numpy.array", "numpy.zeros", "matplotlib.pyplot.imsave", "numpy.round", "numpy.transpose" ] ]
engeir/isr-spectrum
[ "7ac0562dd71c3d55bf5991c3fe8de3b5d8a55a02" ]
[ "src/isr_spectrum/plotting/reproduce.py" ]
[ "\"\"\"Reproduce the plots used in the thesis, and/or create new\n\"experiments\" based on the abstract base class `Reproduce`.\n\nRun from `main.py`.\n\"\"\"\n\nimport sys\nimport time\nfrom abc import ABC, abstractmethod\n\nimport matplotlib\nimport matplotlib.patheffects as PathEffects\nimport matplotlib.pyplot ...
[ [ "numpy.load", "numpy.min", "numpy.cos", "matplotlib.pyplot.minorticks_on", "numpy.max", "matplotlib.pyplot.savefig", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.tight_layout", "matplotlib.patheffects.withStroke", "matplotlib.pyp...
renan-cunha/intelligent-systems-project
[ "66b31a2dd3ad19d13a357fb74ba524c5884ff5ea" ]
[ "server/test_api.py" ]
[ "import pytest\nfrom flask import json\nfrom api import app\nimport os\nimport cloudpickle as cp\nimport pandas as pd\nimport numpy as np\nfrom sklearn.pipeline import Pipeline\nfrom scipy.sparse import csr_matrix\nfrom sklearn.metrics import roc_auc_score\n\ncategorize_route = \"v1/categorize\"\nvalid_categories_s...
[ [ "pandas.read_csv", "sklearn.metrics.roc_auc_score", "pandas.Series" ] ]
AAmineRYT/C106
[ "23f96e82f580ce1cd859571e14f69be19dc47525" ]
[ "setup.py" ]
[ "import plotly.express as px\nimport csv\nimport numpy as np\n\ndef plotFigure(data_path):\n with open(data_path) as csv_file:\n df = csv.DictReader(csv_file)\n fig = px.scatter(df,x=\"Temperature\", y=\"Ice-cream Sales\")\n fig.show()\n\ndef getDataSource(data_path):\n ice_cream_sales = ...
[ [ "numpy.corrcoef" ] ]
omerferhatt/ml-on-genes
[ "ead86d9e8bcf83c3bbc3f15528c93eb766c637cd" ]
[ "models/decision_tree.py" ]
[ "import numpy as np\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.model_selection import cross_val_score\n\n\ndef train_decision_tree(x_train, y_train, fold):\n dt = DecisionTreeClassifier()\n scores = cross_val_score(dt, x_train, y_train, cv=fold)\n print(f\"Decision Tree\\n\"\n ...
[ [ "sklearn.model_selection.cross_val_score", "sklearn.tree.DecisionTreeClassifier" ] ]
Jeffrey0Liao/2020-2021-Final-Year-Project-Joint-Sentimental-Analysis-Based-on-Tree-topology
[ "7aa8fe1ce901a61c41bd8d51a22d6dc313b1740b" ]
[ "model.py" ]
[ "import torch as th\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data import Dataset\nimport torch.nn.functional as F\nimport numpy as np\n\nimport dgl\nimport dgl.function as fn\n\nclass TreeLSTMCell(nn.Module):\n def __init__(self, x_size, h_size):\n super(TreeLSTMCe...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.nn.Dropout", "torch.sigmoid", "torch.mm", "torch.nn.functional.softmax", "torch.tanh", "torch.nn.Embedding", "torch.chunk", "torch.sum" ] ]
Anita1017/nlp-recipes
[ "a5cd2303187239799ae0b1597a7c16eb99a97108", "a5cd2303187239799ae0b1597a7c16eb99a97108" ]
[ "utils_nlp/eval/SentEval/senteval/utils.py", "utils_nlp/models/transformers/abstractive_summarization_bertsum.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\nfrom __future__ import absolute_import, division, unicode_literals\n\nimport numpy as np\nimport re\nimport inspect...
[ [ "numpy.dot", "numpy.linalg.norm" ], [ "torch.utils.data.RandomSampler", "torch.stack", "torch.save", "torch.utils.data.SequentialSampler", "torch.cuda.empty_cache", "torch.tensor", "torch.utils.data.DataLoader", "torch.ones_like", "torch.load", "torch.utils.data...
terrifyzhao/information_extract
[ "d950c25911f5a8d9f7e10eb9ecfd53f897cef8d0" ]
[ "final/train.py" ]
[ "import json\nfrom final.model import model\nfrom keras.callbacks import Callback\nimport keras.backend as K\nfrom tqdm import tqdm\nimport numpy as np\nimport os\nfrom gensim.models import Word2Vec\nimport jieba\nimport ahocorasick\n\nos.environ[\"KMP_DUPLICATE_LIB_OK\"] = \"TRUE\"\n\ntrain_model_path = 'out2/trai...
[ [ "numpy.array", "numpy.zeros", "numpy.where", "numpy.argmax", "numpy.expand_dims" ] ]
cnheider/imgaug
[ "f0a7432205975e4435c81894a63bb147af67c476" ]
[ "checks/check_elastic_transformation.py" ]
[ "from __future__ import print_function, division\nimport imgaug as ia\nfrom imgaug import augmenters as iaa\nimport imageio\nimport numpy as np\nfrom skimage import data\n\ndef main():\n image = data.astronaut()\n image = ia.imresize_single_image(image, (128, 128))\n\n #image = ia.imresize_single_image(np....
[ [ "numpy.hstack", "numpy.copy", "numpy.arange", "numpy.vstack" ] ]
danilobellini/Axelrod
[ "2c9212553e06095c24adcb82a5979279cbdf45fb" ]
[ "axelrod/tests/unit/test_eigen.py" ]
[ "\"\"\"Test for eigen.py.\"\"\"\n\nimport unittest\n\nimport numpy\nfrom axelrod.eigen import _normalise, principal_eigenvector\nfrom numpy.testing import assert_array_almost_equal\n\n\nclass FunctionCases(unittest.TestCase):\n def test_identity_matrices(self):\n for size in range(2, 6):\n mat ...
[ [ "numpy.identity", "numpy.array", "numpy.dot", "numpy.ones" ] ]
davidsvaughn/har-pytorch
[ "334733a1e870637c9077d16fc15e0b1954a6dfc5" ]
[ "preproc.py" ]
[ "import torch\nfrom torch import nn\n\ndef add_magnitudes(x):\n G,A = x[:,:3,:], x[:,3:,:]\n \n ## add magnitude of accel and gyro...\n a = torch.norm(A, dim=1, keepdim=True)\n g = torch.norm(G, dim=1, keepdim=True)\n# x = torch.cat((G, g, A, a), 1)\n \n return torch.cat((G, g, A, a), 1)" ]
[ [ "torch.norm", "torch.cat" ] ]
TAREQMAHIN/NLP-Task-Assignment-TAREQ-
[ "4edd8ace9063a09ee38e643731badd490517187b" ]
[ "train.py" ]
[ "from keras.models import Sequential\r\nfrom keras.layers import Dense, Embedding, LSTM\r\nfrom keras.utils.np_utils import to_categorical\r\nfrom keras.preprocessing.text import Tokenizer\r\nfrom keras.preprocessing.sequence import pad_sequences\r\nfrom keras.callbacks import ModelCheckpoint, EarlyStopping\r\nimpo...
[ [ "sklearn.preprocessing.LabelEncoder", "numpy.asarray", "numpy.random.shuffle", "numpy.arange", "pandas.read_csv" ] ]
Davidbeltran99/maffin
[ "d4a80ff5e2a3623f04e871a8d08a0b12e764cf9d" ]
[ "cogs/feature/analytics.py" ]
[ "from discord.ext import commands\n\nimport discord\n# import asyncio\n# import timeago\nimport datetime\nimport timedelta\nimport utils.db\nfrom utils.checks import dev\nimport seaborn as sns\nfrom matplotlib import pyplot as plt\nimport pandas as pd\nimport timeago\n\nclass analytics(commands.Cog):\n\n\tdef __ini...
[ [ "matplotlib.pyplot.clf", "matplotlib.pyplot.close", "matplotlib.pyplot.xticks", "pandas.DataFrame" ] ]
Varun0801/ga-learner-dsb-repo
[ "45ce5ae273ca66a2443d4b9417e74ef0f872d8ec" ]
[ "Probability-Basics-/code.py" ]
[ "# --------------\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# code starts here\ndf = pd.read_csv(path)\n#print(df.info())\np_a = ((df['fico'] > 700).sum())/len(df)\nprint(p_a)\np_b = ((df['purpose'] == 'debt_consolidation').sum())/len(df)\nprint(p_b)\ndf1 = df[df['purpose']== 'deb...
[ [ "matplotlib.pyplot.hist", "pandas.read_csv", "matplotlib.pyplot.bar" ] ]
timothyleslie/CodeBERT
[ "6767a3b7076f5b481cc228d2032c21327269c5b8" ]
[ "CodeBERT/code2nl/run.py" ]
[ "# coding=utf-8\r\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\r\n# Copyright (c) 2018, NVIDIA CORPORATION. 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.\...
[ [ "torch.utils.data.RandomSampler", "numpy.exp", "torch.cuda.is_available", "torch.load", "torch.nn.DataParallel", "torch.distributed.init_process_group", "torch.manual_seed", "torch.tensor", "torch.utils.data.DataLoader", "torch.device", "torch.cuda.manual_seed_all", ...
juluobruce/Biodiversity-dashboard
[ "158fb826b15e80da401775e7ca97d88b6e893cbb" ]
[ "Belly_Button_Biodiversity/app.py" ]
[ "import os\n\nimport pandas as pd\nimport numpy as np\n\nimport sqlalchemy\nfrom sqlalchemy.ext.automap import automap_base\nfrom sqlalchemy.orm import Session\nfrom sqlalchemy import create_engine\n\nfrom flask import Flask, jsonify, render_template\nfrom flask_sqlalchemy import SQLAlchemy\n\napp = Flask(__name__)...
[ [ "pandas.read_sql_query" ] ]
TeamEpochGithub/Jigsaw
[ "0b2f65681e585de4bcb0913f01f10c92358ca376" ]
[ "src/training/train.py" ]
[ "import gc\nimport time\nimport copy\nimport os\n\nimport numpy as np\n\nfrom collections import defaultdict\n\nimport torch\nfrom torch.optim import lr_scheduler\nfrom torch.utils.data import DataLoader\nimport torch.nn as nn\n\nfrom tqdm import tqdm\n\nfrom data_loader import JigsawDataset\n\n# For colored termin...
[ [ "torch.nn.MarginRankingLoss", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.no_grad", "torch.cuda.get_device_name", "torch.optim.lr_scheduler.CosineAnnealingWarmRestarts", "torch.cuda.is_available", "torch.utils.data.DataLoader" ] ]
matthiasdiener/pyopencl
[ "b072dd5298d4ecd340afe61089529fb3148872af" ]
[ "test/test_algorithm.py" ]
[ "#! /usr/bin/env python\n\nfrom __future__ import division, with_statement, absolute_import, print_function\n\n__copyright__ = \"Copyright (C) 2013 Andreas Kloeckner\"\n\n__license__ = \"\"\"\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation...
[ [ "numpy.max", "numpy.array", "numpy.linalg.norm", "numpy.dot", "numpy.zeros", "numpy.minimum", "numpy.set_printoptions", "numpy.sum", "numpy.min", "numpy.where", "numpy.arange", "numpy.sort", "numpy.random.randint", "numpy.cumsum", "numpy.vdot", "nump...
animolopez/arctic_sound
[ "33a63d10b7734e2539efa5f318d2cc98c6d491e9" ]
[ "sinewave.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport IPython.display\n\nimport sys\nsys.path.append(r\"C:\\Users\\作業用\\Documents\\module\")\nfrom iowave import *\nfrom spectrogram import *\n\nA = 0.8\nf = 440\nlength = 1\nfrs = 44100\n\nt = np.arange(0, length, 1 / frs)\ny = A * np.sin(2*np.pi*f*t)\n\nplt.p...
[ [ "numpy.sin", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
ameli/detkit
[ "54a1d5116e668f18be57954ba012f6061044668e" ]
[ "detkit/_utilities/plot_utilities.py" ]
[ "# SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu>\n# SPDX-License-Identifier: BSD-3-Clause\n# SPDX-FileType: SOURCE\n#\n# This program is free software: you can redistribute it and/or modify it\n# under the terms of the license found in the LICENSE.txt file in the root\n# directory of t...
[ [ "matplotlib.use", "matplotlib.pyplot.switch_backend", "matplotlib.pyplot.savefig", "matplotlib.pyplot.rc", "matplotlib.pyplot.show", "matplotlib.get_backend" ] ]
Cognive-in/coursera_ML_Python
[ "f174d350321aab0ef9cd14a41e425f3e753fdaa5" ]
[ "Ex_1/data/gradientDescent.py" ]
[ "import numpy as np\nimport data.computeCost as cc\n\ndef gradientDescent(X,y,theta,alpha,num_iters):\n m = len(y)\n J_hist = np.zeros((num_iters,1))\n for i in range(num_iters):\n theta = theta - alpha*(1.0/m)*np.transpose(X).dot(X.dot(theta)-np.transpose([y]))\n J_hist[i] = cc.computeCost(X...
[ [ "numpy.transpose", "numpy.zeros" ] ]
vatsan/shap
[ "6a23d95321501ac3c1c203cdc9eedf211ee34706" ]
[ "shap/plots/summary.py" ]
[ "\"\"\" Summary plots of SHAP values across a whole dataset.\n\"\"\"\n\nfrom __future__ import division\n\nimport warnings\nimport numpy as np\nfrom scipy.stats import gaussian_kde\ntry:\n import matplotlib.pyplot as pl\nexcept ImportError as e:\n warnings.warn(\"matplotlib could not be loaded!\", e)\n pas...
[ [ "matplotlib.pyplot.xlim", "numpy.min", "numpy.invert", "matplotlib.pyplot.gcf", "numpy.cumsum", "numpy.max", "numpy.random.normal", "matplotlib.pyplot.colorbar", "numpy.nanpercentile", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.fill_between", "matplotlib.pyplo...
james94/P2-Advanced-Lane-Lines-CarND
[ "7661f14086c3e960826f3116d9d89048151670f8" ]
[ "lib/cv/LaneVehiclePosition.py" ]
[ "import matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport cv2\nimport os\n\n# LaneVehiclePosition calculates vehicle's position with respect to the center\n# of the lane\n\nclass LaneVehiclePosition:\n def __init__(self):\n \"\"\"\n Initializes conversion fr...
[ [ "matplotlib.pyplot.imsave", "matplotlib.pyplot.savefig", "numpy.abs" ] ]
essy00/mw_classification
[ "7a8a963a9c34f51e7c4a3a64d71849ee632fc950" ]
[ "mw_classification/gui.py" ]
[ "from PIL import ImageTk, Image\r\nimport cv2\r\nimport numpy as np\r\nimport tensorflow\r\n\r\nimport tkinter.filedialog\r\nimport tkinter as tk\r\nimport shutil\r\nimport os\r\n\r\nface_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')\r\nmodel = tensorflow.keras.models.load_model('model.h5')...
[ [ "tensorflow.keras.models.load_model", "numpy.array" ] ]
raphael-roemer/ML-inference-effective-parameters-prediction
[ "e5b34e7222579720e9e3a453f41af4762557fc41" ]
[ "ML/machine_learning/model_fit.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import GridSearchCV, learning_curve,ShuffleSplit, train_test_split\nimport os\nimport time\nimport shap\nimport xgboost as xgb\n\nareas = ['CE']\ndata_version = '2021-07-14_3'\n#targets = ['g1','g2','q','r','D','mu_w_0','mu_a_0','RoCof','nadir',...
[ [ "sklearn.model_selection.train_test_split", "pandas.DataFrame", "pandas.read_hdf" ] ]
Andy-yeongjin/crawling_project_1_hotel_reviews
[ "db680e02e2349d0bdfe157d7628e2a39d94a990f" ]
[ "pros/2-1-pros.py" ]
[ "# -*- coding: utf8 -*- \nimport requests\nimport pandas as pd\nimport selenium\nfrom selenium import webdriver\nfrom selenium.webdriver.common.by import By \nfrom selenium.webdriver.support.ui import WebDriverWait \nfrom selenium.webdriver.support import expected_conditions as EC\nfrom selenium.webdriver.chrome.op...
[ [ "matplotlib.font_manager.FontProperties", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xticks", "matplotlib.pyplot.yticks", "matplotlib.rc", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
federico2001/OpenBlender
[ "613b4c60726551f845782c961851c07d53f86aad" ]
[ "OpenBlender/OpenBlender.py" ]
[ "# Copyright (c) 2021 OpenBlender.io\n# Simplicity is key.\n\n\nfrom urllib.request import Request, urlopen\nfrom base64 import b64encode, b64decode\nfrom urllib.request import urlopen\nfrom urllib.parse import urlencode\nfrom contextlib import closing\nfrom datetime import datetime\nfrom io import StringIO\nimport...
[ [ "pandas.DataFrame.from_dict" ] ]
alex-muci/finance-musings
[ "e6baf3bdca67451b98b939fedff40d93ec2d75d3" ]
[ "sabr/sabr/samples/complete_run.py" ]
[ "\"\"\"\nINCOMPLETE ** INCOMPLETE ** INCOMPLETE\nSample vol surface fitting using SABR:\n 1. read raw prices for [SPX, ...] options (using .csv file in analytics.data from Raj) &\n get raw implied vols\n 2. TODO: get implied vol spline for each liquid maturity (e.g. LIQUID: 4 or more prices) &\n calibrate SAB...
[ [ "pandas.DataFrame.from_dict", "numpy.zeros" ] ]
bunderhi/donkeycar
[ "c8cc941af681820dfbf3d212dd155552cbdc1e6b" ]
[ "donkeycar/parts/realsenseT265.py" ]
[ "'''\nAuthor: Tawn Kramer\nFile: realsense2.py\nDate: April 14 2019\nNotes: Parts to input data from Intel Realsense 2 cameras\n'''\nimport time\nimport logging\n\nimport numpy as np\nimport cv2\nimport os\nfrom math import tan, pi, asin, atan2\nimport pyrealsense2 as rs\nimport donkeycar as dk\n\nclass RPY:\n d...
[ [ "numpy.array", "numpy.reshape", "numpy.zeros", "numpy.eye", "numpy.vstack" ] ]
weiyunfei/taichi
[ "52a7cd8325672bc160e5540e54064c960c78256d" ]
[ "tests/python/test_bit_struct.py" ]
[ "import numpy as np\nfrom pytest import approx\n\nimport taichi as ti\nfrom tests import test_utils\n\n\n@test_utils.test(require=ti.extension.quant_basic, debug=True)\ndef test_simple_array():\n ci13 = ti.types.quant.int(13, True)\n cu19 = ti.types.quant.int(19, False)\n\n x = ti.field(dtype=ci13)\n y ...
[ [ "numpy.array" ] ]
bear9608/NIU
[ "07168e981cf261e2e20c577c7d75df0cc2fb0c19" ]
[ "utils/few_shot.py" ]
[ "import torch\n\n\ndef split_shot_query(data, way, shot, query, ep_per_batch=1):\n img_shape = data.shape[1:]\n data = data.view(ep_per_batch, way, shot + query, *img_shape)\n x_shot, x_query = data.split([shot, query], dim=2)\n x_shot = x_shot.contiguous()\n x_query = x_query.contiguous().view(ep_pe...
[ [ "torch.arange" ] ]
klee229/CS179J-Smart-Water-Station-Project
[ "7568c23dc7cd4108ca42c27bf77e18a2a74aa36f" ]
[ "tests/test_csv.py" ]
[ "import unittest\nimport csv\nimport pandas as pd\n\n\nclass TestCSVFile(unittest.TestCase):\n\n # NOTE: all items in user_data converted to str from int or float, this way we compare string to string for testing\n\n def test_open_write_read_close(self):\n # example users for testing\n columns =...
[ [ "pandas.read_csv" ] ]
cuigucohen/Code-width-and-height-of-vehicle
[ "0c4c0876089459da87a0bfb67f02e34bd764dda1" ]
[ "lib/datasets/imdb.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\nimport os\nimport os.path as osp\nimport PIL\nfrom utils.cy...
[ [ "numpy.zeros_like", "numpy.zeros", "numpy.where", "numpy.arange", "numpy.sort", "numpy.hstack", "numpy.vstack" ] ]
stjordanis/mljar-supervised
[ "8c3f9d1ed527dfcfdaef91cf82e2779c5832e294" ]
[ "supervised/utils/importance.py" ]
[ "import os\nimport json\nimport logging\nimport warnings\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.inspection import permutation_importance\nfrom supervised.algorithms.registry import (\n BINARY_CLASSIFICATION,\n MULTICLASS_CLASSIFICATION,\n REGRESSION,\n)\nfro...
[ [ "pandas.DataFrame", "sklearn.metrics.log_loss", "sklearn.metrics.make_scorer", "sklearn.inspection.permutation_importance", "numpy.unique" ] ]
janapavlasek/faster-rcnn.pytorch
[ "8080ee08165931e3480558a6b10db63d52eeb5f8" ]
[ "lib/faster_rcnn/model/faster_rcnn/faster_rcnn.py" ]
[ "import random\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport torchvision.models as models\nfrom torch.autograd import Variable\nimport numpy as np\nfrom ..utils.config import cfg\nfrom ..rpn.rpn import _RPN\n\nfrom ..roi_layers import ROIAlign, RO...
[ [ "torch.autograd.Variable", "torch.nn.functional.cross_entropy", "torch.nn.functional.softmax" ] ]
aditya-taparia/ImageEditor-Tkinter-Application
[ "f8444c24bc9b1da9702c54ff2659abc419c39998" ]
[ "Image_editor.py" ]
[ "import cv2\r\nimport os\r\nimport tkinter as tk\r\nimport numpy as np\r\nimport random\r\nfrom tkinter import *\r\nfrom tkinter import ttk\r\nfrom tkinter import filedialog\r\nfrom PIL import ImageTk, Image \r\nglobal count,emig\r\nglobal bright,con\r\nglobal frp,tname#list of paths\r\nfrp=[]\r\ntname=[]\r\ncon=1\...
[ [ "numpy.array", "numpy.uint8", "numpy.zeros", "numpy.copy", "numpy.interp", "numpy.arange" ] ]
xiongzihua/ncnn-yolo
[ "8d0d05af4263c127d22642c9fe17957b5c068a83" ]
[ "pytorch-yolo-v1/yoloLoss.py" ]
[ "#encoding:utf-8\r\n#\r\n#created by xiongzihua 2017.12.26\r\n#\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom torch.autograd import Variable\r\n\r\nclass yoloLoss(nn.Module):\r\n def __init__(self,S,B,l_coord,l_noobj):\r\n super(yoloLoss,self).__init__()\r\n se...
[ [ "torch.nn.functional.mse_loss", "torch.sqrt", "torch.LongTensor", "torch.autograd.Variable" ] ]
holwech/pysa
[ "d002e3b635b88037024555e1f9aab701b31044f3" ]
[ "pysa/nhht.py" ]
[ "import numpy as np\nimport scipy.signal as signal\nfrom . import utils\n\n# Calculates the normalized HHt.\n# Takes in all the IMFs, but not the residue. That is; the last row of the the return value\n# of the EMD function should not be included in the input variable \"imfs\"\ndef nhht(imfs, sample_frequency):\n ...
[ [ "numpy.zeros", "numpy.copy", "numpy.fabs", "numpy.float32", "numpy.conj", "scipy.signal.hilbert" ] ]
rajkshah3/val
[ "1436335ae5d810ddccd30ea5251624ca797bcaaf" ]
[ "nets/rnn.py" ]
[ "from tensorflow.python.util import nest\nfrom tensorflow.python.framework import tensor_shape\n\nimport tensorflow as tf\nimport numpy as np\n\nslim = tf.contrib.slim\n\n\ndef _state_size_with_prefix(state_size, prefix=None):\n\n result_state_size = tensor_shape.as_shape(state_size).as_list()\n if prefix is not ...
[ [ "tensorflow.concat", "tensorflow.expand_dims", "tensorflow.python.util.nest.is_sequence", "tensorflow.contrib.layers.xavier_initializer", "tensorflow.nn.bidirectional_dynamic_rnn", "tensorflow.contrib.rnn.BasicLSTMCell", "numpy.load", "tensorflow.python.framework.tensor_shape.as_sh...
razvanc92/ST-WA
[ "90259082f5b872aa584dd72c0857499f96d2cd76" ]
[ "componenets/metrics.py" ]
[ "import numpy as np\nimport torch\n\ndef MAE_torch(pred, true, mask_value=None):\n if mask_value != None:\n mask = torch.gt(true, mask_value)\n pred = torch.masked_select(pred, mask)\n true = torch.masked_select(true, mask)\n return torch.mean(torch.abs(true-pred))\n\ndef MSE_torch(pred, ...
[ [ "numpy.square", "numpy.divide", "torch.gt", "numpy.sum", "torch.abs", "numpy.where", "torch.sum", "numpy.absolute", "torch.div", "torch.mean", "torch.masked_select" ] ]
Crazy-Jack/Cl-InfoNCE
[ "b1ce87bc016a4f7ca95839b31f5bb66ebb04748e" ]
[ "clinfonce/util.py" ]
[ "from __future__ import print_function\nimport os, sys\nimport logging\nimport argparse\nimport shutil\nimport getpass\nimport subprocess\n\nimport math\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\nclass TwoCropTransform:\n \"\"\"Create two crops of the same image\"\"\...
[ [ "numpy.asarray", "torch.save", "torch.no_grad", "torch.nn.init.xavier_uniform_", "torch.load" ] ]
alexholcombe/twoWords
[ "9e86b2dc13cb6dd9a79820957525a3e9e1d253b3", "9e86b2dc13cb6dd9a79820957525a3e9e1d253b3" ]
[ "specialFieldsStudentCode/Charlie/noiseStaircaseHelpers.py", "twoWordsCheryl.py" ]
[ "import numpy as np\nfrom psychopy import visual, data, logging\nimport itertools\nfrom math import log\nfrom copy import deepcopy\nfrom pandas import DataFrame\nimport pylab, os\nfrom matplotlib.ticker import ScalarFormatter\n\ndef toStaircase(x,descendingPsycho):\n #Don't need to take log, staircase internals ...
[ [ "numpy.array", "pandas.DataFrame", "numpy.ones", "numpy.random.shuffle", "numpy.arange" ], [ "numpy.array", "numpy.isnan", "numpy.random.rand", "numpy.zeros", "numpy.median", "numpy.round", "numpy.ones", "numpy.random.shuffle", "numpy.diff", "numpy.w...
xw-hu/DGNL-Net
[ "44e8516429fe8a4e7db615573454b24f51f595cc" ]
[ "modules.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch import nn\n\n\nclass DGNL(nn.Module):\n def __init__(self, in_channels):\n super(DGNL, self).__init__()\n\n self.eps = 1e-6\n self.sigma_pow2 = 100\n\n self.theta = nn.Conv2d(in_channels, int(in_channels / 2), kernel_size=1)\n...
[ [ "torch.stack", "torch.min", "torch.bmm", "torch.nn.ReLU6", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.functional.softmax", "torch.Tensor", "torch.pow" ] ]
sidgurun/zELDA
[ "60f5fa3936c643acdb4ea7ee502c9fc4b31abf92" ]
[ "zELDA/__init__.py" ]
[ "import os\nimport os.path\n\nimport time\n\n#from pylab import *\n\nimport sys\nimport shutil\n\nimport urllib\n\nimport numpy as np\n\nfrom sklearn.ensemble import RandomForestRegressor, ExtraTreesRegressor, GradientBoostingRegressor\nfrom sklearn.neighbors import KNeighborsRegressor\n\nimport pickle\n\nfrom scip...
[ [ "numpy.random.rand", "numpy.copy", "numpy.load", "numpy.exp", "numpy.mean", "numpy.where", "numpy.histogram", "numpy.zeros_like", "numpy.log", "matplotlib.pyplot.get_cmap", "numpy.interp", "numpy.arange", "numpy.trapz", "numpy.isfinite", "numpy.sqrt", ...
paulwababu/kuccps-placement-system
[ "8e3a96267fef92c1cc0755ce9637b8173d7d3ef8" ]
[ "cluster.py" ]
[ "from math import sqrt\nfrom xxlimited import Str\n\n\"\"\"\nTo calculate kcse cluster points, we use the formular below\n\nC = √(X/48 * Y/84) * 48\n\nwhere, C = Cluster Points\n X = points obtained in the four main subjects required in the course you want to do,\n eg computer science\n Y = total ...
[ [ "pandas.read_csv" ] ]
BruninLima/PydaptiveFiltering
[ "14f4758a25b7cb3f1fd643caa5caffd5e7f06c6a" ]
[ "pydaptivefiltering/Meta_LMS.py" ]
[ "import numpy as np\nfrom time import time\n\n# Done:\n# LMS\n# NLMS\n# Newton_LMS\n# SignData\n# SignError\n\n# TODO:\n# DualSign\n# Power2Error\n# AffineProjection\n# T domain\n# T domain DCT\n# T domain DFT\n\n\nclass LMS:\n\n def LMS(Filter, desired_signal: np.ndarray, input_signal: np.ndarray, step: float =...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros", "numpy.sign", "numpy.abs", "numpy.append" ] ]
johntiger1/vaal_querying
[ "c20da3b0b5ca9f25334523f831d0ba8a11f710ca" ]
[ "vgg.py" ]
[ "import torch\nimport torch.nn as nn\n\n\n__all__ = [\n 'VGG', 'vgg11', 'vgg11_bn', 'vgg13', 'vgg13_bn', 'vgg16', 'vgg16_bn',\n 'vgg19_bn', 'vgg19',\n]\n\n\nmodel_urls = {\n 'vgg11': 'https://download.pytorch.org/models/vgg11-bbd30ac9.pth',\n 'vgg13': 'https://download.pytorch.org/models/vgg13-c768596a....
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.flatten", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.init.normal_", "torch.nn.AdaptiveAv...
rrkrp100/Face_detect
[ "57b069f6c03c9e07a3f45a485624e8e4ad40ce78" ]
[ "retrain.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.image.resize_bilinear", "tensorflow.reduce_min", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.image.random_flip_left_right", "tensorflow.matmul", "tensorflow.import_graph_def", "tensorflow.stack", "tensorflow.python.platform.gfile.Exists", "tensorf...
phillikus/doom-ai
[ "ee0d49ae46321960adacc054d041377622877b10" ]
[ "src/models/rnn/RNN.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\n\nclass RNN(nn.Module):\n def __init__(self, num_inputs, num_actions):\n super(RNN, self).__init__()\n self.convolution1 = nn.Conv2d(in_channels=num_inputs, out_channels...
[ [ "torch.nn.Linear", "torch.nn.Conv2d" ] ]
sdrees/pandas
[ "bef454f0893efe2fa5e49317635f89c03467d16e" ]
[ "pandas/tests/extension/test_arrow.py" ]
[ "\"\"\"\nThis file contains a minimal set of tests for compliance with the extension\narray interface test suite, and should contain no other tests.\nThe test suite for the full functionality of the array is located in\n`pandas/tests/arrays/`.\nThe tests in this file are inherited from the BaseExtensionTests, and o...
[ [ "pandas.array", "pandas.core.arrays.arrow.dtype.ArrowDtype.construct_from_string", "pandas.core.arrays.arrow.dtype.ArrowDtype" ] ]
SahilC/reinforcement-learning
[ "ed4aa772f7a5c28188887242ba35cd5854a8c78f" ]
[ "assign2/bandit.py" ]
[ "import numpy as np\nclass Bandit:\n def __init__(self, k):\n self.k = k\n \n def action(self, a):\n return np.random.normal(5 + a, 1)\n\n def loss(self, delta, t, numsteps):\n \tloss = [np.random.binomial(1, 0.5, 1) for i in xrange(8)]\n \t\n \tloss.append(np.random.binomial(1, 0...
[ [ "numpy.random.normal", "numpy.array", "numpy.random.binomial" ] ]
csmasters/vedastr
[ "7513384ab503f15dc574c7d92b75ff2092354757" ]
[ "vedastr/models/bodies/rectificators/tps_stn.py" ]
[ "# modify from https://github.com/clovaai/deep-text-recognition-benchmark\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.nn import functional as F\n\nfrom vedastr.models.bodies import build_feature_extractor\nfrom vedastr.models.utils import build_torch_nn, build_module\nfrom .registry impor...
[ [ "numpy.concatenate", "numpy.square", "torch.zeros", "numpy.linalg.norm", "numpy.meshgrid", "numpy.fill_diagonal", "numpy.zeros", "numpy.log", "torch.nn.Sequential", "numpy.ones", "torch.bmm", "torch.from_numpy", "numpy.stack", "torch.nn.functional.grid_sampl...
usnistgov/sesame
[ "2cfc33b64f4834ca63a31de744d5879e6c5ad342", "2cfc33b64f4834ca63a31de744d5879e6c5ad342" ]
[ "sesame/observables.py", "examples/tutorial2/1d_heterojunction.py" ]
[ "# Copyright 2017 University of Maryland.\n#\n# This file is part of Sesame. It is subject to the license terms in the file\n# LICENSE.rst found in the top-level directory of this distribution.\n\nfrom numpy import exp\nimport numpy as np\n\n\ndef get_n(sys, efn, v, sites):\n \"\"\"\n Compute the electron den...
[ [ "numpy.abs", "numpy.exp", "numpy.log" ], [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "numpy.exp", "numpy.save", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.linspace" ] ]
dpfranke/qtt
[ "f60e812fe8b329e67f7b38d02eef552daf08d7c9", "f60e812fe8b329e67f7b38d02eef552daf08d7c9" ]
[ "docs/notebooks/qtt_example.py", "qtt/legacy.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\" Example script to show QTT capabilities\n\n@author: eendebakpt\n\"\"\"\n\n#%% Load packages\nfrom imp import reload\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport tempfile\nfrom collections import OrderedDict\n\nimport qcodes\nfrom qcodes import MatPlot\n\nimport qtt\n...
[ [ "numpy.set_printoptions" ], [ "matplotlib.pyplot.colorbar", "matplotlib.pyplot.clim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.tight_layout", "matplotlib.colors.LinearSegmentedColormap", "matplotlib.pyplot.gca", "matplotlib.pyplot.axis", "numpy.array", "numpy.per...
entn-at/filtering
[ "da8edda4c8fb651eb9dbd7b25f7fc8f18b2cc144" ]
[ "lilfilter/local_amplitude.py" ]
[ "# To be run with python3. Caution: this module requires torch!\n\n\"\"\"\nThis module defines an object called Normalizer that can be used to\nnormalize the output of class Multistreamer (from ./multistreamer.py),\nwith a view to making the data easier for neural nets to process.\n\nThe basic idea is that we comp...
[ [ "torch.zeros", "torch.empty" ] ]
muzishen/Huawei_Digix_Retrieval_Top4
[ "39151e2f8493221138404e2942afbf03e3afbf08" ]
[ "code/model/backbones/se_resnet_ibn_a.py" ]
[ "from .se_module import SELayer\nimport torch.nn as nn\nimport torch\nimport math\n\n__all__ = ['se_resnet50_ibn_a', 'se_resnet101_ibn_a', 'se_resnet152_ibn_a']\n\ndef conv3x3(in_planes, out_planes, stride=1):\n return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False)\n\n\ncla...
[ [ "torch.cat", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.split", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.InstanceNorm2d", "torch.load", "torch.nn.AdaptiveAvgPool2d" ] ]
SalihTuncer/CoronaSimulation
[ "ee18d5735bc0f583459fc1ee15bbf912348abf18" ]
[ "Simulation.py" ]
[ "# package imports\n# external libraries which need to be installed separately\nimport numpy as np\n# internal python libraries\nfrom pprint import pformat\n\nfrom InfectionChain import InfectionChain\n\n\"\"\"\nThis is the heart of the whole application. This is where the simulation happens.\n\"\"\"\n\n\nclass Sim...
[ [ "numpy.array" ] ]
THGLab/NewtonNet
[ "fcf2af848a1c998bd08096dcefb58a5610eda03c" ]
[ "newtonnet/data/parse_raw.py" ]
[ "import os\nimport numpy as np\nimport warnings\nfrom collections import defaultdict\nfrom numpy.lib.function_base import append\nfrom sklearn.utils import random\nfrom sklearn.utils.random import sample_without_replacement\nfrom sklearn.model_selection import train_test_split\n\nfrom combust.utils.utility import s...
[ [ "numpy.concatenate", "numpy.array", "numpy.ceil", "numpy.ones_like", "numpy.nan_to_num", "numpy.sum", "sklearn.utils.random.sample_without_replacement", "numpy.load", "numpy.tile", "numpy.nanmean", "numpy.arange", "sklearn.model_selection.train_test_split", "num...
WordBearerYI/HPNet
[ "41d37ae61adab813582091bf3fb0e744513d731d" ]
[ "model.py" ]
[ "from torchvision.models import resnext50_32x4d as resnext\r\nimport torch.nn as nn\r\nimport torch\r\nimport torch.nn.functional as F\r\n\r\n\r\nclass HPANet(nn.Module):\r\n def __init__(self, hidden_size=1280,num_cls=18):\r\n super(HPANet, self).__init__()\r\n self.model_base = resnext().double()...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat", "torch.nn.ReLU", "torch.nn.BCEWithLogitsLoss", "torch.nn.CrossEntropyLoss" ] ]
alfredoav/trax
[ "e35776e7d0b5e58d2e69100fafb8080d4f2b19be" ]
[ "trax/supervised/decoding.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Trax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app...
[ [ "numpy.concatenate", "numpy.full" ] ]
yuhonghong66/kepler-mapper
[ "b7ecd1c573b1da49006aa651313fc2c79293f671" ]
[ "kmapper/cover.py" ]
[ "from __future__ import division\n\nimport warnings\nfrom itertools import product\nimport numpy as np\n\n# TODO: Incorporate @pablodecm's cover API.\n\n\nclass Cover:\n \"\"\"Helper class that defines the default covering scheme\n\n\n Parameters\n ------------\n\n limits: Numpy Array (n_dim,2)\n ...
[ [ "numpy.max", "numpy.array", "numpy.zeros", "numpy.float", "numpy.min", "numpy.any" ] ]
jessicaleete/numerical_computing
[ "cc71f51f35ca74d00e617af3d1a0223e19fb9a68" ]
[ "Labs/GMRES/plots.py" ]
[ "import numpy as np\nfrom scipy import linalg as la\nimport matplotlib\nmatplotlib.rcParams = matplotlib.rc_params_from_file('../../matplotlibrc')\nfrom matplotlib import pyplot as plt\n\ndef plot_gmres():\n M = 2*np.eye(200)+np.random.normal(0, .5/np.sqrt(200), (200,200))\n b = np.ones(200)\n k = 200\n ...
[ [ "numpy.empty", "numpy.zeros", "matplotlib.pyplot.savefig", "numpy.ones", "matplotlib.rc_params_from_file", "matplotlib.pyplot.close", "numpy.real", "numpy.eye", "scipy.linalg.eig", "numpy.sqrt", "numpy.imag", "matplotlib.pyplot.gca", "scipy.linalg.norm", "ma...
Eunjnnn/ignite
[ "743089705b2b252aa5e2a0f310da3a8724d6711e" ]
[ "ignite/contrib/metrics/regression/wave_hedges_distance.py" ]
[ "from typing import Tuple\n\nimport torch\n\nfrom ignite.contrib.metrics.regression._base import _BaseRegression\nfrom ignite.metrics.metric import reinit__is_reduced, sync_all_reduce\n\n\nclass WaveHedgesDistance(_BaseRegression):\n r\"\"\"Calculates the Wave Hedges Distance.\n\n .. math::\n \\text{WH...
[ [ "torch.tensor", "torch.sum" ] ]
feay1234/som-dst
[ "3e96fc8da8cae5a3b822718fa1e75edef1944d56" ]
[ "utils/data_utils.py" ]
[ "\"\"\"\nSOM-DST\nCopyright (c) 2020-present NAVER Corp.\nMIT license\n\"\"\"\n\nimport numpy as np\nimport json\nfrom torch.utils.data import Dataset\nimport torch\nimport random\nimport re\nfrom copy import deepcopy\nfrom .fix_label import fix_general_label_error\nimport collections\n\nflatten = lambda x: [i for ...
[ [ "numpy.array", "torch.tensor" ] ]
RoboJackets/robocup-software
[ "ae2920b8b98213e625d0565dd67005e7a8595fac" ]
[ "rj_gameplay/rj_gameplay/tactic/goalie_tactic.py" ]
[ "\"\"\"Tactic to produce goalie behavior, which tracks the ball, moves to block if a shot on goal is taken, and stays within the goalie box (generally).\"\"\"\n\nfrom dataclasses import dataclass\nfrom typing import List, Optional\nfrom typing import Dict, Generic, List, Optional, Tuple, Type, TypeVar\n\nimport stp...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.dot", "numpy.abs", "numpy.clip" ] ]
timoklimmer/neanno
[ "0c76e21a1774880827f518dc9550b54cce38625c" ]
[ "neanno/utils/metrics.py" ]
[ "from io import BytesIO\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sn\nfrom sklearn.metrics import confusion_matrix\n\nfrom neanno.utils.dict import merge_dict_sum_child_dicts\nfrom neanno.utils.text import (\n extract_annotations_as_list,\n extract_categories_from_categories_c...
[ [ "pandas.Categorical", "pandas.Series" ] ]