Learning place cells and remapping by decoding the cognitive map