snowkylin / tensorflow-handbook

简单粗暴 TensorFlow 2 | A Concise Handbook of TensorFlow 2 | 一本简明的 TensorFlow 2 入门指导教程
https://tf.wiki
3.94k stars 841 forks source link

Tensorflow in JavaScript #6

Open huan opened 5 years ago

huan commented 5 years ago

基本上比较全面的介绍了 Node.js 和 Browser 里面如何使用 Tensorflow.js ,同时提供了一个完整的 Seq2Seq 模型供读者更深度的了解和上手。

我的开发子 Repo: https://github.com/huan/javascript-concise-chitchat

cc: @wangtz

huan commented 5 years ago

Reviews from @pyu10055:

Overall looks great, couple suggestions. 1) can you add the WeChat plugin support in the overview 2) the converter params have changed, please check 1.x doc 3) please also check node doc 4) the performance numbers are old I will send you a new one.

Thanks for the reviews, I'll looking into them and looking forward to receiving your new performance charts!

huan commented 5 years ago

Reviews from @snowkylin

JavaScript

snowkylin commented 4 years ago

训练一节

  1. 介绍一下链式表达式,这一块和Python区别很大,是必须要用链式表达式吗,还是说一般的表达式也可以用(比如tf.add(a, b))?
  2. 关于取值,介绍一下.dataSync()和.arraySync(),还有其他类似的.XXXSync的API吗,看起来是对应于传统的sess.run()或者eager execution的.numpy(),这一块可以系统介绍一下。
huan commented 4 years ago
  1. xsRaw.sub(...).div(...) 可以被改写成
    1. tf.sub(xsRaw, ...) https://js.tensorflow.org/api/latest/#sub
    2. tf.div(a, b) https://js.tensorflow.org/api/latest/#div
  2. 有三个: dataSync / arraySync / bufferSync 。他们的作用就是把数据从 GPU 里面取回来,和 session.run / .numpy() 的确是一类功能。
    1. A good article: The perils of tensor.dataSync()

我这两个都加一下。