public class ComputationGraphConfiguration extends Object implements Serializable, 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 BackpropType |
backpropType |
protected CacheMode |
cacheMode |
protected org.nd4j.linalg.api.buffer.DataType |
dataType |
protected NeuralNetConfiguration |
defaultConfiguration |
protected int |
epochCount |
protected WorkspaceMode |
inferenceWorkspaceMode |
protected int |
iterationCount |
protected List<String> |
networkInputs
List of inputs to the network, by name
|
protected List<String> |
networkOutputs
List of network outputs, by name
|
protected int |
tbpttBackLength |
protected int |
tbpttFwdLength |
protected int[] |
topologicalOrder |
protected List<String> |
topologicalOrderStr |
protected WorkspaceMode |
trainingWorkspaceMode |
protected boolean |
validateOutputLayerConfig |
protected Map<String,List<String>> |
vertexInputs |
protected Map<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(String json)
Create a computation graph configuration from json
|
static ComputationGraphConfiguration |
fromYaml(String json)
Create a neural net configuration from YAML
|
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.
|
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.
|
NetworkMemoryReport |
getMemoryReport(InputType... inputTypes)
Get a
MemoryReport for the given computation graph configuration. |
String |
toJson() |
String |
toString() |
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 Map<String,GraphVertex> vertices
protected WorkspaceMode trainingWorkspaceMode
protected WorkspaceMode inferenceWorkspaceMode
protected CacheMode cacheMode
protected org.nd4j.linalg.api.buffer.DataType dataType
protected boolean validateOutputLayerConfig
protected BackpropType backpropType
protected int tbpttFwdLength
protected int tbpttBackLength
protected NeuralNetConfiguration defaultConfiguration
protected int iterationCount
protected int epochCount
protected int[] topologicalOrder
public String toYaml()
public static ComputationGraphConfiguration fromYaml(String json)
json
- the neural net configuration from YAMLComputationGraphConfiguration
public String toJson()
public static ComputationGraphConfiguration fromJson(String json)
json
- the neural net configuration from jsonComputationGraphConfiguration
public ComputationGraphConfiguration clone()
public void validate()
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 anywhereIllegalStateException
- 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 Map<String,InputType> getLayerActivationTypes(InputType... inputTypes)
inputTypes
- Input types for the networkpublic Map<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 networkCopyright © 2019. All rights reserved.