The Neural Ring: An Algebraic Tool for Analyzing the Intrinsic Structure of Neural Codes