MATLAB Answers

Can I feed a neural network with a "predefined" set of training images at every iteration ?

12 ビュー (過去 30 日間)
M J
M J 2020 年 9 月 24 日
コメント済み: Srivardhan Gadila 2020 年 10 月 27 日
Hi everyone,
I am working with a convolutional neural network (GoogLeNet) but instead of using classic "full" images, I am working with patches cropped out of the images. In other words, each class contains several images (which are actually subfolders), and each image contains several patches (the png files).
I wrote a simple function that reads n random patches (png files) belonging to m random images at every run, and was wondering how to implement it in the training process. I basically want to use those n randomly generated training png files (minibatch) at every iteration. Should this be done within the "trainNetwork" function?
Is there any question/example that deals with this topic?
Thank you very much.
Best regards

  4 件のコメント

表示 1 件の古いコメント
M J
M J 2020 年 9 月 25 日
Thank you for your answer! My function generates only a small subset of the training images (n random png files). Should I then use a for loop to create a new training image datastore at each iteration?
Sindar
Sindar 2020 年 9 月 25 日
I'm sorry, I'm not sure - my familiarity with the problem is shallow. My first thought would be that you want a single training set for every iteration, so you should create the image datastore once and stick with it. (Perhaps increase n? or run multiple times to gather a larger training set)
M J
M J 2020 年 9 月 25 日
Yes. For example, assuming I have 100 iterations per epoch, I would like to repeatedly generate 100 random training subsets (based on my set of rules, as mentioned above), each of which would be fed to the network at every iteration.

サインインしてコメントする。

採用された回答

Srivardhan Gadila
Srivardhan Gadila 2020 年 9 月 28 日
Based on the above information in question & comments I think using the custom training loop would be a good Idea. You can refer to Train Network Using Custom Training Loop & Deep Learning Custom Training Loops for more information.

  2 件のコメント

M J
M J 2020 年 10 月 2 日
Thank you very much ! I'm assuming you're referring to the minibatchqueue function ?

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by