当前位置:网站首页>Gram 矩阵
Gram 矩阵
2022-06-26 05:36:00 【SP FA】
关于 Gram 矩阵
n 维欧式空间中任意 k 个向量之间两两内积所组成的矩阵,称为这 k 个向量的 Gram 矩阵。
向量内积公式: a ⃗ ⋅ b ⃗ = ∑ i = 1 n a i b i \vec a\cdot\vec b=\sum\limits_{i=1}^na_ib_i a⋅b=i=1∑naibi所以 Gram 矩阵的公式就是: G r a m ( a ⃗ 1 ⋯ a ⃗ k ) = ( ( a ⃗ 1 ⋅ a ⃗ 1 ) ⋯ ( a ⃗ 1 ⋅ a ⃗ k ) ⋮ ⋱ ⋮ ( a ⃗ k ⋅ a ⃗ 1 ) ⋯ ( a ⃗ k ⋅ a ⃗ k ) ) Gram(\vec a_1\cdots\vec a_k)=\begin{pmatrix}(\vec a_1\cdot\vec a_1)&\cdots&(\vec a_1\cdot\vec a_k)\\\vdots&\ddots&\vdots\\(\vec a_k\cdot\vec a_1)&\cdots&(\vec a_k\cdot\vec a_k)\end{pmatrix} Gram(a1⋯ak)=⎝⎜⎛(a1⋅a1)⋮(ak⋅a1)⋯⋱⋯(a1⋅ak)⋮(ak⋅ak)⎠⎟⎞
可以看出,Gram 矩阵是一个对称矩阵。
Gram 矩阵可以看作是数据之间的偏心协方差矩阵(即没有减去均值的协方差矩阵,关于协方差矩阵可以看这篇文章)
Gram 矩阵的应用
对于一组特征,我们计算它的 Gram 矩阵,可以反映出特征两两之间的相关性。对角线上的元素可以理解为该特征的信息,其余元素则提供了不同特征相关性信息,这样一个矩阵既能体现出有哪些特征,又能反映出不同特征之间的紧密程度。
Gram 矩阵最直接的应用是在图像风格迁移领域。对于一张图片,我们想要提取它的风格,就需要使用网络提取局部纹理特征、图像轮廓等信息,然后计算 Gram 矩阵,就可以找出特征之间的相关性,这个计算出的 Gram 矩阵就反映了图像的风格。此时如果要比较两张图片之间的风格相似程度,只需要比较它们的 Gram 矩阵,若 Gram 矩阵的差异较小,则可以认为两张图像风格相近。
边栏推荐
猜你喜欢
cartographer_local_trajectory_builder_2d
【ARM】在NUC977上搭建基于boa的嵌入式web服务器
[arm] add desktop application for buildreoot of rk3568 development board
Mongodb image configuration method
DOM文档
Red team scoring method statistics
操作符的优先级、结合性、是否控制求值顺序【详解】
REUSE_ALV_GRID_DISPLAY 事件实现(DATA_CHANGED)
cartographer_ optimization_ problem_ 2d
As promised: Mars, the mobile terminal IM network layer cross platform component library used by wechat, has been officially open source
随机推荐
June 3 is a happy day
cartographer_fast_correlative_scan_matcher_2d分支定界粗匹配
Mise en file d'attente des messages en utilisant jedis Listening redis stream
【ARM】在NUC977上搭建基于boa的嵌入式web服务器
无线网络存在的安全问题及现代化解决方案
使用Jedis监听Redis Stream 实现消息队列功能
vscode config
Tp5.0 framework PDO connection MySQL error: too many connections solution
PHP 2D / multidimensional arrays are sorted in ascending and descending order according to the specified key values
Leetcode114. Expand binary tree into linked list
Positioning setting horizontal and vertical center (multiple methods)
The difference between get and post in small interview questions
Apktool tool usage document
使用Jenkins执行TestNg+Selenium+Jsoup自动化测试和生成ExtentReport测试报告
vscode config
Recursively traverse directory structure and tree presentation
uniCloud云开发获取小程序用户openid
C# 39. Conversion between string type and byte[] type (actual measurement)
Pytorch中自己所定义(修改)的模型加载所需部分预训练模型参数并冻结
redis探索之布隆过滤器