Comments (10)
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.
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.
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.
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.
Thank you, @Optimox . The PR 217 seems what I look for. 👍
from tabnet.
After sparsemax, only 1% feature is nonzeros, is it normal?
from tabnet.
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.
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.
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.
@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)
- Wrapper for GridSearchCV with RuntimeError: "Cannot clone object..." for embeddings HOT 3
- Count the number of parameters HOT 2
- Loss goes to -inf HOT 1
- The mask tensor M in script tab_network.py needs to be transformed to realize the objective stated in the paper: "γ is a relaxation parameter – when γ = 1, a feature is enforced to be used only at one decision step".
- Current version on conda-forge is 4.0 while 4.1 is already released HOT 8
- Minimal working example for TabNetRegressor/Classifier HOT 4
- Transfer learning, capability to change structure of model HOT 1
- Generate Embeddings for Tabular Data HOT 1
- TabNet overfits (help wanted, not a bug) HOT 9
- TabNetRegressor vs other networks HOT 1
- spike in memory when training ends HOT 8
- Severe overfitting HOT 18
- OOM problem when I search hyperparameters with Tabnet HOT 3
- Support for complex-valued datasets HOT 4
- Different classification variables in the test set and train set HOT 1
- Struggling to get model to fit - Help Wanted HOT 7
- Optimizing TabNet for Disease Classification with Continuous Audio Features HOT 1
- Interpreting Sparsity on Global Importance HOT 5
- ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() HOT 1
- Validation loss HOT 1
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 tabnet.