How to reduce 4096-dimensional vector of function to 1024-dimensional vector in CNN Caffemodel?

I used 16-layer VGGnet to extract functions from the image. It produces a 4096-dimensional function vector. However, I need a 1024-dimensional vector. How do I reduce this 4096-vector to 1024-vector? Do I need to add a new layer on top of fc7 ?

0
source share
2 answers

Yes.

+4
source

Yes, you need to add another layer on top of fc7 . This is how your last few layers should look like

 layers { bottom: "fc7" top: "fc7" name: "relu7" type: RELU } layers { bottom: "fc7" top: "fc7" name: "drop7" type: DROPOUT dropout_param { dropout_ratio: 0.5 } } layers { name: "fc8" bottom: "fc7" top: "fc8" type: INNER_PRODUCT inner_product_param { num_output: 1024 } blobs_lr: 0 blobs_lr: 0 } layers { name: "loss" type: SOFTMAX_LOSS bottom: "fc8" bottom: "label" top: "loss/loss" } layers { name: "accuracy/top1" type: ACCURACY bottom: "fc8" bottom: "label" top: " accuracy@1 " include: { phase: TEST } accuracy_param { top_k: 1 } } 
+2
source

Source: https://habr.com/ru/post/982190/


All Articles