public class KerasModel extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
className |
protected static KerasModelConfiguration |
config |
protected KerasLayer.DimOrder |
dimOrder |
protected boolean |
enforceTrainingConfig |
protected ArrayList<String> |
inputLayerNames |
protected String |
kerasBackend |
protected int |
kerasMajorVersion |
protected Map<String,KerasLayer> |
layers |
protected List<KerasLayer> |
layersOrdered |
protected KerasModelBuilder |
modelBuilder |
protected IUpdater |
optimizer |
protected ArrayList<String> |
outputLayerNames |
protected Map<String,InputType> |
outputTypes |
protected int |
truncatedBPTT |
protected boolean |
useTruncatedBPTT |
Modifier | Constructor and Description |
---|---|
|
KerasModel() |
|
KerasModel(KerasModelBuilder modelBuilder)
(Recommended) Builder-pattern constructor for (Functional API) Model.
|
protected |
KerasModel(String modelJson,
String modelYaml,
Hdf5Archive weightsArchive,
String weightsRoot,
String trainingJson,
Hdf5Archive trainingArchive,
boolean enforceTrainingConfig,
int[] inputShape,
KerasLayer.DimOrder dimOrder)
(Not recommended) Constructor for (Functional API) Model from model configuration
(JSON or YAML), training configuration (JSON), weights, and "training mode"
boolean indicator.
|
Modifier and Type | Method and Description |
---|---|
ComputationGraph |
getComputationGraph()
Build a ComputationGraph from this Keras Model configuration and import weights.
|
ComputationGraph |
getComputationGraph(boolean importWeights)
Build a ComputationGraph from this Keras Model configuration and (optionally) import weights.
|
ComputationGraphConfiguration |
getComputationGraphConfiguration()
Configure a ComputationGraph from this Keras Model configuration.
|
KerasModelBuilder |
modelBuilder() |
protected static KerasModelConfiguration config
protected KerasModelBuilder modelBuilder
protected String className
protected boolean enforceTrainingConfig
protected Map<String,KerasLayer> layers
protected List<KerasLayer> layersOrdered
protected boolean useTruncatedBPTT
protected int truncatedBPTT
protected int kerasMajorVersion
protected String kerasBackend
protected KerasLayer.DimOrder dimOrder
protected IUpdater optimizer
public KerasModel()
public KerasModel(KerasModelBuilder modelBuilder) throws UnsupportedKerasConfigurationException, IOException, InvalidKerasConfigurationException
modelBuilder
- builder objectIOException
- IO exceptionInvalidKerasConfigurationException
- Invalid Keras configUnsupportedKerasConfigurationException
- Unsupported Keras configprotected KerasModel(String modelJson, String modelYaml, Hdf5Archive weightsArchive, String weightsRoot, String trainingJson, Hdf5Archive trainingArchive, boolean enforceTrainingConfig, int[] inputShape, KerasLayer.DimOrder dimOrder) throws IOException, InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
modelJson
- model configuration JSON stringmodelYaml
- model configuration YAML stringenforceTrainingConfig
- whether to enforce training-related configurationsIOException
- IO exceptionInvalidKerasConfigurationException
- Invalid Keras configUnsupportedKerasConfigurationException
- Unsupported Keras configpublic KerasModelBuilder modelBuilder()
public ComputationGraphConfiguration getComputationGraphConfiguration() throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
InvalidKerasConfigurationException
UnsupportedKerasConfigurationException
public ComputationGraph getComputationGraph() throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
InvalidKerasConfigurationException
UnsupportedKerasConfigurationException
public ComputationGraph getComputationGraph(boolean importWeights) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
importWeights
- whether to import weightsInvalidKerasConfigurationException
UnsupportedKerasConfigurationException
Copyright © 2022. All rights reserved.