Standard Pretrained Models
/home/dmai/miniconda3/envs/mrl/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: to-Python converter for boost::shared_ptr<RDKit::FilterCatalogEntry const> already registered; second conversion method ignored.
  return f(*args, **kwds)

Model Zoo

This module contains a set of standard models with pre-trained weights

model_from_url[source]

model_from_url(weight_filename)

class PretrainedGenerativeAgent[source]

PretrainedGenerativeAgent(weight_filename, model, vocab, loss_function, dataset, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='pretrained_model') :: GenerativeAgent

PretrainedGenerativeAgent - base GenerativeAgent variant for pretrained models

Inputs:

  • weight_filename str: filename to grab from S3

  • model nn.Module: model

  • vocab Vocab: vocabulary

  • loss_function Callable: loss function for supervised training. Should function as loss = loss_function(model_output, y)

  • dataset Base_Dataset: dataset

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

LSTM LM

Models based on LSTM_LM class

lstm_lm_small[source]

lstm_lm_small(vocab, drop_scale=1.0)

lstm_lm_small - small LSTM_LM model

Inputs:

  • vocab Vocab: vocab to use

  • drop_scale float: scale dropout values

lstm_lm_large[source]

lstm_lm_large(vocab, drop_scale=1.0)

lstm_lm_large - large LSTM_LM model

Inputs:

  • vocab Vocab: vocab to use

  • drop_scale float: scale dropout values

vocab = CharacterVocab(SMILES_CHAR_VOCAB)
model = lstm_lm_small(vocab)
assert isinstance(model, nn.Module)
model = lstm_lm_large(vocab)
assert isinstance(model, nn.Module)

class LSTM_LM_Small_ZINC[source]

