Is it possible truncate a neural network weights?

When I am training a neural network I get the weights e.g. 0.960928653806898,0.273172876012661, ..., -0.413223736485805, but is possible modify the weights to obtain only the integer part and 2 digits to the fracctional part?

 Respuesta aceptada

Greg Heath
Greg Heath el 4 de Nov. de 2014
Editada: Greg Heath el 6 de Nov. de 2014
Set the display format at the beginning of the program. It will not affect the accuracy of internal function calculations.
help format
doc format
e.g.,
a = 0.960928653806898; b=0.273172876012661; c=-0.413223736485805;
format short
a,b,c
%a = 0.96093
%b = 0.27317
%c = -0.41322
Hope this helps.
Thank you for formally accepting my answer
Greg

1 comentario

Image Analyst
Image Analyst el 7 de Nov. de 2014
Editada: Image Analyst el 7 de Nov. de 2014
Ana's answer moved here (It seems like Ana and Shana are the same person with two accounts):
Hi Greg, thank you for answer my question. At the beginning of the program I write "format compact" and with this command I visualize weights like: 0.9609,0.2731, ..., -0.4132. However, I know matlab weights are obtained randomly. But is possible truncate the randomly number using a function like round2 to obtain weights like 0.96,0.27, ..., -0.41?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 3 de Nov. de 2014

Editada:

el 7 de Nov. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by