Additional loss / regularization term based on distance in classification of ordinal classes with neural networks Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) 2019 Moderator Election Q&A - Questionnaire 2019 Community Moderator Election ResultsNeural networks: which cost function to use?Is cross-entropy a good cost function if I'm interested in the probabilities of a sample belonging to a certain class?Cost function for Ordinal Regression using neural networksFractions or probabilities as training labelsTheoretical and practical comparison of CTC and seq2seq loss in TensorflowNeural Networks - Strategies for problems with high Bayes error rateHow to use a cross entropy loss function for each letter/digit in a captcha?Dealing with extreme values in softmax cross entropy?What loss function avoids overconfidence?Loss Function for Probability Regression
Can this water damage be explained by lack of gutters and grading issues?
Suing a Police Officer Instead of the Police Department
Who's this lady in the war room?
"Destructive force" carried by a B-52?
How was Lagrange appointed professor of mathematics so early?
Output the slug and name of a CPT single post taxonomy term
What were wait-states, and why was it only an issue for PCs?
Kepler's 3rd law: ratios don't fit data
When does Bran Stark remember Jamie pushing him?
What is the definining line between a helicopter and a drone a person can ride in?
Marquee sign letters
How is an IPA symbol that lacks a name (e.g. ɲ) called?
Why aren't road bike wheels tiny?
Knights and Knaves question
2 sample t test for sample sizes - 30,000 and 150,000
Is it OK if I do not take the receipt in Germany?
A journey... into the MIND
Is "ein Herz wie das meine" an antiquated or colloquial use of the possesive pronoun?
Proving inequality for positive definite matrix
Is Vivien of the Wilds + Wilderness Reclamation a competitive combo?
Who can become a wight?
Why not use the yoke to control yaw, as well as pitch and roll?
Pointing to problems without suggesting solutions
Does Prince Arnaud cause someone holding the Princess to lose?
Additional loss / regularization term based on distance in classification of ordinal classes with neural networks
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
2019 Moderator Election Q&A - Questionnaire
2019 Community Moderator Election ResultsNeural networks: which cost function to use?Is cross-entropy a good cost function if I'm interested in the probabilities of a sample belonging to a certain class?Cost function for Ordinal Regression using neural networksFractions or probabilities as training labelsTheoretical and practical comparison of CTC and seq2seq loss in TensorflowNeural Networks - Strategies for problems with high Bayes error rateHow to use a cross entropy loss function for each letter/digit in a captcha?Dealing with extreme values in softmax cross entropy?What loss function avoids overconfidence?Loss Function for Probability Regression
$begingroup$
Sometimes when doing classification with neural networks, there is no ordinal relationship between the target classes. However, if there is, using cross-entropy loss for training, is there a way to add an extra regularization term or loss term that is based on the distance between the predicted class and target class? The goal is of course to give the model the intuition that it is worse to predict class 0 for target 25 than to predict class 24. I was also thinking along the lines of using mean squared error instead of cross-entropy as a loss function but maybe that's unusual for neural networks? Any thoughts or experiences regarding this?
neural-network classification loss-function regularization
$endgroup$
add a comment |
$begingroup$
Sometimes when doing classification with neural networks, there is no ordinal relationship between the target classes. However, if there is, using cross-entropy loss for training, is there a way to add an extra regularization term or loss term that is based on the distance between the predicted class and target class? The goal is of course to give the model the intuition that it is worse to predict class 0 for target 25 than to predict class 24. I was also thinking along the lines of using mean squared error instead of cross-entropy as a loss function but maybe that's unusual for neural networks? Any thoughts or experiences regarding this?
neural-network classification loss-function regularization
$endgroup$
$begingroup$
How about treating it as a regression problem, if there is a clear mapping from the classes to scalar values? if your categories are like age ranges "18-24", "25-40", etc, then treat these as a scalar that's the midpoint of the range.
$endgroup$
– Sean Owen
Apr 4 at 19:37
$begingroup$
Makes sense but would that imply changing the architecture altogether, turning the problem into a regression problem instead of a classification problem? I think the problem might be that I have 96 classes and scaling them to be in [0, 1] would give a very dense population in that small interval... I feel like such a model wouldn't be successful in predicting the exact right value very often even though it would be successful in the way that it would often be in the vicinity of the right value... but maybe I am mistaken, I have done much more classification than regression.
$endgroup$
– fast-reflexes
Apr 6 at 11:20
add a comment |
$begingroup$
Sometimes when doing classification with neural networks, there is no ordinal relationship between the target classes. However, if there is, using cross-entropy loss for training, is there a way to add an extra regularization term or loss term that is based on the distance between the predicted class and target class? The goal is of course to give the model the intuition that it is worse to predict class 0 for target 25 than to predict class 24. I was also thinking along the lines of using mean squared error instead of cross-entropy as a loss function but maybe that's unusual for neural networks? Any thoughts or experiences regarding this?
neural-network classification loss-function regularization
$endgroup$
Sometimes when doing classification with neural networks, there is no ordinal relationship between the target classes. However, if there is, using cross-entropy loss for training, is there a way to add an extra regularization term or loss term that is based on the distance between the predicted class and target class? The goal is of course to give the model the intuition that it is worse to predict class 0 for target 25 than to predict class 24. I was also thinking along the lines of using mean squared error instead of cross-entropy as a loss function but maybe that's unusual for neural networks? Any thoughts or experiences regarding this?
neural-network classification loss-function regularization
neural-network classification loss-function regularization
asked Apr 4 at 18:16
fast-reflexesfast-reflexes
1011
1011
$begingroup$
How about treating it as a regression problem, if there is a clear mapping from the classes to scalar values? if your categories are like age ranges "18-24", "25-40", etc, then treat these as a scalar that's the midpoint of the range.
$endgroup$
– Sean Owen
Apr 4 at 19:37
$begingroup$
Makes sense but would that imply changing the architecture altogether, turning the problem into a regression problem instead of a classification problem? I think the problem might be that I have 96 classes and scaling them to be in [0, 1] would give a very dense population in that small interval... I feel like such a model wouldn't be successful in predicting the exact right value very often even though it would be successful in the way that it would often be in the vicinity of the right value... but maybe I am mistaken, I have done much more classification than regression.
$endgroup$
– fast-reflexes
Apr 6 at 11:20
add a comment |
$begingroup$
How about treating it as a regression problem, if there is a clear mapping from the classes to scalar values? if your categories are like age ranges "18-24", "25-40", etc, then treat these as a scalar that's the midpoint of the range.
$endgroup$
– Sean Owen
Apr 4 at 19:37
$begingroup$
Makes sense but would that imply changing the architecture altogether, turning the problem into a regression problem instead of a classification problem? I think the problem might be that I have 96 classes and scaling them to be in [0, 1] would give a very dense population in that small interval... I feel like such a model wouldn't be successful in predicting the exact right value very often even though it would be successful in the way that it would often be in the vicinity of the right value... but maybe I am mistaken, I have done much more classification than regression.
$endgroup$
– fast-reflexes
Apr 6 at 11:20
$begingroup$
How about treating it as a regression problem, if there is a clear mapping from the classes to scalar values? if your categories are like age ranges "18-24", "25-40", etc, then treat these as a scalar that's the midpoint of the range.
$endgroup$
– Sean Owen
Apr 4 at 19:37
$begingroup$
How about treating it as a regression problem, if there is a clear mapping from the classes to scalar values? if your categories are like age ranges "18-24", "25-40", etc, then treat these as a scalar that's the midpoint of the range.
$endgroup$
– Sean Owen
Apr 4 at 19:37
$begingroup$
Makes sense but would that imply changing the architecture altogether, turning the problem into a regression problem instead of a classification problem? I think the problem might be that I have 96 classes and scaling them to be in [0, 1] would give a very dense population in that small interval... I feel like such a model wouldn't be successful in predicting the exact right value very often even though it would be successful in the way that it would often be in the vicinity of the right value... but maybe I am mistaken, I have done much more classification than regression.
$endgroup$
– fast-reflexes
Apr 6 at 11:20
$begingroup$
Makes sense but would that imply changing the architecture altogether, turning the problem into a regression problem instead of a classification problem? I think the problem might be that I have 96 classes and scaling them to be in [0, 1] would give a very dense population in that small interval... I feel like such a model wouldn't be successful in predicting the exact right value very often even though it would be successful in the way that it would often be in the vicinity of the right value... but maybe I am mistaken, I have done much more classification than regression.
$endgroup$
– fast-reflexes
Apr 6 at 11:20
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "557"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48626%2fadditional-loss-regularization-term-based-on-distance-in-classification-of-ord%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Data Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48626%2fadditional-loss-regularization-term-based-on-distance-in-classification-of-ord%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
How about treating it as a regression problem, if there is a clear mapping from the classes to scalar values? if your categories are like age ranges "18-24", "25-40", etc, then treat these as a scalar that's the midpoint of the range.
$endgroup$
– Sean Owen
Apr 4 at 19:37
$begingroup$
Makes sense but would that imply changing the architecture altogether, turning the problem into a regression problem instead of a classification problem? I think the problem might be that I have 96 classes and scaling them to be in [0, 1] would give a very dense population in that small interval... I feel like such a model wouldn't be successful in predicting the exact right value very often even though it would be successful in the way that it would often be in the vicinity of the right value... but maybe I am mistaken, I have done much more classification than regression.
$endgroup$
– fast-reflexes
Apr 6 at 11:20