torch.nn.Module.eval:
Sets the module in evaluation mode.
This has any effect only on certain modules. See documentations of particular modules for details of their behaviors in training/evaluation mode, if they are affected,
这个函数仅对特定的模块有效.有些函数在 training/evaluation 模态下有不同的行为,可以到具体模块的文档去查看在不同模态下有什么不同的行为.
备注:
受"训练模态""评估模态"影响的模块有 "dropout层"及"batch normalization层".其它的暂不知道
本文详细介绍了PyTorch中torch.nn.Module.eval()函数的作用,即设置模块为评估模式。此模式对某些模块如Dropout和BatchNormalization的行为有显著影响,提供了在训练和评估模式下模块行为差异的概述。
3027

被折叠的 条评论
为什么被折叠?



