1d convolutional lstm similar to an lstm layer but the input transformations and recurrent transformations are both convolutional args filters int the dimension of the output space the number of filters in the convolution kernelsize int or tuplelist of 1 integer specifying the size of the convolution window strides int or tuplelist of 1 integer specifying the stride length of the convolution strides 1 is incompatible with dilationrate 1 padding string valid or same caseinsensitive valid means no padding same results in padding evenly to the leftright or updown of the input such that output has the same heightwidth dimension as the input dataformat string either channelslast or channelsfirst the ordering of the dimensions in the inputs channelslast corresponds to inputs with shape batch steps features while channelsfirst corresponds to inputs with shape batch features steps it defaults to the imagedataformat value found in your keras config file at keraskeras json if you never set it then it will be channelslast dilationrate int or tuplelist of 1 integers specifying the dilation rate to use for dilated convolution activation activation function to use by default hyperbolic tangent activation function is applied tanhx recurrentactivation activation function to use for the recurrent step usebias boolean whether the layer uses a bias vector kernelinitializer initializer for the kernel weights matrix used for the linear transformation of the inputs recurrentinitializer initializer for the recurrentkernel weights matrix used for the linear transformation of the recurrent state biasinitializer initializer for the bias vector unitforgetbias boolean if true add 1 to the bias of the forget gate at initialization use in combination with biasinitializerzeros this is recommended in jozefowicz et al 2015 http www jmlr orgproceedingspapersv37jozefowicz15 pdf kernelregularizer regularizer function applied to the kernel weights matrix recurrentregularizer regularizer function applied to the recurrentkernel weights matrix biasregularizer regularizer function applied to the bias vector activityregularizer regularizer function applied to kernelconstraint constraint function applied to the kernel weights matrix recurrentconstraint constraint function applied to the recurrentkernel weights matrix biasconstraint constraint function applied to the bias vector dropout float between 0 and 1 fraction of the units to drop for the linear transformation of the inputs recurrentdropout float between 0 and 1 fraction of the units to drop for the linear transformation of the recurrent state seed random seed for dropout returnsequences boolean whether to return the last output in the output sequence or the full sequence default false returnstate boolean whether to return the last state in addition to the output default false gobackwards boolean default false if true process the input sequence backwards and return the reversed sequence stateful boolean default false if true the last state for each sample at index i in a batch will be used as initial state for the sample of index i in the following batch unroll boolean default false if true the network will be unrolled else a symbolic loop will be used unrolling can speedup a rnn although it tends to be more memoryintensive unrolling is only suitable for short sequences call arguments inputs a 4d tensor initialstate list of initial state tensors to be passed to the first call of the cell mask binary tensor of shape samples timesteps indicating whether a given timestep should be masked training python boolean indicating whether the layer should behave in training mode or in inference mode this is only relevant if dropout or recurrentdropout are set input shape if dataformatchannelsfirst 4d tensor with shape samples time channels rows if dataformatchannelslast 4d tensor with shape samples time rows channels output shape if returnstate a list of tensors the first tensor is the output the remaining tensors are the last states each 3d tensor with shape samples filters newrows if dataformat channelsfirst or shape samples newrows filters if dataformat channelslast rows values might have changed due to padding if returnsequences 4d tensor with shape samples timesteps filters newrows if dataformat channelsfirst or shape samples timesteps newrows filters if dataformat channelslast else 3d tensor with shape samples filters newrows if dataformat channelsfirst or shape samples newrows filters if dataformat channelslast references shi et al 2015http arxiv orgabs1506 04214v1 the current implementation does not include the feedback loop on the cells output 1d convolutional lstm similar to an lstm layer but the input transformations and recurrent transformations are both convolutional args filters int the dimension of the output space the number of filters in the convolution kernel_size int or tuple list of 1 integer specifying the size of the convolution window strides int or tuple list of 1 integer specifying the stride length of the convolution strides 1 is incompatible with dilation_rate 1 padding string valid or same case insensitive valid means no padding same results in padding evenly to the left right or up down of the input such that output has the same height width dimension as the input data_format string either channels_last or channels_first the ordering of the dimensions in the inputs channels_last corresponds to inputs with shape batch steps features while channels_first corresponds to inputs with shape batch features steps it defaults to the image_data_format value found in your keras config file at keras keras json if you never set it then it will be channels_last dilation_rate int or tuple list of 1 integers specifying the dilation rate to use for dilated convolution activation activation function to use by default hyperbolic tangent activation function is applied tanh x recurrent_activation activation function to use for the recurrent step use_bias boolean whether the layer uses a bias vector kernel_initializer initializer for the kernel weights matrix used for the linear transformation of the inputs recurrent_initializer initializer for the recurrent_kernel weights matrix used for the linear transformation of the recurrent state bias_initializer initializer for the bias vector unit_forget_bias boolean if true add 1 to the bias of the forget gate at initialization use in combination with bias_initializer zeros this is recommended in jozefowicz et al 2015 http www jmlr org proceedings papers v37 jozefowicz15 pdf kernel_regularizer regularizer function applied to the kernel weights matrix recurrent_regularizer regularizer function applied to the recurrent_kernel weights matrix bias_regularizer regularizer function applied to the bias vector activity_regularizer regularizer function applied to kernel_constraint constraint function applied to the kernel weights matrix recurrent_constraint constraint function applied to the recurrent_kernel weights matrix bias_constraint constraint function applied to the bias vector dropout float between 0 and 1 fraction of the units to drop for the linear transformation of the inputs recurrent_dropout float between 0 and 1 fraction of the units to drop for the linear transformation of the recurrent state seed random seed for dropout return_sequences boolean whether to return the last output in the output sequence or the full sequence default false return_state boolean whether to return the last state in addition to the output default false go_backwards boolean default false if true process the input sequence backwards and return the reversed sequence stateful boolean default false if true the last state for each sample at index i in a batch will be used as initial state for the sample of index i in the following batch unroll boolean default false if true the network will be unrolled else a symbolic loop will be used unrolling can speed up a rnn although it tends to be more memory intensive unrolling is only suitable for short sequences call arguments inputs a 4d tensor initial_state list of initial state tensors to be passed to the first call of the cell mask binary tensor of shape samples timesteps indicating whether a given timestep should be masked training python boolean indicating whether the layer should behave in training mode or in inference mode this is only relevant if dropout or recurrent_dropout are set input shape if data_format channels_first 4d tensor with shape samples time channels rows if data_format channels_last 4d tensor with shape samples time rows channels output shape if return_state a list of tensors the first tensor is the output the remaining tensors are the last states each 3d tensor with shape samples filters new_rows if data_format channels_first or shape samples new_rows filters if data_format channels_last rows values might have changed due to padding if return_sequences 4d tensor with shape samples timesteps filters new_rows if data_format channels_first or shape samples timesteps new_rows filters if data_format channels_last else 3d tensor with shape samples filters new_rows if data_format channels_first or shape samples new_rows filters if data_format channels_last references shi et al 2015 http arxiv org abs 1506 04214v1 the current implementation does not include the feedback loop on the cells output
from keras.api_export import keras_export
from keras.layers.rnn.conv_lstm import ConvLSTM


