Matrix multiply tips and Cholesky Decomposition

Matrix mulitply

python

a1 = np.arange(2)                                # [0,1] (2,)
a2 = np.arange(6).reshape(2,3)                   # [[1,2,3][4,5,6]] (2,3)

a1@a2
> array([3, 4, 5])                                  # (3,)

a2[None,:]@b
> array([[3, 4, 5]])                                # (1,3)

a1 * a2
>array([[0, 3],
       [0, 4],
       [0, 5]])

Q: what's the order of a a2 @ a2.T:
a1
a2 @ a2.T = (a1 * a2 ) @ a2.T
实质,将系数a1平均分给a2的列向量上

Julia

CPP

Cholesky Decompostion

The cholesky decompostion is exclusively defined for symmetric or Hermitian positive definite matrices,
A = LL*.

Python:

1.  chol_xx_cov = np.linalg.cholesky(x_cov)
2. 
    s1,v1,d1 = np.linalg.svd(x_cov)
    v1 = np.clip(v1,a_min = 1e-8,a_max = None)
    q1 = np.linalg.qr(np.sqrt(v1)[:,None] * d1)[-1]
    chol_xx_cov = q1.T

Julia:

CPP

No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
Previous
Next