Commit 59f22781 authored by MAIRAL Julien's avatar MAIRAL Julien


parent 5b8db4e2
This diff is collapsed.
This is a re-implementation of the convolutional kernel network (CKN) methods introduced in
Julien Mairal
[End-to-End Kernel Learning with Supervised Convolutional Kernel Networks][1]. Adv. NIPS. 2016.
This is an almost pure C++ implementation using directly CUDA and CUDNN, along with a Matlab
The software package features both the unsupervised and supervised variants of CKNs
and is open-source with a GPLv3 license.
## Q: Why not using popular deep learning frameworks?
Today, there is no good reason for a developer to proceed with a pure
C++/CUDA/CUDNN implementation for such a project, unless he wants to
learn how to use (and understand) low-level tools such as CUDA and CUDNN.
In the present case, this was my main motivation.
The resulting software package is therefore able to reproduce the results of the
original paper, which were obtained on CPUs, but is relatively painful to
install. More user-friendly (but slightly slower) versions will be made
available soon in Tensorflow and Pytorch.
## Installation
You need to edit the file `build.m`, and set up the paths to the CUDA, Matlab, and
CUDNN libraries on a Linux operating system. The file is also configured to
compile using the Intel C++ compiler, featuring the MKL library, but it also
possible to modify it to compile using gcc.
Typing `build` inside Matlab will compile the different mex files. To use them,
you may then have to exit Matlab, and use the script `` to run
Matlab again while pre-loading the required library.
We are aware that this operation is not user-friendly and you should wait for the
Tensorflow and Pytorch implementation if you do not manage to compile these files
## Example files and data
The package contains two scripts `script_ckn_unsupervised.m`, which contains
a few examples of calls of the unsupervised variant of CKN, while `script_ckn_supervised.m` uses
the supervised variant (on GPUs).
To run these scripts, you need to download the CIFAR-10 dataset, and place it in the data folder.
You may download these files from [here]( (for the pre-whitened version)
or [here]( (for the raw dataset).
See also [here]( for the original dataset.
## Q: Why do the results seem to be slightly better than in the original paper?
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment