Giter VIP home page Giter VIP logo

Comments (10)

Optimox avatar Optimox commented on July 26, 2024 1

Hello @joseluismoreira,

There are two PR on this topic already:

  • a very old one from me that was definitely not ideal : #92
  • a more recent one and more promising one : #217

I guess the sparsity is not very important since you will only break the sparsity for embeddings from the same feature, so in the end you'll still be looking at only a few original features.

from tabnet.

Optimox avatar Optimox commented on July 26, 2024 1

The model learns to use its attention layer. For each row, the model decides what column should be masked or not.
During inference, the model decides on its own where to put its attention, nothing is hard coded here and every test row gets a different attention mask. You can use the explain method to see where the model has been looking for every row at every step.

from tabnet.

joseluismoreira avatar joseluismoreira commented on July 26, 2024

Great issue! Reading the paper and the both original implementation and this one I made the same question about the embeddings from the same columns be used together. Have you benchmarked that already, somehow?

from tabnet.

joseluismoreira avatar joseluismoreira commented on July 26, 2024

I guess if we take the mean or the max we will lose the sparcity property... I am not sure, but maybe we can torch.stack the features instead of torch.cat them, and apply the sparse max in this new dimension. I would like to test this idea and maybe we can evaluate together the approachs.

from tabnet.

joseluismoreira avatar joseluismoreira commented on July 26, 2024

Thank you, @Optimox . The PR 217 seems what I look for. 👍

from tabnet.

W-void avatar W-void commented on July 26, 2024

After sparsemax, only 1% feature is nonzeros, is it normal?

from tabnet.

Optimox avatar Optimox commented on July 26, 2024

hello @W-void,

The goal of sparsemax activation is to get a sparse mask, with a lot of 0 values. So yes it is expected.

However if you think the masks are too sparse you can play with different parameters:

  • switch from sparsemax to entmax (not sure this will have a big impact)
  • set lambda_sparse to 0 to reduce the penalization on sparsity
  • add more steps and set a larger value of gamma to be sure that the features used by each step are different (in the end the algorithm will use more features)

Let me know if this helped.

from tabnet.

W-void avatar W-void commented on July 26, 2024

hello @W-void,

The goal of sparsemax activation is to get a sparse mask, with a lot of 0 values. So yes it is expected.

However if you think the masks are too sparse you can play with different parameters:

  • switch from sparsemax to entmax (not sure this will have a big impact)
  • set lambda_sparse to 0 to reduce the penalization on sparsity
  • add more steps and set a larger value of gamma to be sure that the features used by each step are different (in the end the algorithm will use more features)

Let me know if this helped.

@Optimox ,thx!I have set lambda_sparse to 0,It has little improvement. I will switch from sparsemax to entmax as you said.
I'm still confused. If only 2 or 3 features are used, the following FeatTransformer will get little information. I don't think it's a good result.

from tabnet.

SeohuiPark avatar SeohuiPark commented on July 26, 2024

I have a question about mask and "explain" method.

I checked on Tabmodel.py that there is an "explain" method of the model. I wonder how different masks are printed for each instance of the test data because the "explain" method does not train the model.

Do we use the mask that has been learned until the last epoch of the training data in each row of the test data?

from tabnet.

Optimox avatar Optimox commented on July 26, 2024

@athewsey this has been around for way too long. I have been thinking of a more general way to deal with this and I created a PR here : #443

I'd be happy to have your thoughts on this!

from tabnet.

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.