Overcoming catastrophic forgetting problem by weight consolidation and long-term memory