I have followed link : https://github.com/mayanksatnalika/ipython/blob/master/embeddings%20project/safe_driver/Safe_driver_Kaggle.ipynb
but getting error NameError: name 'Merge' is not defined when i am running the following block :
from keras.layers import *
from keras.models import *
models = []
for categoical_var in categoical_vars :
model = Sequential()
no_of_unique_cat = df_train[categoical_var].nunique()
embedding_size = min(np.ceil((no_of_unique_cat)/2), 50 )
embedding_size = int(embedding_size)
model.add( Embedding( no_of_unique_cat+1, embedding_size, input_length = 1 ) )
model.add(Reshape(target_shape=(embedding_size,)))
models.append( model )
model_rest = Sequential()
model_rest.add(Dense(16, input_dim= 43 ))
models.append(model_rest)
full_model = Sequential()
full_model.add(Merge(models, mode='concat'))
full_model.add(Dense(1000))
full_model.add(Activation('relu'))
full_model.add(Dense(400))
full_model.add(Activation('relu'))
full_model.add(Dense(200))
full_model.add(Activation('sigmoid'))
full_model.add(Dense(2))
full_model.add(Activation('sigmoid'))
full_model.compile(loss='binary_crossentropy', optimizer='adam',metrics=['accuracy'])
I am new to keras so followed many lniks .It seems Merge is not supported in Keras 2.0, tried many things but not able to get this working .
followed stackoverflow on these two, How to "Merge" Sequential models in Keras 2.0? and Keras - Merging layers - Keras 2.0 but not helping .