Open hkristof03 opened 1 year ago
The example you wrote out looks correct - what do you think is missing?
@maciejkula Thanks for your response.
I checked the documentation of the Cross layer now:
def call(self, x0: tf.Tensor, x: Optional[tf.Tensor] = None) -> tf.Tensor:
"""Computes the feature cross.
Args:
x0: The input tensor
x: Optional second input tensor. If provided, the layer will compute
crosses between x0 and x; if not provided, the layer will compute
crosses between x0 and itself.
Returns:
Tensor of crosses.
"""
From this it is obvious what happens when only one parameter is passed. The question's objective was to validate if I correctly implemented the stacking of the Cross layers.
@hkristof03, Your implementation of the Cross block is correct.
The output of layer x_(l+1)
of a Cross stack is the output of the previous layer, x_l
, crossed with x_0
.
In the DCN tutorial, there is no layer stacking, which means we simply cross x_0
with itself. This is why the layer can be called with a single argument. In the stacked case you need to do as you have done.
From the DCN Paper
I would like to ask for some help regarding stacked Cross layers.
From this tutorial, the calling of a simple DCN layer looks like this:
From the documentation of the DCN Cross layer:
I really don't get how it is possible to properly call the Cross layer first with one variable then with two. The second looks more reasonable for me according to the DCN paper and the tutorial.
What I would like to do is to stack multiple Cross layers and properly feed them with the data from the embedding layers.