Giter VIP home page Giter VIP logo

Comments (2)

vvivek921 avatar vvivek921 commented on August 17, 2024

@kengz @lgraesser

from slm-lab.

kengz avatar kengz commented on August 17, 2024

Hi @vvivek921, glad that you're enjoying the book! This is definitely the right place to ask, and it would also help other readers/users who might have the same question.

For your question, loss could start out being underestimated, hence the low initial value, since it depends on the initial values of the policy network which yields log_probs. If the network is still learning, the loss will keep changing as a result of minimizing and correcting (so it may increase if it's initial value was underestimated), as well as because of the changing returns, until it eventually converges to a relatively stable final value.

This is also an interesting observation: in deep RL, the loss curve isn't always reliable for reasons like this, and it is partly why debugging can be tricky! Granted, losses in RL is quite different than losses in supervised learning.

If you look at the loss graph (inside the ./data/{your_experiment_folder}/graph/ folder), you would see graph that is quite noisy, like the one below (which has a different scale because it's using a different advantage baseline). It is especially harder to tell also because the environment is so simple and can be solved in such a short timescale.

reinforce_cartpole_t0_s1_session_graph_train_loss_vs_frame

For a harder environment which requires a longer time scale to solve, such as an Atari game, we can more clearly observe the more pronounced changes (decreasing) of the loss over a much longer time, like the one below (PPO on Atari Pong, max total reward = 21) shown with its return graph. Note that even here it still increases slightly toward the end.

Hope this helps!

ppo_pong_t0_s0_session_graph_eval_loss_vs_frame
ppo_pong_t0_s0_session_graph_eval_mean_returns_ma_vs_frames

from slm-lab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.