From nupic.core