poli.objective_repository.sa_tdc.register.SABlackBox

poli.objective_repository.sa_tdc.register.SABlackBox#

class poli.objective_repository.sa_tdc.register.SABlackBox(string_representation: Literal['SMILES', 'SELFIES'] = 'SMILES', alphabet: list[str] | None = None, max_sequence_length: int = inf, batch_size: int = None, parallelize: bool = False, num_workers: int = None, evaluation_budget: int = inf, force_isolation: bool = False)#

Synthetic-accessibility black box implementation using the TDC oracles [1].

Parameters
  • string_representation (Literal["SMILES", "SELFIES"], optional) – A string (either “SMILES” or “SELFIES”) specifying which molecule representation you plan to use.

  • alphabet (list[str] | None, optional) – The alphabet to be used for the SMILES or SELFIES representation. It is common that the alphabet depends on the dataset used, so it is recommended to pass it as an argument. Default is None.

  • max_sequence_length (int, optional) – The maximum length of the sequence. Default is infinity.

  • batch_size (int, optional) – The batch size for simultaneous execution, by default None.

  • parallelize (bool, optional) – Flag indicating whether to parallelize execution, by default False.

  • num_workers (int, optional) – The number of workers for parallel execution, by default None.

  • evaluation_budget (int, optional) – The maximum number of function evaluations. Default is infinity.

__init__(string_representation: Literal['SMILES', 'SELFIES'] = 'SMILES', alphabet: list[str] | None = None, max_sequence_length: int = inf, batch_size: int = None, parallelize: bool = False, num_workers: int = None, evaluation_budget: int = inf, force_isolation: bool = False)#

Initialize the SABlackBox object.

Parameters
  • string_representation (Literal["SMILES", "SELFIES"], optional) – A string (either “SMILES” or “SELFIES”) specifying which molecule representation you plan to use.

  • alphabet (list[str] | None, optional) – The alphabet to be used for the SMILES or SELFIES representation. It is common that the alphabet depends on the dataset used, so it is recommended to pass it as an argument. Default is None.

  • max_sequence_length (int, optional) – The maximum length of the sequence. Default is infinity.

  • batch_size (int, optional) – The batch size for parallel evaluation, by default None.

  • parallelize (bool, optional) – Flag indicating whether to parallelize the evaluation, by default False.

  • num_workers (int, optional) – The number of workers for parallel evaluation, by default None.

  • evaluation_budget (int, optional) – The maximum number of evaluations, by default float(“inf”).

Methods

__init__([string_representation, alphabet, ...])

Initialize the SABlackBox object.

reset_evaluation_budget()

Resets the evaluation budget by setting the number of evaluations made to 0.

set_observer(observer)

Set the observer object for recording observations during evaluation.

terminate()

Terminate the black box optimization problem.