use std to initialize pairwise weights