Applies a 1D average pooling over an input signal composed of several input planes.
nn_module
Calls nn_avg_pool1d() during training.
Parameters
kernel_size::integer()
The size of the window. Can be a single number or a vector.stride::integer()
The stride of the window. Can be a single number or a vector. Default:kernel_size.padding::integer()
Implicit zero paddings on both sides of the input. Can be a single number or a vector. Default: 0.ceil_mode::logical(1)
WhenTRUE, will use ceil instead of floor to compute the output shape. Default:FALSE.count_include_pad::logical(1)
WhenTRUE, will include the zero-padding in the averaging calculation. Default:TRUE.divisor_override::numeric(1)
If specified, it will be used as divisor, otherwise size of the pooling region will be used. Default: NULL. Only available fornn_avg_pool2dandnn_avg_pool3d, i.e. this parameter does not exist fornn_avg_pool1d.
Input and Output Channels
One input channel called "input" and one output channel called "output".
For an explanation see PipeOpTorch.
Super classes
mlr3pipelines::PipeOp -> PipeOpTorch -> PipeOpTorchAvgPool -> PipeOpTorchAvgPool1D
Methods
PipeOpTorchAvgPool1D$new()
Creates a new instance of this R6 class.
Usage
PipeOpTorchAvgPool1D$new(id = "nn_avg_pool1d", param_vals = list())Arguments
id(
character(1))
Identifier of the resulting object.param_vals(
list())
List of hyperparameter settings, overwriting the hyperparameter settings that would otherwise be set during construction.
Examples
# Construct the PipeOp
pipeop = nn("avg_pool1d")
pipeop
#>
#> ── PipeOp <avg_pool1d>: not trained ────────────────────────────────────────────
#> Values: list()
#>
#> ── Input channels:
#> name train predict
#> <char> <char> <char>
#> input ModelDescriptor Task
#>
#> ── Output channels:
#> name train predict
#> <char> <char> <char>
#> output ModelDescriptor Task
# The available parameters
pipeop$param_set
#> <ParamSet(5)>
#> id class lower upper nlevels default value
#> <char> <char> <num> <num> <num> <list> <list>
#> 1: kernel_size ParamUty NA NA Inf <NoDefault[0]> [NULL]
#> 2: stride ParamUty NA NA Inf [NULL] [NULL]
#> 3: padding ParamUty NA NA Inf 0 [NULL]
#> 4: ceil_mode ParamLgl NA NA 2 FALSE [NULL]
#> 5: count_include_pad ParamLgl NA NA 2 TRUE [NULL]