Reinforcement Learning: Multiple Unique Discrete Actions

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]

 Respuesta aceptada

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!

Más respuestas (0)

Categorías

Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.

Productos

Versión

R2020a

Preguntada:

el 27 de Jul. de 2020

Comentada:

el 7 de Sept. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by