TensorFlow语法(2)


数学运算

1.矩阵元素运算:+ - * / % (取余) //(整除)
TensorFlow语法(2)
tf.math.log( )、tf.exp( )
TensorFlow语法(2)

tf.pow( )幂次方、tf.sqrt( )平方根
TensorFlow语法(2)

2.矩阵运算:@,tf.matmul( )都表示矩阵相乘。
TensorFlow语法(2)

维度变换

1.tf.reshape( )重塑张量。
TensorFlow语法(2)
将[4,784,3]恢复成[4,28,28,3],需要额外的信息(height和weight)
TensorFlow语法(2)
2.tf.transposer( )转置
TensorFlow语法(2)
TensorFlow语法(2)
3.tf.exand_dims( )增加维度
a表示要增加维度的原数据,axis指定增加维度的索引位置。
TensorFlow语法(2)
4.tf.squeeze( )删除维度为1的维度
axis表示维度为1的位置的索引。
TensorFlow语法(2)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-10-14
  • 2021-05-14
  • 2021-09-20
  • 2022-01-21
  • 2022-12-23
猜你喜欢
  • 2021-11-13
  • 2021-11-19
  • 2022-12-23
  • 2021-10-03
  • 2021-09-08
  • 2021-06-11
  • 2021-09-06
相关资源
相似解决方案