Backpropagation for Shared Weights