private static void checkForUnknownRegularizer ( Map < String , Object > regularizerConfig , boolean enforceTrainingConfig , KerasLayerConfiguration conf ) throws UnsupportedKerasConfigurationException { if ( regularizerConfig != null ) { for ( String field : regularizerConfig . keySet ( ) ) { if ( ! field . equals ( conf . getREGULARIZATION_TYPE_L1 ( ) ) && ! field . equals ( conf . getREGULARIZATION_TYPE_L2 ( ) ) && ! field . equals ( conf . getLAYER_FIELD_NAME ( ) ) && ! field . equals ( conf . getLAYER_FIELD_CLASS_NAME ( ) ) && ! field . equals ( conf . getLAYER_FIELD_CONFIG ( ) ) ) { if ( enforceTrainingConfig ) throw new UnsupportedKerasConfigurationException ( "Unknown regularization field " + field ) ; else log . warn ( "Ignoring unknown regularization field " + field ) ; } } } }
Check whether Keras weight regularization is of unknown type . Currently prints a warning since main use case for model import is inference not further training . Unlikely since standard Keras weight regularizers are L1 and L2 .