caffe
caffe copied to clipboard
Test the triplet-loss accuracy!
Hello! I see your cifar-10 using the triplet loss replacing the softmax. If we want to test the triplet the accuracy, what can I do?
First, in train_test.prototxt, add the following layer before the "sampling" layer.
layer {
name: "accuracy"
type: "Accuracy"
bottom: "ip1"
bottom: "label"
top: "accuracy"
include {
phase: TEST
}
}
Then in solver file, just change test interval to 100 and you will see test output,
# Carry out testing every training iterations.
test_interval: 100
I also set the batch_size's of both TRAIN and TEST to 100, and the output like as follows:
I0520 02:33:18.689152 22927 solver.cpp:454] Snapshotting to binary proto file examples/cifar10/triplet_loss/cifar10_quick_iter_5000.caffemodel
I0520 02:33:18.733136 22927 sgd_solver.cpp:273] Snapshotting solver state to binary proto file examples/cifar10/triplet_loss/cifar10_quick_iter_5000.solverstate
I0520 02:33:18.734175 22927 solver.cpp:337] Iteration 5000, Testing net (#0)
I0520 02:33:22.881525 22927 solver.cpp:404] Test net output #0: accuracy = 0.0057
I0520 02:33:22.881626 22927 solver.cpp:404] Test net output #1: loss = 0.299064 (* 1 = 0.299064 loss)
Very very Thaks ! I have a try!
这个accuracy为什么这么小,caffe里的accuracy层直接用应该不对吧?