what is the value for L2 regularization coeff, by default,while training?
이전 댓글 표시
while trainig a deep learning network in MATLAB, what is the trainingOptions for setting L2 regularization coeff.?
Like if adam optimizer is used how to set this parameter?
more clearly like in optim.Adam in pytorch , weight_decay option is given.how to set it here in MATLAB?
답변 (1개)
Adam Danz
2020년 10월 21일
0 개 추천
댓글 수: 6
krishna Chauhan
2020년 10월 21일
Adam Danz
2020년 10월 21일
What documentation (pytorch or matab)?
I assume you're referencing the TORCH.OPTIM.ADAM algorithm which uses a default vaue of 0 for the weight_decay. The L2Regularization property in Matlab's TrainingOptionsADAM which is the factor for L2 regularizer (weight decay), can also be set to 0. Or are you using a different method of training?

krishna Chauhan
2020년 10월 21일
Adam Danz
2020년 10월 21일
Well, I haven't used either of them so I don't want to insert too much certainty but their descriptions certainly seem the same.
There are a few ways you could verify this
- Look at the code in Matlab and PyTorch to see how those two params are used.
- Run the same data through both programs with the same inputs and examine the outputs (there are probably some random processes involved so you may not get exactly the same results).
- If you have some kind of known dataset that produces a known result, sometimes provided in the text books, you could use that to verify that the L2Regularization term is doing what you think it does.
- There's likely someone how there more familiar with both programs. Writing to Matlab Support may help but they probably wouldn't answer PyTorch questions.
krishna Chauhan
2020년 10월 22일
If it were me, I'd step through the process in debug mode to study and compare the two methods. Perhaps there's more detail in Matalb's (and PyTorch's) documentation that would shed light on the differences.
Maybe the difference is caused by a small difference in one of the optional parameters, as you mentioned.
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!