Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [softmax]

Normalizing exponential function which transforms a numeric vector such that all its entries become between 0 and 1 and together sum to 1. It is often used as the final layer of a neural network performing a classification task.

0
votes
1answer
19 views

Softmax where the max probability is less than one

I have a neural network with a softmax at the end. Something like this: ...
0
votes
1answer
16 views

How to implement thresholded softmax in Keras?

I would like to implement a threshold after the final softmax layer in a Keras-built classification problem so that class assignments with probability below some threshold alpha are disregarded (i.e. ...
0
votes
3answers
25 views

Two logistic regression or one Softmax regression

The following question is from Geron's Hans-On Machine Learning book. Suppose you want to classify pictures as outdoor/indoor and daytime/nighttime. Should you use two Logistic regression or one ...
0
votes
0answers
11 views

NLP - how do you randomly draw negative samples?

From my understanding, negative sampling randomly samples K negative samples from a noise distribution, P(w). The noise ...
1
vote
1answer
18 views

Having trouble figuring out how loss was calculated for SQuAD task in BERT paper

The BERT Paper https://arxiv.org/pdf/1810.04805.pdf Section 4.2 covers the SQuAD training. So from my understanding, there are two extra parameters trained, they are two vectors with the same ...
0
votes
0answers
32 views

Neural Networks output functions [duplicate]

Studying about neural networks as a newbie, I learned (I think) about the different types of output functions, but I have been confused when to use each. (softmax, cross-entropy, sigmoid, none) For ...
1
vote
0answers
64 views

Reinforcement Learning partial derivative of loss function w.r.t. input of softmax

In the paper "Self-critical sequence training for image captioning" (link) on page 3 they define the loss function (of the parameters $\theta$) of an image captioning system as the negative expected ...
0
votes
0answers
20 views

Difference between sigmoid and softmax [duplicate]

I know, that usually we use sigmoid in the hidden layer, and softmax as an output but what is the difference between neural network with one output and sigmoid activation layer and network with two ...
0
votes
2answers
151 views

Softmax layer derivative by hand

I would like to compute the gradient of the loss function with respect to the input to a sigmoid layer. This is a question in some online course I found (see 1:09:22 in https://www.youtube.com/watch?v=...
1
vote
1answer
57 views

Problem with Softmax decision boundary

While reading this paper: sphere face on page 2, it explains that original softmax boundary is given by: $$(W_1 −W_2)x+b_1 −b_2 = 0$$ While trying to obtain the boundary on a toy generated 2D dataset ...
0
votes
0answers
34 views

Softmax regression vector features?

I'm working on a difficult classification problem where there are a very large number of known classes (~50k). I have only about 20k labelled points, but these only represent <1% of the possible ...
0
votes
0answers
137 views

confusion matrix for one hot vectors

Let $\mathbf{Y}$ be a matrix where each row is a one-hot encoding of true labels and $\hat{\mathbf{Y}}$ be a similar matrix for predicted labels that are generated by a softmax function. How is the ...
3
votes
1answer
442 views

Is a neural network consisting of a single softmax classification layer only a linear classifier?

Since the softmax function is a generalization of the logistic function it is continuous and non-linear. So the output of the softmax layer is: softmax( weight_matrix * input_activation) ...
1
vote
2answers
566 views

Softmax weights initialization

I am a new to deep learning and neural networks, and I need to know if there is a good weights initialization method to use if the activation function is Softmax like Tanh, ReLU and Sigmoid. Related ...
0
votes
0answers
122 views

Tensorflow tf.nn.sampled_softmax_loss: Should uniform_candidate_sampler be the default sampler instead of log_uniform_candidate_sampler?

I was reading the documentation for tf.nn.sampled_softmax_loss: https://www.tensorflow.org/api_docs/python/tf/nn/sampled_softmax_loss It says for choosing the negative samples, if we don't put ...
0
votes
1answer
31 views

Meaning of different softmax notations in papers

I was wondering if the different notations of the softmax input mean different things especially about the size of the output. For example, in the paper Pointer Networks, it sometimes state the input ...
0
votes
1answer
114 views

How to get meaningful results from Softmax activation in Deep Unsupervised Clustering Network

I found this interesting paper regarding deep unsupervised clustering and am looking to mimic some of the things done, however there is one thing that is not clear to me. In the paper, they use a ...
0
votes
0answers
86 views

multi class logistic regression : $K-1$ regressors or $K$ regressors (softmax)?

I read that, in multiclass logistic regression, we have a pivot class $K$ and $K-1$ set of $\vec{w}$ weights, then, for the pivot class: \begin{eqnarray} P( C_K | \vec{x} ) &= 1- \sum_\limits{t=...
0
votes
0answers
28 views

What does this cross entropy notation $J(o, v_c, U) = CE(y, \hat y)$ mean?

From http://web.stanford.edu/class/cs224n/assignment1/index.html under "complementary written problems" problem $3(a)$: What does $J_{\text{Softmax---CE}}(o, v_c, U) = CE(y, \hat y)$ fully stand for? ...
0
votes
1answer
391 views

Candidate Sampling for Softmax - Tensorflow; Sampling Probability

I am trying to understand the mathematics behind the sampled softmax in Tensorflow. They have the following document, trying to explain how the sampling process works: https://www.tensorflow.org/...
1
vote
1answer
101 views

Proof for the efficiency of Softmax in multi-classification

I already search for this question but I can't find any convincing explanation so I want to ask it here. my problem is with softmax activation function and cross-entropy.why they can produce a better ...
0
votes
2answers
50 views

Softmax derivation - case i==j

I am reading this article: https://eli.thegreenplace.net/2016/the-softmax-function-and-its-derivative about softmax derivation w.r.t. to the input. Please confirm my understanding of the case when j==...
0
votes
2answers
45 views

Neural Network Layer for Binary Outputs

I'm currently using an LSTM network to make a yes or no decision in a robot. The network has a single output with the values in training data being 0 for one decision and 1 for another. The problem ...
1
vote
1answer
337 views

machine learning - Derivative of log-likelihood function in softmax regression

I'm trying to find the derivative of the log-likelihood function in softmax regression. I have (with $\Theta$ being the parameters, and $x^{(i)}$ being the $i$th training example, and $s_j$ ...
0
votes
0answers
137 views

change hinge loss error function with cross-entropy

I'm trying to implement cross-entropy as an error function in RBF neural networks instead of hinge loss error function. I need to find cross-entropy error for each output neuron, like hinge loss error ...
0
votes
1answer
127 views

In multi-class logistic regression, does SGD one training example update all the weights?

In multi-class logistic regression, lets say we use softmax and cross entropy. Does SGD one training example update all the weights or only a portion of the weights which are associated to the label ? ...
0
votes
0answers
16 views

Softmax regression learning curve intersecting

I've implemented softmax regression on python. I've separated the Iris data into training, validation and test data. When I plot the learning curve for training data and validation data I get this: ...
0
votes
0answers
54 views

Loss function for partial/splitted softmax outputs on binary ground truth

I need to find a loss function for the scenario where each output is a vector instead of a scalar. And each of these vectors in one-hot-encoded. So I would like to use something like softmax loss on ...
4
votes
0answers
312 views

Definition of softmax function

This question follows up on stats.stackexchange.com/q/233658 The logistic regression model for classes {0, 1} is $$ \mathbb{P} (y = 1 \;|\; x) = \frac{\exp(w^T x)}{1 + \exp(w^T x)} \\ \mathbb{P} (y =...
1
vote
0answers
58 views

How to interpret Gelman's multivariate Gaussian prior for multinomial distribution?

Andrew Gelman suggested the use of a multivariate Normal distribution as prior for hierarchical models that have a multinomial distribution at the lowest level (http://andrewgelman.com/2009/04/29/...
1
vote
1answer
243 views

Does hierarchical softmax of skip gram and CBOW only update output vectors on the path from the root to the actual output word?

After reading word2vec Parameter Learning Explained by Xin Rong, I understand that in the hierarchical softmax model, there is no output vector representation for words, instead, each of the $V-1$ ...
0
votes
1answer
176 views

Optimal neural net weights when using cross entropy loss

I'm trying to understand how cross-entropy works for finding the optimal weights in neural networks. According to Eli Bendersky's website and neural networks and deeplearning tutorial, we can find the ...
2
votes
1answer
899 views

Difference between mathematical and Tensorflow implementation of Softmax Crossentropy with logit

Softmax cross entropy with logits is define as follows: $a_i = \frac{e^{z_i}}{\sum_{\forall j} e^{z_j}}$ $l={\sum_{\forall i}}y_ilog(a_i)$ Where $l$ is the actual loss. But when you look deep into ...
2
votes
0answers
25 views

Cost function to output reliable error probabilities?

I'm using softmax regression but my goal is not to increase the 'accuracy' but instead to create probabilities which are accurate. Using cross entropy or the means squared error (which I'm aware I'm ...
9
votes
2answers
325 views

How deep is the connection between the softmax function in ML and the Boltzmann distribution in thermodynamics?

The softmax function, commonly used in neural networks to convert real numbers into probabilities, is the same function as the Boltzmann distribution, the probability distribution over energies for en ...
1
vote
0answers
303 views

Tensorflow Sampled_Softmax_loss - correct usage [closed]

I am working on a Speaker recognition problem, I have very big number of classes so I need to use, tf.nn.sampled_softmax_loss to speed up training time. The problem is I am using Keras with Tensorflow ...
1
vote
0answers
181 views

How do I implement softmax forward propagation and backpropagation to replace sigmoid in a neural network?

I'm currently using 3Blue1Brown's tutorial series on neural networks and lack extensive calculus knowledge/experience. I'm using the following equations to calculate the gradients for weights and ...
0
votes
0answers
66 views

question about backpropagation with a softmax

When we have a neural network with a softmax layer, I'm a little confused how the weights get updated which are NOT associated with the correct answer. The issue is that the cost function will ...
1
vote
0answers
40 views

Neural Nets: Benefits of Mixing Activation Functions? [duplicate]

I'm currently studying and would like to know if there are any actual benefits of using a mixture of activation functions for each layer. For example, if I am trying to predict the probabilities of ...
3
votes
1answer
568 views

How does the subtraction of the logit maximum improve learning?

My question comes from another question answered on Stackoverflow; the Keras implemantion of softmax activation function is customized to subtract the maximum value ...
1
vote
1answer
107 views

Softmax dealing with non present classes [closed]

Is it okey to assume that, if I have trained my neural network for image classification using k classes using a Softmax output function, whenever I feed an image that does not belong to any of the k ...
0
votes
2answers
323 views

Are weights 1-D or 2-D in softmax Regression?

I've learned ML and have been learning DL from Andrew Ng's coursera courses, and every time he talks about a linear classifier, the weights are just a 1-D vector. Even during the assignments, when we ...
1
vote
0answers
283 views

finding the loss derivative w.r.t. weights for a convolutional layer

Take the loss function: $$ \mathrm{loss} ~~=~~ \sum_{i=1}^N \left( -z_{}[y] + \log{\left( \sum_{c=1}^{10} \exp(z_{}[c]) \right)} \right)$$ where $z \in \mathbb{R}^{10}$ is the input to the softmax ...
1
vote
1answer
261 views

Why does deriving the softmax for a single vector come to 0 for me?

There is a lot of material explaining how to calculate the jacobian for the softmax backwards pass, but I find it confusing how to get to the actual errors from the jacobian. The obvious answer would ...
0
votes
1answer
279 views

What is the meaning of fully-convolutional cross entropy loss in the function below (image attached)?

I am trying to understand the loss function given below from this paper. I do not understand $l_{p}(x_{hw}; y_{hw})$ part.
3
votes
0answers
179 views

Expectation of the softmax transform for Gaussian multivariate variables

Prelims In the article Sequential updating of conditional probabilities on directed graphical structures by Spiegelhalter and Lauritzen they give an approximation to the expectation of a logistic ...
4
votes
2answers
447 views

How can't the Softmax layer never converge using hard targets

Here's a quote from the deep learning book by Ian Goodfellow (page 236): Maximum likelihood learning with a softmax classifier and hard targets may actually never converge -- the softmax can ...
4
votes
1answer
593 views

Is minimizing softmax cross entropy with two labels equivalent to minimizing sigmoid binary cross entropy with 1 label?

Is using a sigmoid at the end of a neural network with 1 label equivalent to using a softmax with 2 labels?
1
vote
0answers
158 views

Mutual exclusive classes for deciding Softmax Regression vs. k Binary Classifiers

I realise that similar questin is asked here also Softmax regression or $K$ binary logistic regression But my concern is related to last section of this article from stanford http://ufldl.stanford....
6
votes
2answers
1k views

What is distribution parameterization?

I encountered this term in the Stanford notes about softmax regression: we will begin by expressing the multinomial as an exponential family distribution. To parameterize a multinomial over k ...