Categorical Deep Learning: An Algebraic Theory of Architectures