Package org.jetbrains.kotlinx.dl.api.inference.keras

Types

LayerBatchNormPaths
Link copied to clipboard
class LayerBatchNormPaths(layerName: String, gammaPath: String, betaPath: String, movingMeanPath: String, movingVariancePath: String) : LayerPaths

Contains layerName, gammaPath, betaPath, movingMeanPath, movingVariancePath for BatchNorm layer, found in hdf5 file via

LayerConvOrDensePaths
Link copied to clipboard
class LayerConvOrDensePaths(layerName: String, kernelPath: String, biasPath: String) : LayerPaths

Contains layerName, kernelPath, biasPath for specific layer, found in hdf5 file via

LayerPaths
Link copied to clipboard
open class LayerPaths(layerName: String)

Parent class for specific paths to layers in h5 file. Contains only layerName field

LayerPReLUPaths
Link copied to clipboard
class LayerPReLUPaths(layerName: String, alphaPath: String) : LayerPaths

Contains layerName, alphaPath for PReLU layer, found in hdf5 file via

LayerSeparableConv2DPaths
Link copied to clipboard
class LayerSeparableConv2DPaths(layerName: String, depthwiseKernelPath: String, pointwiseKernelPath: String, biasPath: String) : LayerPaths

Contains layerName, depthwiseKernelPath, pointwiseKernelPath, biasPath for SeparableConv2D layer, found in hdf5 file via

MissedWeightsStrategy
Link copied to clipboard
enum MissedWeightsStrategy : Enum<MissedWeightsStrategy>

This strategy defines the behaviour during weights' loading if the weights are not found in the h5 file by the standard Keras paths.

Functions

loadWeights
Link copied to clipboard
fun GraphTrainableModel.loadWeights(hdfFile: HdfFile)

Loads weights from hdf5 file created in Keras TensorFlow framework.

fun GraphTrainableModel.loadWeights(hdfFile: HdfFile, layerList: List<Layer>)

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

loadWeightsByPaths
Link copied to clipboard
fun GraphTrainableModel.loadWeightsByPaths(hdfFile: HdfFile, layerList: List<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.

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

Loads weights from hdf5 file created in Keras TensorFlow framework.

loadWeightsByPathTemplates
Link copied to clipboard
fun GraphTrainableModel.loadWeightsByPathTemplates(hdfFile: HdfFile, kernelDataPathTemplate: String = KERNEL_DATA_PATH_TEMPLATE, biasDataPathTemplate: String = BIAS_DATA_PATH_TEMPLATE)

Loads weights from hdf5 file created in Keras TensorFlow framework.

fun GraphTrainableModel.loadWeightsByPathTemplates(hdfFile: HdfFile, layerList: List<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.

loadWeightsForFrozenLayers
Link copied to clipboard
fun GraphTrainableModel.loadWeightsForFrozenLayers(hdfFile: HdfFile)

Loads weights from hdf5 file created in Keras TensorFlow framework for non-trainable (or frozen) layers only.

fun GraphTrainableModel.loadWeightsForFrozenLayersByPathTemplates(hdfFile: HdfFile, kernelDataPathTemplate: String = KERNEL_DATA_PATH_TEMPLATE, biasDataPathTemplate: String = BIAS_DATA_PATH_TEMPLATE)

Loads weights from hdf5 file created in Keras TensorFlow framework for non-trainable (or frozen) layers only.

recursivePrintGroupInHDF5File
Link copied to clipboard
fun recursivePrintGroupInHDF5File(hdfFile: HdfFile, group: Group)

Helper function to print out file in hdf5 format for debugging purposes.

saveModelConfiguration
Link copied to clipboard
fun GraphTrainableModel.saveModelConfiguration(jsonConfigFile: File, isKerasFullyCompatible: Boolean = false)

Saves model description as json configuration file fully compatible with the Keras TensorFlow framework.