- In general, it is best to test smaller portions of your program as you work, to make sure each part is working right.
- In general, you can use a command like print in Python or disp in Matlab to display variable values in the middle of program execution --- that can help with debugging if you need it.
For neural networks:
If you change your nonlinearity from sigmoid, you should really
adjust your gradient descent rule to reflect the new nonlinearity
(eg, rederive d/dw (y - g(wT x+b))2)
For SVM:
We never established the gradient descent rule for SVM (the rule
shown in the SVM slides discussing hyperparameters is the update
rule for logistic classification). You should figure out the update
rule based on the derivative of the formula given in the project
write-up. It actually would be best to take a derivative for the
γ as well (learn the γ) and even learn a separate γ
for each data point (0 γs would be like 0 αs, indicating
non support vectors)
mini,γ wTw + Σi in +1γi(1-(wTxi+b)) + Σi in -1γi(wTxi+b + 1) + Σi in Allγi
(You can also use the simpler version given in the write-up (probably will classify less well):
mini,γ wTw + γΣi in +1(1-(wTxi+b)) + γΣi in -1(wTxi+b + 1)
)