本文簡要介紹python語言中 torch.nn.LPPool1d
的用法。
用法:
class torch.nn.LPPool1d(norm_type, kernel_size, stride=None, ceil_mode=False)
kernel_size-單個 int,窗口的大小
stride-單個 int,窗口的步幅。默認值為
kernel_size
ceil_mode-當為 True 時,將使用
ceil
而不是floor
來計算輸出形狀
在由多個輸入平麵組成的輸入信號上應用 1D power-average 池化。
在每個窗口上,計算的函數是:
在 p = 時,獲得最大池化
在 p = 1 時,得到 Sum Pooling(與 Average Pooling 成正比)
注意
如果
p
的冪和為零,則未定義此函數的梯度。在這種情況下,此實現會將梯度設置為零。- 形狀:
輸入: 或 。
輸出: 或 ,其中
- 例子::
>>> # power-2 pool of window of length 3, with stride 2. >>> m = nn.LPPool1d(2, 3, stride=2) >>> input = torch.randn(20, 16, 50) >>> output = m(input)
參數:
相關用法
- Python PyTorch LPPool2d用法及代碼示例
- Python PyTorch LazyModuleMixin用法及代碼示例
- Python PyTorch LinearLR用法及代碼示例
- Python PyTorch LKJCholesky用法及代碼示例
- Python PyTorch L1Loss用法及代碼示例
- Python PyTorch LeakyReLU用法及代碼示例
- Python PyTorch LogSigmoid用法及代碼示例
- Python PyTorch LowRankMixtureCrossNet用法及代碼示例
- Python PyTorch LayerNorm用法及代碼示例
- Python PyTorch LineReader用法及代碼示例
- Python PyTorch LogNormal用法及代碼示例
- Python PyTorch LambdaLR用法及代碼示例
- Python PyTorch LocalResponseNorm用法及代碼示例
- Python PyTorch LSTM用法及代碼示例
- Python PyTorch LowRankMultivariateNormal用法及代碼示例
- Python PyTorch Linear用法及代碼示例
- Python torchrec.modules.crossnet.LowRankCrossNet用法及代碼示例
- Python PyTorch LogSoftmax用法及代碼示例
- Python PyTorch LSTMCell用法及代碼示例
- Python PyTorch LocalElasticAgent用法及代碼示例
- Python PyTorch Laplace用法及代碼示例
- Python PyTorch LazyModuleExtensionMixin.apply用法及代碼示例
- Python PyTorch LinearReLU用法及代碼示例
- Python PyTorch frexp用法及代碼示例
- Python PyTorch jvp用法及代碼示例
注:本文由純淨天空篩選整理自pytorch.org大神的英文原創作品 torch.nn.LPPool1d。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。