.
Some checks failed
s444501-training/pipeline/head There was a failure building this commit

This commit is contained in:
s444501 2022-05-01 14:59:44 +02:00
parent 14416b5faa
commit 27080d10fa
2 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,4 @@
import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
@ -5,6 +6,14 @@ from sklearn.preprocessing import LabelEncoder
import pandas as pd
# Parametry z konsoli
try:
epochs = sys.argv[1]
except:
print('No epoch number passed. Defaulting to 100')
epochs = 100
# Model
class Model(nn.Module):
def __init__(self, input_features=2, hidden_layer1=60, hidden_layer2=90, output_features=3):
@ -64,7 +73,6 @@ optimizer = torch.optim.Adam(model.parameters(), lr=0.01)
# Trening
epochs = 100
losses = []
for i in range(epochs):
y_pred = model.forward(X_train)

View File

@ -9,9 +9,9 @@ pipeline {
name: 'BUILD_SELECTOR'
)
string(
defaultValue: '10',
description: 'some training parameter',
name: 'TRAINING_PARAM'
defaultValue: '100',
description: 'number of epochs',
name: 'EPOCH'
)
}
stages {
@ -23,7 +23,9 @@ pipeline {
}
stage('Train model') {
steps {
sh 'python biblioteki_ml.py ${params.TRAINING_PARAM}'
withEnv(["EPOCH=${params.EPOCH}"]) {
sh 'python biblioteki_ml.py $EPOCH'
}
}
}
stage('Archive model') {