99[ ![ Maintenance] ( https://img.shields.io/badge/Maintained%3F-yes-green.svg )] ( https://github.com/jrzaurin/pytorch-widedeep/graphs/commit-activity )
1010[ ![ contributions welcome] ( https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat )] ( https://github.com/jrzaurin/pytorch-widedeep/issues )
1111[ ![ codecov] ( https://codecov.io/gh/jrzaurin/pytorch-widedeep/branch/master/graph/badge.svg )] ( https://codecov.io/gh/jrzaurin/pytorch-widedeep )
12- [ ![ Python 3.6 3. 7 3.8 3.9] ( https://img.shields.io/badge/python-3.6%20%7C%203 .7%20%7C%203.8%20%7C%203.9-blue.svg )] ( https://www.python.org/ )
12+ [ ![ Python 3.7 3.8 3.9] ( https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9-blue.svg )] ( https://www.python.org/ )
1313
1414# pytorch-widedeep
1515
@@ -24,6 +24,13 @@ using wide and deep models.
2424
2525** Slack** : if you want to contribute or just want to chat with us, join [ slack] ( https://join.slack.com/t/pytorch-widedeep/shared_invite/zt-soss7stf-iXpVuLeKZz8lGTnxxtHtTw )
2626
27+ The content of this document is organized as follows:
28+
29+ 1 . [ introduction] ( #introduction )
30+ 2 . [ The deeptabular component] ( #the-deeptabular-component )
31+ 3 . [ installation] ( #installation )
32+ 4 . [ quick start (tl;dr)] ( #quick-start )
33+
2734### Introduction
2835
2936`` pytorch-widedeep `` is based on Google's [ Wide and Deep Algorithm] ( https://arxiv.org/abs/1606.07792 )
@@ -82,61 +89,58 @@ into:
8289 <img width =" 300 " src =" docs/figures/architecture_2_math.png " >
8390</p >
8491
92+ I recommend using the `` wide `` and `` deeptabular `` models in
93+ `` pytorch-widedeep `` . However it is very likely that users will want to use
94+ their own models for the `` deeptext `` and `` deepimage `` components. That is
95+ perfectly possible as long as the the custom models have an attribute called
96+ `` output_dim `` with the size of the last layer of activations, so that
97+ `` WideDeep `` can be constructed. Again, examples on how to use custom
98+ components can be found in the Examples folder. Just in case
99+ `` pytorch-widedeep `` includes standard text (stack of LSTMs) and image
100+ (pre-trained ResNets or stack of CNNs) models.
101+
102+ ### The `` deeptabular `` component
103+
85104It is important to emphasize that ** each individual component, ` wide ` ,
86105` deeptabular ` , ` deeptext ` and ` deepimage ` , can be used independently** and in
87106isolation. For example, one could use only ` wide ` , which is in simply a
88107linear model. In fact, one of the most interesting functionalities
89- in`` pytorch-widedeep `` is the `` deeptabular `` component. Currently,
90- `` pytorch-widedeep `` offers the following different models for that
91- component:
108+ in`` pytorch-widedeep `` would be the use of the `` deeptabular `` component on
109+ its own, i.e. what one might normally refer as Deep Learning for Tabular
110+ Data. Currently, `` pytorch-widedeep `` offers the following different models
111+ for that component:
92112
93- 1 . `` TabMlp `` : this is almost identical to the [ tabular
94- model] ( https://docs.fast.ai/tutorial.tabular.html ) in the fantastic
95- [ fastai] ( https://docs.fast.ai/ ) library, and consists simply in embeddings
96- representing the categorical features, concatenated with the continuous
97- features, and passed then through a MLP.
98113
99- 2 . `` TabRenset `` : This is similar to the previous model but the embeddings are
114+ 1 . ** TabMlp** : a simple MLP that receives embeddings representing the
115+ categorical features, concatenated with the continuous features.
116+ 2 . ** TabResnet** : similar to the previous model but the embeddings are
100117passed through a series of ResNet blocks built with dense layers.
101-
102- 3 . `` Tabnet `` : Details on TabNet can be found in:
118+ 3 . ** TabNet** : details on TabNet can be found in
103119[ TabNet: Attentive Interpretable Tabular Learning] ( https://arxiv.org/abs/1908.07442 )
104120
105- 4 . `` TabTransformer `` : Details on the TabTransformer can be found in:
106- [ TabTransformer: Tabular Data Modeling Using Contextual Embeddings] ( https://arxiv.org/pdf/2012.06678.pdf ) .
107- Note that the TabTransformer implementation available at `` pytorch-widedeep ``
108- is an adaptation of the original implementation.
121+ And the `` Tabformer `` family, i.e. Transformers for Tabular data:
109122
110- 5 . `` FT-Transformer `` : or Feature Tokenizer transformer. This is a relatively small
111- variation of the `` TabTransformer `` . The variation itself was first
112- introduced in the `` SAINT `` paper, but the name "`` FT-Transformer `` " was first
113- used in
123+ 4 . ** TabTransformer** : details on the TabTransformer can be found in
124+ [ TabTransformer: Tabular Data Modeling Using Contextual Embeddings] ( https://arxiv.org/pdf/2012.06678.pdf ) .
125+ 5 . ** SAINT** : Details on SAINT can be found in
126+ [ SAINT: Improved Neural Networks for Tabular Data via Row Attention and Contrastive Pre-Training] ( https://arxiv.org/abs/2106.01342 ) .
127+ 6 . ** FT-Transformer** : details on the FT-Transformer can be found in
114128[ Revisiting Deep Learning Models for Tabular Data] ( https://arxiv.org/abs/2106.11959 ) .
115- When using the `` FT-Transformer `` each continuous feature is "embedded"
116- (i.e. going through a 1-layer MLP with or without activation function) and
117- then passed through the attention blocks along with the categorical features.
118- This is available in `` pytorch-widedeep `` 's `` TabTransformer `` by setting the
119- parameter `` embed_continuous = True `` .
120-
129+ 7 . ** TabFastFormer ** : adaptation of the FastFormer for tabular data. Details
130+ on the Fasformer can be found in
131+ [ FastFormers: Highly Efficient Transformer Models for Natural Language Understanding ] ( https://arxiv.org/abs/2010.13382 )
132+ 8 . ** TabPerceiver ** : adaptation of the Perceiver for tabular data. Details on
133+ the Perceiver can be found in
134+ [ Perceiver: General Perception with Iterative Attention ] ( https://arxiv.org/abs/2103.03206 )
121135
122- 6 . `` SAINT `` : Details on SAINT can be found in:
123- [ SAINT: Improved Neural Networks for Tabular Data via Row Attention and Contrastive Pre-Training] ( https://arxiv.org/abs/2106.01342 ) .
136+ Note that while there are scientific publications for the TabTransformer,
137+ SAINT and FT-Transformer, the TabFasfFormer and TabPerceiver are our own
138+ adaptation of those algorithms for tabular data.
124139
125140For details on these models and their options please see the examples in the
126141Examples folder and the documentation.
127142
128- Finally, while I recommend using the `` wide `` and `` deeptabular `` models in
129- `` pytorch-widedeep `` it is very likely that users will want to use their own
130- models for the `` deeptext `` and `` deepimage `` components. That is perfectly
131- possible as long as the the custom models have an attribute called
132- `` output_dim `` with the size of the last layer of activations, so that
133- `` WideDeep `` can be constructed. Again, examples on how to use custom
134- components can be found in the Examples folder. Just in case
135- `` pytorch-widedeep `` includes standard text (stack of LSTMs) and image
136- (pre-trained ResNets or stack of CNNs) models.
137-
138-
139- ### Installation
143+ ### Installation
140144
141145Install using pip:
142146
@@ -167,8 +171,8 @@ when running on Mac, present in previous versions, persist on this release
167171and the data-loaders will not run in parallel. In addition, since `python
1681723.8` , [the ` multiprocessing` library start method changed from ` 'fork'` to ` 'spawn'`] ( https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods ) .
169173This also affects the data-loaders (for any ` torch ` version) and they will
170- not run in parallel. Therefore, for Mac users I recommend using `python
171- 3.6 ` or ` 3.7 ` and ` torch <= 1.6` (with the corresponding, consistent
174+ not run in parallel. Therefore, for Mac users I recommend using ` python 3.7 `
175+ and ` torch <= 1.6 ` (with the corresponding, consistent
172176version of ` torchvision ` , e.g. ` 0.7.0 ` for ` torch 1.6 ` ). I do not want to
173177force this versioning in the ` setup.py ` file since I expect that all these
174178issues are fixed in the future. Therefore, after installing
0 commit comments