Class SameDiffVertex

    • Constructor Detail

      • SameDiffVertex

        public SameDiffVertex()
    • Method Detail

      • initializeParameters

        public abstract void initializeParameters​(Map<String,​INDArray> params)
        Set the initial parameter values for this layer, if required
        Parameters:
        params - Parameter arrays that may be initialized
      • numParams

        public long numParams​(boolean backprop)
        Specified by:
        numParams in class GraphVertex
      • minVertexInputs

        public int minVertexInputs()
        Specified by:
        minVertexInputs in class GraphVertex
        Returns:
        The Smallest valid number of inputs to this vertex
      • maxVertexInputs

        public int maxVertexInputs()
        Specified by:
        maxVertexInputs in class GraphVertex
        Returns:
        The largest valid number of inputs to this vertex
      • instantiate

        public GraphVertex instantiate​(ComputationGraph graph,
                                       String name,
                                       int idx,
                                       INDArray paramsView,
                                       boolean initializeParams,
                                       DataType networkDatatype)
        Description copied from class: GraphVertex
        Create a GraphVertex instance, for the given computation graph, given the configuration instance.
        Specified by:
        instantiate in class GraphVertex
        Parameters:
        graph - The computation graph that this GraphVertex is to be part of
        name - The name of the GraphVertex object
        idx - The index of the GraphVertex
        paramsView - A view of the full parameters array
        initializeParams - If true: initialize the parameters. If false: make no change to the values in the paramsView array
        Returns:
        The implementation GraphVertex object (i.e., implementation, no the configuration)
      • getOutputType

        public InputType getOutputType​(int layerIndex,
                                       InputType... vertexInputs)
                                throws InvalidInputTypeException
        Description copied from class: GraphVertex
        Determine the type of output for this GraphVertex, given the specified inputs. Given that a GraphVertex may do arbitrary processing or modifications of the inputs, the output types can be quite different to the input type(s).
        This is generally used to determine when to add preprocessors, as well as the input sizes etc for layers
        Specified by:
        getOutputType in class GraphVertex
        Parameters:
        layerIndex - The index of the layer (if appropriate/necessary).
        vertexInputs - The inputs to this vertex
        Returns:
        The type of output for this vertex
        Throws:
        InvalidInputTypeException - If the input type is invalid for this type of GraphVertex
      • validateInput

        public void validateInput​(INDArray[] input)
        Validate input arrays to confirm that they fulfill the assumptions of the layer. If they don't, throw an exception.
        Parameters:
        input - inputs to the layer
      • getMemoryReport

        public MemoryReport getMemoryReport​(InputType... inputTypes)
        Description copied from class: GraphVertex
        This is a report of the estimated memory consumption for the given vertex
        Specified by:
        getMemoryReport in class GraphVertex
        Parameters:
        inputTypes - Input types to the vertex. Memory consumption is often a function of the input type
        Returns:
        Memory report for the vertex
      • paramReshapeOrder

        public char paramReshapeOrder​(String paramName)
      • getRegularizationByParam

        public List<Regularization> getRegularizationByParam​(String paramName)
        Description copied from interface: TrainingConfig
        Get the regularization types (l1/l2/weight decay) for the given parameter. Different parameters may have different regularization types.
        Specified by:
        getRegularizationByParam in interface TrainingConfig
        Parameters:
        paramName - Parameter name ("W", "b" etc)
        Returns:
        Regularization types (if any) for the specified parameter
      • isPretrainParam

        public boolean isPretrainParam​(String paramName)
        Description copied from interface: TrainingConfig
        Is the specified parameter a layerwise pretraining only parameter?
        For example, visible bias params in an autoencoder (or, decoder params in a variational autoencoder) aren't used during supervised backprop.
        Layers (like DenseLayer, etc) with no pretrainable parameters will return false for all (valid) inputs.
        Specified by:
        isPretrainParam in interface TrainingConfig
        Parameters:
        paramName - Parameter name/key
        Returns:
        True if the parameter is for layerwise pretraining only, false otherwise
      • getUpdaterByParam

        public IUpdater getUpdaterByParam​(String paramName)
        Description copied from interface: TrainingConfig
        Get the updater for the given parameter. Typically the same updater will be used for all updaters, but this is not necessarily the case
        Specified by:
        getUpdaterByParam in interface TrainingConfig
        Parameters:
        paramName - Parameter name
        Returns:
        IUpdater for the parameter