Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify the generator object to process np.array argument (and convert from string to list) #355

Closed
wants to merge 1 commit into from

Conversation

wenx-guo
Copy link
Contributor

@wenx-guo wenx-guo commented Jun 5, 2024

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 the AEPsychGenerator 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

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 5, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D58163715

wenx-guo added a commit to wenx-guo/aepsych that referenced this pull request Jun 6, 2024
… from string to list) (facebookresearch#355)

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 the `AEPsychGenerator` 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
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D58163715

… from string to list) (facebookresearch#355)

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 the `AEPsychGenerator` 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
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D58163715

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 6a5ddb8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants