Hi
Thank you for your reply.
My codes are not really something important 
Below you could be able to see them all:
//////////////////////////////////////////////////////////////////////////////////
#Autoencoder and Autodecoder conv layer…
class Autoencoder(nn.Module):
def init(self):
super(Autoencoder,self).init()
    self.encoder = nn.Sequential(
        nn.Conv1d(1,5,kernel_size=5, stride=2),
        nn.ReLU(True),
        nn.Conv1d(5,10,kernel_size=5, stride = 2),
        nn.ReLU(True),
        nn.Conv1d(10,20,kernel_size=5, stride = 2),
        nn.ReLU(True))
    self.decoder = nn.Sequential(          
        nn.ConvTranspose1d(20,10,kernel_size=5, stride = 2),
        nn.ReLU(True),
        nn.ConvTranspose1d(10,5,kernel_size=5, stride = 2),
        nn.ReLU(True),
        nn.ConvTranspose1d(5,1,kernel_size=5, stride = 2),
        nn.Sigmoid())

def forward(self,x):
x = self.encoder(x)
x = self.decoder(x)
return x
//////////////////////////////////////////////////////////////////
num_epochs = 32
batch_size = 2048
learning_rate = 1e-3
////////////////////////////////////////////////////////////
model = Autoencoder().cpu()
criterion = nn.MSELoss()
optimizer = torch.optim.Adam(model.parameters(), lr=learning_rate,
weight_decay=1e-5)
dataloader = DataLoader(data_pixel2, batch_size=batch_size, shuffle=True)
///////////////////////////////////////////////////////////////////////////////
#training loop
​
​
for epoch in range(num_epochs):
for data in dataloader:
img = data
    # ===================forward=====================
    output = model(img)
    print("out", output.size())
    print("img", img.size())
    loss = criterion(output, img)
    # ===================backward====================
    optimizer.zero_grad()
    loss.backward()
    optimizer.step()
# ===================log========================
print('epoch [{}/{}], loss:{:.4f}'
      .format(epoch+1, num_epochs, loss.data[0]))
if epoch % 10 == 0:
    pic = to_img(output.cpu().data)
    save_image(pic, './dc_img/image_{}.png'.format(epoch))

///////////////////////////////////////////////
Regards,