Sure the loss is L1Loss and optimizer is Adam and here are the training and  validation
def test(loss):
    network.eval()
    test_loss = 0
    correct = 0
    with torch.no_grad():
        val = network(torch.Tensor(wordvec_val).cuda())
        loss_value = loss(val, torch.Tensor(test_labels).long().cuda())
        print(loss_value.item())
        val = val.cpu().detach().numpy()
        print(" ")
        print("Validation MAE : scikit-learn ",mean_absolute_error(val,test_labels))
        print(" ")
        test_val.append(mean_absolute_error(val,test_labels))
def train(epoch,loss):
  network.train()
  for batch_idx, (data, target) in enumerate(train_loader):
        
    optimizer.zero_grad()
    
    output = network(data.cuda())
    
    loss_value = loss(output, target.long().cuda())
    
    loss_value.backward(retain_graph=True)
    
    plot_grad_flow(network.named_parameters())
    
    optimizer.step()
    
    if batch_idx % log_interval == 0:
      print('Train Epoch: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}'.format(
        epoch, batch_idx * len(data), len(train_loader.dataset),
        100. * batch_idx / len(train_loader), loss_value.item()))