How can I change the regularization (weight decay) in fitnet?

1 回表示 (過去 30 日間)
Bao Ngo
Bao Ngo 2023 年 4 月 4 日
編集済み: Binaya 2024 年 8 月 21 日
I use fitnet to create a 50-node model, with training and validation ratios set to 30% and 70%. I want the regularization (weight decay) set at 0.1 and 0.5 and and then find mean and variance of MSEs for training and validation portions of the dataset from the 10 repetitions. How can I do it?

回答 (1 件)

Binaya
Binaya 2024 年 8 月 21 日
編集済み: Binaya 2024 年 8 月 21 日
Hi Bao
To use regularization in "fitnet", you can modify the regularization performance parameter of the network. The following code snippet shows how to use regularization:
net = fitnet(50);
net.performParam.regularization = 0.1; % or 0.5
This parameter can be initialized alongside other parameters defined to configure the network. The rest of the provided code remains the same and the network can be trained to calculate the mean MSEs as per your requirement.
You can refer to the following links to understand about:
  1. Properties of shallow neural networks: https://www.mathworks.com/help/deeplearning/ref/network.html?searchHighlight=shallow%20networks&s_tid=srchtitle_support_results_4_shallow%20networks#:~:text=given%20property%20values-,Properties,-Architecture%20Properties
  2. Neural network object properties: https://www.mathworks.com/help/deeplearning/ug/neural-network-object-properties.html

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by