Class ComputationGraphConfiguration

    • Field Detail

      • trainingWorkspaceMode

        protected WorkspaceMode trainingWorkspaceMode
      • inferenceWorkspaceMode

        protected WorkspaceMode inferenceWorkspaceMode
      • validateOutputLayerConfig

        protected boolean validateOutputLayerConfig
      • networkInputs

        protected List<String> networkInputs
        List of inputs to the network, by name
      • networkOutputs

        protected List<String> networkOutputs
        List of network outputs, by name
      • tbpttFwdLength

        protected int tbpttFwdLength
      • tbpttBackLength

        protected int tbpttBackLength
      • iterationCount

        protected int iterationCount
      • epochCount

        protected int epochCount
      • topologicalOrder

        protected int[] topologicalOrder
      • topologicalOrderStr

        protected List<String> topologicalOrderStr
    • Constructor Detail

      • ComputationGraphConfiguration

        public ComputationGraphConfiguration()
    • Method Detail

      • toYaml

        public String toYaml()
        Returns:
        YAML representation of configuration
      • toJson

        public String toJson()
        Returns:
        JSON representation of computation graph configuration
      • validate

        public void validate()
        Check the configuration, make sure it is valid
        Throws:
        IllegalStateException - if configuration is not valid
      • validate

        public void validate​(boolean allowDisconnected,
                             boolean allowNoOutput)
        Check the configuration, make sure it is valid
        Parameters:
        allowDisconnected - If true: don't throw an exception on vertices that are 'disconnected'. A disconnected vertex is one that is not an output, and doesn't connect to any other vertices. i.e., it's output activations don't go anywhere
        Throws:
        IllegalStateException - if configuration is not valid
      • addPreProcessors

        public void addPreProcessors​(InputType... inputTypes)
        Add preprocessors automatically, given the specified types of inputs for the network. Inputs are specified using the InputType class, in the same order in which the inputs were defined in the original configuration.
        For example, in a network with two inputs: a convolutional input (28x28x1 images) and feed forward inputs, use .addPreProcessors(InputType.convolutional(28,28,1),InputType.feedForward()).
        For the CNN->Dense and CNN->RNN transitions, the nIns on the Dense/RNN layers will also be added automatically. NOTE: This method will be called automatically when using the ComputationGraphConfiguration.GraphBuilder.setInputTypes(InputType...) functionality. See that method for details.
      • addPreProcessors

        public void addPreProcessors​(boolean addPreprocIfNecessary,
                                     boolean forceOverrideInputs,
                                     InputType... inputTypes)
        Add preprocessors automatically, given the specified types of inputs for the network. Inputs are specified using the InputType class, in the same order in which the inputs were defined in the original configuration.
        For example, in a network with two inputs: a convolutional input (28x28x1 images) and feed forward inputs, use .addPreProcessors(InputType.convolutional(28,28,1),InputType.feedForward()).
        For the CNN->Dense and CNN->RNN transitions, the nIns on the Dense/RNN layers will also be added automatically. NOTE: This method will be called automatically when using the ComputationGraphConfiguration.GraphBuilder.setInputTypes(InputType...) functionality. See that method for details.
        Parameters:
        forceOverrideInputs - whether to forcibly over ride inputs or not when setting up pre processing
        inputTypes - the input types to set
      • addPreProcessors

        public void addPreProcessors​(boolean forceOverrideInputs,
                                     InputType... inputTypes)
        Add preprocessors automatically, given the specified types of inputs for the network. Inputs are specified using the InputType class, in the same order in which the inputs were defined in the original configuration.
        For example, in a network with two inputs: a convolutional input (28x28x1 images) and feed forward inputs, use .addPreProcessors(InputType.convolutional(28,28,1),InputType.feedForward()).
        For the CNN->Dense and CNN->RNN transitions, the nIns on the Dense/RNN layers will also be added automatically. NOTE: This method will be called automatically when using the ComputationGraphConfiguration.GraphBuilder.setInputTypes(InputType...) functionality. See that method for details.
        Parameters:
        forceOverrideInputs - whether to forcibly over ride inputs or not when setting up pre processing
        inputTypes - the input types to set
      • getLayerActivationTypes

        public Map<String,​InputType> getLayerActivationTypes​(InputType... inputTypes)
        For the given input shape/type for the network, return a map of activation sizes for each layer and vertex in the graph. Note that this method will automatically add preprocessors if required, to handle (for example) the transition between CNN and dense layers.
        Parameters:
        inputTypes - Input types for the network
        Returns:
        A map of activation types for the graph (key: vertex name. value: type of activations out of that vertex)
      • getLayerActivationTypes

        public Map<String,​InputType> getLayerActivationTypes​(boolean addPreprocIfNecessary,
                                                                   boolean overrideInputs,
                                                                   InputType... inputTypes)
        For the given input shape/type for the network, return a map of activation sizes for each layer and vertex in the graph. Note that this method can also add preprocessors if required (to handle transitions between some layer types such as convolutional -> dense, for example)
        Parameters:
        addPreprocIfNecessary - If true: add any required preprocessors, in the process of calculating the layer activation sizes
        overrideInputs - whether to forcibly over ride inputs when setting inputs
        inputTypes - Input types for the network
        Returns:
        A map of activation types for the graph (key: vertex name. value: type of activations out of that vertex)
      • getLayerActivationTypes

        public Map<String,​InputType> getLayerActivationTypes​(boolean addPreprocIfNecessary,
                                                                   InputType... inputTypes)
        For the given input shape/type for the network, return a map of activation sizes for each layer and vertex in the graph. Note that this method can also add preprocessors if required (to handle transitions between some layer types such as convolutional -> dense, for example)
        Parameters:
        addPreprocIfNecessary - If true: add any required preprocessors, in the process of calculating the layer activation sizes
        inputTypes - Input types for the network
        Returns:
        A map of activation types for the graph (key: vertex name. value: type of activations out of that vertex)
      • getMemoryReport

        public NetworkMemoryReport getMemoryReport​(InputType... inputTypes)
        Get a MemoryReport for the given computation graph configuration. This is used to estimate the memory requirements for the given network configuration and input
        Parameters:
        inputTypes - Input types for the network
        Returns:
        Memory report for the network