Memorizing environmental signals through feedback and feedforward loops. (April 2021)