nikhilk / node-tensorflow

Node.js + TensorFlow
Apache License 2.0
587 stars 59 forks source link

Faster implementation of reshapeList #32

Open Kemaweyan opened 6 years ago

Kemaweyan commented 6 years ago

This is MUCH faster implementation of the reshapeList function. My SSD model has output shape [3012, 23], so inner for-loop invokes 3012x2 calls to the splice method that makes the function extremely slow. It takes about 2 seconds (!) on my i3 6100 CPU. Therefore I changed the function to avoid calls to the splice method and now it takes just about 1 millisecond what is quite acceptable.

nikhilk commented 6 years ago

Thanks for the contribution -- been a bit caught up on other things, but hope to review/merge later this week. Just wanted to chime in before its too long.