Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

VGG

vgg.py   - academic (idiomatic)
vgg_c.py - production (composable)

Paper

Macro-Architecture

Micro-Architecture

Convolutional Group (Block)

Stem Group

Classifier Group

Composable

Example Instantiate a stock VGG model

from vgg_c import VGG

# VGG16 from research paper
vgg = VGG(16)

# VGG16 custom input shape/classes
vgg = VGG(16, input_shape=(128, 128, 3), n_classes=50)

# getter for the tf.keras model
model = vgg.model

Example: Compose and train a mini-VGG model

''' Example for constructing/training a VGG model on CIFAR-10
'''
# Example of constructing a mini-VGG
groups = [ { 'n_layers': 1, 'n_filters': 64 },
           { 'n_layers': 2, 'n_filters': 128 },
           { 'n_layers': 2, 'n_filters': 256 } ]
vgg = VGG(groups, input_shape=(32, 32, 3), n_classes=10)
vgg.model.summary()

# train on CIFAR-10
vgg.cifar10()