Class RecurrentBlock.BaseBuilder<T extends RecurrentBlock.BaseBuilder>

    • Constructor Summary

      Constructors 
      Constructor Description
      BaseBuilder()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      T optBatchFirst​(boolean batchFirst)
      Sets the optional batchFirst flag that indicates whether the input is batch major or not.
      T optBidirectional​(boolean useBidirectional)
      Sets the optional parameter that indicates whether to use bidirectional recurrent layers.
      T optDropRate​(float dropRate)
      Sets the drop rate of the dropout on the outputs of each RNN layer, except the last layer.
      T optHasBiases​(boolean hasBiases)
      Sets the optional biases flag that indicates whether to use biases or not.
      T optReturnState​(boolean returnState)
      Sets the optional flag that indicates whether to return state or not.
      protected abstract T self()  
      T setNumLayers​(int numLayers)
      Sets the Required number of stacked layers.
      T setStateSize​(int stateSize)
      Sets the Required size of the state for each layer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • dropRate

        protected float dropRate
      • stateSize

        protected long stateSize
      • numLayers

        protected int numLayers
      • batchFirst

        protected boolean batchFirst
      • hasBiases

        protected boolean hasBiases
      • bidirectional

        protected boolean bidirectional
      • returnState

        protected boolean returnState
    • Constructor Detail

      • BaseBuilder

        public BaseBuilder()
    • Method Detail

      • optDropRate

        public T optDropRate​(float dropRate)
        Sets the drop rate of the dropout on the outputs of each RNN layer, except the last layer.
        Parameters:
        dropRate - the drop rate of the dropout
        Returns:
        this Builder
      • setStateSize

        public T setStateSize​(int stateSize)
        Sets the Required size of the state for each layer.
        Parameters:
        stateSize - the size of the state for each layer
        Returns:
        this Builder
      • setNumLayers

        public T setNumLayers​(int numLayers)
        Sets the Required number of stacked layers.
        Parameters:
        numLayers - the number of stacked layers
        Returns:
        this Builder
      • optBidirectional

        public T optBidirectional​(boolean useBidirectional)
        Sets the optional parameter that indicates whether to use bidirectional recurrent layers.
        Parameters:
        useBidirectional - whether to use bidirectional recurrent layers
        Returns:
        this Builder
      • optBatchFirst

        public T optBatchFirst​(boolean batchFirst)
        Sets the optional batchFirst flag that indicates whether the input is batch major or not. The default value is true.
        Parameters:
        batchFirst - whether the input is batch major or not
        Returns:
        this Builder
      • optHasBiases

        public T optHasBiases​(boolean hasBiases)
        Sets the optional biases flag that indicates whether to use biases or not.
        Parameters:
        hasBiases - whether to use biases or not
        Returns:
        this Builder
      • optReturnState

        public T optReturnState​(boolean returnState)
        Sets the optional flag that indicates whether to return state or not. This is typically useful when you use RecurrentBlock in Sequential block. The default value is false.
        Parameters:
        returnState - whether to return state or not
        Returns:
        this Builder
      • self

        protected abstract T self()