学习Pytorch

Introduction to tensors

What’s a Tensor?

基本词汇

  • basis vector: 基向量
  • component: 分量
  • Euclidean plane: 欧几里得平面,就是二维平面
  • These three compents pertain only to the vector we had laid on the table
    • pertain: 属于
    • 这三个分量只属于我们刚才放在桌子上的那个向量

基本思路

  • 对于一个二维平面中的向量,可以使用这个向量在x轴和y轴上的分量进行表示
  • x轴的分量用基向量来表示,例如一个向量在x轴上的分量是3个基向量
  • y轴的分量用基向量来表示,例如一个向量在y轴上的分量是4个基向量
  • 那么这个向量就可以使用$(3,4)$来表示
  • 为了表示一个平面中的任意一个向量,我们可以用$(A_x, A_y)$来表示
  • 向量中的每个分量,都只有一个基向量,所以向量也被叫做rank 1 tensor
  • Rank and dimension are not the same.

高维张量

rank 2 tensor
  • 对于rank 2 tensor,我们需要使用9个分量来表示,每组分量由两个基向量表示
  • 在空间中,一个施加在平面上的力
  • 我们可以使用rank 2 tensor来表示这个力的分布关系
  • rank 2 tensor的一组分量中的第一个基向量可以用来表示平面,第二个基向量可以用来表示力
  • 每个基向量都有3种,所以在三维空间的rank 2 tensor就是一个3 * 3的矩阵,拥有9个分量
rank 3 tensor
  • rank 3 tensor,对于每个分量,需要三个方向来考虑
  • 在三维空间中,每个方向的基向量都有三种
  • 所以三维空间中的rank 3 tensor使用一个3 _ 3 _ 3的立体空间来表示的



Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Google Gemini updates: Flash 1.5, Gemma 2 and Project Astra
  • Displaying External Posts on Your al-folio Blog
  • 强化学习导论
  • 企业项目实训
  • 面试总结