How to get output of hidden layer given an input, weights and biases of the hidden layer in keras?

后端 未结 3 1857
难免孤独
难免孤独 2021-02-15 17:53

Suppose I have trained the model below for an epoch:

model = Sequential([
    Dense(32, input_dim=784), # first number is output_dim
    Activation(\'relu\'),
          


        
3条回答
  •  难免孤独
    2021-02-15 18:26

    As for weights, I had a none-Sequential model. What I did was using model.summary() to get the desired layers name and then model.get_layer("layer_name").get_weights() to get the weights.

提交回复
热议问题