How to extract cell state of LSTM model through model.fit()?
问题 My LSTM model is like this, and I would like to get state_c def _get_model(input_shape, latent_dim, num_classes): inputs = Input(shape=input_shape) lstm_lyr,state_h,state_c = LSTM(latent_dim,dropout=0.1,return_state = True)(inputs) fc_lyr = Dense(num_classes)(lstm_lyr) soft_lyr = Activation('relu')(fc_lyr) model = Model(inputs, [soft_lyr,state_c]) model.compile(optimizer='adam', loss='mse', metrics=['accuracy']) return model model =_get_model((n_steps_in, n_features),latent_dim ,n_steps_out)