Demo codes for evolution gradient:
https://github.com/szhaovas/blog-ytb/blob/master/NES/eg_demo.py
Demo codes for natural gradient:
https://github.com/szhaovas/blog-ytb/blob/master/NES/ng_demo.py
Check out my evolution gradient video (3:00~9:36) if you are interested in how the gradients are derived:
https://youtu.be/3yqVGWLXhk8?t=180