Class BidirectionalParamInitializer

    • Constructor Detail

      • BidirectionalParamInitializer

        public BidirectionalParamInitializer​(Bidirectional layer)
    • Method Detail

      • paramKeys

        public List<String> paramKeys​(Layer layer)
        Description copied from interface: ParamInitializer
        Get a list of all parameter keys given the layer configuration
        Specified by:
        paramKeys in interface ParamInitializer
        Parameters:
        layer - Layer
        Returns:
        All parameter keys
      • isWeightParam

        public boolean isWeightParam​(Layer layer,
                                     String key)
        Description copied from interface: ParamInitializer
        Is the specified parameter a weight?
        Specified by:
        isWeightParam in interface ParamInitializer
        Parameters:
        layer - Layer
        key - Key to check
        Returns:
        True if parameter is a weight
      • isBiasParam

        public boolean isBiasParam​(Layer layer,
                                   String key)
        Description copied from interface: ParamInitializer
        Is the specified parameter a bias?
        Specified by:
        isBiasParam in interface ParamInitializer
        Parameters:
        layer - Layer
        key - Key to check
        Returns:
        True if parameter is a bias
      • init

        public Map<String,​INDArray> init​(NeuralNetConfiguration conf,
                                               INDArray paramsView,
                                               boolean initializeParams)
        Description copied from interface: ParamInitializer
        Initialize the parameters
        Specified by:
        init in interface ParamInitializer
        Parameters:
        conf - the configuration
        paramsView - a view of the full network (backprop) parameters
        initializeParams - if true: initialize the parameters according to the configuration. If false: don't modify the values in the paramsView array (but do select out the appropriate subset, reshape etc as required)
        Returns:
        Map of parameters keyed by type (view of the 'paramsView' array)
      • getGradientsFromFlattened

        public Map<String,​INDArray> getGradientsFromFlattened​(NeuralNetConfiguration conf,
                                                                    INDArray gradientView)
        Description copied from interface: ParamInitializer
        Return a map of gradients (in their standard non-flattened representation), taken from the flattened (row vector) gradientView array. The idea is that operates in exactly the same way as the paramsView does in #init(Map, NeuralNetConfiguration, INDArray); thus the position in the view (and, the array orders) must match those of the parameters
        Specified by:
        getGradientsFromFlattened in interface ParamInitializer
        Parameters:
        conf - Configuration
        gradientView - The flattened gradients array, as a view of the larger array
        Returns:
        A map containing an array by parameter type, that is a view of the full network gradients array