ding.framework.middleware.learner¶
ding.framework.middleware.learner
¶
OffPolicyLearner
¶
Overview
The class of the off-policy learner, including data fetching and model training. Use the __call__ method to execute the whole learning process.
__init__(cfg, policy, buffer_, reward_model=None, log_freq=100)
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
- cfg (
|
obj: |
required | |
- policy (
|
obj: |
required | |
- buffer (
|
obj: |
required | |
- reward_model (
|
obj: |
required | |
- log_freq (
|
obj: |
required |
__call__(ctx)
¶
Output of ctx
- train_output (:obj:
Deque): The training output in deque.
HERLearner
¶
Overview
The class of the learner with the Hindsight Experience Replay (HER). Use the __call__ method to execute the data featching and training process.
__init__(cfg, policy, buffer_, her_reward_model)
¶
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
- cfg (
|
obj: |
required | |
- policy (
|
obj: |
required | |
- buffer\_ (
|
obj: |
required | |
- her_reward_model (
|
obj: |
required |
__call__(ctx)
¶
Output of ctx
- train_output (:obj:
Deque): The deque of training output.
Full Source Code
../ding/framework/middleware/learner.py