/usr/share/pyshared/mdp/test/test_WhiteningNode.py is in python-mdp 3.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | from _tools import *
def testWhiteningNode():
vars = 5
dim = (10000,vars)
mat,mix,inp = get_random_mix(mat_dim=dim, avg=uniform(vars))
w = mdp.nodes.WhiteningNode()
w.train(inp)
out = w.execute(inp)
assert_array_almost_equal(mean(out, axis=0),
numx.zeros(dim[1]), decimal)
assert_array_almost_equal(std(out, axis=0),
numx.ones(dim[1]), decimal - 3)
def testWhiteningNode_SVD():
vars = 5
dim = (10000,vars)
mat,mix,inp = get_random_mix(mat_dim=dim, avg=uniform(vars))
w = mdp.nodes.WhiteningNode(svd=True)
w.train(inp)
out = w.execute(inp)
assert_array_almost_equal(mean(out, axis=0),
numx.zeros(dim[1]), decimal)
assert_array_almost_equal(std(out, axis=0),
numx.ones(dim[1]), decimal - 3)
|