0

In caffe, if I make my own variable associated with a layer and I modify this variable during training iterations, the test phase does not know about the modifications to that variable, it seems to initialize it for itself. the training testing phases share weights but nothing else. How do I share other variables between the training and testing phases. Thanks.

eg: say I declare in inner_product_layer.hpp,

int dog = 5;

and in Backward_gpu() I modify,

dog = 6;

the testing phase thinks dog=5. I want the testing phase to know that dog is now 6.

1 Answers1

1

The executable for training and test phase is different, hence, if you modify a variable inside the code during training, it won't be reflected at test time. You could dump the variable to an output file when training ends and read the file as an argument at test time while initializing the layer in the LayerSetUp function. The filename can be added as a layer parameter , where you can check if you are in the test phase and set your parameters from the file you saved.

Bharat
  • 2,139
  • 2
  • 16
  • 35