# https://github.com/tensorflow/tpu/blob/master/models/official/efficientnet/lite/efficientnet_lite_builder.py
# (width_coefficient, depth_coefficient, resolution, dropout_rate)
# 'efficientnet-lite3': (1.2, 1.4, 280, 0.3),
#
#_DEFAULT_BLOCKS_ARGS = [
#    'r1_k3_s11_e1_i32_o16_se0.25', 'r2_k3_s22_e6_i16_o24_se0.25',
#    'r2_k5_s22_e6_i24_o40_se0.25', 'r3_k3_s22_e6_i40_o80_se0.25',
#    'r3_k5_s11_e6_i80_o112_se0.25', 'r4_k5_s22_e6_i112_o192_se0.25',
#    'r1_k3_s11_e6_i192_o320_se0.25',
#]

[net]
# Training
batch=120
subdivisions=6
height=288
width=288
channels=3
momentum=0.9
decay=0.0005
max_crop=320

cutmix=1
mosaic=1
label_smooth_eps=0.1

burn_in=1000
learning_rate=0.256
policy=step
step=10000
scale=0.96
max_batches=1600000
momentum=0.9
decay=0.00005

angle=7
hue=.1
saturation=.75
exposure=.75
aspect=.75


### CONV1 - 1 (1)
# conv1
[convolutional]
filters=40	#32
size=3
pad=1
stride=2
batch_normalize=1
activation=relu6


### CONV2 - MBConv1 - 1 (2)
# conv2_1_expand
[convolutional]
filters=40	#32
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv2_1_dwise
[convolutional]
groups=40	#32
filters=40	#32
size=3
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv2_1_linear
[convolutional]
filters=16	#16
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV2 - MBConv1 - 2 (2)
# conv2_1_expand
[convolutional]
filters=40	#32
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv2_1_dwise
[convolutional]
groups=40	#32
filters=40	#32
size=3
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv2_1_linear
[convolutional]
filters=16	#16
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV3 - MBConv6 - 1 (3)
# dropout only before residual connection
[dropout]
probability=.3

# block_3_1
[shortcut]
from=-5
activation=linear

# conv2_2_expand
[convolutional]
filters=112	#96
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv2_2_dwise
[convolutional]
groups=112	#96
filters=112	#96
size=3
pad=1
stride=2
batch_normalize=1
activation=relu6

# conv2_2_linear
[convolutional]
filters=32	#24
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV3 - MBConv6 - 2 (3)
# conv3_1_expand
[convolutional]
filters=176	#144
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv3_1_dwise
[convolutional]
groups=176	#144
filters=176	#144
size=3
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv3_1_linear
[convolutional]
filters=32	#24
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV3 - MBConv6 - 3 (3)
# dropout only before residual connection
[dropout]
probability=.3

# block_3_1
[shortcut]
from=-5
activation=linear

# conv3_1_expand
[convolutional]
filters=176	#144
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv3_1_dwise
[convolutional]
groups=176	#144
filters=176	#144
size=3
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv3_1_linear
[convolutional]
filters=32	#24
size=1
stride=1
pad=0
batch_normalize=1
activation=linear



### CONV4 - MBConv6 - 1 (3)
# dropout only before residual connection
[dropout]
probability=.3

# block_3_1
[shortcut]
from=-5
activation=linear

# conv_3_2_expand
[convolutional]
filters=176	#144
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_3_2_dwise
[convolutional]
groups=176	#144
filters=176	#144
size=5
pad=1
stride=2
batch_normalize=1
activation=relu6

# conv_3_2_linear
[convolutional]
filters=48	#40
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV4 - MBConv6 - 2 (3)
# conv_4_1_expand
[convolutional]
filters=232	#192
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_4_1_dwise
[convolutional]
groups=232	#192
filters=232	#192
size=5
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_4_1_linear
[convolutional]
filters=48	#40
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV4 - MBConv6 - 3 (3)
# dropout only before residual connection
[dropout]
probability=.3

