func (kdata SigmoidKernel) Func(a, b []float64) (sumprod float64) {
	return math.Tanh(kdata.gamma*floats.Dot(a, b) + kdata.coef0)
}
Func for SigmoidKernel
package svm
import (
	"math"
	"gonum.org/v1/gonum/floats"
)
type Kernel interface {
	Func(a, b []float64) float64
}
type LinearKernel struct{}
func (LinearKernel) Func(a, b []float64) (sumprod float64) {
	sumprod = floats.Dot(a, b)
	return
}
type PolynomialKernel struct{ gamma, coef0, degree float64 }
func (kdata PolynomialKernel) Func(a, b []float64) (sumprod float64) {
	return math.Pow(kdata.gamma*floats.Dot(a, b)+kdata.coef0, kdata.degree)
}
type RBFKernel struct{ gamma float64 }
func (kdata RBFKernel) Func(a, b []float64) float64 {
	L2 := 0.
	for i := range a {
		v := a[i] - b[i]
		L2 += v * v
	}
	return math.Exp(-kdata.gamma * L2)
}
type SigmoidKernel struct{ gamma, coef0 float64 }