Output the loss/cost function in keras?

8 views
Skip to first unread message

mike...@gmail.com

unread,
Feb 2, 2018, 3:45:22 PM2/2/18
to Keras-users
I am trying to find the cost function in keras. I am running an LSTM with the loss function "categorical_crossentropy" and I added a regularizer. How do i output what the cost function looks like after my regularizer this for my own analysis?

model = Sequential()
model
.add(LSTM(
    NUM_HIDDEN_UNITS
,
    return_sequences
=True,
    input_shape
=(PHRASE_LEN, SYMBOL_DIM),
    kernel_regularizer
=regularizers.l2(0.01)
   
))
model
.add(Dropout(0.3))
model
.add(LSTM(NUM_HIDDEN_UNITS, return_sequences=False))
model
.add(Dropout(0.3))
model
.add(Dense(SYMBOL_DIM))
model
.add(Activation('softmax'))
model
.compile(loss='categorical_crossentropy',
    optimizer
=RMSprop(lr=1e-03, rho=0.9, epsilon=1e-08))

Reply all
Reply to author
Forward
0 new messages