# Path: utils/layer_macros.py
# def conv2dbn(l, name, **kwargs):
#     """ Batch normalized DNN Conv2D Layer """
#     l = nn.layers.dnn.Conv2DDNNLayer(
#         l, name=name,
#         **kwargs
#     )
#     l = batch_norm(l, name='%sbn' % name)
#     return l


import lasagne as nn
import theano.tensor as T
from utils.layer_macros import conv2dbn
def inceptionB(input_layer, name, nfilt):
    l1 = conv2dbn(
        input_layer, name='%s_inceptB_1_3x3' % name,
        num_filters=nfilt[0][0], filter_size=3, stride=2
    )

    l2 = conv2dbn(
        input_layer, name='%s_inceptB_2_1x1' % name,
        num_filters=nfilt[1][0], filter_size=1
    )
    l2 = conv2dbn(
        l2, name='%s_inceptB_2_3x3_1' % name,
        num_filters=nfilt[1][1], filter_size=3, pad=1
    )
    l2 = conv2dbn(
        l2, name='%s_inceptB_2_3x3_2' % name,
        num_filters=nfilt[1][2], filter_size=3, stride=2
    )

    l3 = avg_pool(
        input_layer, name='%s_inceptB_3p' % name,
        pool_size=3, stride=2,
    )

    return nn.layers.ConcatLayer(
        [l1, l2, l3], name='%s_inceptB_concat' % name
    )


def inceptionC(input_layer, name, nfilt):

# Path: utils/layer_macros.py
# def conv2dbn(l, name, **kwargs):
#     """ Batch normalized DNN Conv2D Layer """
#     l = nn.layers.dnn.Conv2DDNNLayer(
#         l, name=name,
#         **kwargs
#     )
#     l = batch_norm(l, name='%sbn' % name)
#     return l


# Path: utils/inception.py
import lasagne as nn
import theano.tensor as T
from utils.layer_macros import conv2dbn

def inceptionB(input_layer, name, nfilt):
    l1 = conv2dbn(
        input_layer, name='%s_inceptB_1_3x3' % name,
        num_filters=nfilt[0][0], filter_size=3, stride=2
    )

    l2 = conv2dbn(
        input_layer, name='%s_inceptB_2_1x1' % name,
        num_filters=nfilt[1][0], filter_size=1
    )
    l2 = conv2dbn(
        l2, name='%s_inceptB_2_3x3_1' % name,
        num_filters=nfilt[1][1], filter_size=3, pad=1
    )
    l2 = conv2dbn(
        l2, name='%s_inceptB_2_3x3_2' % name,
        num_filters=nfilt[1][2], filter_size=3, stride=2
    )

    l3 = avg_pool(
        input_layer, name='%s_inceptB_3p' % name,
        pool_size=3, stride=2,
    )

    return nn.layers.ConcatLayer(
        [l1, l2, l3], name='%s_inceptB_concat' % name
    )


def inceptionC(input_layer, name, nfilt):

    l1 = conv2dbn(