Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

# Tag Info

Accepted

### Custom loss function with additional parameter in Keras

You can write a function that returns another function, as is done here on GitHub ...
Accepted

### Parameterization regression of rotation angle

The second way, predicting $x=cos(\alpha)$ and $y=sin(\alpha)$ is totally okay. Yes, the norm of the predicted $(x, y)$ vector is not guaranteed to be near $1$. But it is not likely to blow up, ...

### Keras Sequential model returns loss 'nan'

To sum up the different solutions from both stackOverflow and github, which would depend of course on your particular situation: Add regularization to add l1 or l2 penalties to the weights. Otherwise,...
Accepted

### Why is there a $2$ at the denominator of the mean squared error function?

This is just for mathematical convenience. When you differentiate $C(w,b)$, you will get an extra $2$. To eliminate that, $2$ is kept beforehand in denominator. You can also watch this video on SVM ...

### What is the difference between SGD classifier and the Logisitc regression?

Welcome to SE:Data Science. SGD is a optimization method, while Logistic Regression (LR) is a machine learning algorithm/model. You can think of that a machine learning model defines a loss function, ...
Accepted

### Custom loss function with additional parameter in Keras

I think the best solution is: add the weights to the second column of y_true and then: ...

### Validation loss is lower than the training loss

It is certainly correct in the sense that it is a legitimate neural network. The dropout layer introduces noise that is not injected during the test period. The goal is to combat overfitting so that ...
Accepted

### Why does putting a 1/2 in front of the squared error make the math easier?

A major reason for using MSE is to optimize the parameters of a regression model. From calculus, you know how to find the minimum of a function by taking the derivative. That puts a "2" out ...

### What's the difference between Error, Risk and Loss?

Error In this context, error is the difference between the actual / true value ($\theta$) and the predicted / estimated value ($\hat\theta$) $$Error = \theta - \hat\theta$$ Loss Loss and Risk are ...
Accepted

### Validation loss

Validation loss is the same metric as training loss, but it is not used to update the weights. It is calculated in the same way - by running the network forward over inputs $\mathbf{x}_i$ and ...
Accepted

### loss/val_loss are decreasing but accuracies are the same in LSTM!

I think this is because your targets y are continuous instead of binary. Therefore, either ignore the accuracy report, or ...

### What makes binary cross entropy a better choice for binary classification than other loss functions?

As mentioned in the blog, cross entropy is used because it is equivalent to fitting the model using maximum likelihood estimation. This on the other hand can be interpreted as minimizing the ...
Accepted

### Does small batch size improve the model?

In general smaller or larger batch size doesn't guarantee better convergence. Batch size is more or less treated as a hyperparameter to tune keeping in the memory constraints you have. There is a ...