public static class TransferLearning.GraphBuilder
extends java.lang.Object
Constructor and Description |
---|
GraphBuilder(ComputationGraph origGraph)
Computation Graph to tweak for transfer learning
|
Modifier and Type | Method and Description |
---|---|
protected TransferLearning.GraphBuilder |
addInputs(java.lang.String... inputNames) |
TransferLearning.GraphBuilder |
addLayer(java.lang.String layerName,
Layer layer,
InputPreProcessor preProcessor,
java.lang.String... layerInputs)
Add a layer with a specified preprocessor
|
TransferLearning.GraphBuilder |
addLayer(java.lang.String layerName,
Layer layer,
java.lang.String... layerInputs)
Add a layer of the specified configuration to the computation graph
|
TransferLearning.GraphBuilder |
addVertex(java.lang.String vertexName,
GraphVertex vertex,
java.lang.String... vertexInputs)
Add a vertex of the given configuration to the computation graph
|
ComputationGraph |
build()
Returns a computation graph build to specifications.
|
TransferLearning.GraphBuilder |
fineTuneConfiguration(FineTuneConfiguration fineTuneConfiguration)
Set parameters to selectively override existing learning parameters
Usage eg.
|
TransferLearning.GraphBuilder |
nOutReplace(java.lang.String layerName,
int nOut,
Distribution dist)
Modify the architecture of a vertex layer by changing nOut
Note this will also affect the vertex layer that follows the layer specified, unless it is the output layer
Currently does not support modifying nOut of layers that feed into non-layer vertices like merge, subset etc
To modify nOut for such vertices use remove vertex, followed by add vertex
Can specify different weight init schemes for the specified layer and the layer that follows it.
|
TransferLearning.GraphBuilder |
nOutReplace(java.lang.String layerName,
int nOut,
Distribution dist,
Distribution distNext)
Modified nOut of specified layer.
|
TransferLearning.GraphBuilder |
nOutReplace(java.lang.String layerName,
int nOut,
Distribution dist,
WeightInit scheme) |
TransferLearning.GraphBuilder |
nOutReplace(java.lang.String layerName,
int nOut,
WeightInit scheme)
Modify the architecture of a vertex layer by changing nOut
Note this will also affect the vertex layer that follows the layer specified, unless it is the output layer
Currently does not support modifying nOut of layers that feed into non-layer vertices like merge, subset etc
To modify nOut for such vertices use remove vertex, followed by add vertex
Can specify different weight init schemes for the specified layer and the layer that follows it.
|
TransferLearning.GraphBuilder |
nOutReplace(java.lang.String layerName,
int nOut,
WeightInit scheme,
Distribution dist) |
TransferLearning.GraphBuilder |
nOutReplace(java.lang.String layerName,
int nOut,
WeightInit scheme,
WeightInit schemeNext) |
TransferLearning.GraphBuilder |
removeVertexAndConnections(java.lang.String vertexName)
Remove specified vertex and it's connections from the computation graph
|
TransferLearning.GraphBuilder |
removeVertexKeepConnections(java.lang.String outputName)
Remove the specified vertex from the computation graph but keep it's connections.
|
TransferLearning.GraphBuilder |
setFeatureExtractor(java.lang.String... layerName)
Specify a layer vertex to set as a "feature extractor"
The specified layer vertex and the layers on the path from an input vertex to it it will be "frozen" with parameters staying constant
|
TransferLearning.GraphBuilder |
setOutputs(java.lang.String... outputNames)
Set outputs to the computation graph, will add to ones that are existing
Also determines the order, like in ComputationGraphConfiguration
|
public GraphBuilder(ComputationGraph origGraph)
origGraph
- public TransferLearning.GraphBuilder fineTuneConfiguration(FineTuneConfiguration fineTuneConfiguration)
fineTuneConfiguration
- public TransferLearning.GraphBuilder setFeatureExtractor(java.lang.String... layerName)
layerName
- public TransferLearning.GraphBuilder nOutReplace(java.lang.String layerName, int nOut, WeightInit scheme)
layerName
- The name of the layer to change nOut ofnOut
- Value of nOut to change toscheme
- Weight init scheme to use for params in layerName and the layers following itDISTRIBUTION
public TransferLearning.GraphBuilder nOutReplace(java.lang.String layerName, int nOut, Distribution dist)
layerName
- The name of the layer to change nOut ofnOut
- Value of nOut to change todist
- Weight distribution scheme to useDISTRIBUTION
public TransferLearning.GraphBuilder nOutReplace(java.lang.String layerName, int nOut, Distribution dist, Distribution distNext)
layerName
- The name of the layer to change nOut ofnOut
- Value of nOut to change todist
- Weight distribution scheme to use for layerNamedistNext
- Weight distribution scheme for layers following layerNameDISTRIBUTION
public TransferLearning.GraphBuilder nOutReplace(java.lang.String layerName, int nOut, WeightInit scheme, Distribution dist)
public TransferLearning.GraphBuilder nOutReplace(java.lang.String layerName, int nOut, Distribution dist, WeightInit scheme)
public TransferLearning.GraphBuilder nOutReplace(java.lang.String layerName, int nOut, WeightInit scheme, WeightInit schemeNext)
public TransferLearning.GraphBuilder removeVertexKeepConnections(java.lang.String outputName)
outputName
- public TransferLearning.GraphBuilder removeVertexAndConnections(java.lang.String vertexName)
vertexName
- public TransferLearning.GraphBuilder addLayer(java.lang.String layerName, Layer layer, java.lang.String... layerInputs)
layerName
- layer
- layerInputs
- public TransferLearning.GraphBuilder addLayer(java.lang.String layerName, Layer layer, InputPreProcessor preProcessor, java.lang.String... layerInputs)
layerName
- layer
- preProcessor
- layerInputs
- public TransferLearning.GraphBuilder addVertex(java.lang.String vertexName, GraphVertex vertex, java.lang.String... vertexInputs)
vertexName
- vertex
- vertexInputs
- public TransferLearning.GraphBuilder setOutputs(java.lang.String... outputNames)
outputNames
- protected TransferLearning.GraphBuilder addInputs(java.lang.String... inputNames)
public ComputationGraph build()