repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
pcadoret/toucan-connectors | [
"bfe3960fc2d54ac5039d6712e61c7d6fb1160729"
] | [
"toucan_connectors/mssql/mssql_connector.py"
] | [
"import pandas as pd\nimport pymssql\nfrom pydantic import Field, SecretStr, constr\n\nfrom toucan_connectors.toucan_connector import ToucanConnector, ToucanDataSource\n\n\nclass MSSQLDataSource(ToucanDataSource):\n # By default SQL Server selects the database which is set\n # as default for specific user\n ... | [
[
"pandas.read_sql"
]
] |
WhiteTeaDragon/hw-asr | [
"78a767ab00a743b8d28d1fdad795f066fc0795da"
] | [
"hw_asr/model/deep_speech_model.py"
] | [
"import torch\nfrom torch import nn\n\nfrom hw_asr.base import BaseModel\n\n\nclass DeepSpeechModel(BaseModel):\n def __init__(self, n_feats, n_class, hidden_size, n_layers, dropout,\n *args, **kwargs):\n super().__init__(n_feats, n_class, *args, **kwargs)\n self.convolutional = nn.... | [
[
"torch.nn.Linear",
"torch.nn.LSTM",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.transpose"
]
] |
Hao-Yuanxin/pyFFTW | [
"86df872d4d489ad79b97f93a9512e9f63a0258e0"
] | [
"pyfftw/interfaces/numpy_fft.py"
] | [
"#!/usr/bin/env python\n#\n# Henry Gomersall\n# heng@kedevelopments.co.uk\n#\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Redistributions of source code must retain the above co... | [
[
"numpy.asarray",
"numpy.conjugate"
]
] |
shuaizzZ/mmdetection | [
"b6ded17b22065cb3aef827983d3634e3c918c3e3"
] | [
"mmdet/core/export/pytorch2onnx.py"
] | [
"from functools import partial\n\nimport mmcv\nimport numpy as np\nimport torch\nfrom mmcv.runner import load_checkpoint\nfrom mmcv import Config\n\n\ndef generate_inputs_and_wrap_model(config_path, checkpoint_path, input_config):\n \"\"\"Prepare sample input and wrap model for ONNX export.\n\n The ONNX expor... | [
[
"numpy.array",
"torch.from_numpy"
]
] |
ptrendx/gluon-cv | [
"5017de97bffcdf7fd90a0be5cdd3201dc7af769e"
] | [
"gluoncv/data/kinetics400/classification.py"
] | [
"# pylint: disable=line-too-long,too-many-lines,missing-docstring\n\"\"\"Kinetics400 action classification dataset.\nCode partially borrowed from https://github.com/open-mmlab/mmaction.\"\"\"\nimport os\nimport numpy as np\nfrom mxnet import nd\nfrom mxnet.gluon.data import dataset\n\n__all__ = ['Kinetics400']\n\nc... | [
[
"numpy.zeros",
"numpy.stack",
"numpy.random.randint",
"numpy.transpose",
"numpy.squeeze"
]
] |
kent0304/AttnGAN | [
"3076a1f004a182d28077e5882baf081dc382f620"
] | [
"code/miscc/utils.py"
] | [
"import os\nimport errno\nimport numpy as np\nfrom torch.nn import init\n\nimport torch\nimport torch.nn as nn\n\nfrom PIL import Image, ImageDraw, ImageFont\nfrom copy import deepcopy\nimport skimage.transform\n\nfrom miscc.config import cfg\n\n\n# For visualization ################################################... | [
[
"numpy.max",
"numpy.concatenate",
"torch.cat",
"numpy.uint8",
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.sum",
"torch.nn.functional.interpolate",
"numpy.ones",
"numpy.transpose",
"numpy.argsort",
"torch.nn.init.orthogonal_"
]
] |
Abner0627/nc_lab_abner | [
"af8849d3bab160cce7e51621a3c21fd3e8bf764f"
] | [
"get_data.py"
] | [
"#%% Import modules\nimport h5py\nimport numpy as np\nfrom os import listdir\n\ndef get_data(dpath, data_list): \n #%% Parameters\n bin_width = 0.064\n div = int(bin_width / 0.004)\n order = 20\n \n SESSION_UNSORTING_FR_64 = []\n FR_ORDER = []\n \n FR_ORDER_TRAIN = []\n POS_NOR_ORDER_... | [
[
"numpy.concatenate",
"numpy.histogram",
"numpy.array",
"numpy.delete",
"numpy.max",
"numpy.zeros",
"numpy.copy",
"numpy.min",
"numpy.mean",
"numpy.vstack"
]
] |
andrew-kulikov/license-plate-recognition | [
"70c0074c7511850deb13d44d584ff84608d1231b"
] | [
"src/DetectPlates.py"
] | [
"# DetectPlates.py\n\nimport math\nimport random\n\nimport DetectChars\nimport PossibleChar\nimport PossiblePlate\nimport Preprocess\nimport Recognitor\nimport cv2\nimport numpy as np\n\nPLATE_WIDTH_PADDING_FACTOR = 1.3\nPLATE_HEIGHT_PADDING_FACTOR = 1.5\n\n\ndef detectPlatesInScene(img_original_scene):\n listOf... | [
[
"numpy.zeros"
]
] |
preeti98/sleap | [
"203c3a03c0c54f8dab242611d9a8d24595e98081",
"203c3a03c0c54f8dab242611d9a8d24595e98081"
] | [
"tests/nn/data/test_dataset_ops.py",
"tests/nn/data/test_training.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom sleap.nn.system import use_cpu_only; use_cpu_only() # hide GPUs for test\n\nfrom sleap.nn.data import dataset_ops\n\n\ndef test_batcher():\n ds = tf.data.Dataset.from_tensors({\"a\": tf.reshape(tf.range(3 * 2), [3, 2])})\n ds = ds.unbatch()\n\n batcher = ... | [
[
"numpy.isnan",
"tensorflow.data.Dataset.range",
"tensorflow.range",
"numpy.testing.assert_array_equal",
"tensorflow.ones"
],
[
"tensorflow.data.Dataset.from_tensors"
]
] |
dpopadic/ml-res | [
"1fd746301b3ef10a96f78832cebb0c79c9327f1c"
] | [
"ml/ex8/ex8_cofi.py"
] | [
"# ------------- Machine Learning - Topic 8: Anomaly Detection and Recommender Systems\n\n# This file contains code that helps you get started on the\n# exercise. You will need to complete the following functions\n# in this exercise:\n#\n# cofiCostFunc\n# checkCostFunction\n# computeNumericalGradient... | [
[
"numpy.dot",
"numpy.reshape",
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"scipy.io.loadmat",
"numpy.random.randn",
"numpy.mean",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"numpy.column_stack",
"scipy.optimize.minimize",
"matplotlib.pyplot.imshow"
]
] |
RobertCsordas/tcf | [
"da20530dfb4336deddfbe5e79d62e72d1dc2580e"
] | [
"paper/lib/stat_tracker.py"
] | [
"from dataclasses import dataclass\nfrom typing import Union\nimport math\nimport numpy as np\nimport statistics\n\n\n@dataclass\nclass Stat:\n mean: Union[np.ndarray, float]\n std: Union[np.ndarray, float]\n n: int\n\n def __repr__(self) -> str:\n return f\"Stat(mean: {self.mean}, std: {self.std... | [
[
"numpy.maximum"
]
] |
dongjundev/Image-Classification | [
"9ff51b7cad166c6a27710551577c8b0eca4c280e"
] | [
"main.py"
] | [
"import os\r\n\r\nimport torchvision.utils\r\nfrom PIL import Image\r\n\r\nimport torch\r\nfrom torch.utils.data import Dataset, DataLoader\r\nfrom torch import nn\r\nfrom torchvision import transforms\r\n\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n\r\nclass CustomImageDataset(Dataset):\r\n ... | [
[
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.MaxPool2d",
"torch.max",
"torch.no_grad",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"numpy.transpose",
"torch.utils.data.DataLoader",
"torch.load",
"matplotlib.pyplot.show",
... |
Taoup/interactive-selection | [
"50796c33127557b1cba6b3419e4cb825e0d44516"
] | [
"train_click.py"
] | [
"import argparse\nimport os\nimport numpy as np\nfrom tqdm import tqdm\n\nfrom mypath import Path\nfrom dataloaders import make_data_loader\nfrom modeling.sync_batchnorm.replicate import patch_replication_callback\nfrom modeling.correction_net.fusion_net import *\nfrom modeling.deeplab import DeepLabX\nfrom modelin... | [
[
"numpy.argmax",
"numpy.load"
]
] |
ocean-perception/oplab_pipeline | [
"1138e716f43e015812e9eb44b542cf76544b6b98"
] | [
"auv_nav/parsers/hybis.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCopyright (c) 2020, University of Southampton\nAll rights reserved.\nLicensed under the BSD 3-Clause License.\nSee LICENSE.md file in the project root for full license information.\n\"\"\"\n\nimport math\nimport os\nfrom pathlib import Path\n\nimport pandas as pd\n\nfrom auv_nav.to... | [
[
"pandas.read_csv"
]
] |
UPstartDeveloper/TensoRF | [
"5720788f10f6a21f2ea1286c9e0356f83db09a0d"
] | [
"dataLoader/your_own_data.py"
] | [
"import torch,cv2\nfrom torch.utils.data import Dataset\nimport json\nfrom tqdm import tqdm\nimport os\nfrom PIL import Image\nfrom torchvision import transforms as T\n\n\nfrom .ray_utils import *\n\n\nclass YourOwnDataset(Dataset):\n def __init__(self, datadir, split='train', downsample=1.0, is_stack=False, N_v... | [
[
"torch.cat",
"torch.stack",
"torch.norm",
"torch.FloatTensor",
"torch.inverse",
"torch.tensor",
"torch.mean"
]
] |
kemaloksuz/aLRPLoss-AblationExperiments | [
"49d3eb7a01ae60380e46b8c0ef496d6c53ac40b9"
] | [
"lib/util/pascal_voc_eval.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.concatenate",
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.minimum",
"numpy.sum",
"numpy.where",
"numpy.finfo",
"numpy.arange",
"numpy.sort",
"numpy.argsort",
"numpy.cumsum",
"numpy.argmax",
"numpy.maximum"
]
] |
Hubert51/Randomness_Test | [
"d87ee46d092c5c36687981d4cddc5882c8d5becc"
] | [
"setup.py"
] | [
"from distutils.core import setup\nfrom distutils.extension import Extension\nfrom Cython.Build import cythonize\nimport numpy\n# python setup.py build_ext --inplace\next_options = {\"compiler_directives\": {\"profile\": True, \"language_level\" : \"3\"}, \"annotate\": True}\next_modules = [Extension('utils.PyRan... | [
[
"numpy.get_include"
]
] |
alexandertsema/IndoorLocalizationSceneClassifier | [
"89f239234adf903a53e5df7ce65caf3a6b9169fe"
] | [
"src/evaluation/test.py"
] | [
"import sys\nimport time\nfrom datetime import datetime\nimport numpy as np\nimport tensorflow as tf\nfrom data.data_set import DataSet\nfrom evaluation.evaluation import Evaluation\nfrom helpers.configuration import Configuration\nfrom helpers.sessions import Sessions\nfrom model.cnn import Cnn\nfrom visualization... | [
[
"tensorflow.summary.FileWriter",
"tensorflow.train.start_queue_runners",
"numpy.array",
"tensorflow.train.Coordinator",
"tensorflow.argmax",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.train.Saver",
"numpy.sum",
"tensorflow.squeeze",
"tensorflow.summary.merge_... |
cgrudz/DAPPER | [
"177917bd6d7520ac221e384174f07b35dc03b45b"
] | [
"dapper/mods/LorenzIII/__init__.py"
] | [
"\"\"\"A multi-scale, smooth version of the classic Lorenz-96.\n\nThis is an implementation of \"Model III\" of `bib.lorenz2005designing`.\n\nSimilar to `dapper.mods.LorenzUV` this model is designed\nto contain two different scales. However, in \"Model III\"\nthe two scales are not kept separate, but superimposed,\... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.ones",
"numpy.roll",
"scipy.ndimage.convolve1d",
"numpy.arange",
"scipy.signal.oaconvolve",
"numpy.hstack",
"numpy.mod"
]
] |
RicardoLanJ/graph-ter | [
"3b9bda527a6a9559be835c5b84e6491ac8c5aa30"
] | [
"graph_ter_seg/runner/classifier_runner.py"
] | [
"import os\nimport torch\n\nimport numpy as np\nimport pandas as pd\nimport torch.nn as nn\n\nfrom tensorboardX import SummaryWriter\nfrom torch.utils.data.dataloader import DataLoader\n\nfrom graph_ter_seg.models.backbone import Backbone\nfrom graph_ter_seg.models.classifier import Classifier\nfrom graph_ter_seg.r... | [
[
"torch.nn.NLLLoss",
"numpy.logical_or",
"torch.utils.data.dataloader.DataLoader",
"pandas.DataFrame",
"torch.no_grad",
"numpy.mean",
"numpy.logical_and",
"numpy.unique"
]
] |
sunghoonhong/SWAT | [
"0b9e3d988dacd245b60b3c5e9718fe7e74e7fad1",
"0b9e3d988dacd245b60b3c5e9718fe7e74e7fad1"
] | [
"modular-rl/src/environments/nervenet_hopper.py",
"modular-rl/src/TransformerActor.py"
] | [
"import numpy as np\nfrom gym import utils\nfrom gym.envs.mujoco import mujoco_env\nfrom utils import *\n\n\nclass ModularEnv(mujoco_env.MujocoEnv, utils.EzPickle):\n def __init__(self, xml):\n self.xml = xml\n mujoco_env.MujocoEnv.__init__(self, xml, 4)\n utils.EzPickle.__init__(self)\n\n ... | [
[
"numpy.square",
"numpy.array",
"numpy.degrees",
"numpy.abs",
"numpy.isfinite"
],
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LayerNorm",
"torch.squeeze",
"torch.cuda.is_available",
"torch.tanh",
"torch.nn.TransformerEncoderLayer"
]
] |
AaronBrooksCsiro/rioxarray | [
"9d9824684bad526a8cd8247f2645e7cb29a4d393"
] | [
"rioxarray/_io.py"
] | [
"\"\"\"\n\nCredits:\n\nThis file was adopted from: https://github.com/pydata/xarray # noqa\nSource file: https://github.com/pydata/xarray/blob/1d7bcbdc75b6d556c04e2c7d7a042e4379e15303/xarray/backends/rasterio_.py # noqa\n\"\"\"\n\nimport os\nimport re\nimport warnings\nfrom collections import OrderedDict\nfrom dist... | [
[
"numpy.max",
"numpy.asarray",
"numpy.zeros",
"numpy.min",
"numpy.ix_",
"numpy.arange",
"numpy.squeeze",
"numpy.dtype"
]
] |
Harshvardhan1999/The-Movie-Cinema | [
"8c91dc5f33bd353e34b7b4c427c4acdfe4a9bf50"
] | [
"Movie Recommendation System/main.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom flask import Flask, render_template, request\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.metrics.pairwise import cosine_similarity\nimport json\nimport bs4 as bs\nimport urllib.request\nimport pickle\nimport requests\nfrom datetime import... | [
[
"numpy.array",
"pandas.read_csv"
]
] |
EllAchE/nba_tipoff | [
"f3820e391d4a6ddb611efeb6c709f16876771684"
] | [
"src/skill_algorithms/common_data_processing.py"
] | [
"import json\nimport pandas as pd\nfrom sklearn.metrics import log_loss\n\nimport ENVIRONMENT\nfrom src.database.database_creation import resetAndInitializePredictionSummaryDict\n\ndef preMatchPredictionsNoBinning(awayPlayerCode, awayPlayerTeam, homeOdds, homePlayerCode, homePlayerTeam, scoringTeam,\n ... | [
[
"pandas.read_csv",
"sklearn.metrics.log_loss"
]
] |
matsuyama/tensorflow | [
"a27d844e05447e65aa279ae5269a2d75590f46f6",
"a27d844e05447e65aa279ae5269a2d75590f46f6"
] | [
"tensorflow/python/ops/seq2seq.py",
"tensorflow/python/kernel_tests/template_test.py"
] | [
"# Copyright 2015 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.python.ops.variable_scope.variable_scope",
"tensorflow.python.ops.variable_scope.get_variable",
"tensorflow.python.ops.math_ops.tanh",
"tensorflow.python.ops.array_ops.expand_dims",
"tensorflow.python.framework.ops.device",
"tensorflow.python.ops.math_ops.cast",
"tensorflow... |
sesh1810/3D_ICH_SEGMENTATION_PREDICTION | [
"0971a3a3c8f01228fba3a5698652a24e8ca7ceb0"
] | [
"segmentation/models/Residual UNet/Visualize.py"
] | [
"from __future__ import print_function\nimport argparse\nimport os\nimport numpy as np\nfrom PIL import Image\nimport torch\nfrom torch.autograd import Variable\nimport torchvision.transforms as transforms\n#from networks import define_G, define_D, GANLoss, print_network\nimport torch.nn as nn\n\n#from util import ... | [
[
"numpy.max",
"torch.autograd.Variable",
"torch.FloatTensor",
"torch.no_grad",
"torch.from_numpy",
"torch.load",
"numpy.unique",
"torch.nn.parallel.DataParallel",
"numpy.squeeze",
"numpy.expand_dims"
]
] |
gtsambos/tsk | [
"eda66fa7795bcae9b2d6ac5d0101c5ea98bc6802"
] | [
"python/tskit/tables.py"
] | [
"# MIT License\n#\n# Copyright (c) 2018-2020 Tskit Developers\n# Copyright (c) 2017 University of Oxford\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, inclu... | [
[
"numpy.max",
"numpy.logical_or",
"numpy.array",
"numpy.append",
"numpy.array_equal",
"numpy.logical_not",
"numpy.fmax",
"numpy.min",
"numpy.logical_and",
"numpy.diff",
"numpy.any",
"numpy.where",
"numpy.bitwise_and",
"numpy.cumsum",
"numpy.repeat",
"... |
nrupatunga/pytorch-deaf | [
"751a37669e78f6671a26cb5cff42c05139bf3c41"
] | [
"src/misc/image_io.py"
] | [
"\"\"\"\nFile: image_io.py\nAuthor: Nrupatunga\nEmail: nrupatunga.s@byjus.com\nGithub: https://github.com/nrupatunga\nDescription: Image IO\n\"\"\"\n\nimport numpy as np\nimport torch\nfrom PIL import Image\nfrom torchvision import get_image_backend\n\ntry:\n import accimage\nexcept ImportError:\n accimage = ... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"torch.is_tensor",
"torch.from_numpy"
]
] |
pengfeisu/tensorflow | [
"cae852a32ee8ef86d4a58512c1177359c5bfd465",
"cae852a32ee8ef86d4a58512c1177359c5bfd465"
] | [
"tensorflow/contrib/gan/python/features/python/tensor_pool_impl.py",
"tensorflow/contrib/eager/python/network.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.ops.array_ops.identity",
"tensorflow.python.ops.control_flow_ops.cond",
"tensorflow.python.ops.data_flow_ops.RandomShuffleQueue",
"tensorflow.python.framework.ops.control_dependencies",
"tensorflow.python.ops.random_ops.random_uniform"
],
[
"tensorflow.python.trainin... |
manoja328/gradlab | [
"a3889635925c72abde5d532b72e9bfdd0a4538f0"
] | [
"udpconnection.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jan 24 11:04:48 2017\n\n@author: gradlab\n\"\"\"\n\n\nimport socket\nimport time\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport cv2\n\n#specify the ip address , the port is always same\nUDP_IP = \"169.254.185.14\"\nUDP_PORT = 30444\n\nsock = socket.sock... | [
[
"numpy.max",
"numpy.uint8",
"numpy.reshape",
"numpy.zeros",
"numpy.min"
]
] |
mzakharocsc/tensorflow | [
"cfdfcc311c10eacad1c9a6506c53987372b132f3"
] | [
"tensorflow/contrib/distribute/python/mirrored_strategy_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.framework.ops.device",
"tensorflow.python.eager.context.graph_mode",
"tensorflow.contrib.distribute.python.mirrored_strategy.MirroredStrategy",
"tensorflow.python.framework.constant_op.constant",
"tensorflow.python.training.distribution_strategy_context.get_replica_context",... |
Kill-The-Bug/Python | [
"7cd0b1c9d7af3dab5c95a67a77e4b469cb1a990b"
] | [
"OpenCvMouseControl/main.py"
] | [
"import cv2\nimport numpy as np\nimport math\nimport time\nimport pyautogui\n\n\npyautogui.FAILSAFE = False\nSCREEN_X, SCREEN_Y = pyautogui.size()\nCLICK = CLICK_MESSAGE = MOVEMENT_START = None\n\n\ncap = cv2.VideoCapture(0)\n\nwhile cap.isOpened():\n ret, img = cap.read()\n CAMERA_X, CAMERA_Y, channels = img... | [
[
"numpy.zeros"
]
] |
KongCDY/baselines_pytorch | [
"26c1a9e7829aad88eb725f79c401fe9d108803bf"
] | [
"ptbaselines/algos/ppo2/runner.py"
] | [
"import numpy as np\nfrom ptbaselines.algos.common.runners import AbstractEnvRunner\nfrom ptbaselines.algos.common import torch_utils\n\nclass Runner(AbstractEnvRunner):\n \"\"\"\n We use this object to make a mini batch of experiences\n __init__:\n - Initialize the runner\n\n run():\n - Make a mi... | [
[
"numpy.zeros_like",
"numpy.asarray"
]
] |
OlafHaag/joint-localization | [
"32d4e91ab813809a8f424bfe8c82e203bb215625"
] | [
"joint_localization/stsc.py"
] | [
"\"\"\"\nZelnik-Manor, L., & Perona, P. (2005). Self-tuning spectral clustering.\nIn Advances in neural information processing systems (pp. 1601-1608).\nOriginal Paper: https://papers.nips.cc/paper/2619-self-tuning-spectral-clustering.pdf\n\"\"\"\nfrom itertools import groupby\n\nimport numpy as np\nfrom functools ... | [
[
"numpy.sin",
"numpy.zeros",
"scipy.linalg.eigh",
"numpy.sum",
"numpy.choose",
"numpy.eye",
"scipy.linalg.sqrtm",
"numpy.argmax",
"numpy.cos",
"scipy.optimize.minimize",
"numpy.tril"
]
] |
plandes/dltools | [
"925f02200c62a7dc798e474ed94a86e009fd1ebf"
] | [
"test/python/mnist/stash.py"
] | [
"from typing import Tuple, Iterable, Dict, Set\nfrom dataclasses import dataclass\nimport logging\nimport collections\nfrom pathlib import Path\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data.sampler import SubsetRandomSampler\nfrom torchvision import datasets, tran... | [
[
"torch.utils.data.sampler.SubsetRandomSampler",
"torch.utils.data.DataLoader",
"numpy.random.shuffle",
"numpy.floor"
]
] |
changhoonhahn/feasiBGS | [
"63975b1e60f6f93f3b5020ee51ca565f325b918d",
"b5f535f12cf64babc9e25bcec75edd45d8668f74"
] | [
"feasibgs/skymodel.py",
"run/survey_sim/survey_sim.py"
] | [
"'''\n'''\nimport os \nimport pickle\nimport numpy as np \nimport pandas as pd \nfrom scipy.interpolate import interp1d\nfrom itertools import chain, combinations_with_replacement\n# -- astropy --\nimport astropy.units as u\nfrom astropy.time import Time\n# -- specsim -- \nimport specsim\nfrom specsim.atmosphere im... | [
[
"numpy.array",
"scipy.interpolate.interp1d",
"numpy.arccos",
"pandas.DataFrame.from_csv",
"numpy.asarray",
"numpy.zeros",
"numpy.dot",
"numpy.sum",
"numpy.rint",
"numpy.sin",
"numpy.log",
"numpy.exp",
"numpy.any",
"numpy.abs",
"numpy.cos",
"numpy.lin... |
Coldog2333/DGMN-pytorch | [
"c34248afca516625c2ac2fc6d6f4ce8fe2988c99"
] | [
"data_provider/data_provider_cmudog.py"
] | [
"import logging\nimport os\nimport numpy as np\nfrom tqdm import tqdm\nimport argparse\nfrom pprint import pprint, pformat\nimport time\nimport logging\nimport nltk\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\n\nfrom data_provider.utils import GloveTokenizer\nfrom config_file import *\n\n\nclass... | [
[
"torch.save",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.load"
]
] |
karanchawla/ai_for_robotics | [
"03bb66bae99bac3acd79bc1ec6d3b9c0eeabcdf8"
] | [
"1_0_probability_ml_basics/solution/sampling/SamplePdf.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport scipy.optimize\n\n\nclass SamplePdf():\n\n k = 0 # number of samples\n uni_sample = np.array([]) # array containing the uniform samples\n pdf_sample = np.array([]) # array containing the new samples of the pdf\n\n # function that is called by the r... | [
[
"numpy.array",
"numpy.delete",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.arctan2",
"matplotlib.pyplot.show"
]
] |
chandar-lab/CriticalGradientOptimization | [
"1af4b1df40489991289bb50bb69859a00b2c97c6",
"1af4b1df40489991289bb50bb69859a00b2c97c6"
] | [
"experiments/multiwoz_lstm/utils/db_pointer.py",
"experiments/snli/infersent_comp/encoder/models.py"
] | [
"import sqlite3\n\nimport numpy as np\n\nfrom nlp import normalize\n\n# loading databases\ndomains = ['restaurant', 'hotel', 'attraction', 'train', 'taxi',\n 'hospital'] # , 'police']\ndbs = {}\nfor domain in domains:\n db = 'db/{}-dbase.db'.format(domain)\n conn = sqlite3.connect(db)\n c = conn... | [
[
"numpy.array"
],
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LSTM",
"torch.nn.GRU",
"torch.LongTensor",
"numpy.sort",
"torch.nn.utils.rnn.pack_padded_sequence",
"matplotlib.pyplot.bar",
"numpy.fromstring",
"matplotlib.pyplot.xticks",
"torch.sum",
"torch.nn.S... |
loveorchids/deformable_detection | [
"b15e7fb2dd5248c6e6d6bc7febcf4c9fb66011c6"
] | [
"dd_model.py"
] | [
"import torch, sys, os, math\nsys.path.append(os.path.expanduser(\"~/Documents\"))\nimport torch.nn as nn\nfrom torch.autograd import Function\nimport numpy as np\nfrom torchvision.models import vgg16_bn\nimport omni_torch.networks.blocks as omth_blocks\nimport init\nfrom dd_utils import *\nfrom dd_model_cfg import... | [
[
"torch.zeros",
"torch.cat",
"torch.nn.Softmax",
"torch.nn.ModuleList",
"torch.nn.ModuleDict",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.Conv2d",
"torch.Tensor",
"torch.randn"
]
] |
solarfresh/solartf | [
"69a5f2ed9990f71e7e19054c4e6e1206396f24e3"
] | [
"solartf/core/metric.py"
] | [
"import tensorflow as tf\nfrom solartf.data.bbox.type import BBoxesTensor\nfrom .util import tf_bbox_intersection\n\n\nclass IoUFamilyMetric:\n def __init__(self, coord='corner'):\n if coord == 'iou':\n self.coord = 'corner'\n else:\n self.coord = coord\n\n def tf_iou(self,... | [
[
"tensorflow.boolean_mask",
"tensorflow.reduce_sum",
"tensorflow.keras.backend.epsilon"
]
] |
viv92/wildML_RLimplementations | [
"06681b1e680f43634fae209341de1d2dffc87d48"
] | [
"DQN/DQN_givenSolution.py"
] | [
"import gym\nfrom gym.wrappers import Monitor\nimport itertools\nimport numpy as np\nimport os\nimport random\nimport sys\nimport psutil\nimport tensorflow as tf\n\nif \"../\" not in sys.path:\n sys.path.append(\"../\")\n\nfrom lib import plotting\nfrom collections import deque, namedtuple\n\nenv = gym.envs.make(\... | [
[
"tensorflow.get_default_session",
"tensorflow.contrib.layers.fully_connected",
"tensorflow.contrib.layers.conv2d",
"tensorflow.image.crop_to_bounding_box",
"tensorflow.reshape",
"numpy.invert",
"tensorflow.to_float",
"tensorflow.contrib.layers.flatten",
"tensorflow.global_varia... |
YCaptain/MapWorld-pred | [
"12f35cd0744cabe1303321e0256b17967fe43da9",
"12f35cd0744cabe1303321e0256b17967fe43da9"
] | [
"src/utils/cycgan/util.py",
"test/SegOptRoadTest.py"
] | [
"\"\"\"This module contains simple helper functions \"\"\"\r\nfrom __future__ import print_function\r\nimport torch\r\nimport numpy as np\r\nfrom PIL import Image\r\nimport os\r\n\r\n\r\ndef tensor2im(input_image, imtype=np.uint8):\r\n \"\"\"\"Converts a Tensor array into a numpy image array.\r\n\r\n Paramete... | [
[
"numpy.max",
"numpy.median",
"numpy.tile",
"numpy.min",
"numpy.mean",
"torch.abs",
"numpy.std",
"numpy.transpose"
],
[
"numpy.zeros"
]
] |
Pawel-M/EZ-Coach | [
"ee078b8ab7409730e99cb38653d03aa574ab914b"
] | [
"examples/simple_learning.py"
] | [
"import abc\nimport pickle\nimport random\nfrom collections import defaultdict, namedtuple\nfrom typing import Iterable, Tuple\n\nimport numpy as np\n\nimport ezcoach.agent\nfrom ezcoach.enviroment import Manifest\nfrom ezcoach.value import IntList, IntValue\n\nimport tensorflow\nimport tensorflow.keras as kr\n\n\n... | [
[
"numpy.max",
"numpy.ones",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Model",
"tensorflow.keras.Input",
"tensorflow.keras.optimizers.Adam",
"numpy.vstack"
]
] |
gfzriesgos/shakyground-lfs | [
"2caf67cc32e6800286eded2df1efb05973ccf41b"
] | [
"openquake/hazardlib/tests/gsim/raghukanth_iyengar_2007_test.py"
] | [
"# The Hazard Library\n# Copyright (C) 2012-2018 GEM Foundation\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU Affero General Public License as\n# published by the Free Software Foundation, either version 3 of the\n# License, or (at your option) any later... | [
[
"numpy.array",
"numpy.isnan"
]
] |
jvallesf/triton-inference-server | [
"32a7a6f6e8323ee55953ef9e81b76c4d9198eed7"
] | [
"src/clients/python/experimental_api_v2/library/grpcclient.py"
] | [
"# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n# notice, this list of c... | [
[
"numpy.resize",
"numpy.array"
]
] |
HendrikHuelsbusch/pymer4 | [
"ab8e28489c467813e1c3703c46f392a29668b6f0"
] | [
"pymer4/tests/test_simulate.py"
] | [
"from __future__ import division\nimport numpy as np\nfrom pymer4.models import Lm, Lmer\nfrom pymer4.simulate import simulate_lm, simulate_lmm\n\n\ndef test_simulate_lm():\n\n # Simulate some data\n num_obs = 500\n num_coef = 3\n coef_vals = [10, 2.2, -4.1, 3]\n mus = [10., 3., 2.]\n corrs = .1\n... | [
[
"numpy.allclose",
"numpy.triu_indices",
"numpy.abs"
]
] |
ahzeeshan/samos | [
"c7c615d7f7bf4e78b570eabf487996d43a353909"
] | [
"samos/plotting/plot_xsf.py"
] | [
"#!/usr/bin/env python\nfrom mayavi import mlab\nimport sys, numpy as np, re\nfrom ase.data.colors import jmol_colors\nfrom ase.data import atomic_numbers, covalent_radii, chemical_symbols\nfrom ase import Atoms\nfrom tvtk.api import tvtk\n\nfrom ase.visualize.mlab import plot\n\nfrom aiida_scripts.charges.io_xsf i... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"numpy.isnan",
"numpy.zeros",
"numpy.log",
"numpy.sqrt",
"numpy.log10"
]
] |
dthierry/princetonDacLti | [
"135f1665d1ed09ef11af8559f14ff4665efbc723"
] | [
"src/utils/pyplot_df_vAir.py"
] | [
"#!/usr/bin/env python3\n\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport sys\n#: By David Thierry @ 2021\n#: Take into account the Air\ndef main():\n # Dac-flue bars\n df = pd.read_csv(\"../mods/df_dac_flue.csv\")\n labels = [r\"Frsh\", r\"Sat\", r\"Abs-0\", r\"Abs-1\", r\"Abs-2\", r\"Reg-0\... | [
[
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots"
]
] |
ImbesatRizvi/Accio | [
"b0ad2d245f4f7c42d85b722db9fad435c0d06a99"
] | [
"deep_learn/eval_utils.py"
] | [
"import torch\nfrom .dataset.tensor_utils import MultiLabelUnMarginLossify\n\ndef multiclass_accuracy(output, target, decimal_precision=2):\n \"Computes the accuracy for the given output against target\"\n with torch.no_grad():\n # get the index having the maximum output value\n _, predicted = o... | [
[
"torch.no_grad",
"torch.mean",
"torch.sum"
]
] |
msteffen/seldon-core | [
"8aaa104de8c6e2a8138632022265271ec070ad1f"
] | [
"testing/scripts/test_tags.py"
] | [
"import json\nimport logging\nimport time\nfrom subprocess import run\n\nimport numpy as np\nimport pytest\nfrom google.protobuf import json_format\n\nfrom seldon_e2e_utils import (\n API_AMBASSADOR,\n grpc_request_ambassador,\n initial_grpc_request,\n initial_rest_request,\n rest_request_ambassador,... | [
[
"numpy.array"
]
] |
jacobmanalo/dmrg_tool | [
"8a14b7f33b77f53df4356f090bdcd1a82b12ff20"
] | [
"pymps/autoMPO.py"
] | [
"import numpy as np\nimport tensornetwork as tn\nimport itertools as itt\nfrom scipy import linalg as la\nimport scipy as SP\nfrom tensornetwork.tensor import Tensor\n\n\nclass LocalOperator:\n \"\"\"A simple class to define auxiliary operators that support multiplication and addition,\n based on the rule... | [
[
"numpy.array",
"numpy.matmul",
"numpy.zeros"
]
] |
lorynebissuel/models | [
"7f597cf851c793ce1b8db7a93a94894b04424d4c"
] | [
"official/nlp/modeling/layers/position_embedding.py"
] | [
"# Copyright 2019 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.range",
"tensorflow.expand_dims",
"tensorflow.cos",
"tensorflow.sin",
"tensorflow.cast",
"tensorflow.keras.utils.register_keras_serializable"
]
] |
Mindee/doctr | [
"b9d8feb1b4a2206e4944ef2dea109acc19585074"
] | [
"doctr/datasets/funsd.py"
] | [
"# Copyright (C) 2021, Mindee.\n\n# This program is licensed under the Apache License version 2.\n# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.\n\nimport json\nimport os\nfrom pathlib import Path\nfrom typing import Any, Dict, List, Tuple\n\nimport numpy as np\n\... | [
[
"numpy.asarray"
]
] |
Pandinosaurus/pyrobolearn | [
"9cd7c060723fda7d2779fa255ac998c2c82b8436",
"9cd7c060723fda7d2779fa255ac998c2c82b8436",
"9cd7c060723fda7d2779fa255ac998c2c82b8436",
"9cd7c060723fda7d2779fa255ac998c2c82b8436",
"9cd7c060723fda7d2779fa255ac998c2c82b8436",
"9cd7c060723fda7d2779fa255ac998c2c82b8436"
] | [
"pyrobolearn/models/promp/rhythmic_promp.py",
"pyrobolearn/models/dmp/dmpytorch/rhythmic_dmp.py",
"pyrobolearn/robots/rrbot.py",
"pyrobolearn/models/model.py",
"pyrobolearn/losses/losses.py",
"pyrobolearn/models/dmp/discrete_dmp.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Provides the discrete ProMP.\n\nReferences\n - [1] \"Probabilistic Movement Primitives\", Paraschos et al., 2013\n - [2] \"Using Probabilistic Movement Primitives in Robotics\", Paraschos et al., 2018\n\"\"\"\n\nimport numpy as np\n\nfrom pyrobolearn.mode... | [
[
"numpy.sin",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.suptitle",
"matplotlib.pyplot.figure",
"numpy.cos",
"numpy.dstack",
"matplotlib.pyplot.show",
"numpy.linspace",
"matplotlib.pyplot.subplot"
],
[
"torch.isnan",
"numpy.zeros",
... |
josephwillard/symbolic-pymc | [
"7bef08dd572c3ddc32ddc8e8e3c0b1809b4ce654"
] | [
"tests/tensorflow/test_printing.py"
] | [
"import io\nimport textwrap\n\nimport pytest\nimport numpy as np\nimport tensorflow as tf\n\nfrom contextlib import redirect_stdout\n\nfrom unification import var, Var\n\nfrom symbolic_pymc.tensorflow.meta import mt\nfrom symbolic_pymc.tensorflow.printing import tf_dprint\n\nfrom tests.tensorflow import run_in_grap... | [
[
"tensorflow.compat.v1.placeholder",
"tensorflow.convert_to_tensor",
"tensorflow.multiply",
"numpy.random.seed",
"tensorflow.Graph",
"tensorflow.TensorShape",
"numpy.random.randn",
"numpy.ones",
"tensorflow.executing_eagerly",
"numpy.arange",
"tensorflow.add"
]
] |
ZPedroP/ASAPPpy | [
"57640298215270bd7282ec70a3e5269e6c7b5091",
"57640298215270bd7282ec70a3e5269e6c7b5091"
] | [
"ASAPPpy/classifiers/svm_restantes_classes.py",
"ASAPPpy/classifiers/svm.py"
] | [
"import keras as k\nimport pandas as pd\nimport cufflinks as cf\nfrom sklearn.model_selection import train_test_split\nfrom keras import Sequential\nfrom keras.layers import Embedding\nfrom keras.layers import Dense,SpatialDropout1D\nfrom keras.preprocessing.text import Tokenizer\nfrom keras.preprocessing.sequence... | [
[
"sklearn.svm.SVC",
"sklearn.metrics.classification_report",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
],
[
"sklearn.svm.SVC",
"sklearn.metrics.classification_report",
"sklearn.feature_extraction.text.TfidfVe... |
SofiaBadini/estimagic | [
"ff4948dc4175cd690b3a021969c6119a6a619f96"
] | [
"estimagic/decorators.py"
] | [
"\"\"\"This module contains various decorators.\n\nThere are two kinds of decorators defined in this module which consists of either two or\nthree nested functions. The former are decorators without and the latter with arguments.\n\nFor more information on decorators, see this `guide`_ on https://realpython.com whi... | [
[
"pandas.DataFrame",
"numpy.linalg.norm",
"numpy.isscalar"
]
] |
yzz127/BigDL | [
"5c7ded98ff091694ddf61a5f3952a814d22c7616"
] | [
"python/nano/test/ray/_train_torch_lightning.py"
] | [
"#\n# Copyright 2016 The BigDL Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law ... | [
[
"torch.utils.data.Subset",
"torch.utils.data.DataLoader",
"torch.eq"
]
] |
cedricxie/l5kit | [
"d21644e20f642c5160fee24028dc34d5abb4bf4e"
] | [
"l5kit/l5kit/rasterization/satellite_rasterizer.py"
] | [
"from typing import List, Optional, Tuple\n\nimport cv2\nimport numpy as np\n\nfrom ..geometry import rotation33_as_yaw, transform_point, world_to_image_pixels_matrix\nfrom .rasterizer import Rasterizer\nfrom .satellite_image import get_sat_image_crop_scaled\n\n\nclass SatelliteRasterizer(Rasterizer):\n \"\"\"Th... | [
[
"numpy.linalg.norm",
"numpy.linalg.inv",
"numpy.asarray",
"numpy.append"
]
] |
pk-ai/training | [
"86b0d6c74853565eab08e76054ce96083ebfd45e"
] | [
"machine-learning/coursera_exercises/ex2/in_python/exercises/advOptimize.py"
] | [
"import numpy as np\nimport scipy.optimize as op\n\ndef Sigmoid(z):\n return 1/(1 + np.exp(-z))\n\ndef Gradient(theta,x,y):\n m , n = x.shape\n theta = theta.reshape((n,1))\n y = y.reshape((m,1))\n sigmoid_x_theta = Sigmoid(x.dot(theta))\n grad = ((x.T).dot(sigmoid_x_theta-y))/m\n return grad.f... | [
[
"numpy.sum",
"scipy.optimize.minimize",
"numpy.exp"
]
] |
opjakhar/Youtube8M_mutlilabel_video_classifcation_BOS_Kaggle | [
"699bfb41fc4e0abe704260a57d21779a44ec1a75"
] | [
"video_level_models.py"
] | [
"# Copyright 2017 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 app... | [
[
"tensorflow.reduce_sum",
"tensorflow.contrib.slim.l2_regularizer",
"tensorflow.flags.DEFINE_integer",
"tensorflow.reshape"
]
] |
daniele-sartiano/biaffine-parser | [
"b2fd6872ba6f5cf15f98662dc966f1f05927c944"
] | [
"parser/utils/field.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom collections import Counter\nfrom parser.utils.fn import pad\nfrom parser.utils.vocab import Vocab\n\nimport torch\nimport sys\n\nclass RawField(object):\n\n def __init__(self, name, fn=None):\n super(RawField, self).__init__()\n\n self.name = name\n self.fn =... | [
[
"torch.std",
"torch.tensor"
]
] |
Joey61Liuyi/Early-Bird-Tickets | [
"7bb23243bc4343519d58d828f0d3254e80c5fedd"
] | [
"score_prove.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2021/12/26 22:22\n# @Author : LIU YI\n\nimport argparse\nimport random\n\nimport numpy as np\nimport os\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torchvision import datasets, transforms\nimport wandb\n# from models import *\nimport mode... | [
[
"torch.zeros",
"numpy.linalg.slogdet",
"numpy.zeros",
"numpy.mean",
"torch.ones",
"torch.cuda.set_device",
"numpy.resize",
"torch.cuda.is_available",
"torch.load",
"torch.ones_like",
"torch.clone",
"torch.sort",
"torch.nn.DataParallel",
"torch.sum"
]
] |
Zeo95/BasicSR | [
"0e55b20c2a88428961eceb28dd87558b038c4322"
] | [
"basicsr/train.py"
] | [
"import datetime\nimport logging\nimport math\nimport time\nimport torch\nfrom os import path as osp\n\nfrom basicsr.data import build_dataloader, build_dataset\nfrom basicsr.data.data_sampler import EnlargedSampler\nfrom basicsr.data.prefetch_dataloader import CPUPrefetcher, CUDAPrefetcher\nfrom basicsr.models imp... | [
[
"torch.cuda.current_device"
]
] |
McMasterAI/POST_study_Project | [
"b30abf405e0ee491445d8566db2e2306c67b04bc"
] | [
"notebooks/pandas_rowExtraction.py"
] | [
"import pandas as pd\nimport sys\nimport argparse\n\ndf = pd.read_csv('C:/Users/aidan/Downloads/dta_file_converted.csv', low_memory=False)\n\n# pd.set_option(\"display.max_rows\", None, \"display.max_columns\", None)\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--rownum\")\nparser.add_argument(\"--p... | [
[
"pandas.read_csv"
]
] |
xrachitx/audioRecordJS | [
"bc16d736a4ccb613b8032b927cea48b2a7185447"
] | [
"public/code/spec_augment.py"
] | [
"# Copyright 2019 RnD at Spoon Radio\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 ... | [
[
"matplotlib.use",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"numpy.random.uniform",
"torch.tensor",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.show"
]
] |
sfantao/deepppl | [
"3091c342814744d622eda6f7a185085d420a152b"
] | [
"deepppl/tests/inference/test_kmeans.py"
] | [
"from .harness import MCMCTest\nfrom pprint import pprint\nfrom sklearn.datasets import make_blobs\n\ndef test_kmeans():\n data = {}\n data['N'] = 6\n data['D'] = 2\n data['K'] = 3\n \n X, _ = make_blobs(n_samples=data['N'], random_state=170)\n \n data['y'] = X\n \n t_kmeans = MCMCTest... | [
[
"sklearn.datasets.make_blobs"
]
] |
tallamjr/numpyro | [
"a4567a8759eb71b7afdf9886bc077e44c72d00f6"
] | [
"numpyro/infer/autoguide.py"
] | [
"# Copyright Contributors to the Pyro project.\n# SPDX-License-Identifier: Apache-2.0\n\n# Adapted from pyro.infer.autoguide\nfrom abc import ABC, abstractmethod\nfrom contextlib import ExitStack\nfrom functools import partial\nimport warnings\n\nimport numpy as np\n\nimport jax\nfrom jax import grad, hessian, lax,... | [
[
"numpy.prod",
"numpy.isnan"
]
] |
d909b/extd_med_benchmark | [
"254667c292f3eb9b702b57f2dd5a87c1b954cc67"
] | [
"GAN_cpd/metrics/sliced_wasserstein.py"
] | [
"# Copyright 2018, Tero Karras, NVIDIA CORPORATION\n#\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# This work is licensed under the Creative Commons Attribution-NonCommercial\n# 4.0 International License. To view a copy of this license, visit\n# http://creativecommons.org/licenses/by-nc/4.0/... | [
[
"numpy.concatenate",
"numpy.square",
"numpy.matmul",
"numpy.zeros",
"numpy.round",
"numpy.random.randn",
"numpy.mean",
"numpy.std",
"numpy.float32",
"numpy.random.randint",
"numpy.sort",
"numpy.abs"
]
] |
shivdhar/pytorch-lightning | [
"e4f7223c6384a65520c958f64b02db1952c61430"
] | [
"pytorch_lightning/metrics/functional/classification.py"
] | [
"from functools import wraps\nfrom typing import Callable, Optional, Sequence, Tuple\n\nimport torch\nfrom torch.nn import functional as F\n\nfrom pytorch_lightning.metrics.functional.reduction import reduce\nfrom pytorch_lightning.utilities import FLOAT16_EPSILON, rank_zero_warn\n\n\ndef to_onehot(\n tensor... | [
[
"torch.zeros",
"torch.bincount",
"torch.cat",
"torch.trapz",
"torch.argsort",
"torch.ones",
"torch.sum",
"torch.tensor",
"torch.ones_like",
"torch.is_nonzero",
"torch.argmax",
"torch.where",
"torch.cumsum"
]
] |
vibwipro/Machine-Learning-Python | [
"a5e2ef30db0c7825ab910d802795e82b4b5fc49c"
] | [
"Panda/Panda_group_By.py"
] | [
"\r\nimport pandas as pd\r\ndf = pd.read_csv(\"Data/weather_by_cities.csv\")\r\n\r\ng = df.groupby(\"city\")\r\n\r\nfor city, data in g:\r\n print(\"city:\",city)\r\n print(\"\\n\")\r\n print(\"data:\",data)\r\n\r\n\r\n\r\n############ This is similar to SQL,\r\n########### SELECT * from weather_data GRO... | [
[
"pandas.read_csv"
]
] |
akprasadan/summer2021ML | [
"c75ea5dd8522236a7217c0c5239789686b5b9672",
"c75ea5dd8522236a7217c0c5239789686b5b9672"
] | [
"src/classification/qda.py",
"tests/test_qda.py"
] | [
"'''This module builds a class for k-nearest neighbor classification.\n'''\n\nimport numpy as np\nfrom numpy.lib.shape_base import split\nfrom src.classification.classification import Classification\nfrom src.helperfunctions.evaluation_metrics import evaluate_accuracy, confusion_matrix\n\nclass QDA(Classification):... | [
[
"numpy.max",
"numpy.count_nonzero",
"numpy.linalg.det",
"numpy.mean",
"numpy.apply_along_axis",
"numpy.linalg.inv"
],
[
"numpy.array",
"numpy.random.rand",
"numpy.cov",
"numpy.sum",
"numpy.mean",
"sklearn.discriminant_analysis.QuadraticDiscriminantAnalysis",
... |
timdelbruegger/freecopter | [
"0d7023ba0fdbdfe2609b49e86bf2545fb4c8b2da"
] | [
"src/python3/sensorfusion/fusion_master_test.py"
] | [
"import unittest\r\nfrom sensorfusion.height_provider import HeightProvider, correct_ultrasonic_angle\r\nimport time\r\nimport numpy as np\r\n\r\nfrom sensorfusion.fusion_master import SensorFusionMaster\r\nimport logging\r\n\r\n\r\nclass TestFusionMaster(unittest.TestCase):\r\n\r\n \"\"\"\r\n Test to manuall... | [
[
"numpy.set_printoptions"
]
] |
hkimaf/unixmd | [
"616634c720d0589fd600e3268afab9da957e18bb"
] | [
"util/statistical_analysis.py"
] | [
"import argparse\nimport os\nimport numpy as np\n\ndef statistical_analysis():\n \"\"\" Python utility script for PyUNIxMD output analysis\n In this script, PyUNIxMD output files are post-process into organized analysis data\n It includes BO population analysis, electron coherence analysis, nacme a... | [
[
"numpy.multiply",
"numpy.array",
"numpy.zeros"
]
] |
torchOnVideo/torchOnVideo | [
"aa07d5661f772eca027ecc6b79e14bd68a515aa1"
] | [
"torchOnVideo/frame_interpolation/adacof/train_model.py"
] | [
"import torch\nimport torch.optim as optim\nimport torch.optim.lr_scheduler as lr_scheduler\nfrom torch.utils.data import DataLoader\nimport os\n\nfrom .adacof import AdaCoF\nfrom ..models import AdaCoFNet\nfrom torchOnVideo.losses import AdaCoF_loss\nfrom torchOnVideo.datasets.Vimeo90KTriplet.frame_interpolation i... | [
[
"torch.optim.lr_scheduler.StepLR",
"torch.utils.data.DataLoader",
"torch.load"
]
] |
DFX184/manifold_learning | [
"1f0cb1f2aea19769e7a4825dec4dcdb47900166c"
] | [
"isomap.py"
] | [
"import warnings\r\nfrom mds import *\r\nimport numpy as np\r\nfrom utils import *\r\nimport matplotlib.pyplot as plt\r\n\r\nclass NotExistPath(UserWarning):\r\n pass\r\n\r\n\r\nclass IsoMap:\r\n def __init__(self,\r\n n_dim=2,\r\n n_neighbors=None,\r\n epsilon=... | [
[
"numpy.zeros",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"sklearn.datasets.make_swiss_roll",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot"
]
] |
shenzhongqiang/cnstock_py | [
"2bb557657a646acb9d20d3ce78e15cf68390f8ea"
] | [
"jobs/get_tonghuashun.py"
] | [
"import os\nimport re\nfrom lxml import etree\nfrom selenium import webdriver\nimport requests\nimport pandas as pd\nfrom stock.utils.symbol_util import symbol_to_exsymbol\nfrom stock.globalvar import BASIC_DIR\n\n\nheaders = {\"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, li... | [
[
"pandas.DataFrame"
]
] |
thaihungle/MAED | [
"25d6497f200dc9b190846de24189b69cffead47d"
] | [
"nlp_task/metrics.py"
] | [
"from sklearn.metrics import roc_auc_score, f1_score, hamming_loss\nimport numpy as np\n\ndef set_score_pre(input_batch, target_batch, predict_batch, str2tok):\n s = []\n s2 = []\n for b in range(target_batch.shape[0]):\n trim_target = []\n trim_predict = []\n for t in target_batch[b]:... | [
[
"numpy.random.rand",
"numpy.zeros",
"sklearn.metrics.hamming_loss",
"numpy.mean",
"sklearn.metrics.f1_score",
"sklearn.metrics.roc_auc_score"
]
] |
mmabrouk/detectron2 | [
"158e395acdb8ca6ed6d488b43475f9ef9d200405",
"158e395acdb8ca6ed6d488b43475f9ef9d200405"
] | [
"projects/DensePose/tests/test_image_list_dataset.py",
"tests/structures/test_masks.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport contextlib\nimport os\nimport tempfile\nimport unittest\nimport torch\nfrom torchvision.utils import save_image\n\nfrom densepose.data.image_list_dataset import ImageListDataset\nfrom densepose.data.transform import ImageResizeTransform\n\n\n@contextlib.... | [
[
"torch.Size",
"torch.rand"
],
[
"torch.zeros",
"torch.all",
"torch.tensor",
"torch.ones"
]
] |
az508/Trajectory-based-Nonoverlapping-calibration | [
"ab4a442634185cfd06f3635ca2665f3247b93778"
] | [
"nonoverlapcalibrationnpversion.py"
] | [
"\"\"\" Neural Network.\n\nA 2-Hidden Layers Fully Connected Neural Network (a.k.a Multilayer Perceptron)\nimplementation with TensorFlow. This example is using the MNIST database\nof handwritten digits (http://yann.lecun.com/exdb/mnist/).\n\nLinks:\n [MNIST Dataset](http://yann.lecun.com/exdb/mnist/).\n\nAuthor... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"numpy.zeros",
"numpy.linalg.inv",
"matplotlib.pyplot.plot",
"numpy.eye",
"numpy.float32",
"numpy.linalg.lstsq",
"numpy.linalg.svd",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca",
"numpy.diag",
"numpy.vsta... |
Vitonka/image-captioning | [
"f1e0d08ba3b621ab77bade91065e36c0d4d2ccca"
] | [
"src/beam_search.py"
] | [
"import torch\nfrom utils.text_utils import START, END\n\n\ndef beam_search(\n model, model_type, image,\n w2i, i2w,\n device, max_length=15, beam_size=1, data_mode='packed'):\n if model_type == 'rnn':\n beam_func = beam_search_rnn\n elif model_type == 'lstm':\n beam_func = ... | [
[
"torch.cat",
"torch.nn.utils.rnn.pack_sequence",
"torch.stack",
"torch.nn.Softmax",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.tensor",
"torch.mean"
]
] |
pjmark/NIMPA | [
"c29baf885535c83e242a95892ca5b022b865163b"
] | [
"niftypet/nimpa/prc/imio.py"
] | [
"\"\"\"image input/output functionalities.\"\"\"\nimport datetime\nimport logging\nimport numbers\nimport os\nimport pathlib\nimport re\nimport shutil\nfrom subprocess import run\nfrom textwrap import dedent\n\nimport nibabel as nib\nimport numpy as np\nimport pydicom as dcm\nfrom miutil.imio.nii import array2nii ... | [
[
"numpy.array",
"numpy.int8",
"numpy.array_equal",
"numpy.isnan",
"numpy.zeros",
"numpy.log",
"numpy.sum",
"numpy.ones",
"numpy.transpose",
"numpy.argsort",
"numpy.squeeze",
"numpy.asanyarray"
]
] |
SODALITE-EU/refactoring-ml | [
"a869a51d4a50c74df5ad2c820da4e401a04d189f"
] | [
"forecast-api/app.py"
] | [
"import pandas as pd\nfrom flask import Flask, json, request, Response\n\nimport timeseries.arima_grid as armia\nimport timeseries.var_multi as var_multi\nfrom regression import linear\n\napp = Flask(__name__)\napp.config[\"DEBUG\"] = True\n\n\n@app.route('/forecast-api/<model>/forecast/<x>', methods=['POST'])\ndef... | [
[
"pandas.Series"
]
] |
lynx-delta/adapted_u-net_dense_crfs | [
"215ea62b64757e55ab54bce2da2db323f836d892"
] | [
"netw_postprocess.py"
] | [
"\r\nimport numpy as np\r\nimport pydensecrf.densecrf as dcrf\r\nfrom pydensecrf.utils import unary_from_softmax\r\nfrom pydensecrf.utils import create_pairwise_bilateral, create_pairwise_gaussian\r\n\r\n\r\ndef pp_denseCRF(imag, y_pred,\r\n pairwise_gauss=True, pairwise_bilateral=True,\r\n ... | [
[
"numpy.moveaxis",
"numpy.reshape"
]
] |
He-jerry/Xenoblade2-Detection | [
"fd72708c0c20bf5e953fbcb972d338904e8ee248"
] | [
"RetinaNet/detect_video.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport logging\nimport os\nimport sys\nimport time\n\nimport torch\nimport torchvision.transforms as transforms\n\nfrom PIL import Image\nfrom utils.config impo... | [
[
"torch.autograd.Variable",
"torch.cuda.is_available",
"numpy.random.randint"
]
] |
emirkmo/astropy | [
"d96cd45b25ae55117d1bcc9c40e83a82037fc815",
"d96cd45b25ae55117d1bcc9c40e83a82037fc815",
"d96cd45b25ae55117d1bcc9c40e83a82037fc815"
] | [
"astropy/table/tests/test_pprint.py",
"astropy/utils/iers/tests/test_leap_second.py",
"astropy/visualization/mpl_normalize.py"
] | [
"# This Python file uses the following encoding: utf-8\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n\nimport pytest\nimport numpy as np\nfrom io import StringIO\n\nfrom astropy import table\nfrom astropy.io import ascii\nfrom astropy.table import Table, QTable\nfrom astropy.table.table_helper... | [
[
"numpy.array",
"numpy.arange"
],
[
"numpy.all",
"numpy.array",
"numpy.testing.assert_array_equal"
],
[
"numpy.array",
"numpy.true_divide",
"numpy.subtract",
"numpy.ma.array",
"numpy.isscalar",
"numpy.isfinite",
"numpy.clip",
"matplotlib.pyplot.imshow"
... |
pangolin93/DeepGrabCut-PyTorch | [
"203efe849948df1ea7367af58980f6f66f0b1a8f"
] | [
"launch_deepgc.py"
] | [
"import cv2\nimport numpy as np\nimport os\nimport torch\n\n\nfrom torch.nn.functional import upsample\nfrom dataloaders import utils\nimport networks.deeplab_resnet as resnet\n\nfrom glob import glob\nfrom copy import deepcopy\nfrom bwsss import DATA_DIR, DEVICE, OUTPUT_DIR\n\nfrom matplotlib import pyplot as plt\... | [
[
"numpy.concatenate",
"torch.device",
"numpy.zeros_like",
"torch.nn.functional.upsample",
"numpy.zeros",
"matplotlib.pyplot.savefig",
"numpy.ones",
"numpy.exp",
"torch.cuda.is_available",
"numpy.squeeze",
"numpy.expand_dims"
]
] |
hangqiu/MLEXray | [
"23d0ff7cd39854bbd8fcc8e050bb3c1787edb056"
] | [
"edgeml/python/src/MLEXray/TFLite_Viewer.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport seaborn as sns\nimport pandas as pd\n\n# Output of the TFLite model.\ntflite_model = \"model/imagenet_mobilenet_v2_100_224_converted_tflite/mobilenet_v2_100_imagenet_quant_224.tflite\"\ninterpreter = tf.lite.Interpreter(model_path=tflite_model)\ninterpreter.alloc... | [
[
"pandas.DataFrame",
"tensorflow.lite.Interpreter",
"pandas.set_option"
]
] |
JosieHong/Handwritten-digit-recognition-based-on-CNN | [
"dc4f84429120485db05ff547607ee87d92f3e20f"
] | [
"VGG16_model.py"
] | [
"import tensorflow as tf \n\ndef conv_layer(x, num_filters, name, filter_height = 3, filter_width = 3, stride = 1, padding = 'SAME'):\n\n\tinput_channels = int(x.get_shape()[-1])\n\n\twith tf.variable_scope(name) as scope:\n\t\tW = tf.get_variable('weights', shape = [filter_height, filter_width, input_channels, num... | [
[
"tensorflow.constant_initializer",
"tensorflow.nn.relu",
"tensorflow.nn.conv2d",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.variable_scope",
"tensorflow.nn.softmax",
"tensorflow.nn.bias_add",
"tensorflow.nn.max_pool",
"tensorflow.nn.dropout",
"tensorflow.ran... |
wsyCUHK/tormentor | [
"683b37fd943368137ddb8fc78f75ab750cf05526"
] | [
"tormentor/augmented_dataset.py"
] | [
"import itertools\nimport time\nfrom typing import Type\nimport torch\nfrom matplotlib import pyplot as plt\n\n\nfrom .base_augmentation import DeterministicImageAugmentation\n\n\nclass AugmentedDs(torch.utils.data.Dataset):\n @classmethod\n def augment_sample(cls, *args, augmentation, process_device: torch.d... | [
[
"torch.zeros",
"torch.cat",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"torch.tensor",
"matplotlib.pyplot.show",
"torch.Tensor",
"torch.where",
"torch.empty_like"
]
] |
i2r-simmc/i2r-simmc-2021 | [
"e0358e5909ee598552240cc12e85c71360634b2e"
] | [
"subtask_134/train_bart.py"
] | [
"import os\nimport argparse\nimport random\nimport json\nimport math\nfrom tqdm import tqdm\nimport numpy as np\nimport torch\n# import torch.nn as nn\nfrom torch.utils.data import RandomSampler, SequentialSampler\nfrom torch.utils.data.dataloader import DataLoader\n\nfrom transformers import BartTokenizer, BartFor... | [
[
"torch.utils.data.RandomSampler",
"torch.cuda.manual_seed_all",
"torch.utils.data.dataloader.DataLoader",
"numpy.random.seed",
"torch.no_grad",
"torch.utils.data.SequentialSampler",
"torch.save",
"numpy.mean",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.cuda.... |
bamtercelboo/pytorch_POS_NER_Chunking | [
"3450d6fdf9fd761f535cb164262ad8752cf529ff"
] | [
"models/model_PNC_Pretrained.py"
] | [
"# @Author : bamtercelboo\n# @Datetime : 2018/1/31 9:24\n# @File : model_PNC.py\n# @Last Modify Time : 2018/1/31 9:24\n# @Contact : bamtercelboo@{gmail.com, 163.com}\n\n\"\"\"\n FILE : model_PNC.py\n FUNCTION : Part-of-Speech Tagging(POS), Named Entity Recognition(NER) and Chunking\n\"\"\"\n\nimport torch\ni... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.cat",
"torch.nn.LSTM",
"numpy.array",
"numpy.add",
"torch.nn.init.xavier_uniform",
"numpy.sum",
"torch.autograd.Variable",
"torch.from_numpy",
"torch.manual_seed",
"torch.nn.BatchNorm1d",
"numpy.sq... |
soloice/tf-tutorial | [
"c8068124ee9945fc1fd561e32054e688fc34eee1"
] | [
"src/mnist_cnn.py"
] | [
"import tensorflow as tf\nimport time\nfrom tensorflow.examples.tutorials.mnist import input_data\n\n\ndef weight_variable(shape):\n initial = tf.truncated_normal(shape, stddev=0.1)\n return tf.Variable(initial)\n\n\ndef bias_variable(shape):\n initial = tf.constant(0.1, shape=shape)\n return tf.Variabl... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.train.AdamOptimizer",
"tensorflow.nn.conv2d",
"tensorflow.argmax",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.Variable",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.trunc... |
mikedorfman/NSIDC-MIZ-Comparison | [
"9991d27ba36034668241048f9cec5fc794e5aa51"
] | [
"modules/download.py"
] | [
"\"\"\"\nA module to assist in the downloading of MIZ files and loading into memory (eg pandas df)\n\"\"\"\n\nimport datetime\nimport os\nfrom pathlib import Path\nimport urllib.request\n\nfrom joblib import Parallel, delayed\nimport geopandas as gpd\nimport netCDF4 as nc\nimport numpy as np\nimport pandas as pd\ni... | [
[
"pandas.date_range",
"numpy.load",
"numpy.save",
"numpy.squeeze"
]
] |
dipghoshraj/virtual-pen | [
"ffc63af834ec3b495d98ba0de85b125580b2f025"
] | [
"pensetup.py"
] | [
"import cv2\nimport numpy as np\nimport time\n\n\n# A required callback method that goes into the trackbar function.\ndef nothing(x):\n pass\n\n\n# Initializing the webcam feed.\ncap = cv2.VideoCapture(0)\ncap.set(3, 1280)\ncap.set(4, 720)\n\n# Create a window named trackbars.\ncv2.namedWindow(\"Trackbars\")\n\n... | [
[
"numpy.hstack",
"numpy.array",
"numpy.save"
]
] |
Setec-Lab/solar_cell_simulator | [
"804741e5246f8f8e5529b00135b979127caf8047",
"804741e5246f8f8e5529b00135b979127caf8047"
] | [
"software/python/ControlCargaProgramable/main.py",
"software/python/ControlCargaProgramable/Code with issue and results/SAS_v2.py"
] | [
"import pyvisa\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport math\nimport controller\nimport time\n\nInputIsc = 0.5196\nInputImp = 0.5029\nInputVmp = 2.409\nInputVoc = 2.690\nInputVoc_Tcomp = 0\nInputVmp_Tcomp = 0\nInputPcos = 1\nInputT = 0\n\n\ndef scalevars(voc_tcomp, vmp_tcomp, pcos, voc, vmp, imp... | [
[
"numpy.abs",
"numpy.asarray",
"numpy.zeros"
],
[
"numpy.zeros"
]
] |
NYU-MLDA/OpenABC | [
"399ffdb639440609a84ee74f1970fbbbef6b1b2a"
] | [
"models/qor/SynthNetV3/model.py"
] | [
"import torch\nfrom torch_geometric.nn import MessagePassing\nfrom torch_geometric.nn import global_mean_pool, global_max_pool\nimport torch.nn.functional as F\nfrom torch_geometric.utils import add_self_loops, degree\n\nallowable_synthesis_features = {\n 'synth_type' : [0,1,2,3,4,5,6]\n}\n\ndef get_synth_featur... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.Conv1d",
"torch.nn.functional.dropout",
"torch.nn.init.xavier_uniform_",
"torch.nn.BatchNorm1d",
"torch.nn.Embedding"
]
] |
dnarqq/WildHack | [
"88a8f8887b7faf7684dbc9d95695e6fa439b2a77",
"4fb9e4545cb47a4283ebc1dec955c0817b1664c0"
] | [
"archive/detection/detector_eval/evaluate_detections.py",
"research/active_learning/active_learning_methods/simulate_batch.py"
] | [
"#\n# evaluate_detections.py\n#\n# Adapted from analyze_detection.py which is now archived.\n#\n\n#%% Imports and constants\n\nimport argparse\nimport math\nimport pickle\nimport sys\nfrom collections import defaultdict\nimport os\n\nfrom tqdm import tqdm\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom o... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros"
],
[
"numpy.array",
"numpy.random.choice",
"numpy.random.seed",
"numpy.mean",
"numpy.argmax",
"numpy.argsort",
"numpy.unique"
]
] |
Dewsand/deep_learning | [
"635cc469ece6778d0f2b735e7f3535292248f032"
] | [
"25 VGG/vgg.py"
] | [
"import torch\r\nfrom torch import nn\r\nfrom d2l import torch as d2l\r\n\r\n# 构造vgg块\r\ndef vgg_block(num_convs, in_channels, out_channels):\r\n layers = []\r\n for _ in range(num_convs):\r\n layers.append(nn.Conv2d(in_channels,out_channels,kernel_size=3,padding=1))\r\n layers.append(nn.ReLU())... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.Flatten"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.