A digital architecture for support vector machines: Theory, algorithm and FPGA implementation