Code and meta-parameters corresponding to Meta-learning of Pooling Layers for Character Recognition, found at this arXiv link.
We propose a meta-learning framework for pooling layers. In our framework, a parameterized pooling layer is proposed in which the kernel shape and pooling operation are trainable using two parameters, thereby allowing a flexible pooling of the input data as shown in figure (c). In figure (a) and (b), the max and average values are calculated for each kernel. Also, all the kernels share the same shape and operation. In figure (c), the proposed meta-learned pooling employs different shapes and operations in individual kernels. We also propose a meta-learning algorithm for the parameterized pooling layer, which allows us to acquire a suitable pooling layer across multiple tasks.
All experiments were run in a conda environment with python 3.7.4, using pytorch 1.4.0. The conda environment we used is exported in environment.yml.
The file generate_data.py
contains the data generation code. You must specify the name of the problem we wish to generate data for. Options are:
Max_1d
: 1-D data generated by a max pooling layerAverage_1d
: 1-D data generated by a average pooling layerSquare_1d
: 1-D data generated by the pooling layer consists of the max pooling for the first half and average pooling for the second halfMax_2d
: 2-D data generated by a max pooling layerAverage_2d
: 2-D data generated by a average pooling layerSquare_2d
: 2-D data generated by the pooling layer consists of the max pooling for the first half and average pooling for the second halfNonSquare_2d
: Changing kernel size ofSuquare_2d
to (2, 1), stride 2, and generate data
Example:
python generate_data.py --problem Square_1d
The file train.py
contains training and evaluation code. The problem
argument controls which artificial data is used. The argument model
controls the 1D pooling layer, 2D pooling layer.
Some examples are given below:
python train.py --problem Square_1d --model Pooling_1d --input_size 60 --output_size 30
python train.py --problem Square_2d --model Pooling_2d --input_size 28 --output_size 196
WIP
- Author : Takato Otsuzuki, Hideaki Hayashi, Heon Song, Seiichi Uchida
- Affiliation : Kyushu University, Fukuoka, Japan
- Contact E-mail : takato.otsuzuki@human.ait.kyushu-u.ac.jp, hayashi@ait.kyushu-u.ac.jp