loadWeightsByPaths

fun GraphTrainableModel.loadWeightsByPaths(hdfFile: HdfFile, weightPaths: List<LayerPaths>, missedWeights: MissedWeightsStrategy = MissedWeightsStrategy.INITIALIZE)

Loads weights from hdf5 file created in Keras TensorFlow framework.

Parameters

hdfFile

File in hdf5 file format containing weights of Sequential model.

weightPaths

Fully-specified paths to kernel and bias weights of each layer.

NOTE: Kernel and bias will be initialized by default initializers if they are missed in weightPaths object.

fun GraphTrainableModel.loadWeightsByPaths(hdfFile: HdfFile, layerList: MutableList<Layer>, kernelDataPathTemplate: String = KERNEL_DATA_PATH_TEMPLATE, biasDataPathTemplate: String = BIAS_DATA_PATH_TEMPLATE)

Loads weights from hdf5 file created in Keras TensorFlow framework for pre-defined list of layers.

NOTE: Weights for another layers will not be loaded (should be initialized manually).

Parameters

hdfFile

File in hdf5 file format containing weights of Sequential model.

layerList

List of layers to load weights. Weights for other layers will be initialized by initializer later.

kernelDataPathTemplate

Template path to kernel weights of the specific layer.

biasDataPathTemplate

Template path to bias weights of the specific layer.