library(MASS)
A = mvrnorm(n=500, c(0,0), diag(2))
B = mvrnorm(n=500, c(2,0), matrix(c(4,0,0,4), 2))
A = cbind(A, rep(1, 500))
B = cbind(B, rep(1, 500))
data = data.frame(rbind(A,B))

library(nnet)
net = nnet(d~x1+x2, data=data, size=2, maxit=200)
t = table(
	y=predict(net, type="class")
	d=data$d
)
t