当前位置: 首页 > news >正文

凡科做的网站可以优化百度平台app

凡科做的网站可以优化,百度平台app,江苏电商网站开发,城建网官网SVD方法是模型降阶的一类重要方法,本征正交分解(POD)和平衡截断(BT)都属于SVD类方法。 要想深入了解模型降阶技术,我们可以先从SVD的应用入手,做一个直观的了解。 1. SVD的定义和分类 我们想寻找…

SVD方法是模型降阶的一类重要方法,本征正交分解(POD)和平衡截断(BT)都属于SVD类方法。

要想深入了解模型降阶技术,我们可以先从SVD的应用入手,做一个直观的了解。

1. SVD的定义和分类

我们想寻找一个A的逼近:Ak,使得rank(Ak) = k < n,且|A - Ak|最小。

下面的定理(也称为Schmidt-Mirsky, Eckart-Young定理)说明矩阵A的低秩逼近可以用SVD实现:

2. SVD在图像压缩中的应用

原始图片, rank=720:

绘制其R,G,B的奇异值:

压缩图片,rank=144:

压缩图片,rank=72:

代码:

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as imageA = image.imread("svd-image-compression-img.jpg")# Each pixel (typically) consists of 3 bytes — for the red, green and blue components of the color, respectively. 
# So, if we want to efficiently store the image, we need to somehow efficiently encode 3 matrices R, G and B 
# for each color component, respectively.
# We can extract the 3 color component matrices as briefly mentioned above as follows:
# 0xff代表十进制数值255
R = A[:,:,0] / 0xff
G = A[:,:,1] / 0xff
B = A[:,:,2] / 0xff# Now, we compute the SVD decomposition:
R_U, R_S, R_VT = np.linalg.svd(R)
G_U, G_S, G_VT = np.linalg.svd(G)
B_U, B_S, B_VT = np.linalg.svd(B)# polt the singular values
xaxis = np.arange(0, len(R_S))
plt.plot(xaxis, R_S, label='R_S')
plt.plot(xaxis, G_S, label='G_S')
plt.plot(xaxis, B_S, label='B_S')
plt.legend()relative_rank = 0.1
max_rank = int(relative_rank * min(R.shape[0], R.shape[1]))
print("max rank = %d" % max_rank)  # 144def read_as_compressed(U, S, VT, k):Ak = np.zeros((U.shape[0], VT.shape[1]))for i in range(k):U_i = U[:,[i]]VT_i = np.array([VT[i]])Ak += S[i] * (U_i @ VT_i)return Ak## Actually, it is easier and more efficient to perform the same operation 
## with a lower-rank matrix multiplication.
# def read_as_compressed(U, S, VT, k):
#     return (U[:,:k] @ np.diag(S[:k])) @ VT[:k]R_compressed = read_as_compressed(R_U, R_S, R_VT, max_rank)
G_compressed = read_as_compressed(G_U, G_S, G_VT, max_rank)
B_compressed = read_as_compressed(B_U, B_S, B_VT, max_rank)compressed_float = np.dstack((R_compressed, G_compressed, B_compressed))
compressed = (np.minimum(compressed_float, 1.0) * 0xff).astype(np.uint8)# Plot
plt.figure()
plt.imshow(A)plt.figure()
plt.imshow(compressed)image.imsave("compressed.jpg", compressed)

参考资料:

[A.C. Antoulas 2001] Approximation of large-scale dynamical systems: An overview
[潘建瑜] 矩阵计算_讲义 
Compressing images with singular value decomposition (SVD) | ZeroBone
http://www.zhongyajixie.com/news/13855.html

相关文章:

  • 怎样能创建一个网站厦门百度推广开户
  • 什么是电子商务网站推广百度seo优化服务
  • 苹果CMS如何做视频网站泉州搜索推广
  • wordpress设置文章固定标题朝阳区seo技术
  • 手机付费咨询网站建设什么软件可以发布广告信息
  • 做外贸网站赚钱吗武汉seo排名
  • 怎么做网盘网站免费打广告平台有哪些
  • asp网站建设代码网站模板平台资源
  • 手机网站源码asp宁德网站建设制作
  • 1000学习做网站贵吗淘宝指数转换
  • 竞猜网站开发常用seo站长工具
  • 上色的网站下载免费怎样开网站
  • 武汉外贸建站腾讯域名
  • 泉州外贸网站开发公司重庆网站排名推广
  • 做金融的喜欢逛哪些网站免费b站推广网站入口202
  • 南昌网站开发最新国际新闻50条简短
  • 知名做网站费用搜索引擎优化指的是什么
  • 济南网站设计价格百度游戏排行榜
  • 怎么开通自己的微信小程序标题优化怎样选关键词
  • 网站系统平台建设近期的新闻热点
  • framework7做网站零基础学seo要多久
  • sns社交网站 有哪些免费宣传平台
  • 做网站不难吧网络推广怎么收费
  • 服饰工厂网站建设百度搜索推广开户
  • 网站开发前端学习做神马seo快速排名软件
  • 电脑网页视频怎么下载广州seo优化排名公司
  • 织梦网站logo更改小说关键词生成器
  • 注册资本随便填了500万seo和sem推广
  • 中山建公司网站域名注册价格及续费
  • 重庆建设工程信息网官网安全监督信息seo深圳网络推广