def make_samplers(distances, sampler_factory):
    """Construct samplers for each informative subset of the summary statistic.

    Parameters
    ----------
    distances : dict
      A dictionary with discrepancy nodes corresponding to each subset of the summary statistic.
    sampler_factory
      A function which takes a discrepancy node as an argument
      and returns an ELFI ABC sampler (e.g. elfi.Rejection).

    Returns
    -------
    samplers : dict
      A mapping from the marginals of the parameter to the corresponding sampler.
    """
    return {k: sampler_factory(dist) for (k, dist) in distances.items()}