Neural Network Loss Function Calculator
Neural Network Loss Function Calculator computes Mean Squared Error (MSE), Mean Absolute Error (MAE), and Cross-Entropy Loss for given predicted and actual values. Enter two comma-separated lists of numbers (e.g., 0.1,0.2,0.3 for predicted and 0,0,1 for actual).
Loss Functions Used
Loss functions measure the difference between predicted and actual values in neural networks. This calculator computes:
Mean Squared Error (MSE):
\\[ MSE = \frac{1}{n} \sum_{i=1}^{n} (y_i – \hat{y}_i)^2 \\]Mean Absolute Error (MAE):
\\[ MAE = \frac{1}{n} \sum_{i=1}^{n} |y_i – \hat{y}_i| \\]Cross-Entropy Loss (Binary):
\\[ CE = -\frac{1}{n} \sum_{i=1}^{n} [y_i \log(\hat{y}_i) + (1 – y_i) \log(1 – \hat{y}_i)] \\]Where \\( y_i \\) is the actual value, \\( \hat{y}_i \\) is the predicted value, and \\( n \\) is the number of values.
Algorithm Steps:
- Input two arrays of numbers (predicted and actual values).
- Validate inputs (same length, valid numbers, 0 ≤ predicted ≤ 1 for CE).
- Calculate MSE, MAE, and Cross-Entropy Loss.
- Display results and visualize errors per sample.