Skip to content

Commit

Permalink
close issue SmirkCao#83
Browse files Browse the repository at this point in the history
  • Loading branch information
SmirkCao committed Jun 12, 2019
1 parent a29bfec commit 2a87801
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CH17/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ def test_lsa_puffinwarellc_tutorial(self):
[0., 0., 0., 1., 1., 0., 0., 0., 0.]])
u, s, vh = np.linalg.svd(x, full_matrices=False)

print("\n")
print(40*"*"+"u"+40*"*")
print(np.round(u[:, :3], 2))

print(40*"*"+"s"+40*"*")
print(np.round(s[:3], 2))
print(40*"*"+"vh"+40*"*")
print(np.round(vh[:3, :], 2))

print(40*"*"+"svh"+40*"*")
print(np.round(np.dot(s[:3]*np.eye(3), vh[:3, :]), 2))

# v based decision
max_abs_raws = np.argmax(np.abs(vh), axis=1)
signs = np.sign(vh[range(vh.shape[0]), max_abs_raws])
Expand Down

0 comments on commit 2a87801

Please sign in to comment.