add memorize into training process