crested.tl.zoo.deeptopic_lstm

Contents

crested.tl.zoo.deeptopic_lstm#

crested.tl.zoo.deeptopic_lstm(seq_len, num_classes, filters=300, first_kernel_size=30, max_pool_size=15, max_pool_stride=5, dense_out=256, lstm_out=128, first_activation='relu', activation='relu', output_activation='sigmoid', lstm_do=0.1, dense_do=0.4, pre_dense_do=0.2, motifs_path=None)#

Construct a DeepTopicLSTM model. Usually used for topic classification.

Parameters:
  • seq_len (int) – Width of the input region.

  • num_classes (int) – Number of classes to predict.

  • filters (int (default: 300)) – Number of filters in the first convolutional layer. Followed by halving in subsequent layers.

  • first_kernel_size (int (default: 30)) – Size of the kernel in the first convolutional layer.

  • max_pool_size (int (default: 15)) – Size of the max pooling kernel.

  • max_pool_stride (int (default: 5)) – Stride of the max pooling kernel.

  • dense_out (int (default: 256)) – Number of neurons in the dense layer.

  • lstm_out (int (default: 128)) – Number of units in the lstm layer.

  • first_activation (str (default: 'relu')) – Activation function for the first conv block.

  • activation (str (default: 'relu')) – Activation function for subsequent blocks.

  • output_activation (str (default: 'sigmoid')) – Activation function for the output layer.

  • lstm_do (float (default: 0.1)) – Dropout rate for the lstm layer.

  • dense_do (float (default: 0.4)) – Dropout rate for the dense layers.

  • pre_dense_do (float (default: 0.2)) – Dropout rate before the dense layers.

  • motifs_path (Optional[str] (default: None)) – Path to the motif file to initialize the convolutional weights.

Return type:

Model

Returns:

A Keras model.