Double precision in deep learning

조회 수: 10 (최근 30일)
bah
bah 2022년 11월 28일
댓글: Walter Roberson 2023년 11월 12일
Hello guys,
i want to train my LSTM using double precision but the deep learning toolbox only allows single precision. Can i change that to double precision or how do i train my neural network using double precision ?
Thanks.
  댓글 수: 5
bah
bah 2022년 11월 29일
Thanks a lot for the information.
Walter Roberson
Walter Roberson 2023년 11월 12일
A lot of Nvidia models have double precision at 1/32 of single precision rates. Some improve to 1/24. And a few uncommon models more intended for server improve to 1/8: you have to examine the models carefully to determine the best for your purposes.

댓글을 달려면 로그인하십시오.

채택된 답변

Joss Knight
Joss Knight 2022년 12월 18일
This is possible with a dlnetwork but it is (currently) more of a workaround than anything else. Once your dlnetwork is ready to go, convert it to double precision:
net = dlupdate(@double, net);
net.State = dlupdate(@double, net.State);
Then make sure your input data to the network is always in double precision. Everything should then remain in double as you train and use the network.
Let me know if this doesn't work for you.
  댓글 수: 2
Rohan Mahala
Rohan Mahala 2023년 11월 12일
Hi Joss, can you please tell how to do this without a dlnetwork
Joss Knight
Joss Knight 2023년 11월 12일
To do this without a dlnetwork you will need to implement your network in functional form. Either way, to train it will require use of automatic differentiation and a custom training loop.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Parallel and Cloud에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by