added method to sample a dataset from a network or InferenceEngine