TrickyGo / Dive-into-DL-TensorFlow2.0

本项目将《动手学深度学习》(Dive into Deep Learning)原书中的MXNet实现改为TensorFlow 2.0实现,项目已得到李沐老师的认可
https://trickygo.github.io/Dive-into-DL-TensorFlow2.0/#/
Apache License 2.0
3.79k stars 820 forks source link

torch库在前面没有 导入(3.11.4.1) #33

Closed vuexiaob closed 4 years ago

vuexiaob commented 4 years ago

3.11.4.1 生成数据集 该小节,torch库在前面没有 导入,我是在本地安装了Pytorch,然后import torch,就可以成功了。

n_train, n_test, true_w, true_b = 100, 100, [1.2, -3.4, 5.6], 5 features = torch.randn((n_train + n_test, 1)) poly_features = torch.cat((features, torch.pow(features, 2), torch.pow(features, 3)), 1) labels = (true_w[0] poly_features[:, 0] + true_w[1] poly_features[:, 1]

archersama commented 4 years ago

已修复,删去pytorch的api,换成tensorflow2的api