ioam / topographica

A general-purpose neural simulator focusing on topographic maps.
topographica.org
BSD 3-Clause "New" or "Revised" License
53 stars 32 forks source link

Test pattern #653

Closed Hima-Mehta closed 8 years ago

Hima-Mehta commented 8 years ago

Hello, Is there any way I can add mask to constant patterns in 'Test pattern' GUI ? I want to check my lissom activation for each and every test pattern after training .

jbednar commented 8 years ago

Can you explain? You can add masks to any pattern, but I don't know how that would help checking LISSOM activations. I'd strongly recommend using GCAL rather than LISSOM, in any case; GCAL is simpler, more robust, and more realistic.

Hima-Mehta commented 8 years ago

In GUI there is a menu item called "test pattern" where I can not set my predefined numpy array as mask in a constant pattern.

philippjfr commented 8 years ago

Are you working exclusively in the GUI or have you tried working in the Jupyter notebook? The latter is now the recommended workflow, so if you need some guidance on how to measure and display responses to arbitrary patterns in the notebook let me know.

jbednar commented 8 years ago

In GUI there is a menu item called "test pattern" where I can not set my predefined numpy array as mask in a constant pattern.

I can't think of a way that you could do that in the GUI, but there's no need to use the GUI for presenting a constant pattern; just use the pattern_present command, either from the command line or a notebook. Should be much simpler than trying to hack it into the GUI somehow. I think you can still use the GUI's activity window to see the results afterwards, though I don't have a running copy of the GUI to try that with today. And yes, I strongly recommend using the notebook interface rather than the GUI; it's vastly more powerful in general.

philippjfr commented 8 years ago

Alternatively you can also use the featuremapper.command.measure_response function, just specify the patterngenerator and the outputs to measure like this:

measure_response(outputs=['V1'], pattern_generator=ig.Constant(mask_shape=ig.Disk()),
                 durations=np.linspace(0,1,21))

This will give you a HoloMap of Image types corresponding to each measured output. In a notebook this will visualize the response automatically.

jbednar commented 8 years ago

Right; measure_response uses pattern_present internally, and users can use either approach. I'm not sure what a mask will buy in this case, though -- a mask of a constant pattern is just the same as using the mask shape as the pattern shape, I would think. Masks are important for things like images or gratings that you want to make circular, but maybe you have some other use case in mind.

Hima-Mehta commented 8 years ago

Yes I mostly work on Jupyter notebook only but I did not know the way to test patterns neither could I find the it in docs . Thanks for these solutions. featuremapper.command.measure_response seem exactly like what I am looking for . Thank you .

Off this topic : Is Holoviews compatible with stable version of topographica now ? I had read that you guys going to update it .

philippjfr commented 8 years ago

No problem glad we could help.

Off this topic : Is Holoviews compatible with stable version of topographica now ? I had read that you guys going to update it .

When you stable version do you mean the 0.9.8 release? In that case the answer is probably no, it won't work very well. Personally I'm working with the development version of Topographica and HoloViews and will continue to make sure those work nicely together.

jbednar commented 8 years ago

Since the 0.9.8 release, most of the development on Topographica has been driven by Jean-Luc and Philipp, who are now submitting their PhD theses. My hope is that after they have submitted, we can release Topographica 1.0, incorporating all of their work and making sure everything is stable and usable. For now, the development version (from github) has tons of new features, but anything not crucial for Jean-Luc and Philipp's theses has been a bit neglected, such as the Tk GUI. For 1.0 I plan to either bring the GUI up to date with their changes, or else retire it altogether; depends on how much work it seems like at that time. :-/ Right now, everything but the Model Editor can be done using the notebook interface, though I'd personally like a version of the Test Pattern window that works in the notebook (which Philipp actually drafted at some point, but it's not currently usable).