Dimensions explanation

https://blog.csdn.net/lcczzu/article/details/85757229

 

Understand reduce_sum

 

  1. What is the sum
  2. What is reduce
  3. What is the dimension (indices, are now changed to the same axis and numpy package, etc.)

1. What are the dimensions? What is the axis (axis)? How the index shaft (axis)?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  1. 2 3-dimensional matrix to find where in the 3-dimensional cube Index: 0
  2. Find 3-dimensional array where the index 1 in a two-dimensional matrix: 1
  3. 3 found that the number of the one-dimensional array of index: 0

 

 

 

 

2. What is reduce

 

  1. Axis elements found in a = 1, i.e., [1,2], [3,4], [5,6], [7,8] array of four (two group on February, since the front and rear two two of the same status)
  2. It is performed by adding [1,2] + [3,4] = [4,6], [5,6] + [7,8] = [12, 14] = 1 axis dimension
  3. Compressing this dimension, that is "out of one square brackets" stars [[4, 6], [12, 14]]

3. What is keepdims

 

Guess you like

Origin www.cnblogs.com/zhangbojiangfeng/p/11200334.html