tensorflow————Understand the dimensions (two-dimensional, three-dimensional, thinking) and axis Axis in tensor

       In tensorflow, changing attempts is a frequently used operation. The format of color images in tensorflow is RGB, which is different from some other frameworks.

        When understanding multi-dimensional arrays, you can understand according to (batch_size, height, width, channel), the corresponding color image is RGB (in caffe, the incoming is channel, height, width)

       Understanding of two-dimensional arrays, (height, width). The storage starts from the small dimension, that is, x[h0][w0], x[h0][w1], x[0][w2], that is, store 1, 2, 3.

         The understanding of the three-dimensional array, (height, width, channel), can be intuitively understood from the lower right picture, and this is the case when the picture in the three-bit channel format is read.

                              

At the same time, after processing the heat map, we can directly use tf.argmax(x, axis=-1) to get the maximum value in the channel dimension to generate the heat map.

 

The understanding of four-dimensional array, (batch_size, height, width, channel) four-dimensional image can be regarded as multiple pictures.

 

In terms of dimensionality, we can understand it like this, and memorize. The three-dimensional and four-dimensional are as follows

In tensorflow, there are functions such as argmax and argmin that can be used for axis. It can be used in adding and deleting the dimension axis

 

Guess you like

Origin blog.csdn.net/JACKSONMHLK/article/details/107023188