dnn module forward() output in intermediate layers?

asked 2019-10-19 04:54:07 -0600

fogx gravatar image

updated 2019-10-20 02:50:25 -0600

berak gravatar image

Hi, im trying to get the activations from a specific layer using the dnn module. Specifically the forward() method, since that seems to be the only method that does this. If i understand the documentation correctly, the following code should give me the output for every Layer.

    names = self.net.getLayerNames()
    outputs = self.net.forward(names)

the result is a set of arrays. However, when i look at the values in these arrays they don't seem to be quite right. For example, my 3d layer is a relu layer, which should output max(0,input), but the array contains negative values.

So my question is:

  • what exactly am i looking at in the forward() output if its not the output of each layer,
  • and how can i get the activations of each layer using the dnn module?
edit retag flag offensive close merge delete