# block_4_2
[shortcut]
from=-5
activation=linear

# conv_4_1_expand
[convolutional]
filters=232	#192
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_4_1_dwise
[convolutional]
groups=232	#192
filters=232	#192
size=5
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_4_1_linear
[convolutional]
filters=48	#40
size=1
stride=1
pad=0
batch_normalize=1
activation=linear




### CONV5 - MBConv6 - 1 (5)
# dropout only before residual connection
[dropout]
probability=.3

# block_4_2
[shortcut]
from=-5
activation=linear

# conv_4_3_expand
[convolutional]
filters=232	#192
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_4_3_dwise
[convolutional]
groups=232	#192
filters=232	#192
size=3
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_4_3_linear
[convolutional]
filters=96	#80
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV5 - MBConv6 - 2 (5)
# conv_4_4_expand
[convolutional]
filters=464	#384
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_4_4_dwise
[convolutional]
groups=464	#384
filters=464	#384
size=3
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_4_4_linear
[convolutional]
filters=96	#80
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV5 - MBConv6 - 3 (5)
# dropout only before residual connection
[dropout]
probability=.3

# block_4_4
[shortcut]
from=-5
activation=linear

# conv_4_5_expand
[convolutional]
filters=464	#384
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_4_5_dwise
[convolutional]
groups=464	#384
filters=464	#384
size=3
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_4_5_linear
[convolutional]
filters=96	#80
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV5 - MBConv6 - 4 (5)
# dropout only before residual connection
[dropout]
probability=.3

# block_4_4
[shortcut]
from=-5
activation=linear

# conv_4_5_expand
[convolutional]
filters=464	#384
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_4_5_dwise
[convolutional]
groups=464	#384
filters=464	#384
size=3
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_4_5_linear
[convolutional]
filters=96	#80
size=1
stride=1
pad=0
batch_normalize=1
activation=linear



### CONV5 - MBConv6 - 5 (5)
# dropout only before residual connection
[dropout]
probability=.3

# block_4_4
[shortcut]
from=-5
activation=linear

# conv_4_5_expand
[convolutional]
filters=464	#384
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_4_5_dwise
[convolutional]
groups=464	#384
filters=464	#384
size=3
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_4_5_linear
[convolutional]
filters=96	#80
size=1
stride=1
pad=0
batch_normalize=1
activation=linear



### CONV6 - MBConv6 - 1 (5)
# dropout only before residual connection
[dropout]
probability=.3

# block_4_6
[shortcut]
from=-5
activation=linear

# conv_4_7_expand
[convolutional]
filters=464	#384
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_4_7_dwise
[convolutional]
groups=464	#384
filters=464	#384
size=5
pad=1
stride=2
batch_normalize=1
activation=relu6

# conv_4_7_linear
[convolutional]
filters=136	#112
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV6 - MBConv6 - 2 (5)
# conv_5_1_expand
[convolutional]
filters=688	#576
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_5_1_dwise
[convolutional]
groups=688	#576
filters=688	#576
size=5
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_5_1_linear
[convolutional]
filters=136	#112
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV6 - MBConv6 - 3 (5)
# dropout only before residual connection
[dropout]
probability=.3

# block_5_1
[shortcut]
from=-5
activation=linear

# conv_5_2_expand
[convolutional]
filters=688	#576
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_5_2_dwise
[convolutional]
groups=688	#576
filters=688	#576
size=5
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_5_2_linear
[convolutional]
filters=136	#112
size=1
stride=1
pad=0
batch_normalize=1
activation=linear



### CONV6 - MBConv6 - 4 (5)
# dropout only before residual connection
[dropout]
probability=.3

# block_5_1
[shortcut]
from=-5
activation=linear

# conv_5_2_expand
[convolutional]
filters=688	#576
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_5_2_dwise
[convolutional]
groups=688	#576
filters=688	#576
size=5
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_5_2_linear
[convolutional]
filters=136	#112
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV6 - MBConv6 - 5 (5)
# dropout only before residual connection
[dropout]
probability=.3

