def SetPhase(self, layer, pos=True):
    """Setup required before starting a phase.

    This method makes 'state' and 'sample' point to the right variable depending
    on the phase.
    """
    if pos:
      layer.state = layer.pos_state
      layer.sample = layer.pos_sample
    else:
      layer.state = layer.neg_state
      layer.sample = layer.neg_sample
Setup required before starting a phase.

    This method makes 'state' and 'sample' point to the right variable depending
    on the phase.
    
deepnet/dbm.py