Skip to content

Otsuzuki/Meta-learning-of-Pooling-Layers-for-Character-Recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meta-learning of Pooling Layers for Character Recognition

Code and meta-parameters corresponding to Meta-learning of Pooling Layers for Character Recognition, found at this arXiv link.

Features

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.

属性

Installation and requirements

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.

Simulation of Artificial 1D data

Generate data

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 layer
  • Average_1d : 1-D data generated by a average pooling layer
  • Square_1d : 1-D data generated by the pooling layer consists of the max pooling for the first half and average pooling for the second half
  • Max_2d : 2-D data generated by a max pooling layer
  • Average_2d : 2-D data generated by a average pooling layer
  • Square_2d : 2-D data generated by the pooling layer consists of the max pooling for the first half and average pooling for the second half
  • NonSquare_2d : Changing kernel size of Suquare_2d to (2, 1), stride 2, and generate data

Example:

python generate_data.py --problem Square_1d

Train

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

Character Recognition (Omniglot)

WIP

Author

About

Experiments for Meta-learning of Pooling Layers for Character Recognition

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages