Correcting weights of pattern synapses