repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
Sengxian/cogdl
[ "b0a855feef6a883bcc0f7df421fc6092ec18abde", "b0a855feef6a883bcc0f7df421fc6092ec18abde" ]
[ "cogdl/tasks/link_prediction.py", "examples/gnn_models/chebyshev.py" ]
[ "import copy\nimport json\nimport logging\nimport os\nimport random\n\nimport networkx as nx\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom cogdl.datasets import build_dataset\nfrom cogdl.datasets.kg_data import BidirectionalOneShotIterator, TrainDataset\nfrom cogdl.models import build_model\nfrom c...
[ [ "torch.cat", "numpy.dot", "torch.stack", "torch.randperm", "torch.cuda.is_available", "sklearn.metrics.f1_score", "torch.sigmoid", "numpy.linalg.norm", "sklearn.metrics.precision_recall_curve", "numpy.random.randint", "torch.nn.BCELoss", "torch.zeros", "numpy.ar...
suriya-1403/Food-Detection
[ "aa52f946150bb949692a2307a55839a6252b35a9" ]
[ "Frontend/app.py" ]
[ "from flask import Flask, render_template, request\nfrom tensorflow.keras.models import load_model\nfrom tensorflow.keras.preprocessing import image\nimport numpy as np\n\napp = Flask(__name__)\nfood_list = ['donuts', 'pizza', 'samosa']\n\nmodel = load_model('model.hdf5', compile=False)\n\n\ndef predict_label(image...
[ [ "tensorflow.keras.preprocessing.image.load_img", "tensorflow.keras.models.load_model", "tensorflow.keras.preprocessing.image.img_to_array", "numpy.argmax", "numpy.expand_dims" ] ]
RafeyIqbalRahman/Data-Imputation-Techniques
[ "2c6e04136f82df7673948eae9da36b70ffe672a6" ]
[ "SimpleImputer.py" ]
[ "from numpy import isnan\nfrom pandas import read_csv, DataFrame\nfrom sklearn.impute import SimpleImputer\n\n# Load the data\ndf = read_csv('https://raw.githubusercontent.com/jbrownlee/Datasets/master/horse-colic.csv',\n header=None,\n na_values='?',)\n\n# Show the first 5 rows of the dat...
[ [ "sklearn.impute.SimpleImputer", "pandas.read_csv", "numpy.isnan", "pandas.DataFrame" ] ]
Agoniii/tensorflow
[ "4c6ad75c06935faf238b48034194712483114f5f" ]
[ "tensorflow/lite/python/tflite_convert.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.lite.python.lite.TFLiteConverterV2.from_saved_model", "tensorflow.python.keras.models.load_model", "tensorflow.lite.python.lite.TFLiteConverterV2.from_keras_model", "tensorflow.lite.python.lite.OpsSet.get_options", "tensorflow.lite.python.lite.OpsSet", "tensorflow.python.platfo...
joncrawf/mime
[ "7be7b1351cabaacc17caddbb6f808f3d37721a81" ]
[ "metaworld/envs/mujoco/sawyer_xyz/sawyer_basketball.py" ]
[ "import numpy as np\nfrom gym.spaces import Box\n\nfrom metaworld.envs.env_util import get_asset_full_path\nfrom metaworld.envs.mujoco.sawyer_xyz.base import SawyerXYZEnv, _assert_task_is_set, _sparse_task\n\n\nclass SawyerBasketballEnv(SawyerXYZEnv):\n\n def __init__(self):\n\n liftThresh = 0.3\n ...
[ [ "numpy.concatenate", "numpy.array", "numpy.linalg.norm", "numpy.exp", "numpy.hstack" ] ]
felixrlopezm/Udacity-Nanodegree-program-AI-programming-with-Python
[ "a87fcf6e9c37cf60ae6ff01c9909313b5d1b987a" ]
[ "predict_functions.py" ]
[ "# python3\n#\n# PROGRAMMER: Félix Ramón López Martínez\n# DATE CREATED: 10/11/2020\n# REVISED DATE:\n# PURPOSE: This is the repository of all the functions called fron predict.py.\n#\n##\n\n# Imports python modules\nimport argparse\nfrom torchvision import models\nimport torch\nfrom torch import nn\nfrom PIL impor...
[ [ "torch.nn.Linear", "torch.nn.LogSoftmax", "numpy.array", "torch.nn.Dropout", "torch.no_grad", "matplotlib.pyplot.figure", "torch.nn.ReLU", "torch.topk", "torch.load", "matplotlib.pyplot.show", "torch.exp", "matplotlib.pyplot.subplot" ] ]
SeaOfOcean/FastNN
[ "73b70c633117ccff4f1a270f461bacb96e0fc4ee" ]
[ "moe/trainer.py" ]
[ "# Copyright 2021 Alibaba Group Holding Limited. 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# Unle...
[ [ "tensorflow.compat.v1.estimator.RunConfig", "tensorflow.compat.v1.gfile.MakeDirs", "tensorflow.compat.v1.logging.warn", "tensorflow.compat.v1.logging.info", "tensorflow.compat.v1.train.StepCounterHook", "tensorflow.compat.v1.gfile.Open", "tensorflow.compat.v1.ConfigProto", "tensorf...
ZwX1616/mxnet-SSD
[ "fd89424d711b1ec4f02c35987212d1038e69e905" ]
[ "deploy/python/live.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport sys\nimport cv2\nimport mxnet as mx\nimport numpy as np\nimport random\nfrom pathlib import Path\nimport time\n\nmillisecond = lambda x: int(round(x * 1000))\n\nclass Detector(object):\n \"\"\"\n SSD detector which hold a detection network and wraps detection API\n\n Para...
[ [ "numpy.minimum", "numpy.where", "numpy.swapaxes", "numpy.argsort", "numpy.maximum" ] ]
MhmudAlpurd/IC-pytorchlite
[ "76ba0e04a423acbfe960dcd8dd9a0bc47c3893e7" ]
[ "ASLRecognition/scripts/test.py" ]
[ "'''\nUSAGE:\npython test.py --img A_test.jpg\n'''\nimport torch\nimport joblib\nimport torch.nn as nn\nimport numpy as np\nimport cv2\nimport argparse\nimport torchvision.transforms as transforms\nimport torch.nn.functional as F\nimport time\nimport cnn_models\nfrom PIL import Image\n\n# construct the argument par...
[ [ "numpy.transpose", "torch.tensor", "torch.load", "torch.max" ] ]
yagamimisa/dfc2019
[ "b823b6b1ac9215f7477ea38b5bf39919c7e1c02c" ]
[ "track2/make_track2_npz.py" ]
[ "# convert folders of images to npz train/validation sets\r\n# for training DenseMapNet and ICNet models\r\nfrom os.path import join\r\nfrom pathlib import Path\r\nfrom sys import stderr\r\n\r\nimport numpy as np\r\nimport os\r\nfrom copy import deepcopy\r\nfrom tqdm import tqdm\r\nimport tifffile\r\nimport glob\r\...
[ [ "numpy.asarray", "numpy.random.seed", "numpy.random.shuffle", "numpy.savez_compressed", "numpy.arange" ] ]
Eugenio2192/autumnopen
[ "9001304d711dc94070992897ad1cfb4eae8c5e36" ]
[ "src/homogenization/cost_of_carbon_capture_cement.py" ]
[ "from src.tools.config_loader import Configuration\nfrom src.technoeconomical.cost_operations_functions import cost_of_carbon_capture\nfrom src.harmonization.cost_transformation_functions import convert_value, index_generator\nimport pandas as pd\nconfig = Configuration.get_instance()\npd.set_option('display.max_co...
[ [ "pandas.read_csv", "pandas.set_option" ] ]
xlegend1024/onnxruntime-iot-edge
[ "9fc76b7dabf70ad4144e6f1d567689a2965adb30" ]
[ "modules/InferenceModule/inference.py" ]
[ "# Copyright (c) Microsoft. All rights reserved.\n# Licensed under the MIT license. See LICENSE file in the project root for\n# full license information.\n\nimport numpy as np\nimport time\n\ndef run_onnx(frame, location, timestamp, sess):\n\t\"\"\"\n\tDetect objects in frame of your camera, and returns results.\n\...
[ [ "numpy.array", "numpy.argmax", "numpy.exp" ] ]
Virtsionis/torch-nilm
[ "3df0d37ebc90e0429545c83effee93d346ef5a83", "3df0d37ebc90e0429545c83effee93d346ef5a83" ]
[ "neural_networks/custom_modules.py", "lab/training_tools.py" ]
[ "import warnings\nimport torch.nn as nn\n\n\nclass LinearDropRelu(nn.Module):\n def __init__(self, in_features, out_features, dropout=0):\n super(LinearDropRelu, self).__init__()\n self.linear = nn.Sequential(\n nn.Linear(in_features, out_features),\n nn.Dropout(dropout),\n ...
[ [ "torch.nn.Linear", "torch.nn.InstanceNorm1d", "torch.nn.Dropout", "torch.nn.Conv1d", "torch.nn.Sequential", "torch.nn.ReLU", "torch.nn.BatchNorm1d", "torch.nn.ZeroPad2d", "torch.nn.MaxPool1d", "torch.nn.Flatten" ], [ "torch.device", "numpy.array", "torch.sta...
DorAmram/pandas
[ "a2bbdb5a0abd131d0190fe58c0ba7cbf21b960c9", "4071dde86e33434e1bee8304fa62074949f813cc" ]
[ "pandas/tests/io/json/test_normalize.py", "pandas/tests/indexes/datetimes/test_datetime.py" ]
[ "import json\n\nimport numpy as np\nimport pytest\n\nfrom pandas import DataFrame, Index, json_normalize\nimport pandas.util.testing as tm\n\nfrom pandas.io.json._normalize import nested_to_record\n\n\n@pytest.fixture\ndef deep_nested():\n # deeply nested data\n return [\n {\n \"country\": \...
[ [ "numpy.array", "pandas.Index", "pandas.util.testing.assert_frame_equal", "pandas.io.json._normalize.nested_to_record", "pandas.DataFrame", "pandas.io.json.json_normalize", "pandas.util.testing.assert_produces_warning", "pandas.util.testing.assert_equal" ], [ "numpy.random.r...
jccmak/lightpipes
[ "1a296fe08bdd97fc9a0e11f92bab25c85f68e57d" ]
[ "sphinx-sources/Examples/Commands/PipFFT.py" ]
[ "from LightPipes import *\nimport matplotlib.pyplot as plt\n\nsize=15*mm\nwavelength=1*um\nN=150\nz=1*m\nR=3*mm\nRf=1.5*mm\nseed=7\nMaxPhase=1.5\n\nF=Begin(size,wavelength,N);\nF=CircAperture(R,0,0,F);\nF=RandomPhase(seed,MaxPhase,F);\nF=Fresnel(z,F);\nI0=Intensity(0,F);\n\nF=PipFFT(1,F);\nF=CircAperture(Rf,0,0,F);...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
gabrielfior/hackzurich-earthquake
[ "448f6229c8b87ce7aa9ecbcf1e5d585ef553a532" ]
[ "notebooks/execute.py" ]
[ "import pandas as pd\nfrom fastai.tabular.all import *\nfrom fastai.tabular.data import *\nfrom functools import reduce\nfrom tqdm import tqdm, trange\n\nlearn = load_learner('monster_model_10batches.pkl')\n\ndf = pd.read_csv('../public_data/train.csv')\ntest = pd.read_csv('../public_data/test.csv')\nbuild_owner = ...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.merge" ] ]
TOffergeld/pandapower
[ "630e3278ca012535f78282ae73f1b86f3fe932fc" ]
[ "pandapower/test/loadflow/test_runpp.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2016-2020 by University of Kassel and Fraunhofer Institute for Energy Economics\n# and Energy System Technology (IEE), Kassel. All rights reserved.\n\n\nimport copy\nimport os\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nimport pandapower as pp\nfrom panda...
[ [ "pandas.isnull", "numpy.array", "numpy.isclose", "numpy.isnan", "numpy.exp", "numpy.allclose", "numpy.arange", "numpy.sqrt", "numpy.all" ] ]
awslabs/improving-forecast-accuracy-with-machine-learning
[ "020e9c1c9ca6ea6c0f5df9a502119dbd11a0c328" ]
[ "source/tests/shared/test_dataset_file.py" ]
[ "# #####################################################################################################################\n# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #\n# ...
[ [ "numpy.random.bytes" ] ]
sourcery-ai-bot/detectron2
[ "fd0c5c59afbdc43f7005fb1a8c0c39ac5dc44039" ]
[ "detectron2/modeling/meta_arch/panoptic_fpn.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport logging\nfrom typing import Dict, List\nimport torch\nfrom torch import nn\n\nfrom detectron2.config import configurable\nfrom detectron2.structures import ImageList\n\nfrom ..postprocessing import detector_postprocess, sem_seg_p...
[ [ "torch.zeros_like", "torch.argsort", "torch.unique" ] ]
ZhangYikaii/PRML
[ "cf4fd9539af08de739110673afbf450963b6e931" ]
[ "prml/preprocess/polynomial.py" ]
[ "import itertools\nimport functools\nimport numpy as np\n\n\nclass PolynomialFeature(object):\n \"\"\"\n polynomial features\n\n transforms input array with polynomial features\n\n Example\n =======\n x =\n [[a, b],\n [c, d]]\n\n y = PolynomialFeatures(degree=2).transform(x)\n y =\n ...
[ [ "numpy.asarray" ] ]
woctezuma/download-steam-banners
[ "b4cc1d5b96ac479b76517e11ea7cd19c43eee38e" ]
[ "find_unique_games.py" ]
[ "# Code inspired from:\n# - build_feature_index.py\n# - https://github.com/woctezuma/steam-descriptions/blob/master/find_unique_games.py\n\nimport json\nimport logging\nfrom time import time\n\nimport numpy as np\nimport steamspypi\nfrom sklearn.neighbors import NearestNeighbors\n\nfrom build_feature_index impo...
[ [ "sklearn.neighbors.NearestNeighbors" ] ]
yosagaf/medical-biometrics
[ "9f3151d20ee40e12bf9a9abdcdd89b9de4ef8fc0" ]
[ "assignement2/viewing3DBrainMRI.py" ]
[ "# import necessary packages\n\nimport imageio\nimport scipy.ndimage as ndi\nimport numpy as np\nimport SimpleITK as sitk\nimport matplotlib.pyplot as plt\n\n# the path of a T1-weighted brain .nii image\npath = \"data/BRAIN.nii\"\n\n\n# read the .nii image containing the volume with the SimpleITK \nsitk_f = sitk.Re...
[ [ "scipy.ndimage.convolve", "scipy.ndimage.binary_closing", "matplotlib.pyplot.subplots", "scipy.ndimage.binary_dilation", "matplotlib.pyplot.show" ] ]
Open-Speech-EkStep/data-acquisition-pipeline
[ "b28df36d417010d85d3e5c5f6882eb8fe89ce5ae" ]
[ "selenium_youtube_crawler/tests/test_downloader.py" ]
[ "import os\nfrom unittest import TestCase\nfrom unittest.mock import patch, call, MagicMock\n\nimport pandas as pd\n\nfrom selenium_youtube_crawler.downloader import Downloader\n\n\nclass DownloaderTest(TestCase):\n\n @patch(\"selenium_youtube_crawler.downloader.GCSHelper\")\n def setUp(self, mock_gcs_helper)...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
euCanSHare/image_segmentation
[ "6c314f6d3ac5912af8729b04393a694544f6adb8" ]
[ "model_zoo/unet2D_bn_modified.py" ]
[ "import tensorflow as tf\nfrom tfwrapper import layers\n\n\n\ndef forward(images, training, nlabels):\n\n images_padded = tf.pad(images, [[0,0], [92, 92], [92, 92], [0,0]], 'CONSTANT')\n\n conv1_1 = layers.conv2D_layer_bn(images_padded, 'conv1_1', num_filters=64, training=training, padding='VALID')\n conv1...
[ [ "tensorflow.pad" ] ]
mahow0/neighborhood-shelves
[ "c1814ad425101994e1e5dc824c06cd2cb4e02ea5" ]
[ "ai/src/main.py" ]
[ "import argparse\nimport torch\nimport torch.optim as optim\nfrom torch.utils.data import DataLoader\nfrom transformers import TrainingArguments\nfrom train import train\nfrom evaluate import evaluate\nfrom model import T5Seq2SeqModel\nfrom utils import load_train_test_split, ProductDataset\n\ndef main(model, optim...
[ [ "torch.device", "torch.cuda.empty_cache", "torch.cuda.is_available", "torch.optim.lr_scheduler.ReduceLROnPlateau" ] ]
raphaelsulzer/dgnn
[ "08ef076e80ea38daf000ac2be6771363d6d4ea9a" ]
[ "processing/shapenet/scan.py" ]
[ "import argparse, subprocess, os, random, sys\nimport numpy as np\nfrom tqdm import tqdm\nimport multiprocessing\n\ndef scan_one(args):\n\n # choose random scan parameters\n\n if(args.scan_conf == 0):\n points = 12000\n cameras = 15\n noise = 0.0\n outliers = 0.0\n elif(args.sca...
[ [ "numpy.array", "numpy.random.randn" ] ]
Coastchb/tensorflow
[ "cabefb9f98502c739aa2761a9fc654004a993d58" ]
[ "tensorflow/python/training/tracking/python_state_test.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.variables.Variable", "tensorflow.python.framework.ops.Graph", "numpy.array", "tensorflow.python.training.tracking.base.TrackableReference", "tensorflow.python.training.tracking.util.Checkpoint", "numpy.zeros", "numpy.ones", "numpy.load", "tensorflow.pytho...
agolovanov/quill
[ "18cf99cc8517f173765d4f56a90a6d53403e90f8" ]
[ "python/energy_test.py" ]
[ "#!/usr/bin/python\nimport numpy as np\nimport resread\n\ndef check(data_folder = '../results/', t=None):\n 'Verifies energy conservation in a Quill run'\n resread.data_folder = data_folder\n resread.read_parameters()\n data = resread.t_data('energy', silent = True)\n data_deleted = None\n if resr...
[ [ "numpy.sum" ] ]
lebronjames/TensorFlow
[ "cb72f1363bfcaafa496917307e3a0824c5483ee2" ]
[ "TensorFlowTest01.py" ]
[ "import tensorflow as tf\ngreeting = tf.constant('Hello Google Tensorflow!')\nsess = tf.Session()\nresult = sess.run(greeting)\nprint(result)\nsess.close()\n" ]
[ [ "tensorflow.constant", "tensorflow.Session" ] ]
mzhang-code/serving
[ "527c6f2173eba584ebdca4f8b11ae3c0550ab1a9" ]
[ "tensorflow_serving/model_servers/test_util/tensorflow_model_server_test_base.py" ]
[ "# Copyright 2016 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.config.experimental.set_virtual_device_configuration", "tensorflow.config.experimental.list_physical_devices", "tensorflow.config.experimental.VirtualDeviceConfiguration", "tensorflow.config.experimental.get_virtual_device_configuration" ] ]
kitkat52/pietoolbelt
[ "0e0b5859662fcb43b008218746cc3e76cc66b6b8" ]
[ "pietoolbelt/metrics/torch/regression.py" ]
[ "import torch\nimport numpy as np\nfrom piepline import AbstractMetric\nfrom sklearn.preprocessing import MinMaxScaler\nfrom torch import Tensor\n\nfrom pietoolbelt.metrics.cpu.regression import rmse as rmse_cpu\nfrom pietoolbelt.metrics.cpu.regression import amad as amad_cpu\nfrom pietoolbelt.metrics.cpu.regressio...
[ [ "torch.abs", "torch.mean" ] ]
jgori-ouistiti/interaction-agents
[ "922d9bddb2b14784e32c4639b66cec302e80e13a" ]
[ "test/unit/space/test_gym-conversions.py" ]
[ "import numpy\nfrom coopihc.space.Space import Space\nfrom coopihc.space.utils import discrete_space, continuous_space, multidiscrete_space\nimport gym\n\n\ndef test_all_conversions():\n test_discrete()\n test_continuous()\n test_multidiscrete()\n\n\ndef test_discrete():\n s = discrete_space([1, 2, 3])\...
[ [ "numpy.ones" ] ]
johnwlambert/dlupi-heteroscedastic-dropou
[ "057dd079fce7ec8833b818b77fd694c01a1adcbc" ]
[ "cnns/base_networks/vgg_truncated.py" ]
[ "# John Lambert, Ozan Sener\n\nimport torch.nn as nn\nimport math\n\nclass VGGTruncatedConv(nn.Module):\n def __init__(self, opt ):\n super(VGGTruncatedConv, self).__init__()\n\n self.cfg = [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512, 'M', 512, 512, 512, 'M']\n self.conv =...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
zhiqiang00/Hon-GCN
[ "916f826f9193a800ac9d4d2e66f2ee108025a23d" ]
[ "pygcn/data_processed.py" ]
[ "import random\nfrom itertools import combinations\n\nimport networkx as nx\nimport pandas as pd\nimport numpy as np\nimport torch\n\nfrom pygcn.utils import sample_neg_graph\n\n\ndef get_Graph(Path):\n edges = []\n f = open(Path)\n for line in f.readlines():\n node1, node2 = line.strip().split()[:2...
[ [ "numpy.array", "numpy.savetxt", "pandas.DataFrame", "numpy.genfromtxt", "numpy.mean", "numpy.argsort", "pandas.concat", "pandas.read_csv", "numpy.dtype" ] ]
rtaiello/learning-to-learn
[ "f3c1a8d176b8ea7cc60478bfcfdd10a7a52fd296" ]
[ "preprocess.py" ]
[ "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.abs", "tensorflow.minimum", "tensorflow.concat", "numpy.exp", "numpy.finfo", "tensorflow.maximum" ] ]
mohamed799/Learning-to-See-in-the-Dark
[ "80baad1011c7829be1a1269d2cee7f55b99a238a" ]
[ "train_Sony.py" ]
[ "# uniform content loss + adaptive threshold + per_class_input + recursive G\n# improvement upon cqf37\nfrom __future__ import division\nimport os, time, scipy.io\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\nimport numpy as np\nimport rawpy\nimport glob\nfrom PIL import Image\n\ninput_dir = '/c...
[ [ "tensorflow.contrib.slim.max_pool2d", "numpy.minimum", "tensorflow.train.get_checkpoint_state", "numpy.where", "tensorflow.depth_to_space", "tensorflow.global_variables_initializer", "numpy.concatenate", "tensorflow.trainable_variables", "tensorflow.shape", "tensorflow.conc...
niranjana687/hangar-py
[ "d4af0cd85c5588b59fb869097b3245d3b85ad8c3" ]
[ "tests/test_dataloaders.py" ]
[ "from os.path import join as pjoin\nfrom os import mkdir\nimport pytest\nimport numpy as np\nfrom hangar import Repository\n\n\ntry:\n import torch\n from torch.utils.data import DataLoader\n from hangar import make_torch_dataset\n skipTorch = False\nexcept ImportError:\n skipTorch = True\n\n\n@pytes...
[ [ "tensorflow.TensorShape", "numpy.allclose", "torch.utils.data.DataLoader", "tensorflow.compat.v1.enable_eager_execution", "numpy.random.random" ] ]
tanmayb123/DeepSPADE
[ "3c62a0b588850b142b77dca6bb3f1d93f6c1e6b1" ]
[ "train2.py" ]
[ "\"\"\"\nTrain convolutional network for sentiment analysis. Based on\n\"Convolutional Neural Networks for Sentence Classification\" by Yoon Kim\nhttp://arxiv.org/pdf/1408.5882v2.pdf\n\nFor 'CNN-non-static' gets to 82.1% after 61 epochs with following settings:\nembedding_dim = 20\nfilter_sizes = (3, 4)\nnum_filter...
[ [ "numpy.random.seed", "tensorflow.Session" ] ]
fhvilshoj/TorchLRP
[ "74253a1be05f0be0b7c535736023408670443b6e" ]
[ "examples/explain_vgg.py" ]
[ "import os\nimport sys\nimport torch\nimport pickle\nfrom torch.nn import Sequential, Conv2d, Linear\n\nimport pathlib\nimport argparse\nimport torchvision\nfrom torchvision import datasets, transforms as T\nimport configparser\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# Append parent directory of t...
[ [ "torch.arange", "matplotlib.pyplot.subplots", "torch.manual_seed", "torch.abs", "torch.cuda.is_available", "matplotlib.pyplot.show", "torch.utils.data.DataLoader", "torch.tensor", "torch.allclose" ] ]
loyanie/Mask_RCNN
[ "16f56ab86b9cb9834fcdc431e49eab119304b5da" ]
[ "mrcnn/model.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[ ]:\n\n\n\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implementation.\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport random\nimport datetime\nimport re\nimport mat...
[ [ "tensorflow.exp", "numpy.random.choice", "tensorflow.image.non_max_suppression", "numpy.copy", "tensorflow.unique", "tensorflow.reshape", "numpy.where", "tensorflow.sqrt", "numpy.sort", "tensorflow.stack", "tensorflow.control_dependencies", "numpy.broadcast_to", ...
baharefatemi/dgl
[ "ed1948b5555106dee133cef91ed9ecfd3bd4310d" ]
[ "examples/pytorch/jtnn/jtnn/chemutils.py" ]
[ "import rdkit\nimport rdkit.Chem as Chem\nfrom scipy.sparse import csr_matrix\nfrom scipy.sparse.csgraph import minimum_spanning_tree\nfrom collections import defaultdict\nfrom rdkit.Chem.EnumerateStereoisomers import EnumerateStereoisomers, StereoEnumerationOptions\n\nMST_MAX_WEIGHT = 100 \nMAX_NCAND = 2000\n\ndef...
[ [ "scipy.sparse.csr_matrix", "scipy.sparse.csgraph.minimum_spanning_tree" ] ]
helia95/SpeakerRecognition_tutorial
[ "5c00f9165fd260d50b74ab46e4d81d7cfd77ab8c" ]
[ "model/resnet.py" ]
[ "\"\"\"Imported from https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py\r\nand added support for the 1x32x32 mel spectrogram for the speech recognition.\r\nKaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun: Deep Residual Learning for Image Recognition\r\nhttps://arxiv.org/abs/1512.03385\r\n\...
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.utils.model_zoo.load_url", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
jackyjsy/SGGAN
[ "bf07e933f8a53eff30ecb7398324a0b549508fa3" ]
[ "model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\n\n\nclass ResidualBlock(nn.Module):\n \"\"\"Residual Block.\"\"\"\n def __init__(self, dim_in, dim_out):\n super(ResidualBlock, self).__init__()\n self.main = nn.Sequential(\n nn.Conv2d(dim_in...
[ [ "torch.cat", "torch.nn.Sequential", "torch.nn.Tanh", "torch.nn.LeakyReLU", "torch.nn.ConvTranspose2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.InstanceNorm2d", "numpy.power" ] ]
testingautomated-usi/rl-plasticity-experiments
[ "a32cebcee89f6f734477a1f1bdd8b7f8ef7aa99a" ]
[ "src/agent.py" ]
[ "import csv\nimport glob\nimport multiprocessing\nimport os\nimport warnings\nfrom queue import Queue\nfrom typing import Tuple\n\nimport gym\nimport numpy as np\nimport stable_baselines3\nimport tensorflow as tf\nimport yaml\nfrom stable_baselines3.common.utils import get_linear_fn, set_random_seed\nfrom tensorflo...
[ [ "tensorflow.autograph.set_verbosity", "numpy.ones", "numpy.zeros", "tensorflow.get_logger" ] ]
itrharrison/skypy-itrharrison
[ "cea1f02d1b2cd3b689266d7ae9bca1a4cfe986a2" ]
[ "skypy/galaxies/_schechter.py" ]
[ "'''Implementation of Schechter LF and SMF.'''\n\nimport numpy as np\n\nfrom .redshift import schechter_lf_redshift, schechter_smf_redshift\nfrom .stellar_mass import schechter_smf_mass\nfrom .luminosity import schechter_lf_magnitude\nfrom astropy import units\n\n__all__ = [\n 'schechter_lf',\n 'schechter_smf...
[ [ "numpy.interp", "numpy.ndim" ] ]
Gorilla-Lab-SCUT/gorilla-3d
[ "399ed8616781a0fbc462f655c0e80c258c5a5207" ]
[ "gorilla3d/nn/models/pointnet/pointnet.py" ]
[ "# Copyright (c) 2019, NVIDIA CORPORATION. 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 req...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.nn.BatchNorm1d" ] ]
gcslui/Money-generator
[ "1b9e40296d30851344bb2bf06ad58ecf2e37d4fc" ]
[ "src/visualize.py" ]
[ "import matplotlib.pyplot as plt\nimport mplfinance as mpf\nimport numpy as np\nimport pandas as pd\nfrom datetime import datetime, timedelta\n\nfrom src.db_default import DB_ASSUMED_TZ, DB_FROZEN_VARIANTS\nfrom src.db_class import FinanceDB\n\n\ndef plot_timeseries(df, ticker, column='close', interval='minutes'):\...
[ [ "pandas.to_datetime", "pandas.DatetimeIndex", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
wjjmjh/Cogent3-GitHub-CI
[ "c79c82c4b51f56be50f1079ddcdfcffaccaf80dd", "c79c82c4b51f56be50f1079ddcdfcffaccaf80dd" ]
[ "src/cogent3/evolve/likelihood_function.py", "src/cogent3/draw/drawable.py" ]
[ "#!/usr/bin/env python\n\nimport json\nimport random\n\nfrom collections import defaultdict\nfrom copy import deepcopy\n\nimport numpy\n\nfrom cogent3.core.alignment import ArrayAlignment\nfrom cogent3.evolve import substitution_model\nfrom cogent3.evolve.simulate import AlignmentEvolver, random_sequence\nfrom coge...
[ [ "numpy.dot", "numpy.asarray", "numpy.zeros", "numpy.take" ], [ "numpy.max", "numpy.array", "numpy.isnan", "numpy.min", "numpy.flip" ] ]
josephtessmer/EMsoft
[ "97daa26978c42d5f569f4588a9991393c157d509" ]
[ "Source/pyEMsoft/EMsoft/pyEMsoftTools.py" ]
[ "# some simple tools to have when working with pyEMsoft module\nfrom EMsoft import pyEMsoft\nimport numpy as np\nimport h5py as h5\nimport os\nimport matplotlib.pyplot as plt\n\n\nclass Tools(object):\n \"\"\"\n Module Tools\n\n\n Some tools to help with pyEMsoft module\n\n \"\"\"\n @staticmethod\n ...
[ [ "numpy.divide", "numpy.deg2rad", "numpy.array", "numpy.reshape", "numpy.zeros", "numpy.asarray", "numpy.sum", "numpy.mean", "numpy.chararray", "numpy.sqrt", "numpy.average" ] ]
columbustech/label-debugger
[ "e509c64e3184c05ef936c0a7a881ee0124067776" ]
[ "web.py/v6/fpfn.py" ]
[ "'''\nCreated on Mar 5, 2019\n\n@author: hzhang0418\n'''\nimport numpy as np\nfrom operator import itemgetter\n\nfrom sklearn.model_selection import KFold\nfrom sklearn.ensemble import RandomForestClassifier\n\nfrom v6.detector import Detector\n\nclass FPFN(Detector):\n \n def __init__(self, features, labels,...
[ [ "numpy.max", "sklearn.ensemble.RandomForestClassifier", "numpy.where", "numpy.argmax", "sklearn.model_selection.KFold" ] ]
PhilVest/scanning-xray-diffraction
[ "ea469d1806df78237d43fbf427cc44f017148970" ]
[ "s3dxrd/utils/scanning_transform.py" ]
[ "\nfrom __future__ import print_function\n\n\"\"\" Modified from ImageD11 transform.py by Axel Henningsson 2021\n This is only good for the scanning_3DXRD scenario when the t_y==0 and \n t_z==0 for all reflections, the idea is to allow for per measurement\n grain cms positions to be passed via t_x,t_y,t_z ...
[ [ "numpy.array", "numpy.dot", "numpy.sin", "numpy.zeros", "numpy.arcsin", "numpy.sum", "numpy.degrees", "numpy.radians", "numpy.where", "numpy.arctan2", "numpy.sqrt", "numpy.cos", "numpy.cross" ] ]
jmachalica/PygameProjects
[ "f1cdcad32b9e4c3eb584c7447f88a0436a30d134" ]
[ "Maze/maze.py" ]
[ "\r\n\r\n# '''\r\n# Assumptions:\r\n\r\n# maze returned will be a grid - array consisting of 1 and 0\r\n# 0 - cell is empty\r\n# 1 - cell is wall\r\n\r\n# EXAMPLE:\r\n# 1 1 1 1 1 1 1\r\n# 0 0 0 0 1 0 0\r\n# 1 1 1 0 1 0 1\r\n# 1 0 0 0 1 0 1\r\n# 1 0 1 1 1 0 1\r\n# 1 0 0 0 0 0 1\r\n# ...
[ [ "numpy.ones" ] ]
hoya012/carrier-of-tricks-for-classification-pytorch
[ "d788d7a4e5007da9c410bdd3ef7ce3766d2ba0cd" ]
[ "main.py" ]
[ "import os, sys\nimport torch\nimport torch.nn as nn\nimport torchvision\n\nPATH = os.path.dirname(os.path.abspath(__file__))\nsys.path.insert(0, PATH + '/../..')\n\nfrom option import get_args\nfrom learning.trainer import Trainer\nfrom learning.evaluator import Evaluator\nfrom utils import get_model, make_optimiz...
[ [ "torch.manual_seed", "torch.cuda.get_device_name", "torch.nn.CrossEntropyLoss", "torch.cuda.device_count" ] ]
fbarth/agents
[ "b8cc1651671148efb2b6ae082774d28b1d1800cb" ]
[ "code/games/fourinrow_popout/FuziyPlayer.py" ]
[ "from Player import Player\nimport numpy as np\n\nclass FuziyPlayer(Player):\n def name(self):\n return \"Fuziy Player\"\n\n def max_value(self, board, action, alpha, beta, player_code, p):\n if p == 0:\n result = self.evaluate(player_code, board), action\n return result\n sucessors = self.suce...
[ [ "numpy.matrix", "numpy.diag" ] ]
oAzv/GCFM
[ "5dc584f0722b90b99614616c9b210d9e086f8ff3" ]
[ "scripts/WK_NetArch/alexnet_features.py" ]
[ "#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n\nfrom torch import nn\n\nclass EncoderCNN(nn.Module):\n '''\n Alexnet pre-training model call, network structure adaptation modification.\n '''\n def __init__(self, model):\n '''Initialize the model, deconstruct it.\n\n Args:\n\n ...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.ReLU" ] ]
NikitaKramarev/GW-stripping
[ "9147ba6ce871b4a263b9579cf4be8b709cb808ec" ]
[ "test/test_gw.py" ]
[ "import gw_stripping\nimport pytest\nimport numpy\nimport pandas\nimport astropy.constants\nimport os.path\n\n@pytest.mark.parametrize('q, res', [\n # Next tests from Eggleton Paper\n (9.9901e-4, 0.0484),\n (9.901e-3, 0.1020),\n (0.0909, 0.2068),\n (0.2857, 0.3031),\n (0.5000, 0.3789),\n (0.714...
[ [ "numpy.testing.assert_allclose", "pandas.read_table" ] ]
andylucny/slnava
[ "02141541440c0e948abb9f287f130238adaa9e28" ]
[ "navigator.py" ]
[ "import numpy as np\nimport cv2\nfrom agentspace import Agent, Space\n\nclass NavigatorAgent(Agent):\n\n def __init__(self,gpsName,goalName,headingName,forwardName,turnName):\n self.gpsName = gpsName\n self.goalName = goalName\n self.headingName = headingName\n self.forwardName = forw...
[ [ "numpy.arctan2" ] ]
ekantola/character-segmenter
[ "44cc16d4a9d9b260a1a52424b00ac40b638e5387" ]
[ "sample_image.py" ]
[ "import cv2.cv2 as cv2 # and not just `import cv2`, to make VSCode happier\nimport numpy as np\n\nfrom PIL import Image\n\n\nPIL_GRAYSCALE = \"L\"\n\n\ndef read_grayscale(filename: str) -> np.ndarray:\n return cv2.cvtColor(cv2.imread(filename), cv2.COLOR_BGR2GRAY)\n\n\ndef pad_and_resize(image: Image.Image, des...
[ [ "numpy.set_printoptions" ] ]
unax127/HyperGAN
[ "aa847e0c12f854ca95ac2d86e3dfa7cb7309410e" ]
[ "hypergan/tk_viewer.py" ]
[ "\"\"\"\nOpens a window that displays an image.\nUsage:\n\n from viewer import GlobalViewer\n GlobalViewer.update(image)\n\n\"\"\"\nimport numpy as np\nimport os\nimport contextlib\n\n\nclass TkViewer:\n def __init__(self, title=\"HyperGAN\", viewer_size=1, enabled=True):\n self.screen = None\n ...
[ [ "numpy.pad", "numpy.reshape", "numpy.tile", "numpy.shape", "numpy.transpose" ] ]
JhonesBR/google_by_img
[ "cfb8565648cff475a58c91fc8d90c19087a71244" ]
[ "googleByImg.py" ]
[ "'''##########################################################################################################'''\n'''System Variables'''\n\nMAX_WORDS = 14\nPYTESSERACT_PATH = r'C:\\Program Files\\Tesseract-OCR\\tesseract'\n\n'''\n If you want to change the language of recognition change it at\n line 108 \n ...
[ [ "numpy.array", "numpy.arange" ] ]
lyubomirr/AI-Algorithms
[ "53cb37572d084d4204f0b8632ebb1cea78b1dc8c" ]
[ "KMeans/clusterize.py" ]
[ "import random\nimport math\nimport matplotlib.pyplot as plt\nfrom itertools import accumulate\n\ndef k_means(k, dataset, iterations):\n best_centroids, best_clusters = k_means_core(k, dataset)\n best_wssd = calculate_total_wssd(best_centroids, best_clusters)\n\n for i in range(iterations - 1):\n ce...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.scatter" ] ]
uehir0/Gasyori100knock
[ "a38d3c516f5f965822610edcf113f59412905c03" ]
[ "Question_21_30/codes/question26.py" ]
[ "import cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\nimg = cv2.imread(\"imori.jpg\").astype(np.float)\nH,W,C=img.shape\n\n# Nearest Neighbor\na = 1.5\naH = int(a * H)\naW = int(a * W)\n\ny = np.arange(aH).repeat(aW).reshape(aW,aH)\ny = (y / a)\nx = np.tile(np.arange(aW),(aH,1))\nx = (x / a)\n\nfy = np....
[ [ "numpy.floor", "numpy.arange", "numpy.expand_dims", "numpy.minimum" ] ]
hiromu/fairseq
[ "b8651bc984413e7e45f44294dffcc85692ba89c1" ]
[ "fairseq/data/token_block_dataset.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\nimport numpy as np\nimport torch\nfrom fairseq.data import FairseqDataset, plasma_utils\nfrom fairseq.data.indexed_dataset import be...
[ [ "torch.is_tensor", "numpy.array" ] ]
suri5471/skillmodels
[ "8ceeeae7892cbec859c5725e4e169f2b6d025be4" ]
[ "skillmodels/visualize_factor_distributions.py" ]
[ "import sys\nimport warnings\nfrom traceback import format_exception\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport scipy\nimport seaborn as sns\n\nfrom skillmodels.process_model import process_model\n\n\ndef plot_factor_distributions(\n model_dict,\n states,\n period,\...
[ [ "matplotlib.pyplot.subplots", "matplotlib.pyplot.figure", "scipy.stats.gaussian_kde", "pandas.concat", "numpy.vstack" ] ]
baagaard-usgs/eew-analyze
[ "5f9ec7d6eecd693fc0a3147d2695c957da64d4b2" ]
[ "eewperformance/analysisdb.py" ]
[ "# ======================================================================\n#\n# Brad T. Aagaard\n# U.S. Geological Survey\n#\n# ======================================================================\n#\n\nimport sqlite3\nimport sys\nimport logging\nimport datetime\ni...
[ [ "numpy.ma.masked_values", "numpy.zeros" ] ]
ppnaumann/CSCF
[ "ea8af1f2fdec3a90a041324a32893d5dadc7e14b" ]
[ "src/cscf/decoder.py" ]
[ "import numpy as np\nimport decimal\n\n\nclass Decoder(object):\n \"\"\"\n docstring\n \"\"\"\n\n def __init__(self, problem):\n self.problem = problem\n self.invalid_genotype_value = 1.0\n\n def decode_without_repair(self, x):\n _x = x.copy()\n # two parts, first sequence...
[ [ "numpy.concatenate", "numpy.interp", "numpy.argsort" ] ]
GiuppoUni/gym-pybullet-drones
[ "9339b803f471c7510cc6d9b14828982bb426466b" ]
[ "assignments/aer1216_fall2020_hw1_ctrl.py" ]
[ "\"\"\"Control implementation for assignment 1.\n\nThe script is used the simulation in file `aer1216_fall2020_hw1_sim.py`.\n\nExample\n-------\nTo run the simulation, type in a terminal:\n\n $ python aer1216_fall2020_hw1_sim.py\n\nNotes\n-----\nTune the PD coefficients in `HW1Control.__init__()`.\n\n\"\"\"\nimp...
[ [ "numpy.array", "numpy.sqrt", "numpy.zeros" ] ]
matln/Attentive-Filtering-Network
[ "cef007e68f1016b6f6daf2510feabe7565d4756b" ]
[ "src/data_reader/v7_dataset.py" ]
[ "import numpy as np\nimport torch\nfrom torch.utils import data\nimport adv_kaldi_io as ako\nimport kaldi_io as ko\n\n\"\"\"\nFor CNN+GRU where it loads one utterance at a time \n\"\"\"\n\nclass SpoofDataset(data.Dataset):\n \"\"\"PyTorch dataset that reads kaldi feature\n \"\"\"\n def __init__(self, scp_f...
[ [ "numpy.expand_dims" ] ]
katrinleinweber/riemann_book
[ "0bd2320765a459249d938c6913cc39339cddb3fb" ]
[ "exact_solvers/euler_stripes.py" ]
[ "def plot_exact_riemann_solution_stripes(rho_l=3.,u_l=0.,p_l=3.,\n rho_r=1.,u_r=0.,p_r=1.,gamma=1.4,t=0.4): \n import matplotlib.pyplot as plt\n import numpy as np\n from exact_solvers import Euler \n from utils import riemann_tools\n q_l = Euler.primitive_to_...
[ [ "numpy.mod", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "numpy.linspace", "numpy.vstack" ] ]
lamarqued/tech-radar
[ "05563bdd47cca971caa5abab12d23939d6db04db" ]
[ "docs/make_data.py" ]
[ "import json\nimport getpass\nimport pandas as pd\n\nUSER = getpass.getuser()\nPATH = f\"C:/Users/{USER}/Ekimetrics/Ekimetrics. - Eki.Innovation/Opensource Tech Radar.xlsx\"\n\ndata = pd.read_excel(PATH).iloc[:,:6]\n\ndata[\"quadrant\"] = data[\"quadrant\"].str.lower().str.replace(\" \",\"\").replace({\"datascience...
[ [ "pandas.read_excel" ] ]
isomerase/MyPyGLM
[ "d8c884f74f7b9e7953f6602a6cd01d27275f76d6" ]
[ "calc_STA.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nSpike Triggered Average calculator\n\nInput:\nstimulus (t)\nspike spikeTimes (t)\n if no spiketimes, generate randoms\n\nGiven stim and spiketimes, grabs the spike windows, and calcs the spike triggered average.\n\noutput:\nspike triggered average\n\n\nCreated on Wed Feb 11 21:2...
[ [ "numpy.array", "numpy.zeros", "numpy.genfromtxt", "numpy.random.randint", "numpy.average", "matplotlib.pyplot.show" ] ]
sdym-test/pytorch
[ "fc3c7fb7566639d0a36af88bbac0c7920f73ee3b", "fc3c7fb7566639d0a36af88bbac0c7920f73ee3b" ]
[ "torch/ao/quantization/fx/quantization_patterns.py", "test/test_reductions.py" ]
[ "import torch\nfrom torch.fx import GraphModule\nfrom torch.fx.graph import (\n Node,\n Graph,\n)\nfrom ..observer import (\n default_affine_fixed_qparams_observer,\n default_symmetric_fixed_qparams_observer,\n)\n\nfrom ..quantization_mappings import (\n get_static_quant_module_class,\n get_dynami...
[ [ "torch.ao.quantization.quantize.is_activation_post_process" ], [ "torch.prod", "numpy.random.rand", "numpy.median", "numpy.empty", "torch.histogram", "torch.tensor", "numpy.prod", "torch._aminmax", "torch.testing._internal.common_dtype.get_all_math_dtypes", "torch.m...
chengyi-wu/nlp-web
[ "a3250fb78e53f5a1f4422699160d33e5f52eb551" ]
[ "app/text_classifier/model.py" ]
[ "# coding: utf-8\nfrom __future__ import print_function\nimport os, sys\nimport tensorflow.contrib.keras as kr\nimport tensorflow as tf\nimport numpy as np\nfrom collections import Counter\nimport time\nfrom datetime import timedelta\nimport csv\nimport random\n\nif sys.version_info[0] > 2:\n is_py3 = True\nelse...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.nn.embedding_lookup", "tensorflow.nn.softmax", "tensorflow.global_variables_initializer", "tensorflow.cast", "tensorflow.argmax", "tensorflow.train.Saver", "tensorflow.layers.conv1d", "tensorflow.ConfigProto", "...
ryanjmccall/prod_mle_capstone
[ "027a62368703a52318354630114e59ac3012100c" ]
[ "tests/sentiment_classifier/task/test_checkpoint.py" ]
[ "import os\n\nimport numpy as np\nimport pandas as pd\nimport shutil\nimport unittest\n\nfrom sentiment_classifier.context import DATA_DIR\nfrom sentiment_classifier.task.checkpoint import (_CHECKPOINT_DF_FNAME, checkpoint_exists, load_checkpoint,\n write_checkpoint)...
[ [ "pandas.DataFrame", "numpy.array", "numpy.frombuffer" ] ]
jsantoso2/Household_Amenity_Detection
[ "dd05fe86f31b3eb3478f7675080ebc0f59ef0b6c" ]
[ "docker_test/app.py" ]
[ "# common imports\r\nimport pandas as pd\r\nimport numpy as np\r\nimport os\r\nimport streamlit as st\r\nfrom PIL import Image\r\nimport time\r\nimport cv2\r\nimport torch, torchvision\r\n\r\n# Some basic setup:\r\nimport detectron2\r\n\r\n# import some common detectron2 utilities\r\nfrom detectron2.engine import D...
[ [ "pandas.DataFrame", "torch.cuda.is_available", "numpy.asarray" ] ]
iammosespaulr/crnn
[ "ec536e05b1eac25097d1e473800a5a33db3356f4" ]
[ "tool/create_dataset.py" ]
[ "import os\nimport lmdb # install lmdb by \"pip install lmdb\"\nimport cv2\nimport numpy as np\n\n\ndef checkImageIsValid(imageBin):\n if imageBin is None:\n return False\n imageBuf = np.fromstring(imageBin, dtype=np.uint8)\n img = cv2.imdecode(imageBuf, cv2.IMREAD_GRAYSCALE)\n imgH, imgW = img....
[ [ "numpy.fromstring" ] ]
xiamo311/AquaSCALE
[ "28968d1b349c2370d8c20bda5b6675270e4ab65d" ]
[ "examples/resilience_metrics.py" ]
[ "from __future__ import print_function\nimport wntr\nimport numpy as np\nimport networkx as nx\nimport matplotlib.pyplot as plt\n\ndef topographic_metrics(wn):\n # Get a copy of the graph\n G = wn.get_graph_deep_copy()\n\n # Print general topographic information\n print(nx.info(G))\n\n # Plot node an...
[ [ "numpy.max", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.min", "numpy.mean", "matplotlib.pyplot.figure", "numpy.nanmin", "numpy.arange", "matplotlib.pyplot.ylabel", "numpy.nanmax" ] ]
rochi88/dshare
[ "9dc46baff822be2ae7a7541fa10535a0299fbb5e" ]
[ "bdshare/stock/trading.py" ]
[ "import time\nimport requests\nfrom bs4 import BeautifulSoup\nimport pandas as pd\nfrom bdshare.util import vars as vs\n\n\ndef get_current_trade_data(symbol=None, retry_count=1, pause=0.001):\n \"\"\"\n get last stock price.\n :param symbol: str, Instrument symbol e.g.: 'ACI' or 'aci'\n :re...
[ [ "pandas.DataFrame", "pandas.read_fwf" ] ]
MasterEndless/Final-year-project
[ "ee9fc9e31a3b0855668077231de12da881c09035" ]
[ "Audio model/Audio Network/test.py" ]
[ "#coding:utf8\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.autograd import Variable\nfrom torch.utils.data import DataLoader\nfrom torchvision import datasets\nfrom config import opt\n\nfrom loader import get_loader\nfrom models import get_model\nim...
[ [ "numpy.array", "torch.nn.Softmax", "torch.nn.CrossEntropyLoss", "numpy.save" ] ]
JulianYu123456/icnn
[ "0aaf4b5cd13d71d98b0d05f367e1f71657ea6eb8" ]
[ "RL/src/helper.py" ]
[ "import tensorflow as tf\n\ndef variable_summaries(var, name=None, suffix=None):\n if name is None:\n if suffix is None:\n name = var.name\n else:\n name = '/'.join(var.name.split('/')[:-1])+'/'+suffix\n with tf.name_scope('summaries'):\n mean = tf.reduce_mean(var)\n...
[ [ "tensorflow.reduce_min", "tensorflow.histogram_summary", "tensorflow.scalar_summary", "tensorflow.reduce_max", "tensorflow.name_scope", "tensorflow.reduce_mean", "tensorflow.square" ] ]
thangnguyenminh/MaskRCNN
[ "ae6aa0018b9fbc146319d1e99caf807e331b4c64" ]
[ "mrcnn/utils.py" ]
[ "\"\"\"\nMask R-CNN\nCommon utility functions and classes.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport sys\nimport os\nimport logging\nimport math\nimport random\nimport numpy as np\nimport tensorflow as tf\nimport sci...
[ [ "numpy.dot", "numpy.minimum", "numpy.exp", "numpy.multiply", "numpy.where", "tensorflow.stack", "numpy.cumsum", "tensorflow.cast", "numpy.concatenate", "numpy.max", "numpy.divide", "numpy.empty", "numpy.log", "numpy.argmax", "numpy.arange", "numpy.sq...
BywinTec/OpenKS
[ "379732a9a4a418c5960cd5c47391099147a15ca5" ]
[ "openks/models/model.py" ]
[ "# Copyright (c) 2021 OpenKS Authors, DCD Research Lab, Zhejiang University. \n# All Rights Reserved.\n\n\"\"\"\nAn abstract class for openks models to be trained with Paddle\n\"\"\"\nimport logging\nfrom typing import Tuple, List, Any\nimport torch\nimport torch.nn as nn\nfrom torch.utils import data\nimport paddl...
[ [ "torch.from_numpy" ] ]
yihui-he/KL-Loss
[ "962a687c7caca56b3b8562b437a8370077a59074" ]
[ "detectron/modeling/retinanet_heads.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl...
[ [ "numpy.log", "numpy.zeros" ] ]
lutzkuen/statarb
[ "0da5e5a5c44e81fe7154e2aa7ef5d33a9ade17b1" ]
[ "analyst.py" ]
[ "#!/usr/bin/env python \n\nfrom pandas.stats.moments import ewma\n\nfrom loaddata import *\nfrom regress import *\nfrom util import *\n\n\ndef calc_rtg_daily(daily_df, horizon):\n print(\"Caculating daily rtg...\")\n result_df = filter_expandable(daily_df)\n print(\"Calculating rtg0...\")\n # result_...
[ [ "pandas.stats.moments.ewma" ] ]
MichelML/ml-aging
[ "b54470c00450da7d5b50e7be4a1f162f1c4b8531" ]
[ "my_notebooks/efficientnet.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# ## Load libraries\n\n# In[1]:\n\n\nget_ipython().system('pip install -q -r requirements.txt')\n\n\n# In[1]:\n\n\nimport sys\nimport os\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport rxrxutils.rxrx.io as rio\nfrom scipy import misc\n\nfr...
[ [ "torch.manual_seed", "torch.utils.data.DataLoader", "sklearn.model_selection.train_test_split", "pandas.read_csv", "torch.nn.CrossEntropyLoss" ] ]
rasmusbergpalm/pymc3
[ "7e464e59bcb0adb28df94f379b3e8d4af12bd4d1" ]
[ "pymc3/tests/test_tuning.py" ]
[ "# Copyright 2020 The PyMC Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "numpy.testing.assert_allclose", "numpy.array" ] ]
arjunbhagoji/blackbox-attacks-eccv
[ "d577745c64dfa47963d02bad40d6c5e65b02845f" ]
[ "clarifai/attack_clarifai.py" ]
[ "from clarifai.rest import ClarifaiApp\nimport matplotlib.image as mpimg\nimport numpy as np\nfrom clarifai.rest import Image as ClImage\nimport time\nimport argparse\nimport StringIO\n\ndef dict_reader(concepts_list, preds_array):\n if args.target_model == 'moderation':\n preds_array[0]=filter(lambda con...
[ [ "numpy.zeros_like", "numpy.log", "numpy.zeros", "numpy.round", "numpy.random.permutation", "matplotlib.image.imread", "numpy.mean", "numpy.sign", "numpy.argmax", "numpy.clip", "numpy.array_split" ] ]
nickp60/genvis_lite
[ "7ff9f66b3c1f6fb5cb445141685fe6dc1e9a9258" ]
[ "webapp/api/views.py" ]
[ "from django.shortcuts import render\nfrom django.http import JsonResponse\nfrom django.core.serializers.json import DjangoJSONEncoder\n\nfrom django.views.decorators.csrf import csrf_exempt\nfrom api.tags import method\nfrom core import settings\n\nimport json\nimport numpy as np\nimport pandas as pd\n\n\nclass Nu...
[ [ "pandas.read_csv", "pandas.DataFrame.from_csv" ] ]
AnnaNylander/exjobb
[ "74bdf299aa5e51adb7757364188e09a3e3986660" ]
[ "network/nn_practice/mnist/mnist_classifier.py" ]
[ "# -*- coding: utf-8 -*-\nimport torch\nimport pandas\nimport numpy\nimport matplotlib.pyplot as plt\nfrom torch.autograd import Variable\nfrom torch.utils.data import Dataset, DataLoader\nfrom MnistDataSet import MnistDataSet\nfrom Network import Net\n\n# N is batch size; D_in is input dimension;\n# H is hidden di...
[ [ "torch.nn.MultiLabelSoftMarginLoss", "torch.autograd.Variable", "torch.save", "torch.unsqueeze", "torch.utils.data.DataLoader" ] ]
medvidov/PyNomaly
[ "789c0ca7587b86343f636b132dcf1f475ee6b90b" ]
[ "pynom-env/lib/python3.6/site-packages/pydataset/datasets_handler.py" ]
[ "# datasets_handler.py\n# dataset handling file\n\nimport pandas as pd\nfrom .utils import html2text\nfrom .locate_datasets import __items_dict, __docs_dict, __get_data_folder_path\n\nitems = __items_dict()\ndocs = __docs_dict()\n\n# make dataframe layout (of __datasets_desc()) terminal-friendly\npd.set_option('dis...
[ [ "pandas.read_csv", "pandas.set_option" ] ]
barnrang/omniglot
[ "c93d333687b1d182e1c20aa7e6798c7a0bcc2474" ]
[ "priorloader.py" ]
[ "import numpy as np\nfrom keras.utils import np_utils\nimport tensorflow\nimport keras\nimport random\nfrom python.dataloader import loader\n\nclass DataGenerator(tensorflow.keras.utils.Sequence):\n 'Generates data for Keras'\n def __init__(self, data_type='train', dim=(28,28), n_channels=1,\n ...
[ [ "numpy.empty", "numpy.load" ] ]
musicinmybrain/NeuroM
[ "8aa8813f7f1a4a8363863c9c2fc94a0a11d2b328" ]
[ "tests/geom/test_transform.py" ]
[ "# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project\n# All rights reserved.\n#\n# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following cond...
[ [ "numpy.array", "numpy.sin", "numpy.dot", "numpy.linalg.det", "numpy.identity", "numpy.allclose", "numpy.cos", "numpy.all", "numpy.linspace", "numpy.linalg.inv" ] ]
piojanu/neptune-contrib
[ "7793c325af1c225cbda972bc0f89fa45f8da6cf3" ]
[ "neptunecontrib/versioning/data.py" ]
[ "#\n# Copyright (c) 2019, Neptune Labs Sp. z o.o.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "numpy.ceil", "numpy.random.choice", "numpy.random.seed", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tight_layout", "numpy.sqrt", "matplotlib.pyplot.imread" ] ]
CaptorAB/OpenSeries
[ "d09cafb0d049d174c4c07b3b6493558ca18938ff" ]
[ "openseries/sim_price.py" ]
[ "# -*- coding: utf-8 -*-\nfrom typing import Union\n\nimport numpy as np\nimport pandas as pd\n\nfrom openseries.stoch_processes import (\n ModelParameters,\n geometric_brownian_motion_log_returns,\n heston_model_levels,\n geometric_brownian_motion_jump_diffusion_levels,\n)\n\n\nclass ReturnSimulation(o...
[ [ "numpy.random.seed", "pandas.DataFrame", "numpy.insert", "numpy.sqrt" ] ]
nicolaslrveiga/spark
[ "f079002aeec4f6d85ea367edf99c0ccb33928d27" ]
[ "python/pyspark/pandas/series.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo...
[ [ "pandas.Index", "pandas.isna", "pandas.api.types.is_list_like", "pandas.api.types.is_hashable", "pandas.DataFrame", "pandas.notna", "pandas.core.accessor.CachedAccessor", "pandas.io.formats.printing.pprint_thing", "pandas.Series", "numpy.issubdtype" ] ]
captaincapsaicin/slip
[ "3c112f51cd11118f1e11c0c6fdd8c3d31d304d9b" ]
[ "models_test.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.array" ] ]
lleonart1984/rendezvous
[ "f8f5e73fa1ede7c33d8cf08548bce1475a0cc8da" ]
[ "tests/test_gpu_buffer_wrap.py" ]
[ "import torch\nfrom rendering.manager import *\n\nprint(torch.cuda.is_available())\n\n\nt = torch.zeros(3, device=torch.device('cuda:0'))\n# t[0] = t[0].item()\n\nt2 = torch.ones(3, device=torch.device('cuda:0'))\nt2[0] = t2[0].item()\n\nimage_width = 512\nimage_height = 512\n\npresenter = create_presenter(width=im...
[ [ "torch.device", "torch.cuda.is_available" ] ]
sergiovitale/pansharpening-cnn-python-version
[ "5cd5949572d6e797a90694bf99010c6c97dba8e2" ]
[ "fir_filter_wind.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCopyright (c) 2018 Image Processing Research Group of University Federico II of Naples ('GRIP-UNINA').\nAll rights reserved. This work should only be used for nonprofit purposes.\n\"\"\"\n\nimport numpy as np\n\ndef fir_filter_wind(Hd,w):\n \"\"\"\n\tcompute fir filter with wind...
[ [ "numpy.rot90", "numpy.sum", "numpy.fft.ifft2" ] ]
davxy/numeric
[ "1e8b44a72e1d570433a5ba81ae0795a750ce5921" ]
[ "python/chebyshev_poly.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nfrom numpy.polynomial.chebyshev import Chebyshev, cheb2poly\n\n\nmindeg, maxdeg = 0, 5\n\ncmap = plt.get_cmap('rainbow')\ncolors = cmap(np.linspace(0, 1, maxdeg-mindeg+1))\nprint(colors)\n\nl = list(np.zeros(mindeg, int)) + [1]\nxx = np.linspace(-1, 1, 100)\ntx ...
[ [ "numpy.zeros", "matplotlib.pyplot.grid", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.plot", "matplotlib.pyplot.gcf", "matplotlib.pyplot.show", "numpy.linspace", "numpy.polynomial.chebyshev.cheb2poly", "numpy.polynomial.chebyshev.Chebyshev" ] ]
RobMulla/kaggle-ieee-fraud-detection
[ "00cff8865aeb3b4524d7b054fef42c661b56a958" ]
[ "scripts/M044.py" ]
[ "\"\"\"\nCreated by: Rob Mulla\nSep 26\n\nIEEE Fraud Detection Model\n\n- FE013\n- Yang's Features\n- Raddars Features\n- Remove AV bad features automatically\n\n\"\"\"\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport os\nimport sys\nimport matpl...
[ [ "pandas.DataFrame", "numpy.mean", "numpy.std", "pandas.concat", "sklearn.model_selection.KFold", "pandas.read_csv", "pandas.read_parquet", "sklearn.metrics.roc_auc_score" ] ]