I have been looking at the kernels available in your code, and the implementation of the tanh kernel puzzles me. You have it as:
when it should be:
(since x.feature is a row vector)?
Have I misunderstood the nature of the kernel? Should prod only be there for spline?