mahshid majd
mahshid majd

Reputation: 41

Why does the accuracy drop to zero in each epoch, while training convlstm layers in keras?

I am trying to use ConvLSTM layers in Keras 2 to train an action recognition model. The model has 3 ConvLSTM layers and 2 Fully Connected ones.

At each and every epoch the accuracy for the first batch (usually more than one) is zero and then it increases to some amount more than the previous epoch. For example, the first epoch finishes at 0.3 and the next would finish at 0.4 and so on.

My question is why does it get back to zero at each epoch?

p.s.

Upvotes: 4

Views: 1698

Answers (1)

Marcin Możejko
Marcin Możejko

Reputation: 40516

So - in order to understand why something like this happening you need to understand how keras computes accuracy during the batch computation:

  1. Before each batch - a number of positively classified examples is stored.
  2. After each batch - a number of positively classified examples is stored and it's printed after division by all examples used in training.

As your accuracy is pretty low it's highly probable that in a first few batches none of the examples will be classified properly. Especially when you have a small batch. This makes accuracy to be 0 at the beginning of your training.

Upvotes: 1

Related Questions