we set the output dimension of FC1 layer as 2 . 譬如FC1之后输出:
feat=(256, 2)
256是batch_size,256张图片,每个图片提取两个特征
横纵坐标是两个feature,得到两个类,一共256个点。
直角坐标系映射到极坐标:向量长度不相等。 Features learned by the original softmax loss can not be classified simply via angles ——增加角度margin。
The decision boundary in softmax loss is :
If we define as a feature vector (特征向量?) and constrain and , the boundary:
,
where is the angle between and x
到此为止,boundary只与角度θ有关,修改softmax loss直接优化角度,让 CNNs 提取到角度可分性更高的feature。现在我们来看加了的约束后的图像:
通过修改的softmax loss得到的feature。Compared to original softmax loss, the features learned by modified softmax loss are angularly distributed.
作者觉得两类分的还不够开,于是引入一个整数,惩罚因子,控制分开的角度距离,边界变为:
,
越大,越大,得到更大的角,两类分离越远,如下图: