Imported from https://github.com/human-aimachine-art/pytorch-STROTSS-improved