I am trying to reproduce the Credit Card Fraud Detection using autoencoders done in this git repo (https://github.com/curiousily/Credit-Card-Fraud-Detection-using-Autoencoders-in-Keras 8) and my network looks like :
class Autoencoder(nn.Module):
def init(self):
super(Autoencoder, self).init()
self.encoder = nn.Sequential(
nn.Linear(29, 14),
nn.Tanh(),
nn.Linear(14, 7),
nn.ReLU())
    self.decoder = nn.Sequential(
        nn.Linear(7, 14),
        nn.Tanh(),
        nn.Linear(14, 29),
        nn.ReLU())

def forward(self, x):
    x = self.encoder(x)
    x = self.decoder(x)
    return x

My training loop looks like
for epoch in range(num_epochs):
for data in train_loader:
#print(type(data))
#data = Variable(data).cpu()
#print(type(data))
# ===================forward=====================
output = model(data)
loss = criterion(output, data)
    # ===================backward====================
    optimizer.zero_grad()
    loss.backward()
    optimizer.step()
# ===================log========================
print('epoch [{}/{}], loss:{:.4f}'
      .format(epoch + 1, num_epochs, loss.item()))
history['train_loss'].append(loss.item())

torch.save(model.state_dict(), ‘./credit_card_model.pth’)
Yet my training loss behaviour is completely different to what has been achieved using Keras. In my case it looks like model is not learning at all, whereas in case of Keras, there is a smooth degradation of training loss. Can somebody have a look at what I am doing wrong. All other steps like data prep, preprocessing etc are exactly same.
Thx
Vimal