nntoolbox.tabular.components.components module

class nntoolbox.tabular.components.components.CrossLayer(n_hidden, bias=True, return_first=False)[source]

Bases: torch.nn.modules.module.Module

Implement a (residual) crossing layer for Deep and Cross Net (DCN):

x_{l+1} = x_0 x^T_l w + b + x_l

Based on: https://arxiv.org/pdf/1708.05123.pdf

forward(inputs)[source]
Parameters

inputs – a tuple: first element is the orinal features, second element is the output of last layer

Returns

reset_parameters()[source]

Reset the parameters of the model

training: bool