Code Monkey home page Code Monkey logo

Comments (5)

bpopeters avatar bpopeters commented on August 20, 2024

Hi Saul,

Could you provide some code that causes this error? I haven't been able to reproduce it.

from entmax.

bpopeters avatar bpopeters commented on August 20, 2024

First couple of things I've noticed:

  1. The nans occur elsewhere if you change from float64 to float32.
  2. The bug does not only occur with budget==2. I can produce it for many inputs with budget==1.

from entmax.

ssantos97 avatar ssantos97 commented on August 20, 2024

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.

bpopeters avatar bpopeters commented on August 20, 2024

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)

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.