add sendMail and parameters

This commit is contained in:
Anna Nowak 2021-04-28 21:21:14 +02:00
parent 1df69c4ccf
commit 9c135c7665
6 changed files with 3356 additions and 3335 deletions

5
.gitignore vendored
View File

@ -61,5 +61,6 @@ data.csv
test.csv test.csv
train.csv train.csv
dev.csv dev.csv
stat.txt *.txt
.venv/ .venv/
model.h5

View File

@ -7,6 +7,16 @@ pipeline {
defaultSelector: lastSuccessful(), defaultSelector: lastSuccessful(),
description: 'Which build to use for copying artifacts', description: 'Which build to use for copying artifacts',
name: 'WHICH_BUILD' name: 'WHICH_BUILD'
),
string(
defaultValue: '16'
description: 'batch size',
name: 'BATCH_SIZE'
),
string(
defaultValue: '15'
description: 'epochs',
name: 'EPOCHS'
) )
} }
stages { stages {
@ -15,7 +25,13 @@ pipeline {
steps steps
{ {
copyArtifacts(fingerprintArtifacts: true, projectName: 's434760-create-dataset', selector: buildParameter('WHICH_BUILD')) copyArtifacts(fingerprintArtifacts: true, projectName: 's434760-create-dataset', selector: buildParameter('WHICH_BUILD'))
sh 'python3.8 train.py' }
}
stage('train')
{
steps
{
sh 'python3.8 train.py ${params.BATCH_SIZE} ${params.EPOCHS}'
} }
} }
stage('archive artifacts') { stage('archive artifacts') {
@ -23,5 +39,10 @@ pipeline {
archiveArtifacts 'model.h5' archiveArtifacts 'model.h5'
} }
} }
stage('send email') {
emailext body: 'build status: ${currentBuild.result}',
subject: 's434760 - train',
to: 'annnow19@st.amu.edu.pl'
}
} }
} }

View File

@ -1,2 +0,0 @@
Train: 25.844615936279297
Test: 25.38555335998535

BIN
model.h5

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,7 @@ import pandas as pd
from os import path from os import path
from tensorflow import keras from tensorflow import keras
from tensorflow.keras import layers from tensorflow.keras import layers
import sys
model_name = "model.h5" model_name = "model.h5"
train_data=pd.read_csv('train.csv') train_data=pd.read_csv('train.csv')
@ -30,8 +31,8 @@ else:
history = model.fit( history = model.fit(
X, X,
Y, Y,
batch_size=16, batch_size=int(sys.argv[1]),
epochs=15, epochs=int(sys.argv[2]),
) )
model.save(model_name) model.save(model_name)