Thanks a lot, It would be much better if you copy/paste all of those codes here as well. its kind of hard to be redirected to another website.
Anyway I have some questions as well.
Why cant we simply do :
self.decoder[0].weight = self.encoder[0].weight.t()
and instead we must do :
self.decoder[0].weight.data = self.encoder[0].weight.data.transpose(0,1)
doesn’t data only copy the raw values from the source to the destination (i.e encoder to decoder)?
so basically this would be two different weights that happen to have the same initial values! and in backprop they just get tuned independently. (please see the images below)
my second question is, why cant we use .t() instead of transpose(0,1) aren’t they interchangeable?
Also I noticed, simply doing :
weights = nn.Parameter(torch.randn_like(self.encoder[0].weight))
self.encoder[0].weight.data = weights.clone()
self.decoder[0].weight.data = self.encoder[0].weight.data.transpose(0, 1)

results in different weight visualization. when I tried to visualize both weights, they look just different!

trained_encoder_w.jpg752×768 192 KB
 
trained_decoder_w.png752×768 289 KB

Update:
After transposing the decoders weight and visualizing it, it turns out, they are identical ( decoders weight visualization is a bit washed out though, but they are indeed look alike)