Single Neuron with Backpropagation
Neural Units & Activations DS practice problem on Onlearn.
Difficulty: medium.
Topics: Understanding Single Neuron with Backpropagation, Chain Rule, Dot Product, Sigmoid Activation, Mean Squared Error, Weight Update Rule, Calculus, Linear Algebra, Optimization Theory, Probability and Statistics, Computational Programming, Differential Calculus, Vector Operations, Gradient-Based Learning, Loss Function Analysis, Iterative Numerical Methods.
Write a Python function that simulates a single neuron with sigmoid activation, and implements backpropagation to update the neuron's weights and bias. The function should take a list of feature vectors, associated true binary labels, initial weights, initial bias, a learning rate, and the number of epochs. The function should update the weights and bias using gradient descent based on the MSE loss, and return the updated weights, bias, and a list of MSE values for each epoch, each rounded to four decimal places.