Live data from Hacker News

Keras.js – Run trained Keras models in your browser

github.com

1–10 of 28 posts

Re: Keras.js – Run trained Keras models in your browser

#6
post #2

This is awesome! Can you describe how you implemented the WebGL ops a bit more? Did you have to write your own convolution kernel with GLSL for example?

They mentioned they used the weblas library/module.

See code for example https://github.com/transcranial/keras-js/blob/master/src/Ten... or code on weblas github repo.

Re: Keras.js – Run trained Keras models in your browser

#8
post #5

What sort of performance can be expected compared to running in the terminal? How large NNs will this scale to in practice? I see a 50-layer resnet is mentioned; but not 1000-layers?

1000 layer networks aren't used in practice. 50 layers is enough for state-of-the art performance.

Re: Keras.js – Run trained Keras models in your browser

#9
post #5

What sort of performance can be expected compared to running in the terminal? How large NNs will this scale to in practice? I see a 50-layer resnet is mentioned; but not 1000-layers?

It sounds like inference (prediction) performance is ok (probably I doubt training performance would be very fun.

Re: Keras.js – Run trained Keras models in your browser

#10
post #2

This is awesome! Can you describe how you implemented the WebGL ops a bit more? Did you have to write your own convolution kernel with GLSL for example?

Thanks! For WebGL, credit goes to https://github.com/waylonflinn/weblas. I only really use GEMM, but it works quite well. In keras.js, convolution is implemented with the oft-used im2col transformation to turn it into a matrix multiply followed by reshape. Convolution kernels directly GLSL could potentially provide speed gains I'm sure, but I can't even imagine writing it for tensors of arbitrary shape.
Post reply on HN