| Modifier and Type | Field and Description |
|---|---|
protected KerasModelConfiguration |
config |
protected KerasLayer.DimOrder |
dimOrder |
protected boolean |
enforceTrainingConfig |
protected int[] |
inputShape |
protected String |
modelJson |
protected String |
modelYaml |
protected Hdf5Archive |
trainingArchive |
protected String |
trainingJson |
protected String |
trainingYaml |
protected Hdf5Archive |
weightsArchive |
protected String |
weightsRoot |
| Constructor and Description |
|---|
KerasModelBuilder(KerasModelConfiguration config)
KerasModelBuilder constructed from a model configuration.
|
| Modifier and Type | Method and Description |
|---|---|
KerasModel |
buildModel()
Build a KerasModel (corresponding to ComputationGraph) from this model builder.
|
KerasSequentialModel |
buildSequential()
Build a KerasSequentialModel (corresponding to MultiLayerNetwork) from this model builder.
|
void |
close()
Close all HDF5 archives for this model builder.
|
KerasModelBuilder |
dimOrder(KerasLayer.DimOrder dimOrder)
Manually set dim order for Keras model, i.e.
|
KerasModelBuilder |
enforceTrainingConfig(boolean enforceTrainingConfig)
Determine whether to enforce loading a training configuration or not.
|
KerasModelBuilder |
inputShape(int[] inputShape)
Provide input shape for Keras models that have been compiled without one.
|
KerasModelBuilder |
modelHdf5Filename(String modelHdf5Filename)
Set full model HDF5 (architecture, weights and training configuration) by providing the HDF5 filename.
|
KerasModelBuilder |
modelJson(String modelJson)
Set model architecture from model JSON string.
|
KerasModelBuilder |
modelJsonFilename(String modelJsonFilename)
Set model architecture from file name pointing to model JSON string.
|
KerasModelBuilder |
modelJsonInputStream(InputStream modelJsonInputStream)
Set model architecture from input stream of model JSON.
|
KerasModelBuilder |
modelYaml(String modelYaml)
Set model architecture from model YAML string.
|
KerasModelBuilder |
modelYamlFilename(String modelYamlFilename)
Set model architecture from file name pointing to model YAML string.
|
KerasModelBuilder |
modelYamlInputStream(InputStream modelYamlInputStream)
Set model architecture from input stream of model YAML.
|
KerasModelBuilder |
trainingJson(String trainingJson)
Provide training configuration as JSON string
|
KerasModelBuilder |
trainingJsonInputStream(InputStream trainingJsonInputStream)
Provide training configuration as file input stream from JSON
|
KerasModelBuilder |
trainingYaml(String trainingYaml)
Provide training configuration as YAML string
|
KerasModelBuilder |
trainingYamlInputStream(InputStream trainingYamlInputStream)
Provide training configuration as file input stream from YAML
|
KerasModelBuilder |
weightsHdf5Filename(String weightsHdf5Filename)
Set weights of the model by providing the file name of the corresponding weights HDF5 file.
|
KerasModelBuilder |
weightsHdf5FilenameNoRoot(String weightsHdf5Filename)
Set weights of the model by providing the file name of the corresponding weights HDF5 file.
|
protected String modelJson
protected String modelYaml
protected String trainingJson
protected String trainingYaml
protected Hdf5Archive weightsArchive
protected String weightsRoot
protected Hdf5Archive trainingArchive
protected boolean enforceTrainingConfig
protected KerasModelConfiguration config
protected int[] inputShape
protected KerasLayer.DimOrder dimOrder
public KerasModelBuilder(KerasModelConfiguration config)
config - KerasModelConfigurationpublic KerasModelBuilder modelJson(String modelJson)
modelJson - model as JSON string.public KerasModelBuilder modelYaml(String modelYaml)
modelYaml - model as YAML string.public KerasModelBuilder modelJsonFilename(String modelJsonFilename) throws IOException
modelJsonFilename - Name of file containing model JSON stringIOException - I/O Exceptionpublic KerasModelBuilder modelYamlFilename(String modelYamlFilename) throws IOException
modelYamlFilename - Name of file containing model YAML stringIOException - I/O Exceptionpublic KerasModelBuilder modelJsonInputStream(InputStream modelJsonInputStream) throws IOException
modelJsonInputStream - Input stream of model JSONIOException - I/O exceptionpublic KerasModelBuilder modelYamlInputStream(InputStream modelYamlInputStream) throws IOException
modelYamlInputStream - Input stream of model YAMLIOException - I/O exceptionpublic KerasModelBuilder inputShape(int[] inputShape)
inputShape - Input shape as int arraypublic KerasModelBuilder trainingJson(String trainingJson)
trainingJson - Training JSON stringpublic KerasModelBuilder trainingYaml(String trainingYaml)
trainingYaml - Training YAML stringpublic KerasModelBuilder dimOrder(KerasLayer.DimOrder dimOrder)
dimOrder - Ordering of dimensions (channels first vs. last)public KerasModelBuilder trainingJsonInputStream(InputStream trainingJsonInputStream) throws IOException
trainingJsonInputStream - Input stream of training JSON stringIOExceptionpublic KerasModelBuilder trainingYamlInputStream(InputStream trainingYamlInputStream) throws IOException
trainingYamlInputStream - Input stream of training YAML stringIOExceptionpublic KerasModelBuilder modelHdf5Filename(String modelHdf5Filename) throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException, IOException
modelHdf5Filename - File name of HDF5 file containing full modelUnsupportedKerasConfigurationException - Unsupported configurationInvalidKerasConfigurationException - Invalid configurationIOException - I/O exceptionpublic KerasModelBuilder weightsHdf5FilenameNoRoot(String weightsHdf5Filename) throws IOException
weightsHdf5Filename - File name of weights HDF5IOExceptionpublic KerasModelBuilder weightsHdf5Filename(String weightsHdf5Filename) throws IOException
weightsHdf5Filename - File name of weights HDF5IOExceptionpublic KerasModelBuilder enforceTrainingConfig(boolean enforceTrainingConfig)
enforceTrainingConfig - boolean, read training config or notpublic KerasModel buildModel() throws IOException, InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
IOException - I/O exceptionInvalidKerasConfigurationException - Invalid configurationUnsupportedKerasConfigurationException - Unsupported configurationpublic KerasSequentialModel buildSequential() throws IOException, InvalidKerasConfigurationException, UnsupportedKerasConfigurationException
IOException - I/O exceptionInvalidKerasConfigurationException - Invalid configurationUnsupportedKerasConfigurationException - Unsupported configurationpublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2021. All rights reserved.