fixed shape of cost_weights