Zaktualizuj 'train-mlflow.py'

This commit is contained in:
Kornelia Girejko 2022-05-15 14:31:36 +02:00
parent 065f162b33
commit fbdc99fd9d

View File

@ -82,8 +82,8 @@ def my_main(epochs):
mlflow.log_param("epochs", epochs)
for epochs in range(epochs):
y_predicted = model(X_training)
loss = criterion(y_predicted,y_training)
y_predicted_train = model(X_training)
loss = criterion(y_predicted_train,y_training)
loss.backward()
optimizer.step()
optimizer.zero_grad()
@ -100,7 +100,7 @@ def my_main(epochs):
#result.write(f'{y_predicted}')
input_example = X_testing[0]
siganture = mlflow.models.signature.infer_signature(X_training.numpy(), model(X_training.numpy()))
siganture = (X_training, y_predicted_train))
tracking_url_type_store = urlparse(mlflow.get_tracking_uri()).scheme
mlflow.pytorch.log_model(model, "model", registered_model_name="s478815", signature=siganture, input_example=input_example)