Saving hyperparameters within function