Implement awesome CNNs with Keras
Keras2.1.0+, Tensorflow1.4+
1.resnet_cifar.py
nb_classes: the number of your dataset classes, for cifar-10, nb_classes should be 10
img_dim: the input shape of the model input
nb_blocks: the number of blocks in each stage,the depth of the model = 2 + 2 x (nb_blocks[0] + nb_blocks[1] + nb_blocks[2])
k: the widen fatcor, k=1 indicates that the model is original ResNet, when k>1 the model is a wide ResNet
weight_decay: weight decay for L2 regularization
droprate: the dropout between two convolutons of each block is added and the default drop rate is set to 0.0
return: ResNet model or WRN model
from resnet_cifar import create_ResNet
resnet = create_ResNet(
nb_classes = 10,
img_dim = (32, 32, 3),
nb_blocks = [18, 18, 18],
k = 1,
droprate = 0.0
)