  W-graph refers to a general class of random graph models that can be seen as
a random graph limit. It is characterized by both its graphon function and its
motif frequencies. In this paper, relying on an existing variational Bayes
algorithm for the stochastic block models along with the corresponding weights
for model averaging, we derive an estimate of the graphon function as an
average of stochastic block models with increasing number of blocks. In the
same framework, we derive the variational posterior frequency of any motif. A
simulation study and an illustration on a social network complete our work.
