知识卡片
批损失比较要统一归一化
SVI每批返回的负ELBO估计通常随批量大小变化。跨训练轮或数据规模比较时,应说明是总损失、每样本均值还是每像素均值;本例累加各批后除以样本数,打印时却用了loss而非avg_loss,图与日志口径须核对。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
avg_loss = loss / train_size print("Epoch: {} avgs training loss: {}".format(epoch, loss)) train_loss.append(avg_loss) if epoch % TEST_FREQUENCY == 0: #3 test_epoch(vae, test_loader) #3 #1 Run the training procedure for a certain number of epochs. #2 Run a training step on one batch in one epoch. #3 The test data evaluation procedure runs every 10 epochs. Again, see https://www.altdeep.ai/p/causalaibook for a link to a Jupyter notebook
参考来源
- 位置:《Causal AI》第05章《连接因果与深度学习》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Causal AI/_epub-src/OEBPS/Text/chapter-5.xhtml)
- 结论依据:摘录中关于批损失比较要统一归一化的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:avg_loss = loss / train_size print("Epoch: {} avgs training loss: {}".format(epoch, loss)) train_loss.append(avg_loss) if epoch % TEST_FREQUENCY == 0: #3 test_epoch(vae, test_loader) #3 #1 Run the training procedure for a certain number of epochs. #2 Run a training step on one batch in one epoch. #3 The test data evaluation procedure runs every 10 epochs. Again, see https://www.altdeep.ai/p/causalaibook for a link to a Jupyter notebook