gt4sd.algorithms.controlled_sampling.paccmann_gp.core module¶
PaccMannGP Algorithm.
PaccMannGP generation is conditioned via gaussian processes.
Summary¶
Classes:
PaccMannGP Algorithm. |
|
Configuration to generate compounds controlling molecules properties. |
Reference¶
- class PaccMannGP(configuration, target)[source]¶
Bases:
GeneratorAlgorithm
[S
,T
]PaccMannGP Algorithm.
- __init__(configuration, target)[source]¶
Instantiate PaccMannGP ready to generate items.
- Parameters
configuration (
AlgorithmConfiguration
[~S, ~T]) – domain and application specification defining parameters, types and validations.target (
Optional
[~T,None
]) – a target for which to generate items.
Example
An example for generating small molecules (SMILES) with high affinity for a target protein:
configuration = PaccMannGPGenerator() target = { "qed": {"weight": 1.0}, "molwt": {"target": 200}, "sa": {"weight": 2.0}, "affinity": {"protein": "MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTT"} } paccmann_gp = PaccMannGP(configuration=configuration, target=target) items = list(paccmann_gp.sample(10)) print(items)
- get_generator(configuration, target)[source]¶
Get the function to sample batches via PaccMannGP’s GPConditionalGenerator.
- Parameters
configuration (
AlgorithmConfiguration
[~S, ~T]) – helps to set up specific application of PaccMannGP.target (
Optional
[~T,None
]) – context or condition for the generation.
- Return type
Callable
[[~T],Iterable
[Any
]]- Returns
callable with target generating a batch of items.
- validate_configuration(configuration)[source]¶
Overload to validate the a configuration for the algorithm.
- Parameters
configuration (
AlgorithmConfiguration
[~S, ~T]) – the algorithm configuration.- Raises
InvalidAlgorithmConfiguration – in case the configuration for the algorithm is invalid.
- Return type
AlgorithmConfiguration
[~S, ~T]- Returns
the validated configuration.
- __abstractmethods__ = frozenset({})¶
- __annotations__ = {'generate': 'Untargeted', 'generator': 'Union[Untargeted, Targeted[T]]', 'max_runtime': 'int', 'max_samples': 'int', 'target': 'Optional[T]'}¶
- __doc__ = 'PaccMann\\ :superscript:`GP` Algorithm.'¶
- __module__ = 'gt4sd.algorithms.controlled_sampling.paccmann_gp.core'¶
- __orig_bases__ = (gt4sd.algorithms.core.GeneratorAlgorithm[~S, ~T],)¶
- __parameters__ = (~S, ~T)¶
- _abc_impl = <_abc._abc_data object>¶
- class PaccMannGPGenerator(*args, **kwargs)[source]¶
Bases:
PaccMannGPGenerator
,Generic
[T
]Configuration to generate compounds controlling molecules properties.
Implementation from the paper: https://doi.org/10.1021/acs.jcim.1c00889.
- algorithm_type: ClassVar[str] = 'controlled_sampling'¶
General type of generative algorithm.
- domain: ClassVar[str] = 'materials'¶
General application domain. Hints at input/output types.
- algorithm_version: str = 'v0'¶
To differentiate between different versions of an application.
There is no imposed naming convention.
- batch_size: int = 32¶
- temperature: float = 1.4¶
- generated_length: int = 100¶
- limit: float = 5.0¶
- acquisition_function: str = 'EI'¶
- number_of_steps: int = 32¶
- number_of_initial_points: int = 16¶
- initial_point_generator: str = 'random'¶
- seed: int = 42¶
- number_of_optimization_rounds: int = 1¶
- sampling_variance: float = 0.1¶
- samples_for_evaluation: int = 4¶
- maximum_number_of_sampling_steps: int = 32¶
- get_target_description()[source]¶
Get description of the target for generation.
- Return type
Dict
[str
,str
]- Returns
target description.
- get_conditional_generator(resources_path)[source]¶
Instantiate the actual generator implementation.
- Parameters
resources_path (
str
) – local path to model files.- Return type
- Returns
instance with
generate_batch
method for targeted generation.
- validate_item(item)[source]¶
Check that item is a valid SMILES.
- Parameters
item (
str
) – a generated item that is possibly not valid.- Raises
InvalidItem – in case the item can not be validated.
- Return type
str
- Returns
the validated SMILES.
- classmethod get_filepath_mappings_for_training_pipeline_arguments()[source]¶
Get filepath mappings for the given training pipeline arguments.
- Parameters
training_pipeline_arguments (
TrainingPipelineArguments
) – training pipeline arguments.- Return type
Dict
[str
,str
]- Returns
a mapping between artifacts’ files and training pipeline’s output files.
- __annotations__ = {'acquisition_function': <class 'str'>, 'algorithm_application': 'ClassVar[str]', 'algorithm_name': 'ClassVar[str]', 'algorithm_type': typing.ClassVar[str], 'algorithm_version': <class 'str'>, 'batch_size': <class 'int'>, 'domain': typing.ClassVar[str], 'generated_length': <class 'int'>, 'initial_point_generator': <class 'str'>, 'limit': <class 'float'>, 'maximum_number_of_sampling_steps': <class 'int'>, 'number_of_initial_points': <class 'int'>, 'number_of_optimization_rounds': <class 'int'>, 'number_of_steps': <class 'int'>, 'samples_for_evaluation': <class 'int'>, 'sampling_variance': <class 'float'>, 'seed': <class 'int'>, 'temperature': <class 'float'>}¶
- __dataclass_fields__ = {'acquisition_function': Field(name='acquisition_function',type=<class 'str'>,default='EI',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'description': 'Acquisition function used in the Gaussian process. More details in https://scikit-optimize.github.io/stable/modules/generated/skopt.gp_minimize.html.'}),kw_only=False,_field_type=_FIELD), 'algorithm_application': Field(name='algorithm_application',type=typing.ClassVar[str],default='PaccMannGPGenerator',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=<dataclasses._MISSING_TYPE object>,_field_type=_FIELD_CLASSVAR), 'algorithm_name': Field(name='algorithm_name',type=typing.ClassVar[str],default='PaccMannGP',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=<dataclasses._MISSING_TYPE object>,_field_type=_FIELD_CLASSVAR), 'algorithm_type': Field(name='algorithm_type',type=typing.ClassVar[str],default='controlled_sampling',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=<dataclasses._MISSING_TYPE object>,_field_type=_FIELD_CLASSVAR), 'algorithm_version': Field(name='algorithm_version',type=<class 'str'>,default='v0',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=False,_field_type=_FIELD), 'batch_size': Field(name='batch_size',type=<class 'int'>,default=32,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'description': 'Batch size used for the generative model sampling.'}),kw_only=False,_field_type=_FIELD), 'domain': Field(name='domain',type=typing.ClassVar[str],default='materials',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=<dataclasses._MISSING_TYPE object>,_field_type=_FIELD_CLASSVAR), 'generated_length': Field(name='generated_length',type=<class 'int'>,default=100,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'description': 'Maximum length in tokens of the generated molcules (relates to the SMILES length).'}),kw_only=False,_field_type=_FIELD), 'initial_point_generator': Field(name='initial_point_generator',type=<class 'str'>,default='random',default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'description': 'Scheme to generate initial points. More details in https://scikit-optimize.github.io/stable/modules/generated/skopt.gp_minimize.html.'}),kw_only=False,_field_type=_FIELD), 'limit': Field(name='limit',type=<class 'float'>,default=5.0,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'description': 'Hypercube limits in the latent space.'}),kw_only=False,_field_type=_FIELD), 'maximum_number_of_sampling_steps': Field(name='maximum_number_of_sampling_steps',type=<class 'int'>,default=32,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'description': 'Maximum number of sampling steps in an optimization round.'}),kw_only=False,_field_type=_FIELD), 'number_of_initial_points': Field(name='number_of_initial_points',type=<class 'int'>,default=16,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'description': 'Number of initial points evaluated.'}),kw_only=False,_field_type=_FIELD), 'number_of_optimization_rounds': Field(name='number_of_optimization_rounds',type=<class 'int'>,default=1,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'description': 'Maximum number of optimization rounds.'}),kw_only=False,_field_type=_FIELD), 'number_of_steps': Field(name='number_of_steps',type=<class 'int'>,default=32,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'description': 'Number of steps for an optmization round.'}),kw_only=False,_field_type=_FIELD), 'samples_for_evaluation': Field(name='samples_for_evaluation',type=<class 'int'>,default=4,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'description': 'Number of samples averaged for each minimization function evaluation.'}),kw_only=False,_field_type=_FIELD), 'sampling_variance': Field(name='sampling_variance',type=<class 'float'>,default=0.1,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'description': 'Variance of the Gaussian noise applied during sampling from the optimal point.'}),kw_only=False,_field_type=_FIELD), 'seed': Field(name='seed',type=<class 'int'>,default=42,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'description': 'Seed used for random number generation in the optimizer. Set to -1 for no seed.'}),kw_only=False,_field_type=_FIELD), 'temperature': Field(name='temperature',type=<class 'float'>,default=1.4,default_factory=<dataclasses._MISSING_TYPE object>,init=True,repr=True,hash=None,compare=True,metadata=mappingproxy({'description': 'Temperature parameter for the softmax sampling in decoding.'}),kw_only=False,_field_type=_FIELD)}¶
- __dataclass_params__ = _DataclassParams(init=True,repr=True,eq=True,order=False,unsafe_hash=False,frozen=False)¶
- __doc__ = '\n Configuration to generate compounds controlling molecules properties.\n\n Implementation from the paper: https://doi.org/10.1021/acs.jcim.1c00889.\n '¶
- __eq__(other)¶
Return self==value.
- __hash__ = None¶
- __init__(*args, **kwargs)¶
- __match_args__ = ('algorithm_version', 'batch_size', 'temperature', 'generated_length', 'limit', 'acquisition_function', 'number_of_steps', 'number_of_initial_points', 'initial_point_generator', 'seed', 'number_of_optimization_rounds', 'sampling_variance', 'samples_for_evaluation', 'maximum_number_of_sampling_steps')¶
- __module__ = 'gt4sd.algorithms.controlled_sampling.paccmann_gp.core'¶
- __orig_bases__ = (<class 'types.PaccMannGPGenerator'>, typing.Generic[~T])¶
- __parameters__ = (~T,)¶
- __pydantic_complete__ = True¶
- __pydantic_config__ = {}¶
- __pydantic_core_schema__ = {'cls': <class 'gt4sd.algorithms.controlled_sampling.paccmann_gp.core.PaccMannGPGenerator'>, 'config': {'title': 'PaccMannGPGenerator'}, 'fields': ['algorithm_version', 'batch_size', 'temperature', 'generated_length', 'limit', 'acquisition_function', 'number_of_steps', 'number_of_initial_points', 'initial_point_generator', 'seed', 'number_of_optimization_rounds', 'sampling_variance', 'samples_for_evaluation', 'maximum_number_of_sampling_steps'], 'frozen': False, 'metadata': {'pydantic_js_annotation_functions': [], 'pydantic_js_functions': [functools.partial(<function modify_model_json_schema>, cls=<class 'gt4sd.algorithms.controlled_sampling.paccmann_gp.core.PaccMannGPGenerator'>, title=None)]}, 'post_init': False, 'ref': 'types.PaccMannGPGenerator:94662814449776', 'schema': {'collect_init_only': False, 'computed_fields': [], 'dataclass_name': 'PaccMannGPGenerator', 'fields': [{'type': 'dataclass-field', 'name': 'algorithm_version', 'schema': {'type': 'default', 'schema': {'type': 'str'}, 'default': 'v0'}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}, {'type': 'dataclass-field', 'name': 'batch_size', 'schema': {'type': 'default', 'schema': {'type': 'int'}, 'default': 32}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}, {'type': 'dataclass-field', 'name': 'temperature', 'schema': {'type': 'default', 'schema': {'type': 'float'}, 'default': 1.4}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}, {'type': 'dataclass-field', 'name': 'generated_length', 'schema': {'type': 'default', 'schema': {'type': 'int'}, 'default': 100}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}, {'type': 'dataclass-field', 'name': 'limit', 'schema': {'type': 'default', 'schema': {'type': 'float'}, 'default': 5.0}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}, {'type': 'dataclass-field', 'name': 'acquisition_function', 'schema': {'type': 'default', 'schema': {'type': 'str'}, 'default': 'EI'}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}, {'type': 'dataclass-field', 'name': 'number_of_steps', 'schema': {'type': 'default', 'schema': {'type': 'int'}, 'default': 32}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}, {'type': 'dataclass-field', 'name': 'number_of_initial_points', 'schema': {'type': 'default', 'schema': {'type': 'int'}, 'default': 16}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}, {'type': 'dataclass-field', 'name': 'initial_point_generator', 'schema': {'type': 'default', 'schema': {'type': 'str'}, 'default': 'random'}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}, {'type': 'dataclass-field', 'name': 'seed', 'schema': {'type': 'default', 'schema': {'type': 'int'}, 'default': 42}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}, {'type': 'dataclass-field', 'name': 'number_of_optimization_rounds', 'schema': {'type': 'default', 'schema': {'type': 'int'}, 'default': 1}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}, {'type': 'dataclass-field', 'name': 'sampling_variance', 'schema': {'type': 'default', 'schema': {'type': 'float'}, 'default': 0.1}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}, {'type': 'dataclass-field', 'name': 'samples_for_evaluation', 'schema': {'type': 'default', 'schema': {'type': 'int'}, 'default': 4}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}, {'type': 'dataclass-field', 'name': 'maximum_number_of_sampling_steps', 'schema': {'type': 'default', 'schema': {'type': 'int'}, 'default': 32}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_functions': [], 'pydantic_js_annotation_functions': [<function get_json_schema_update_func.<locals>.json_schema_update_func>]}}], 'type': 'dataclass-args'}, 'slots': True, 'type': 'dataclass'}¶
- __pydantic_decorators__ = DecoratorInfos(validators={}, field_validators={}, root_validators={}, field_serializers={}, model_serializers={}, model_validators={}, computed_fields={})¶
- __pydantic_fields__ = {'acquisition_function': FieldInfo(annotation=str, required=False, default='EI', description='Acquisition function used in the Gaussian process. More details in https://scikit-optimize.github.io/stable/modules/generated/skopt.gp_minimize.html.', init=True, init_var=False, kw_only=False), 'algorithm_version': FieldInfo(annotation=str, required=False, default='v0', init=True, init_var=False, kw_only=False), 'batch_size': FieldInfo(annotation=int, required=False, default=32, description='Batch size used for the generative model sampling.', init=True, init_var=False, kw_only=False), 'generated_length': FieldInfo(annotation=int, required=False, default=100, description='Maximum length in tokens of the generated molcules (relates to the SMILES length).', init=True, init_var=False, kw_only=False), 'initial_point_generator': FieldInfo(annotation=str, required=False, default='random', description='Scheme to generate initial points. More details in https://scikit-optimize.github.io/stable/modules/generated/skopt.gp_minimize.html.', init=True, init_var=False, kw_only=False), 'limit': FieldInfo(annotation=float, required=False, default=5.0, description='Hypercube limits in the latent space.', init=True, init_var=False, kw_only=False), 'maximum_number_of_sampling_steps': FieldInfo(annotation=int, required=False, default=32, description='Maximum number of sampling steps in an optimization round.', init=True, init_var=False, kw_only=False), 'number_of_initial_points': FieldInfo(annotation=int, required=False, default=16, description='Number of initial points evaluated.', init=True, init_var=False, kw_only=False), 'number_of_optimization_rounds': FieldInfo(annotation=int, required=False, default=1, description='Maximum number of optimization rounds.', init=True, init_var=False, kw_only=False), 'number_of_steps': FieldInfo(annotation=int, required=False, default=32, description='Number of steps for an optmization round.', init=True, init_var=False, kw_only=False), 'samples_for_evaluation': FieldInfo(annotation=int, required=False, default=4, description='Number of samples averaged for each minimization function evaluation.', init=True, init_var=False, kw_only=False), 'sampling_variance': FieldInfo(annotation=float, required=False, default=0.1, description='Variance of the Gaussian noise applied during sampling from the optimal point.', init=True, init_var=False, kw_only=False), 'seed': FieldInfo(annotation=int, required=False, default=42, description='Seed used for random number generation in the optimizer. Set to -1 for no seed.', init=True, init_var=False, kw_only=False), 'temperature': FieldInfo(annotation=float, required=False, default=1.4, description='Temperature parameter for the softmax sampling in decoding.', init=True, init_var=False, kw_only=False)}¶
- __pydantic_serializer__ = SchemaSerializer(serializer=Dataclass( DataclassSerializer { class: Py( 0x00005618676dc070, ), serializer: Fields( GeneralFieldsSerializer { fields: { "seed": SerField { key_py: Py( 0x00007f1dc51c2d70, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1ea9468610, ), ), serializer: Int( IntSerializer, ), }, ), ), required: true, }, "algorithm_version": SerField { key_py: Py( 0x00007f1dc54e27e0, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1ea52cf3f0, ), ), serializer: Str( StrSerializer, ), }, ), ), required: true, }, "batch_size": SerField { key_py: Py( 0x00007f1dc51c2c70, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1ea94684d0, ), ), serializer: Int( IntSerializer, ), }, ), ), required: true, }, "temperature": SerField { key_py: Py( 0x00007f1dc51c2cb0, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1dcadd6790, ), ), serializer: Float( FloatSerializer { inf_nan_mode: Null, }, ), }, ), ), required: true, }, "generated_length": SerField { key_py: Py( 0x00007f1dc54e3050, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1ea9468d50, ), ), serializer: Int( IntSerializer, ), }, ), ), required: true, }, "limit": SerField { key_py: Py( 0x00007f1dc51c2cf0, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1dcadd6710, ), ), serializer: Float( FloatSerializer { inf_nan_mode: Null, }, ), }, ), ), required: true, }, "samples_for_evaluation": SerField { key_py: Py( 0x00007f1dc54e19d0, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1ea9468150, ), ), serializer: Int( IntSerializer, ), }, ), ), required: true, }, "number_of_initial_points": SerField { key_py: Py( 0x00007f1dc54e1520, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1ea94682d0, ), ), serializer: Int( IntSerializer, ), }, ), ), required: true, }, "acquisition_function": SerField { key_py: Py( 0x00007f1dc54e3000, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1dca93ac70, ), ), serializer: Str( StrSerializer, ), }, ), ), required: true, }, "number_of_steps": SerField { key_py: Py( 0x00007f1dc51c2d30, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1ea94684d0, ), ), serializer: Int( IntSerializer, ), }, ), ), required: true, }, "initial_point_generator": SerField { key_py: Py( 0x00007f1dc54e1930, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1ea8601530, ), ), serializer: Str( StrSerializer, ), }, ), ), required: true, }, "number_of_optimization_rounds": SerField { key_py: Py( 0x00007f1dc54e18e0, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1ea94680f0, ), ), serializer: Int( IntSerializer, ), }, ), ), required: true, }, "sampling_variance": SerField { key_py: Py( 0x00007f1dc54e1840, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1dcadd6290, ), ), serializer: Float( FloatSerializer { inf_nan_mode: Null, }, ), }, ), ), required: true, }, "maximum_number_of_sampling_steps": SerField { key_py: Py( 0x00007f1dc519c570, ), alias: None, alias_py: None, serializer: Some( WithDefault( WithDefaultSerializer { default: Default( Py( 0x00007f1ea94684d0, ), ), serializer: Int( IntSerializer, ), }, ), ), required: true, }, }, computed_fields: Some( ComputedFields( [], ), ), mode: SimpleDict, extra_serializer: None, filter: SchemaFilter { include: None, exclude: None, }, required_fields: 14, }, ), fields: [ Py( 0x00007f1ea52ed250, ), Py( 0x00007f1ea52ccc70, ), Py( 0x00007f1e33d8d4b0, ), Py( 0x00007f1dca9b95c0, ), Py( 0x00007f1ea8d7ecf0, ), Py( 0x00007f1dc54e3870, ), Py( 0x00007f1dca921870, ), Py( 0x00007f1dc54e38c0, ), Py( 0x00007f1dc54c4350, ), Py( 0x00007f1ea8602870, ), Py( 0x00007f1dc54e3910, ), Py( 0x00007f1dc54e3960, ), Py( 0x00007f1dc54e39b0, ), Py( 0x00007f1dc54b33f0, ), ], name: "PaccMannGPGenerator", }, ), definitions=[])¶
- __pydantic_validator__ = SchemaValidator(title="PaccMannGPGenerator", validator=Dataclass( DataclassValidator { strict: false, validator: DataclassArgs( DataclassArgsValidator { fields: [ Field { kw_only: false, name: "algorithm_version", py_name: Py( 0x00007f1ea52ed250, ), init: true, init_only: false, lookup_key: Simple { key: "algorithm_version", py_key: Py( 0x00007f1dc54e1d90, ), path: LookupPath( [ S( "algorithm_version", Py( 0x00007f1dc54e1d40, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1ea52cf3f0, ), ), on_error: Raise, validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), validate_default: false, copy_default: false, name: "default[str]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, Field { kw_only: false, name: "batch_size", py_name: Py( 0x00007f1ea52ccc70, ), init: true, init_only: false, lookup_key: Simple { key: "batch_size", py_key: Py( 0x00007f1dc51c2ab0, ), path: LookupPath( [ S( "batch_size", Py( 0x00007f1dc51c2a70, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1ea94684d0, ), ), on_error: Raise, validator: Int( IntValidator { strict: false, }, ), validate_default: false, copy_default: false, name: "default[int]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, Field { kw_only: false, name: "temperature", py_name: Py( 0x00007f1e33d8d4b0, ), init: true, init_only: false, lookup_key: Simple { key: "temperature", py_key: Py( 0x00007f1dc51c2a30, ), path: LookupPath( [ S( "temperature", Py( 0x00007f1dc51c29f0, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1dcadd6790, ), ), on_error: Raise, validator: Float( FloatValidator { strict: false, allow_inf_nan: true, }, ), validate_default: false, copy_default: false, name: "default[float]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, Field { kw_only: false, name: "generated_length", py_name: Py( 0x00007f1dca9b95c0, ), init: true, init_only: false, lookup_key: Simple { key: "generated_length", py_key: Py( 0x00007f1dc54e1de0, ), path: LookupPath( [ S( "generated_length", Py( 0x00007f1dc54e1cf0, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1ea9468d50, ), ), on_error: Raise, validator: Int( IntValidator { strict: false, }, ), validate_default: false, copy_default: false, name: "default[int]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, Field { kw_only: false, name: "limit", py_name: Py( 0x00007f1ea8d7ecf0, ), init: true, init_only: false, lookup_key: Simple { key: "limit", py_key: Py( 0x00007f1dc51c2af0, ), path: LookupPath( [ S( "limit", Py( 0x00007f1dc51c2b30, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1dcadd6710, ), ), on_error: Raise, validator: Float( FloatValidator { strict: false, allow_inf_nan: true, }, ), validate_default: false, copy_default: false, name: "default[float]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, Field { kw_only: false, name: "acquisition_function", py_name: Py( 0x00007f1dc54e3870, ), init: true, init_only: false, lookup_key: Simple { key: "acquisition_function", py_key: Py( 0x00007f1dc54e1ca0, ), path: LookupPath( [ S( "acquisition_function", Py( 0x00007f1dc54e1c50, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1dca93ac70, ), ), on_error: Raise, validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), validate_default: false, copy_default: false, name: "default[str]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, Field { kw_only: false, name: "number_of_steps", py_name: Py( 0x00007f1dca921870, ), init: true, init_only: false, lookup_key: Simple { key: "number_of_steps", py_key: Py( 0x00007f1dc51c2b70, ), path: LookupPath( [ S( "number_of_steps", Py( 0x00007f1dc51c2bb0, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1ea94684d0, ), ), on_error: Raise, validator: Int( IntValidator { strict: false, }, ), validate_default: false, copy_default: false, name: "default[int]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, Field { kw_only: false, name: "number_of_initial_points", py_name: Py( 0x00007f1dc54e38c0, ), init: true, init_only: false, lookup_key: Simple { key: "number_of_initial_points", py_key: Py( 0x00007f1dc54e1b60, ), path: LookupPath( [ S( "number_of_initial_points", Py( 0x00007f1dc54e1b10, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1ea94682d0, ), ), on_error: Raise, validator: Int( IntValidator { strict: false, }, ), validate_default: false, copy_default: false, name: "default[int]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, Field { kw_only: false, name: "initial_point_generator", py_name: Py( 0x00007f1dc54c4350, ), init: true, init_only: false, lookup_key: Simple { key: "initial_point_generator", py_key: Py( 0x00007f1dc54e1ac0, ), path: LookupPath( [ S( "initial_point_generator", Py( 0x00007f1dc54e1a70, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1ea8601530, ), ), on_error: Raise, validator: Str( StrValidator { strict: false, coerce_numbers_to_str: false, }, ), validate_default: false, copy_default: false, name: "default[str]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, Field { kw_only: false, name: "seed", py_name: Py( 0x00007f1ea8602870, ), init: true, init_only: false, lookup_key: Simple { key: "seed", py_key: Py( 0x00007f1dc51c2bf0, ), path: LookupPath( [ S( "seed", Py( 0x00007f1dc51c2c30, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1ea9468610, ), ), on_error: Raise, validator: Int( IntValidator { strict: false, }, ), validate_default: false, copy_default: false, name: "default[int]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, Field { kw_only: false, name: "number_of_optimization_rounds", py_name: Py( 0x00007f1dc54e3910, ), init: true, init_only: false, lookup_key: Simple { key: "number_of_optimization_rounds", py_key: Py( 0x00007f1dc54e1a20, ), path: LookupPath( [ S( "number_of_optimization_rounds", Py( 0x00007f1dc54e2010, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1ea94680f0, ), ), on_error: Raise, validator: Int( IntValidator { strict: false, }, ), validate_default: false, copy_default: false, name: "default[int]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, Field { kw_only: false, name: "sampling_variance", py_name: Py( 0x00007f1dc54e3960, ), init: true, init_only: false, lookup_key: Simple { key: "sampling_variance", py_key: Py( 0x00007f1dc54e1fc0, ), path: LookupPath( [ S( "sampling_variance", Py( 0x00007f1dc54e2150, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1dcadd6290, ), ), on_error: Raise, validator: Float( FloatValidator { strict: false, allow_inf_nan: true, }, ), validate_default: false, copy_default: false, name: "default[float]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, Field { kw_only: false, name: "samples_for_evaluation", py_name: Py( 0x00007f1dc54e39b0, ), init: true, init_only: false, lookup_key: Simple { key: "samples_for_evaluation", py_key: Py( 0x00007f1dc54e2100, ), path: LookupPath( [ S( "samples_for_evaluation", Py( 0x00007f1dc54e2830, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1ea9468150, ), ), on_error: Raise, validator: Int( IntValidator { strict: false, }, ), validate_default: false, copy_default: false, name: "default[int]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, Field { kw_only: false, name: "maximum_number_of_sampling_steps", py_name: Py( 0x00007f1dc54b33f0, ), init: true, init_only: false, lookup_key: Simple { key: "maximum_number_of_sampling_steps", py_key: Py( 0x00007f1dc519c090, ), path: LookupPath( [ S( "maximum_number_of_sampling_steps", Py( 0x00007f1dc519c510, ), ), ], ), }, validator: WithDefault( WithDefaultValidator { default: Default( Py( 0x00007f1ea94684d0, ), ), on_error: Raise, validator: Int( IntValidator { strict: false, }, ), validate_default: false, copy_default: false, name: "default[int]", undefined: Py( 0x00007f1ea71db950, ), }, ), frozen: false, }, ], positional_count: 14, init_only_count: None, dataclass_name: "PaccMannGPGenerator", validator_name: "dataclass-args[PaccMannGPGenerator]", extra_behavior: Ignore, extras_validator: None, loc_by_alias: true, }, ), class: Py( 0x00005618676dc070, ), fields: [ Py( 0x00007f1ea52ed250, ), Py( 0x00007f1ea52ccc70, ), Py( 0x00007f1e33d8d4b0, ), Py( 0x00007f1dca9b95c0, ), Py( 0x00007f1ea8d7ecf0, ), Py( 0x00007f1dc54e3870, ), Py( 0x00007f1dca921870, ), Py( 0x00007f1dc54e38c0, ), Py( 0x00007f1dc54c4350, ), Py( 0x00007f1ea8602870, ), Py( 0x00007f1dc54e3910, ), Py( 0x00007f1dc54e3960, ), Py( 0x00007f1dc54e39b0, ), Py( 0x00007f1dc54b33f0, ), ], post_init: None, revalidate: Never, name: "PaccMannGPGenerator", frozen: false, slots: true, }, ), definitions=[], cache_strings=True)¶
- __repr__()¶
Return repr(self).
- __signature__ = <Signature (algorithm_version: str = 'v0', batch_size: int = 32, temperature: float = 1.4, generated_length: int = 100, limit: float = 5.0, acquisition_function: str = 'EI', number_of_steps: int = 32, number_of_initial_points: int = 16, initial_point_generator: str = 'random', seed: int = 42, number_of_optimization_rounds: int = 1, sampling_variance: float = 0.1, samples_for_evaluation: int = 4, maximum_number_of_sampling_steps: int = 32) -> None>¶
- __wrapped__¶
alias of
PaccMannGPGenerator