past.Utils.Ripplewalk_sampler¶
- past.Utils.Ripplewalk_sampler(graph, r=0.5, batchsize=6400, total_times=10)¶
Training stategy of subgraph segmentation based on random walk, enabling mini-batch training on large datasets
- Parameters:
graph – graph indicating connectivity between spots, usually K-NN graph constructed from spatial coordinates
r – expansion ratio for sampling subgraph
batchsize – number of samples for a mini-batch
total_times – decide the number of subgraph to sample, number of subgraph = total_times * dataset_size / batchsize
- Returns:
a list containing index of sampled sub-graphs
- Return type:
list