Skip to content

Commit 37d5e50

Browse files
author
John Halloran
committed
Working build (no normalization)
1 parent 22a1b0d commit 37d5e50

File tree

3 files changed

+116
-133
lines changed

3 files changed

+116
-133
lines changed

src/diffpy/snmf/main.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import numpy as np
22
import snmf_class
33

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)
88
N, M = MM.shape
99

1010
# Convert to DataFrames for display
@@ -21,9 +21,10 @@
2121
print("Initial Guess (Y0):\n", df_Y0, "\n")
2222
"""
2323

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}")
2728
# print(f"Compare to true X: {X_norm}")
2829
# print(f"Compare to true Y: {Y_norm}")
2930
np.savetxt("my_new_X.txt", my_model.X, fmt="%.6g", delimiter=" ")

src/diffpy/snmf/old_main.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)