Skip to content
Advertisement

Tag: gradient

Compute the gradient of the SVM loss function

I am trying to implement the SVM loss function and its gradient. I found some example projects that implement these two, but I could not figure out how they can use the loss function when computing the gradient. Here is the formula of loss function: What I cannot understand is that how can I use the loss function’s result while

How to plot a gradient color line in matplotlib?

To state it in a general form, I’m looking for a way to join several points with a gradient color line using matplotlib, and I’m not finding it anywhere. To be more specific, I’m plotting a 2D random walk with a one color line. But, as the points have a relevant sequence, I would like to look at the plot

Advertisement