CfC
CfC copied to clipboard
posible optimization to tf_cfc.py
A regularizing kernel could be used to penalize the neural network weights. This can help to avoid overfitting the model and improve its overall performance.
This could be done by adding the following line of code after the creation of each dense layer in the "backbone" section of the build method:
copy code self.backbone.append( tf.keras.layers.Dense( self.hparams["backbone_units"], backbone_activation, kernel_regularizer=tf.keras.regularizers.L2( self.hparams["weight_decay"] ), ) ) This would add an L2 regularizer kernel to each dense layer in the "backbone" section, using the "weight_decay" parameter specified in the hyperparameters to set the level of regularization.