def SetUpLinks(self):
    """Modifies self.net to create two parallel nets."""
    net1 = self.net
    net2 = CopyModel(net1)  # creates a copy of the net.
    for layer in net1.layer:
      if layer.hyperparams.fast_dropout:
        layer.is_output = True
      layer.name += '_1'
    for edge in net1.edge:
      edge.node1 += '_1'
      edge.node2 += '_1'
    for layer in net2.layer:
      layer.tied = True
      layer.tied_to = '%s_1' % layer.name
      if layer.hyperparams.fast_dropout:
        layer.is_output = True
      if layer.is_input or layer.is_output:
        layer.data_field.tied = True
        layer.data_field.tied_to = '%s_1' % layer.name
      layer.name += '_2'
    for edge in net2.edge:
      edge.tied = True
      edge.tied_to_node1 = '%s_1' % edge.node1
      edge.tied_to_node2 = '%s_1' % edge.node2
      edge.node1 += '_2'
      edge.node2 += '_2'
    self.net.MergeFrom(net2)
Modifies self.net to create two parallel nets.
deepnet/fastdropoutnet.py