Mixed DataType in action space
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
For mixed type of Data in action space, which of them will be used rlFiniteSetSpec or rlNumericSpec. I have seen a query regarding the observation space, but does it holds for action space too?
채택된 답변
Shaik
2023년 5월 13일
0 개 추천
Hi,
The choice between rlFiniteSetSpec and rlNumericSpec for the action space depends on the nature of the action you want to define in your reinforcement learning (RL) environment.
- rlFiniteSetSpec: Use this specification when the action space consists of a discrete set of possible actions. Each action in the set can be represented by a unique value or identifier. For example, if your action space consists of a finite set of discrete actions, such as "move forward," "turn left," or "turn right," you can use rlFiniteSetSpec to define the action space.
- rlNumericSpec: Use this specification when the action space is continuous or can be represented by a range of numerical values. If your action space requires specifying a continuous value, such as controlling the speed or position of a robotic arm, you can use rlNumericSpec to define the action space.
When defining the action space in an RL environment, you need to choose the appropriate specification based on the characteristics of the actions you want to represent. You can have a mix of rlFiniteSetSpec and rlNumericSpec objects within the action space if your environment requires both discrete and continuous actions.
Regarding the link you provided, it refers to a query about the observation space, but the same concept applies to the action space as well. The rlFiniteSetSpec and rlNumericSpec objects can be used to define both observation and action spaces in an RL environment, depending on the type of data they represent.
In summary, consider the nature of your action space (discrete or continuous) and use either rlFiniteSetSpec or rlNumericSpec accordingly to define the appropriate specification for your action space in the RL environment.
댓글 수: 6
Sania Gul
2023년 5월 14일
Thankyou Shaik. I am working on "wareHouse Robot" given in MATLAB Reinforcement Learning on Ramp. There the actions i.e. The translational and Rotational forces applied on robot to avoid the obstacles are continuous. and these actions are then used to generate the continuous observations including 6 parameters" x', 'y', cos theta', 'sin theta', 'velocity' and 'omega' (angular velocity) as given in its Simulink model given in Figure below.
Now, I want the rotations (sin theta) and (cos theta) to be discrete only (1,0,-1), while others should be continuous, but if I make Rotational Force discrete, it would make the states 'x' and 'y' discrete too as they are generated by both Translational and Rotational Forces as shown in next Figure. What should I do?
Now, I want the rotations (sin theta) and (cos theta) to be discrete only (1,0,-1), while others should be continuous, but if I make Rotational Force discrete, it would make the states 'x' and 'y' discrete too as they are generated by both Translational and Rotational Forces as shown in next Figure. What should I do?
Shaik
2023년 5월 14일
If you want to keep the rotational forces discrete while keeping the states 'x' and 'y' continuous, one possibility is to modify the state representation. One approach could be to represent the angle θ as an integer value (e.g., in degrees or radians) rather than using sin(θ) and cos(θ).
Here's an example of how you could modify the state representation:
- Define a maximum and minimum angle, θ_max and θ_min, respectively, in degrees or radians, depending on your preference. For this example, let's assume that θ can vary between -180 and 180 degrees.
- Define the rotation angle, θ, as an integer value between θ_min and θ_max. You can use the 'discretize' function in MATLAB to obtain the corresponding integer value. For example:
theta_bins = linspace(-180, 180, num_bins); % divide the range [-180, 180] into num_bins equally spaced intervals
theta = discretize(atan2(sin_theta, cos_theta)*180/pi, theta_bins);
Here, num_bins is the number of intervals you want to divide the range into. The atan2 function is used to obtain the angle from sin_theta and cos_theta, and then this angle is converted to degrees using the *180/pi scaling factor.
- Update the state representation to use the new rotation angle θ instead of sin(θ) and cos(θ). You would need to modify the observation space to include the new state variables, and also the action space to properly map the discrete action space to the continuous control inputs.
You can experiment with different values of num_bins to see how it affects the discretization of the rotation angle. A larger value of num_bins will result in a finer discretization of the angle, at the cost of increased computational complexity and training time.
Sania Gul
2023년 5월 15일
Thank you sooo much. No words of gratitude are enough for this guidance. Stay happy. :-)
Shaik
2023년 5월 15일
If my answer is helpful, can you accept it please?
Sania Gul
2023년 5월 15일
I have already done it :-)
Shaik
2023년 5월 15일
Thanks Sania! :)
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Reinforcement Learning에 대해 자세히 알아보기
참고 항목
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
