public class FunctionSequence<T extends Tensor<T>,F extends Function<T>>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected TensorFactory<T> |
factory |
protected java.util.Map<java.lang.String,Node<T,F>> |
lookup |
protected java.util.Map<java.lang.String,org.ddogleg.struct.Tuple2<T,T>> |
outputStorage |
protected java.util.List<Node<T,F>> |
sequence |
| Constructor and Description |
|---|
FunctionSequence(java.util.List<Node<T,F>> sequence,
java.lang.Class<T> type)
Configures the sequence
|
| Modifier and Type | Method and Description |
|---|---|
T |
getNodeOutput(int index) |
int[] |
getOutputShape() |
java.util.List<Node<T,F>> |
getSequence() |
java.lang.Class<T> |
getTensorType() |
void |
initialize(int[] inputShape)
Initialize and declare memory for all nodes in the network given the shape of the input tensor
|
void |
process(T input,
T output)
Process the input tensor and compute the output tensor by feeding the results through the network.
|
void |
setParameters(java.util.Map<java.lang.String,java.util.List<T>> nodeParameters)
Specify the parameters for each node in the network
|
protected java.util.Map<java.lang.String,Node<T extends Tensor<T>,F extends Function<T>>> lookup
protected java.util.Map<java.lang.String,org.ddogleg.struct.Tuple2<T extends Tensor<T>,T extends Tensor<T>>> outputStorage
protected TensorFactory<T extends Tensor<T>> factory
public void initialize(int[] inputShape)
inputShape - Shape of input tensor.public void setParameters(java.util.Map<java.lang.String,java.util.List<T>> nodeParameters)
nodeParameters - Map where the key is the function/node name and the value is the parameters for that nodepublic void process(T input, T output)
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>>)input - Input tensoroutput - Storage for output tensor.public T getNodeOutput(int index)
public int[] getOutputShape()
public java.lang.Class<T> getTensorType()