I’m working on a Variation AutoEncoder example and I have a simple question that is mainly about PyTorch.
Let’s suppose that we use binary cross entropy (torch.nn.BCELoss()) as the reconstruction loss; that is, we apply BCELoss on the reconstructed images (output of decoder) and target images (original images).
However, original images are the input of the encoder, and, thus, they are naturally defined as torch.autograd.Variable. On the other hand, the reconstructed images are torch.Tensor. Applying BCELoss on them makes PyCharm complain about the types of inputs (BCELoss is expected to take two tensors, not one tensor and one Variable).
I’m just wondering whether this might cause any problems. Should I give BCELoss its targets (i.e., original images) as non-Variable tensors, or is it ok to keep it as is?