In my machine learning pipeline, I have all the arguments collected into a dictionary.
args = {'save_model': True,
'learning_rate': 0.01,
'batch_size': 4,
'model': 'my_model',
'momentum': 0.9,
'random_brighness': 0.5,
'random_flipping': 0.5,
...}
Then I have a bunch of functions that take the entire args dictionary as an input. Each of these only uses a small subset of all the arguments. Is there anything wrong with this design?
model = get_model(args)
data = get_data(args)
transformed_data = transform_data(data, args)
from the perspective of the function, it looks like:
def get_trainer(args):
loss_function = args['loss_function']
optimizer = args['optimizer']
class_weights = args['class_weights']
...
versus:
def get_trainer(loss_function, optimizer, class_weights)
...