normalization of probabilities in predicting a poly-neuron output in neural nets
$begingroup$
When predicting a poly-neuron output in neural nets, say, predicting multiple handwritten digits and giving an output neuron vector (0.1,...,0.9,0.1,...), many use sth like softmax (or sth like the energy dependent probability exponential formula in statistical mechanics) to normalize the output vector such that all the components of the output vector sum up to 1, and that the normalized output vector becomes a probability vector. I doubt the necessity of this normalization, for without which I can equally well predict as per the biggest vector component. Is there anything I overlooked?
neural-network normalization
$endgroup$
add a comment |
$begingroup$
When predicting a poly-neuron output in neural nets, say, predicting multiple handwritten digits and giving an output neuron vector (0.1,...,0.9,0.1,...), many use sth like softmax (or sth like the energy dependent probability exponential formula in statistical mechanics) to normalize the output vector such that all the components of the output vector sum up to 1, and that the normalized output vector becomes a probability vector. I doubt the necessity of this normalization, for without which I can equally well predict as per the biggest vector component. Is there anything I overlooked?
neural-network normalization
$endgroup$
add a comment |
$begingroup$
When predicting a poly-neuron output in neural nets, say, predicting multiple handwritten digits and giving an output neuron vector (0.1,...,0.9,0.1,...), many use sth like softmax (or sth like the energy dependent probability exponential formula in statistical mechanics) to normalize the output vector such that all the components of the output vector sum up to 1, and that the normalized output vector becomes a probability vector. I doubt the necessity of this normalization, for without which I can equally well predict as per the biggest vector component. Is there anything I overlooked?
neural-network normalization
$endgroup$
When predicting a poly-neuron output in neural nets, say, predicting multiple handwritten digits and giving an output neuron vector (0.1,...,0.9,0.1,...), many use sth like softmax (or sth like the energy dependent probability exponential formula in statistical mechanics) to normalize the output vector such that all the components of the output vector sum up to 1, and that the normalized output vector becomes a probability vector. I doubt the necessity of this normalization, for without which I can equally well predict as per the biggest vector component. Is there anything I overlooked?
neural-network normalization
neural-network normalization
asked Nov 9 '18 at 10:21
feynmanfeynman
1578
1578
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
You are correct, but this is not called normalization. You can simply use the highest probability output for category. This is what softmax does for you. For example 2 output neurons can have 0.1 for dog and 0.9 for cat as the loss. Softmax will it just convert it to [0,1] meaning no dog but a cat is on the image.
$endgroup$
$begingroup$
What I mean by normalization is that softmax makes the components of the probability vector sum up to 1, which I don't deem a must. That's clear, I won't use softmax for this sheer aesthetic piece of pleasure.
$endgroup$
– feynman
Nov 11 '18 at 9:23
$begingroup$
You can do that as well. But if your loss is for example categorical_crossentropy then a softmax is needed because crossentropy requires a one-hot output.
$endgroup$
– Manngo
Nov 11 '18 at 19:59
$begingroup$
@ Manngo Sorry I don't get what you mean by categorical. If I have several digits to recognize, is that what you mean?
$endgroup$
– feynman
Nov 12 '18 at 11:11
$begingroup$
categorical_crossentropy loss requites data encoded as on-hot method as categories like [0,0,0,0,1,0,0,0]. This is what softmax does.
$endgroup$
– Manngo
Nov 13 '18 at 10:23
add a comment |
$begingroup$
Yes, you have overlooked something. Let me explain this with an example:
When training a neural network, you use the loss function as a signal to backpropagation. Now let us say that you have a network which outputs three categories: Cat, Dog, and Toad. Let's say the prediction of the network in an iteration is [0.7, 0.6, 0.3], although the data is, in fact, an image of a dog, meaning the truth is: [0 1 0].
Without a softmax layer, you cannot really tell much the network got the prediction wrong. In this example you might think the difference is 0.7 - 0.6 = 0.1, however after running a softmax, you realize that it is in fact 0.03, since the network was very strong in differentiating between the Toad category vs. Dog and Cat, so the loss is not as big as it seems.
Now as an experiment, run a neural network without the softmax layer and see for yourself, how severe it can affect the training. Not only that, but normalization of the input batches also makes a huge difference in training a network.
New contributor
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
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%2f40955%2fnormalization-of-probabilities-in-predicting-a-poly-neuron-output-in-neural-nets%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You are correct, but this is not called normalization. You can simply use the highest probability output for category. This is what softmax does for you. For example 2 output neurons can have 0.1 for dog and 0.9 for cat as the loss. Softmax will it just convert it to [0,1] meaning no dog but a cat is on the image.
$endgroup$
$begingroup$
What I mean by normalization is that softmax makes the components of the probability vector sum up to 1, which I don't deem a must. That's clear, I won't use softmax for this sheer aesthetic piece of pleasure.
$endgroup$
– feynman
Nov 11 '18 at 9:23
$begingroup$
You can do that as well. But if your loss is for example categorical_crossentropy then a softmax is needed because crossentropy requires a one-hot output.
$endgroup$
– Manngo
Nov 11 '18 at 19:59
$begingroup$
@ Manngo Sorry I don't get what you mean by categorical. If I have several digits to recognize, is that what you mean?
$endgroup$
– feynman
Nov 12 '18 at 11:11
$begingroup$
categorical_crossentropy loss requites data encoded as on-hot method as categories like [0,0,0,0,1,0,0,0]. This is what softmax does.
$endgroup$
– Manngo
Nov 13 '18 at 10:23
add a comment |
$begingroup$
You are correct, but this is not called normalization. You can simply use the highest probability output for category. This is what softmax does for you. For example 2 output neurons can have 0.1 for dog and 0.9 for cat as the loss. Softmax will it just convert it to [0,1] meaning no dog but a cat is on the image.
$endgroup$
$begingroup$
What I mean by normalization is that softmax makes the components of the probability vector sum up to 1, which I don't deem a must. That's clear, I won't use softmax for this sheer aesthetic piece of pleasure.
$endgroup$
– feynman
Nov 11 '18 at 9:23
$begingroup$
You can do that as well. But if your loss is for example categorical_crossentropy then a softmax is needed because crossentropy requires a one-hot output.
$endgroup$
– Manngo
Nov 11 '18 at 19:59
$begingroup$
@ Manngo Sorry I don't get what you mean by categorical. If I have several digits to recognize, is that what you mean?
$endgroup$
– feynman
Nov 12 '18 at 11:11
$begingroup$
categorical_crossentropy loss requites data encoded as on-hot method as categories like [0,0,0,0,1,0,0,0]. This is what softmax does.
$endgroup$
– Manngo
Nov 13 '18 at 10:23
add a comment |
$begingroup$
You are correct, but this is not called normalization. You can simply use the highest probability output for category. This is what softmax does for you. For example 2 output neurons can have 0.1 for dog and 0.9 for cat as the loss. Softmax will it just convert it to [0,1] meaning no dog but a cat is on the image.
$endgroup$
You are correct, but this is not called normalization. You can simply use the highest probability output for category. This is what softmax does for you. For example 2 output neurons can have 0.1 for dog and 0.9 for cat as the loss. Softmax will it just convert it to [0,1] meaning no dog but a cat is on the image.
answered Nov 10 '18 at 22:02
ManngoManngo
1734
1734
$begingroup$
What I mean by normalization is that softmax makes the components of the probability vector sum up to 1, which I don't deem a must. That's clear, I won't use softmax for this sheer aesthetic piece of pleasure.
$endgroup$
– feynman
Nov 11 '18 at 9:23
$begingroup$
You can do that as well. But if your loss is for example categorical_crossentropy then a softmax is needed because crossentropy requires a one-hot output.
$endgroup$
– Manngo
Nov 11 '18 at 19:59
$begingroup$
@ Manngo Sorry I don't get what you mean by categorical. If I have several digits to recognize, is that what you mean?
$endgroup$
– feynman
Nov 12 '18 at 11:11
$begingroup$
categorical_crossentropy loss requites data encoded as on-hot method as categories like [0,0,0,0,1,0,0,0]. This is what softmax does.
$endgroup$
– Manngo
Nov 13 '18 at 10:23
add a comment |
$begingroup$
What I mean by normalization is that softmax makes the components of the probability vector sum up to 1, which I don't deem a must. That's clear, I won't use softmax for this sheer aesthetic piece of pleasure.
$endgroup$
– feynman
Nov 11 '18 at 9:23
$begingroup$
You can do that as well. But if your loss is for example categorical_crossentropy then a softmax is needed because crossentropy requires a one-hot output.
$endgroup$
– Manngo
Nov 11 '18 at 19:59
$begingroup$
@ Manngo Sorry I don't get what you mean by categorical. If I have several digits to recognize, is that what you mean?
$endgroup$
– feynman
Nov 12 '18 at 11:11
$begingroup$
categorical_crossentropy loss requites data encoded as on-hot method as categories like [0,0,0,0,1,0,0,0]. This is what softmax does.
$endgroup$
– Manngo
Nov 13 '18 at 10:23
$begingroup$
What I mean by normalization is that softmax makes the components of the probability vector sum up to 1, which I don't deem a must. That's clear, I won't use softmax for this sheer aesthetic piece of pleasure.
$endgroup$
– feynman
Nov 11 '18 at 9:23
$begingroup$
What I mean by normalization is that softmax makes the components of the probability vector sum up to 1, which I don't deem a must. That's clear, I won't use softmax for this sheer aesthetic piece of pleasure.
$endgroup$
– feynman
Nov 11 '18 at 9:23
$begingroup$
You can do that as well. But if your loss is for example categorical_crossentropy then a softmax is needed because crossentropy requires a one-hot output.
$endgroup$
– Manngo
Nov 11 '18 at 19:59
$begingroup$
You can do that as well. But if your loss is for example categorical_crossentropy then a softmax is needed because crossentropy requires a one-hot output.
$endgroup$
– Manngo
Nov 11 '18 at 19:59
$begingroup$
@ Manngo Sorry I don't get what you mean by categorical. If I have several digits to recognize, is that what you mean?
$endgroup$
– feynman
Nov 12 '18 at 11:11
$begingroup$
@ Manngo Sorry I don't get what you mean by categorical. If I have several digits to recognize, is that what you mean?
$endgroup$
– feynman
Nov 12 '18 at 11:11
$begingroup$
categorical_crossentropy loss requites data encoded as on-hot method as categories like [0,0,0,0,1,0,0,0]. This is what softmax does.
$endgroup$
– Manngo
Nov 13 '18 at 10:23
$begingroup$
categorical_crossentropy loss requites data encoded as on-hot method as categories like [0,0,0,0,1,0,0,0]. This is what softmax does.
$endgroup$
– Manngo
Nov 13 '18 at 10:23
add a comment |
$begingroup$
Yes, you have overlooked something. Let me explain this with an example:
When training a neural network, you use the loss function as a signal to backpropagation. Now let us say that you have a network which outputs three categories: Cat, Dog, and Toad. Let's say the prediction of the network in an iteration is [0.7, 0.6, 0.3], although the data is, in fact, an image of a dog, meaning the truth is: [0 1 0].
Without a softmax layer, you cannot really tell much the network got the prediction wrong. In this example you might think the difference is 0.7 - 0.6 = 0.1, however after running a softmax, you realize that it is in fact 0.03, since the network was very strong in differentiating between the Toad category vs. Dog and Cat, so the loss is not as big as it seems.
Now as an experiment, run a neural network without the softmax layer and see for yourself, how severe it can affect the training. Not only that, but normalization of the input batches also makes a huge difference in training a network.
New contributor
$endgroup$
add a comment |
$begingroup$
Yes, you have overlooked something. Let me explain this with an example:
When training a neural network, you use the loss function as a signal to backpropagation. Now let us say that you have a network which outputs three categories: Cat, Dog, and Toad. Let's say the prediction of the network in an iteration is [0.7, 0.6, 0.3], although the data is, in fact, an image of a dog, meaning the truth is: [0 1 0].
Without a softmax layer, you cannot really tell much the network got the prediction wrong. In this example you might think the difference is 0.7 - 0.6 = 0.1, however after running a softmax, you realize that it is in fact 0.03, since the network was very strong in differentiating between the Toad category vs. Dog and Cat, so the loss is not as big as it seems.
Now as an experiment, run a neural network without the softmax layer and see for yourself, how severe it can affect the training. Not only that, but normalization of the input batches also makes a huge difference in training a network.
New contributor
$endgroup$
add a comment |
$begingroup$
Yes, you have overlooked something. Let me explain this with an example:
When training a neural network, you use the loss function as a signal to backpropagation. Now let us say that you have a network which outputs three categories: Cat, Dog, and Toad. Let's say the prediction of the network in an iteration is [0.7, 0.6, 0.3], although the data is, in fact, an image of a dog, meaning the truth is: [0 1 0].
Without a softmax layer, you cannot really tell much the network got the prediction wrong. In this example you might think the difference is 0.7 - 0.6 = 0.1, however after running a softmax, you realize that it is in fact 0.03, since the network was very strong in differentiating between the Toad category vs. Dog and Cat, so the loss is not as big as it seems.
Now as an experiment, run a neural network without the softmax layer and see for yourself, how severe it can affect the training. Not only that, but normalization of the input batches also makes a huge difference in training a network.
New contributor
$endgroup$
Yes, you have overlooked something. Let me explain this with an example:
When training a neural network, you use the loss function as a signal to backpropagation. Now let us say that you have a network which outputs three categories: Cat, Dog, and Toad. Let's say the prediction of the network in an iteration is [0.7, 0.6, 0.3], although the data is, in fact, an image of a dog, meaning the truth is: [0 1 0].
Without a softmax layer, you cannot really tell much the network got the prediction wrong. In this example you might think the difference is 0.7 - 0.6 = 0.1, however after running a softmax, you realize that it is in fact 0.03, since the network was very strong in differentiating between the Toad category vs. Dog and Cat, so the loss is not as big as it seems.
Now as an experiment, run a neural network without the softmax layer and see for yourself, how severe it can affect the training. Not only that, but normalization of the input batches also makes a huge difference in training a network.
New contributor
New contributor
answered 17 hours ago
ambodiambodi
1011
1011
New contributor
New contributor
add a comment |
add a comment |
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%2f40955%2fnormalization-of-probabilities-in-predicting-a-poly-neuron-output-in-neural-nets%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