Class FunctionSequence<T extends Tensor<T>,​F extends Function<T>>

java.lang.Object
deepboof.graph.FunctionSequence<T,​F>

public class FunctionSequence<T extends Tensor<T>,​F extends Function<T>>
extends Object
Processes a sequence of forward functions. Any non-cyclical graph with a single input and a single output can be processed by this function. The list of functions passed in to the constructor is assumed to have already been ordered.
  • Field Details

  • Constructor Details

    • FunctionSequence

      public FunctionSequence​(List<Node<T,​F>> sequence, Class<T> type)
      Configures the sequence
      Parameters:
      sequence - Sequence of functions which has been ordered to meet pre-requisites.
      type - Type of tensor
  • Method Details

    • initialize

      public void initialize​(int[] inputShape)
      Initialize and declare memory for all nodes in the network given the shape of the input tensor
      Parameters:
      inputShape - Shape of input tensor.
    • setParameters

      public void setParameters​(Map<String,​List<T>> nodeParameters)
      Specify the parameters for each node in the network
      Parameters:
      nodeParameters - Map where the key is the function/node name and the value is the parameters for that node
    • process

      public void process​(T input, T output)
      Process the input tensor and compute the output tensor by feeding the results through the network. Must call initialize(int[]) once with the same shape as the input tensor. Must also call setParameters(java.util.Map<java.lang.String, java.util.List<T>>)
      Parameters:
      input - Input tensor
      output - Storage for output tensor.
    • getSequence

      public List<Node<T,​F>> getSequence()
    • getNodeOutput

      public T getNodeOutput​(int index)
    • getOutputShape

      public int[] getOutputShape()
    • getTensorType

      public Class<T> getTensorType()