Skip to content
Julia code for the paper S. Gu, L. Zhang, W. Zuo, and X. Feng, “Projective Dictionary Pair Learning for Pattern Classification,” In NIPS 2014
Branch: master
Clone or download
Latest commit a0e830a Nov 30, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Updated two iteration loops Apr 26, 2016
test Fixed a performance test issue caused by removing ne Dec 14, 2015
.gitignore Fixed a little in .gitignore Mar 11, 2015
.travis.yml Update .travis.yml Nov 30, 2017
LICENSE Added MIT license Dec 14, 2015
appveyor.yml Added appveyor config May 1, 2016


previous DPL.jl

Build Status Coverage Status




using ProjectiveDictionaryPairLearning

The output should be something similar to this

The running time for DPL training is : 6.79 s
The running time for DPL testing is : 0.23 s
Recognition rate for DPL is : 97.579%

Comparison with MATLAB version

Actually the MATLAB version runs much faster as below.

The running time for DPL training is : 3.12 s
The running time for DPL testing is : 0.17 s
Recognition rate for DPL is : 0.976


Prepare Data and Labels

  • Training Data TrData: Column Vectors (Should be normalize!d)
  • Training Label TrLabel: Class Label Integers in A Row
  • Testing Data TtData: Column Vectors (Should also be normalize!d )
  • Testing Label TtLabel: Class Label Integers in A Row

Set Parameters

DictSize = 30
τ = 0.05
λ = 0.003
γ = 0.0001

DPL Training

DictMat, EncoderMat = TrainDPL(TrData, TrLabel, DictSize, τ, λ, γ)

DPL Testing

PredictLabel, Error, Distance = ClassificationDPL(TtData, DictMat, EncoderMat, DictSize)

Ref: dpldemo() in ProjectiveDictionaryPairLearning.jl

Advanced Usage

Inner functions have been exposed to use.

  • initialization.jl: DataMat, D, P, DataInvMat, A = initialization(Data, Label, DictSize, τ, λ, γ)
  • updateA!.jl: updateA!(A, D, DataMat, P, τ, DictSize)
  • updateD!.jl: updateD!(D, A, DataMat)
  • updateP!.jl: updateP!(P, A, DataInvMat, DataMat, τ)

Ref: TrainDPL.jl in ProjectiveDictionaryPairLearning.jl



The original matlab code is for the paper:

The julia port of this code is for the paper:

Qu, Xiaofeng; Zhang, David; Lu, Guangming; and Guo, Zhenhua, “Door knob hand recognition system,” Will appear in Systems, Man, and Cybernetics: Systems, IEEE Transactions on.

Authors' Pages



The example feature dataset (YaleB_Jiang) used in this code is from Dr. Zhuolin Jiang:

For the experiments on AR and caltech 101 dataset, we also used the feature datasets provided by Dr. Jiang.

For experiment on UCF50, we used the Action bank feature provided in: Please refer to our paper for the detailed experimental setting.


If you have problems with the paper, the algorithm or the original matlab code, please contact us at or

If you have problems with the julia code, please contact us at


  • A thank you to afternone, who optimized the julia code


  • Add test
  • NEW add more tests
  • Optimize the performance
  • NEW optimize the performance further
  • Proper packaging
You can’t perform that action at this time.