Class Conv1D
1D convolution layer (e.g. temporal convolution). This layer creates a convolution kernel that is convolved with the layer input over a single spatial(or temporal) dimension to produce a tensor of outputs.If use_bias is True, a bias vector is created and added to the outputs.Finally, if activation is not None, it is applied to the outputs as well. When using this layer as the first layer in a model, provide an input_shape argument (tuple of integers or None, does not include the batch axis), e.g. input_shape=(10, 128) for time series sequences of 10 time steps with 128 features per step in data_format="channels_last", or (None, 128) for variable-length sequences with 128 features per step.
Implements
Inherited Members
Namespace: Keras.Layers
Assembly: Keras.dll
Syntax
public class Conv1D : BaseLayer, IDisposable
Constructors
| Improve this Doc View SourceConv1D(Int32, Int32, Int32, String, String, Int32, String, Boolean, String, String, String, String, String, String, String, Shape)
Initializes a new instance of the Conv1D class.
Declaration
public Conv1D(int filters, int kernel_size, int strides = 1, string padding = "valid", string data_format = "channels_last", int dilation_rate = 1, string activation = "", bool use_bias = true, string kernel_initializer = "glorot_uniform", string bias_initializer = "zeros", string kernel_regularizer = "", string bias_regularizer = "", string activity_regularizer = "", string kernel_constraint = "", string bias_constraint = "", Shape input_shape = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | filters | Integer, the dimensionality of the output space (i.e. the number of output filters in the convolution). |
System.Int32 | kernel_size | An integer or tuple/list of a single integer, specifying the length of the 1D convolution window. |
System.Int32 | strides | An integer or tuple/list of a single integer, specifying the stride length of the convolution. Specifying any stride value != 1 is incompatible with specifying any dilation_rate value != 1. |
System.String | padding | One of "valid", "causal" or "same" (case-insensitive). "valid" means "no padding". "same" results in padding the input such that the output has the same length as the original input. "causal" results in causal (dilated) convolutions, e.g. output[t] does not depend on input[t + 1:]. A zero padding is used such that the output has the same length as the original input. Useful when modeling temporal data where the model should not violate the temporal order. See WaveNet: A Generative Model for Raw Audio, section 2.1. |
System.String | data_format | A string, one of "channels_last" (default) or "channels_first". The ordering of the dimensions in the inputs. "channels_last" corresponds to inputs with shape (batch, steps, channels) (default format for temporal data in Keras) while "channels_first" corresponds to inputs with shape (batch, channels, steps). |
System.Int32 | dilation_rate | an integer or tuple/list of a single integer, specifying the dilation rate to use for dilated convolution. Currently, specifying any dilation_rate value != 1 is incompatible with specifying any strides value != 1. |
System.String | activation | Activation function to use (see activations). If you don't specify anything, no activation is applied (ie. "linear" activation: a(x) = x). |
System.Boolean | use_bias | Boolean, whether the layer uses a bias vector. |
System.String | kernel_initializer | Initializer for the kernel weights matrix (see initializers). |
System.String | bias_initializer | Initializer for the bias vector (see initializers). |
System.String | kernel_regularizer | Regularizer function applied to the kernel weights matrix (see regularizer). |
System.String | bias_regularizer | Regularizer function applied to the bias vector (see regularizer). |
System.String | activity_regularizer | Regularizer function applied to the output of the layer (its "activation"). (see regularizer). |
System.String | kernel_constraint | Constraint function applied to the kernel matrix (see constraints). |
System.String | bias_constraint | Constraint function applied to the bias vector (see constraints). |
Shape | input_shape | 3D tensor with shape: (batch, steps, channels) |