What is the equivalent of the W_regularizer parameter in Keras 2.x?

Trying to do the exercises with Python 3, TF, and Keras 2 and looking at this code in lesson 4:

def embedding_input(name, n_in, n_out, reg):
    inp = Input(shape=(1,), dtype='int64', name=name)
    return inp, Embedding(n_in, n_out, input_length=1, W_regularizer=l2(reg))(inp)

There are several regularization parameters now and I’m not sure what they do or which one is the replacement for the W_regularizer param above.

Refer this:- https://github.com/fchollet/keras/wiki/Keras-2.0-release-notes

1 Like

From keras doc:

embeddings_regularizer: Regularizer function applied to the embeddings matrix (see regularizer).

In general, http://keras.io comes in really handy for short examples and questions around the syntax.

That is super helpful! gratzi.

1 Like