Added choice of training algorithm