• Stars
    star
    175
  • Rank 218,059 (Top 5 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

mxnet version of Large-Margin Softmax Loss for Convolutional Neural Networks.

mx-lsoftmax

mxnet version of Large-Margin Softmax Loss for Convolutional Neural Networks.

Derivatives

I put all formula I used to calculate the derivatives below. You can check it by yourself. If there's a mistake, please do tell me or open an issue.

The derivatives doesn't include lambda in the paper, but the code does. Instead of using lambda to weight the original f_i_yi = |w_yi||x_i|cos(t), the code uses beta because lambda is a keyword for Python, but beta plays exactly the same role as lambda.

formula

Gradient Check

Gradient check can be failed with data type float32 but ok with data type float64. So don't afraid to see gradient check failed.

Operator Performance

I implement the operator both in Python and C++(CUDA). The performance below is training LeNet on a single GTX1070 with parameters margin = 4, beta = 1. Notice the C++ implement can only run on GPU context.

Batch Size traditional fully connected lsoftmax in Python lsoftmax in C++(CUDA)
128 ~45000 samples / sec 2800 ~ 3300 samples / sec ~40000 samples / sec
256 ~54000 samples / sec 3500 ~ 4200 samples / sec ~47000 samples / sec

Visualization

original softmax (traditional fully connected)

lsoftmax-margin-1

lsoftmax with margin = 2, beta = 100 and scale = 0.99

lsoftmax-margin-2

lsoftmax with margin = 3, beta = 100 and scale = 0.99

lsoftmax-margin-3

lsoftmax with margin = 4, beta = 100 and scale = 0.99

lsoftmax-margin-4

lsoftmax with margin = 6, beta = 1000 and scale = 0.99

lsoftmax-margin-6

References

More Repositories

1

mini-caffe

Minimal runtime core of Caffe, Forward only, GPU support and Memory efficiency.
C++
375
star
2

deep-landmark

Predict facial landmarks with Deep CNNs powered by Caffe.
Python
283
star
3

face-alignment-at-3000fps

C++ implementation of Face Alignment at 3000 FPS via Regressing Local Binary Features
C++
197
star
4

JDA

C++ implementation of Joint Cascade Face Detection and Alignment.
C++
185
star
5

Joint-Face-Detection-and-Alignment

Caffe and Python implementation of Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks
Python
101
star
6

OrdinalRegression

Caffe Loss Layer for Ordinal Regression with Multiple Output CNN for Age Estimation.
C++
45
star
7

mini-caffe-example

detect facial landmark with mini-caffe
C++
18
star
8

FashionAI.KPS

My solution to FashionAI Key Points Detection of Apparel.
Python
13
star
9

Apriori

a simple implementation of Apriori algorithm in Python.
Python
12
star
10

WGAN

Play with Wasserstein GAN on MXNet.
Python
10
star
11

jsmnpp

jsmn++ is a tiny json parser embedded in your C++ project for configuration.
C++
8
star
12

QMIBBrowser

a mib browser based on snmp++ and Qt
C
5
star
13

face-alignment-presentation

All materials used in Face Alignment Presentation for MultiMedia Course.
4
star
14

rcpr-annotated

RCPR ไปฃ็ ๆณจ่งฃ
MATLAB
3
star
15

luoyetx.github.io

Resume
CSS
2
star
16

installers

scripts for installing open source tools and libraries from source code. Currently On CentOS
Shell
2
star
17

spider-event

a simple workflow for web crawling
JavaScript
1
star
18

CourseraHW

Homework Code on Coursera
MATLAB
1
star