Add parameter in JenkinsfileTraining
This commit is contained in:
parent
f42484bf5b
commit
eda9b6f8ec
@ -9,6 +9,11 @@ pipeline {
|
|||||||
description: 'Which build to use for copying artifacts',
|
description: 'Which build to use for copying artifacts',
|
||||||
name: 'BUILD_SELECTOR'
|
name: 'BUILD_SELECTOR'
|
||||||
)
|
)
|
||||||
|
string(
|
||||||
|
defaultValue: '5',
|
||||||
|
description: 'Epochs',
|
||||||
|
name: 'EPOCHS'
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
triggers {
|
triggers {
|
||||||
@ -32,7 +37,7 @@ pipeline {
|
|||||||
stage('Script') {
|
stage('Script') {
|
||||||
steps {
|
steps {
|
||||||
sh 'chmod 777 ./create_model.py'
|
sh 'chmod 777 ./create_model.py'
|
||||||
sh "python3 ./create_model.py"
|
sh "python3 ./create_model.py ${params.EPOCHS}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('CreateArtifacts') {
|
stage('CreateArtifacts') {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
import sys
|
||||||
from keras.models import Sequential
|
from keras.models import Sequential
|
||||||
from keras.layers import Dense
|
from keras.layers import Dense
|
||||||
from keras.optimizers import Adam
|
from keras.optimizers import Adam
|
||||||
@ -6,6 +7,8 @@ from keras import regularizers
|
|||||||
|
|
||||||
from helper import prepare_tensors
|
from helper import prepare_tensors
|
||||||
|
|
||||||
|
epochs = int(sys.argv[1])
|
||||||
|
|
||||||
hp_train = pd.read_csv('hp_train.csv')
|
hp_train = pd.read_csv('hp_train.csv')
|
||||||
hp_dev = pd.read_csv('hp_dev.csv')
|
hp_dev = pd.read_csv('hp_dev.csv')
|
||||||
|
|
||||||
@ -22,6 +25,6 @@ model.add(Dense(1, activation='linear'))
|
|||||||
adam = Adam(learning_rate=0.001, beta_1=0.9, beta_2=0.999, epsilon=1e-7)
|
adam = Adam(learning_rate=0.001, beta_1=0.9, beta_2=0.999, epsilon=1e-7)
|
||||||
model.compile(optimizer=adam, loss='mean_squared_error')
|
model.compile(optimizer=adam, loss='mean_squared_error')
|
||||||
|
|
||||||
model.fit(X_train, Y_train, epochs=20, batch_size=32, validation_data=(X_dev, Y_dev))
|
model.fit(X_train, Y_train, epochs=epochs, batch_size=32, validation_data=(X_dev, Y_dev))
|
||||||
|
|
||||||
model.save('hp_model.h5')
|
model.save('hp_model.h5')
|
||||||
|
Loading…
Reference in New Issue
Block a user