Unit test with keras

Viewed 1247

I do have a machine learning application built on top of Keras. I've done writing methods like normalize_dataset , get_model, train_model, predict_class and so on. now I want to write a unit test for this method to assure that they are working correctly but I don't know how to do it.

Example:

def get_model():
    model = Sequential()
    model.add(Dense(32, activation='relu', input_dim=100))
    model.add(Dense(1, activation='sigmoid'))
    model.compile(optimizer='rmsprop',
                  loss='binary_crossentropy',
                  metrics=['accuracy'])
    return model

here I want to write a test for this method to be sure when I added more layer to my model it works just fine as now.

Update: much like the first example of this topic but via Keras.

0 Answers
Related