이 번역 페이지는 최신 내용을 담고 있지 않습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
rlRepresentationOptions
rlRepresentationOptions
는 권장되지 않습니다. 대신 agent options 객체 내에서 rlOptimizerOptions
객체를 사용하십시오. 자세한 내용은 rlRepresentationOptions는 권장되지 않습니다. 항목을 참조하십시오.
설명
rlRepresentationOptions
객체를 사용하여 크리틱(rlValueRepresentation
, rlQValueRepresentation
)과 액터(rlDeterministicActorRepresentation
, rlStochasticActorRepresentation
)에 대한 옵션 세트를 지정합니다.
생성
속성
LearnRate
— 표현에 대한 학습률
0.01
(디폴트 값) | 양의 스칼라
표현에 대한 학습률로, 양의 스칼라로 지정됩니다. 학습률이 너무 낮으면 훈련 시간이 오래 걸립니다. 학습률이 너무 높으면 훈련이 최적의 결과보다 못한 값에 도달하거나 발산할 수 있습니다.
예: 'LearnRate',0.025
Optimizer
— 표현에 대한 최적화 함수
"adam"
(디폴트 값) | "sgdm"
| "rmsprop"
표현의 신경망을 훈련시키는 최적화 함수로, 다음 중 하나로 지정됩니다.
"adam"
— Adam 최적화 함수를 사용합니다.OptimizerParameters
옵션의GradientDecayFactor
필드와SquaredGradientDecayFactor
필드를 사용하여 기울기 이동평균의 감쇠율과 제곱 기울기 이동평균의 감쇠율을 지정할 수 있습니다."sgdm"
— SGDM(Stochastic Gradient Descent with Momentum: 모멘텀을 사용한 확률적 경사하강법) 최적화 함수를 사용합니다.OptimizerParameters
옵션의Momentum
필드를 사용하여 모멘텀 값을 지정할 수 있습니다."rmsprop"
— RMSProp 최적화 함수를 사용합니다.OptimizerParameters
옵션의SquaredGradientDecayFactor
필드를 사용하여 제곱 기울기 이동평균의 감쇠율을 지정할 수 있습니다.
이러한 최적화 함수에 대한 자세한 내용은 Deep Learning Toolbox™에서 trainingOptions
의 알고리즘 섹션에 있는 확률적 경사하강법 항목을 참조하십시오.
예: 'Optimizer',"sgdm"
OptimizerParameters
— 최적화 함수에 적용 가능한 파라미터
OptimizerParameters
객체
최적화 함수에 적용 가능한 파라미터로, 다음 파라미터를 갖는 OptimizerParameters
객체로 지정됩니다.
파라미터 | 설명 |
---|---|
Momentum | 이전 스텝의 기여로, 0과 1 사이의 스칼라로 지정됩니다. 값이 0이면 이전 스텝의 기여가 없음을 의미합니다. 값이 1이면 최대 기여를 의미합니다. 이 파라미터는 |
Epsilon | 분모 오프셋으로, 양의 스칼라로 지정됩니다. 최적화 함수는 0으로 나누기를 방지하기 위해 신경망 파라미터 업데이트에서 분모에 이 오프셋을 더합니다. 이 파라미터는 |
GradientDecayFactor | 기울기 이동평균의 감쇠율로, 0과 1 사이의 양의 스칼라로 지정됩니다. 이 파라미터는 |
SquaredGradientDecayFactor | 제곱 기울기 이동평균의 감쇠율로, 0과 1 사이의 양의 스칼라로 지정됩니다. 이 파라미터는 |
OptimizerParameters
의 특정 속성이 Optimizer
옵션에 지정된 최적화 함수 유형에 적용되지 않는 경우, 해당 속성은 "Not applicable"
로 설정됩니다.
디폴트 값을 변경하려면 rlRepresentationOptions
세트를 만들고 점 표기법으로 OptimizerParameters
의 속성에 액세스하여 값을 변경하십시오.
repOpts = rlRepresentationOptions; repOpts.OptimizerParameters.GradientDecayFactor = 0.95;
GradientThreshold
— 기울기의 임계값
Inf
(디폴트 값) | 양의 스칼라
표현 기울기의 임계값으로, Inf
또는 양의 스칼라로 지정됩니다. 기울기가 이 값을 초과하면 기울기는 GradientThresholdMethod
옵션에서 지정한 대로 잘립니다. 기울기 자르기를 사용하면 훈련 반복에서 신경망 파라미터가 변경되는 정도가 제한됩니다.
예: 'GradientThreshold',1
GradientThresholdMethod
— 기울기 임계값 결정 방법
"l2norm"
(디폴트 값) | "global-l2norm"
| "absolute-value"
기울기 임계값을 초과하는 기울기 값을 자를 때 사용할 기울기 임계값 메서드로, 다음 중 하나로 지정됩니다.
"l2norm"
— 학습 가능한 파라미터의 기울기의 L2 노름이GradientThreshold
보다 큰 경우, L2 노름이GradientThreshold
와 같아지도록 기울기를 스케일링합니다."global-l2norm"
— 전역 L2 노름 L이GradientThreshold
보다 큰 경우, 모든 기울기를GradientThreshold/
L배만큼 스케일링합니다. 전역 L2 노름은 모든 학습 가능한 파라미터를 고려합니다."absolute-value"
— 학습 가능한 파라미터의 기울기의 개별 편도함수의 절댓값이GradientThreshold
보다 큰 경우,GradientThreshold
와 같아지도록 편도함수를 스케일링하고 편도함수의 부호를 그대로 유지합니다.
자세한 내용은 Deep Learning Toolbox에서 trainingOptions
의 알고리즘 섹션에 있는 기울기 제한 항목을 참조하십시오.
예: 'GradientThresholdMethod',"absolute-value"
L2RegularizationFactor
— L2 정규화 인자
0.0001 (디폴트 값) | 음이 아닌 스칼라
L2 정규화 함수(가중치 감쇠)의 인자로, 음이 아닌 스칼라로 지정됩니다. 자세한 내용은 Deep Learning Toolbox에서 trainingOptions
의 알고리즘 섹션에 있는 L2 정규화 항목을 참조하십시오.
파라미터가 많이 있는 표현을 사용할 때 과적합을 방지하려면 L2RegularizationFactor
옵션을 늘리는 것을 고려하십시오.
예: 'L2RegularizationFactor',0.0005
UseDevice
— 훈련을 위한 계산 장치
"cpu"
(디폴트 값) | "gpu"
기울기 계산, 파라미터 업데이트, 훈련 중 예측하기와 같이 심층 신경망 연산을 수행하는 데 사용하는 계산 장치입니다. "cpu"
또는 "gpu"
로 지정됩니다.
"gpu"
옵션을 사용하려면 Parallel Computing Toolbox™와 CUDA®를 지원하는 NVIDIA® GPU가 둘 다 필요합니다. 지원되는 GPU에 대한 자세한 내용은 GPU 연산 요구 사항 (Parallel Computing Toolbox) 항목을 참조하십시오.
gpuDevice
(Parallel Computing Toolbox)를 사용하여 MATLAB®에서 사용할 로컬 GPU 장치를 쿼리하거나 선택할 수 있습니다.
참고
GPU에서 에이전트를 훈련시키거나 시뮬레이션하면 해당 장치 고유의 수치적 반올림 오차가 발생합니다. 이러한 오차로 인해 동일한 연산을 CPU에서 수행한 것과 다른 결과가 산출될 수 있습니다.
병렬 처리를 사용하여 훈련 속도를 높이고 싶다면 UseDevice
를 설정할 필요가 없습니다. 그 대신, 에이전트 훈련 시 UseParallel
옵션이 true
로 설정된 rlTrainingOptions
객체를 사용합니다. 멀티코어 프로세서와 GPU를 사용하여 훈련하는 방법에 대한 자세한 내용은 Train Agents Using Parallel Computing and GPUs 항목을 참조하십시오.
예: 'UseDevice',"gpu"
객체 함수
rlValueRepresentation | (Not recommended) Value function critic representation for reinforcement learning agents |
rlQValueRepresentation | (Not recommended) Q-Value function critic representation for reinforcement learning agents |
rlDeterministicActorRepresentation | (Not recommended) Deterministic actor representation for reinforcement learning agents |
rlStochasticActorRepresentation | (Not recommended) Stochastic actor representation for reinforcement learning agents |
예제
표현을 만들 때 사용할 옵션 구성하기
강화 학습 에이전트의 크리틱 또는 액터 표현을 만들 때 사용할 옵션 세트를 만듭니다. 표현의 학습률을 0.05로 설정하고 기울기 임계값을 1로 설정합니다. 옵션 세트를 만들 때 이름-값 쌍을 사용하여 옵션을 설정할 수 있습니다. 사용자가 명시적으로 설정하지 않은 옵션은 디폴트 값을 갖습니다.
repOpts = rlRepresentationOptions('LearnRate',5e-2,... 'GradientThreshold',1)
repOpts = rlRepresentationOptions with properties: LearnRate: 0.0500 GradientThreshold: 1 GradientThresholdMethod: "l2norm" L2RegularizationFactor: 1.0000e-04 UseDevice: "cpu" Optimizer: "adam" OptimizerParameters: [1x1 rl.option.OptimizerParameters]
또는, 디폴트 옵션 세트를 만들고 점 표기법을 사용하여 일부 값을 변경합니다.
repOpts = rlRepresentationOptions; repOpts.LearnRate = 5e-2; repOpts.GradientThreshold = 1
repOpts = rlRepresentationOptions with properties: LearnRate: 0.0500 GradientThreshold: 1 GradientThresholdMethod: "l2norm" L2RegularizationFactor: 1.0000e-04 UseDevice: "cpu" Optimizer: "adam" OptimizerParameters: [1x1 rl.option.OptimizerParameters]
OptimizerParameters
옵션의 속성을 변경하려면 점 표기법을 사용하여 해당 속성에 액세스합니다.
repOpts.OptimizerParameters.Epsilon = 1e-7; repOpts.OptimizerParameters
ans = OptimizerParameters with properties: Momentum: "Not applicable" Epsilon: 1.0000e-07 GradientDecayFactor: 0.9000 SquaredGradientDecayFactor: 0.9990
버전 내역
R2019a에 개발됨R2022a: rlRepresentationOptions
는 권장되지 않습니다.
rlRepresentationOptions
객체는 더 이상 권장되지 않습니다. 액터와 크리틱에 대한 최적화 옵션을 지정하려면 rlOptimizerOptions
객체를 대신 사용하십시오.
특히, agent options 객체를 만들고 이 객체의 CriticOptimizerOptions
및 ActorOptimizerOptions
속성을 적절한 rlOptimizerOptions
객체로 설정할 수 있습니다. 그러면 해당 에이전트를 생성하는 함수에 이 agent options 객체를 전달할 수 있습니다. 다음 표에 이 워크플로가 나와 있습니다.
rlRepresentationOptions : 권장되지 않음 | rlOptimizerOptions : 권장 |
---|---|
crtOpts = rlRepresentationOptions(... 'GradientThreshold',1); critic = rlValueRepresentation(... net,obsInfo,'Observation',{'obs'},ctrOpts) | criticOpts = rlOptimizerOptions(... 'GradientThreshold',1); agentOpts = rlACAgentOptions(... 'CriticOptimizerOptions',crtOpts); agent = rlACAgent(actor,critic,agentOpts) |
또는 에이전트를 만든 다음, 점 표기법을 사용하여 에이전트 액터와 크리틱에 대한 최적화 옵션에 액세스할 수 있습니다(예: agent.AgentOptions.ActorOptimizerOptions.GradientThreshold = 1;
).
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)