How to create a multiple layer perceptron with layers of specific sizes in keras? I am trying to recreate a model based on its description. The model is described as a "10 layers of size 500 ... 10". From my understanding, the size refers to the number of hidden units, which I could customize using model.add(dense)

My code looks like this: 

model = Sequential() 
model.add(Conv2D(32, (3,3), activation='relu', input_shape=input_shape)
model.add(Dense(500, activation = 'relu')) 
... 
model.add(Dense(10, activation = 'softmax'))


However, it is yielding a very low accuracy rate (about 20% lower than what I was supposed to get). 

Am I doing something wrong?
There may be quite a lot of reasons for this. As I understand you try to repeat someone's results, and all you know is the architecture. Your keras architecture seems correct, but you should also take into account:


Data - did the authors used data augmentation? 
Regularizations, such as dropout, L1, L2, batch normalization - that can significantly influence your results.
Other hyper-parameters, like optimizer, batch size etc. Did you do a grid/random search of those? 


If you took all this into account, provide us with more complete training code, so we don't have to guess.