Skip to content

Commit

Permalink
Utility for generating linear embedding that contains status quo
Browse files Browse the repository at this point in the history
Summary: A utility for generating an embedding that contains the status quo, so that SQ will be in-design in the embedding. Also adds IntToFloat to the ALEBO transorms since I need that for the current IGTV experiment.

Reviewed By: qingfeng10

Differential Revision: D23275586

fbshipit-source-id: 1180d6c01483037ed5f65cdbcd5cda49dca6f372
  • Loading branch information
bletham authored and facebook-github-bot committed Aug 24, 2020
1 parent fc4cd2a commit 1ecee1b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ax/modelbridge/strategies/alebo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,23 @@
from ax.modelbridge.random import RandomModelBridge
from ax.modelbridge.torch import TorchModelBridge
from ax.modelbridge.transforms.centered_unit_x import CenteredUnitX
from ax.modelbridge.transforms.int_to_float import IntToFloat
from ax.modelbridge.transforms.remove_fixed import RemoveFixed
from ax.modelbridge.transforms.standardize_y import StandardizeY
from ax.models.random.alebo_initializer import ALEBOInitializer
from ax.models.torch.alebo import ALEBO


ALEBO_X_trans = [RemoveFixed, IntToFloat, CenteredUnitX]


def get_ALEBOInitializer(
search_space: SearchSpace, B: np.ndarray, **model_kwargs: Any
) -> RandomModelBridge:
return RandomModelBridge(
search_space=search_space,
model=ALEBOInitializer(B=B, **model_kwargs),
transforms=[CenteredUnitX],
transforms=ALEBO_X_trans, # pyre-ignore
)


Expand All @@ -45,7 +50,7 @@ def get_ALEBO(
search_space=search_space,
data=data,
model=ALEBO(B=B, **model_kwargs),
transforms=[CenteredUnitX, StandardizeY],
transforms=ALEBO_X_trans + [StandardizeY], # pyre-ignore
torch_dtype=B.dtype,
torch_device=B.device,
)
Expand Down

0 comments on commit 1ecee1b

Please sign in to comment.