>> e = exp 1.0 >> sigmoid xx = 1.0 / (1 + (e ** (1.0 * xx))) > > That 1.0 * xx caught my eye. > > In case this was an oversight on your part: if you mean the usual sigmoid > function, that should be 1.0 / (1 + (e ** (0.0 - x))). i had a different constant there before.