gt4sd.algorithms.conditional_generation.paccmann_rl.core module

PaccMannRL Algorithm.

PaccMannRL generation is conditioned via reinforcement learning.

Summary

Classes:

PaccMannRL

PaccMannRL Algorithm.

PaccMannRLOmicBasedGenerator

Configuration to generate compounds with low IC50 for a target omics profile.

PaccMannRLProteinBasedGenerator

Configuration to generate compounds with high affinity to a target protein.

Reference

class PaccMannRL(configuration, target)[source]

Bases: GeneratorAlgorithm[S, T]

PaccMannRL Algorithm.

__init__(configuration, target)[source]

Instantiate PaccMannRL 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:

affinity_config = PaccMannRLProteinBasedGenerator()
target = "MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTT"
paccmann_affinity = PaccMannRL(configuration=affinity_config, target=target)
items = list(paccmann_affinity.sample(10))
print(items)
get_generator(configuration, target)[source]

Get the function to sample batches via PaccMannRL’s ConditionalGenerator.

Parameters
  • configuration (AlgorithmConfiguration[~S, ~T]) – helps to set up specific application of PaccMannRL.

  • 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:`RL` Algorithm.'
__module__ = 'gt4sd.algorithms.conditional_generation.paccmann_rl.core'
__orig_bases__ = (gt4sd.algorithms.core.GeneratorAlgorithm[~S, ~T],)
__parameters__ = (~S, ~T)
_abc_impl = <_abc._abc_data object>
class PaccMannRLProteinBasedGenerator(*args, **kwargs)[source]

Bases: PaccMannRLProteinBasedGenerator, Generic[T]

Configuration to generate compounds with high affinity to a target protein.

Implementation from the paper: https://doi.org/10.1088/2632-2153/abe808.

algorithm_type: ClassVar[str] = 'conditional_generation'

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

ProteinSequenceConditionalGenerator

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.

