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

15 次查看(过去 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
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