question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

alpha in Log space.

See original GitHub issue

Hi. I’m just wondering why alpha get updated in ‘log’ space rather than in its own value. Was doing that stable for entire training? Or any other reason?

# In https://github.com/medipixel/rl_algorithms/blob/master/algorithms/sac/agent.py

 # train alpha
        if self.hyper_params["AUTO_ENTROPY_TUNING"]:
            alpha_loss = (
                -self.log_alpha * (log_prob + self.target_entropy).detach()
            ).mean()

            self.alpha_optimizer.zero_grad()
            alpha_loss.backward()
            self.alpha_optimizer.step()

            alpha = self.log_alpha.exp()
        else:
            alpha_loss = torch.zeros(1)
            alpha = self.hyper_params["W_ENTROPY"]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
Curt-Parkcommented, Jul 21, 2019

That’s because alpha should be greater than or equal to zero due to the dual problem’s constraint. see (13).

1reaction
Junyoungparkcommented, Jul 22, 2019

Sure. Thanks again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

numpy.logspace — NumPy v1.24 Manual
numpy.logspace# ... Return numbers spaced evenly on a log scale. In linear space, the sequence starts at base ** start (base to the...
Read more >
numpy.logspace() in Python - GeeksforGeeks
The numpy.logspace() function returns number spaces evenly w.r.t interval on a log scale. Syntax : numpy.logspace(start, stop, num = 50, ...
Read more >
Why do we search for RidgeCV alphas on a logarithmic scale?
Everybody says you should provide a logarithmically scaled range of values for RidgeCV to search over in estimating the optimal alpha value ...
Read more >
Logarithmic scale - Wikipedia
A logarithmic scale (or log scale) is a way of displaying numerical data over a very wide ... solar system and distance to...
Read more >
Alpha Selection — Yellowbrick v1.5 documentation
... import AlphaSelection # Load the regression dataset X, y = load_concrete() # Create a list of alphas to cross-validate against alphas =...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found