Zaktualizuj 'ml_pytorch_mlflow.py'

This commit is contained in:
Sebastian Wałęsa 2022-05-15 22:58:19 +02:00
parent b8a80fb138
commit 635259d6f2

View File

@ -131,15 +131,15 @@ def my_main(epochs):
expected = [] expected = []
predicted = [] predicted = []
inputs = [] inputss = []
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_) inputss.append(input_)
inputs = pd.DataFrame(inputs, dtype=np.float64) inputss = pd.DataFrame(inputs, dtype=np.float64)
inputs = inputs.to_numpy() inputss = inputs.to_numpy()
MSE = mean_squared_error(expected, predicted) MSE = mean_squared_error(expected, predicted)
MAE = mean_absolute_error(expected, predicted) MAE = mean_absolute_error(expected, predicted)
@ -153,10 +153,10 @@ 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(inputs) print(inputss)
input_example = inputs[0] input_example = inputss[0]
signature = infer_signature(inputs, expected) signature = infer_signature(inputss, expected)
tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme
if tracking_url_type_store != "file": if tracking_url_type_store != "file":