Reinforcement learning task

16 görüntüleme
İlk okunmamış mesaja atla

Benedek Kurdi

okunmadı,
2 Nis 2021 13:17:172.04.2021
alıcı Minno.js

Hi all,
I'm trying to implement a new learning task in Minno and I'm running into some issues. You can access the study from here and I attached the task as a .txt as well.
(1) Randomization
I'm sorry, I feel like I keep running into this but I just haven't been able to figure it out.
In lines 261–262, I'm showing two stimuli:
{type: 'showStim',handle:'col2Left'},
{type: 'showStim', handle:'col1Right'},
and depending on the participant's choice, either the left stimulus or the right stimulus is then supposed to be shown as it enters a machine (e.g., lines 285–288):
{type:'showStim', handle:'col1RightTop'},
{type:'custom', fn: function(){
animate('[data-handle="col1RightTop"]', {duration: 3000, topShift: 0.2});
}},
I was trying to make sure that these two stimuli (e.g., col1Right and col1RightTop) are the same by setting the same random seed for them (e.g., lines 95 and 100), but something is clearly off because the stimulus that goes into the machine is not the same as the stimulus that was selected before.
(2) Incrementing a counter depending on participant response
In lines 352–354 I have some code that increments a counter so that I can show the trial number to participants. I tried to modify this code to make sure that another counter (which counts points) gets incremented depending on what option the participant chooses. For example, in lines 289–291, I'm trying to say the following:
{type:'custom', fn: function(trialobject, globalObject){
globalObject.col1Tracker = globalObject.col1Tracker + 10;
}},    
For some reason this code is not working and the counter isn't getting incremented. Can someone please give me a pointer as to what I'm doing wrong?
(3) Logging
The only information that I'm really interested in logging is what option participants choose (E key vs. I key) and the two stimuli that they are selecting from. Which is why I tried to put the logging in line 271 (along with resetting the timer in line 263). However, the trial response getting logged is "commence" and the trial latency is 0. Where should I put the log and resetTimer actions so that I can log the participant's choice and the latency starting where the two options were first shown on screen?
Thanks so much for your help in advance!
—Benedek
game.txt

Elad Zlotnick

okunmadı,
5 Nis 2021 03:31:555.04.2021
alıcı Minno.js
Hi Benedeck,

Regarding your randomization question, you got it almost right.
"seed" is sensitive to the order in which the stimuli appear.
"repeat"ed elements repeat the seeded element that appeared before them.

In your task, the repeated element (i.e. col1rightTop) appear before the seeding elements (i.e. col1Right) in the stimuli array.
Therefore, the stimulus is repeated in the next trial, instead of the current one.
Correct the order, and it should be fine.

best,
Elad

Mayan Navon

okunmadı,
5 Nis 2021 03:32:295.04.2021
alıcı Benedek Kurdi, Minno.js
Hi Benedek,

I'm not sure about your first question, but here is my solution to the other issues:
2. I'm not sure I understood which of the two counters you described isn't working. Anyway, you probably want to use a setter for the counters. For example: {type:'setGlobalAttr', setter:function(global){ global.current.col2Tracker+10;}}, and define this counter as current at the start of the script:
    var current = API.getCurrent();
    current. col2Tracker = 0;
Here is an example of a simple task that uses a setter.
3. The logging needs to occur after the keypress, so it can't be located in the same event where you set the input. Same for the removeInput action. You'd want to locate them in the conditions that occur upon keypress (e.g., conditions: [{type:'inputEquals',value:'col1I'}],). First remove the input, and then log the input.

--
You received this message because you are subscribed to the Google Groups "Minno.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minnojs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minnojs/CAPGF78E%2B2xx7wW2_oe2v4YVZiR93RZprbvANmeqM76XWQEg6Fw%40mail.gmail.com.


--
Mayan

Benedek Kurdi

okunmadı,
5 Nis 2021 10:58:225.04.2021
alıcı Mayan Navon, Minno.js
I'm not sure about your first question, but here is my solution to the other issues:
Is there someone else that we could ask? Maybe Elad?
 
2. I'm not sure I understood which of the two counters you described isn't working. Anyway, you probably want to use a setter for the counters. For example: {type:'setGlobalAttr', setter:function(global){ global.current.col2Tracker+10;}}, and define this counter as current at the start of the script:
    var current = API.getCurrent();
    current. col2Tracker = 0;
Here is an example of a simple task that uses a setter.
I must be doing something wrong, but the updating is still not working. And I'm getting a non-standard syntax error saying "Expected an assignment or function call and instead saw an expression." Not sure if the two are related.
 
3. The logging needs to occur after the keypress, so it can't be located in the same event where you set the input. Same for the removeInput action. You'd want to locate them in the conditions that occur upon keypress (e.g., conditions: [{type:'inputEquals',value:'col1I'}],). First remove the input, and then log the input.
This is working great now, thanks.
Thanks again!
—Benedek
--
Benedek Kurdi
411 Orange Street #4B
New Haven, CT 06511
game2.txt

Benedek Kurdi

okunmadı,
5 Nis 2021 11:07:265.04.2021
alıcı Minno.js

Thanks, Elad. I just saw your response. I fixed the order and it's working great now.

Mayan Navon

okunmadı,
6 Nis 2021 04:41:226.04.2021
alıcı Benedek Kurdi, Minno.js
2. I'm not sure I understood which of the two counters you described isn't working. Anyway, you probably want to use a setter for the counters. For example: {type:'setGlobalAttr', setter:function(global){ global.current.col2Tracker+10;}}, and define this counter as current at the start of the script:
    var current = API.getCurrent();
    current. col2Tracker = 0;
Here is an example of a simple task that uses a setter.
I must be doing something wrong, but the updating is still not working. And I'm getting a non-standard syntax error saying "Expected an assignment or function call and instead saw an expression." Not sure if the two are related.
 
Right, sorry for that. It should be:
{type:'setGlobalAttr', setter:function(global){global.current.col1Tracker+=10;}},
This worked in my tests, but let me know if you're still having issues...

Benedek Kurdi

okunmadı,
6 Nis 2021 17:12:396.04.2021
alıcı Mayan Navon, Minno.js

Yes, that took care of it! Thanks so much.
—Benedek
Tümünü yanıtla
Yazarı yanıtla
Yönlendir
0 yeni ileti