Return the canonical convolution and pooling configuration for VGG11, VGG13, VGG16, or VGG19. Each integer is a convolution output-channel count and each string M is a 2 by 2 max-pooling layer. Accept the variant name case-insensitively. Return the configuration as a new Python list containing integers and M strings.
Examples
Input: variant = "vgg11"
Output: [64,"M",128,"M",256,256,"M",512,512,"M",512,512,"M"]
Explanation: VGG11 contains eight convolution entries grouped by five pooling entries.
Input: variant = "VGG16"
Output: [64,64,"M",128,128,"M",256,256,256,"M",512,512,512,"M",512,512,512,"M"]
Input: variant = "vgg19"
Output: [64,64,"M",128,128,"M",256,256,256,256,"M",512,512,512,512,"M",512,512,512,512,"M"]
Hint 1
Normalize the variant with str.lower().
Hint 2
Store the four canonical configurations in a dictionary.
Requirements
- Use ordinary Python lists and strings.
- Support VGG11, VGG13, VGG16, and VGG19.
- Treat variant names case-insensitively.
- Return a new Python list in canonical layer order.
Constraints
- variant names one of the four supported VGG architectures, ignoring case.
All steps in VGG
Accepts: string
VGG Configuration
Return the canonical convolution and pooling configuration for VGG11, VGG13, VGG16, or VGG19. Each integer is a convolution output-channel count and each string M is a 2 by 2 max-pooling layer. Accept the variant name case-insensitively. Return the configuration as a new Python list containing integers and M strings.
Examples
Input: variant = "vgg11"
Output: [64,"M",128,"M",256,256,"M",512,512,"M",512,512,"M"]
Explanation: VGG11 contains eight convolution entries grouped by five pooling entries.
Input: variant = "VGG16"
Output: [64,64,"M",128,128,"M",256,256,256,"M",512,512,512,"M",512,512,512,"M"]
Input: variant = "vgg19"
Output: [64,64,"M",128,128,"M",256,256,256,256,"M",512,512,512,512,"M",512,512,512,512,"M"]
Hint 1
Normalize the variant with str.lower().
Hint 2
Store the four canonical configurations in a dictionary.
Requirements
- Use ordinary Python lists and strings.
- Support VGG11, VGG13, VGG16, and VGG19.
- Treat variant names case-insensitively.
- Return a new Python list in canonical layer order.
Constraints
- variant names one of the four supported VGG architectures, ignoring case.
All steps in VGG
Accepts: string