Skip to content

Latest commit

 

History

History
849 lines (538 loc) · 12.1 KB

nn.rst

File metadata and controls

849 lines (538 loc) · 12.1 KB

torch.nn

.. automodule:: torch.nn
.. currentmodule:: torch.nn

Parameters

.. autoclass:: Parameter
    :members:

Containers

Module

.. autoclass:: Module
    :members:

Sequential

.. autoclass:: Sequential
    :members:

ModuleList

.. autoclass:: ModuleList
    :members:

ParameterList

.. autoclass:: ParameterList
    :members:

Convolution Layers

Conv1d

.. autoclass:: Conv1d
    :members:

Conv2d

.. autoclass:: Conv2d
    :members:

Conv3d

.. autoclass:: Conv3d
    :members:

ConvTranspose1d

.. autoclass:: ConvTranspose1d
    :members:

ConvTranspose2d

.. autoclass:: ConvTranspose2d
    :members:

ConvTranspose3d

.. autoclass:: ConvTranspose3d
    :members:


Pooling Layers

MaxPool1d

.. autoclass:: MaxPool1d
    :members:

MaxPool2d

.. autoclass:: MaxPool2d
    :members:

MaxPool3d

.. autoclass:: MaxPool3d
    :members:

MaxUnpool1d

.. autoclass:: MaxUnpool1d
    :members:

MaxUnpool2d

.. autoclass:: MaxUnpool2d
    :members:

MaxUnpool3d

.. autoclass:: MaxUnpool3d
    :members:

AvgPool1d

.. autoclass:: AvgPool1d
    :members:

AvgPool2d

.. autoclass:: AvgPool2d
    :members:

AvgPool3d

.. autoclass:: AvgPool3d
    :members:

FractionalMaxPool2d

.. autoclass:: FractionalMaxPool2d
    :members:

LPPool2d

.. autoclass:: LPPool2d
    :members:

AdaptiveMaxPool1d

.. autoclass:: AdaptiveMaxPool1d
    :members:

AdaptiveMaxPool2d

.. autoclass:: AdaptiveMaxPool2d
    :members:

AdaptiveAvgPool1d

.. autoclass:: AdaptiveAvgPool1d
    :members:

AdaptiveAvgPool2d

.. autoclass:: AdaptiveAvgPool2d
    :members:


Non-linear Activations

ReLU

.. autoclass:: ReLU
    :members:

ReLU6

.. autoclass:: ReLU6
    :members:

ELU

.. autoclass:: ELU
    :members:

PReLU

.. autoclass:: PReLU
    :members:

LeakyReLU

.. autoclass:: LeakyReLU
    :members:

Threshold

.. autoclass:: Threshold
    :members:

Hardtanh

.. autoclass:: Hardtanh
    :members:

Sigmoid

.. autoclass:: Sigmoid
    :members:

Tanh

.. autoclass:: Tanh
    :members:

LogSigmoid

.. autoclass:: LogSigmoid
    :members:

Softplus

.. autoclass:: Softplus
    :members:

Softshrink

.. autoclass:: Softshrink
    :members:

Softsign

.. autoclass:: Softsign
    :members:

Tanhshrink

.. autoclass:: Tanhshrink
    :members:

Softmin

.. autoclass:: Softmin
    :members:

Softmax

.. autoclass:: Softmax
    :members:

LogSoftmax

.. autoclass:: LogSoftmax
    :members:


Normalization layers

BatchNorm1d

.. autoclass:: BatchNorm1d
    :members:

BatchNorm2d

.. autoclass:: BatchNorm2d
    :members:

BatchNorm3d

.. autoclass:: BatchNorm3d
    :members:


Recurrent layers

RNN

.. autoclass:: RNN
    :members:

LSTM

.. autoclass:: LSTM
    :members:

GRU

.. autoclass:: GRU
    :members:

RNNCell

.. autoclass:: RNNCell
    :members:

LSTMCell

.. autoclass:: LSTMCell
    :members:

GRUCell

.. autoclass:: GRUCell
    :members:

Linear layers

Linear

.. autoclass:: Linear
    :members:


Dropout layers

Dropout

.. autoclass:: Dropout
    :members:

Dropout2d

.. autoclass:: Dropout2d
    :members:

Dropout3d

.. autoclass:: Dropout3d
    :members:


Sparse layers

Embedding

.. autoclass:: Embedding
    :members:

Distance functions

PairwiseDistance

.. autoclass:: PairwiseDistance
    :members:


Loss functions

L1Loss

.. autoclass:: L1Loss
    :members:

MSELoss

.. autoclass:: MSELoss
    :members:

CrossEntropyLoss

.. autoclass:: CrossEntropyLoss
    :members:

NLLLoss

.. autoclass:: NLLLoss
    :members:

NLLLoss2d

.. autoclass:: NLLLoss2d
    :members:

KLDivLoss

.. autoclass:: KLDivLoss
    :members:

