titu1994 / DenseNet

DenseNet implementation in Keras
MIT License
707 stars 294 forks source link

Why reshape in fc-densenet in top layer before applying softmax? #49

Closed lminer closed 5 years ago

lminer commented 5 years ago

I was wondering if you had a sense why you need to do a reshape here before applying the softmax.

titu1994 commented 5 years ago

Because Softmax is only applied to the final dimension, and it should normally be applied only to the channel dimension.

Nowadays, Softmax supports multidim input and defaults to the last axis, but in earlier versions this was not the case.

lminer commented 5 years ago

Thank you! Great explanation.