Negative loss (gradient ascent toward high-reward actions)
Element-wise multiply log_probs and advantages
Average across batch
Hints
Hint 1: REINFORCE
Loss = -E[log π(a|s) * G_t]
Hint 2: Baseline
Advantage A = G_t - V(s) reduces variance
Hint 3: Gradient direction
Higher advantage → increase log prob of that action
Keywords
rlpolicy-gradientactorneural-networks
Python
Run your code to see results
No results yet
Run your code to check it against the examples, or submit to run every test.