Skip to content

Commit 44ce483

Browse files
added test_svd performance, moved to 0.6.7
1 parent 8436b51 commit 44ce483

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ And in the notebooks provided in the [examples](https://github.com/CalculatedCon
4242
pip install weightwatcher
4343
```
4444

45-
### Current TestPyPI Version: 0.6.6.9
45+
### Current TestPyPI Version: 0.6.7
4646

4747
```sh
4848
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple weightwatcher

tests/test_svd.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import numpy as np
2+
import scipy.linalg as la
3+
import time
4+
5+
# Generate random matrix with 1000 rows and 500 columns
6+
A = np.random.rand(1000, 500)
7+
8+
# Test numpy.linalg.svd
9+
start_time = time.time()
10+
U, S, VT = np.linalg.svd(A, full_matrices=False)
11+
end_time = time.time()
12+
np_time = end_time - start_time
13+
print(f"np.linalg.svd took {np_time:.5f} seconds")
14+
15+
# Test scipy.linalg.svd
16+
start_time = time.time()
17+
U, S, VT = la.svd(A, full_matrices=False)
18+
end_time = time.time()
19+
scipy_time = end_time - start_time
20+
print(f"scipy.linalg.svd took {scipy_time:.5f} seconds")
21+
22+
# Compare the execution times
23+
if np_time < scipy_time:
24+
print("numpy.linalg.svd is faster")
25+
else:
26+
print("scipy.linalg.svd is faster")
27+

weightwatcher/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
__name__ = "weightwatcher"
21-
__version__ = "0.6.6.9"
21+
__version__ = "0.6.7"
2222
__license__ = "Apache License, Version 2.0"
2323
__description__ = "Diagnostic Tool for Deep Neural Networks"
2424
__url__ = "https://calculationconsulting.com/"

0 commit comments

Comments
 (0)