Reading https://github.com/tensorflow/tfjs-models/tree/master/universal-sentence-encoder the sample code needs to compute the dot product of two tensors and it uses arraySync
on the tensors, nested for loops, and JavaScript defined vector operations. Wouldn’t it be better practice to use tf.layers.dot? The code would be much more concise and presumably much faster. (If it is the case the sample code predated tf.layers.dot
then shouldn’t it be updated?
Also would it not help the potential users of USE QnA to provide some information about why use this instead of just using the generic USE. Is it faster? More accurate? Smaller?