Reinforcement Learning: Multiple Unique Discrete Actions
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Huzaifah Shamim
am 27 Jul. 2020
Kommentiert: Huzaifah Shamim
am 7 Sep. 2020
THis question has been answered before here, but I wanted to make a variation of this. Lets say we wanted to make the following modification. Once one action value has been selected, the second possible action value can not be the same. So if we had:
a = [1,2,3,4,5,6,7,8,9, 10];
b = [1,2,3,4,5,6,7,8,9, 10];
[A,B] = meshgrid(a,b);
actions = reshape(cat(2,A',B'),[],2);
actionInfo = num2cell(actions,2);
I basically want to get rid of the cell arrays that have the same values such as [1,1], [2,2], [3,3].....[10,10]. Is there an easy way to do this?
Clarification: But I do want to have values such as [1,2] and [2,1]
0 Kommentare
Akzeptierte Antwort
Uday Pradhan
am 7 Sep. 2020
Hi Huzaifa,
According to my understanding, you would like to remove the action pairs which have the same values like [1 1],[2 2],...[10 10]. To do this, you can create a separate action matrix which do not have such arrays at all (10 in total to be excluded).
newActions = actions(actions(:,1)~=actions(:,2),:);
actionInfo = num2cell(newActions,2);
This will give you a cell array which do not contain pairs of type [x x]. Hope this helps!
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!