Zaktualizuj 'ml_pytorch_mlflow.py'

This commit is contained in:
Sebastian Wałęsa 2022-05-15 22:08:21 +02:00
parent e5ade0a166
commit 41f8394f8f

View File

@ -130,10 +130,12 @@ def my_main(epochs):
expected = [] expected = []
predicted = [] predicted = []
inputs = []
for i in range(0, len(val_ds), 1): for i in range(0, len(val_ds), 1):
input_, target = val_ds[i] input_, target = val_ds[i]
expected.append(float(target)) expected.append(float(target))
predicted.append(float(prediction(input_, model))) predicted.append(float(prediction(input_, model)))
inputs.append(input_)
MSE = mean_squared_error(expected, predicted) MSE = mean_squared_error(expected, predicted)
MAE = mean_absolute_error(expected, predicted) MAE = mean_absolute_error(expected, predicted)
@ -147,7 +149,7 @@ def my_main(epochs):
input_, target = val_ds[i] input_, target = val_ds[i]
file.write(str(predict_single(input_, target, model))) file.write(str(predict_single(input_, target, model)))
print(val_ds[0]) print(inputs)
# input_example = val_ds[0] # input_example = val_ds[0]
# # input_example = input_example.unsqueeze(0) # # input_example = input_example.unsqueeze(0)