Here is the forward
method for TabularModel
:
We won’t show __init__
here, since it’s not that interesting, but we will look at each line of code in forward
in turn. The first line:
and concatenates them into a single tensor:
Then dropout is applied. You can pass embd_p
to __init__
to change this value:
They are passed through a batchnorm layer:
and concatenated with the embedding activations, if there were any:
x = torch.cat([x, x_cont], 1) if self.n_emb != 0 else x_cont
Congratulations! Now you know every single piece of the architectures used in the fastai library!