Add Sacred FileStorageObserver
Some checks failed
s444409-training/pipeline/head There was a failure building this commit
Some checks failed
s444409-training/pipeline/head There was a failure building this commit
This commit is contained in:
parent
f716e52cbf
commit
d794e390aa
1
.gitignore
vendored
1
.gitignore
vendored
@ -19,3 +19,4 @@ __pycache__
|
||||
evaluation_results.txt
|
||||
model_out
|
||||
trend.png
|
||||
sacred_runs
|
||||
|
@ -35,6 +35,7 @@ pipeline {
|
||||
stage('Archive model and evaluate it') {
|
||||
steps {
|
||||
archiveArtifacts artifacts: 'model_out', onlyIfSuccessful: true
|
||||
archiveArtifacts artifacts: 'sacred_runs', onlyIfSuccessful: true
|
||||
build job: "s444409-evaluation/${params.BRANCH}/"
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ import argparse
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import torch
|
||||
from sacred.observers import FileStorageObserver
|
||||
from torch import nn
|
||||
from torch.utils.data import DataLoader, Dataset
|
||||
from sacred import Experiment
|
||||
@ -120,7 +121,13 @@ def main(batch_size, epochs):
|
||||
print("Model saved in ./model_out file.")
|
||||
|
||||
|
||||
ex = Experiment('Predict power output for a given time')
|
||||
def setup_experiment():
|
||||
ex = Experiment('Predict power output for a given time')
|
||||
ex.observers.append(FileStorageObserver('sacred_runs'))
|
||||
return ex
|
||||
|
||||
|
||||
ex = setup_experiment()
|
||||
|
||||
|
||||
@ex.config
|
||||
@ -132,3 +139,6 @@ def experiment_config():
|
||||
@ex.automain
|
||||
def run(batch_size, epochs):
|
||||
main(batch_size, epochs)
|
||||
|
||||
|
||||
ex.add_artifact('model_out')
|
||||
|
Loading…
Reference in New Issue
Block a user