How to implement a submeasure, for example, keras in a tensor flow?

What does subsample in this keras function?

 Convolution2D(nb_filter, nb_row, nb_col, subsample=subsample, activation=activation, border_mode=border_mode, W_regularizer=W_regularizer, b_regularizer=b_regularizer, dim_ordering=dim_ordering)(x) 

How to implement this subsample in tensorflow ?

+6
source share
2 answers
Subprogramme

in Keras, it’s the same as steps in a tensor flow. You can use the strides argument in the tenorflow function tf.nn.conv2d () to implement this.

Subsample / strides tells you how much to move the filter in each dimension when performing a convolution. For example, with a step of 1 in each direction, you must transfer the filter to one for each convolution and create an output of the same size as the input (except for border filling effects). If the steps were set to 2, the result would be half the size of the original image.

+6
source

There are various subsampling methods. You can make an average pool where you take the average value of the patch or the maximum pool, the latter becoming more popular. Use tf.nn.avg_pool () or tf.nn.max_pool (), the documentation for these functions can be found here

+1
source

All Articles