get weight matrix