---
dataset:
    task:
        background_class: {use: false}
        preprocess:
            shape:
                height: 224
                width: 224
                channels: 3
            validate: null
            _final_cpu_imagenet:
                - {type: subtract_channel_means}
                - {type: linear_map, scale: 255.0}
            _final_cpu:
                - {type: linear_map, scale: 2.0, shift: -1.0}
            final_cpu: !arith >
                $(dataset.task._final_cpu_imagenet)
                if $(dataset.name) == 'imagenet' else '_final_cpu'
model:
    bn: false
    name: !arith "'vgg16_bn' if $(model.bn) else 'vgg16'"
    layers:
        _init: &init
            weights_initializer:
                type: tensorflow.truncated_normal_initializer
                stddev: 0.09
            biases_initializer:
                type: tensorflow.constant_initializer
                value: 0.1
        _conv: &conv
            <<: *init
            type: convolution
            kernel_size: [3, 3]
            stride: 1
            padding: same
            weights_regularizer:
                type: tensorflow.contrib.layers.l2_regularizer
                scale: 0.00004
            normalizer_fn: !arith >
                'tensorflow.contrib.slim.batch_norm' if $(model.bn) else None
            normalizer_params:
                scale: true
                decay: 0.997
                epsilon: 0.00001
        _fc: &fc {<<: *init, type: fully_connected}
        conv1_1: {<<: *conv, num_outputs: 64}
        conv1_2: {<<: *conv, num_outputs: 64}
        pool1: &pool
            {type: max_pool, kernel_size: [2, 2], padding: valid, stride: 2}
        conv2_1: {<<: *conv, num_outputs: 128}
        conv2_2: {<<: *conv, num_outputs: 128}
        pool2: *pool
        conv3_1: {<<: *conv, num_outputs: 256}
        conv3_2: {<<: *conv, num_outputs: 256}
        conv3_3: {<<: *conv, num_outputs: 256}
        pool3: *pool
        conv4_1: {<<: *conv, num_outputs: 512}
        conv4_2: {<<: *conv, num_outputs: 512}
        conv4_3: {<<: *conv, num_outputs: 512}
        pool4: *pool
        conv5_1: {<<: *conv, num_outputs: 512}
        conv5_2: {<<: *conv, num_outputs: 512}
        conv5_3: {<<: *conv, num_outputs: 512}
        pool5: *pool
        flatten5: {type: flatten}
        fc6: {<<: *fc, num_outputs: 4096}
        dropout6: &dropout {type: dropout, keep_prob: 0.5}
        fc7: {<<: *fc, num_outputs: 4096}
        dropout7: *dropout
        fc8:
            <<: *fc
            num_outputs: $(dataset.task.num_classes)
            activation_fn: null
        cifar_fc6: {<<: *fc, num_outputs: 512}
        cifar_fc7:
            <<: *fc
            num_outputs: $(dataset.task.num_classes)
            normalizer_fn: null
            activation_fn: null
    _graph:
        imagenet: [flatten5, fc6, dropout6, fc7, dropout7, fc8]
        cifar10: &cifar_graph [flatten5, cifar_fc6, cifar_fc7]
        cifar100: *cifar_graph
    graph:
        from: input
        with: !arith >
            [
                conv1_1, conv1_2, pool1,
                conv2_1, conv2_2, pool2,
                conv3_1, conv3_2, conv3_3, pool3,
                conv4_1, conv4_2, conv4_3, pool4,
                conv5_1, conv5_2, conv5_3, pool5
            ] + $(model._graph.$(dataset.name))
        to: output
