Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Implementation for <Large-Margin Softmax Loss for Convolutional Neural Networks> in ICML'16.
| Date | Stars |
|---|---|
| 2026-07-31 | 353 |
| 2026-08-05 | 353 |
| 2026-08-06 | 353 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Large-Margin Softmax Loss for Convolutional Neural Networks
By Weiyang Liu, Yandong Wen, Zhiding Yu, Meng Yang
### Introduction
We introduce a large-margin softmax (L-Softmax) loss for convolutional neural networks. L-Softmax loss can greatly improve the generalization ability of CNNs, so it is very suitable for general classification, feature embedding and biometrics (e.g. face) verification. We give the 2D feature visualization on MNIST to illustrate our L-Softmax loss.
<img src="asserts/mnist_2d.png" width="90%" height="90%">
### Citation
The paper is published in [ICML 2016](http://proceedings.mlr.press/v48/liud16.pdf) and also available at [arXiv](https://arxiv.org/abs/1612.02295).
If the code helps your research, please consider to cite our work:
Large-Margin Softmax Loss for Convolutional Neural Networks
Weiyang Liu, Yandong Wen, Zhiding Yu and Meng Yang
Proceedings of The 33rd International Conference on Machine Learning. 2016: 507-516.
@inproceedings{liu2016large,
title={Large-Margin Softmax Loss for Convolutional Neural Networks},
author={Liu, Weiyang and Wen, Yandong and Yu, Zhiding and Yang, Meng},
booktitle={Proceedings of The 33rd International Conference on Machine Learning},
pages={507--516},
year={2016}
}
### Third-party Re-implementation
- MXNet: [code](https://github.com/luoyetx/mx-lsoftmax) by [luoyetx](https://github.com/luoyetx).
- TensorFlow (with C++ API): [code](https://github.com/HiKapok/tf.extra_losses) by [Changan Wang](https://github.com/HiKapok).
- TensorFlow: [code](https://github.com/auroua/L_Softmax_TensorFlow) by [auroua](https://github.com/auroua)
- Caffe2: [code](https://github.com/tpys/face-recognition-caffe2) by [tpys](https://github.com/tpys).
- PyTorch: [code](https://github.com/amirhfarzaneh/lsoftmax-pytorch) by [Amir H. Farzaneh](https://github.com/amirhfarzaneh).
- PyTorch: [code](https://github.com/jihunchoi/lsoftmax-pytorch) by [jihunchoi](https://github.com/jihunchoi).
We greatly appreciate the contributions for all the third-party re-implementations!
### Update
- 2017/1/23 Fix a bug that lambda_min may change during backprop. Thanks [luoyetx](https://github.com/luoyetx)!
- 2016/12/18 The repository is officially built.
### Files
- Caffe library
- L-Softmax Loss
* src/caffe/proto/caffe.proto
* include/caffe/layers/largemargin_inner_prodcut_layer.hpp
* src/caffe/layers/largemargin_inner_prodcut_layer.cpp
* src/caffe/layers/largemargin_inner_prodcut_layer.cu
- mnist example
* myexamples/mnist/mnist_test_lmdb
* myexamples/mnist/mnist_test_lmdb
* myexamples/mnist/model/mnist_train_test.prototxt
* myexamples/mnist/mnist_solver.prototxt
- cifar10 example
* myexamples/cifar10/model/cifar_train_test.prototxt
* myexamples/cifar10/cifar_solver.prototxt
- cifar10+ example
* myexamples/cifar10+/model/cifar_train_test.prototxt
* myexamples/cifar10+/cifar_solver.prototxt
### Usage
- The prototxt of LargeMarginInnerProduct layer is as follows:
layer {
name: "ip2"
type: "LargeMarginInnerProduct"
bottom: "ip1"
bottom: "label"
top: "ip2"
top: "lambda"
param {
name: "ip2"
lr_mult: 1
}
largemargin_inner_product_param {
num_output: 10 //number of outputs
type: QUADRUPLE //value of m
//only SINGLE (m=1), DOUBLE (m=2), TRIPLE (m=3) and QUADRUPLE (m=4) are available.
base: 1000
gamma: 0.000025
power: 35
iteration: 0
lambda_min: 0
//base, gamma, power and lambda_min are parameters of exponential lambda descent
weight_filler {
type: "msra"
}
}
include {
phase: TRAIN
}
}
- For specific examples, please refer to myexamples/mnist folder.
### Notes for training
- L-Softmax loss is the combination of "LargeMargExcerpt of 7,405 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:9c0bf519f833062b, llm:Repo topics: caffe, deep-learning, face-recognition, icml-2016, image-recognition, l-softmax, lsoftmax-loss; description: implementation of Large-Margin Softmax Loss for CNNs (loss function for classification/face verification).
matched fp:9c0bf519f833062b, llm:Repo topics: caffe, deep-learning, face-recognition, icml-2016, image-recognition, l-softmax, lsoftmax-loss; description: implementation of Large-Margin Softmax Loss for CNNs (loss function for classification/face verification).
matched fp:9c0bf519f833062b, llm:Repo topics: caffe, deep-learning, face-recognition, icml-2016, image-recognition, l-softmax, lsoftmax-loss; description: implementation of Large-Margin Softmax Loss for CNNs (loss function for classification/face verification).