Skip to content

Instantly share code, notes, and snippets.

@quiye
Last active February 12, 2018 12:54
Show Gist options
  • Save quiye/49c8f3b25583c4176871a3998a0d94c6 to your computer and use it in GitHub Desktop.
Save quiye/49c8f3b25583c4176871a3998a0d94c6 to your computer and use it in GitHub Desktop.
平均を0にする正規化のやり方
import numpy as np
from numpy.random import *
m = 5
n = 3
a = rand(m,n)
v = np.full((n,n),1)
u = np.full((m,m),1)
print('a => 入力の行列')
print(a)
print("a-1/n*a.dot(vv) => 各行の和が0")
print(a-1/n*a.dot(v))
print("a-1/m*uu.dot(a) => 各列の和が0")
print(a-1/m*u.dot(a))
@quiye
Copy link
Author

quiye commented Feb 12, 2018

vv, uuではなく、単にv, uなのでは?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment