markusrobertjonsson / learningsimulator

Version Sifaka
MIT License
1 stars 1 forks source link

Add "anonymous" stimulus elements #102

Closed markusrobertjonsson closed 2 years ago

markusrobertjonsson commented 4 years ago

Suppose our stimuli are 5 x 5 images. We could write:

    stimulus_elements: s11, s12, ..., s54, s55
    ...
    @stimulus image1: s11[0], s12[0.2], ..., s54[0.5], s55[0.3]

but this is impractical. (@stimulus pertains to the suggestion in issue #101.)

The suggestion is to let the underlying elements s11,...,s55 be defined by the position in an intensity vector. Then instead of

    stimulus_elements: s11, s12, s13, s14, s15,
                       s21, s22, s23, s24, s25,
                       s31, s32, s33, s34, s35,
                       s41, s42, s43, s44, s45,
                       s51, s52, s53, s54, s55
    @stimulus image1: s11[0.0], s12[0.2], s13[0.6], s14[0.1], s15[0.9],
                      s21[0.1], s22[0.1], s23[0.2], s24[0.5], s25[0.3],
                      s31[0.2], s32[0.2], s33[0.6], s34[0.1], s35[0.3],
                      s41[0.4], s42[0.6], s43[0.5], s44[0.2], s45[0.9],
                      s51[0.7], s52[0.9], s53[0.4], s54[0.5], s55[0.3]

we may write

    @stimulus image1: 0.0, 0.2, 0.6, 0.1, 0.9,
                      0.1, 0.1, 0.2, 0.5, 0.3,
                      0.2, 0.2, 0.6, 0.1, 0.3,
                      0.4, 0.6, 0.5, 0.2, 0.9,
                      0.7, 0.9, 0.4, 0.5, 0.3

but s11, s21,..., s55 need not be declared as stimulus elements. If one needs to access these individually, a naming convention is needed, for example calling them "e1", "e2", etc. (which then must be protected).

This can be handy even with few components:

    @stimulus orange: 1, 0.65, 0
    @stimulus yellow: 1, 0, 0
    @stimulus gray: 0.5, 0.5, 0.5

which would assume three underlying elements ("red", "green", and "blue" in this case) and is short for

    @stimulus orange: red[1], green[0.65], blue[0]
    @stimulus yellow: red[1], green[0], blue[0]
    @stimulus gray: red[0.5], green[0.5], blue[0.5]
markusrobertjonsson commented 2 years ago

Moved to https://github.com/learningsimulator/learningsimulator/issues/147