Double precision in deep learning

12 visualizaciones (últimos 30 días)
bah
bah el 28 de Nov. de 2022
Comentada: Walter Roberson el 12 de Nov. de 2023
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 comentarios
bah
bah el 29 de Nov. de 2022
Thanks a lot for the information.
Walter Roberson
Walter Roberson el 12 de Nov. de 2023
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.

Iniciar sesión para comentar.

Respuesta aceptada

Joss Knight
Joss Knight el 18 de Dic. de 2022
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 comentarios
Rohan Mahala
Rohan Mahala el 12 de Nov. de 2023
Hi Joss, can you please tell how to do this without a dlnetwork
Joss Knight
Joss Knight el 12 de Nov. de 2023
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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Parallel and Cloud en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by