# block_5_1
[shortcut]
from=-5
activation=linear

# conv_5_2_expand
[convolutional]
filters=688	#576
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_5_2_dwise
[convolutional]
groups=688	#576
filters=688	#576
size=5
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_5_2_linear
[convolutional]
filters=136	#112
size=1
stride=1
pad=0
batch_normalize=1
activation=linear



### CONV7 - MBConv6 - 1 (6)
# dropout only before residual connection
[dropout]
probability=.3

# block_5_2
[shortcut]
from=-5
activation=linear

# conv_5_3_expand
[convolutional]
filters=688	#576
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_5_3_dwise
[convolutional]
groups=688	#576
filters=688	#576
size=5
pad=1
stride=2
batch_normalize=1
activation=relu6


# conv_5_3_linear
[convolutional]
filters=232	#192
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV7 - MBConv6 - 2 (6)
# conv_6_1_expand
[convolutional]
filters=1152	#960
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_6_1_dwise
[convolutional]
groups=1152		#960
filters=1152	#960
size=5
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_6_1_linear
[convolutional]
filters=232	#192
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV7 - MBConv6 - 3 (6)
# dropout only before residual connection
[dropout]
probability=.3

# block_6_1
[shortcut]
from=-5
activation=linear

# conv_6_2_expand
[convolutional]
filters=1152	#960
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_6_2_dwise
[convolutional]
groups=1152	#960
filters=1152	#960
size=5
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_6_2_linear
[convolutional]
filters=232	#192
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV7 - MBConv6 - 4 (6)
# dropout only before residual connection
[dropout]
probability=.3

# block_6_1
[shortcut]
from=-5
activation=linear

# conv_6_2_expand
[convolutional]
filters=1152	#960
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_6_2_dwise
[convolutional]
groups=1152	#960
filters=1152	#960
size=5
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_6_2_linear
[convolutional]
filters=232	#192
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV7 - MBConv6 - 5 (6)
# dropout only before residual connection
[dropout]
probability=.3

# block_6_1
[shortcut]
from=-5
activation=linear

# conv_6_2_expand
[convolutional]
filters=1152	#960
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_6_2_dwise
[convolutional]
groups=1152	#960
filters=1152	#960
size=5
stride=1
pad=1
batch_normalize=1
activation=relu6

# conv_6_2_linear
[convolutional]
filters=232	#192
size=1
stride=1
pad=0
batch_normalize=1
activation=linear


### CONV7 - MBConv6 - 6 (6)
# dropout only before residual connection
[dropout]
probability=.3

# block_6_1
[shortcut]
from=-5
activation=linear

# conv_6_2_expand
[convolutional]
filters=1152	#960
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_6_2_dwise
[convolutional]
groups=1152	#960
filters=1152	#960
size=5
stride=1
pad=1
batch_normalize=1
activation=relu6



# conv_6_2_linear
[convolutional]
filters=232	#192
size=1
stride=1
pad=0
batch_normalize=1
activation=linear



### CONV8 - MBConv6 - 1 (1)
# dropout only before residual connection
[dropout]
probability=.3

# block_6_2
[shortcut]
from=-5
activation=linear

# conv_6_3_expand
[convolutional]
filters=1152	#960
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6

# conv_6_3_dwise
[convolutional]
groups=1152	#960
filters=1152	#960
size=3
stride=1
pad=1
batch_normalize=1
activation=relu6



# conv_6_3_linear
[convolutional]
filters=384	#320
size=1
stride=1
pad=0
batch_normalize=1
activation=linear




### CONV9 - Conv2d 1x1
# conv_6_4
[convolutional]
filters=1536	#1280
size=1
stride=1
pad=0
batch_normalize=1
activation=relu6


[avgpool]

[dropout]
probability=.3

[convolutional]
filters=1000
size=1
stride=1
pad=0
activation=linear

[softmax]
groups=1

#[cost]
#type=sse

