Transfer of learning in inference problems