Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename fn arg from
parameters
to parameterization
in Service API …
…tutorial (#2130) Summary: Rename the argument in the Service API tutorial `evaluate` function from `parameters` to `parameterization` to avoid confusion with the `parameters` configuration dictionary kwarg. This is also in line with the way the evaluate function is defined in the [corresponding section in the loop API tutorial](https://ax.dev/tutorials/gpei_hartmann_loop.html#1.-Define-evaluation-function). i.e., ```python def evaluate(parameters): x = np.array([parameters.get(f"x{i+1}") for i in range(6)]) # In our case, standard error is 0, since we are computing a synthetic function. return {"hartmann6": (hartmann6(x), 0.0), "l2norm": (np.sqrt((x**2).sum()), 0.0)} ... for i in range(25): parameters, trial_index = ax_client.get_next_trial() # Local evaluation here can be replaced with deployment to external system. ax_client.complete_trial(trial_index=trial_index, raw_data=evaluate(parameters)) ``` becomes ```python def evaluate(parameterization): x = np.array([parameters.get(f"x{i+1}") for i in range(6)]) # In our case, standard error is 0, since we are computing a synthetic function. return {"hartmann6": (hartmann6(x), 0.0), "l2norm": (np.sqrt((x**2).sum()), 0.0)} ... for i in range(25): parameterization, trial_index = ax_client.get_next_trial() # Local evaluation here can be replaced with deployment to external system. ax_client.complete_trial(trial_index=trial_index, raw_data=evaluate(parameterization)) ``` Pull Request resolved: #2130 Reviewed By: Balandat Differential Revision: D52783577 Pulled By: danielcohenlive fbshipit-source-id: 5df6bf9c2b9d245a1dbfbcb3bd916f93664a5dda
- Loading branch information