Deep Learning Homework 2: CS/DS541
Deep Learning Homework 2: CS/DS541
Using both unregularized cross-entropy loss and percent correctly classified examples provides a comprehensive evaluation of network performance. Cross-entropy loss measures the confidence and calibration of predictions, penalizing incorrect predictions more severely, while the percentage of correctly classified examples directly assesses classification accuracy. Together, they offer insights into both the probabilistic prediction quality and the overall classification effectiveness, ensuring no trade-off between being overly confident yet inaccurate .
The regularization term in the cross-entropy loss for softmax regression as presented in Homework 2 omits dividing by the number of examples, n. This modification simplifies the equation without altering its functional behavior because the 1/n factor can be subsumed into the regularization constant, α. This rationale ensures computational simplicity while achieving the same regulatory effect on weight magnitudes .
Data normalization scales input feature values to a smaller range, typically [0, 1], which reduces the scale of feature variance and ensures smoother gradient updates during training. This accelerates training by preventing saturation of activation functions and improving convergence speed, as the network can learn more uniformly across various features without some dominating due to inherent scale differences .
Regularization penalizes large weights, thus preventing overfitting during training on image classification tasks like the Fashion MNIST dataset. It ensures the model generalizes well to the test data by avoiding extreme parameter values. Regularization is included directly in the loss function, affecting the gradient descent optimization by influencing the size of weight updates, indirectly controlling the model's complexity .
In logistic regression, convergence properties of weights and biases depend on the learning rate and the nature of training examples. With well-chosen learning rates, training loss can converge to a specific value, indicating successful learning. Bias convergence is more contingent on training example configuration, possibly failing to converge without well-designed data distributions. These insights highlight the importance of hyperparameter tuning and dataset preparation in achieving convergence in logistic regression .
Deriving the gradient for softmax regression with respect to a weight vector involves differentiating the cross-entropy loss function. The main steps include identifying how the prediction probabilities depend on the weight vector across all classes due to softmax's normalization. The challenges arise from handling the dependence of all classes on all weights, requiring separate treatment for cases where the class index matches and does not match the weight vector's index. Additionally, attention is needed to aggregate the gradients across all examples, considering class-specific impacts .
Homework 2 suggests using previous methodologies from age regression tasks for hyperparameter optimization, highlighting the need for careful splitting of training data into validation and test sets, regularization strategies, and gradient descent tuning using stochastic methods. This approach ensures that model performance on unseen data is maximized and reduces overfitting by validating the choice of hyperparameters throughout the training process .
Handling separate cases where l = k and l ≠ k in the gradient derivation for softmax regression is crucial due to the competing and cooperative effects of weight vectors across class predictions. For l = k, the gradient directly captures how weights affect their predicted class's probability. For l ≠ k, the gradient corrects the inadvertent influence on other classes, ensuring the softmax normalization constraint (probabilities summing to one) is respected. This dual consideration ensures accurate gradient computation, maintaining model stability and prediction accuracy .
In softmax regression, each weight vector w(l) affects not only the output for class l but also the outputs for other classes due to the normalization across classes. Changing one weight vector to increase its corresponding output will necessarily decrease the outputs of others. This interconnectedness means the gradient with respect to each weight vector must consider its impact across all classes, thus complicating the gradient descent process .
The linear neural network cannot solve the XOR problem because the gradient minimization leads to all weights and biases being equal to zero. This makes the prediction independent of the input, thus failing to classify XOR, which is non-linearly separable. As shown in the homework, solving for w = [w1, w2]⊤ and b that minimize the function results in w1 = 0, w2 = 0, and b = 0.5, meaning the output is always 0.5, which is insufficient for XOR classification .