e2e-model-learning icon indicating copy to clipboard operation
e2e-model-learning copied to clipboard

The NLL loss function in the newsvendor task is wrongly used.

Open dichen9412 opened this issue 4 years ago • 0 comments

The NLL loss function in the newsvendor task is wrongly used. NLLLoss() (in PyTorch) expects a log-probability as input. But your code sends the raw probability into it. So it is actually minimizing -sum pi. instead of minimizing - sum log(pi). Though this weird loss can still kind of maximize the likelihood, it is different from your description. This happens in your task_net and mle_net.

Another bug: your main.py for "# Nonlinear MLE net" actually is doing linear MLE net. You need to send the parameter "is_nonlinear=True".

dichen9412 avatar Apr 23 '21 19:04 dichen9412