IUM_06 - add epochs, learning_rate and weight_decay parameters models/Jenkinsfile, update create_model.py script
This commit is contained in:
parent
bf552fd706
commit
300d8a82d5
@ -5,6 +5,7 @@ import torch.nn as nn
|
|||||||
import torch.optim as optim
|
import torch.optim as optim
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
from sklearn.metrics import classification_report
|
from sklearn.metrics import classification_report
|
||||||
|
|
||||||
@ -34,10 +35,18 @@ y_test = torch.FloatTensor(y_test).view(-1, 1)
|
|||||||
# Parameters
|
# Parameters
|
||||||
input_size = X_train.shape[1]
|
input_size = X_train.shape[1]
|
||||||
hidden_size = 128
|
hidden_size = 128
|
||||||
|
|
||||||
|
# Default parameters
|
||||||
learning_rate = 0.001
|
learning_rate = 0.001
|
||||||
weight_decay = 0.001
|
weight_decay = 0.001
|
||||||
num_epochs = 1000
|
num_epochs = 1000
|
||||||
|
|
||||||
|
# Parameters from sys.argv
|
||||||
|
if len(sys.argv) > 1:
|
||||||
|
num_epochs = int(sys.argv[1])
|
||||||
|
learning_rate = float(sys.argv[2])
|
||||||
|
weight_decay = float(sys.argv[3])
|
||||||
|
|
||||||
# Model initialization
|
# Model initialization
|
||||||
model = NeuralNetwork(input_size, hidden_size)
|
model = NeuralNetwork(input_size, hidden_size)
|
||||||
|
|
||||||
|
4
models/Jenkinsfile
vendored
4
models/Jenkinsfile
vendored
@ -1,6 +1,10 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
|
parameters {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Clone repository') {
|
stage('Clone repository') {
|
||||||
steps {
|
steps {
|
||||||
|
Loading…
Reference in New Issue
Block a user