Skip to content

Commit

Permalink
Remove usage of MinimumTrialsInStatus in AEPsych (#326)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #326

X-link: facebook/Ax#2134

We have replaced the more limited MinimumTrialsInStatus with the more flexible TransitionCriterion `MinTrials`. This diff is the first in a set of diffs intended to update the legacy usage of CompletionCriterion in AEPsych.

In following diffs we will:
- Completely remove the completion criterion file
- update all four completion criterion defined in aepsych code here: https://www.internalfb.com/code/fbsource/[409e3dfb01ec5c613d34e58c491d63e8051d10d9]/fbcode/frl/ae/aepsych/tests/generators/test_completion_criteria.py?lines=12-15
- revisit storage
- remove all todos in gennode, genstrat, and transitioncriterion classes related to maintaining this deprecated code
- update AEPsych GSs as needed
- determine if run indefinetly can be replaced by simply having gen_unlimited_trials = true

Additional info: https://docs.google.com/document/d/1JWaD20ux8dRVWom3VhTBkh4_1v170XNJ3Xf7EdWsMc8/edit?usp=sharing

Reviewed By: crasanders

Differential Revision: D52848140

fbshipit-source-id: cfbc96052f3898e4b3466d76f9cb11b18452fd9a
  • Loading branch information
mgarrard authored and facebook-github-bot committed Jan 18, 2024
1 parent 55534fd commit d6a1e20
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions aepsych/generators/completion_criterion/min_total_tells.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@

from aepsych.config import Config, ConfigurableMixin
from ax.core.base_trial import TrialStatus
from ax.modelbridge.completion_criterion import MinimumTrialsInStatus
from ax.modelbridge.transition_criterion import MinTrials


class MinTotalTells(MinimumTrialsInStatus, ConfigurableMixin):
class MinTotalTells(MinTrials, ConfigurableMixin):
@classmethod
def get_config_options(cls, config: Config, name: str) -> Dict[str, Any]:
min_total_tells = config.getint(name, "min_total_tells", fallback=1)
options = {"status": TrialStatus.COMPLETED, "threshold": min_total_tells}
options = {
"only_in_statuses": [TrialStatus.COMPLETED],
"threshold": min_total_tells,
}
return options

0 comments on commit d6a1e20

Please sign in to comment.