Zaktualizuj 'train-mlflow.py'

This commit is contained in:
Kornelia Girejko 2022-05-15 15:20:53 +02:00
parent aceb722599
commit 9e91e88678

View File

@ -26,6 +26,7 @@ from urllib.parse import urlparse
import mlflow
import mlflow.sklearn
from urllib.parse import urlparse
from mlflow.models import infer_signature
mlflow.set_experiment("s478815")
@ -90,7 +91,9 @@ def my_main(epochs):
with open ("output.txt",'a+') as f:
if (epochs%100==0):
f.write(f'epoch:{epochs+1},loss = {loss.item():.4f}')
x = X_training.detach().numpy()
y = y_predicted_train.detach().numpy()
with torch.no_grad():
y_predicted = model(X_testing)
y_predicted_cls = y_predicted.round()
@ -100,7 +103,7 @@ def my_main(epochs):
#result.write(f'{y_predicted}')
input_example = X_testing[0].numpy()
siganture = pd.DataFrame([X_training, y_predicted_train])
siganture = infer_signature(x,y)
tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme
if tracking_url_type_store != "file":