numenta / nupic.embodied

GNU Affero General Public License v3.0
6 stars 6 forks source link

Torchifies disagreement experiments #29

Closed lucasosouza closed 3 years ago

lucasosouza commented 3 years ago

Converts all from numpy to torch. The backprop has been tested local, it is running, but can't verify algorithm correctness.

It is very slow. Reason is the training loop is a 4-nested loop: steps, epochs, batches, and dynamics models. Currently, they are all sequential. And a single CPU core is being used. Some pending actions:

ps1: My local environment is python 3.7, hence pytorch is limited to 1.71. For that I couldn't use t.ravel() and had to use t.flatten() instead. The difference is ravel() only uses a view(), so it points to the same place in memory, while flatten create a copy. When upgrading the environment we should switch those.

ps2: PR also includes some style fixes to be compliant to PEP8, including variable naming, spacing, copyright notice and import order. I've been applying the style fixes gradually as I work with the different sections of the code.