Did you like the parameter configuration file example that you just saw? I hope you did. In this section, we will implement a parameter manger that will help us load, get, and set these parameters as necessary.
We will start by creating a Python class named ParamsMangerthat initializes the paramsmember variable with the dictionary of parameters read from the params_fileusing the JSON Python library, as follows:
#!/usr/bin/env pythonimport JSONclass ParamsManager(object): def __init__(self, params_file): """ A class to manage the Parameters. Parameters include configuration parameters and Hyper-parameters :param params_file: Path to the parameters JSON file """ self.params = JSON.load(open(params_file, 'r'))
We will ...