IBM / mi-prometheus

Enabling reproducible Machine Learning research
http://mi-prometheus.rtfd.io/
Apache License 2.0
42 stars 18 forks source link

ParamRegistry/Interface: added facilities to remove entries #100

Closed aasseman closed 5 years ago

aasseman commented 5 years ago

fixes #99 I have not tested though. I am counting on you guys :)

aasseman commented 5 years ago

I did not implement __delitem__ though. But since it is a very optional thing, I'll leave it for anyone who wants to do it.

vmarois commented 5 years ago

Hey @aasseman Thanks for that!

I have tried to run it but it seems that it is not working with the minimal reproducible example below. Or I am missing something?

import os
import yaml
from miprometheus.utils import ParamInterface

params = ParamInterface()

yaml_config = os.path.expanduser('~/mi-prometheus/configs/vision/simplecnn_mnist.yaml')

params.add_config_params_from_yaml(yaml_path=yaml_config)

conf_str = yaml.safe_dump(params['testing'].to_dict(), default_flow_style=False)
conf_str += '=' * 80 + '\n'
print(conf_str)

params['testing']['problem'].del_config_params('resize')

conf_str = yaml.safe_dump(params['testing'].to_dict(), default_flow_style=False)
conf_str += '=' * 80 + '\n'
print(conf_str)  # the 'resize' key is still present
vmarois commented 5 years ago

Have updated the doc in other branch, will merge it just after merging that one :+1: