title: TypeError: ('Keyword argument not understood:', 'b_regularizer')
body: <p>Below is the code for my Python Script named NER_model.py
  The problem is with the line <strong>self.model.add</strong>, in the function named <strong>make_and_compile</strong>, where one of the input arguments is <strong>b_regularizer</strong>. Did the recent versions of Keras have a different name for 'b_regularizer' ?</p>
  <p>Can someone plz tell me how to resolve this error?</p>
  <pre><code># Keras imports
  from tensorflow import keras
  from keras.preprocessing import sequence
  from keras.models import Sequential
  from keras.layers import Dense
  from keras.layers import LSTM
  from keras.layers.wrappers import TimeDistributed
  from keras.layers.wrappers import Bidirectional
  from keras.layers.core import Dropout
  from keras.regularizers import l2
  from keras import metrics
  
  import numpy as np
  import pandas as pd
  from sklearn.metrics import confusion_matrix, classification_report
  
  
  class NER():
      def __init__(self, data_reader):
          self.data_reader = data_reader
          self.x, self.y = data_reader.get_data();
          self.model = None
          self.x_train = None
          self.y_train = None
          self.x_test = None
          self.y_test = None
  
      def make_and_compile(self, units = 150, dropout = 0.2, regul_alpha = 0.0):
          self.model = Sequential()
          # Bidirectional LSTM with 100 outputs/memory units
          self.model.add(Bidirectional(LSTM(units, 
                                            return_sequences=True,
                                            kernel_regularizer=l2(regul_alpha),
                                            b_regularizer=l2(regul_alpha)),
                                      input_shape = [self.data_reader.max_len, 
                                                     self.data_reader.LEN_WORD_VECTORS]))
          self.model.add(TimeDistributed(Dense(self.data_reader.LEN_NAMED_CLASSES, 
                                               activation='softmax',
                                               kernel_regularizer=l2(regul_alpha),
                                               b_regularizer=l2(regul_alpha))))
          self.model.add(Dropout(dropout))
          self.model.compile(loss='categorical_crossentropy',
                             optimizer='adam',
                             metrics=['accuracy'])
          print(self.model.summary())
  </code></pre>
  <p><strong>And the error is:</strong></p>
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  ~\6th SEM - NLP Project\NER_model.py in make_and_compile(self, units, dropout, regul_alpha)
       29                 self.model = Sequential()
       30                 # Bidirectional LSTM with 100 outputs/memory units
  ---&gt; 31         self.model.add(Bidirectional(LSTM(units, 
       32                                                                                   return_sequences=True,
       33                                                                                   kernel_regularizer=l2(regul_alpha),
  
  ~\AppData\Roaming\Python\Python39\site-packages\keras\layers\recurrent_v2.py in __init__(self, units, activation, recurrent_activation, use_bias, kernel_initializer, recurrent_initializer, bias_initializer, unit_forget_bias, kernel_regularizer, recurrent_regularizer, bias_regularizer, activity_regularizer, kernel_constraint, recurrent_constraint, bias_constraint, dropout, recurrent_dropout, return_sequences, return_state, go_backwards, stateful, time_major, unroll, **kwargs)
     1087     self.return_runtime = kwargs.pop('return_runtime', False)
     1088 
  -&gt; 1089     super(LSTM, self).__init__(
     1090         units,
     1091         activation=activation,
  
  ~\AppData\Roaming\Python\Python39\site-packages\keras\layers\recurrent.py in __init__(self, *args, **kwargs)
     1135   def __init__(self, *args, **kwargs):
     1136     self._create_non_trackable_mask_cache()
  -&gt; 1137     super(DropoutRNNCellMixin, self).__init__(*args, **kwargs)
     1138 
     1139   @tf.__internal__.tracking.no_automatic_dependency_tracking
  
  ~\AppData\Roaming\Python\Python39\site-packages\keras\layers\recurrent.py in __init__(self, units, activation, recurrent_activation, use_bias, kernel_initializer, recurrent_initializer, bias_initializer, unit_forget_bias, kernel_regularizer, recurrent_regularizer, bias_regularizer, activity_regularizer, kernel_constraint, recurrent_constraint, bias_constraint, dropout, recurrent_dropout, return_sequences, return_state, go_backwards, stateful, unroll, **kwargs)
     2816         trainable=kwargs.get('trainable', True),
     2817         **cell_kwargs)
  -&gt; 2818     super(LSTM, self).__init__(
     2819         cell,
     2820         return_sequences=return_sequences,
  
  ~\AppData\Roaming\Python\Python39\site-packages\keras\layers\recurrent.py in __init__(self, cell, return_sequences, return_state, go_backwards, stateful, unroll, time_major, **kwargs)
      417       kwargs['input_shape'] = input_shape
      418 
  --&gt; 419     super(RNN, self).__init__(**kwargs)
      420     self.cell = cell
      421     self.return_sequences = return_sequences
  
  ~\AppData\Roaming\Python\Python39\site-packages\tensorflow\python\training\tracking\base.py in _method_wrapper(self, *args, **kwargs)
      627     self._self_setattr_tracking = False  # pylint: disable=protected-access
      628     try:
  --&gt; 629       result = method(self, *args, **kwargs)
      630     finally:
      631       self._self_setattr_tracking = previous_value  # pylint: disable=protected-access
  
  ~\AppData\Roaming\Python\Python39\site-packages\keras\engine\base_layer.py in __init__(self, seed, force_generator, **kwargs)
     3436       **kwargs: other keyword arguments that will be passed to the parent class
     3437     &quot;&quot;&quot;
  -&gt; 3438     super().__init__(**kwargs)
     3439     self._random_generator = backend.RandomGenerator(
     3440         seed, force_generator=force_generator)
  
  ~\AppData\Roaming\Python\Python39\site-packages\tensorflow\python\training\tracking\base.py in _method_wrapper(self, *args, **kwargs)
      627     self._self_setattr_tracking = False  # pylint: disable=protected-access
      628     try:
  --&gt; 629       result = method(self, *args, **kwargs)
      630     finally:
      631       self._self_setattr_tracking = previous_value  # pylint: disable=protected-access
  
  ~\AppData\Roaming\Python\Python39\site-packages\keras\engine\base_layer.py in __init__(self, trainable, name, dtype, dynamic, **kwargs)
      339     }
      340     # Validate optional keyword arguments.
  --&gt; 341     generic_utils.validate_kwargs(kwargs, allowed_kwargs)
      342 
      343     # Mutable properties
  
  ~\AppData\Roaming\Python\Python39\site-packages\keras\utils\generic_utils.py in validate_kwargs(kwargs, allowed_kwargs, error_message)
     1172   for kwarg in kwargs:
     1173     if kwarg not in allowed_kwargs:
  -&gt; 1174       raise TypeError(error_message, kwarg)
     1175 
     1176 
  
  TypeError: ('Keyword argument not understood:', 'b_regularizer')
  </code></pre>