基于张量网络的机器学习(四)

本文介绍了一种新颖的张量表示与运算方法,利用图形化的方式描绘张量及张量之间的运算,如外积、内积和矩阵的迹等。文章详细解释了张量分解,包括SVD、CP和Tucker分解,并介绍了张量网络的概念及其在复杂张量运算中的应用。

  在前面的学习中,我们已经比较详细地学习了四种张量分解,接下来,我们就将进入张量网络的学习。

一.新的方法

  当张量的阶数超过了3阶后,我们要去形象地描绘这个张量就会显得困难,为了方便,现在引入一种新的张量表示方法。

使用新的方法描绘各阶张量

  对于一个矩阵,可以将行作为起始地点,将列作为目标地点,那么对应的元素值可以代表起始地点到目标地点的距离,类似的,我们把矩阵的行作为输入,列作为输出,行数可以使用指标i代表输入空间的维数,列数可以用指标j代表输出空间的维数,并用类似电路的图形来表示:
在这里插入图片描述
这表示一个二阶张量,一条边表示一个维度,对其进行推广就是n阶张量可以由一个节点邻接n条边来表示,标量就可以只由一个节点来表示,所以:
在这里插入图片描述

对于更高阶的张量,我们依旧可以这么做,但是我们还能为其附加上更多含义:
在这里插入图片描述
加上一个大圈可以表明哪些维度当做内部结构,比如上图的四阶张量是以三阶张量作为内部结构,五阶张量前者以三阶张量作为内部结构,后者以二阶张量作为内部结构,当然,也可以不止这么一个圈,比如:
在这里插入图片描述
第一个粉圈代表第一个内部结构,第二个蓝圈代表第二个内部结构。

使用新的方法描绘各阶张量的运算

  这种新的张量描绘方法的特点是:张量本身由节点(对于节点长什么样还并未作出定性要求)表示,指标由连接节点的边表示;不同张量的公共指标由连接对应节点的边表示,默认进行求和。

  • 外积:
    在这里插入图片描述

  • 内积:
    在这里插入图片描述

  • 矩阵的迹:一个自环

在这里插入图片描述
矩阵的迹还具有循环特性:
在这里插入图片描述

  • 缩并:矩阵乘法实际就是缩并,只要有一条公共边张量阶数之和就降两阶
    矩阵和矩阵相乘:
    在这里插入图片描述
    矩阵和向量相乘:
    在这里插入图片描述
    高阶张量和高阶张量的缩并(这里进行了两次缩并):
    在这里插入图片描述

使用新的方法描绘张量分解

  • 普通的矩阵分解如图:
    在这里插入图片描述
    这里将一个矩阵分解成了四个矩阵的乘积。

  • SVD分解
    conda install opencv
    上图最后一个等号右边的左右奇异矩阵为方形但奇异值矩阵为一个三角形且连接的边是弯的,这也说明,这种新的方法并未对节点和边的形状作定性要求,只要合理即可(比如奇异值矩阵可以是一个对角阵,所以它用一个三角形来表示可以突出矩阵的特点)。

  • CP分解
    在这里插入图片描述
    这里将一个四阶张量通过CP分解分解成R个秩一张量的和,每个秩一张量等于四个向量的外积。

  • Tucker分解
    对于一个三阶张量 A ,它可以分解为一个核心张量和三个(不同模态下的)正交矩阵的模乘:
    在这里插入图片描述

二.张量网络

什么是张量网络

  将多个张量(包含向量、矩阵、高阶张量)按照特定规则缩并,形成一个网络,称为张量网络,张量网络可以说是将张量内部缩并关系抽象出来的成果,大概就长成下面这样:

在这里插入图片描述

传统绘图法与张量网络法

  下图(a)展示的是一个三阶张量与一个矩阵的模乘,图(b)是图(a)的推广,张量与矩阵的模乘也是一种缩并,显然这种缩并关系用张量网络表示显得更形象。
在这里插入图片描述
  这种新的方法将为接下来有关某些重要的张量网络(矩阵乘积态、投影纠缠对态等等)的进一步学习打下基础。

参考资料链接:
https://rajatvd.github.io/Factor-Graphs/
https://www.math3ma.com/blog/matrices-as-tensor-network-diagrams
https://www.bilibili.com/video/BV17z411i7yM/

Modern applications in engineering and data science are increasingly based on multidimensional data of exceedingly high volume, variety, and structural richness. However, standard machine learning algo- rithms typically scale exponentially with data volume and complex- ity of cross-modal couplings - the so called curse of dimensionality - which is prohibitive to the analysis of large-scale, multi-modal and multi-relational datasets. Given that such data are often efficiently represented as multiway arrays or tensors, it is therefore timely and valuable for the multidisciplinary machine learning and data analytic communities to review low-rank tensor decompositions and tensor net- works as emerging tools for dimensionality reduction and large scale optimization problems. Our particular emphasis is on elucidating that, by virtue of the underlying low-rank approximations, tensor networks have the ability to alleviate the curse of dimensionality in a number of applied areas. In Part 1 of this monograph we provide innovative solutions to low-rank tensor network decompositions and easy to in- terpret graphical representations of the mathematical operations on tensor networks. Such a conceptual insight allows for seamless migra- tion of ideas from the flat-view matrices to tensor network operations and vice versa, and provides a platform for further developments, prac- tical applications, and non-Euclidean extensions. It also permits the introduction of various tensor network operations without an explicit notion of mathematical expressions, which may be beneficial for many research communities that do not directly rely on multilinear algebra. Our focus is on the Tucker and tensor train (TT) decompositions and their extensions, and on demonstrating the ability of tensor networks to provide linearly or even super-linearly (e.g., logarithmically) scalable solutions, as illustrated in detail in Part 2 of this monograph.
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值