# Training data
x <- seq(-3,3,length.out=400)
y <- tanh(x)
# A held out validation set for the stop criterion
x.val <- runif(50,min=-6,max=6)
y.val <- tanh(x.val)
# Training the model using the validation set to prevent overfitting
m <- TrainIBHM(x,y,
ConfigureIBHM(stop.criterion = ValidationSC(x.val, y.val))
)
summary(m)
plot(y.val,predict(m,x.val),asp=1)
Run the code above in your browser using DataLab