Message Boards Message Boards

0
|
1213 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Custom percentile LossFunction?

Posted 1 year ago

Hi,

I want to use a custom LossFunction (in particular, a loss function that calculates the q'th percentile of the absolute differences), but I cannot figure out how to do this from the documentation. Through some educated guessing I found out that:

LossFunction->ThreadingLayer[(#1 - #2)^2 &, InputPorts -> {"Input", "Target"}]

gives the same result as the MeanSquaredLossLayer, but when I try:

LossFunction->ThreadingLayer[Quantile[Abs[(#1 - #2)] , 0.2]& , InputPorts -> {"Input", "Target"}]

I am getting the error:

ThreadingLayer::invscf: Quantile[Abs[#1-#2],0.2]& 

could not be symbolically evaluated as a n-ary scalar function.

So it seems that ThreadingLayer expects an n-ary scalar function, but how can I turn the result of Quantile into an n-ary scalar function?

Thanks, GW

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract