mltk.core.TflitePadding

class TflitePadding[source]

Padding types

This may be instantiated with either an integer OR string, e.g.:

padding = TflitePadding(0)
padding = TflitePadding('same')

Properties

SAME

Add zeros to the borders of the input so that the output has the same dimensions when applying the kernel

VALID

Apply the kernel only the valid regions of the input, the output dimensions will be reduced

width

The calculated width of the padding for the current layer

height

The calculated height of the padding for the current layer

Methods

to_string

Return the padding as a string

SAME = 0

Add zeros to the borders of the input so that the output has the same dimensions when applying the kernel

out_height = ceil(float(in_height) / float(stride_height))
out_width  = ceil(float(in_width) / float(stride_width))
VALID = 1

Apply the kernel only the valid regions of the input, the output dimensions will be reduced

out_height = ceil(float(in_height - filter_height + 1) / float(stride_height))
out_width  = ceil(float(in_width - filter_width + 1) / float(stride_width))
property width: int

The calculated width of the padding for the current layer

Return type:

int

property height: int

The calculated height of the padding for the current layer

Return type:

int

to_string()[source]

Return the padding as a string

Return type:

str