Ashton T. Sperry
Ashton T. Sperry

Reputation: 145

LSTM Regularizers

I wish to use an L1 or L2 regularizer on my layers in my stacked LSTM. However, I can't tell which one of kernel_regularizer=None, recurrent_regularizer=None, bias_regularizer=None I should select and modify. Any help would be appreciated.

Upvotes: 1

Views: 2602

Answers (1)

Leo
Leo

Reputation: 173

For example , for l2 regularizer

from keras.regularizers import l2


Bidirectional(LSTM(LSTM_unit, kernel_regularizer=l2(0.05),recurrent_regularizer=l2(0.05), return_sequences=True, dropout=dropout))(x)

Upvotes: 1

Related Questions