Skip to content

Commit f971f32

Browse files
committed
(modelAdjusters) Updated adjust() to wrap inputs in np.array() so it handles data coming in as Python nested lists of floats, 2D NumPy arrays, and list of 1D NumPy arrays seamlessly
1 parent f81436c commit f971f32

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎pysipfenn/core/modelAdjusters.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ def adjust(
308308
assert len(self.targetData) != 0, "The target data must not be empty for the adjustment process."
309309
assert len(self.descriptorData) == len(self.targetData), "The descriptor and target data must have the same length."
310310

311-
ddTensor = torch.from_numpy(self.descriptorData).float().to(device=self.device)
312-
tdTensor = torch.from_numpy(self.targetData).float().to(device=self.device)
311+
ddTensor = torch.from_numpy(np.array(self.descriptorData)).float().to(device=self.device)
312+
tdTensor = torch.from_numpy(np.array(self.targetData)).float().to(device=self.device)
313313
if validation > 0:
314314
split = int(len(ddTensor) * (1 - validation))
315315
self.validationLabels = ["Training"]*split + ["Validation"]*(len(ddTensor)-split)

0 commit comments

Comments
 (0)