Reputation: 19
Here is the code:
model = keras.Sequential([keras.layers.Flatten(input_shape=(1,9000)),
keras.layers.Dense(100, activation=tf.nn.relu),
keras.layers.Dense(4, activation=tf.nn.softmax)])
model.compile(optimizer=tf.train.AdamOptimizer(),
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
history = model.fit(x_train, y_train, validation_split=0.20,epochs = 10, shuffle=False, verbose =1)
With every new run I get different loss and accuracy values for each epoch. I expect consistent results, how do I achieve that?
Upvotes: 0
Views: 330
Reputation: 374
With every new model initialization you start with new random weights. In order to get reproducible results in keras read here:
Upvotes: 1