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

How to generate this picture by using the class of PatternGenerator? #612

Closed youngjt closed 9 years ago

youngjt commented 9 years ago

How to generate the following picture by using the class of PatternGenerator?

topo

Thanks.

jbednar commented 9 years ago

There are a lot of ways, and I'm not sure what the simplest would be. I might rather use FeatureMapper to generate that, not PatternGenerator, since that handles cross products of parameter values (orientation and position, in this case). But it would take a metafeature there, because position is being varied orthogonally to the current orientation, which is a bit tricky. If it were just PatternGenerator, you could set the orientation,x,and y parameters to some complicated function objects that depend on time, or you could use a Selector object to select between different objects, each with a fixed orientation and wrapping around between the various possible positions orthogonal to that orientation. Or you could just write a loop to present such objects in order. Overall, it depends what you're trying to achieve; if it's to collect the responses to these patterns in order, FeatureMapper or a loop is probably appropriate. The PatternGenerator-based solutions are probably appropriate mainly if you want to use this for training, where you want this pattern to repeat forever.

youngjt commented 9 years ago

Thanks for your answer。

I have solved this problem.And my method is: using math formulas: y=kx+b(k=tan(orientation),and I have got a suitable b).

(1)Then get the X Position and Y Position: x_points,y_points = SheetCoordinateSystem(p.bounds, p.xdensity, p.ydensity).sheetcoordinates_of_matrixidx()

(2)put the x_points in y=kx+b,and we can get the y' (3)find the suitable y_points by y',and then you have found a 'line' in the matrix