Reinforcement Learning: Multiple Unique Discrete Actions

6 ビュー (過去 30 日間)
Huzaifah Shamim
Huzaifah Shamim 2020 年 7 月 27 日
コメント済み: Huzaifah Shamim 2020 年 9 月 7 日
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]

採用された回答

Uday Pradhan
Uday Pradhan 2020 年 9 月 7 日
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!

その他の回答 (0 件)

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by