Skip to content

Commit b0b3ecc

Browse files
committed
- adjust makePredictions to reshape multi-property models without affecting the backwards compatibility with custom operations; dictionay result printouts will *not* work correctly for multi-property models but will function as expected for single-property models
1 parent f446b35 commit b0b3ecc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pysipfenn/core/pysipfenn.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -667,12 +667,17 @@ def makePredictions(
667667
else:
668668
tempOut = model(dataIn)
669669
t1 = perf_counter()
670-
dataOuts.append(tempOut.cpu().detach().numpy())
670+
671+
# Convert to numpy and reshape multi-property outputs
672+
temp_numpy = tempOut.cpu().detach().numpy()
673+
for col_idx in range(temp_numpy.shape[1]):
674+
dataOuts.append(temp_numpy[:, col_idx].reshape(-1, 1))
675+
671676
if self.verbose:
672677
print(f'Prediction rate: {round(len(tempOut) / (t1 - t0), 1)} pred/s')
673678
print(f'Obtained {len(tempOut)} predictions from: {net}')
674679

675-
# Transpose and round the predictions
680+
# Transpose the predictions
676681
dataOuts = np.array(dataOuts).T.tolist()[0]
677682
self.predictions = dataOuts
678683
return dataOuts

0 commit comments

Comments
 (0)