repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
ljx02/MLFinalWork | [
"d0eb1551401035be5b8c12fe1fd3733aefcc652f"
] | [
"detect.py"
] | [
"from __future__ import division\n\nfrom models import *\nfrom utils.utils import *\nfrom utils.datasets import *\n\nimport os\nimport sys\nimport time\nimport datetime\nimport argparse\n\nfrom PIL import Image\n\nimport torch\nfrom torch.utils.data import DataLoader\nfrom torchvision import datasets\nfrom torch.au... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.get_cmap",
"torch.no_grad",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"torch.load",
"matplotlib.ticker.NullLocator",
"matplotli... |
hasanabs/B_DNN | [
"e81bd1c1096dd6862d5b6e31c8795164183210de"
] | [
"fungsi_dnn.py"
] | [
"\"\"\"\n@author: Hasan Albinsaid\n@site: https://github.com/hasanabs\n\"\"\"\nimport numpy as np\nimport itertools\nfrom tensorflow import keras\nfrom tensorflow.keras.layers import Dense, BatchNormalization\nfrom tensorflow.keras.optimizers import SGD\n\ndef nck(n,k):\n return np.math.factorial(n)/np.math.fac... | [
[
"numpy.delete",
"numpy.array",
"tensorflow.keras.optimizers.SGD",
"numpy.zeros",
"numpy.random.randn",
"tensorflow.keras.metrics.SparseCategoricalAccuracy",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.Model",
"numpy.where",
"numpy.math.factori... |
kylehkhsu/role-of-data | [
"fdd7d3eb571624ed5b9edfb6c9a60140cadac1a6"
] | [
"scripts/tests/test_resnet20.py"
] | [
"import torch\nimport torchvision\nimport torchvision.transforms as transforms\nimport torch.utils.data as data\nimport argparse\nimport numpy as np\nfrom scripts.data_dependent_prior_sgd import train_classifier_epoch\nfrom src.model.cnn import resnet20\nfrom src.model.base.classifier import Classifier\nfrom tqdm i... | [
[
"torch.manual_seed",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"numpy.random.seed"
]
] |
r0mainK/modelforge | [
"5ec9f3889e75ec414366cd5ff7815c2600d250fa"
] | [
"modelforge/model.py"
] | [
"from copy import deepcopy\nimport inspect\nimport logging\nimport os\nfrom pathlib import Path\nfrom pprint import pformat\nimport re\nimport shutil\nimport tempfile\nfrom typing import BinaryIO, Iterable, List, Optional, Tuple, Union\nimport uuid\n\nimport asdf\nimport humanize\nimport numpy\nimport pygtrie\nimpo... | [
[
"numpy.array",
"numpy.diff"
]
] |
1170301027/ConvexOpt | [
"36f9d181e015eb7ac8276d27ca3c5d76f3468e38"
] | [
"Lab2/constrainedOptimization.py"
] | [
"import numpy as np\nfrom pre import point, example, golden_search\n\n\ndef ALM(loss_function: example, start: point, y_t: float, epsilon=0.1, iteration_max=1000) -> list:\n points, M, k = [start], len(start), 0\n\n while True:\n # find the new point by cyclic coordinate method\n p = points[k]\n... | [
[
"numpy.mod"
]
] |
hnt4499/facenet | [
"75ced35c361e994234d8f66b9fb6f208a592c791"
] | [
"contributed/export_embeddings.py"
] | [
"\"\"\"\nExports the embeddings and labels of a directory of images as numpy arrays.\n\nTypicall usage expect the image directory to be of the openface/facenet form and\nthe images to be aligned. Simply point to your model and your image directory:\n python facenet/contributed/export_embeddings.py ~/models/facen... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.minimum",
"tensorflow.get_default_graph",
"tensorflow.Graph",
"tensorflow.Session",
"scipy.misc.imresize",
"numpy.save",
"tensorflow.ConfigProto",
"numpy.stack",
"numpy.squeeze",
"tensorflow.GPUOptions",
... |
sthagen/Shapely | [
"0a11e6e83acf340109244fbbafba04fbee478c15"
] | [
"shapely/tests/geometry/test_collection.py"
] | [
"import numpy as np\nimport pytest\n\nfrom shapely import GeometryCollection, LineString, Point, wkt\nfrom shapely.geometry import shape\n\n\n@pytest.fixture()\ndef geometrycollection_geojson():\n return {\n \"type\": \"GeometryCollection\",\n \"geometries\": [\n {\"type\": \"Point\", \"... | [
[
"numpy.empty"
]
] |
indian312/eemeter | [
"ad84fe87837b7886ec1038a20a28efa846c6262c"
] | [
"eemeter/features.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n\n Copyright 2014-2019 OpenEEmeter contributors\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.apa... | [
[
"numpy.full",
"numpy.isnan",
"pandas.cut",
"pandas.Timedelta",
"pandas.Interval",
"pandas.concat",
"pandas.merge_asof",
"pandas.DataFrame",
"numpy.arange",
"pandas.Series",
"numpy.maximum"
]
] |
tatsu0428/dash_board | [
"e53be79b13f04be046a344e363fd15e374c3e09b"
] | [
"app.py"
] | [
"import pandas as pd\nimport plotly.graph_objects as go\nimport streamlit as st\nfrom pandas.api.types import is_numeric_dtype\n\n\n#ダッシュボードの生成\ndef main():\n st.set_page_config(layout=\"wide\")\n #タイトルの表示\n st.title(\"DashBoard using Streamlit\")\n #制作者の表示\n st.text(\"Created by Tatsuya NISHIZAWA\")... | [
[
"pandas.read_csv",
"pandas.api.types.is_numeric_dtype"
]
] |
anikhil/riskimposing2021 | [
"361a908e7bdd7551012deb23667fae8664799c6b"
] | [
"delhi_junee_2006_09_anjtry - Copy.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"DELHI junee 2006-09 anjtry.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/15nV65qT81YVIeQ77CfXm_RGstKKJ2Lrr\n\"\"\"\n\nfrom IPython.display import display\nimport pandas as pd\n\n# Displaying data in sumar... | [
[
"pandas.read_excel",
"pandas.concat",
"sklearn.model_selection.StratifiedKFold",
"matplotlib.pyplot.subplots",
"sklearn.svm.SVC",
"sklearn.metrics.accuracy_score",
"sklearn.discriminant_analysis.LinearDiscriminantAnalysis",
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.ensemb... |
aidankmcl/AdventureTimeClassifier | [
"47f9a501bd377edb48256d3b4ba4abdb933104ef"
] | [
"model.py"
] | [
"\nfrom random import shuffle\n\nfrom wrangle import Wrangler\n\nfrom sklearn import metrics\nfrom sklearn.externals import joblib\nfrom sklearn.cross_validation import train_test_split\nfrom sklearn.linear_model import LogisticRegression as LR\nfrom sklearn.svm import LinearSVC as SVC\nfrom sklearn.feature_extract... | [
[
"sklearn.linear_model.LogisticRegression",
"sklearn.externals.joblib.dump",
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
mishidemudong/deep_recommendation | [
"6100cfd4037b45b167227ed76acbc536500bc119"
] | [
"Rec_Server/utils/load_user_data.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri May 14 10:55:57 2021\n\n@author: liang\n\"\"\"\n\n'''\nuse redis for online mode\n\n'''\n\nimport pandas as pd\n\ndef get_user_data_redshift(curse, user_id):\n \n sql = '''\n \n select user_id,max(create_time)\n from 表\n... | [
[
"pandas.DataFrame"
]
] |
AgentMaker/Paddle-RLBooks | [
"1a6add1d01b1bab08bb9d246fcd6ab852a43c18c"
] | [
"td3/train.py"
] | [
"from model import Actor, Critic\nfrom replay_memory import ReplayMemory\nimport paddle\nimport paddle.nn.functional as F\nimport numpy as np\nimport gym\n\nbatch_size = 256\nnum_episodes = 100000\nmemory_size = 1000000\npolicy_delay = 2\nlearning_rate = 0.1\ngamma = 0.99\nratio = 0.005\nexploration_noise = 0.1\nep... | [
[
"numpy.random.seed",
"numpy.float"
]
] |
pomelyu/ML_HW | [
"b87697f3ee86592a34d80c8dbf167a5767731630"
] | [
"src/optimizers/radam.py"
] | [
"# From https://github.com/LiyuanLucasLiu/RAdam/blob/master/radam/radam.py\n\nimport math\n\nimport torch\nfrom torch.optim.optimizer import Optimizer\n\n\nclass RAdam(Optimizer):\n\n def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0, degenerated_to_sgd=True):\n if not 0.0 <... | [
[
"torch.zeros_like"
]
] |
vnep-approx-py3/evaluation-ifip-networking-2018-py3 | [
"d830c502c7e5ec01619c0af2ea7fdaaf7d1db5de"
] | [
"evaluation_ifip_networking_2018/evaluation.py"
] | [
"# MIT License\n#\n# Copyright (c) 2016-2018 Matthias Rost, Elias Doehne, Alexander Elvers\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without l... | [
[
"matplotlib.cm.ScalarMappable",
"numpy.mean",
"numpy.nanmean",
"numpy.sort",
"numpy.full",
"numpy.empty",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"numpy.nanmin",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.append",
"matplotlib.pyp... |
Ashleshk/Machine-Learning-Data-Science-Deep-Learning | [
"03357ab98155bf73b8f1d2fd53255cc16bea2333",
"03357ab98155bf73b8f1d2fd53255cc16bea2333"
] | [
"Multi_class-SVM-IRIS_DATASET/SVM.py",
"Machine Learning/nlp_class3/bilstm_mnist.py"
] | [
"# Required Packages\nfrom sklearn import datasets\t\t# To Get iris dataset\nfrom sklearn import svm \t\t\t# To fit the svm classifier\nimport numpy as np\nimport matplotlib.pyplot as plt \n\n# import iris data to model Svm classifier\niris_dataset = datasets.load_iris()\n\nprint (\"Iris data set Description :: ... | [
[
"matplotlib.pyplot.contourf",
"sklearn.svm.LinearSVC",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.yticks",
"sklearn.svm.SVC",
"numpy.arange",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylabel",
"matplotlib.... |
Niklas-AD/Mask2Former | [
"786f395fab4e156970628134cb49eb3547d7287b"
] | [
"mask2former/modeling/transformer_decoder/maskformer_transformer_decoder.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n# Modified by Bowen Cheng from: https://github.com/facebookresearch/detr/blob/master/models/detr.py\nimport fvcore.nn.weight_init as weight_init\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\nfrom detectron2.config import configurabl... | [
[
"torch.nn.Sequential",
"torch.nn.Linear",
"torch.nn.Embedding",
"torch.einsum"
]
] |
shashigowdak/tensorflow | [
"bba3f6a4e733dfd5865dfb14943624c13a7ba9fd"
] | [
"tensorflow/tools/compatibility/tf_upgrade_v2_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.tools.compatibility.tf_upgrade_v2.TFAPIChangeSpec",
"tensorflow.tools.common.traverse.traverse",
"tensorflow.python.util.tf_export.get_v2_names",
"tensorflow.tools.common.public_api.PublicAPIVisitor",
"tensorflow.python.util.tf_export.get_v1_names",
"tensorflow.python.util.tf_i... |
dboceck/AIdiva | [
"66907ca9981ca6588acf493db0e64d07589e86f4"
] | [
"aidiva/helper_modules/combine_expanded_indels_and_create_csv.py"
] | [
"import pandas as pd\nimport numpy as np\nimport tempfile\nimport argparse\nfrom itertools import takewhile\nfrom operator import itemgetter\n\n\nvariant_consequences = {\"transcript_ablation\": 1,\n \"splice_acceptor_variant\": 2,\n \"splice_donor_variant\": 3,\n ... | [
[
"pandas.read_csv"
]
] |
arthurazs/uff-ml | [
"7f8c66df1fc8fd5b041a96bdec4cc159d1654377"
] | [
"aula2/1pandas.py"
] | [
"from sklearn.datasets import load_iris\nimport pandas as pd\n\niris_dataset = load_iris()\niris_data = iris_dataset['data'] # objetos\niris_features = iris_dataset['feature_names'] # atributos\niris_targets = iris_dataset['target'] # atributos / classes\niris_target_names = i... | [
[
"pandas.DataFrame",
"sklearn.datasets.load_iris"
]
] |
pkorshunov/pyannote-core | [
"02cd8eb12d4a396a542d487605f7620c1c386143"
] | [
"pyannote/core/utils/cluster.py"
] | [
"#!/usr/bin/env python\n# encoding: utf-8\n\n# The MIT License (MIT)\n\n# Copyright (c) 2018 CNRS\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including wit... | [
[
"numpy.array",
"numpy.sum",
"numpy.copy",
"scipy.spatial.distance.squareform",
"numpy.random.shuffle",
"numpy.mean",
"numpy.unique"
]
] |
PrimozGodec/keras-explain | [
"692785e881dc12a1500a9e651b07c7ff6fef6f9d"
] | [
"keras_explain/deep_viz_keras/visual_backprop.py"
] | [
"import keras.backend as K\nimport numpy as np\nfrom keras.initializers import Ones, Zeros\nfrom keras.layers import Input, Conv2DTranspose\nfrom keras.models import Model\n\nfrom keras_explain.deep_viz_keras.saliency import SaliencyMask\n\n\nclass VisualBackprop(SaliencyMask):\n \"\"\"A SaliencyMask class that ... | [
[
"numpy.max",
"numpy.mean",
"numpy.min",
"numpy.expand_dims"
]
] |
kian1377/falco-python | [
"a9666629845fc72957cd89339f924b9cfb7ce6f5",
"a9666629845fc72957cd89339f924b9cfb7ce6f5"
] | [
"examples/demo_gen_pupil_LUVOIR_A_final.py",
"examples/EXAMPLE_main_DST_DMLC_probing.py"
] | [
"import sys\nsys.path.insert(0,\"../\")\nimport falco\nimport proper\nimport numpy as np\n\nimport matplotlib.pyplot as plt\n\ninputs = {}\ninputs[\"Nbeam\"] = 1000\ninputs[\"magfacD\"] = 1.\ninputs[\"wStrut\"] = 0.01\n\npupil = falco.mask.falco_gen_pupil_LUVOIR_A_final(inputs)\n\nplt.imshow(pupil); plt.colorbar();... | [
[
"numpy.fliplr",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.imshow"
],
[
"numpy.size"
]
] |
mhamilton723/TorchPQ | [
"f3d560ec04d9c741943fa930a1257c9be9445cbe"
] | [
"torchpq/index/IVFPQIndex.py"
] | [
"import torch\nimport numpy as np\nfrom .BaseIndex import BaseIndex\nfrom ..container import CellContainer\nfrom ..codec import PQCodec, VQCodec\nfrom ..fn import IVFPQTopk\nfrom ..fn import Topk\nfrom .. import util\nfrom .. import metric\n\nclass IVFPQIndex(CellContainer):\n def __init__(\n self,\n d_v... | [
[
"torch.device",
"torch.softmax",
"torch.ceil",
"torch.cuda.is_available",
"torch.tensor",
"torch.log2"
]
] |
FionaLippert/FluxRGNN | [
"176f8f6bf24f65b9822e406f5de173cc5a17960a"
] | [
"fluxrgnn/dataloader.py"
] | [
"import torch\nfrom torch_geometric.data import Data, DataLoader, Dataset, InMemoryDataset\nimport numpy as np\nimport networkx as nx\nimport os.path as osp\nimport os\nimport pandas as pd\nimport pickle\nimport itertools as it\nfrom omegaconf import DictConfig, OmegaConf\nimport warnings\nimport datetime\nwarnings... | [
[
"numpy.quantile",
"numpy.exp",
"torch.load",
"pandas.concat",
"numpy.deg2rad",
"torch.flip",
"numpy.concatenate",
"numpy.empty",
"numpy.nanmin",
"numpy.arange",
"torch.tensor",
"numpy.nanmax",
"torch.zeros",
"numpy.array",
"torch.save",
"numpy.stack"... |
stanford-crfm/composer | [
"4996fbd818971afd6439961df58b531d9b47a37b",
"4996fbd818971afd6439961df58b531d9b47a37b"
] | [
"composer/datasets/create/cifar20.py",
"composer/algorithms/mixup/mixup.py"
] | [
"from argparse import ArgumentParser, Namespace\nfrom typing import Any, Dict, Generator, Tuple\n\nimport numpy as np\nfrom torchvision.datasets import CIFAR100\nfrom wurlitzer import pipes\n\nfrom composer.datasets.webdataset import create_webdataset\n\n\ndef parse_args() -> Namespace:\n args = ArgumentParser()... | [
[
"numpy.array"
],
[
"torch.Tensor",
"torch.nn.functional.one_hot",
"torch.randperm",
"numpy.random.beta"
]
] |
SINGROUP/ED-AFM | [
"9e50f57ab151033294426294d288b5347234600d"
] | [
"figures/stats/stats_distance_Xe.py"
] | [
"\nimport os\nimport sys\nimport glob\nimport time\nimport random\nimport numpy as np\n\nimport torch\n\nsys.path.append('../../ProbeParticleModel')\nfrom pyProbeParticle import oclUtils as oclu\nfrom pyProbeParticle import fieldOCL as FFcl\nfrom pyProbeParticle import RelaxOpenCL as oclr\nfrom pyProbePart... | [
[
"numpy.array",
"numpy.linspace",
"torch.no_grad",
"torch.from_numpy"
]
] |
arthurratz/qr_decomposition | [
"62f14b77bdc3f1f5f5ca73c5c4a5121154212e66"
] | [
"qr_decomposition/qr_decomposition/qr_gschmidt.py"
] | [
"#---------------------------------------------------------------------------\r\n# QR Factorization Using Gram-Schmidt Orthogonalization v.0.0.1\r\n#\r\n# Q,R = qr_gram_schmidt(A)\r\n# \r\n# The worst-case complexity of full matrix Q factorization:\r\n#\r\n# In real case: p = O... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.shape",
"numpy.transpose"
]
] |
ghost-60/TF_CenterNet | [
"ff758eebdd39a37af5a349dbea9a4d42ba380f38"
] | [
"CenterNet.py"
] | [
"import tensorflow as tf\nimport cfg\nimport loss\nfrom net import resnet\nfrom net.layers import _conv, upsampling, _conv_nn\nimport numpy as np\nclass CenterNet():\n def __init__(self, inputs, is_training):\n self.is_training = is_training\n try:\n self.pred_hm, self.pred_wh, self.pred... | [
[
"tensorflow.variable_scope",
"tensorflow.layers.conv2d",
"numpy.log"
]
] |
mattiaspaul/VoxelMorphPlusPlus | [
"707aec7e8e35193a0bbe4ada94be46f89f3da6a0"
] | [
"src/utils_voxelmorph_plusplus.py"
] | [
"import nibabel as nib\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport matplotlib.pyplot as plt\nimport os\nimport math\nimport struct\nimport csv\nimport time\n\ndef gpu_usage():\n print('gpu usage (current/max): {:.2f} / {:.2f} GB'.format(torch.cuda.memory_allo... | [
[
"torch.stack",
"torch.cuda.amp.autocast",
"torch.nn.ModuleList",
"torch.ones",
"torch.eye",
"torch.exp",
"torch.nn.functional.avg_pool3d",
"torch.sqrt",
"torch.FloatTensor",
"numpy.arange",
"torch.empty",
"torch.Tensor",
"torch.zeros",
"numpy.array",
"to... |
cchaugen/temp_openmc_for_Sterling | [
"9f346c9c7ab3128fa40548e936290b97610a2235"
] | [
"openmc/lattice.py"
] | [
"from __future__ import division\n\nfrom abc import ABCMeta\nfrom collections import OrderedDict, Iterable\nfrom copy import deepcopy\nfrom math import sqrt, floor\nfrom numbers import Real, Integral\nfrom xml.etree import ElementTree as ET\n\nfrom six import add_metaclass, string_types\nimport numpy as np\n\nimpor... | [
[
"numpy.empty",
"numpy.asarray",
"numpy.broadcast",
"numpy.any",
"numpy.ravel",
"numpy.squeeze",
"numpy.atleast_2d"
]
] |
huy-ha/frustum-convnet | [
"45958623da24c16ebfeaf83a066ba23ced5fe001"
] | [
"configs/config.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.array"
]
] |
blackcow/pytorch-cifar-master | [
"c571c8fd7fe521907755ca2eacb6aa877abe3493"
] | [
"dataset/cifar10_rmlabel.py"
] | [
"\"\"\"\n对 training load data 改写\n按比例删除某 label 下的数据\n\"\"\"\nfrom __future__ import print_function\nfrom PIL import Image\nimport os\nimport os.path\nimport numpy as np\nimport sys\n\nif sys.version_info[0] == 2:\n import cPickle as pickle\nelse:\n import pickle\n\nimport torch.utils.data as data\nfrom torchv... | [
[
"numpy.delete",
"numpy.arange",
"numpy.vstack"
]
] |
NotMorven/cavaface.pytorch | [
"822651f0e6d4d08df5441922acead39dc5375103"
] | [
"backbone/mobilenetv3.py"
] | [
"\"\"\"\nCreates a MobileNetV3 Model as defined in:\nAndrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, Quoc V. Le, Hartwig Adam. (2019).\nSearching for MobileNetV3\narXiv preprint arXiv:1905.02244.\n\"\"\"\n# ---------------------... | [
[
"torch.nn.Identity",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.init.kaiming_normal_",
"torch.nn.ReLU6",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.PReLU",
"torch.nn.AdaptiveAvgPool2d"
]
] |
pozzocapstone/musical-robot1 | [
"556cb325851c6e268bee6c46d8a00e073b404ca6"
] | [
"musicalrobot/pixel_analysis.py"
] | [
"import os,sys\r\nsys.path.append(os.path.dirname(os.path.abspath(__file__)))\r\n\r\n\r\nimport skimage\r\nimport numpy as np\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport edge_detection\r\n\r\nfrom skimage import io\r\nfrom skimage.draw import circle\r\nfrom scipy.signal... | [
[
"numpy.asarray",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"numpy.mean",
"numpy.amax",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.ylabel",
"numpy.amin",
"matplotlib.pyplot.show",
"scipy.signal.find_peaks",
"matplotlib.pyplot.imshow"
]
] |
awesome-archive/hyperparameter_hunter | [
"6fb727a5c6d87b55aced348ea2c17767f12fb7a3"
] | [
"hyperparameter_hunter/utils/file_utils.py"
] | [
"\"\"\"This module defines utilities for reading, writing, and modifying different types of files\"\"\"\n##################################################\n# Import Own Assets\n##################################################\nfrom hyperparameter_hunter.settings import G\n\n######################################... | [
[
"numpy.array"
]
] |
webclinic017/gs-quant | [
"ebb8ee5e1d954ab362aa567293906ce51818cfa8",
"ebb8ee5e1d954ab362aa567293906ce51818cfa8"
] | [
"gs_quant/test/timeseries/test_measures_xccy.py",
"gs_quant/api/gs/data.py"
] | [
"\"\"\"\nCopyright 2020 Goldman Sachs.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in wr... | [
[
"pandas.Timestamp",
"pandas.testing.assert_series_equal"
],
[
"pandas.to_datetime",
"pandas.DataFrame.from_records",
"pandas.DatetimeIndex",
"pandas.DataFrame",
"pandas.concat",
"pandas.Series"
]
] |
Sam-Gao-Xin/Courses- | [
"263ff4680ed1dfd253be3652f7f13ad707af1a36"
] | [
"MITx-6.00.2x/Lecture 9 - Sampling and Standard Error/lecture9-segment3.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Sep 19 11:45:20 2016\n\n@author: johnguttag\n\"\"\"\n\nimport random, pylab, numpy\n\n#set line width\npylab.rcParams['lines.linewidth'] = 4\n#set font size for titles \npylab.rcParams['axes.titlesize'] = 20\n#set font size for labels on axes\npylab.rcParams['axes.la... | [
[
"numpy.std"
]
] |
mikojimnz/KnightsWatch | [
"ba98f0f01a328f3dbd30929d113636640a06b94a"
] | [
"self_test.py"
] | [
"import json\nimport nltk\nimport numpy\nimport os\nimport pickle\nimport random\nimport re\nimport sys\nimport time\nimport tensorflow\nimport tflearn\n\nfrom nltk.stem.lancaster import LancasterStemmer\nfrom termcolor import colored, cprint\nfrom time import sleep\n\nCONST_REG = r'(?i)\\b((?:https?:(?:/{1,3}|[a-z... | [
[
"numpy.array",
"tensorflow.reset_default_graph",
"numpy.argmax"
]
] |
patientzero/timage-icann2019 | [
"59c08fef30d91f0bc68abfc469bc394ac2949435"
] | [
"code/timage/data/image/image.py"
] | [
"from matplotlib import use\nimport matplotlib.pyplot as plt\n\nuse('Agg')\n\n\nclass ImageMixin(object):\n\n def __init__(self, x, size=(640, 480), color_depth=3):\n self.x = x\n self.size = size\n self.color_depth = color_depth\n\n def transform(self):\n raise NotImplementedError... | [
[
"matplotlib.use",
"matplotlib.pyplot.close"
]
] |
Xtuden-com/profiler | [
"4cb9e4fc9d7c06a818e3f71d6cc1f36fb9324483"
] | [
"plugin/tensorboard_plugin_profile/convert/kernel_stats_proto_to_gviz_test.py"
] | [
"# Copyright 2020 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.test.main"
]
] |
DeeperMind/pytorch-operator | [
"29cc92dd3ee2289ef26cf3b31c22f7618e6c1250"
] | [
"examples/tcp-dist/mnist/dist_mnist.py"
] | [
"#!/usr/bin/env python\n\nimport os\nimport torch\nimport torch.distributed as dist\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom math import ceil\nfrom random import Random\nfrom torch.autograd import Variable\nfrom torchvision import datasets, transforms\n\n\nclass P... | [
[
"torch.nn.Linear",
"torch.distributed.get_world_size",
"torch.distributed.init_process_group",
"torch.autograd.Variable",
"torch.nn.functional.dropout",
"torch.nn.functional.log_softmax",
"torch.manual_seed",
"torch.nn.Conv2d",
"torch.distributed.all_reduce",
"torch.nn.func... |
Yanshang1991/espnet | [
"174bc42814036cfa42ea133f937f59d7a89ecf5d"
] | [
"test/test_custom_transducer.py"
] | [
"# coding: utf-8\n\nimport argparse\nfrom distutils.version import LooseVersion\nimport tempfile\n\nimport json\nimport pytest\nimport torch\n\nfrom espnet.asr.pytorch_backend.asr_init import load_trained_model\nimport espnet.lm.pytorch_backend.extlm as extlm_pytorch\nfrom espnet.nets.beam_search_transducer import ... | [
[
"torch.quantization.quantize_dynamic",
"torch.no_grad",
"torch.tensor"
]
] |
66chenbiao/sleepace_verification_tool | [
"6271312d9d78ee50703e27a75787510cab4c7f4d"
] | [
"slp_utils/utils.py"
] | [
"#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\"\"\"\n# @author : biao chen\n# @Email : chenbiao@sleepace.net\n# @Project : Python_Files\n# @File : utils.py\n# @Software: PyCharm\n# @Time : 2021/5/20 下午7:42\n\"\"\"\nimport os\nimport struct\nimport sys\nimport time\nimport traceback\nfrom datetime import datetime\n... | [
[
"matplotlib.dates.MinuteLocator",
"pandas.set_option",
"matplotlib.pyplot.gca",
"pandas.DataFrame",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.gcf",
"pan... |
tomfalainen/word_spotting | [
"df1ed0ccf5e2749a4cb67ecd8484674ea9137309"
] | [
"misc/map_eval.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Mar 26 08:53:26 2016\n\n@author: tomas\n\"\"\"\nimport sys\nimport json\n\nimport numpy as np\n\nfrom util import MAP, MAP_qbs\n\nif __name__ == '__main__':\n fold = int(sys.argv[1])\n tmp_file = str(sys.argv[2])\n ub = int(sys.argv[3])\n \n with open(... | [
[
"numpy.array",
"numpy.load"
]
] |
skgabriel/coopnet | [
"0815cbd123dd40a87d05a2168206a8c2caac257b"
] | [
"cooperative/disc_selection.py"
] | [
"import argparse\nimport os\nimport json\nimport torch\nimport torch.nn.functional as F\nfrom transformers import *\nimport numpy as np\nimport json\nimport ast\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser()\n parser.add_argument('--subset',type=str,default='aan')\n parser.add_argument(... | [
[
"torch.cuda.manual_seed_all",
"numpy.log",
"numpy.random.seed",
"numpy.mean",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.load"
]
] |
vveitch/relational-ERM | [
"34efbaec989182b8946e9f7a77c094cc0a6496ca"
] | [
"src/node_classification_with_features/predictor_class_and_losses.py"
] | [
"\"\"\"\nExample defining predictor class and losses for relational ERM model\n\"\"\"\n\nimport tensorflow as tf\nfrom node_classification_with_features.node_classification_template import make_node_classifier\nfrom relational_erm.models.skipgram import _make_edge_list_logits, make_simple_skipgram_loss, make_weight... | [
[
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.reduce_sum",
"tensorflow.losses.sparse_softmax_cross_entropy",
"tensorflow.layers.dense",
"tensorflow.contrib.layers.l2_regularizer"
]
] |
ClandininLab/voxelmorph | [
"b7536489414780e839675d3a06fb2093e9e43501"
] | [
"scripts/tf/test.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nExample script for testing quality of trained vxm models. This script iterates over a list of images\nand corresponding segmentations, registers them to an atlas, propagates segmentations to the atlas,\nand computes the dice overlap. Example usage is:\n\n test.py \\\n --model... | [
[
"numpy.std",
"numpy.load",
"numpy.mean",
"tensorflow.device"
]
] |
Junhojuno/vision-transformer | [
"38f8a17967e91e98f767c8e5754081ee8bcd72b4"
] | [
"model/init_weight.py"
] | [
"import torch\nimport torch.nn as nn\nimport math\nimport warnings\n\nfrom torch.functional import norm\n\n\ndef trunc_normal(tensor, mean=0.0, std=1.0, a=-2.0, b=2.0):\n \"\"\"\n Fills the input tensor with`values drawn from a truncated normal distribution.\n The values are effectively drawn from the norm... | [
[
"torch.nn.init.constant_",
"torch.no_grad",
"torch.nn.init.xavier_uniform_",
"torch.nn.init.ones_",
"torch.nn.init.normal_",
"torch.nn.init.zeros_"
]
] |
juice1000/Synchronous-vs-Asynchronous-Learning-Tensorflow- | [
"654be60f7986ac9bb7ce1d080ddee377c3389f93",
"34cfac4a889e2c973651c1c07740ea0908542d68"
] | [
"cart_venv/Lib/site-packages/tensorflow_core/_api/v1/compat/v2/experimental/__init__.py",
"cart_venv/Lib/site-packages/tensorflow_estimator/python/estimator/canned/dnn_testing_utils.py"
] | [
"# This file is MACHINE GENERATED! Do not edit.\n# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.\n\"\"\"Public API for tf.experimental namespace.\n\"\"\"\n\nfrom __future__ import print_function as _print_function\n\nimport sys as _sys\n\nfrom tensorflow.python.eager.context impor... | [
[
"tensorflow.python.util.module_wrapper.TFModuleWrapper"
],
[
"tensorflow.python.ops.variables.Variable",
"tensorflow.python.ops.array_ops.identity",
"tensorflow.python.training.training_util.create_global_step",
"tensorflow.python.summary.writer.writer_cache.FileWriterCache.clear",
"te... |
ywang037/Ternary-Federated | [
"9be32f5d2542769f97fe8a060b5e6771e2dce975"
] | [
"utils/data_utils.py"
] | [
"import torch\nimport numpy as np\nimport torchvision\nimport torchvision.transforms as transforms\nfrom torch.utils.data.dataset import Dataset\n\n\n# -------------------------------------------------------------------------------------------------------\n# DATASETS\n# ---------------------------------------------... | [
[
"numpy.max",
"numpy.array",
"numpy.sum",
"numpy.min",
"numpy.random.shuffle",
"numpy.random.randint",
"numpy.arange",
"numpy.floor",
"numpy.linspace",
"torch.Tensor",
"numpy.maximum"
]
] |
formiel/NeurIPS2021 | [
"a2a29a1904779c3ffd1a002fd057bf90b31a234d"
] | [
"SLU/compute_error_rate.py"
] | [
"\nimport os\nimport sys\nimport itertools\nimport argparse\nimport random\n\nimport torch\n\nblank_token = '__'\nbos_token = 'SOS'\neos_token = 'EOS'\nvoid_concept = 'null'\nslu_start_concept_mark = '_SOC_'\nslu_end_concept_mark = '_EOC_'\n\nblank_idx = 0\nsos_idx = -1\neos_idx = -1\nsoc_idx = -1\neoc_idx = -1\nnu... | [
[
"torch.IntTensor",
"torch.FloatTensor",
"torch.LongTensor"
]
] |
gregorgebhardt/gym-guppy | [
"ba94881e7b70c0333fdbed82117b7ac8e2487a07"
] | [
"gym_guppy/wrappers/observation_wrapper.py"
] | [
"from collections import deque\n\nimport gym\nimport numpy as np\n\nfrom gym_guppy import VariableStepGuppyEnv\nfrom gym_guppy.guppies import AdaptiveCouzinGuppy\nfrom gym_guppy.tools import Feedback\nfrom gym_guppy.tools.math import get_local_poses, transform_sin_cos, ray_casting_walls, compute_dist_bins, \\\n ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"numpy.empty",
"numpy.tile",
"numpy.radians",
"numpy.append",
"numpy.linspace",
"numpy.expand_dims"
]
] |
DataAsCode/stateful | [
"7c461589090ca9fabfbb97d3d17d34a6a2c7a185"
] | [
"src/stateful/storage/stream.py"
] | [
"from typing import Optional\n\nimport numpy as np\nimport pandas as pd\nfrom pandas import DatetimeIndex\nfrom stateful.representable import Representable\nfrom stateful.storage.tree import DateTree\nfrom stateful.utils import list_of_instance, cast_output\nfrom pandas.api.types import infer_dtype\n\n\nclass Strea... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.isna",
"pandas.api.types.infer_dtype"
]
] |
chiragnagpal/probflow | [
"1ba0619cd4f482a015cd25633d2f113d5d0f3476"
] | [
"src/probflow/utils/torch_distributions.py"
] | [
"\"\"\"Torch backend distributions\"\"\"\n\n\ndef get_TorchDeterministic():\n\n from numbers import Number\n\n import torch\n from torch.distributions import constraints\n from torch.distributions.kl import register_kl\n from torch.distributions.utils import broadcast_all\n\n class TorchDeterminis... | [
[
"torch.Size",
"torch.zeros",
"torch.distributions.utils.broadcast_all",
"torch.ones",
"torch.distributions.kl.register_kl"
]
] |
serbible/FirstContactWithTensorFlow-2ndEdition | [
"5a95a128bdd8ca604d1647ad59f981eb960e21ac"
] | [
"SingleLayerNeuralNetwork.py"
] | [
"import input_data\nimport tensorflow as tf\n\nmnist = input_data.read_data_sets(\"MNIST_data/\", one_hot=True)\n\nx = tf.placeholder(\"float\", [None, 784])\nW = tf.Variable(tf.zeros([784, 10]))\nb = tf.Variable(tf.zeros([10]))\nmatm = tf.matmul(x, W)\ny = tf.nn.softmax(tf.matmul(x, W) + b)\ny_ = tf.placeholder(\"... | [
[
"tensorflow.zeros",
"tensorflow.argmax",
"tensorflow.Session",
"tensorflow.matmul",
"tensorflow.log",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.cast",
"tensorflow.train.GradientDescentOptimizer"
]
] |
akofman/models | [
"42f98218d7b0ee54077d4e07658442bc7ae0e661"
] | [
"official/recommendation/neumf_model.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.contrib.tpu.TPUEstimatorSpec",
"tensorflow.group",
"tensorflow.contrib.tpu.CrossShardOptimizer",
"tensorflow.reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.models.Model",
"tensorflow.tile",
"tensorflow.identity",
"tensorflow.cast",
"tensorflow.trai... |
Coughman058/hardware | [
"b726c91b67b49083ad8ca9ce1e4c45d50896e936"
] | [
"tfe_hardware/qcodes_instrument_drivers/Keysight/Keysight_P9374A.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nA driver to control the Keysight VNA P9374A using pyVISA and qcodes\n\n@author: Hatlab: Ryan Kaufman; UIUC: Wolfgang Pfaff\n\n\"\"\"\n\nimport logging\nfrom typing import Any, Union, Dict, List, Tuple\n\nimport numpy as np\nfrom qcodes import (VisaInstrument, Parameter, ParameterWi... | [
[
"numpy.array"
]
] |
cameronaaron/conversationai-crowdsource | [
"2d47a03489116b3ca33d7648c2f0c576ce68b64d"
] | [
"constructiveness_toxicity_crowdsource/scripts/create_data_for_large_scale_annotations.py"
] | [
"#!/usr/local/bin/python3\n__author__ = \"Varada Kolhatkar\"\nimport argparse\nimport pandas as pd\nimport numpy as np\nfrom collections import Counter\n\nSOCC_PATH = '/Users/vkolhatk/Data/SOCC/raw/'\nTEMP_DATA_PATH = '/Users/vkolhatk/Data/tmp/'\n\ndef get_arguments():\n parser = argparse.ArgumentParser(des... | [
[
"pandas.read_csv",
"pandas.concat"
]
] |
prolearner/gluon-ts | [
"3ea8931a4220b9138a2b186dd6fff4fb353e4669"
] | [
"src/gluonts/evaluation/backtest.py"
] | [
"# Copyright 2018 Amazon.com, Inc. or its affiliates. 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# A copy of the License is located at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# or ... | [
[
"pandas.date_range"
]
] |
Thomas-Schatz/audmem | [
"291bb490cae15a67da1a6629c2c15f2b12d50cc4"
] | [
"audmem/stim/test_stim3.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jun 27 11:07:59 2018\n\n@author: Thomas Schatz & Marianne Duyck\n\nRepeated white noise stimuli creation\n\nFor a second ERP test.\n\nCreate 16-bit (signed) 44.1kHz no header mono wavefiles\nsame design as Andrillon et al. 2015 for one block\n3 trial types: RefRN, RN... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.round",
"pandas.DataFrame",
"numpy.random.seed",
"numpy.random.randn",
"numpy.min",
"numpy.floor"
]
] |
paradoxcell/jcvi | [
"225a7f0375a2f8b31d3c44b8134d58b68befe3d6"
] | [
"jcvi/apps/phylo.py"
] | [
"#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n\n\"\"\"\nConstruct and visualize phylogenetic trees from:\n1. MCSCAN output\n2. CDS sequences in FASTA format\n\nOptions are provided for each step:\n1. sequence alignment:\n ClustalW2 or MUSCLE (wrapped on Biopython)\n2. alignment editting:\n GBlocks (opt... | [
[
"numpy.arange"
]
] |
arisgrout/Research-SNPit | [
"c0c656046ec73cd065127840469f0110a7859e93"
] | [
"modules/functions.py"
] | [
"#!/usr/bin/env python3\n# %%\n# ---------------------- packages\n\n# // RELOAD MODULE OPTION WHEN NEEDED\n# importlib.reload(sys.modules['transformers'])\n\n# %%\n# General packages\nimport numpy as np\nimport pandas as pd\nimport pickle # save API responses to variables\nimport math\nimport json\nimport os\nimp... | [
[
"numpy.array",
"pandas.json_normalize",
"pandas.read_sql_query"
]
] |
imgovind/dffml | [
"2a23f55acaac69c7a1840260b0ede694216c2007"
] | [
"model/scratch/dffml_model_scratch/slr.py"
] | [
"# SPDX-License-Identifier: MIT\n# Copyright (c) 2019 Intel Corporation\n\"\"\"\nDescription of what this model does\n\"\"\"\nimport os\nimport abc\nimport json\nimport hashlib\nfrom typing import AsyncIterator, Tuple, Any, List, Optional, NamedTuple, Dict\n\nimport numpy as np\n\nfrom dffml.repo import Repo\nfrom ... | [
[
"numpy.array",
"numpy.mean",
"numpy.append"
]
] |
jonarani/random_walk | [
"316556bac00d9ce0cf1034a3eea57ca8ead1c211"
] | [
"random_walk.py"
] | [
"import enum\nimport numpy as np\nimport random\nimport matplotlib.pyplot as plt\n\n# 1. Create and algorithm for random walk with equal probability of length 100\n# 2. Run your RW algorithm 10x and calculate the statistical features: \n# time average, ensemble average, variance and standard deviation.\n# Plo... | [
[
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.axhline",
"numpy.sum",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.legend",
"numpy.mean",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.hist",
"numpy.subtract"... |
RaghavPrabhakar66/SyMPC | [
"6bc86f40e69477868446c10c01f0a96d9ed3b6f2"
] | [
"src/sympc/module/nn/linear.py"
] | [
"\"\"\"The MPC Linear Layer.\"\"\"\n\n# stdlib\nfrom collections import OrderedDict\nfrom typing import Any\nfrom typing import Dict\nfrom typing import Optional\nfrom typing import Tuple\n\n# third party\nimport torch\n\nfrom sympc.tensor import MPCTensor\nfrom sympc.utils import ispointer\n\nfrom .smpc_module imp... | [
[
"torch.nn.Linear"
]
] |
Magiccircuit/face-mask-detection | [
"4dd7ed82dbd2258d81a0d6beb472affb5762a9c3"
] | [
"utils/metrics.py"
] | [
"# Model validation metrics\n\nfrom pathlib import Path\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\n\nfrom . import general\n\n\ndef fitness(x):\n # Model fitness as a weighted combination of metrics\n w = [0.0, 0.0, 0.1, 0.9] # weights for [P, R, mAP@0.5, mAP@0.5:0.95]\n return ... | [
[
"torch.stack",
"numpy.zeros",
"numpy.sum",
"matplotlib.pyplot.legend",
"numpy.interp",
"matplotlib.pyplot.subplots",
"torch.where",
"matplotlib.pyplot.figure",
"numpy.where",
"numpy.stack",
"numpy.argsort",
"numpy.flip",
"numpy.linspace",
"numpy.unique"
]
... |
rusty1s/pytorch-geometric | [
"ded9a7b10ad8ebc19c97e567c7bb1ae6605253db",
"ded9a7b10ad8ebc19c97e567c7bb1ae6605253db"
] | [
"examples/rev_gnn.py",
"test/transforms/test_random_link_split.py"
] | [
"# Peak GPU memory usage is around 1.57 G\n# | RevGNN Models | Test Acc | Val Acc |\n# |-------------------------|-----------------|-----------------|\n# | 112 layers 160 channels | 0.8307 ± 0.0030 | 0.9290 ± 0.0007 |\n# | 7 layers 160 channels | 0.8276 ± 0.0027 | 0.9272 ± 0.0006 |\n\nimp... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LayerNorm",
"torch.nn.ModuleList",
"torch.nn.functional.dropout",
"torch.no_grad",
"torch.cuda.is_available",
"torch.zeros_like"
],
[
"torch.arange",
"torch.randint",
"torch.stack",
"torch.tensor"
]
] |
sbarham/lv-nlm-he-2019 | [
"6fd1ce680675759d0a58878ac1fde31122712752"
] | [
"utils/create.py"
] | [
"# python\nimport sys\n\n# torch\nimport torch\nfrom torch import nn\n\n# ours\nfrom data import MonoTextData\nfrom modules import VAE\nfrom modules import LSTMEncoder, LSTMDecoder\n\n\n############################################\n# INITIALIZERS #\n#######################################... | [
[
"torch.nn.init.uniform_",
"torch.nn.init.xavier_normal_",
"torch.load"
]
] |
bovee/Aston | [
"315871346df72b3e8fcfa9943e8a3519e60299ff"
] | [
"aston/peak/peak_fitting.py"
] | [
"import numpy as np\nfrom scipy.optimize import leastsq, fmin, fmin_l_bfgs_b\n\n# bounding code inspired by http://newville.github.com/lmfit-py/bounds.html\n# which was inspired by leastsqbound, which was inspired by MINUIT\n\n\ndef _to_bound_p(params, bounds):\n new_v = {}\n for p in params:\n if p no... | [
[
"numpy.sin",
"scipy.optimize.fmin_l_bfgs_b",
"numpy.arcsin",
"numpy.mean",
"numpy.diff",
"scipy.optimize.fmin",
"scipy.optimize.leastsq",
"numpy.abs",
"numpy.sqrt"
]
] |
raoshenglong/mmcv | [
"e22740b1d6953d75a0acecce4455d23800b1f018"
] | [
"mmcv/cnn/bricks/activation.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom mmcv.utils import TORCH_VERSION, build_from_cfg, digit_version\nfrom .registry import ACTIVATION_LAYERS\n\nfor module in [\n nn.ReLU, nn.LeakyReLU, nn.PReLU, nn.RReLU, nn.ReLU6, nn.E... | [
[
"torch.nn.functional.gelu",
"torch.clamp"
]
] |
preethamgali/gpt-neox | [
"26374f34c84118f98b88e82c9d0e414ca4290536"
] | [
"megatron/data/gpt2_dataset.py"
] | [
"# coding=utf-8\n# Copyright (c) 2021, EleutherAI contributors\n# This file is based on code by the authors denoted below and has been modified from its original version.\n#\n# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# yo... | [
[
"numpy.max",
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.random.RandomState",
"numpy.sum",
"torch.cuda.LongTensor",
"numpy.load",
"numpy.min",
"numpy.save",
"numpy.arange",
"torch.distributed.get_rank",
"numpy.iinfo"
]
] |
michaelfeil/dtu_mlops | [
"53b15e85b6c3a235b52aaa35089835f8eff35699"
] | [
"s4_debugging_and_logging/exercise_files/vae_mnist_pytorch_profiler.py"
] | [
"\"\"\"\nAdapted from\nhttps://github.com/Jackson-Kang/Pytorch-VAE-tutorial/blob/master/01_Variational_AutoEncoder.ipynb\n\nA simple implementation of Gaussian MLP Encoder and Decoder trained on MNIST\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport torchvision.transforms as transforms\nfrom torch.utils.data im... | [
[
"torch.nn.Linear",
"torch.device",
"torch.profiler.tensorboard_trace_handler",
"torch.no_grad",
"torch.randn_like",
"torch.utils.data.DataLoader",
"torch.nn.BCELoss",
"torch.profiler.schedule",
"torch.exp",
"torch.randn",
"torch.nn.functional.binary_cross_entropy"
]
] |
lekshmicnair/Web-Design-Challenge | [
"5685089e99b411e3e3a1987633152cd9bc290556"
] | [
"WebVisualizations/data.py"
] | [
"import pandas as pd\n\t\n# Read the cities.csv file\ndf = pd.read_csv('Resources/cities.csv')\n\t\n# Save as html file\ndf.to_html('data.html', index=False)\n\t\n# Assign to table to view\ntable = df.to_html()\nprint(table)\n"
] | [
[
"pandas.read_csv"
]
] |
mumuwoyou/pytrader | [
"6b94e0c8ecbc3ef238cf31715acf8474b9d26b4a"
] | [
"cyvn/trader/app/ctaStrategy/strategy/strategyBollingerBot01.py"
] | [
"# encoding: UTF-8\n\n\"\"\"\"\n基于布林带的交易策略\n观察周期:1min\n策略周期:5min\n策略逻辑:\n1. 信号:突破上轨、下轨\n2. 过滤:均线多头、空头排列\n3. 出场:分级止盈;固定止损\n\"\"\"\n\n\n\nimport talib\nimport numpy as np\n\nfrom cyvn.trader.vtObject import VtBarData\nfrom cyvn.trader.vtConstant import EMPTY_STRING\nfrom cyvn.trader.app.ctaStrategy.ctaTemplate import... | [
[
"pandas.DataFrame"
]
] |
dunknowcoding/RGANet | [
"206715439c445f67489400d8d0a45b906ecfee16"
] | [
"scripts/seg_models.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n: Project - Test speed of different models\n: standalone segmentation using torch in-built models - fcn, deeplabv3, lr-aspp\n: Author - Xi Mo\n: Institute - University of Kansas\n: Date - 5/13/2021 last updated 5/15/2021\n: Model Reference:\n https://pyt... | [
[
"torch.device",
"numpy.array",
"torch.no_grad",
"torch.autograd.set_detect_anomaly",
"torch.softmax",
"numpy.where",
"torch.cuda.is_available",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.load"
]
] |
danielt17/Triplet-loss-few-shot-learning | [
"473e800d3c2b8e33e11d90089468ee5ee18ba7d4"
] | [
"code/VisualizeTSNE.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Mon Jun 7 12:15:25 2021\r\n\r\n@author: danie\r\n\"\"\"\r\n\r\n# %% Imports\r\n\r\nimport torch\r\nimport torchvision\r\nfrom torchvision import transforms\r\nfrom TrainTripletNetwork import LoadBestModel\r\nimport matplotlib\r\nimport matplotlib.pyplot as plt\r\nfr... | [
[
"numpy.array",
"numpy.reshape",
"matplotlib.pyplot.xlabel",
"torch.utils.data.random_split",
"matplotlib.pyplot.legend",
"sklearn.manifold.TSNE",
"matplotlib.rc",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.yl... |
tmulc18/S2SCycleGAN | [
"db78bb588421d0e1886509012b7d3f1ddec77681"
] | [
"SEGAN/preproc.py"
] | [
"import stft\nimport numpy as np\n\nglobal SMP_RATE, SEG_SIZE\nSMP_RATE = 16000\n\nwindow_sec = .02 #window length 20 ms\nSEG_SIZE = int(SMP_RATE*window_sec)\n\nOVER_LAP = 2\n\n\ndef compute_spectrogram(wav_data):\n\tspecgram = stft.spectrogram(wav_data,framelength=SEG_SIZE,overlap=OVER_LAP)\n\treals,ims = np.real(... | [
[
"numpy.imag",
"numpy.real"
]
] |
piyushsoni27/chatbot_rnn_TF | [
"83acc71a7a45d2e6115bb2018fe1ffe17aa949b8"
] | [
"chatbot.py"
] | [
"from __future__ import print_function\n\nimport numpy as np\nimport tensorflow as tf\n\nimport argparse\nimport os\nimport pickle\nimport copy\nimport sys\nimport html\n\nfrom model import Model\n\ndef main():\n assert sys.version_info >= (3, 3), \\\n \"Must be run in Python 3.3 or later. You are running {}\... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.log",
"tensorflow.reset_default_graph",
"tensorflow.Session",
"numpy.seterr",
"numpy.exp",
"tensorflow.train.get_checkpoint_state",
"numpy.logaddexp.reduce",
"tensorflow.ConfigProto",
"numpy.argsort",
"tensorflow.global_v... |
ulise/hetida-designer | [
"a6be8eb45abf950d5498e3ca756ea1d2e46b5c00"
] | [
"runtime/components/Remaining_Useful_Life/univariate_linear_rul_regression.py"
] | [
"from hetdesrun.component.registration import register\nfrom hetdesrun.datatypes import DataType\n\nimport datetime\nimport pandas as pd\nimport numpy as np\nfrom sklearn.linear_model import LinearRegression\n\n\ndef rul_regression_linear(\n train_series: pd.Series,\n limit: float,\n num_pred_series_future... | [
[
"pandas.date_range",
"sklearn.linear_model.LinearRegression",
"pandas.Series"
]
] |
bartoszptak/EfficientDet | [
"ccc795781fa173b32a6785765c8a7105ba702d0b"
] | [
"EfficientDet/initializers.py"
] | [
"\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable la... | [
[
"numpy.ones"
]
] |
brandonbraun653/ValkyrieRNN | [
"532d2f9b1251d151a7f7ef1324ae3250b496193b"
] | [
"src/PIDController.py"
] | [
"import numpy as np\n\n\nclass PID(object):\n DIRECT = False\n REVERSE = True\n\n def __init__(self, input, output, setpoint, kp, ki, kd, direct):\n \"\"\"\n\n :param input: A function that returns an input value\n :param output: A function that sets an output value\n :param set... | [
[
"numpy.isscalar"
]
] |
poshmine/HEXER_HX_CODE | [
"806d70427cc7d980fc848fdf23627b8d83f3579a"
] | [
"HEXER_CODE.py"
] | [
"'''\nDate of last edit: August 24th, 2020\nAuthor(s): Ryan McGuire* Lane Carasik^\n*Virginia CommonWealth University\n*FAST Research Group\nHEXER - base HEat EXchangER code\nEquations for Reactor Heat Exchangers: \nPython Script for calculation of Shell-and Tube heat transfer coefficient using correctional fact... | [
[
"numpy.sin",
"numpy.arccos"
]
] |
eliteraspberries/python-libnu | [
"869945fc3f0d4c7ebbc9a4e66f3aa6700472b0f3"
] | [
"test-sum.py"
] | [
"#!/usr/bin/env python\n\nimport functools\nimport numpy\n\nimport hypothesis\nimport hypothesis.extra.numpy\nimport hypothesis.strategies\n\nimport libnu.sum\n\nfrom test import eq\n\narrays = functools.partial(\n hypothesis.extra.numpy.arrays,\n dtype=numpy.float32,\n unique=True,\n)\nfloats = hypothesis... | [
[
"numpy.max",
"numpy.sum",
"numpy.copy",
"numpy.min",
"numpy.mean",
"numpy.var"
]
] |
horagong/RoboND-Rover-Project | [
"51546db5473812c1f3a45c395c34ae22f3761409"
] | [
"code/drive_rover.py"
] | [
"# Do the necessary imports\nimport argparse\nimport shutil\nimport base64\nfrom datetime import datetime\nimport os\nimport cv2\nimport numpy as np\nimport socketio\nimport eventlet\nimport eventlet.wsgi\nfrom PIL import Image\nfrom flask import Flask\nfrom io import BytesIO, StringIO\nimport json\nimport pickle\n... | [
[
"numpy.zeros",
"matplotlib.image.imread",
"matplotlib.pyplot.figure",
"numpy.isfinite",
"numpy.dstack"
]
] |
JoshVStaden/codex-africanus | [
"4a38994431d51510b1749fa0e4b8b6190b8b530f"
] | [
"africanus/calibration/utils/examples/apply_gains_to_ms.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nThis example show how to apply gains to an ms in a chunked up way.\nThe gains should be stored in a .npy file and have the shape\nexpected by the corrupt_vis function.\nIt is assumed that the direction axis is ordered in the same way as\nmodel_cols where mode... | [
[
"numpy.load"
]
] |
v3rm1/rl_cartpole | [
"9191120af05ff18cf8c16e48274ef44438a60d6b"
] | [
"rtm_ql_PER/q_rtm_test.py"
] | [
"from os import path\nimport yaml\nimport numpy as np\nimport random\nimport math\nfrom collections import deque\nfrom time import strftime\nimport csv\nimport gym\nfrom logger.score import ScoreLogger\nfrom discretizer import CustomDiscretizer\nfrom debug_plot_functions import DebugLogger\nfrom per_memory import M... | [
[
"numpy.max",
"numpy.array",
"numpy.random.rand",
"numpy.reshape",
"numpy.sum",
"numpy.mean",
"numpy.argmax",
"numpy.random.random",
"numpy.vstack"
]
] |
searobbersduck/GossipInfoAnalysis | [
"2965ed5934f129e7e8c46bd7ab7430d6ee216fcc"
] | [
"GossipHotAnalysis/data.py"
] | [
"# !/usr/bin/env python3\n\nimport os\nimport numpy as np\nimport json\nfrom glob import glob\nimport random\nimport time\n\nimport sys\nsys.path.append('./')\nsys.path.append('./corpus/w2v')\n\nimport gen_pieces\nimport vocab as vocab_160k\n\n# 1. convert json to txt\ndef convert_gossip_json_to_txt(infile, outdir)... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.zeros",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.show"
]
] |
rondon1947/RA26_Ctrl-Alt-Elite_WIMDR | [
"9c7448008aa294cc7c5ab40dcac66f30dec11988"
] | [
"Computer Vision/animal detection/animal_detector.py"
] | [
"import tensorflow as tf\nimport cv2 as cv\n\n\nclass AnimalDetector():\n def get_number_of_animals(self, path_to_image):\n with tf.gfile.FastGFile('/home/aryan/Documents/newsih2020/sih2020/ML Project/Detector_class_animal/frozen_inference_graph.pb', 'rb') as f:\n graph_def = tf.GraphDef()\n ... | [
[
"tensorflow.GraphDef",
"tensorflow.Session",
"tensorflow.import_graph_def",
"tensorflow.gfile.FastGFile"
]
] |
DerMaxxiKing/htc_calculator | [
"10d2e31a1cb4256fdcbe25ec915d7280927a064a"
] | [
"src/htc_calculator/solid.py"
] | [
"import os\r\nimport sys\r\nimport uuid\r\nimport tempfile\r\nimport time\r\nfrom io import StringIO\r\nimport re\r\nimport numpy as np\r\nimport trimesh\r\nfrom pyobb.obb import OBB\r\nfrom scipy.spatial import ConvexHull\r\n\r\nfrom .meshing.surface_mesh_parameters import default_surface_mesh_parameter\r\nfrom .f... | [
[
"numpy.array",
"numpy.random.uniform",
"scipy.spatial.ConvexHull"
]
] |
Receiling/ENPAR | [
"decd2945d21a7be5a0f73c37cfc5e252301aab15"
] | [
"modules/decoders/seq_decoder.py"
] | [
"import logging\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nlogger = logging.getLogger(__name__)\n\n\nclass SeqSoftmaxDecoder(nn.Module):\n \"\"\"This class decodes sequence hidden unit\n \"\"\"\n def __init__(self, hidden_size, label_size, bias=True):\n \"\"\"This fun... | [
[
"torch.nn.Linear",
"torch.nn.CrossEntropyLoss",
"torch.nn.functional.log_softmax"
]
] |
AyushExel/GANSketching | [
"c72524ac4425de898087af7a4c554b777a4e2218"
] | [
"training/networks/diffaug.py"
] | [
"# Differentiable Augmentation for Data-Efficient GAN Training\n# Shengyu Zhao, Zhijian Liu, Ji Lin, Jun-Yan Zhu, and Song Han\n# https://arxiv.org/pdf/2006.10738\n\nfrom random import random\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass DiffAugment(nn.Module):\n def __init__(s... | [
[
"torch.nn.functional.pad",
"torch.nn.functional.interpolate",
"torch.arange"
]
] |
raphaelsulzer/shape_as_points | [
"672c06d876647ddacb3d0fc89570e8f5f4d5b9a2"
] | [
"src/model_rgb.py"
] | [
"import torch\nfrom src.network.net_rgb import RenderingNetwork\nfrom src.utils import approx_psr_grad\nfrom pytorch3d.renderer import (\n RasterizationSettings, \n PerspectiveCameras,\n MeshRenderer, \n MeshRasterizer, \n SoftSilhouetteShader)\nfrom pytorch3d.structures import Meshes\n\n\ndef appro... | [
[
"torch.sigmoid",
"torch.cat",
"torch.stack",
"torch.nn.ReplicationPad3d",
"torch.tanh"
]
] |
Borja-Perez-Diaz/HII-CHI-Mistry | [
"d0dafc753c63246bf14b77807a885ddc7bd4bb99"
] | [
"HCm-uv/HCm-UV_v4.2/HCm-UV_v4.2.py"
] | [
"# Filename: HCm_UV_v4.2.py\n\nimport string\nimport numpy as np\nimport sys\n#sys.stderr = open('errorlog.txt', 'w')\nimport warnings\nwarnings.filterwarnings(\"ignore\")\n\n#Function for interpolation of grids\n\ndef interpolate(grid,z,zmin,zmax,n):\n #Columns of the library\n n_comments = 0\n with open('Li... | [
[
"numpy.random.normal",
"numpy.delete",
"numpy.reshape",
"numpy.zeros",
"numpy.lexsort",
"numpy.genfromtxt",
"numpy.exp",
"numpy.mean",
"numpy.where",
"numpy.std",
"numpy.stack",
"numpy.arange",
"numpy.abs",
"numpy.log10"
]
] |
ldynczuki/ml-python-curso | [
"6988568fe2283a057957830345b5323d05cf7de5",
"6988568fe2283a057957830345b5323d05cf7de5"
] | [
"regressao/regressao_linear_simples_casas.py",
"agrupamento/k-means/k-means_credito1.py"
] | [
"\"\"\"\nNeste caso, queremos fazer a previsão dos preços (prices) das casas.\nAtributo previsor (coluna 5) - \"sqft_living\"\nAtributo classe (coluna 2) - \"price\"\n\"\"\"\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model impor... | [
[
"sklearn.metrics.mean_squared_error",
"sklearn.linear_model.LinearRegression",
"sklearn.metrics.mean_absolute_error",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.scatter",
"pandas.read_csv"
],
[
"numpy.column_stack",
"sklearn.preprocessing.StandardScaler",
... |
calemhoffman/gym-anytrading | [
"4811f7900f59a4489dcc53edaab175dc7715459a"
] | [
"gym_anytrading/envs/trading_env.py"
] | [
"import gym\nfrom gym import spaces\nfrom gym.utils import seeding\nimport numpy as np\nfrom enum import Enum\nimport matplotlib.pyplot as plt\nimport plotly.express as px\nimport plotly.graph_objects as go\nimport pandas as pd\nfrom sklearn import preprocessing, model_selection, feature_selection, ensemble, linear... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.cla",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.show"
]
] |
CraigWang1/EfficientDet-1 | [
"930d6a69aa8d5c62a69ab0349181e83f80ac4c8d"
] | [
"train.py"
] | [
"\"\"\"\nCopyright 2017-2018 Fizyr (https://fizyr.com)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable la... | [
[
"tensorflow.keras.callbacks.TensorBoard",
"tensorflow.keras.utils.get_file",
"tensorflow.Session",
"tensorflow.ConfigProto",
"tensorflow.keras.optimizers.Adam"
]
] |
ming71/SLA | [
"7024b093bc0d456b274314ebeae3bc500c2db65a"
] | [
"utils/box/bbox.py"
] | [
"import torch\n\nfrom torchvision.ops.boxes import nms, batched_nms, box_iou\n\ndef bbox_switch(bbox, in_type, out_type): # 'xyxy', 'xywh'\n if in_type == 'xyxy' and out_type == 'xywh':\n bbox = torch.cat([(bbox[..., 0: 2] + bbox[..., 2: 4]) / 2, bbox[..., 2: 4] - bbox[..., 0: 2]], dim=-1)\n elif in_t... | [
[
"torch.log",
"torch.cat",
"torch.exp",
"torch.tanh"
]
] |
drone-simulation/reinmav-gym | [
"76a0eea77155b32112a44a3787844a3c6a904279"
] | [
"gym_reinmav/envs/native/quadrotor2d.py"
] | [
"#Copyright (C) 2018, by Jaeyoung Lim, jaeyoung@auterion.com\n# 2D quadrotor environment using rate control inputs (continuous control)\n\n#This is free software: you can redistribute it and/or modify\n#it under the terms of the GNU Lesser General Public License as published by\n#the Free Software Foundation, eithe... | [
[
"numpy.array",
"numpy.linalg.norm"
]
] |
rgmane/openpilot | [
"21789500d6541fcffd88b12606a3eddc6d3d8d76"
] | [
"selfdrive/controls/lib/lane_planner.py"
] | [
"from common.numpy_fast import interp\nimport numpy as np\nfrom selfdrive.hardware import EON, TICI\nfrom cereal import log\n\n\nTRAJECTORY_SIZE = 33\n# camera offset is meters from center car to camera\nif EON:\n CAMERA_OFFSET = 0.06\n PATH_OFFSET = 0.0\nelif TICI:\n CAMERA_OFFSET = -0.04\n PATH_OFFSET = -0.04... | [
[
"numpy.array",
"numpy.interp",
"numpy.zeros"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.