Open gpolov-personal opened 4 years ago
Unfortunately, only L1 and L2 loss are supported by DeepNumpy(MXNet numpy ndarray) currently. It's actually pretty easy to fix, but I am not sure if the patch will become part of MXNet 1.6.
Maybe @haojin2 could provide you more information.
Hi @xidulu ,
Thank you very much, it seems that the course d2l.ai is based on the previous interface and they have not change this part. So, not even the 'SoftmaxCrossEntropyLoss or 'SigmoidBCELoss' would work? I would add this ones first, I think they much more used than the Huber loss.
Hi @GPoloVera
It would be great if you could contribute DeepNumpy-compatible version of these Loss function to MXNet, but I just wanna inform you that it's vert likely you contributions will only be accessible through either build from source
or the nightly build
version.
Hi @xidulu,
I would love to do that but I would need some help because I am not familiarise enough with the code. You said it is already done with the L1 and L2 losses but not with the rest isn't it? Maybe trying to replicate the things done on this two and port to the rest is enough or there would be more challenging things?
@GPoloVera Yep, you simply need to replicate the modification done to the L1 and L2 to make other loss functions compatible with DeepNumpy API.
You could refer to this PR: https://github.com/apache/incubator-mxnet/commit/65928b1936d5d43f237b0f9f9e43115861faf4c0#diff-8b9ba6d32a6b2369b6ffde76f0986d1f
p.s. You could just a leave a comment under this thread if you meet any problems during your development.
Description
Using the HuberLoss() (with or without parameters) from the module loss raise a TypeError: exception with the message using it in a simple regression computation where for example L2Loss or L1Loss raise no exception or problem
Error Message
Stack Trace:
Traceback (most recent call last)
To Reproduce
In d2l-course chapter 3.3 is a question of substituting the L2Loss by the HuberLoss. Doing this cause the problem but it also fails with a simple code like this:
Steps to reproduce
What have you tried to solve it?
Environment
We recommend using our script for collecting the diagnositc information. Run the following command and paste the outputs below: