Memory and connectivity in immune and neural network models