BCELoss

.. autoclass:: BCELoss
    :members:

MarginRankingLoss

.. autoclass:: MarginRankingLoss
    :members:

HingeEmbeddingLoss

.. autoclass:: HingeEmbeddingLoss
    :members:

MultiLabelMarginLoss

.. autoclass:: MultiLabelMarginLoss
    :members:

SmoothL1Loss

.. autoclass:: SmoothL1Loss
    :members:

SoftMarginLoss

.. autoclass:: SoftMarginLoss
    :members:

MultiLabelSoftMarginLoss

.. autoclass:: MultiLabelSoftMarginLoss
    :members:

CosineEmbeddingLoss

.. autoclass:: CosineEmbeddingLoss
    :members:

MultiMarginLoss

.. autoclass:: MultiMarginLoss
    :members:


Vision layers

PixelShuffle

.. autoclass:: PixelShuffle
    :members:

UpsamplingNearest2d

.. autoclass:: UpsamplingNearest2d
    :members:

UpsamplingBilinear2d

.. autoclass:: UpsamplingBilinear2d
    :members:


Multi-GPU layers

DataParallel

.. autoclass:: DataParallel
    :members:


Utilities

clip_grad_norm

.. autofunction:: torch.nn.utils.clip_grad_norm


.. currentmodule:: torch.nn.utils.rnn

PackedSequence

.. autofunction:: torch.nn.utils.rnn.PackedSequence


pack_padded_sequence

.. autofunction:: torch.nn.utils.rnn.pack_padded_sequence


pad_packed_sequence

.. autofunction:: torch.nn.utils.rnn.pad_packed_sequence


torch.nn.functional

.. currentmodule:: torch.nn.functional

Convolution functions

conv1d

.. autofunction:: conv1d

conv2d

.. autofunction:: conv2d

conv3d

.. autofunction:: conv3d

conv_transpose1d

.. autofunction:: conv_transpose1d

conv_transpose2d

.. autofunction:: conv_transpose2d

conv_transpose3d

.. autofunction:: conv_transpose3d

Pooling functions

avg_pool1d

.. autofunction:: avg_pool1d

avg_pool2d

.. autofunction:: avg_pool2d

avg_pool3d

.. autofunction:: avg_pool3d

max_pool1d

.. autofunction:: max_pool1d

max_pool2d

.. autofunction:: max_pool2d

max_pool3d

.. autofunction:: max_pool3d

max_unpool1d

.. autofunction:: max_unpool1d

max_unpool2d

.. autofunction:: max_unpool2d

max_unpool3d

.. autofunction:: max_unpool3d

lp_pool2d

.. autofunction:: lp_pool2d

adaptive_max_pool1d

.. autofunction:: adaptive_max_pool1d

adaptive_max_pool2d

.. autofunction:: adaptive_max_pool2d

adaptive_avg_pool1d

.. autofunction:: adaptive_avg_pool1d

adaptive_avg_pool2d

.. autofunction:: adaptive_avg_pool2d


Non-linear activation functions

threshold

.. autofunction:: threshold


relu

.. autofunction:: relu

hardtanh

.. autofunction:: hardtanh

relu6

.. autofunction:: relu6

elu

.. autofunction:: elu

leaky_relu

.. autofunction:: leaky_relu

prelu

.. autofunction:: prelu

rrelu

.. autofunction:: rrelu

logsigmoid

.. autofunction:: logsigmoid

hardshrink

.. autofunction:: hardshrink

tanhshrink

.. autofunction:: tanhshrink

softsign

.. autofunction:: softsign

softplus

.. autofunction:: softplus

softmin

.. autofunction:: softmin

softmax

.. autofunction:: softmax

softshrink

.. autofunction:: softshrink

log_softmax

.. autofunction:: log_softmax

tanh

.. autofunction:: tanh

sigmoid

.. autofunction:: sigmoid

Normalization functions

batch_norm

.. autofunction:: batch_norm

Linear functions

linear

.. autofunction:: linear

Dropout functions

dropout

.. autofunction:: dropout

Distance functions

pairwise_distance

.. autofunction:: pairwise_distance


Loss functions

nll_loss

.. autofunction:: nll_loss


kl_div

.. autofunction:: kl_div

cross_entropy

.. autofunction:: cross_entropy

binary_cross_entropy

.. autofunction:: binary_cross_entropy

smooth_l1_loss

.. autofunction:: smooth_l1_loss

Vision functions

pixel_shuffle

.. autofunction:: pixel_shuffle

pad

.. autofunction:: pad

torch.nn.init

.. currentmodule:: torch.nn.init
.. autofunction:: uniform
.. autofunction:: normal
.. autofunction:: constant
.. autofunction:: xavier_uniform
.. autofunction:: xavier_normal
.. autofunction:: kaiming_uniform
.. autofunction:: kaiming_normal
.. autofunction:: orthogonal
.. autofunction:: sparse