I’m writing a perceptron classifier with one layer. It works well, so my colleagues say their algorithms have like 2 or 3 seconds by iteration, and the my one have something like 15 minutes, and it isn’t normal since i’m using Julia, and it should be faster than python. But of course not if you are a dumb ass. Look to this two lines of code, it looks inoffensive:
label = (convert(Array,df[row,1:1])) append!(perceptron.x, convert(Array,df[row,2:ncolumns]))
so I tried @time call here and get this:
0.002 and 0.008405 respectively.
0.008 * 60.000 iterations * 25 – 30 eras * 10 classes to classify [0-9] + 0.002 * 60.000 iterations * 25 – 30 eras * 10 classes to classify [0-9]
and our champion is here, the problem is the conversion inside the loop, yep, have no free lunch.
How I fix that, simple, outside the loop I parse to an array, and, no more, it’s:
arr = convert(Array, df)
label = arr[row,1] append!(perceptron.x, arr[row,2:ncolumns])
And now, 15 seconds, so I have a lot of work here, trying don’t be a dump guy.
That’s all folks.