Add SimpleNamespace as possible type for hparams
🚀 Feature
Add SimpleNamespace as an acceptable type for hparams.
Motivation
I would like to use SimpleNamespace because it has a similar interface to argparse.Namespace but does not require the usage of the argparse library nor to "downgrade" to a dict-like interface.
I am using a jupyter notebook to work on my models at the moment, and I find it very convinient. Of course this means that argparse cannot really be used easily,
Infos
Someone tried to insert SimpleNamespace in the hierarchy of argparse.Namespace in the past, but it did not go through for performance related concerns.
Pitch
It would be possible to even go beyond this possibility and to remove dict from the possible types for hparams, and to add SimpleNamespace or maybe even namedtuple.
This would remove the need for indexing the dictionary to access hyper parameters and would instead allow a more object-oriented only access.
This would make the whole library more robust.
Also given that namedtuple, for example, is immutable, like hparams are supposed to be.
Of course this could introduce issues to procedures like auto_lr_find or similar techniques used to find the "maximum" batch_size since these would not be able to edit hparams in this case.
For those concerned for historical or backward compatibility I would like to add that it is possible to convert a dict to SimpleNamespace by simply SimpleNamespace(**<dict>).
I am not really advocating for excluding dict or any other type from the possible types, but at least adding SimpleNamespace would be very convenient.
Example
from types import SimpleNamespace
hparams = SimpleNamespace(learning_rate=0.005, batch_size=512, validation_rate=0.2)

model = MNISTClassifier(hparams)
trainer = Trainer(gpus=1, max_epochs=10, auto_lr_find=True)
trainer.fit(model)
OR
from collections import namedtuple

HParams = namedtuple("hparams", ["learning_rate", "batch_size", "validation_rate"], defaults=[0.005, 512, 0.2])

hp1 = HParams()
hp2 = HParams(learning_rate=0.01)
hp3 = HParams(learning_rate=0.01, batch_size=1024)

hparams = hp1

model = MNISTClassifier(hparams)
trainer = Trainer(gpus=1, max_epochs=10, auto_lr_find=True)
trainer.fit(model)