use indices for managing shared weights in sigmapi layers.