Skip to content

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

@dichen9412

Description

@dichen9412

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions