Re:Tiny-dnn – A C++11 implementation of deep learning
by lexy0202 on Wednesday November 30, 2016 @05:26AM
(#13069661)
> I can probably write vanilla JS or Python code that does that in 10 lines or so and would finish in around 5 seconds.
Really? There are certainly frameworks that you can use to achieve this performance in that amount of code, but I would be really interested to see that in vanilla JS/Python.
Re:Tiny-dnn – A C++11 implementation of deep learning
by inglor on Wednesday November 30, 2016 @06:05AM
(#13069797)
Hey, sure - here's 9 lines of code that implement a perceptron. I get ~95% of precision after a second with 400 samples.
```js
const dotSign = (v1, v2) => v1.reduce((prev, x, i) => prev + x * v2[i], 1) > 0 ? 1 : -1
module.exports = (data, weights = Array(data[0].content.length).fill(0)) => {
for(const {label, content} of data) {
const delta = (label - dotSign(content, weights)) / 2;
weights = weights.map((x, i) => x + delta * content[i]);
}
return { perceive: vector => dotSign(vector, weights), weights };
}
```I can upload an electron app that does this with mnist if interested.
Re:Tiny-dnn – A C++11 implementation of deep learning
by attractivechaos on Wednesday November 30, 2016 @09:56AM
(#13071211)
> I get ~95% of precision after a second with 400 samples.
MNIST has 60k training samples and 10k test samples. Are you using only 400 of them? Is 95% the accuracy on the test samples or on the same set of training samples? I believe when we talk about MNIST accuracy, we always refer to the accuracy on the 10k test samples.
Re:Tiny-dnn – A C++11 implementation of deep learning
by anentropic on Wednesday November 30, 2016 @07:46AM
(#13070234)
how long does does it take to get from 95% -> 98.8% though?
Re:Tiny-dnn – A C++11 implementation of deep learning
by lunula on Wednesday November 30, 2016 @08:19AM
(#13070400)
This. You can also get near 98% accuracy with vw and one quadratic interaction over the pixel space. It takes seconds. But that last .8%, forget about ever getting there with infinite training time.
Re:Tiny-dnn – A C++11 implementation of deep learning
by inglor on Thursday December 01, 2016 @05:09PM
(#13084037)
About 10 seconds and 10 times the samples does that.
Re:Tiny-dnn – A C++11 implementation of deep learning
by quinnftw on Wednesday November 30, 2016 @06:40PM
(#13075727)
Is this not a binary perceptron? How do you plan to classify all 10 digits with this?
Re:Tiny-dnn – A C++11 implementation of deep learning
by inglor on Thursday December 01, 2016 @05:10PM
(#13084048)
I cheated here (this _is_ a binary perceptron), but the conversion is super easy with one-vs-rest or one-vs-one (training all pairs and then doing pairwise comparison until we find the one that matches), that would still take ~20 seconds to train.
Re:Tiny-dnn – A C++11 implementation of deep learning
by rawnlq on Wednesday November 30, 2016 @05:47AM
(#13069734)
Not op but here's a cool example in JS: http://cs.stanford.edu/people/karpathy/convnetjs/demo/mnist....
Why is this taking so long?