Live data from Hacker News

Leaf: Machine learning framework in Rust

github.com

51–53 of 53 posts

Re: Leaf: Machine learning framework in Rust

#51

I'm completely new to ML and what real world applications it's suitable for. Are we at the point yet where you can train a computer to look at arbitrary images and count the number of people in it? What if it was the largely on the same background and only the number of people were changing -- for example, a camera shooting a queue of people to determine queue depth at a bus station.

Yes. The general task of looking at arbitrary images and labeling objects (from a set of known categories) in those images is called "detection." In fact the problem you described is easier, because there's only one category (people), and the system only needs to provide a count, rather than provide bounding box rectangles around each object (which is what the standard "detection" task entails).

Convolutional neural nets are the state of the art for this, specifically deep residual learning (http://arxiv.org/abs/1512.03385). It requires a good deal of background to understand what's going on and tune/implement the models, though, even if you just use the frameworks already out there. You probably don't even need that much data - you can probably grab pre-trained models and train them on a small additional dataset you collect.

They can definitely handle arbitrary backgrounds, although having a standard background makes the problem even easier, again.

Most deep learning computer vision algos are trained on 256x256 images, so having even larger images is just fine (you can downsample, or maybe even add up the predictions of different crops).

Re: Leaf: Machine learning framework in Rust

#52
I'm honestly skeptical that Rust is all that appealing for this type of work. It just doesn't seem like the main concerns like performance and type safety are #1 the top priority in this space and #2 this offering is differentiated enough from what you already get from Java today.

Honesly, many modeling problems are clunky and inefficient at scale - however that's ok. When you need to scale bad enough, you already have a significant set of library support in Java to support this.

I'm failing to see an answer to the one question I have, "why rust?"

Re: Leaf: Machine learning framework in Rust

#53
post #36
post #28

The benchmarks would be a lot more useful if the context around them were more obvious. In particular, it would be nice to know if the benchmarks are for a single input, or for a batch of inputs. If for a batch, then the batch size is important too. Maybe this stuff is somewhere on their site, but it shouldn't require digging. Without this information it's hard to make a useful comparison at all.

You are right, batchsize is important and we should make that more clear. The numbers in the benchmark are taken from our deep-learning-benchmarks[1] which we are still in the process of building up. It might actually make sense to test the same model with different batch sizes. The current benchmarks are based on the convnet-benchmarks[2] where the Alexnet model has a batch size of 128. (Alexnet was chosen because o…

That all sounds reasonable. I was surprised at how much the batch size can matter on different hardware. Maybe you've seen this post:

http://svail.github.io/rnn_perf/

It's primarily RNN-focused, but the discussion about batch sizes on GPUs is interesting.

Post reply on HN