Brain Encoding and Decoding in fMRI with Bidirectional Deep Generative Models