ShangtongZhang / DeepRL

Modularized Implementation of Deep RL Algorithms in PyTorch
MIT License
3.21k stars 684 forks source link

How to implement eval_step() in BaseAgent() #64

Closed forhonourlx closed 4 years ago

forhonourlx commented 5 years ago

Hi Shangtong,

I wonder how to write a eval_step()?

class BaseAgent:
    def eval_step(self, state):
        raise NotImplementedError

For example in CategoricalActorCriticNet(), how to eval the model and get a certain action?

        if action is None:
            action = dist.sample()
        log_prob = dist.log_prob(action).unsqueeze(-1)
        entropy = dist.entropy().unsqueeze(-1)

Thanks in advance.

ShangtongZhang commented 4 years ago

Sorry I cannot help issues like this.