cpnota/autonomous-learning-library

Improve hyperparameter parsing

Opened this issue · 0 comments

Right now, we have a repeated piece of code:

    hyperparameters = {}
    for hp in args.hyperparameters:
        key, value = hp.split('=')
        hyperparameters[key] = type(agent.default_hyperparameters[key])(value)
    agent = agent.hyperparameters(**hyperparameters)

First of all, this would be better as a dict comprehension. Second of all, I think agent.hyperparameters could handle the type conversion in a more general way, instead of making the script do it.