docstr: Test that the aspuru_guzik encoder doesn't hard error.
  This model takes too long to fit to do an overfit test
docstr_tok: ["Test","that","the","aspuru_guzik","encoder","does","n't","hard","error",".","This","model","takes","too","long","to","fit","to","do","an","overfit","test"]
code: def test_aspuru_guzik(self):
      """Test that the aspuru_guzik encoder doesn't hard error.
      This model takes too long to fit to do an overfit test
      """
      train_smiles = [
          "Cc1cccc(N2CCN(C(=O)C34CC5CC(CC(C5)C3)C4)CC2)c1C",
          "Cn1ccnc1SCC(=O)Nc1ccc(Oc2ccccc2)cc1",
          "COc1cc2c(cc1NC(=O)CN1C(=O)NC3(CCc4ccccc43)C1=O)oc1ccccc12",
          "O=C1/C(=C/NC2CCS(=O)(=O)C2)c2ccccc2C(=O)N1c1ccccc1",
          "NC(=O)NC(Cc1ccccc1)C(=O)O",
          "CCn1c(CSc2nccn2C)nc2cc(C(=O)O)ccc21",
          "CCc1cccc2c1NC(=O)C21C2C(=O)N(Cc3ccccc3)C(=O)C2C2CCCN21",
          "COc1ccc(C2C(C(=O)NCc3ccccc3)=C(C)N=C3N=CNN32)cc1OC",
          "CCCc1cc(=O)nc(SCC(=O)N(CC(C)C)C2CCS(=O)(=O)C2)[nH]1",
          "CCn1cnc2c1c(=O)n(CC(=O)Nc1cc(C)on1)c(=O)n2Cc1ccccc1",
      ]
      tokens = set()
      for s in train_smiles:
          tokens = tokens.union(set(c for c in s))
      tokens = sorted(list(tokens))
      max_length = max(len(s) for s in train_smiles) + 1
      s = dc.models.seqtoseq.AspuruGuzikAutoEncoder(tokens, max_length)
  
      def generate_sequences(smiles, epochs):
          for i in range(epochs):
              for s in smiles:
                  yield (s, s)
  
      s.fit_sequences(generate_sequences(train_smiles, 100))
  
      # Test it out.
      pred1 = s.predict_from_sequences(train_smiles, beam_width=1)
      pred4 = s.predict_from_sequences(train_smiles, beam_width=4)
      embeddings = s.predict_embeddings(train_smiles)
      pred1e = s.predict_from_embeddings(embeddings, beam_width=1)
      pred4e = s.predict_from_embeddings(embeddings, beam_width=4)
  
      for i in range(len(train_smiles)):
          assert pred1[i] == pred1e[i]
          assert pred4[i] == pred4e[i]
  
file_path: deepchem/deepchem/models/tests/test_seqtoseq.py
imports: import pytest
  import deepchem
  import numpy
  import unittest
label_desc: Use image node_id 2 for calling the TestSeqToSeq obj's underlying member method code with example usage: obj.test_aspuru_guzik() without return types