LSTM_LM_Small_ZINC(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_small_zinc') :: PretrainedGenerativeAgent

LSTM_LM_Small_ZINC - small LSTM_LM model trained on a chunk of the ZINC library

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Small_ZINC()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

agent.reload_weights()

class LSTM_LM_Large_ZINC[source]

LSTM_LM_Large_ZINC(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_large_zinc') :: PretrainedGenerativeAgent

LSTM_LM_Small_ZINC - large LSTM_LM model trained on a chunk of the ZINC library

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Large_ZINC()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

agent.reload_weights()

class LSTM_LM_Small_Chembl[source]

LSTM_LM_Small_Chembl(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_small_chembl') :: PretrainedGenerativeAgent

LSTM_LM_Small_Chembl - small LSTM_LM model trained on a chunk of the Chembl library

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Small_Chembl()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class LSTM_LM_Small_ZINC_NC[source]

LSTM_LM_Small_ZINC_NC(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_small_zinc_nc') :: PretrainedGenerativeAgent

LSTM_LM_Small_ZINC_NC - small LSTM_LM model trained on a chunk of the ZINC library with no chirality markers (ie no '@' symbols)

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Small_ZINC_NC()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class LSTM_LM_Small_Chembl_NC[source]

LSTM_LM_Small_Chembl_NC(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_small_chembl_nc') :: PretrainedGenerativeAgent

LSTM_LM_Small_Chembl_NC - small LSTM_LM model trained on a chunk of the Chembl library with no chirality markers (ie no '@' symbols)

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Small_Chembl_NC()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class LSTM_LM_Small_ZINC_Selfies[source]

LSTM_LM_Small_ZINC_Selfies(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_small_zinc_selfies') :: PretrainedGenerativeAgent

LSTM_LM_Small_ZINC_Selfies - small LSTM_LM model trained on a chunk of the ZINC library using SELFIES-type tokenization

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Small_ZINC_Selfies()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class LSTM_LM_Small_Chembl_Selfies[source]

LSTM_LM_Small_Chembl_Selfies(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_small_chembl_selfies') :: PretrainedGenerativeAgent

LSTM_LM_Small_Chembl_Selfies - small LSTM_LM model trained on a chunk of the Chembl library using SELFIES-type tokenization

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Small_Chembl_Selfies()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class LSTM_LM_Small_Rgroup[source]

LSTM_LM_Small_Rgroup(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_small_rgroup') :: PretrainedGenerativeAgent

LSTM_LM_Small_Rgroup - small LSTM_LM model trained on R-groups. R groups are SMILES with the format *R

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Small_Rgroup()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class LSTM_LM_Small_Linkers[source]

LSTM_LM_Small_Linkers(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_small_linkers') :: PretrainedGenerativeAgent

LSTM_LM_Small_Linkers - small LSTM_LM model trained on linkers. Linkes are SMILES with the format *R*

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Small_Linkers()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class LSTM_LM_Small_Linkers_Mapped[source]

LSTM_LM_Small_Linkers_Mapped(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_small_linkers_mapped') :: PretrainedGenerativeAgent

LSTM_LM_Small_Linkers_Mapped - small LSTM_LM model trained on linkers with mapping tokens for compatibility with LinkerBlockTemplate. Linkers are SMILES with the format *R*

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Small_Linkers_Mapped()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class LSTM_LM_Small_Swissprot[source]

LSTM_LM_Small_Swissprot(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_small_swissprot') :: PretrainedGenerativeAgent

LSTM_LM_Small_Swissprot - small LSTM_LM model trained on the Swissprot protein dataset. This model was trained on protein sequences of 650 amino acids or fewer

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Small_Swissprot()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
proteins = to_protein(smiles)
proteins = [i for i in proteins if i is not None]
assert len(proteins)>80

class LSTM_LM_Small_PI1M[source]

LSTM_LM_Small_PI1M(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_small_pi1m') :: PretrainedGenerativeAgent

LSTM_LM_Small_PI1M - small LSTM_LM model trained on a chunk of the PI1M polymer library

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Small_PI1M()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class LSTM_LM_Small_HGenome[source]

LSTM_LM_Small_HGenome(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_small_hgenome') :: PretrainedGenerativeAgent

LSTM_LM_Small_HGenome - small LSTM_LM model trained on 400bp chunks of the human genome

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Small_HGenome()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_dnas(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class LSTM_LM_Small_HGenome_3Mer[source]

LSTM_LM_Small_HGenome_3Mer(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='lstmlm_small_hgenome_3mer') :: PretrainedGenerativeAgent

LSTM_LM_Small_HGenome_3Mer - small LSTM_LM model trained on 400bp chunks of the human genome with 3-mer tokenization

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = LSTM_LM_Small_HGenome_3Mer()

preds, _ = agent.model.sample_no_grad(100, 33)
smiles = agent.reconstruct(preds)
mols = to_dnas(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

Conditional LSTM LM

Models based on Conditional_LSTM_LM

cond_lstm_small[source]

cond_lstm_small(vocab, encoder, drop_scale=1.0)

cond_lstm_small - small conditional LSTM_LM model

Inputs:

  • vocab Vocab: vocab to use

  • encoder nn.Module: encoder module

  • drop_scale float: scale dropout values

cond_lstm_large[source]

cond_lstm_large(vocab, encoder, drop_scale=1.0)

cond_lstm_large - large conditional LSTM_LM model

Inputs:

  • vocab Vocab: vocab to use

  • encoder nn.Module: encoder module

  • drop_scale float: scale dropout values

mlp_cond_lstm_small[source]

mlp_cond_lstm_small(vocab, drop_scale=1.0)

mlp_cond_lstm_small - small conditional LSTM_LM model with MLP encoder

Inputs:

  • vocab Vocab: vocab to use

  • drop_scale float: scale dropout values

mlp_cond_lstm_large[source]

mlp_cond_lstm_large(vocab, drop_scale=1.0)

mlp_cond_lstm_large - large conditional LSTM_LM model with MLP encoder

Inputs:

  • vocab Vocab: vocab to use

  • drop_scale float: scale dropout values

vocab = CharacterVocab(SMILES_CHAR_VOCAB)
model = mlp_cond_lstm_small(vocab)
assert isinstance(model, nn.Module)
model = mlp_cond_lstm_large(vocab)
assert isinstance(model, nn.Module)

class FP_Cond_LSTM_LM_Small_ZINC[source]

FP_Cond_LSTM_LM_Small_ZINC(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='fp_cond_lstmlm_small_zinc') :: PretrainedGenerativeAgent

FP_Cond_LSTM_LM_Small_ZINC - small Conditional_LSTM_LM model trained to reconstruct SMILES from a ECFP6 fingerprint using a chunk of the ZINC database

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = FP_Cond_LSTM_LM_Small_ZINC()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class FP_Cond_LSTM_LM_Small_ZINC_Selfies[source]

FP_Cond_LSTM_LM_Small_ZINC_Selfies(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='fp_cond_lstmlm_small_zinc_selfies') :: PretrainedGenerativeAgent

FP_Cond_LSTM_LM_Small_ZINC_Selfies - small Conditional_LSTM_LM model trained to reconstruct SMILES from a ECFP6 fingerprint using a chunk of the ZINC database with SELFIES encoding

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = FP_Cond_LSTM_LM_Small_ZINC_Selfies()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class FP_Cond_LSTM_LM_Small_Chembl[source]

FP_Cond_LSTM_LM_Small_Chembl(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='fp_cond_lstmlm_small_chembl') :: PretrainedGenerativeAgent

FP_Cond_LSTM_LM_Small_Chembl - small Conditional_LSTM_LM model trained to reconstruct SMILES from a ECFP6 fingerprint using the Chembl database

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = FP_Cond_LSTM_LM_Small_Chembl()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

VAE

Models based on VAE

mlp_vae[source]

mlp_vae(vocab, drop_scale=1.0)

mlp_vae - VAE with MLP encoder

Inputs:

  • vocab Vocab: vocab to use

  • drop_scale float: scale dropout values

conv_vae[source]

conv_vae(vocab, drop_scale=1.0)

mlp_vae - VAE with convolutional encoder

Inputs:

  • vocab Vocab: vocab to use

  • drop_scale float: scale dropout values

lstm_vae[source]

lstm_vae(vocab, drop_scale=1.0)

mlp_vae - VAE with LSTM encoder

Inputs:

  • vocab Vocab: vocab to use

  • drop_scale float: scale dropout values

vocab = CharacterVocab(SMILES_CHAR_VOCAB)
model = mlp_vae(vocab)
assert isinstance(model, nn.Module)
model = conv_vae(vocab)
assert isinstance(model, nn.Module)
model = lstm_vae(vocab)
assert isinstance(model, nn.Module)

class FP_VAE_ZINC[source]

FP_VAE_ZINC(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='fp_vae_zinc') :: PretrainedGenerativeAgent

FP_VAE_ZINC - MLP-to-LSTM VAE trained to reconstruct SMILES from a ECFP6 fingerprint using the ZINC database

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = FP_VAE_ZINC()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class FP_VAE_Chembl[source]

FP_VAE_Chembl(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='fp_vae_chembl') :: PretrainedGenerativeAgent

FP_VAE_Chembl - MLP-to-LSTM VAE trained to reconstruct SMILES from a ECFP6 fingerprint using the Chembl database

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = FP_VAE_Chembl()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80

class FP_VAE_ZINC_Selfies[source]

FP_VAE_ZINC_Selfies(drop_scale=1.0, base_update=0.97, base_update_iter=5, base_model=True, opt_kwargs={}, clip=1.0, name='fp_vae_zinc_selfies') :: PretrainedGenerativeAgent

FP_VAE_ZINC_Selfies - MLP-to-LSTM VAE trained to reconstruct SMILES from a ECFP6 fingerprint using the ZINC database with SELFIES encoding

Inputs:

  • drop_scale float: dropout scale

  • base_update float: update fraction for the baseline model. Updates the base model following base_model = base_update*base_model + (1-base_update)*model

  • base_update_iter int: update frequency for baseline model

  • base_model bool: if False, baseline model will not be created

  • opt_kwargs dict: dictionary of keyword arguments passed to optim.Adam

  • clip float: gradient clipping

  • name str: agent name

agent = FP_VAE_ZINC_Selfies()

preds, _ = agent.model.sample_no_grad(100, 100)
smiles = agent.reconstruct(preds)
mols = to_mols(smiles)
mols = [i for i in mols if i is not None]
assert len(mols)>80