1. A method for compressing data comprising: receiving the data; repeatedly denoising the data using a denoiser to produce denoised data, each time selecting different denoising parameters wherein denoising parameters comprise symbol compositions of contexts within which symbols are evaluated by the denoiser; lengths of the contexts within which symbols are evaluated by the denoiser; values stored in a channel-transition matrix Π; and values stored in a distortion matrix Λ, until a distortion computed for the denoised data is lower than a threshold distortion; and compressing the denoised data to produce compressed data.