added downsampling to BatchTransform.