Reinforcement Learning: Multiple Unique Discrete Actions
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
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개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!