I don't think I'm getting it. Why would the second cost necessary need targets, and only targets?
There seems to be a mismatch: if there are two costs, the second space would be the output space of the first auto-encoder, but the source would be "targets"?