@keras_export("keras.layers.ConvLSTM1D")
class ConvLSTM1D(ConvLSTM):
    

    def __init__(
        self,
        filters,
        kernel_size,
        strides=1,
        padding="valid",
        data_format=None,
        dilation_rate=1,
        activation="tanh",
        recurrent_activation="sigmoid",
        use_bias=True,
        kernel_initializer="glorot_uniform",
        recurrent_initializer="orthogonal",
        bias_initializer="zeros",
        unit_forget_bias=True,
        kernel_regularizer=None,
        recurrent_regularizer=None,
        bias_regularizer=None,
        activity_regularizer=None,
        kernel_constraint=None,
        recurrent_constraint=None,
        bias_constraint=None,
        dropout=0.0,
        recurrent_dropout=0.0,
        seed=None,
        return_sequences=False,
        return_state=False,
        go_backwards=False,
        stateful=False,
        **kwargs
    ):
        super().__init__(
            rank=1,
            filters=filters,
            kernel_size=kernel_size,
            strides=strides,
            padding=padding,
            data_format=data_format,
            dilation_rate=dilation_rate,
            activation=activation,
            recurrent_activation=recurrent_activation,
            use_bias=use_bias,
            kernel_initializer=kernel_initializer,
            recurrent_initializer=recurrent_initializer,
            bias_initializer=bias_initializer,
            unit_forget_bias=unit_forget_bias,
            kernel_regularizer=kernel_regularizer,
            recurrent_regularizer=recurrent_regularizer,
            bias_regularizer=bias_regularizer,
            activity_regularizer=activity_regularizer,
            kernel_constraint=kernel_constraint,
            recurrent_constraint=recurrent_constraint,
            bias_constraint=bias_constraint,
            return_sequences=return_sequences,
            return_state=return_state,
            go_backwards=go_backwards,
            stateful=stateful,
            dropout=dropout,
            recurrent_dropout=recurrent_dropout,
            seed=seed,
            **kwargs
        )