code: def forward(self, mol_batch, beta=0):
      batch_size = len(mol_batch)
      mol_batch, prop_batch = zip(*mol_batch)
      tree_mess, tree_vec, mol_vec = self.encode(mol_batch)
  
      tree_mean = self.T_mean(tree_vec)
      # Following Mueller et al.
      tree_log_var = -torch.abs(self.T_var(tree_vec))
      mol_mean = self.G_mean(mol_vec)
      # Following Mueller et al.
      mol_log_var = -torch.abs(self.G_var(mol_vec))
  
      z_mean = torch.cat([tree_mean, mol_mean], dim=1)
      z_log_var = torch.cat([tree_log_var, mol_log_var], dim=1)
      kl_loss = (
          -0.5
          * torch.sum(
              1.0 + z_log_var - z_mean * z_mean - torch.exp(z_log_var)
          )
          / batch_size
      )
  
      epsilon = create_var(
          torch.randn(batch_size, self.latent_size // 2), False
      )
      tree_vec = tree_mean + torch.exp(tree_log_var / 2) * epsilon
      epsilon = create_var(
          torch.randn(batch_size, self.latent_size // 2), False
      )
      mol_vec = mol_mean + torch.exp(mol_log_var / 2) * epsilon
  
      word_loss, topo_loss, word_acc, topo_acc = self.decoder(
          mol_batch, tree_vec
      )
      assm_loss, assm_acc = self.assm(mol_batch, mol_vec, tree_mess)
      stereo_loss, stereo_acc = self.stereo(mol_batch, mol_vec)
  
      all_vec = torch.cat([tree_vec, mol_vec], dim=1)
      prop_label = create_var(torch.Tensor(prop_batch))
      prop_loss = self.prop_loss(
          self.propNN(all_vec).squeeze(), prop_label
      )
  
      loss = (
          word_loss
          + topo_loss
          + assm_loss
          + 2 * stereo_loss
          + beta * kl_loss
          + prop_loss
      )
      return (
          loss,
          kl_loss.data,
          word_acc,
          topo_acc,
          assm_acc,
          stereo_acc,
          prop_loss.data,
      )
  
imports: import torch
  import torch.nn
  from .mol_tree import Vocab, MolTree
  from .nnutils import create_var
  from .jtnn_enc import JTNNEncoder
  from .jtnn_dec import JTNNDecoder
  from .mpn import MPN, mol2graph
  from .jtmpn import JTMPN
  from .chemutils import enum_assemble, set_atommap, copy_edit_mol, attach_mols, atom_equal, decode_stereo
  import rdkit
  import rdkit.Chem
  from rdkit import DataStructs
  from rdkit.Chem import AllChem
  import copy
  import math
label_desc: Use image node_id 4 for calling the JTPropVAE obj's underlying member method code with example usage: obj.forward(mol_batch, beta) and returns: loss,  kl_loss,  word_acc,  topo_acc,  assm_acc,  stereo_acc,  prop_loss