improved auto-encoder test script