Can the "input data normalization" of "trainNetwork" be done separatedly?

조회 수: 18 (최근 30일)
Hi,
I am begining with Convolutional Nural Networks in Matlab following the available examples.
I have prepared the input data and parameters. When I have run the training of the networks (trainNetworks) it has began with the 'input data normalization' (during more than 2 hours). Once it has been done, when it should have began the iterations, Matlab has failed (Gpu out of memory).
Would any way to have the normalization done before the training so that I could get the errors (logical errors while I am learning) without expending the previous 2 hours each time?
Thanks a lot,
Jaime

채택된 답변

Madhav Thakker
Madhav Thakker 2020년 9월 14일
Hi Jaime,
I understand that you want to stop the inbuilt data normalization. You can do so by creating your own input data layer and setting normalization to none. I was able to disable normalization in https://www.mathworks.com/help/deeplearning/ug/create-simple-deep-learning-network-for-classification.html by calling
imageInputLayer([28 28 1], 'Normalization', 'none')
instead of
imageInputLayer([28 28 1])
when defining the network.
Hope this helps.
  댓글 수: 1
Jaime Almonacid-Caballer
Jaime Almonacid-Caballer 2020년 9월 16일
Thanks a lot!!,
I have found the solution. I didn't want to preprocess all my images and save them in disk because of their volume. I expected to have a function pre-trainNetwork so that the image would be normalized. I have found the solution in an option of imageInputLayer:
imageInputLayer([128 128 4],'Normalization',@funcN)
Where funcN:
function Y = funcN(X)
Y=X/255.;
end
Anyway, thank you for guiding my steps,
Jaime

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by