I would like to perform a Quantile Regression within Mathematica's neural network framework.
Since there exist a couple of tutorials for this exact problem in Tensorflow, i.e. Deep Quantile Regression, I know this can be done by defining the right loss function for this particular problem, i.e.
$$\rho_\tau(u)= \max[ u\tau, u(\tau-1)].$$
Then a specific quantile $\tau$ can be found by minimizing the expected loss of $y-f(X)$ with respect to $f(X)$, where $f(X)$ is the predicted (quantile) model and $y$ is the observed value for the corresponding input $X$.
My question then, is it possible to define a custom loss function for NetTrain[], and if so, how can this be done?
An example of the data can be loaded by,
data = Flatten[Uncompress[Import["https://pastebin.com/raw/G2kdCu4i"]]]
Note that in this particular setting the observed values are 3-tuples.
Disclaimer, this is my first time using Mathematica's neural network framework.
LossFunction
. It can be a little limited however. It might be helpful if you give some example of the output data and the target data. $\endgroup$ – Carl Lange Oct 12 '18 at 12:41LossFunction
but it only used built-in layers which threw me off. I also added an example of my data. $\endgroup$ – user19218 Oct 12 '18 at 13:14QuantileLossLayer
answers your question - you could post it as an answer and close the question! $\endgroup$ – Carl Lange Oct 12 '18 at 18:08