Keras implementation of SubNetwork
The following results can be reproduced with command:
python main.py --dataset MNIST --subset 1 4
python main.py --dataset MNIST --subset 0 2 6
python main.py --dataset MNIST --subset 0 4 6 7
python main.py --dataset MNIST --subset 0 1 2 3 4 5 6 7 8 9
python main.py --dataset FashionMNIST --subset 5 7 9
python main.py --dataset FashionMNIST --subset 0 1 2 3 4 5 6 7 8 9
subset | SubNetwork | OriginalNetwork | A/B (%) | ||
---|---|---|---|---|---|
# Params (A) | Test - acc | # Params (B) | Test - acc | ||
Using MNISTdataset Network | |||||
[1, 4] | 21,251 | 0.999 | 124,825 | 0.983 | 17.02 |
[0, 2, 6] | 29,947 | 0.992 | 0.980 | 23.99 | |
[0, 4, 6, 7] | 40,243 | 0.992 | 0.981 | 32.24 | |
ALL | 124,825 | 0.979 | 0.979 | 100. | |
Using FashionMNISTdataset Network | |||||
subset for shoes categories [5, 7, 9] | 87,147 | 0.963 | 330,670 | 0.962 | 26.35 |
ALL | 330,670 | 0.911 | 0.911 | 100. |
The following results can be reproduced with command:
python main.py --dataset MNIST --subset 0 1 2 3 4 5 6 7 8 9 --meanNodes True
python main.py --dataset FashionMNIST --subset 0 1 2 3 4 5 6 7 8 9 --meanNodes True
Average number of Nodes |
X-axis: Average number of nodes, Y-aixs: number of subset elements |
- Keras
- Python packages: numpy
python main.py --dataset <choose dataset> --subset <subset of total categories>
Example: python main.py --dataset MNIST --subset 0 1 2 3
Required:
--dataset
: Choose datset. Option:MNIST
orFasionMNIST
--subset
: Subset elements of total categories. example:--subset 0 1 2
Optional:
--meanNodes
: Whether or not to print the average number of nodes. type:bool
, Default:False
This implementation has been tested with Keras 2.2.4 on Windows 10.