Implementing engrams from a machine learning perspective: XOR as a basic motif