For every transition classes repeat:
1. sample random pixel from input-output-factor rasters; get the neighbours of the pixel;
2. check if all neighbors and inpit/output pixels are not Null.
3. if all neighbor pixels are not Null, create input sample and add it to sample table
4. repeat 1-3 until desired number of samples is not created.
So if a pixel of the transition class is located near raster boundaries, then at least one neighbor of the selected pixel lies outside => the pixel can't be used in sample => the pixel is skipped.
The problem appears when ALL pixels of a transition class lie near boundaries. In this case we get infinite loop.
Stratified sampling uses the next procedure:
(see https://github.com/nextgis/molusce/blob/master/algorithms/models/sampler/sampler.py#L326-L334)
So if a pixel of the transition class is located near raster boundaries, then at least one neighbor of the selected pixel lies outside => the pixel can't be used in sample => the pixel is skipped.
The problem appears when ALL pixels of a transition class lie near boundaries. In this case we get infinite loop.