.FastAI
StatefulEncoding
abstract type
defined in module
FastAI
abstract type StatefulEncoding <: Encoding
Encoding that needs to compute some state from the whole sample, even if it only transforms some of the blocks. This could be random state for stochastic augmentations that needs to be the same for every block that is encoded.
The state is created by calling
encodestate(encoding, context, blocks, sample)
and passed to recursive calls with the keyword argument
state
. As a result, you need to implement
encode
,
decode
,
encode!
,
decode!
with a keyword argument
state
that defaults to the above call.
Same goes for
decode
, which should accept a
state
keyword argument defaulting to
decodestate(encoding, context, blocks, sample)
The following pages link back here:
datablock/encoding.jl , datablock/wrappers.jl , encodings/only.jl