I modified the
Finetuning for style recognition example according to my needs:
- I am doing a regression (training images = ~14000, test # ~1500) so I changed the num outputs in the final layer to 1
- This is my last layer in deploy.prototxt
layer {
name: "my-fc8"
type: "InnerProduct"
bottom: "fc7"
top: "my-fc8"
# lr_mult is set to higher than for other layers, because this layer is
starting from random while the others are already trained
param {
lr_mult: 10
decay_mult: 1
}
param {
lr_mult: 20
decay_mult: 0
}
inner_product_param {
num_output: 1
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
- In train_val.prototxt I removed the accuracy layer since I am doing regression and have the following Euclidean Loss Layers
layer {
name: "loss"
type: "EuclideanLoss"
bottom: "my-fc8"
bottom: "label"
}
layer {
name: "loss"
type: "EuclideanLoss"
bottom: "my-fc8"
bottom: "label"
top: "loss"
include {
phase: TEST
}
}
- And since my training and test labels were float I used this
PR, (which breaks the softmax layer but I don't need that) according to this
discussion.
- One thing which is bugging me is when I use the matlab wrapper functions matcaffe_demo() to test the 100000 iteration trained net on any image,
instead of 1 label for 1 image, I get output of 10*1, i.e 10 labels instead of 1, which I then average to infer the predicted label.
So, if anyone can verify that I have proceeded correctly, especially the Euclidean Loss layers for train and test, and the PR for using float labels, I would be very grateful. Before I proceed, I need to be sure that what I have done till now is correct.