I’m trying to utilize the LBFGS optimizer (knowing that it should converge based off a literature example), however my model converges to simply the average of my target values. Am I doing something wrong here?
    for epoch in range(num_epochs):
        MSE=0.0
        for data_sample in dataloader:
            input_data=data_sample[0]
            target=data_sample[1]
            batch_size=len(target)

            input_data=input_data.to(device)
            target=target.to(device)

            def closure():
                optimizer.zero_grad()
                output=model(input_data)
                loss=criterion(output,target)
                loss.backward()
                return loss

            loss=optimizer.step(closure)
            MSE+=loss.item()*batch_size

        MSE=MSE/dataset_size
        RMSE=np.sqrt(MSE)
        epoch_loss=RMSE
        print epoch_loss