public class KerasSequentialModel extends KerasModel
className, enforceTrainingConfig, HDF5_MODEL_CONFIG_ATTRIBUTE, HDF5_MODEL_WEIGHTS_ROOT, HDF5_TRAINING_CONFIG_ATTRIBUTE, inputLayerNames, layers, layersOrdered, MODEL_CLASS_NAME_MODEL, MODEL_CLASS_NAME_SEQUENTIAL, MODEL_CONFIG_FIELD_INPUT_LAYERS, MODEL_CONFIG_FIELD_LAYERS, MODEL_CONFIG_FIELD_OUTPUT_LAYERS, MODEL_FIELD_CLASS_NAME, MODEL_FIELD_CONFIG, outputLayerNames, outputTypes, TRAINING_CONFIG_FIELD_LOSS, truncatedBPTT, useTruncatedBPTT
Modifier | Constructor and Description |
---|---|
protected |
KerasSequentialModel() |
|
KerasSequentialModel(org.deeplearning4j.nn.modelimport.keras.KerasModel.ModelBuilder modelBuilder)
(Recommended) Builder-pattern constructor for Sequential model.
|
|
KerasSequentialModel(java.lang.String modelJson,
java.lang.String modelYaml,
Hdf5Archive weightsArchive,
java.lang.String weightsRoot,
java.lang.String trainingJson,
Hdf5Archive trainingArchive,
boolean enforceTrainingConfig)
(Not recommended) Constructor for Sequential model from model configuration
(JSON or YAML), training configuration (JSON), weights, and "training mode"
boolean indicator.
|
Modifier and Type | Method and Description |
---|---|
MultiLayerConfiguration |
getMultiLayerConfiguration()
Configure a MultiLayerConfiguration from this Keras Sequential model configuration.
|
MultiLayerNetwork |
getMultiLayerNetwork()
Build a MultiLayerNetwork from this Keras Sequential model configuration.
|
MultiLayerNetwork |
getMultiLayerNetwork(boolean importWeights)
Build a MultiLayerNetwork from this Keras Sequential model configuration and import weights.
|
getComputationGraph, getComputationGraph, getComputationGraphConfiguration, helperCopyWeightsToModel, helperImportTrainingConfiguration, helperImportWeights, helperInferOutputTypes, helperPrepareLayers, parseJsonString, parseYamlString
public KerasSequentialModel(org.deeplearning4j.nn.modelimport.keras.KerasModel.ModelBuilder modelBuilder) throws UnsupportedKerasConfigurationException, java.io.IOException, InvalidKerasConfigurationException
modelBuilder
- builder objectjava.io.IOException
InvalidKerasConfigurationException
UnsupportedKerasConfigurationException
public KerasSequentialModel(java.lang.String modelJson, java.lang.String modelYaml, Hdf5Archive weightsArchive, java.lang.String weightsRoot, java.lang.String trainingJson, Hdf5Archive trainingArchive, boolean enforceTrainingConfig) throws java.io.IOException, InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
modelJson
- model configuration JSON stringmodelYaml
- model configuration YAML stringtrainingJson
- training configuration JSON stringjava.io.IOException
InvalidKerasConfigurationException
UnsupportedKerasConfigurationException
protected KerasSequentialModel()
public MultiLayerConfiguration getMultiLayerConfiguration() throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
InvalidKerasConfigurationException
UnsupportedKerasConfigurationException
public MultiLayerNetwork getMultiLayerNetwork() throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
InvalidKerasConfigurationException
UnsupportedKerasConfigurationException
public MultiLayerNetwork getMultiLayerNetwork(boolean importWeights) throws InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
InvalidKerasConfigurationException
UnsupportedKerasConfigurationException