The loss of mse is always 0 when keras for a topic is predicted

my input is a 200 dims vector, which is generated by the average word2 of the vector of all the words in the article, my result is a 50-fold vector, which is generated by the LDA of the article, I want to use mse as a loss function, but the loss value is always 0, my code is as follows :

<pre>model = Sequential()
model.add(Dense(cols*footsize, 400,init = "glorot_uniform"))
# model.add(LeakyReLU(alpha = 0.3))
model.add(Activation('relu'))
model.add(Dropout(0.2))
model.add(Dense(400, 400,init = "glorot_uniform"))
model.add(Activation('relu'))
model.add(Dropout(0.2))
model.add(Dense(400, 50,init = "glorot_uniform"))
model.add(Activation('softmax'))
model.compile(loss='mse', optimizer='rmsprop')</pre>

the screen is displayed as follows: enter image description here

who can tell me why, thanks!

+4
source share
1 answer

First, is your output one hot vector of projected classes? IE: the first class is [1, 0, 0, ...], and the second is [0, 1, 0, 0, ...].

, softmax- , . ( ), MSE , -.

Softmax , . : https://en.wikipedia.org/wiki/Softmax_function

, , .

+5

All Articles