update d_ldW in setWeights