通过npm install @tensorflow/tsfl-node就行
----
机器学习基础
在进行TensorFlow的实践之前, 关于机器学习有一些基本概念需要介绍.....
----
TensorFlow
TensorFlow是目前最出名的机器学习框架. 它提供了许多机器学习过程中所必要的方法, 函数等东西. 虽然第一眼看上去很吓人....tf.tensor([
[
[1, 2],
[3, 4]
],
[
[5, 6],
[7, 8]]
])
修改张量...shape
可以通过Tensor.reshape来在size一致的情况下修改Tensor的shape
const a = tf.tensor([1,2,3,4,5,6]);
const b = a.reshape...而TensorFlow实际上封装了这么一个逻辑(毕竟要用代码实现求偏导实际上还是过于繁琐了)
实际上在梯度下降的过程中, TensorFlow会自动地去调整已经向TensorFlow注册了的variable