Operation Cells#

(hivenas.config.operation_cells)

Cell-based operations definition

class OperationCells[source]#

Bases: object

Wrapper for all Search Space cells, each group of operations (cell) is defined as a function that returns a function. This is to conform to Keras’ functional models’ design pattern.

i.e: ConvBnReLU(3, 32, 1)(input_layer). This ensures that cells defined here and primitive Keras layers are interchangeable and behave the same way in the remainder of the code.

static ConvBnReLU(conv_kern=3, conv_filt=32, conv_stride=1)[source]#

Cell consisting of Conv2D | BatchNormalization | ReLU

Parameters
  • conv_kern (int, optional) – the convolution’s kernel size

  • conv_filter (int, optional) – the number of filters in the conv layer

  • conv_stride (int, optional) – the convolution’s stride value

Returns

returns a functional template that accepts the input layer

Return type

func

static ConvBnReLUAvgPool(conv_kern=3, conv_filt=32, conv_stride=1, pool_size=2, pool_stride=2)[source]#

Cell consisting of Conv2D | BatchNormalization | ReLU | AveragePooling2D

Parameters
  • conv_kern (int, optional) – the convolution’s kernel size

  • conv_filter (int, optional) – the number of filters in the conv layer

  • conv_stride (int, optional) – the convolution’s stride value

  • pool_size (int, optional) – the average pooling kernel size

  • pool_stride (int, optional) – the average pooling’s stride value

Returns

returns a functional template that accepts the input layer

Return type

func

static ResidualConvBnReLU(conv_kern=3, conv_filt=32, conv_stride=1, reg_identity=True, reg_filters=32, block_count=2)[source]#

Residual cell consisting of block_count \(\times\) (Conv2D | BatchNormalization | ReLU)

Parameters
  • conv_kern (int, optional) – the convolution’s kernel size

  • conv_filter (int, optional) – the number of filters in the conv layer

  • conv_stride (int, optional) – the convolution’s stride value

  • reg_identity (bool, optional) – specifies whether an initial regularizing identity layer is added

  • block_count (int, optional) – number of (Conv2D | BatchNormalization | ReLU) cells are used in the residual block

Returns

returns a functional template that accepts the input layer

Return type

func