1
如何将简单的感知器内核化?
带有非线性边界的分类问题不能通过简单的感知器来解决。以下R代码出于说明目的,并且基于Python中的此示例): nonlin <- function(x, deriv = F) { if (deriv) x*(1-x) else 1/(1+exp(-x)) } X <- matrix(c(-3,1, -2,1, -1,1, 0,1, 1,1, 2,1, 3,1), ncol=2, byrow=T) y <- c(0,0,1,1,1,0,0) syn0 <- runif(2,-1,1) for (iter in 1:100000) { l1 <- nonlin(X %*% syn0) l1_error <- y - l1 l1_delta <- l1_error * …