  Many popular models from the networks literature can be viewed through a
common lens. We describe it here and call the class of models log-linear ERGMs.
It includes degree-based models, stochastic blockmodels, and combinations of
these. Given the interest in combined node and block effects in network
formation mechanisms, we introduce a general directed relative of the
degree-corrected stochastic blockmodel: an exponential family model we call
$p_1$-SBM. It is a generalization of several well-known variants of the
blockmodel.
  We study the problem of testing model fit for the log-linear ERGM class.
  The model fitting approach we take, through the use of quick estimation
algorithms borrowed from the contingency table literature and effective
sampling methods rooted in graph theory and algebraic statistics, results in an
exact test whose $p$-value can be approximated efficiently in networks of
moderate sizes.
  We showcase the performance of the method on two data sets from biology: the
connectome of \emph{C. elegans} and the interactome of \emph{Arabidopsis
thaliana}. These two networks, a neuronal network and a protein-protein
interaction network, have been popular examples in the network science
literature, but a model-based approach to studying them has been missing thus
far.
