Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posible optimization to tf_cfc.py #8

Open
yankisimo opened this issue Dec 12, 2022 · 0 comments
Open

posible optimization to tf_cfc.py #8

yankisimo opened this issue Dec 12, 2022 · 0 comments

Comments

@yankisimo
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant