diff --git a/ex-7/percep.c b/ex-7/percep.c index d762119..df68712 100644 --- a/ex-7/percep.c +++ b/ex-7/percep.c @@ -85,8 +85,6 @@ gsl_vector *percep_train( * comparison with other methods. */ double norm = gsl_blas_dnrm2(w); - if (gsl_vector_isneg(w)) - norm = -norm; gsl_vector_scale(w, 1/norm); *cut = -bias/norm; diff --git a/ex-7/plot.py b/ex-7/plot.py index 6151689..42e9f7c 100755 --- a/ex-7/plot.py +++ b/ex-7/plot.py @@ -25,7 +25,7 @@ scatter(*signal, edgecolor='xkcd:charcoal', scatter(*noise, edgecolor='xkcd:charcoal', c='xkcd:pale purple', label='noise') line(-20*w, 20*w, c='xkcd:midnight blue', label='projection') -line(w-10*v, w+10*v, c='xkcd:scarlet', label='cut') +line(abs(w)-10*v, abs(w)+10*v, c='xkcd:scarlet', label='cut') xlabel('x') ylabel('y') xlim(-1.5, 8) diff --git a/notes/images/7-percep-proj.pdf b/notes/images/7-percep-proj.pdf index 280aee7..059701f 100644 Binary files a/notes/images/7-percep-proj.pdf and b/notes/images/7-percep-proj.pdf differ