We again first address the problem of varying granularity in the
representations of the two networks. We compute an aggregated
scene-level representation \(\overline{h_j}\)  based on shots
\(h_i, \dots , h_{i+k}\)  via mean pooling and calculate the noise
contrastive estimation (NCE;
[1]}, [2]}) loss for the
\(j^\mathit {th}\)  scene:
\(\mathcal {R} = - \frac{1}{N} \sum _{j=1}^{N} \log \frac{e^{s(\overline{h_j}, s_{j})/\tau }}{e^{s(\overline{h_j},s_{j})/\tau } + \sum _{\begin{array}{c}k=1 \\ k\ne j\end{array}}^{N}e^{s(\overline{h_j},s_k)/\tau }} \) 
