Comments (5)
I also met this problem and solved it by removing the last ip layer, which is the "fc9_1" layer. Since the "fc9_1" layer will magnify the norm of the feature to enlarge the distance between a and an, you can see the distance keeps increasing untill it overflows. I also recommend adding a "PReLU" layer after the last ip layer before normalizing it.
from tripletloss.
@JoeFannie thanks .
Do you mean to remove the embedding layer?
layer {
name: "norm2"
type: "Python"
bottom: "fc7"
top: "norm2"
python_param {
module: "norm2layer"
layer: "Norm2Layer"
}
}
layer {
name: "fc9_1"
type: "InnerProduct"
bottom: "norm2"
top: "fc9_1"
param {
lr_mult: 1
decay_mult: 0
}
inner_product_param {
num_output: 512
weight_filler {
type: "xavier"
}
}
}
Then, what kind of layer do you measure?
( I need a dimensionally reduced vector. So I want to know how to reduce it.)
from tripletloss.
layer {
name: "norm2"
type: "Python"
bottom: "fc7"
top: "norm2"
python_param {
module: "norm2layer"
layer: "Norm2Layer"
}
}
add only norm2 layer is just good. If u want to reduce the dimension, u can move the norm2 layer to the next to the last ip layer "fc9_1". In one word, the feature is supposed to be normalized before being fed to the triplet loss layer. Hope it helps.
from tripletloss.
@JoeFannie sorry very late..and thanks.
fc7 -> fc9_1 -> norm2 ->"triplet_select"
Do you mean this order?
so, below...
,,,
layer {
name: "fc7"
type: "InnerProduct"
bottom: "fc6"
top: "fc7"
param {
lr_mult: 0
decay_mult: 0
}
param {
lr_mult: 0
decay_mult: 0
}
inner_product_param {
num_output: 4096
weight_filler {
type:"xavier"
}
}
}
layer {
name: "relu7"
type: "ReLU"
bottom: "fc7"
top: "fc7"
}
layer {
name: "drop7"
type: "Dropout"
bottom: "fc7"
top: "fc7"
dropout_param {
dropout_ratio: 0.5
}
}
layer {
name: "fc9_1"
type: "InnerProduct"
bottom: "fc7"
top: "fc9_1"
param {
lr_mult: 1
decay_mult: 0
}
inner_product_param {
num_output: 512
weight_filler {
type: "xavier"
}
}
}
layer {
name: "norm2"
type: "Python"
bottom: "fc9_1"
top: "norm2"
python_param {
module: "norm2layer"
layer: "Norm2Layer"
}
}
#add activation layer may increase the feature's expression
layer {
name: "triplet_select"
type: "Python"
bottom: "norm2"
bottom: "labels"
top: "archor"
top: "positive"
top: "negative"
python_param {
module: "tripletselectlayer"
layer: "TripletSelectLayer"
}
}
layer {
name: "tripletloss"
type: "Python"
bottom: "archor"
bottom: "positive"
bottom: "negative"
top: "loss"
python_param {
module: "tripletlosslayer"
layer: "TripletLayer"
param_str: "'margin': 0.2"
}
loss_weight: 1
}
from tripletloss.
It is what I mean
from tripletloss.
Related Issues (20)
- the module name is right,but it still failed with boost::python::error_already_set
- 训练到后面 loss都变为0.1 an,ap变为0 HOT 6
- training problem
- Hard Sample
- the triplet loss architecture is unsupervised, is this correct?
- tipletselectlayer - computing the distance against the anchor image HOT 2
- shuffle
- fc9_1 weights is increase with the train iterations from 0.0x to 40.x HOT 1
- Training your code on custom dataset HOT 1
- how to train it on 2 gpus
- Use of the margin HOT 2
- Negative mining in TripletSelectLayer HOT 1
- what does no_residual_list for?
- 数据集组织需要什么特别处理么? HOT 1
- online triplet sample selection usage?
- 您好,我想用自己的数据集跑这个网络,除了修改config路径,还需要修改哪里? HOT 2
- Online triplet generation HOT 1
- 工作推荐
- ap,an都变得特别大
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tripletloss.