How to share weights between two nets?

I think you can refer to this topic: