modify the generator object to process np.array argument (and convert from string to list) #355
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
We modified the generator object to process np.array argument: In the config dictionary, we specify the target argument of any child class of the
LookaheadAcquisitionFunction
class as a numpy array. The config processed the numpy array as a string using self.from_dict.We have modified (1) the
_str_to_list
function of the Config class in config.py to accept a broader range of string representations of lists, including those with "\n" escape characters and white spaces. The function will properly convert these strings to list. (2) the_get_acqf_options
function of theAEPsychGenerator
class in base.py. The function uses regex to detect list argument in a string for any acquisition arguments and calls the_str_to_list
function to convert it to a list.Reviewed By: crasanders
Differential Revision: D58163715