Comments (5)
Hi Saul,
Could you provide some code that causes this error? I haven't been able to reproduce it.
from entmax.
First couple of things I've noticed:
- The nans occur elsewhere if you change from float64 to float32.
- The bug does not only occur with budget==2. I can produce it for many inputs with budget==1.
from entmax.
Here is some code:
x = torch.tensor([[[-0.0743, -0.0903]], [[-0.0453, -0.0387]], [[-0.0187, -0.0100]], [[-0.0060, 0.0101]], [[-0.0660, -0.1066]], [[-0.0289, -0.0087]], [[-0.0226, -0.0159]], [[-0.0548, -0.0428]], [[-0.0940, -0.0746]], [[-0.0654, -0.0479]], [[-0.0747, -0.0418]], [[-0.0741, -0.0367]]], requires_grad=True)
check = gradcheck(budget_bisect, (x, 2, -1), eps=1e-5)
from entmax.
Backward also fails if dim == len(x.shape)
. I believe this problems may be related to the gradient issues.
(it's also something we should have already been checking for, but test_arbitrary_dimension_grad
only includes entmax_bisect)
from entmax.
Related Issues (20)
- Usage of alpha HOT 3
- Unexpected behaviour of sparsemax gradients for 3d tensors HOT 8
- entmax implementation for Tesnoflow 2 HOT 1
- Replicating the behaviour from the paper HOT 1
- entmax_bisect leads to loss becoming nan HOT 16
- Problem with sparse activations HOT 9
- Entmax fails when all inputs are -inf HOT 1
- Alpha value less than one? HOT 8
- Index -1 is out of bounds HOT 1
- A bug when alpha = 1 for entmax_bisect? HOT 3
- `entmax_bisect` is not stable around `alpha=1` HOT 3
- Release patch 1.0.1 with torch install_requires fix HOT 5
- Code to reproduce figure 3 HOT 1
- alpha-entmax
- Errors when using the loss function HOT 9
- entmax_bisect bugs with fp16/bf16 HOT 1
- Instability of entmax bisect around 0? HOT 1
- EntmaxBisect forward requires unused argument HOT 2
- Sparse losses return nan when there is -inf in the input HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from entmax.