diff --git a/Jenkinsfile3 b/Jenkinsfile3 index 8c72cba..350b2ad 100644 --- a/Jenkinsfile3 +++ b/Jenkinsfile3 @@ -2,15 +2,19 @@ pipeline { agent { dockerfile true } - - - + parameters{ + string( + defaultValue: '1500', + description: 'Epoch number', + name: 'EPOCH_NUMBER' + ) + } stages { stage('Copy') { steps { copyArtifacts projectName: 's444354-create-dataset' - sh 'python3 ./pytorch/pytorch.py' + sh 'python3 ./pytorch/pytorch.py $EPOCH_NUMBER' } } stage('Archive') { diff --git a/pytorch/pytorch.py b/pytorch/pytorch.py index 3c2e037..bde8aab 100644 --- a/pytorch/pytorch.py +++ b/pytorch/pytorch.py @@ -149,7 +149,7 @@ def fit(epochs, lr, model, train_loader, val_loader, opt_func=torch.optim.SGD): # In[12]: -epochs = 1500 +epochs = sys.argv[1] lr = 1e-6 history5 = fit(epochs, lr, model, train_loader, val_loader)