Skip to content

Latest commit

 

History

History
537 lines (324 loc) · 8.21 KB

nn.functional.rst

File metadata and controls

537 lines (324 loc) · 8.21 KB

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

unfold

.. autofunction:: unfold

fold

.. autofunction:: fold

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_pool1d

.. autofunction:: lp_pool1d

lp_pool2d

.. autofunction:: lp_pool2d

adaptive_max_pool1d

.. autofunction:: adaptive_max_pool1d

adaptive_max_pool2d

.. autofunction:: adaptive_max_pool2d

adaptive_max_pool3d

.. autofunction:: adaptive_max_pool3d

adaptive_avg_pool1d

.. autofunction:: adaptive_avg_pool1d

adaptive_avg_pool2d

.. autofunction:: adaptive_avg_pool2d

adaptive_avg_pool3d

.. autofunction:: adaptive_avg_pool3d


Non-linear activation functions

threshold

.. autofunction:: threshold
.. autofunction:: threshold_


relu

.. autofunction:: relu
.. autofunction:: relu_

hardtanh

.. autofunction:: hardtanh
.. autofunction:: hardtanh_

hardswish

.. autofunction:: hardswish

relu6

.. autofunction:: relu6

elu

.. autofunction:: elu
.. autofunction:: elu_

selu

.. autofunction:: selu

celu

.. autofunction:: celu

leaky_relu

.. autofunction:: leaky_relu
.. autofunction:: leaky_relu_

prelu

.. autofunction:: prelu

rrelu

.. autofunction:: rrelu
.. autofunction:: rrelu_

glu

.. autofunction:: glu

gelu

.. autofunction:: gelu

logsigmoid

.. autofunction:: logsigmoid

hardshrink

.. autofunction:: hardshrink

tanhshrink

.. autofunction:: tanhshrink

softsign

.. autofunction:: softsign

softplus

.. autofunction:: softplus

softmin

.. autofunction:: softmin

softmax

.. autofunction:: softmax

softshrink

.. autofunction:: softshrink

gumbel_softmax

.. autofunction:: gumbel_softmax

log_softmax

.. autofunction:: log_softmax

tanh

.. autofunction:: tanh

sigmoid

.. autofunction:: sigmoid

hardsigmoid

.. autofunction:: hardsigmoid

silu

.. autofunction:: silu


Normalization functions

batch_norm

.. autofunction:: batch_norm

instance_norm

.. autofunction:: instance_norm

layer_norm

.. autofunction:: layer_norm

local_response_norm

.. autofunction:: local_response_norm

normalize

.. autofunction:: normalize

Linear functions

linear

.. autofunction:: linear

bilinear

.. autofunction:: bilinear

Dropout functions

dropout

.. autofunction:: dropout

alpha_dropout

.. autofunction:: alpha_dropout

feature_alpha_dropout

.. autofunction:: feature_alpha_dropout

dropout2d

.. autofunction:: dropout2d

dropout3d

.. autofunction:: dropout3d

Sparse functions

embedding

.. autofunction:: embedding

embedding_bag

.. autofunction:: embedding_bag

one_hot

.. autofunction:: one_hot

Distance functions

pairwise_distance

.. autofunction:: pairwise_distance

cosine_similarity

.. autofunction:: cosine_similarity

pdist

.. autofunction:: pdist


Loss functions

binary_cross_entropy

.. autofunction:: binary_cross_entropy

binary_cross_entropy_with_logits

.. autofunction:: binary_cross_entropy_with_logits

poisson_nll_loss

.. autofunction:: poisson_nll_loss

cosine_embedding_loss

.. autofunction:: cosine_embedding_loss

cross_entropy

.. autofunction:: cross_entropy

ctc_loss

.. autofunction:: ctc_loss

hinge_embedding_loss

.. autofunction:: hinge_embedding_loss

kl_div

.. autofunction:: kl_div

l1_loss

.. autofunction:: l1_loss

mse_loss

.. autofunction:: mse_loss

margin_ranking_loss

.. autofunction:: margin_ranking_loss

multilabel_margin_loss

.. autofunction:: multilabel_margin_loss

multilabel_soft_margin_loss

.. autofunction:: multilabel_soft_margin_loss

multi_margin_loss

.. autofunction:: multi_margin_loss

nll_loss

.. autofunction:: nll_loss

smooth_l1_loss

.. autofunction:: smooth_l1_loss

soft_margin_loss

.. autofunction:: soft_margin_loss

triplet_margin_loss

.. autofunction:: triplet_margin_loss

Vision functions

pixel_shuffle

.. autofunction:: pixel_shuffle

pad

.. autofunction:: pad

interpolate

.. autofunction:: interpolate

upsample

.. autofunction:: upsample

upsample_nearest

.. autofunction:: upsample_nearest

upsample_bilinear

.. autofunction:: upsample_bilinear

grid_sample

.. autofunction:: grid_sample

affine_grid

.. autofunction:: affine_grid

DataParallel functions (multi-GPU, distributed)

data_parallel

.. autofunction:: torch.nn.parallel.data_parallel