I created a "Python" layer "myLayer" in caffe, and use it in the net train_val.prototxt I insert the layer like this:
layer {
name: "my_py_layer"
type: "Python"
bottom: "in"
top: "out"
python_param {
module: "my_module_name"
layer: "myLayer"
}
include { phase: TRAIN } # THIS IS THE TRICKY PART!
}
Now, my layer only participates in the TRAINing phase of the net,
how can I know that in my layer's setup function??
class myLayer(caffe.Layer):
def setup(self, bottom, top):
# I want to know here what is the phase?!!
...
PS,
I posted this question on "Caffe Users" google group as well. I'll udpdate if anything pops there.