Keras 2 API tips

“Old” Keras Dense declaration in Keras 2 API :

model.add(Dense(11, input_dim=11, init=”uniform”, activation=”relu”))

is now:

Dense(11, input_dim=11, activation=”relu”, kernel_initializer=”uniform”)

If when adding you

  • TypeError: add() got an unexpected keyword argument ‘init’

 

UserWarning: The `nb_epoch` argument in `fit` has been renamed `epochs`.
warnings.warn(‘The `nb_epoch` argument in `fit` ‘

Leave a Reply

Your email address will not be published. Required fields are marked *