Add MongoObserver (sacred)
This commit is contained in:
parent
d0a5a7c513
commit
78dd1d38fd
@ -8,6 +8,7 @@ RUN pip3 install torch
|
||||
RUN pip3 install numpy
|
||||
RUN pip3 install sacred
|
||||
RUN pip3 install GitPython
|
||||
RUN pip3 install pymongo
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
@ -12,14 +12,15 @@ from torch import nn, optim
|
||||
import torch.nn.functional as F
|
||||
import sys
|
||||
from sacred import Experiment
|
||||
from sacred.observers import FileStorageObserver
|
||||
from sacred.observers import FileStorageObserver, MongoObserver
|
||||
|
||||
|
||||
# In[ ]:
|
||||
|
||||
|
||||
ex = Experiment("file_observer", save_git_info=False)
|
||||
ex.observers.append(FileStorageObserver('my_runs'))
|
||||
ex = Experiment(save_git_info=False)
|
||||
# ex.observers.append(FileStorageObserver('my_runs'))
|
||||
ex.observers.append(MongoObserver(url='mongodb://mongo_user:mongo_password@localhost:27017', db_name='sacred'))
|
||||
|
||||
@ex.config
|
||||
def my_config():
|
||||
@ -111,3 +112,10 @@ def my_main(epochs, _run):
|
||||
_run.info["epochs"] = epochs
|
||||
_run.info["loss"] = loss
|
||||
|
||||
|
||||
|
||||
# In[ ]:
|
||||
|
||||
|
||||
ex.run()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user