public class ComputationGraphConfiguration
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
MultiLayerConfiguration
, but allows considerably greater flexibility for the network
architecture.GraphVertex
,
which may for example be a layer or a vertex/object that defines arbitrary forward and backward pass functionality.OutputLayer
instances.
Typical usage:ComputationGraphConfiguration conf = new NeuralNetConfiguration.Builder()....graphBuilder()...build();
Modifier and Type | Class and Description |
---|---|
static class |
ComputationGraphConfiguration.GraphBuilder |
Modifier and Type | Field and Description |
---|---|
protected boolean |
backprop |
protected BackpropType |
backpropType |
protected CacheMode |
cacheMode |
protected NeuralNetConfiguration |
defaultConfiguration |
protected int |
epochCount |
protected WorkspaceMode |
inferenceWorkspaceMode |
protected int |
iterationCount |
protected java.util.List<java.lang.String> |
networkInputs
List of inputs to the network, by name
|
protected java.util.List<java.lang.String> |
networkOutputs
List of network outputs, by name
|
protected boolean |
pretrain |
protected int |
tbpttBackLength |
protected int |
tbpttFwdLength |
protected int[] |
topologicalOrder |
protected java.util.List<java.lang.String> |
topologicalOrderStr |
protected WorkspaceMode |
trainingWorkspaceMode |
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
vertexInputs |
protected java.util.Map<java.lang.String,GraphVertex> |
vertices |
Constructor and Description |
---|
ComputationGraphConfiguration() |
Modifier and Type | Method and Description |
---|---|
void |
addPreProcessors(InputType... inputTypes)
Add preprocessors automatically, given the specified types of inputs for the network.
|
ComputationGraphConfiguration |
clone() |
static ComputationGraphConfiguration |
fromJson(java.lang.String json)
Create a computation graph configuration from json
|
static ComputationGraphConfiguration |
fromYaml(java.lang.String json)
Create a neural net configuration from json
|
java.util.Map<java.lang.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.
|
java.util.Map<java.lang.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.
|
NetworkMemoryReport |
getMemoryReport(InputType... inputTypes)
Get a
MemoryReport for the given computation graph configuration. |
java.lang.String |
toJson() |
java.lang.String |
toString() |
java.lang.String |
toYaml() |
void |
validate()
Check the configuration, make sure it is valid
|
void |
validate(boolean allowDisconnected,
boolean allowNoOutput)
Check the configuration, make sure it is valid
|
protected java.util.Map<java.lang.String,GraphVertex> vertices
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> vertexInputs
protected WorkspaceMode trainingWorkspaceMode
protected WorkspaceMode inferenceWorkspaceMode
protected CacheMode cacheMode
protected java.util.List<java.lang.String> networkInputs
protected java.util.List<java.lang.String> networkOutputs
protected boolean pretrain
protected boolean backprop
protected BackpropType backpropType
protected int tbpttFwdLength
protected int tbpttBackLength
protected NeuralNetConfiguration defaultConfiguration
protected int iterationCount
protected int epochCount
protected int[] topologicalOrder
protected java.util.List<java.lang.String> topologicalOrderStr
public java.lang.String toYaml()
public static ComputationGraphConfiguration fromYaml(java.lang.String json)
json
- the neural net configuration from jsonComputationGraphConfiguration
public java.lang.String toJson()
public static ComputationGraphConfiguration fromJson(java.lang.String json)
json
- the neural net configuration from jsonComputationGraphConfiguration
public java.lang.String toString()
toString
in class java.lang.Object
public ComputationGraphConfiguration clone()
clone
in class java.lang.Object
public void validate()
java.lang.IllegalStateException
- if configuration is not validpublic void validate(boolean allowDisconnected, boolean allowNoOutput)
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 anywherejava.lang.IllegalStateException
- if configuration is not validpublic void addPreProcessors(InputType... inputTypes)
InputType
class, in the same order in which the inputs were defined in the original configuration..addPreProcessors(InputType.convolutional(28,28,1),InputType.feedForward())
.ComputationGraphConfiguration.GraphBuilder.setInputTypes(InputType...)
functionality.
See that method for details.public java.util.Map<java.lang.String,InputType> getLayerActivationTypes(InputType... inputTypes)
inputTypes
- Input types for the networkpublic java.util.Map<java.lang.String,InputType> getLayerActivationTypes(boolean addPreprocIfNecessary, InputType... inputTypes)
addPreprocIfNecessary
- If true: add any required preprocessors, in the process of calculating the layer
activation sizesinputTypes
- Input types for the networkpublic NetworkMemoryReport getMemoryReport(InputType... inputTypes)
MemoryReport
for the given computation graph configuration. This is used to estimate the
memory requirements for the given network configuration and inputinputTypes
- Input types for the network