Active Convolution
This repository contains the implementation for the paper Active Convolution: Learning the Shape of Convolution for Image Classification.
The code is based on Caffe and cuDNN(v5)
Abstract
Testing Code
You can validate backpropagation using test code. Because it is not differentiable on lattice points, you should not use integer point position when you are testing code. It is simply possible to define "TEST_ACONV_FAST_ENV" macro in aconv_fast_layer.hpp
- Define "TEST_ACONV_FAST_ENV" macro in aconv_fast_layer.hpp
- > make test
- > ./build/test/test_aconv_fast_layer.testbin
You should pass all tests. Before the start, don't forget to undefine TEST_ACONV_FAST_ENV macro and make again.
Usage
ACU has 4 parameters(weight, bias, x-positions, y-positions of synapse). Even though you don't use bias term, the order will not be changed.
Please refer deploy file in models/ACU
If you want define arbitary shape of convolution,
- use non SQUARE type in aconv_param
- define number of synapse using kernel_h, kernel_w parameter in convolution_param
In example, if you want define cross-shaped convolution with 4 synapses, you can use like belows.
...
aconv_param{ type: CIRCLE }
convolution_param { num_output: 48 kernel_h: 1 kernel_w: 4 stride: 1 }
...
When you use user-defined shape of convolution, you'd better edit aconv_fast_layer.cpp directly to define initial position of synapses.
Example
This is the result of plain ACU network, and there an example in models/ACU of CIFAR-10
Network | CIFAR-10(%) | CIFAR-100(%) |
---|---|---|
baseline | 8.01 | 27.85 |
ACU | 7.33 | 27.11 |
Improvement | +0.68 | +0.74 |
This is changes of the positions over iterations.
You can draw learned position by using ipython script.