Speed of custom training loop

조회 수: 4 (최근 30일)
Sangmin Lee
Sangmin Lee 2020년 9월 2일
답변: Raynier Suresh 2021년 2월 25일
Hi,
I test several code using 'Train Network Using Custom Training Loop'. I found it is severely slower than the method using 'nnet.cnn.layer.Layer ' class layer and 'trainNetwork' function.
Is it ture that 'dlnetwork' class is slower than 'nnet.cnn.layer.Layer ' class? or is it because of the example is using for-loop explicitly instead of using the built-in 'trainNetwork' function?
If I am wrong, please correct me or it would be great to improve speed of algorithm.

답변 (1개)

Raynier Suresh
Raynier Suresh 2021년 2월 25일
Hi, Generally trainNetwork framework is faster, it is optimised to take care of many things. But it's not that the custom training loop will always be slower. You can use the minibatchqueue, gpuArray and dlArray to speed things. Typically, if it is possible to use trainNetwork prefer using this.
If you can provide more information about your workflow and the hardware you were using it will be helpful for us to investigate more on this.

카테고리

Help CenterFile Exchange에서 Custom Training Loops에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by