NetEvaluationMode
is an option that can be given when applying neural net functions to input data, specifying whether the net should use training-specific behavior.
Details

- When a net is applied to an input, net[input,NetEvaluationMode->spec] specifies how layers such as DropoutLayer within the net should behave.
- With the setting NetEvaluationMode->"Test", the normal behavior of layers like DropoutLayer will be used.
- With the setting NetEvaluationMode->"Train", the training-specific behavior of layers like DropoutLayer will be used.
- Recurrent layers such as LongShortTermMemoryLayer also have training-specific behavior via the "Dropout" option.
- Training a net with NetTrain[net,…] will automatically use training-specific behavior.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Normally, training layers like DropoutLayer act like the identity. Create a dropout layer and apply it to an input:

https://wolfram.com/xid/0c0rhshlwdek4-m8xhmo


https://wolfram.com/xid/0c0rhshlwdek4-un467n

Apply the dropout layer with its training behavior, in which roughly half of the vector components are set to zero and the other half are doubled:

https://wolfram.com/xid/0c0rhshlwdek4-usw7a9

Create an ImageAugmentationLayer that takes an image of size 128×128 and returns an image crop of size 64×64:

https://wolfram.com/xid/0c0rhshlwdek4-cz9q25

Apply the layer to an image, obtaining the center crop:

https://wolfram.com/xid/0c0rhshlwdek4-w8pza0

Apply the layer to an image, specifying that training behavior be used. A random crop will be made and the image will be reflected with the given probabilities:

https://wolfram.com/xid/0c0rhshlwdek4-djcxfj

Possible Issues (1)Common pitfalls and unexpected behavior
Currently, any randomness invoked by NetEvaluationMode->"Train" is not affected by SeedRandom and BlockRandom:

https://wolfram.com/xid/0c0rhshlwdek4-c9zqq8


https://wolfram.com/xid/0c0rhshlwdek4-oouzin


https://wolfram.com/xid/0c0rhshlwdek4-wzmtxu

Wolfram Research (2017), NetEvaluationMode, Wolfram Language function, https://reference.wolfram.com/language/ref/NetEvaluationMode.html.
Text
Wolfram Research (2017), NetEvaluationMode, Wolfram Language function, https://reference.wolfram.com/language/ref/NetEvaluationMode.html.
Wolfram Research (2017), NetEvaluationMode, Wolfram Language function, https://reference.wolfram.com/language/ref/NetEvaluationMode.html.
CMS
Wolfram Language. 2017. "NetEvaluationMode." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NetEvaluationMode.html.
Wolfram Language. 2017. "NetEvaluationMode." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NetEvaluationMode.html.
APA
Wolfram Language. (2017). NetEvaluationMode. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NetEvaluationMode.html
Wolfram Language. (2017). NetEvaluationMode. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NetEvaluationMode.html
BibTeX
@misc{reference.wolfram_2025_netevaluationmode, author="Wolfram Research", title="{NetEvaluationMode}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/NetEvaluationMode.html}", note=[Accessed: 05-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_netevaluationmode, organization={Wolfram Research}, title={NetEvaluationMode}, year={2017}, url={https://reference.wolfram.com/language/ref/NetEvaluationMode.html}, note=[Accessed: 05-May-2025
]}