This class implements a layer that trains and calculates transition probabilities in a conditional random field (CRF).
void SetNumberOfClasses( int numberOfClasses );
void SetPaddingClass( int paddingClass );
Sets the number of the empty class used to fill the sequence end.
void SetDropoutRate( float newDropoutRate );
void SetBestPrevClassEnabled( bool enabled );
Enables computation of the first (O_BestPrevClass
) output during training.
This setting allows you to connect the CBestSequenceLayer and get predictions for every batch during training.
By default disabled during training. During inference the first output is always computed, ignoring this setting.
The layer trains the transition probabilities, but they are not available to the user.
The layer may have one or two inputs.
The first input accepts a blob with the object sequences, of the dimensions:
BatchLength
is the sequence lengthBatchWidth
is the number of sequences in the setListSize
is equal to1
Height * Width * Depth * Channels
is the object size
[Optional] The second input accepts a blob with int
data that contains the correct class sequences. This input is required for training. The blob dimensions are:
BatchLength
is equal to the first inputBatchLength
BatchWidth
is equal to the first inputBatchWidth
- the other dimensions are equal to
1
The layer may have two to three outputs.
The first output is a blob with int
data that contains optimal class sequences. The blob dimensions are:
BatchLength
is equal to the inputs'BatchLength
BatchWidth
is equal to the inputs'BatchWidth
Channels
is equal toGetNumberOfClasses()
- the other dimensions are equal to
1
The second output is a blob with float
data that contains non-normalized logarithm of optimal class sequences probabilities. It has the same dimensions as the first output.
[Optional] The third output will be there only if the layer has two inputs. It contains a blob with non-normalized logarithm of the correct class sequences probabilities. The blob dimensions are:
BatchLength
is equal to the inputs'BatchLength
BatchWidth
is equal to the inputs'BatchWidth
- the other dimensions are equal to
1
The CBestSequenceLayer class extracts the best sequence using the first two outputs.