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.

About the `Softmax` in the `CAM_Module`

See original GitHub issue

https://github.com/junfu1115/DANet/blob/799424e7fd9efa5723038ad0dc27c46682160e57/encoding/nn/attention.py#L75

image

Is your code trying to improve numerical stability? Maybe it should be in this form.

       energy_new = torch.max(energy, -1, keepdim=True)
       energy_new = energy_new[0].expand_as(energy)
       energy_new = energy - energy_new
       attention = self.softmax(energy_new)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
junfu1115commented, Apr 7, 2019

@lartpang Thanks, we have tried the form you provide, but the performance is not good

0reactions
junfu1115commented, Apr 8, 2019

@lartpang Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Softmax Function Definition | DeepAI
The softmax function is a function that turns a vector of K real values into a vector of K real values that sum...
Read more >
Softmax function - Wikipedia
The softmax function, also known as softargmax or normalized exponential function, converts a vector of K real numbers into a probability distribution of...
Read more >
A Simple Explanation of the Softmax Function - victorzhou.com
Softmax turns arbitrary real values into probabilities, which are often useful in Machine Learning. The math behind it is pretty simple: ...
Read more >
Softmax Activation Function with Python
Softmax is a mathematical function that converts a vector of numbers into a vector of probabilities, where the probabilities of each value ...
Read more >
Softmax Activation Function: Everything You Need to Know
The softmax activation function transforms the raw outputs of the neural network into a vector of probabilities, essentially a probability distribution over the ......
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