bit_scientist
bit_scientist

Reputation: 1471

how to get what type of activation is used?

I have found that model.layers[index].output prints the info I need. But, I couldn't get what activation function was used by looking at this output: Tensor("dense_11_1/clip_by_value:0", shape=(?, 256), dtype=float32)

Usually, it is like Tensor("block5_conv3_1/Relu:0", shape=(?, ?, ?, 512), dtype=float32) and I can see Relu was used in that layer.

How to determine the activation function of the above-look output? Thanks.

Upvotes: 0

Views: 55

Answers (1)

Dr. Snoopy
Dr. Snoopy

Reputation: 56347

It's easier than you think, layers with activations will expose them with the activation attribute, so you can do:

model.layers[index].activation

And should give you information about the activation used by that layer.

Upvotes: 1

Related Questions