learned weights and bias, and $v \in R^{L}$ is the input row vector. We choose an average (instead of, e.g., sum) to ease generalization to different numbers of elements in the sets, as otherwise the overall magnitude of $Qvec$ would vary depending on the number of elements in the set $V_i$.

### Third Stage, from $(Qvec1,Qvec2)$ to $Q1 \subset_{\%} Q2$

Given the representative vectors of the input queries,\
$(Qvec1,Qvec2)$, we aim to predict the containment rate $Q1 \subset_{\%} Q2$ as accurately as possible. Since we do not know what a “natural” distance measure is in the representative queries vector space, encoded by the neural networks of the second step, we use a fully-connected two-layer neural network, denoted as $MLP_{out}$, to compute the estimated containment rate of the input queries, leaving it up to this neural network to learn the correct distance function. $MLP_{out}$ takes as input a vector of size $4H$ which is constructed from $Qvec1$ and $Qvec2$. The first layer converts the input vector into a vector of size $2H$. The second layer converts the obtained vector of size $2H$, into a single value representing the containment rate. $$\hat{y} = MLP_{out}(Expand(Qvec1,Qvec2))$$ $$MLP_{out}(v) = Sigmoid(ReLU(vU_{out1} + b_{out1})U_{out2} + b_{out2})$$ $$Expand(v_1,v_2) 