version stringclasses 24
values | code stringlengths 396 135k | apis list | full_version stringlengths 1 6 | repo_name stringlengths 6 64 | hexsha stringlengths 40 40 |
|---|---|---|---|---|---|
1.6 | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import itertools
import math
import torch
from torch.distributions import constraints
from torch.distributions.utils import lazy_property
from pyro.distributions.torch_distribution import TorchDistribution
class SpanningTree(To... | [
"torch.zeros",
"torch.Size",
"torch.cholesky",
"torch.stack",
"torch.arange",
"torch.no_grad",
"torch.broadcast_tensors",
"torch.randperm",
"torch.multinomial",
"torch.tensor",
"torch.eye",
"torch.utils.cpp_extension.load",
"torch.empty"
] | 1.6.0 | kashif/pyro | b65b329d8b851c7402acaef9c176a8964caadaf3 |
1.6 | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
import torch
from pyro.distributions.transforms import Transform
from pyro.distributions import constraints
class OrderedTransform(Transform):
"""
Transforms a real vector into an ordered vector.
Specifically, enforces m... | [
"torch.sum",
"torch.cat",
"torch.cumsum"
] | 1.6.0 | kashif/pyro | b65b329d8b851c7402acaef9c176a8964caadaf3 |
1.6 | # Copyright (c) Facebook, Inc. and its affiliates.
import logging
import os
import warnings
from enum import Enum
from typing import Any, Dict, List, Optional, Tuple, Union
import mmf
import pytorch_lightning as pl
import torch
from mmf.common.meter import Meter
from mmf.common.registry import registry
from mmf.datas... | [
"torch.utils.data.DistributedSampler"
] | 1.6.0 | JiesiZhao077/mmf | e20f0d29638c5d05e3e0c385fe67a9bfeef0f921 |
1.5 | import numpy as np
import torch
import torch.nn as nn
import random
import torch.distributions as D
class GenerativeFlow(nn.Module):
"""
Generative flow base class
For models performing density estimation and matching
"""
def __init__(self, args):
super(GenerativeFlow, self).__init__()
... | [
"torch.distributions.Normal",
"torch.randn",
"torch.ones"
] | 1.5.0 | robert-giaquinto/gradient-boosted-normalizing-flows | eca3726774f4498f1583bb79d4a9b955b4f51412 |
1.3 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.nn import GCNConv, GATConv
from torch_geometric.nn.conv import MessagePassing
from torch_geometric.nn.inits import glorot
from torch_geometric.utils import softmax
class HGTConv(MessagePassing):
def __init__(self,... | [
"torch.nn.Linear",
"torch.sigmoid",
"torch.nn.Dropout",
"torch.nn.LayerNorm",
"torch.cos",
"torch.zeros",
"torch.nn.ModuleList",
"torch.sin",
"torch.arange",
"torch.nn.functional.gelu",
"torch.ones",
"torch.Tensor",
"torch.nn.Embedding"
] | 1.3.0 | Suchun-sv/pyHGT | 49fb66e04386835d9dc3ba22abba121f8a960469 |
1.7 | import json
from functools import namedtuple
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.optim import Adam
from torch.utils.data import Dataset, DataLoader
import pytorch_lightning as pl
from omegaconf import DictConfig
from cpc.dataset import AudioRawDataset
class Co... | [
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.nn.GRU",
"torch.nn.ModuleList",
"torch.nn.Conv1d",
"torch.randint",
"torch.nn.BatchNorm1d",
"torch.utils.data.DataLoader",
"torch.nn.CrossEntropyLoss",
"torch.sum"
] | 1.7.0 | lokhiufung/quick-and-dirty-dl | f2e4429451543e9e9a44ed5304e268cf3c2aa888 |
1.8 | r"""Hodgkin-Huxley (HH) benchmark.
HH is a widespread non-linear mechanistic model of neural dynamics.
References:
A quantitative description of membrane current and its application to conduction and excitation in nerve
(Hodgkin et al., 1952)
https://link.springer.com/article/10.1007/BF02459568
Train... | [
"torch.tensor"
] | 1.8.0 | francois-rozet/lampe | 50e53c767ee5d98502ec8520b3bca554f2169eb7 |
1.1 | """
Implementation of non-negative matrix factorization for GPU
"""
from datetime import datetime
from nimfa.methods.seeding import nndsvd
import numpy as np
import torch
import torch.nn
from torch import nn
class NMF:
def __init__(self, V, rank, max_iterations=100000, tolerance=1e-8, test_conv=1000, gpu_id=0, ... | [
"torch.rand",
"torch.cuda.manual_seed",
"torch.no_grad",
"torch.nn.Threshold",
"torch.from_numpy",
"torch.manual_seed",
"torch.cuda.set_device",
"torch.ones"
] | 1.1.0 | edawson/SigProfilerExtractor | a9cc43ddba2271ec68ff4d1a6a93399386713325 |
1.0 | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | [
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.nn.LayerNorm",
"torch.nn.MSELoss",
"torch.nn.Softmax",
"torch.einsum",
"torch.nn.Tanh",
"torch.nn.CrossEntropyLoss",
"torch.arange",
"torch.from_numpy",
"torch.ones",
"torch.matmul",
"torch.nn.Embedding"
] | 1.0 | ceostroff/transformers | 3095ee9dab739f212a8753b5be4e1a72ba42e28e |
1.0 | # coding=utf-8
# Copyright 2020 The Trax Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at... | [
"torch.nn.Linear",
"torch.cat",
"torch.nn.ParameterList",
"torch.einsum",
"torch.enable_grad",
"torch.cuda.current_device",
"torch.ones",
"torch.seed",
"torch.exp",
"torch.nn.CrossEntropyLoss",
"torch.chunk",
"torch.where",
"torch.reshape",
"torch.rsqrt",
"torch.sum",
"torch.nn.LayerNo... | 1.0 | ceostroff/transformers | 3095ee9dab739f212a8753b5be4e1a72ba42e28e |
1.0 | # coding=utf-8
# Copyright 2018 Salesforce and HuggingFace Inc. team.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | [
"torch.tensor"
] | 1.0 | ceostroff/transformers | 3095ee9dab739f212a8753b5be4e1a72ba42e28e |
1.0 | # -*- coding: utf-8 -*-
# @Author : William
# @Project : TextGAN-william
# @FileName : RelGAN_D.py
# @Time : Created at 2019-04-25
# @Blog : http://zhiweil.ml/
# @Description :
# Copyrights (C) 2018. All Rights Reserved.
import math
import torch
import torch.autograd as autograd
import... | [
"torch.zeros",
"torch.cos",
"torch.nn.Dropout",
"torch.nn.Linear",
"torch.nn.LayerNorm",
"torch.sin",
"torch.nn.Sigmoid",
"torch.arange",
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.nn.init.normal_",
"torch.nn.init.uniform_",
"torch.nn.TransformerEncoderLayer"
] | 1.0.0 | JustinLokHinWu/TextGAN-PyTorch | 427f08890056a96fde7e5b67c26c3bb9f5a420a4 |
0.4 | import torch.utils.data as data
import os
import os.path
import numpy as np
from numpy.random import randint
import torch
from colorama import init
from colorama import Fore, Back, Style
import random
from os import listdir
from os.path import join, splitext
import numpy as np
import torch
import torch.nn.functiona... | [
"torch.utils.data.append",
"torch.stack",
"torch.load"
] | 0.4.1 | gzaraunitn/TA3N | d83ae5d9c8f4452ff69dd9002bb4016a695a4be8 |
1.10 | import os
import torch
from transformers import TrainerControl, TrainerState
from transformers.file_utils import WEIGHTS_NAME
from transformers.modeling_utils import PreTrainedModel
from transformers.trainer_callback import TrainerCallback
from transformers.trainer_utils import PREFIX_CHECKPOINT_DIR
from transformers.... | [
"torch.save",
"torch.load"
] | 1.10.0 | sberbank-ai/ru-prompts | 4eeedae92cb5234c70adc787ace7cfceb76b0be0 |
1.2 | import torch
import torch.nn as nn
import torch.nn.functional as F
from base import BaseModel
from model.mem_transformer import MemTransformerLM
from model.gru_ae import *
import numpy as np
class Seq_Attention(BaseModel):
def __init__(
self,
transformer_state_path,
num_classes,
code... | [
"torch.nn.Linear",
"torch.sigmoid",
"torch.nn.Dropout",
"torch.cat",
"torch.no_grad",
"torch.nn.functional.log_softmax",
"torch.nn.ReLU",
"torch.load"
] | 1.2.0 | empyriumz/TAPER-EHR | fc89a27730a6eb6d4b321832e017c7e9662fa2e3 |
1.6 | from __future__ import print_function
from __future__ import division
import math
import torch
import torch.nn as nn
from torch.nn import Parameter
from torchkit.head.localfc.common import calc_logits
class CosFace(nn.Module):
""" Implement of CosFace (https://arxiv.org/abs/1801.09414)
"""
def __init__(s... | [
"torch.nn.init.normal_",
"torch.FloatTensor"
] | 1.6.0 | sarvex/TFace | 490cf90a1f042b86d7d03042f26d0a7cf6b1f0c0 |
1.1 | # -----------------------------------------------------
# Copyright (c) Shanghai Jiao Tong University. All rights reserved.
# Written by Jiefeng Li (jeff.lee.sjtu@gmail.com)
# -----------------------------------------------------
import torch.nn as nn
from .builder import SPPE
from .layers.DUC import DUC
from .layers... | [
"torch.nn.PixelShuffle",
"torch.nn.Conv2d",
"torch.nn.init.normal_",
"torch.nn.init.constant_"
] | 1.1.0 | ericwang0701/AlphaPose | 1f17dbf4b41ad7452430b69f72d58a0585ed09af |
1.1 | # -----------------------------------------------------
# Copyright (c) Shanghai Jiao Tong University. All rights reserved.
# Written by Jiefeng Li (jeff.lee.sjtu@gmail.com)
# -----------------------------------------------------
import os
import sys
import numpy as np
import torch
import torch.nn.functional as F
fro... | [
"torch.nn.functional.binary_cross_entropy_with_logits"
] | 1.1.0 | ericwang0701/AlphaPose | 1f17dbf4b41ad7452430b69f72d58a0585ed09af |
1.6 | # Copyright (c) Facebook, Inc. and its affiliates.
import glob
import importlib
import logging
import os
import random
import sys
from datetime import datetime
import numpy as np
import torch
from omegaconf import OmegaConf, open_dict
def set_seed(seed):
if seed:
if seed == -1:
# From detect... | [
"torch.manual_seed"
] | 1.6.0 | dk25021999/mmf | 218057265a3fc175f656b5ebe8fb44ef5ccca2e9 |
1.2 | from torch.distributions import Normal
import numpy as np
from torch import nn
from typing import Tuple
from tqdm.auto import trange
import torch
from deepqmc import Molecule
from deepqmc.pyscfext import eval_ao_normed, pyscf_from_mol
from deepqmc.wf import WaveFunction
from deepqmc.wf.paulinet.molorb import Molecular... | [
"torch.rand",
"torch.cat",
"torch.diagonal",
"torch.distributions.Normal",
"torch.normal",
"torch.from_numpy",
"torch.tensor",
"torch.exp",
"torch.where"
] | 1.2 | maxiwelian/deepqmc | 0d243e2c5f5964a79929294e62e46819653b137b |
0.4 | from dataset import get_dataloader
from common import config
from model import get_autoencoder
from functional.utils import cycle
from agent import get_training_agent
from functional.visualization import visulize_motion_in_training
import torch
import os
from collections import OrderedDict
from tqdm import tqdm
from te... | [
"torch.from_numpy"
] | 0.4.1 | diegcr/2D-Motion-Retargeting | 2b4acedb45a281d2867c812fce6063dc68b8e88b |
1.8 | import torch
from .base_model import BaseModel
class Classifier(BaseModel):
def __init__(self, model, **kwargs):
super(Classifier, self).__init__(**kwargs)
self.model = model
self.model_name = self.model.name
if self.optimizer is not None:
self.optimizer = self.optimizer... | [
"torch.max",
"torch.argmax",
"torch.nn.functional.softmax"
] | 1.8.1 | elviva404/food-detection-yolov5 | 796a0c1df6e9c9a705dff7782b3f9b213344f11b |
1.10 | import argparse
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import torch
import torch.nn as nn
from models.rnn import IDP_test_rnn
from models.transformer import IDP_compare_Transformer
from idp_methods.utils import *
parser = argparse.ArgumentParser()
parser.add_... | [
"torch.device",
"torch.cat",
"torch.cuda.manual_seed",
"torch.max",
"torch.softmax",
"torch.from_numpy",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.tensor",
"torch.nn.CrossEntropyLoss"
] | 1.10.0 | iliasprc/IDPMetagenome | 519cec77bb55eb91dbb7b243a2d80999742c033d |
1.6 | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
r"""
Multi-Task GP models.
References
.. [Doucet2010sampl]
A. Doucet. A Note on Efficient Conditional Simulatio... | [
"torch.Size",
"torch.zeros",
"torch.cat",
"torch.arange",
"torch.no_grad"
] | 1.6 | CompRhys/botorch | 6965426853b7c2d61244f6874eff3317b3588554 |
1.8 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | [
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.nn.LayerNorm",
"torch.cat",
"torch.nn.MSELoss",
"torch.arange",
"torch.nn.Softmax",
"torch.einsum",
"torch.nn.Tanh",
"torch.nn.CrossEntropyLoss",
"torch.ones",
"torch.tensor",
"torch.nn.BCEWithLogitsLoss",
"torch.tanh",
"torc... | 1.8.1 | guanzhchen/PETuning | eb36327713e237ea95a8982ceabb71de5ca4b09d |
1.5 | # Copyright (c) Facebook, Inc. and its affiliates.
from copy import deepcopy
import torch
from mmf.common.registry import registry
from mmf.models.base_model import BaseModel
from mmf.modules.encoders import MultiModalEncoderBase
from mmf.utils.build import build_classifier_layer
class UnimodalBase(MultiModalEncode... | [
"torch.is_tensor",
"torch.flatten",
"torch.mean"
] | 1.5.0 | anas-awadalla/mmf | 306f8f758831b2abf2c7ef5a8f010670a2cb33ed |
1.5 | # Copyright (c) Facebook, Inc. and its affiliates.
import os
import tempfile
import unittest
import torch
from mmf.datasets.processors.processors import (
CaptionProcessor,
EvalAIAnswerProcessor,
MultiClassFromFile,
MultiHotAnswerFromVocabProcessor,
TransformerBboxProcessor,
)
from mmf.utils.config... | [
"torch.zeros",
"torch.tensor"
] | 1.5.0 | anas-awadalla/mmf | 306f8f758831b2abf2c7ef5a8f010670a2cb33ed |
1.5 | # Copyright (c) Facebook, Inc. and its affiliates.
import glob
import importlib
import logging
import os
import sys
import warnings
import torch
from mmf.common.registry import registry
from mmf.utils.configuration import get_mmf_env, load_yaml
from mmf.utils.distributed import is_master, synchronize
from mmf.utils.d... | [
"torch.save",
"torch.load"
] | 1.5.0 | anas-awadalla/mmf | 306f8f758831b2abf2c7ef5a8f010670a2cb33ed |
1.5 | # Copyright (c) Facebook, Inc. and its affiliates.
import torch
from mmf.common.registry import registry
from torch import nn
from torch.nn.utils.weight_norm import weight_norm
class VisDialDiscriminator(nn.Module):
def __init__(self, config, embedding):
super().__init__()
self.config = config
... | [
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.cat",
"torch.nn.LSTMCell",
"torch.sum"
] | 1.5.0 | anas-awadalla/mmf | 306f8f758831b2abf2c7ef5a8f010670a2cb33ed |
1.0 | from abc import abstractmethod
from pandas import DataFrame
from os.path import exists
from numpy import argmax
from torch.nn import Module, Conv2d
from torch.nn import functional as F
from torch import load as loadModel
from cnn.MixedFilter import MixedConvBNWithReLU as MixedConvWithReLU
from cnn.uniq_loss import Un... | [
"torch.nn.functional.softmax"
] | 1.0.0 | aqui-tna/darts-UNIQ | 293a27b104bc0f53c6093829d1184686b788fba9 |
1.0 | from itertools import groupby
from abc import abstractmethod
from torch import cat, chunk, tensor, zeros, int32
from torch.nn import ModuleList, BatchNorm2d, Conv2d
from torch.distributions.multinomial import Multinomial
from torch.nn import functional as F
from cnn.MixedFilter import MixedFilter
from cnn.block impor... | [
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.BatchNorm2d",
"torch.tensor",
"torch.nn.functional.softmax"
] | 1.0.0 | aqui-tna/darts-UNIQ | 293a27b104bc0f53c6093829d1184686b788fba9 |
1.0 | from torch import zeros, tensor, no_grad
from torch.nn import functional as F
from cnn.model_replicator import ModelReplicator, set_device
class RandomPath(ModelReplicator):
def __init__(self, model, modelClass, args, logger):
super(RandomPath, self).__init__(model, modelClass, args, logger)
def get... | [
"torch.no_grad",
"torch.tensor",
"torch.nn.functional.softmax"
] | 1.0.0 | aqui-tna/darts-UNIQ | 293a27b104bc0f53c6093829d1184686b788fba9 |
1.6 | # Copyright (c) Facebook, Inc. and its affiliates.
import logging
import warnings
import omegaconf
import torch
from mmf.common.dataset_loader import DatasetLoader
from mmf.common.registry import registry
from mmf.modules.metrics import Metrics
from mmf.trainers.base_trainer import BaseTrainer
from mmf.trainers.callba... | [
"torch.cuda.amp.GradScaler",
"torch.device"
] | 1.6.0 | Yui010206/mmf | 01e7ccd664a4492f65ba10aeb3eeeafef62c3b87 |
1.1 | # Copyright 2019 FMR LLC <opensource@fidelity.com>
# SPDX-License-Identifer: Apache-2.0
import numpy as np
import torch
from textwiser.base import BaseFeaturizer
from textwiser.utils import convert, OutputType
class _BaseTransformation(BaseFeaturizer):
def __init__(self, wrap_list_input=True):
"""Initia... | [
"torch.cat"
] | 1.1.0 | vishalbelsare/textwiser | 2c5bdd73c26bd3fb7bd2f324f57d99233aa9c17f |
1.0 | import numpy as np
import pytest
import torch
from ignite.contrib.handlers.param_scheduler import (
ConcatScheduler,
CosineAnnealingScheduler,
LinearCyclicalScheduler,
LRScheduler,
ParamGroupScheduler,
PiecewiseLinear,
create_lr_scheduler_with_warmup,
)
from ignite.engine import Engine, Eve... | [
"torch.zeros",
"torch.optim.lr_scheduler.StepLR",
"torch.optim.SGD",
"torch.optim.lr_scheduler.ExponentialLR",
"torch.ones"
] | 1.0 | jonrbates/ignite | 15eeb8791a2e0c2f55265e1f6b91f91dc35286c5 |
1.0 | import torch
from ignite.contrib.metrics.regression._base import _BaseRegression
from ignite.exceptions import NotComputableError
class GeometricMeanAbsoluteError(_BaseRegression):
r"""
Calculates the Geometric Mean Absolute Error.
:math:`\text{GMAE} = \exp(\frac{1}{n}\sum_{j=1}^n\ln(|A_j - P_j|))`
... | [
"torch.exp",
"torch.sum"
] | 1.0 | jonrbates/ignite | 15eeb8791a2e0c2f55265e1f6b91f91dc35286c5 |
1.1 | import torch
import torch.nn as nn
import torch.nn.functional as F
from ..registry import LOSSES
from .utils import weight_reduce_loss
from icecream import ic
def cross_entropy(pred, label, weight=None, reduction='mean', avg_factor=None):
# element-wise losses
loss = F.cross_entropy(pred, label, reduction='no... | [
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.nonzero",
"torch.nn.functional.cross_entropy",
"torch.arange"
] | 1.1 | cizhenshi/mmdetection | b0fe89677020ebe9e6a736b98d3e791ca0e6536d |
1.4 | import argparse
import os
import sys
import time
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from models import curves_pam
from utils import utils, alignment, data
import models
import definitions
im... | [
"torch.device",
"torch.nonzero",
"torch.nn.ParameterList",
"torch.cuda.manual_seed",
"torch.no_grad",
"torch.optim.SGD",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.load",
"torch.optim.lr_scheduler.LambdaLR",
"torch.nn.CrossEntropyLoss",
"torch.sum"
] | 1.4.0 | IBM/NeuronAlignment | 5b82b60666db1fac72e53db07529a3328ee549c4 |
1.1 | import os
from argparse import Namespace
import numpy as np
import torch
# from pl_examples import LightningTemplateModel
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.loggers import TestTubeLogger, TensorBoardLogger
from tests.base import Lightni... | [
"torch.manual_seed",
"torch.tensor",
"torch.mean",
"torch.argmax",
"torch.sum"
] | 1.1 | gangiman/pytorch-lightning | 9b31272cf0f3079a244944096b4a81eec20fe555 |
1.4 | """This module implements an abstract base class (ABC) 'BaseDataset' for datasets.
It also includes common transformation functions (e.g., get_transform, __scale_width), which can be later used in subclasses.
"""
import random
import numpy as np
import torch.utils.data as data
import torch
from PIL import Image
import... | [
"torch.reshape",
"torch.rand",
"torch.cat",
"torch.tensor"
] | 1.4.0 | loerssoni/pytorch-CycleGAN-and-pix2pix | 289287f9e4bd948a306627b32fc6b57b78420121 |
0.4 | """
LOAD DATA from file.
"""
# pylint: disable=C0301,E1101,W0622,C0103,R0902,R0915
##
import os
import torch
import numpy as np
import torchvision.datasets as datasets
from torchvision.datasets import MNIST
from torchvision.datasets import CIFAR10
from torchvision.datasets import ImageFolder
import torchvision.transf... | [
"torch.cat"
] | 0.4.0 | lss616263/ganomaly | 0e8ddd7b97fdbe35b33d607cddaf62f36cb591c8 |
1.8 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import division, absolute_import, print_function, unicode_literals
from typing import Optional, Union
import math
import torch
from torch import nn
from model.encoder_internal import BasePrefixAwareLayer, BaseLogitAdjustableLayer
from model.hashembed impor... | [
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.stack",
"torch.nn.ModuleList",
"torch.arange",
"torch.split",
"torch.index_select",
"torch.nn.init.zeros_",
"torch.matmul",
"torch.nn.Embedding",
"torch.cumsum"
] | 1.8.1 | s-mizuki-nlp/word_sense_disambiguation | e920b37f879e8db8f2b2d7a55e7997bb8b61ff1a |
1.3 | import torch
import torch.nn.functional as F
import numpy as np
from tqdm import tqdm
from collections import OrderedDict
from maml.utils import update_parameters, tensors_to_device, compute_accuracy
__all__ = ['ModelAgnosticMetaLearning', 'MAML', 'FOMAML']
class ModelAgnosticMetaLearning(object):
"""Meta-learn... | [
"torch.tensor",
"torch.set_grad_enabled"
] | 1.3.0 | ferhah/pytorch-maml | 8fbf8b200c1c73aeb98787e4df43036955dca323 |
1.0 | # -*- coding: utf-8 -*-
from functools import partial
import torch
from torchtext.data import Field, RawField
from onmt.inputters.dataset_base import DatasetBase
class TextDataset(DatasetBase):
"""
Build `Example` objects, `Field` objects, and filter_pred function
from text corpus.
Args:
fi... | [
"torch.stack"
] | 1.0 | kolk/qa_factoid2natural | ccdd0096217c8e88b148f353f0c89628b85f9c4d |
1.8 | # Create by Packetsss
# Personal use is allowed
# Commercial use is prohibited
from __future__ import division
import math
import torch
import torch.optim as optim
from collections import defaultdict
class SharedRMSprop(optim.Optimizer):
"""Implements RMSprop algorithm with shared states.
"""
def __init... | [
"torch.zeros",
"torch.max"
] | 1.8.1 | PaulPan00/donkey_wrapper | a03cf0f42f65625fbce792b06c98acd153c5d6c8 |
1.4 | # -*- coding: utf-8 -*-
import math
from typing import Optional, Tuple
import warnings
import torch
from torch import Tensor
__all__ = [
"spectrogram",
"griffinlim",
"amplitude_to_DB",
"DB_to_amplitude",
"compute_deltas",
"compute_kaldi_pitch",
"create_fb_matrix",
"create_dct",
"c... | [
"torch.round",
"torch.cat",
"torch.view_as_real",
"torch.stack",
"torch.istft",
"torch.nn.functional.pad",
"torch.stft",
"torch.sum",
"torch.log1p",
"torch.norm",
"torch.abs",
"torch.tensor",
"torch.zeros",
"torch.cos",
"torch.min",
"torch.max",
"torch.linspace",
"torch.clamp",
"... | 1.4.0 | worc3131/audio | 05bff83fdec3e8f70f80bf7a1b89951bf7050114 |
1.0 | # coding=utf-8
# Copyright 2020-present the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | [
"torch.cat",
"torch.utils.data.RandomSampler",
"torch.cuda.amp.autocast",
"torch.Generator",
"torch.cuda.random.set_rng_state",
"torch.random.get_rng_state",
"torch.cuda.random.set_rng_state_all",
"torch.cuda.is_available",
"torch.load",
"torch.cuda.random.get_rng_state_all",
"torch.nn.DataParal... | 1.0 | mweiss17/transformers | ae88d5adc89a2020c21d62481e98f058f91784aa |
1.1 | import torch
import torch.nn as nn
import torchvision.models as models
import torchvision.transforms as transforms
class ChannelPoolAdaptiveAvg1d(torch.nn.AdaptiveAvgPool1d):
def forward(self, input):
n, c = input.size()
input = input.view(n,c,1).permute(0,2,1)
pooled = torch.nn.f... | [
"torch.zeros",
"torch.device",
"torch.nn.functional.adaptive_avg_pool1d"
] | 1.1.0 | abitrolly/lightwood | ee0c095f594c5d491196401b59344702f346bc9c |
1.3 | import torch
import torch.nn.functional as F
import configparser
import matplotlib.pyplot as plt
import os
import numpy as np
plt.figure(figsize=(20,5))
import ast
import sys
#to import parent-level modules
os.chdir('Temporal-Based Approach')
sys.path.append('..')
from model.StackedLSTM import StackedLSTM
from util... | [
"torch.cuda.is_available"
] | 1.3.0 | uvashisth/Sonification-using-Deep-Learning | a0917e785c35aa5fadcbb258e938c58071b4e482 |
0.4 | from torch import nn
class GPT2LMHead(nn.Module):
""" Language Model Head for the transformer """
def __init__(self, model_embeddings_weights, config):
super(GPT2LMHead, self).__init__()
self.n_embd = config.n_embd
self.set_embeddings_weights(model_embeddings_weights)
def set_emb... | [
"torch.nn.Linear",
"torch.nn.init.normal_"
] | 0.4.1 | kniazevgeny/GPT2sQA-1 | b319016f51847a25ea3e9cd9c8450d58831cc42a |
1.7 | import torch
from torch import nn
import torch.nn.functional as F
class ConvNormLReLU(nn.Sequential):
def __init__(self, in_ch, out_ch, kernel_size=3, stride=1, padding=1, pad_mode="reflect", groups=1, bias=False):
pad_layer = {
"zero": nn.ZeroPad2d,
"same": nn.Repli... | [
"torch.nn.Sequential",
"torch.nn.Tanh",
"torch.nn.LeakyReLU",
"torch.nn.functional.interpolate",
"torch.nn.Conv2d",
"torch.nn.InstanceNorm2d"
] | 1.7.1 | viztopia/animegan2-pytorch | cef7f42fa429cfc902c3b419d343389e690943f5 |
0.4 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | [
"torch.nn.Linear",
"torch.ones",
"torch.nn.CrossEntropyLoss",
"torch.sigmoid",
"torch.sqrt",
"torch.nn.Softmax",
"torch.zeros_like",
"torch.zeros",
"torch.nn.Tanh",
"torch.matmul",
"torch.nn.Dropout",
"torch.nn.MSELoss",
"torch.arange",
"torch.erf",
"torch.from_numpy",
"torch.ones_like... | 0.4.1 | jiahuanglin/pytorch-transformers | a7a93143df4e60e31e062d7f2a4eb0d6283473a4 |
1.0 | # TvNorm.py
import torch
import torch.nn as nn
class TvNorm(nn.Module):
"""
normalization using the total variation; idea is to normalize pixel-wise by the length of the feature vector, i.e.,
MATLAB notation:
z = diag( 1/ sqrt( sum(x.^2,3)+eps)) x
Attributes:
eps: small float s... | [
"torch.ones",
"torch.zeros",
"torch.sum",
"torch.pow"
] | 1.0.1 | EmoryMLIP/DynamicBlocks | 52acc9fbc1a2640c6ac8922fa18105279ccaea97 |
1.4 | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
"torch.set_grad_enabled"
] | 1.4 | bmahlbrand/pytorch-lightning | 95e85e4d2d8f644b0ccc1f59d59634d6dd0f5d65 |
1.3 | from functools import partial
import pytest
import torch
from sklearn.metrics import (
accuracy_score as sk_accuracy,
jaccard_score as sk_jaccard_score,
precision_score as sk_precision,
recall_score as sk_recall,
roc_auc_score as sk_roc_auc_score,
)
from pytorch_lightning import seed_everything
fr... | [
"torch.zeros",
"torch.rand",
"torch.arange",
"torch.logical_not",
"torch.randint",
"torch.cuda.is_available",
"torch.tensor",
"torch.eye",
"torch.ones_like",
"torch.zeros_like",
"torch.allclose",
"torch.Tensor"
] | 1.3 | rwbfd/pytorch-lightning | f518ee6e25d1499f73cec86ca8b3f584d0fa440d |
1.8 | import torch
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import sys
from gpsa import VariationalGPSA, matern12_kernel, rbf_kernel, LossNotDecreasingChecker
from gpsa.plotting import callback_twod
sys.path.append("../../data")
from simulated.generate_twod_data import generate_twod_data
im... | [
"torch.from_numpy",
"torch.cuda.is_available"
] | 1.8.0 | giovp/spatial-alignment | b03a6508ba581246a3f6367217b2f8df5dcd15d4 |
1.8 | import numpy as np
import pandas as pd
import numpy.random as npr
import torch
from scipy.special import xlogy
def rbf_kernel(
x1, x2, lengthscale_unconstrained, output_variance_unconstrained, diag=False
):
lengthscale = torch.exp(lengthscale_unconstrained)
output_variance = torch.exp(output_variance_unc... | [
"torch.exp",
"torch.square"
] | 1.8.0 | giovp/spatial-alignment | b03a6508ba581246a3f6367217b2f8df5dcd15d4 |
1.8 | import torch
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import sys
from gpsa import VariationalGPSA, LossNotDecreasingChecker
sys.path.append("../../data")
from simulated.generate_oned_data import (
generate_oned_data_affine_warp,
generate_oned_data_gp_warp,
)
from gpsa.plotting... | [
"torch.from_numpy",
"torch.cuda.is_available"
] | 1.8.0 | giovp/spatial-alignment | b03a6508ba581246a3f6367217b2f8df5dcd15d4 |
1.5 | # Copyright 2020 - 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | [
"torch.sqrt",
"torch.log10"
] | 1.5 | davidiommi/MONAI | c470c1a67b33d7dbbce0f8b8c5ffdad84b76d60f |
1.8 | """
Model dependent data transforms that apply MRAugment to
training data before fed to the model.
Modified from https://github.com/facebookresearch/fastMRI/blob/master/fastmri/data/transforms.py
"""
from typing import Dict, Optional, Sequence, Tuple, Union
import fastmri
import numpy as np
import torch
from fastmri.... | [
"torch.tensor"
] | 1.8.1 | z-fabian/MRAugment | 88dd0649f05b2dd43bf967e8b92eaf2d5daab42d |
1.5 | import copy
import datetime
import inspect
import logging
import os
import sys
import time
import warnings
from inspect import signature
from pathlib import Path
from typing import Any, Dict, Optional, Tuple, Type, Union, cast
import torch
from torch.optim.sgd import SGD
from torch.utils.data.dataset import ConcatData... | [
"torch.optim.lr_scheduler.OneCycleLR",
"torch.isnan",
"torch.utils.data.dataset.ConcatDataset",
"torch.utils.data.dataset.Subset",
"torch.utils.tensorboard.SummaryWriter"
] | 1.5.0 | adriensas/flair | f01b0e7ff9a87d3862acae50aeaffdc8e8b8ac21 |
1.5 | from typing import Tuple
import numpy as np
import torch
import torch.nn
from torch.nn.functional import softmax
from torch.nn.utils.rnn import pack_padded_sequence
import flair
from flair.data import Dictionary, Label, List
START_TAG: str = "<START>"
STOP_TAG: str = "<STOP>"
class ViterbiLoss(torch.nn.Module):
... | [
"torch.zeros",
"torch.max",
"torch.gather",
"torch.ones",
"torch.tensor",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.functional.softmax",
"torch.exp"
] | 1.5.0 | adriensas/flair | f01b0e7ff9a87d3862acae50aeaffdc8e8b8ac21 |
0.4 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 Tomoki Hayashi
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import json
import os
import shutil
import tempfile
from argparse import Namespace
import numpy as np
import pytest
import torch
from espnet.nets.pytorch_backend.e2e_tts_fastsp... | [
"torch.device",
"torch.arange",
"torch.no_grad",
"torch.cuda.device_count",
"torch.from_numpy",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.randn",
"torch.nn.DataParallel"
] | 0.4.1 | szmmm/speechchain | 909724c6f305588a52958f64f584ad21696b5173 |
1.1 | import torch
class AnchorGenerator(object):
"""
Examples:
>>> from mmdet.core import AnchorGenerator
>>> self = AnchorGenerator(9, [1.], [1.])
>>> all_anchors = self.grid_anchors((2, 2), device='cpu')
>>> print(all_anchors)
tensor([[ 0., 0., 8., 8.],
... | [
"torch.zeros",
"torch.sqrt",
"torch.stack",
"torch.arange",
"torch.Tensor"
] | 1.1.0 | witnessai/GRAN | 952c2b08a58f3b0087f0f18fd48f8e385e45908b |
1.1 | from mmdet.core import (bbox2roi, bbox_mapping, merge_aug_bboxes,
merge_aug_masks, merge_aug_proposals, multiclass_nms)
class RPNTestMixin(object):
def simple_test_rpn(self, x, img_meta, rpn_test_cfg):
rpn_outs = self.rpn_head(x)
proposal_inputs = rpn_outs + (img_m... | [
"torch.Tensor"
] | 1.1.0 | witnessai/GRAN | 952c2b08a58f3b0087f0f18fd48f8e385e45908b |
1.1 | import torch
import torch.nn as nn
from torch.nn.modules.utils import _pair
from ..utils import ConvModule
from mmdet.core import (auto_fp16)
from ..registry import HEADS
@HEADS.register_module
class GlobalContextSemanticHead(nn.Module):
"""Simplest RoI head, with only two fc layers for semantic a... | [
"torch.nn.Linear",
"torch.nn.modules.utils._pair",
"torch.nn.ModuleList",
"torch.nn.init.constant_",
"torch.nn.ReLU",
"torch.nn.init.normal_"
] | 1.1.0 | witnessai/GRAN | 952c2b08a58f3b0087f0f18fd48f8e385e45908b |
1.1 | from __future__ import division
import math
import numpy as np
import torch
from mmcv.runner.utils import get_dist_info
from torch.utils.data import DistributedSampler as _DistributedSampler
from torch.utils.data import Sampler
class DistributedSampler(_DistributedSampler):
def __init__(self, datase... | [
"torch.Generator"
] | 1.1.0 | witnessai/GRAN | 952c2b08a58f3b0087f0f18fd48f8e385e45908b |
1.0 | import warnings
warnings.filterwarnings("ignore")
import sys
import matplotlib.pylab as plt
import scipy
sys.path.append('waveglow/')
import numpy as np
import torch
from hparams import create_hparams
from train import load_model
from text import text_to_sequence
def plot_data(data, figsize=(16, 4)):
fig, ax... | [
"torch.no_grad",
"torch.load",
"torch.from_numpy"
] | 1.0.0 | gaoxiao/tacotron2 | 0a58682c8025f892b29898088ae275b9086887b6 |
1.9 | import os
from copy import deepcopy
import pytest
import torch
from torch.optim import SGD, Adadelta, Adagrad, Adam, RMSprop
from pythae.customexception import BadInheritanceError
from pythae.models.base.base_utils import ModelOutput
from pythae.models import VQVAE, VQVAEConfig
from pythae.trainers import BaseTraine... | [
"torch.rand",
"torch.equal"
] | 1.9.0 | clementchadebec/benchmark_VAE | 943e231f9e5dfa40b4eec14d4536f1c229ad9be1 |
1.7 | import torch
import torch.nn as nn
from torch.utils.model_zoo import load_url as load_state_dict_from_url
from typing import Any
__all__ = ['AlexNet', 'alexnet']
model_urls = {
'alexnet': 'https://download.pytorch.org/models/alexnet-owt-4df8aa71.pth',
}
class AlexNet(nn.Module):
'''
Al... | [
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.utils.model_zoo.load_url",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.flatten"
] | 1.7.1 | acl21/deep-active-learning-pytorch | 637fd507235632903bcf84ed841ff524d847b94e |
1.6 | import numpy as np
import scipy.stats
import torch as t
from torch.distributions import Normal, Poisson
import math
from .utils import betaln, binomln, kappa_marginal_moments
# flat gaussian mixture
class GaussianMixture:
def __init__(self, mus, sigs):
"""
Args:
- mus: (t.tensor) vect... | [
"torch.stack",
"torch.arange",
"torch.distributions.Normal",
"torch.logsumexp",
"torch.tensor",
"torch.distributions.Poisson",
"torch.lgamma",
"torch.exp"
] | 1.6 | anguswilliams91/jbc-turing-rss-nowcasting | 8c91e568dcf0dfcdf48e03cac86ad01bc47f8dcc |
1.1 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from utils.box_utils import match, log_sum_exp
class MultiBoxLoss(nn.Module):
"""SSD Weighted Loss Function
Compute Targets:
1) Produce Confidence Target Indices by matching ground truth boxes
... | [
"torch.zeros",
"torch.nn.functional.cross_entropy",
"torch.cuda.is_available",
"torch.nn.functional.smooth_l1_loss"
] | 1.1.0 | ka-ryo/M2Det | d947f135e7aad996da43f5fe3a350eeead237fd0 |
1.2 | # coding: utf-8
"""
Training module
"""
from itertools import count
import argparse
import time
import shutil
from typing import List, Dict
import os
from os.path import join
import queue
from functools import partial
import random
import numpy as np
import torch
import torch.nn as nn
from torch import Tensor
from ... | [
"torch.save",
"torch.FloatTensor"
] | 1.2 | deep-spin/S7 | c987906b032eaa727c8bcbec53f48befb467e515 |
1.2 | from typing import Dict
import torch
from torch import Tensor
from torch.distributions.categorical import Categorical
from joeynmt.helpers import tile
def sample_decode(
model,
size: int,
encoder_output,
masks: Dict[str, Tensor],
max_output_length: int,
labels: dict =... | [
"torch.zeros",
"torch.cat",
"torch.stack",
"torch.distributions.categorical.Categorical",
"torch.full"
] | 1.2 | deep-spin/S7 | c987906b032eaa727c8bcbec53f48befb467e515 |
1.2 | import torch
from joeynmt.model import EncoderOutput
from joeynmt.decoders import TransformerDecoder, TransformerDecoderLayer
from .test_helpers import TensorTestCase
class TestTransformerDecoder(TensorTestCase):
def setUp(self):
self.emb_size = 12
self.num_layers = 3
self.hidden_size = ... | [
"torch.rand",
"torch.ones",
"torch.manual_seed",
"torch.nn.init.uniform_",
"torch.Tensor"
] | 1.2 | deep-spin/S7 | c987906b032eaa727c8bcbec53f48befb467e515 |
1.7 | # Copyright (c) Aishwarya Kamath & Nicolas Carion. Licensed under the Apache License 2.0. All Rights Reserved
import argparse
import json
import math
import os
import pickle
from collections import Counter, defaultdict
from copy import deepcopy
from functools import partial
from multiprocessing import Pool
from pathlib... | [
"torch.as_tensor",
"torch.stack"
] | 1.7.0 | bonejay/mdetr | 38c6d7c26d6d493f7bf6772ba65a72b493573d90 |
1.6 | import argparse
import time
import torch
from hivemind.proto.runtime_pb2 import CompressionType
from hivemind.utils.compression import serialize_torch_tensor, deserialize_torch_tensor
def benchmark_compression(tensor: torch.Tensor, compression_type: CompressionType) -> float:
t = time.time()
deserialize_tor... | [
"torch.manual_seed",
"torch.randn"
] | 1.6.0 | Vsevolod-pl/hivemind | 0300cfd91adeb14d91d9659a98221628f9b775b9 |
1.6 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
try:
from torchvision.models.utils import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
# Inception weights ported to Pytorch from
# http://download.tenso... | [
"torch.cat",
"torch.nn.functional.avg_pool2d",
"torch.nn.ModuleList",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.functional.interpolate",
"torch.utils.model_zoo.load_url",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.functional.max_pool2d"
] | 1.6.0 | man-sean/pscgan | be87e519cf789dc28b052afcea6c135a74cdbaaa |
1.5 | import torch
import cv2
import numpy as np
from .models.with_mobilenet import PoseEstimationWithMobileNet
from .modules.keypoints import extract_keypoints, group_keypoints
from .modules.load_state import load_state
from .modules.pose import Pose
from . import demo
def get_rect(net, images, height_size=512):
strid... | [
"torch.cuda.is_available",
"torch.load"
] | 1.5.1 | psi1104/pifuhd | 32be6642d8ee198f6186ec7ab82f329d95a9f275 |
1.7 | import torch
import torch.nn as nn
import torch.nn.functional as F
from functools import partial
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
from timm.models.registry import register_model
from timm.models.vision_transformer import _cfg
__all__ = [
'pvt_tiny', 'pvt_small', 'pvt_medium', 'pvt... | [
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.nn.Dropout",
"torch.nn.LayerNorm",
"torch.nn.Identity",
"torch.nn.init.constant_",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d"
] | 1.7.0 | implus/PVT | 4f70d09f2c0390a9ca2dabf271d725f2d8f75d08 |
0.4 | import sys
import argparse
import copy
import random
import torch
import torch.utils.data as data
from random import shuffle
from collections import OrderedDict
import continual_benchmark.dataloaders.base
import continual_benchmark.agents as agents
import continual_benchmark.dataloaders as dataloaders
from continual_b... | [
"torch.zeros",
"torch.device",
"torch.cat",
"torch.cuda.manual_seed",
"torch.manual_seed",
"torch.cuda.set_device",
"torch.cuda.empty_cache",
"torch.utils.data.DataLoader",
"torch.load",
"torch.Tensor"
] | 0.4.1 | KamilDeja/BinPlay | a8626e0bd85ed2f0c064b0c78c95a0bc8c0eb14e |
1.0 | import os
import gc
import json
import time
import tqdm
import argparse
import datetime
import torch.distributed as dist
import torch.utils.data.distributed
from warpctc_pytorch import CTCLoss
from novograd import (AdamW,
Novograd)
from linknet import (SemsegLoss,
MaskSimila... | [
"torch.nn.NLLLoss",
"torch.device",
"torch.zeros",
"torch.cuda.manual_seed_all",
"torch.stack",
"torch.arange",
"torch.cuda.synchronize",
"torch.distributed.init_process_group",
"torch.isnan",
"torch.no_grad",
"torch.optim.SGD",
"torch.optim.Adam",
"torch.nn.parallel.DistributedDataParallel"... | 1.0 | snakers4/deepspeech.pytorch | 4c9e9648fe56247169d73248340f3a60572d3f5b |
1.0 | # -*- coding: utf-8 -*-
# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is
# holder of all proprietary rights on this computer program.
# You can only use this computer program if you have closed
# a license agreement with MPG or you get the right to use the computer
# program from someone who is... | [
"torch.stack",
"torch.min",
"torch.einsum",
"torch.argmin",
"torch.det",
"torch.tensor",
"torch.log",
"torch.matmul",
"torch.exp"
] | 1.0.1 | omidrk/computervisionPanopticToSMPLAuto | b84b60f0ec4ffdb4ae61348919a95f7bb2eab926 |
1.5 | from itertools import product
import numpy as np
import pandas as pd
import torch
from trains import Task
from models.detection.SSD.priorbox_optimization import PriorOptimizationInput, ImageSizeTuple
from models.detection.SSD.priorbox_optimization.bbox_clustering import get_box_pairwise_iou
def collect_ground_truth... | [
"torch.Tensor"
] | 1.5.1 | danmalowany/trains-model-zoo | 2091100057afae9593b18ddcefd81b7d46724a96 |
1.9 | import json
import os
import subprocess
import sys
from contextlib import contextmanager
from datetime import datetime
from pathlib import Path
from time import sleep
from typing import List, Union
import numpy as np
import torch
import torch.nn as nn
def create_logdir(root: Union[str, Path] = None):
if (root i... | [
"torch.manual_seed",
"torch.save",
"torch.load"
] | 1.9.1 | mil-ad/prospr | a92177989f4480f1f2b43a48b3e18a6597ebba6d |
1.9 | import torch.nn as nn
from ..core.primitives import AbstractPrimitive
class ConvBNReLU(AbstractPrimitive):
def __init__(self, C_in, C_out, kernel_size, stride=1, affine=False):
super().__init__(locals())
pad = 0 if stride == 1 and kernel_size == 1 else 1
self.op = nn.Sequential(
... | [
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d"
] | 1.9.0 | NUDTNASLab/NASLib | 451cdb4738a7c1501ac62f78727c6244039dc657 |
1.0 | from gym import spaces
import multiprocessing.dummy as mp
import multiprocessing
import numpy as np
import os
import torch
import torch
import torch.nn as nn
from torch.nn import Parameter, ModuleList
import torch.nn.functional as F
from evkit.rl.utils import init, init_normc_
from evkit.utils.misc import is_cuda
fr... | [
"torch.nn.init.calculate_gain",
"torch.cat",
"torch.nn.Linear",
"torch.nn.init.constant_"
] | 1.0.1 | jozhang97/Side-tuning | dea345691fb7ee0230150fe56ddd644efdffa6ac |
1.0 | import torch
import torch.nn as nn
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class _CustomDataParallel(nn.Module):
def __init__(self, model, device_ids):
super(_CustomDataParallel, self).__init__()
self.model = nn.DataParallel(model, device_ids=device_ids)
self.m... | [
"torch.cuda.is_available",
"torch.nn.DataParallel",
"torch.cuda.device_count"
] | 1.0.1 | jozhang97/Side-tuning | dea345691fb7ee0230150fe56ddd644efdffa6ac |
1.0 | import torch.nn as nn
from torch.nn import Parameter, ModuleList
import torch.nn.functional as F
import torch
import multiprocessing
import numpy as np
import os
from gym import spaces
from torchvision.models import resnet18
from evkit.rl.utils import init, init_normc_
from evkit.preprocess import transforms
import tor... | [
"torch.nn.Linear",
"torch.cat",
"torch.nn.init.constant_",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ConvTranspose2d",
"torch.no_grad",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.load",
"torch.nn.init.calculate_gain",
"torch.Tensor"
] | 1.0.1 | jozhang97/Side-tuning | dea345691fb7ee0230150fe56ddd644efdffa6ac |
1.0 | from collections import namedtuple, Counter, defaultdict
from tlkit.data.sequential_tasks_dataloaders import ConcatenatedDataLoader, CyclingDataLoader, ErrorPassingConcatenatedDataLoader, ErrorPassingCyclingDataLoader
from tlkit.utils import SINGLE_IMAGE_TASKS, TASKS_TO_CHANNELS
import torch
import torch.utils.data as ... | [
"torch.stack",
"torch.utils.data.DataLoader",
"torch.sum"
] | 1.0.1 | jozhang97/Side-tuning | dea345691fb7ee0230150fe56ddd644efdffa6ac |
1.0 | from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
setup(
name='retinanet',
version='0.1',
description='Fast and accurate single shot object detector',
author = 'NVIDIA Corporation',
author_email='fchabert@nvidia.com',
packages=['retinanet', 'retina... | [
"torch.utils.cpp_extension.CUDAExtension",
"torch.utils.cpp_extension.BuildExtension.with_options"
] | 1.0.0 | abhinavagarwalla/MAL-inference-deepsort | 3dc2010f76dc249e60d3e970247faa7e7c5ffca6 |
1.0 | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License... | [
"torch.nn.Linear",
"torch.cat",
"torch.ne",
"torch.ones",
"torch.nn.CrossEntropyLoss",
"torch.nn.LayerNorm",
"torch.nn.Softmax",
"torch.tensor",
"torch.cuda.device_count",
"torch.cuda.set_device",
"torch.cuda.empty_cache",
"torch.matmul",
"torch.nn.Dropout",
"torch.nn.MSELoss",
"torch.ar... | 1.0 | KanaCS/transformers | d4ba8ec0d56a332fdc66d0339db4dfe1a9af7af0 |
1.7 | import torch
import torch.nn as nn
from pytorch_models.MF import BaseMF
class GMF(BaseMF):
def __init__(self, hyper_params):
super(GMF, self).__init__(hyper_params)
self.final = nn.Linear(hyper_params['latent_size'], 1)
self.dropout = nn.Dropout(hyper_params['dropout'])
def g... | [
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.cat",
"torch.no_grad",
"torch.nn.ReLU",
"torch.nn.Embedding"
] | 1.7.0 | noveens/sampling_cf | e135819b1e7310ee58edbbd138f303e5240a2619 |
1.0 | """
This is an implementation of R2D2(Soft Actor Critic ver).
See https://openreview.net/pdf?id=r1lyTjAqYX and https://arxiv.org/abs/1801.01290
"""
import torch
import torch.nn as nn
from machina import loss_functional as lf
from machina import logger
from machina.traj import traj_functional as tf
def train(traj,
... | [
"torch.arange"
] | 1.0.1 | krish-dx/machina | f93bb6f5aca1feccd71fc509bd6370d2015e2d85 |
1.4 | from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CUDA_HOME
from torch.utils.cpp_extension import CppExtension, CUDAExtension
# In any case, include the CPU version
modules = [
CppExtension('torchsearchsorted.cpu',
['src/cpu/searchsorted_cpu_w... | [
"torch.utils.cpp_extension.CUDAExtension",
"torch.utils.cpp_extension.CppExtension"
] | 1.4.0 | small-zeng/nerf-pytorch | 59b5fc655e1c22cd42dfa4a1617ba6feb8ce3464 |
1.5 | """ Each encoder should have following attributes and methods and be inherited from `_base.EncoderMixin`
Attributes:
_out_channels (list of int): specify number of channels for each encoder feature tensor
_depth (int): specify number of stages in decoder (in other words number of downsampling operations)
... | [
"torch.nn.Identity"
] | 1.5.0 | PVSemk/segmentation_models.pytorch | 8d9b033be918dfc1e6186d9ef404cc7d2c171e8d |
1.3 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# NOTE: To be removed once (if) https://github.com/pytorch/pytorch/pull/37385 lands
from __future__ import annotations... | [
"torch.typename"
] | 1.3 | SamuelMarks/botorch | 7801e2f56dc447322b2b6c92cab683d8900e4c7f |
1.3 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from botorch.utils.testing import BotorchTestCase, MockModel, MockPosterior
class TestMock(BotorchTestCa... | [
"torch.Size",
"torch.rand",
"torch.equal",
"torch.eye",
"torch.empty"
] | 1.3 | SamuelMarks/botorch | 7801e2f56dc447322b2b6c92cab683d8900e4c7f |
1.3 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import warnings
import torch
from botorch.cross_validation import batch_cross_validation, gen_loo_cv_... | [
"torch.Size",
"torch.full_like"
] | 1.3 | SamuelMarks/botorch | 7801e2f56dc447322b2b6c92cab683d8900e4c7f |
3 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG),
# acting on behalf of its Max Planck Institute for Intelligent Systems and the
# Max Planck Institute for Biological Cybernetics. All rights reserved.
#
# Max-Planck-Gesellschaft zur Förderung der Wissens... | [
"torch.zeros"
] | 3 | zokin/human_body_prior | 0278cb45180992e4d39ba1a11601f5ecc53ee148 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.