r/reinforcementlearning • • 1d ago

Sample

Hi everyone

I am new to reinforcement learning and i have question about policy-based algorithm like PPO. in this algorithm do we sample from distribution function when we want to select action in both training and test phases?or just in training and argmax use in testing? I think sampling or argmax is two different way to select action in reinforcement learning and it is not mandatory to use specific way in training and test

2 Upvotes

3 comments sorted by

1

u/Low_Willingness_308 1d ago

Hi, the true answer is that it kind of depends. Often times people use the argmax during evaluation, but in certain environments this can lead to problems (e.g. robotics). See https://thesai.org/Publications/ViewPaper?Volume=16&Issue=10&Code=IJACSA&SerialNo=99 for a good reference.

1

u/FlakyVocalist_0151 1d ago

You’ll see both approaches in the wild. Sampling during eval can help if the environment is stochastic or if deterministic actions make you predictable in a multi-agent setting. If you’re just running a standard benchmark though, argmax is usually the default for measuring final performance.

1

u/Low_Willingness_308 1d ago

Environmental stochasticity is neither necessary nor sufficient to justify stochastic action selection during evaluation. Even in deterministic single-agent environments, taking the argmax of a learned stochastic policy can substantially degrade performance. Sutton & Barto’s short corridor example (Section 13.1) is a good illustration of this.