Class BertPretrainingBlock

  • All Implemented Interfaces:
    Block

    public class BertPretrainingBlock
    extends AbstractBlock
    Creates a block that performs all bert pretraining tasks (next sentence and masked language).
    • Constructor Detail

      • BertPretrainingBlock

        public BertPretrainingBlock​(BertBlock.Builder builder)
        Creates a new Bert pretraining block fitting the given bert configuration.
        Parameters:
        builder - a builder with a bert configuration
    • Method Detail

      • initializeChildBlocks

        public void initializeChildBlocks​(NDManager manager,
                                          DataType dataType,
                                          Shape... inputShapes)
        Initializes the Child blocks of this block. You need to override this method if your subclass has child blocks. Used to determine the correct input shapes for child blocks based on the requested input shape for this block.
        Overrides:
        initializeChildBlocks in class AbstractBaseBlock
        Parameters:
        manager - the manager to use for initialization
        dataType - the requested data type
        inputShapes - the expected input shapes for this block
      • getOutputShapes

        public Shape[] getOutputShapes​(Shape[] inputShapes)
        Returns the expected output shapes of the block for the specified input shapes.
        Parameters:
        inputShapes - the shapes of the inputs
        Returns:
        the expected output shapes of the block