Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNIST example #242

Merged
merged 55 commits into from
Feb 28, 2019
Merged

MNIST example #242

merged 55 commits into from
Feb 28, 2019

Conversation

breznak
Copy link
Member

@breznak breznak commented Feb 1, 2019

  • this is work from @ctrl-z-9000-times , I was playing with the branch and wanted to help, get it in faster.

  • merged recent master

  • reverted changes to SP, this PR aims only to add MNIST; revert 3193892 to continue where you left off.

  • bundle (how?) MNIST data

  • the example now segfaults

  • optimize parameters for better score! (currently 11% 30% 43%)

@breznak breznak added enhancement New feature or request example labels Feb 1, 2019
@ctrl-z-9000-times
Copy link
Collaborator

@breznak,
It appears you started from behind the HEAD. I think a better work flow would have been to:

  1. Start from the latest MNIST branch,
  2. Verify that it works (no segfault, 95% accuracy)
  3. Make new branch off of MNIST
  4. Revert the SpatialPooler stuff to master branch by git checkout master SpatialPooler

bundle (how?) MNIST data

We need download this. Uncompressed, the dataset is 53 Megabytes so we should not check it into git! The dataset has an authoritative source on the internet. A python script can download, unzip and uncompress the files in a cross platform way. I think that numenta has an example downloader script.

Data source: http://yann.lecun.com/exdb/mnist/

Copy link
Member Author

@breznak breznak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my comments about the PR

src/examples/mnist/MNIST_SP.cpp Outdated Show resolved Hide resolved
src/examples/mnist/MNIST_SP.cpp Show resolved Hide resolved
src/examples/mnist/MNIST_SP.cpp Show resolved Hide resolved
src/examples/mnist/MNIST_SP.cpp Outdated Show resolved Hide resolved
src/examples/mnist/MNIST_SP.cpp Outdated Show resolved Hide resolved
src/examples/mnist/MNIST_SP.cpp Outdated Show resolved Hide resolved
@breznak
Copy link
Member Author

breznak commented Feb 1, 2019 via email

@dkeeney
Copy link

dkeeney commented Feb 1, 2019

I think even cmake will be able to download and extract it.

Yes, quite simple.
The question is do we really want it as part of the unit tests that a build every time we submit? That is going to take a lot clock time to run.

This is a great tool to confirm that we have good results but should it be in the CI?

@breznak
Copy link
Member Author

breznak commented Feb 1, 2019 via email

src/CMakeLists.txt Outdated Show resolved Hide resolved
@breznak breznak requested a review from dkeeney February 26, 2019 13:54
@breznak
Copy link
Member Author

breznak commented Feb 26, 2019

Finally the PR is ready.

but hopefully I can get a solid 80% with global inhibition.

apparently, global inhibition is not suitable for 2D images. Could you please retry the parameter optimization some time with local inhibition? It'll take a long time, but should perform no worse than the proposed marcoloumn-aware inhibition.

Otherwise, please review as is.

@breznak breznak added the ready label Feb 26, 2019
Copy link

@dkeeney dkeeney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please turn back on shared library.

src/CMakeLists.txt Outdated Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
@dkeeney
Copy link

dkeeney commented Feb 26, 2019

Thanks :) I spent a week getting shared lib to work so I am a little attached to it.

@breznak
Copy link
Member Author

breznak commented Feb 27, 2019

@ctrl-z-9000-times I am still wondering why the accuracy is so not-good :) with local inhibition (low perf with global inh is "intuitive") compared to your "extended SP". If I understand it, the clever idea with MacroCol SP/inh is that you use the n+1-th dimension to force X cells to cover the (subsets) of the same portion of input space/potential pool.
So the results here with local inh suck just because the low number of columns (variations of input coverage?) (which is due to limited speed)

@ctrl-z-9000-times
Copy link
Collaborator

the clever idea with MacroCol SP/inh is that you use the n+1-th dimension to force X cells to cover the (subsets) of the same portion of input space/potential pool.

That's half of it. The other half is to use global inhibition over the N+1-th dimension, and treat everything in the first N dimensions as a totally separate inhibition areas. The clever trick here is to treat every pair of cells which could possibly interact as either:

  • very close to each other, use global inhibition within a macro-column or
  • very far away from each other, too far away to interact with each other.

@breznak breznak requested a review from dkeeney February 28, 2019 09:52
@breznak
Copy link
Member Author

breznak commented Feb 28, 2019

Bump, please review

Copy link

@dkeeney dkeeney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. 👍

@breznak breznak merged commit b39ffa9 into master Feb 28, 2019
@breznak breznak deleted the mnist-example branch February 28, 2019 13:39
@Thanh-Binh
Copy link

@ctrl-z-9000-times you have your implementation GridCell as an extension of SP. I think it is also useful for Mnist classification. Any comment from you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request example help wanted Extra attention is needed ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants