Package deepboof.graph
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 java.lang.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 Summary
-
Constructor Summary
Constructors Constructor Description FunctionSequence(java.util.List<Node<T,F>> sequence, java.lang.Class<T> type)Configures the sequence -
Method Summary
Modifier and Type Method Description TgetNodeOutput(int index)int[]getOutputShape()java.util.List<Node<T,F>>getSequence()java.lang.Class<T>getTensorType()voidinitialize(int[] inputShape)Initialize and declare memory for all nodes in the network given the shape of the input tensorvoidprocess(T input, T output)Process the input tensor and compute the output tensor by feeding the results through the network.voidsetParameters(java.util.Map<java.lang.String,java.util.List<T>> nodeParameters)Specify the parameters for each node in the network
-
Field Details
-
Constructor Details
-
FunctionSequence
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
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
Process the input tensor and compute the output tensor by feeding the results through the network. Must callinitialize(int[])once with the same shape as the input tensor. Must also callsetParameters(java.util.Map<java.lang.String, java.util.List<T>>)- Parameters:
input- Input tensoroutput- Storage for output tensor.
-
getSequence
-
getNodeOutput
-
getOutputShape
public int[] getOutputShape() -
getTensorType
-