Save atrifacts

This commit is contained in:
Agata 2022-04-29 22:51:30 +02:00
parent 1b13b9842d
commit a5e854c1eb
2 changed files with 17 additions and 1 deletions

View File

@ -21,7 +21,7 @@ pipeline {
copyArtifacts filter: '*', projectName:'s444421-training/training_and_evaluation', selector: buildParameter('BUILD_SELECTOR') copyArtifacts filter: '*', projectName:'s444421-training/training_and_evaluation', selector: buildParameter('BUILD_SELECTOR')
copyArtifacts filter: '*', projectName:'s444421-evaluation/training_and_evaluation', optional: true copyArtifacts filter: '*', projectName:'s444421-evaluation/training_and_evaluation', optional: true
sh 'ipython ./evaluation.py' sh 'ipython ./evaluation.py'
archiveArtifacts artifacts: 'build_accuracy.txt' archiveArtifacts artifacts: 'build_accuracy.txt, bilds_accuracy.jpg'
} }
} }
} }

View File

@ -10,6 +10,7 @@ from sklearn.metrics import accuracy_score
import torch import torch
from torch import nn, optim from torch import nn, optim
import torch.nn.functional as F import torch.nn.functional as F
import matplotlib.pyplot as plt
# In[ ]: # In[ ]:
@ -71,3 +72,18 @@ with open('build_accuracy.txt', 'a') as file:
file.write(str(accuracy)) file.write(str(accuracy))
file.write('\n') file.write('\n')
# In[ ]:
with open('build_accuracy.txt') as file:
acc = [float(line.rstrip()) for line in file]
builds = list(range(1, len(acc) + 1))
plt.xlabel('build')
plt.ylabel('accuracy')
plt.plot(builds, acc, 'ro')
plt.show()
plt.savefig('bilds_accuracy.jpg')