5 ms·
I know even publishing the code for stuff like this is generous but it'd be so cool if the standard practice included publishing a little wasm binary blob as a
by hwers 5y ago
I know even publishing the code for stuff like this is generous but it'd be so cool if the standard practice included publishing a little wasm binary blob as a library independent network with weights to play with without having to go through colab. (Many frameworks have a way of creating that automatically already, e.g. torchscript or jax jit.)
- quanto 5y agoI am not as familiar with the state of the art; are there NN frameworks that export the NN model such that it can be run within WASM?
- hwers 5y agoYup. In torch you can use torchscript and in jax you can 'jit' a function and both turn your NN function into a fairly easily compliable form which could then be translated to wasm. Here's a cool project that does something like this (though I believe it's basically superseded by torchscript): https://github.com/podgorskiy/tensor4 https://github.com/podgorskiy/tensor4 Here it is running stylegan in the browser (via wasm): http://podgorskiy.com/static/stylegan/stylegan.html http://podgorskiy.com/static/stylegan/stylegan.html
- goodmattg 5y agoNote of reference for readers who may not be as familiar. One (pytorch) process is: 1) Use torch.onnx to convert the model to ONNX 2) USe `onnxruntime` built for Web Assembly (WASM) to run the NN in the browser
- hwers 4y agoWell my point was that you could extract it into a wasm blob without onnx (library independent). See tensor4 as linked in the other thread.