Conv1d
Source:R/gen-namespace-docs.R
, R/gen-namespace-examples.R
, R/gen-namespace.R
torch_conv1d.Rd
Conv1d
Usage
torch_conv1d(
input,
weight,
bias = list(),
stride = 1L,
padding = 0L,
dilation = 1L,
groups = 1L
)
Arguments
- input
input tensor of shape
- weight
filters of shape
- bias
optional bias of shape
. Default:NULL
- stride
the stride of the convolving kernel. Can be a single number or a one-element tuple
(sW,)
. Default: 1- padding
implicit paddings on both sides of the input. Can be a single number or a one-element tuple
(padW,)
. Default: 0- dilation
the spacing between kernel elements. Can be a single number or a one-element tuple
(dW,)
. Default: 1- groups
split input into groups,
should be divisible by the number of groups. Default: 1
conv1d(input, weight, bias=NULL, stride=1, padding=0, dilation=1, groups=1) -> Tensor
Applies a 1D convolution over an input signal composed of several input planes.
See nn_conv1d()
for details and output shape.
Examples
if (torch_is_installed()) {
filters = torch_randn(c(33, 16, 3))
inputs = torch_randn(c(20, 16, 50))
nnf_conv1d(inputs, filters)
}
#> torch_tensor
#> (1,.,.) =
#> Columns 1 to 6 3.3138e+00 5.2831e+00 -3.6100e-01 8.5751e+00 -7.5582e+00 7.1657e+00
#> -6.9027e-01 1.0045e+01 3.5643e+00 -2.7117e+00 -7.2237e-01 -3.9413e+00
#> 1.1112e+01 -7.6729e+00 3.3359e+00 4.4755e+00 2.5863e+00 -6.0993e+00
#> -1.1272e+01 1.9350e+00 6.5178e+00 1.3242e+00 -6.5695e+00 -1.0605e+00
#> 8.6817e+00 9.3736e+00 -5.6530e+00 -1.1066e+01 4.3468e+00 3.0705e+00
#> 1.5094e+01 -5.8340e+00 -6.4525e+00 1.7200e+01 -7.3534e+00 -3.9700e+00
#> -4.3259e+00 4.0588e+00 -5.6747e+00 9.9656e+00 -4.5051e-01 -4.0336e+00
#> -1.0973e+00 2.1664e+00 -9.0107e+00 -1.5702e+00 8.0957e+00 -4.6894e+00
#> -8.2211e+00 6.2246e+00 -3.6846e+00 6.7496e+00 1.4534e+01 -2.1186e+00
#> 4.8683e+00 7.7937e+00 -3.0392e+00 -2.0859e+00 -3.4783e+00 1.8398e+00
#> 9.2526e+00 -4.6622e+00 -1.0056e+00 1.4893e+00 3.3024e-03 1.2059e+00
#> -6.1647e+00 -9.8327e-02 -1.7899e+00 -3.9404e+00 -1.0753e+01 4.9760e+00
#> -4.2930e+00 5.9204e+00 1.0420e+01 9.3273e+00 9.4540e+00 -9.5593e+00
#> -9.1599e+00 6.2520e+00 8.3160e+00 4.2140e+00 6.4604e+00 2.3919e+01
#> 3.1060e-01 1.1038e+01 -9.5605e+00 6.7080e-01 -5.4680e+00 2.9316e+00
#> -4.0572e+00 5.7505e-01 1.8635e+01 -9.0718e+00 3.1621e+00 -5.0485e+00
#> 1.0224e+01 -3.7857e+00 -1.2988e+00 2.4912e-01 1.3080e+00 5.7272e+00
#> 5.4048e+00 -2.6134e+00 6.2623e+00 -6.5883e+00 2.9521e+00 5.3387e+00
#> 1.4152e+00 1.9596e+00 6.5169e+00 2.9685e+00 -5.4254e+00 -2.1582e+00
#> 7.5147e+00 -1.5426e+01 9.7988e+00 8.8575e+00 -5.3817e+00 -1.4181e+00
#> -1.5920e+00 5.7191e-01 5.1648e+00 -7.4741e+00 -2.2688e+00 2.8646e-01
#> 9.2518e+00 6.1289e-01 -3.4668e-01 7.0295e+00 -1.6571e+01 -2.4456e+00
#> 6.0348e+00 3.6638e+00 1.7295e+00 -5.4043e+00 2.4957e+00 2.2121e+00
#> 1.1415e+01 2.8437e+00 -3.2786e+00 -7.4129e+00 6.3505e+00 -4.5731e+00
#> -6.6319e+00 -3.9537e-01 3.8207e+00 -8.5019e+00 -4.9140e+00 6.0571e+00
#> 1.6972e+00 -2.2713e+00 -1.0640e+01 -1.9947e+00 1.4233e+01 8.1856e+00
#> -8.4049e+00 1.3405e+00 9.9549e+00 -4.3117e+00 -9.1328e+00 -5.1785e+00
#> -8.6204e+00 1.2829e+01 -4.5831e+00 -2.1847e+00 -3.1013e+00 7.5992e-01
#> 8.0891e+00 1.2587e+01 3.6894e+00 7.1494e+00 3.7426e+00 4.3475e+00
#> ... [the output was truncated (use n=-1 to disable)]
#> [ CPUFloatType{20,33,48} ]