|
1 | 1 | import numpy as np |
2 | 2 | import snmf_class |
3 | 3 |
|
4 | | -X0 = np.loadtxt("inputs/my_X0_4.txt", dtype=float) |
5 | | -MM = np.loadtxt("inputs/my_MM_4.txt", dtype=float) |
6 | | -A0 = np.loadtxt("inputs/my_A0_4.txt", dtype=float) |
7 | | -Y0 = np.loadtxt("inputs/my_W0_4.txt", dtype=float) |
| 4 | +X0 = np.loadtxt("input/X0.txt", dtype=float) |
| 5 | +MM = np.loadtxt("input/MM.txt", dtype=float) |
| 6 | +A0 = np.loadtxt("input/A0.txt", dtype=float) |
| 7 | +Y0 = np.loadtxt("input/W0.txt", dtype=float) |
8 | 8 | N, M = MM.shape |
9 | 9 |
|
10 | 10 | # Convert to DataFrames for display |
|
21 | 21 | print("Initial Guess (Y0):\n", df_Y0, "\n") |
22 | 22 | """ |
23 | 23 |
|
24 | | -my_model = snmf_class.SNMFOptimizer(MM=MM, Y0=Y0, X0=X0, A=A0) |
25 | | -print(f"My final guess for X: {my_model.X}") |
26 | | -print(f"My final guess for Y: {my_model.Y}") |
| 24 | +my_model = snmf_class.SNMFOptimizer(MM=MM, Y0=Y0, X0=X0, A=A0, components=2) |
| 25 | +print("Done") |
| 26 | +# print(f"My final guess for X: {my_model.X}") |
| 27 | +# print(f"My final guess for Y: {my_model.Y}") |
27 | 28 | # print(f"Compare to true X: {X_norm}") |
28 | 29 | # print(f"Compare to true Y: {Y_norm}") |
29 | 30 | np.savetxt("my_new_X.txt", my_model.X, fmt="%.6g", delimiter=" ") |
|
0 commit comments