Add Mongo observer
All checks were successful
s444409-evaluation/pipeline/head This commit looks good
s444409-training/pipeline/head This commit looks good

This commit is contained in:
Marcin Kostrzewski 2022-05-06 22:11:02 +02:00
parent 238b22ea20
commit fd5c67b176
2 changed files with 4 additions and 1 deletions

View File

@ -4,3 +4,4 @@ torch==1.11.0
numpy~=1.22.3 numpy~=1.22.3
matplotlib==3.5.2 matplotlib==3.5.2
sacred==0.8.2 sacred==0.8.2
pymongo==4.1.1

View File

@ -3,7 +3,7 @@ import argparse
import numpy as np import numpy as np
import pandas as pd import pandas as pd
import torch import torch
from sacred.observers import FileStorageObserver from sacred.observers import FileStorageObserver, MongoObserver
from torch import nn from torch import nn
from torch.utils.data import DataLoader, Dataset from torch.utils.data import DataLoader, Dataset
from sacred import Experiment from sacred import Experiment
@ -49,6 +49,8 @@ def main(batch_size, epochs, _run):
def setup_experiment(): def setup_experiment():
ex = Experiment('Predict power output for a given time') ex = Experiment('Predict power output for a given time')
ex.observers.append(FileStorageObserver('sacred_runs')) ex.observers.append(FileStorageObserver('sacred_runs'))
# ex.observers.append(MongoObserver(url='mongodb://mongo_user:mongo_password_IUM_2022@localhost:27017',
# db_name='sacred'))
return ex return ex