  The $f$-invariant is an isomorphism invariant of free-group
measure-preserving actions introduced by Lewis Bowen in [arXiv:0802.4294],
where it was used to show that two finite-entropy Bernoulli shifts over a
finitely generated free group can be isomorphic only if their base measures
have the same Shannon entropy. In [arXiv:0902.0174] Bowen showed that the
$f$-invariant is a variant of sofic entropy; in particular it is the
exponential growth rate of the expected number of good models over a uniform
random homomorphism.
  In this paper we present an analogous formula for the relative $f$-invariant
and use it to prove a formula for the exponential growth rate of the expected
number of good models over a random sofic approximation which is a type of
stochastic block model.
