selfies ======= .. py:module:: selfies .. autoapi-nested-parse:: Class to represent SELFIES molecules. Attributes ---------- .. autoapisummary:: selfies.SELFIES_VOCAB_SMALL selfies.PAD_TOKEN Classes ------- .. autoapisummary:: selfies.Selfies Module Contents --------------- .. py:data:: SELFIES_VOCAB_SMALL :value: ['[#Branch1]', '[#Branch2]', '[#C]', '[#N]', '[=Branch1]', '[=Branch2]', '[=C]', '[=N]', '[=O]',... .. py:data:: PAD_TOKEN :value: '[nop]' .. py:class:: Selfies(selfies_vocab = None, **kwargs) Bases: :py:obj:`gflownet.envs.sequences.base.SequenceBase` :param selfies_vocab: The list of SELFIES tokens to use as the vocabulary. If None (default), the small vocabulary defined in SELFIES_VOCAB_SMALL is used. :type selfies_vocab: List[str] | None .. py:attribute:: selfies_vocab :value: None .. py:method:: states2proxy(states) Prepare a batch of states for a SELFIES-string proxy. The proxy representation is the compact SELFIES string obtained by concatenating all non-padding tokens in the sequence. :param states: A batch of states in environment format, either as a list of states or as a single tensor. :type states: list or tensor :returns: *A list containing one SELFIES string per state.*