diff --git a/chapter_convolutional-neural-networks/conv-layer.md b/chapter_convolutional-neural-networks/conv-layer.md index 4a0e3203432bf70702d4865673f109985d6b0a2c..28318a0783b5e6339e7a631dfaa9bd98ccf3544d 100644 --- a/chapter_convolutional-neural-networks/conv-layer.md +++ b/chapter_convolutional-neural-networks/conv-layer.md @@ -207,7 +207,7 @@ for i in range(10): # 迭代卷积核 conv2d.weight.data()[:] -= lr * conv2d.weight.grad() if (i + 1) % 2 == 0: - print(f'batch {i+1}, loss {float(l.sum()):.3f}') + print(f'epoch {i+1}, loss {float(l.sum()):.3f}') ``` ```{.python .input} @@ -229,7 +229,7 @@ for i in range(10): # 迭代卷积核 conv2d.weight.data[:] -= lr * conv2d.weight.grad if (i + 1) % 2 == 0: - print(f'batch {i+1}, loss {l.sum():.3f}') + print(f'epoch {i+1}, loss {l.sum():.3f}') ``` ```{.python .input} @@ -255,7 +255,7 @@ for i in range(10): weights[0] = conv2d.weights[0] - update conv2d.set_weights(weights) if (i + 1) % 2 == 0: - print(f'batch {i+1}, loss {tf.reduce_sum(l):.3f}') + print(f'epoch {i+1}, loss {tf.reduce_sum(l):.3f}') ``` 在$10$次迭代之后,误差已经降到足够低。现在我们来看看我们[**所学的卷积核的权重张量**]。