|  | 
| 1 | 1 | import numpy as np | 
| 2 | 2 | from snmf_class import SNMFOptimizer | 
| 3 | 3 | 
 | 
| 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 |  | -N, M = MM.shape | 
|  | 4 | +init_comps_file = np.loadtxt("input/X0.txt", dtype=float) | 
|  | 5 | +source_matrix_file = np.loadtxt("input/MM.txt", dtype=float) | 
|  | 6 | +init_stretch_file = np.loadtxt("input/A0.txt", dtype=float) | 
|  | 7 | +init_weights_file = np.loadtxt("input/W0.txt", dtype=float) | 
|  | 8 | + | 
|  | 9 | +my_model = SNMFOptimizer( | 
|  | 10 | +    source_matrix=source_matrix_file, | 
|  | 11 | +    init_weights=init_weights_file, | 
|  | 12 | +    init_comps=init_comps_file, | 
|  | 13 | +    init_stretch=init_stretch_file, | 
|  | 14 | +) | 
| 9 | 15 | 
 | 
| 10 |  | -my_model = SNMFOptimizer(MM=MM, Y0=Y0, X0=X0, A0=A0) | 
| 11 | 16 | print("Done") | 
| 12 |  | -np.savetxt("my_norm_X.txt", my_model.X, fmt="%.6g", delimiter=" ") | 
| 13 |  | -np.savetxt("my_norm_Y.txt", my_model.Y, fmt="%.6g", delimiter=" ") | 
| 14 |  | -np.savetxt("my_norm_A.txt", my_model.A, fmt="%.6g", delimiter=" ") | 
|  | 17 | +np.savetxt("my_norm_comps.txt", my_model.comps, fmt="%.6g", delimiter=" ") | 
|  | 18 | +np.savetxt("my_norm_weights.txt", my_model.weights, fmt="%.6g", delimiter=" ") | 
|  | 19 | +np.savetxt("my_norm_stretch.txt", my_model.stretch, fmt="%.6g", delimiter=" ") | 
0 commit comments