__annotations__ = {'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'>, 'temperature': <class 'float'>}
__dataclass_fields__ = {'algorithm_application': Field(name='algorithm_application',type=typing.ClassVar[str],default='PaccMannRLProteinBasedGenerator',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='PaccMannRL',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='conditional_generation',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), '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 with high affinity to a target protein.\n\n    Implementation from the paper: https://doi.org/10.1088/2632-2153/abe808.\n    '
__eq__(other)

Return self==value.

__hash__ = None
__init__(*args, **kwargs)
__is_pydantic_dataclass__ = True
__match_args__ = ('algorithm_version', 'batch_size', 'temperature', 'generated_length')
__module__ = 'gt4sd.algorithms.conditional_generation.paccmann_rl.core'
__orig_bases__ = (<class 'types.PaccMannRLProteinBasedGenerator'>, typing.Generic[~T])
__parameters__ = (~T,)
__pydantic_complete__ = True
__pydantic_config__ = {}
__pydantic_core_schema__ = {'cls': <class 'gt4sd.algorithms.conditional_generation.paccmann_rl.core.PaccMannRLProteinBasedGenerator'>, 'config': {'title': 'PaccMannRLProteinBasedGenerator'}, 'fields': ['algorithm_version', 'batch_size', 'temperature', 'generated_length'], 'frozen': False, 'post_init': False, 'ref': 'types.PaccMannRLProteinBasedGenerator:94818324615808', 'schema': {'collect_init_only': False, 'computed_fields': [], 'dataclass_name': 'PaccMannRLProteinBasedGenerator', 'fields': [{'type': 'dataclass-field', 'name': 'algorithm_version', 'schema': {'type': 'default', 'schema': {'type': 'str'}, 'default': 'v0'}, 'kw_only': False, 'init': True, 'metadata': {}}, {'type': 'dataclass-field', 'name': 'batch_size', 'schema': {'type': 'default', 'schema': {'type': 'int'}, 'default': 32}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_updates': {'description': 'Batch size used for the generative model sampling.'}}}, {'type': 'dataclass-field', 'name': 'temperature', 'schema': {'type': 'default', 'schema': {'type': 'float'}, 'default': 1.4}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_updates': {'description': 'Temperature parameter for the softmax sampling in decoding.'}}}, {'type': 'dataclass-field', 'name': 'generated_length', 'schema': {'type': 'default', 'schema': {'type': 'int'}, 'default': 100}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_updates': {'description': 'Maximum length in tokens of the generated molcules (relates to the SMILES length).'}}}], '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__ = {'algorithm_version': FieldInfo(annotation=str, required=False, default='v0', init=True, kw_only=False), 'batch_size': FieldInfo(annotation=int, required=False, default=32, description='Batch size used for the generative model sampling.', init=True, 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, kw_only=False), 'temperature': FieldInfo(annotation=float, required=False, default=1.4, description='Temperature parameter for the softmax sampling in decoding.', init=True, kw_only=False)}
classmethod __pydantic_fields_complete__()

Return whether the fields were successfully collected (i.e. type hints were successfully resolved).

This is a private helper, not meant to be used outside Pydantic.

Return type

bool

__pydantic_serializer__ = SchemaSerializer(serializer=PolymorphismTrampoline(     PolymorphismTrampoline {         class: Py(             0x0000563c9c8e9280,         ),         serializer: PolymorphismTrampoline(             PolymorphismTrampoline {                 class: Py(                     0x0000563c9c8e9280,                 ),                 serializer: Dataclass(                     DataclassSerializer {                         class: Py(                             0x0000563c9c8e9280,                         ),                         serializer: Fields(                             GeneralFieldsSerializer {                                 fields: {                                     "temperature": SerField {                                         key: "temperature",                                         alias: None,                                         serializer: Some(                                             WithDefault(                                                 WithDefaultSerializer {                                                     default: Default(                                                         Py(                                                             0x00007f214cdd1650,                                                         ),                                                     ),                                                     serializer: Float(                                                         FloatSerializer {                                                             inf_nan_mode: Null,                                                         },                                                     ),                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                     "algorithm_version": SerField {                                         key: "algorithm_version",                                         alias: None,                                         serializer: Some(                                             WithDefault(                                                 WithDefaultSerializer {                                                     default: Default(                                                         Py(                                                             0x00007f222afe89f0,                                                         ),                                                     ),                                                     serializer: Str(                                                         StrSerializer,                                                     ),                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                     "generated_length": SerField {                                         key: "generated_length",                                         alias: None,                                         serializer: Some(                                             WithDefault(                                                 WithDefaultSerializer {                                                     default: Default(                                                         Py(                                                             0x00007f222f300d50,                                                         ),                                                     ),                                                     serializer: Int(                                                         IntSerializer,                                                     ),                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                     "batch_size": SerField {                                         key: "batch_size",                                         alias: None,                                         serializer: Some(                                             WithDefault(                                                 WithDefaultSerializer {                                                     default: Default(                                                         Py(                                                             0x00007f222f3004d0,                                                         ),                                                     ),                                                     serializer: Int(                                                         IntSerializer,                                                     ),                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                 },                                 computed_fields: Some(                                     ComputedFields(                                         [],                                     ),                                 ),                                 mode: SimpleDict,                                 extra_serializer: None,                                 filter: SchemaFilter {                                     include: None,                                     exclude: None,                                 },                                 required_fields: 4,                             },                         ),                         fields: [                             Py(                                 0x00007f222affaf10,                             ),                             Py(                                 0x00007f222afe83f0,                             ),                             Py(                                 0x00007f21b65bb8b0,                             ),                             Py(                                 0x00007f214cb7e970,                             ),                         ],                         name: "PaccMannRLProteinBasedGenerator",                     },                 ),                 enabled_from_config: false,             },         ),         enabled_from_config: false,     }, ), definitions=[])
__pydantic_validator__ = SchemaValidator(title="PaccMannRLProteinBasedGenerator", validator=Dataclass(     DataclassValidator {         strict: false,         validator: DataclassArgs(             DataclassArgsValidator {                 fields: [                     Field {                         kw_only: false,                         name: "algorithm_version",                         init: true,                         init_only: false,                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "algorithm_version",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: WithDefault(                             WithDefaultValidator {                                 default: Default(                                     Py(                                         0x00007f222afe89f0,                                     ),                                 ),                                 on_error: Raise,                                 validator: Str(                                     StrValidator {                                         strict: false,                                         coerce_numbers_to_str: false,                                     },                                 ),                                 validate_default: false,                                 copy_default: false,                                 name: "default[str]",                                 undefined: Py(                                     0x00007f222cf13af0,                                 ),                             },                         ),                         frozen: false,                     },                     Field {                         kw_only: false,                         name: "batch_size",                         init: true,                         init_only: false,                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "batch_size",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: WithDefault(                             WithDefaultValidator {                                 default: Default(                                     Py(                                         0x00007f222f3004d0,                                     ),                                 ),                                 on_error: Raise,                                 validator: Int(                                     IntValidator {                                         strict: false,                                     },                                 ),                                 validate_default: false,                                 copy_default: false,                                 name: "default[int]",                                 undefined: Py(                                     0x00007f222cf13af0,                                 ),                             },                         ),                         frozen: false,                     },                     Field {                         kw_only: false,                         name: "temperature",                         init: true,                         init_only: false,                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "temperature",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: WithDefault(                             WithDefaultValidator {                                 default: Default(                                     Py(                                         0x00007f214cdd1650,                                     ),                                 ),                                 on_error: Raise,                                 validator: Float(                                     FloatValidator {                                         strict: false,                                         allow_inf_nan: true,                                     },                                 ),                                 validate_default: false,                                 copy_default: false,                                 name: "default[float]",                                 undefined: Py(                                     0x00007f222cf13af0,                                 ),                             },                         ),                         frozen: false,                     },                     Field {                         kw_only: false,                         name: "generated_length",                         init: true,                         init_only: false,                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "generated_length",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: WithDefault(                             WithDefaultValidator {                                 default: Default(                                     Py(                                         0x00007f222f300d50,                                     ),                                 ),                                 on_error: Raise,                                 validator: Int(                                     IntValidator {                                         strict: false,                                     },                                 ),                                 validate_default: false,                                 copy_default: false,                                 name: "default[int]",                                 undefined: Py(                                     0x00007f222cf13af0,                                 ),                             },                         ),                         frozen: false,                     },                 ],                 positional_count: 4,                 init_only_count: None,                 dataclass_name: "PaccMannRLProteinBasedGenerator",                 validator_name: "dataclass-args[PaccMannRLProteinBasedGenerator]",                 extra_behavior: Ignore,                 extras_validator: None,                 loc_by_alias: true,                 validate_by_alias: None,                 validate_by_name: None,             },         ),         class: Py(             0x0000563c9c8e9280,         ),         generic_origin: None,         fields: [             Py(                 0x00007f222affaf10,             ),             Py(                 0x00007f222afe83f0,             ),             Py(                 0x00007f21b65bb8b0,             ),             Py(                 0x00007f214cb7e970,             ),         ],         post_init: None,         revalidate: Never,         name: "PaccMannRLProteinBasedGenerator",         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) -> None>
__wrapped__

alias of PaccMannRLProteinBasedGenerator

class PaccMannRLOmicBasedGenerator(*args, **kwargs)[source]

Bases: PaccMannRLOmicBasedGenerator, Generic[T]

Configuration to generate compounds with low IC50 for a target omics profile.

Implementation from the paper: https://doi.org/10.1016/j.isci.2021.102269.

algorithm_type: ClassVar[str] = 'conditional_generation'

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

TranscriptomicConditionalGenerator

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.

__annotations__ = {'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'>, 'temperature': <class 'float'>}
__dataclass_fields__ = {'algorithm_application': Field(name='algorithm_application',type=typing.ClassVar[str],default='PaccMannRLOmicBasedGenerator',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='PaccMannRL',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='conditional_generation',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), '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 with low IC50 for a target omics profile.\n\n    Implementation from the paper: https://doi.org/10.1016/j.isci.2021.102269.\n    '
__eq__(other)

Return self==value.

__hash__ = None
__init__(*args, **kwargs)
__is_pydantic_dataclass__ = True
__match_args__ = ('algorithm_version', 'batch_size', 'temperature', 'generated_length')
__module__ = 'gt4sd.algorithms.conditional_generation.paccmann_rl.core'
__orig_bases__ = (<class 'types.PaccMannRLOmicBasedGenerator'>, typing.Generic[~T])
__parameters__ = (~T,)
__pydantic_complete__ = True
__pydantic_config__ = {}
__pydantic_core_schema__ = {'cls': <class 'gt4sd.algorithms.conditional_generation.paccmann_rl.core.PaccMannRLOmicBasedGenerator'>, 'config': {'title': 'PaccMannRLOmicBasedGenerator'}, 'fields': ['algorithm_version', 'batch_size', 'temperature', 'generated_length'], 'frozen': False, 'post_init': False, 'ref': 'types.PaccMannRLOmicBasedGenerator:94818324627936', 'schema': {'collect_init_only': False, 'computed_fields': [], 'dataclass_name': 'PaccMannRLOmicBasedGenerator', 'fields': [{'type': 'dataclass-field', 'name': 'algorithm_version', 'schema': {'type': 'default', 'schema': {'type': 'str'}, 'default': 'v0'}, 'kw_only': False, 'init': True, 'metadata': {}}, {'type': 'dataclass-field', 'name': 'batch_size', 'schema': {'type': 'default', 'schema': {'type': 'int'}, 'default': 32}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_updates': {'description': 'Batch size used for the generative model sampling.'}}}, {'type': 'dataclass-field', 'name': 'temperature', 'schema': {'type': 'default', 'schema': {'type': 'float'}, 'default': 1.4}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_updates': {'description': 'Temperature parameter for the softmax sampling in decoding.'}}}, {'type': 'dataclass-field', 'name': 'generated_length', 'schema': {'type': 'default', 'schema': {'type': 'int'}, 'default': 100}, 'kw_only': False, 'init': True, 'metadata': {'pydantic_js_updates': {'description': 'Maximum length in tokens of the generated molcules (relates to the SMILES length).'}}}], '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__ = {'algorithm_version': FieldInfo(annotation=str, required=False, default='v0', init=True, kw_only=False), 'batch_size': FieldInfo(annotation=int, required=False, default=32, description='Batch size used for the generative model sampling.', init=True, 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, kw_only=False), 'temperature': FieldInfo(annotation=float, required=False, default=1.4, description='Temperature parameter for the softmax sampling in decoding.', init=True, kw_only=False)}
classmethod __pydantic_fields_complete__()

Return whether the fields were successfully collected (i.e. type hints were successfully resolved).

This is a private helper, not meant to be used outside Pydantic.

Return type

bool

__pydantic_serializer__ = SchemaSerializer(serializer=PolymorphismTrampoline(     PolymorphismTrampoline {         class: Py(             0x0000563c9c8ec1e0,         ),         serializer: PolymorphismTrampoline(             PolymorphismTrampoline {                 class: Py(                     0x0000563c9c8ec1e0,                 ),                 serializer: Dataclass(                     DataclassSerializer {                         class: Py(                             0x0000563c9c8ec1e0,                         ),                         serializer: Fields(                             GeneralFieldsSerializer {                                 fields: {                                     "generated_length": SerField {                                         key: "generated_length",                                         alias: None,                                         serializer: Some(                                             WithDefault(                                                 WithDefaultSerializer {                                                     default: Default(                                                         Py(                                                             0x00007f222f300d50,                                                         ),                                                     ),                                                     serializer: Int(                                                         IntSerializer,                                                     ),                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                     "algorithm_version": SerField {                                         key: "algorithm_version",                                         alias: None,                                         serializer: Some(                                             WithDefault(                                                 WithDefaultSerializer {                                                     default: Default(                                                         Py(                                                             0x00007f222afe89f0,                                                         ),                                                     ),                                                     serializer: Str(                                                         StrSerializer,                                                     ),                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                     "batch_size": SerField {                                         key: "batch_size",                                         alias: None,                                         serializer: Some(                                             WithDefault(                                                 WithDefaultSerializer {                                                     default: Default(                                                         Py(                                                             0x00007f222f3004d0,                                                         ),                                                     ),                                                     serializer: Int(                                                         IntSerializer,                                                     ),                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                     "temperature": SerField {                                         key: "temperature",                                         alias: None,                                         serializer: Some(                                             WithDefault(                                                 WithDefaultSerializer {                                                     default: Default(                                                         Py(                                                             0x00007f214cdd1650,                                                         ),                                                     ),                                                     serializer: Float(                                                         FloatSerializer {                                                             inf_nan_mode: Null,                                                         },                                                     ),                                                 },                                             ),                                         ),                                         required: true,                                         serialize_by_alias: None,                                         serialization_exclude_if: None,                                     },                                 },                                 computed_fields: Some(                                     ComputedFields(                                         [],                                     ),                                 ),                                 mode: SimpleDict,                                 extra_serializer: None,                                 filter: SchemaFilter {                                     include: None,                                     exclude: None,                                 },                                 required_fields: 4,                             },                         ),                         fields: [                             Py(                                 0x00007f222affaf10,                             ),                             Py(                                 0x00007f222afe83f0,                             ),                             Py(                                 0x00007f21b65bb8b0,                             ),                             Py(                                 0x00007f214cb7e970,                             ),                         ],                         name: "PaccMannRLOmicBasedGenerator",                     },                 ),                 enabled_from_config: false,             },         ),         enabled_from_config: false,     }, ), definitions=[])
__pydantic_validator__ = SchemaValidator(title="PaccMannRLOmicBasedGenerator", validator=Dataclass(     DataclassValidator {         strict: false,         validator: DataclassArgs(             DataclassArgsValidator {                 fields: [                     Field {                         kw_only: false,                         name: "algorithm_version",                         init: true,                         init_only: false,                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "algorithm_version",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: WithDefault(                             WithDefaultValidator {                                 default: Default(                                     Py(                                         0x00007f222afe89f0,                                     ),                                 ),                                 on_error: Raise,                                 validator: Str(                                     StrValidator {                                         strict: false,                                         coerce_numbers_to_str: false,                                     },                                 ),                                 validate_default: false,                                 copy_default: false,                                 name: "default[str]",                                 undefined: Py(                                     0x00007f222cf13af0,                                 ),                             },                         ),                         frozen: false,                     },                     Field {                         kw_only: false,                         name: "batch_size",                         init: true,                         init_only: false,                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "batch_size",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: WithDefault(                             WithDefaultValidator {                                 default: Default(                                     Py(                                         0x00007f222f3004d0,                                     ),                                 ),                                 on_error: Raise,                                 validator: Int(                                     IntValidator {                                         strict: false,                                     },                                 ),                                 validate_default: false,                                 copy_default: false,                                 name: "default[int]",                                 undefined: Py(                                     0x00007f222cf13af0,                                 ),                             },                         ),                         frozen: false,                     },                     Field {                         kw_only: false,                         name: "temperature",                         init: true,                         init_only: false,                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "temperature",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: WithDefault(                             WithDefaultValidator {                                 default: Default(                                     Py(                                         0x00007f214cdd1650,                                     ),                                 ),                                 on_error: Raise,                                 validator: Float(                                     FloatValidator {                                         strict: false,                                         allow_inf_nan: true,                                     },                                 ),                                 validate_default: false,                                 copy_default: false,                                 name: "default[float]",                                 undefined: Py(                                     0x00007f222cf13af0,                                 ),                             },                         ),                         frozen: false,                     },                     Field {                         kw_only: false,                         name: "generated_length",                         init: true,                         init_only: false,                         lookup_path_collection: LookupPathCollection {                             by_name: LookupPath {                                 first_item: PathItemString(                                     "generated_length",                                 ),                                 rest: [],                             },                             by_alias: [],                         },                         validator: WithDefault(                             WithDefaultValidator {                                 default: Default(                                     Py(                                         0x00007f222f300d50,                                     ),                                 ),                                 on_error: Raise,                                 validator: Int(                                     IntValidator {                                         strict: false,                                     },                                 ),                                 validate_default: false,                                 copy_default: false,                                 name: "default[int]",                                 undefined: Py(                                     0x00007f222cf13af0,                                 ),                             },                         ),                         frozen: false,                     },                 ],                 positional_count: 4,                 init_only_count: None,                 dataclass_name: "PaccMannRLOmicBasedGenerator",                 validator_name: "dataclass-args[PaccMannRLOmicBasedGenerator]",                 extra_behavior: Ignore,                 extras_validator: None,                 loc_by_alias: true,                 validate_by_alias: None,                 validate_by_name: None,             },         ),         class: Py(             0x0000563c9c8ec1e0,         ),         generic_origin: None,         fields: [             Py(                 0x00007f222affaf10,             ),             Py(                 0x00007f222afe83f0,             ),             Py(                 0x00007f21b65bb8b0,             ),             Py(                 0x00007f214cb7e970,             ),         ],         post_init: None,         revalidate: Never,         name: "PaccMannRLOmicBasedGenerator",         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) -> None>
__wrapped__

alias of PaccMannRLOmicBasedGenerator