mlair.model_modules.inception_model

Module Contents

Classes

InceptionModelBase

This class contains all necessary construction blocks

Attributes

__author__

__date__

conv_settings_dict

mlair.model_modules.inception_model.__author__ = Felix Kleinert, Lukas Leufen
mlair.model_modules.inception_model.__date__ = 2019-10-22
class mlair.model_modules.inception_model.InceptionModelBase

This class contains all necessary construction blocks

block_part_name(self)

Use unicode due to some issues of keras with normal strings

Returns

batch_normalisation(self, input_x, **kwargs)
create_conv_tower(self, input_x, reduction_filter, tower_filter, tower_kernel, activation='relu', batch_normalisation=False, **kwargs)

This function creates a “convolution tower block” containing a 1x1 convolution to reduce filter size followed by convolution with given filter and kernel size

Parameters
  • input_x – Input to network part

  • reduction_filter – Number of filters used in 1x1 convolution to reduce overall filter size before conv.

  • tower_filter – Number of filters for n x m convolution

  • tower_kernel – kernel size for convolution (n,m)

  • activation – activation function for convolution

  • batch_normalisation

Returns

act(self, input_x, activation, **act_settings)
static _get_act_name(act_name)
create_pool_tower(self, input_x, pool_kernel, tower_filter, activation='relu', max_pooling=True, **kwargs)

This function creates a “MaxPooling tower block”

Parameters
  • input_x – Input to network part

  • pool_kernel – size of pooling kernel

  • tower_filter – Number of filters used in 1x1 convolution to reduce filter size

  • activation

  • max_pooling

Returns

inception_block(self, input_x, tower_conv_parts, tower_pool_parts, **kwargs)

Crate a inception block

Parameters
  • input_x – Input to block

  • tower_conv_parts

    dict containing settings for parts of inception block; Example: tower_conv_parts = {‘tower_1’: {‘reduction_filter’: 32,

    ’tower_filter’: 64, ‘tower_kernel’: (3, 1), ‘activation’ : ‘relu’, ‘padding’ : ‘SymPad2D’}

    ’tower_2’: {‘reduction_filter’: 32,

    ’tower_filter’: 64, ‘tower_kernel’: (5, 1), ‘activation’ : LeakyReLU, ‘padding’ : keras.layers.ZeroPadding2D}

    ’tower_3’: {‘reduction_filter’: 32,

    ’tower_filter’: 64, ‘tower_kernel’: (1, 1), ‘activation’ : ELU, ‘padding’ : src.model_modules.advanced_paddings.ReflectionPadding2D}

    }

  • tower_pool_parts – dict containing settings for pool part of inception block; Example: tower_pool_parts = {‘pool_kernel’: (3, 1), ‘tower_filter’: 64, ‘padding’: ‘RefPad2D’}

Returns

mlair.model_modules.inception_model.conv_settings_dict