fix longterm memory training bug: wrong max affinity