Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dichen9412 opened this issue Apr 23, 2021 · 0 comments
Open

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

dichen9412 opened this issue Apr 23, 2021 · 0 comments

Comments

@dichen9412
Copy link

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant