nnstreamer / nntrainer

NNtrainer is Software Framework for Training Neural Network Models on Devices.
Apache License 2.0
144 stars 73 forks source link

Some confusion about random dataset #2525

Closed eightreal closed 6 months ago

eightreal commented 6 months ago

Hello,

I'm looking at your randomDataset code when I'm writing code, but two parts of it look a little strange, and I'm not sure if you did it on purpose or if it's a bug.

This function processing process is a bit strange. Could you help explain it ?

https://github.com/nnstreamer/nntrainer/blob/5fbaf163c26cec26ac3b8df8c1aec4b9df8a09f4/Applications/utils/datagen/cifar/cifar_dataloader.cpp#L31-L39

And Why is the label passed in here? It should be the value of cur_label_tensor passed in my understanding.

https://github.com/nnstreamer/nntrainer/blob/5fbaf163c26cec26ac3b8df8c1aec4b9df8a09f4/Applications/utils/datagen/cifar/cifar_dataloader.cpp#L103

taos-ci commented 6 months ago

:octocat: cibot: Thank you for posting issue #2525. The person in charge will reply soon.

myungjoo commented 6 months ago

maybe.. we need

33: *data = 1.0; 38: *(data + label) = 1.0; , and a parameter check, label < length.

OR

This supports two different data formats. ( a scalar label and a vector label ).

I presume the latter one. However, we need additional doxygen entry or comments, explaining the expected data format.

jijoongmoon commented 6 months ago

It is for the different cases to take labels. Let's say the class ID is 10 for the truck in CFAR10. Then, if the size == 1, the data will be filled with 9 and if it is not it will be [ 0,0,0,0,0,0,0,0,1 ]

Hope it will help.

eightreal commented 6 months ago

It is for the different cases to take labels. Let's say the class ID is 10 for the truck in CFAR10. Then, if the size == 1, the data will be filled with 9 and if it is not it will be [ 0,0,0,0,0,0,0,0,1 ]

Hope it will help.

Oh, I can understand the case , thanks for your explian, but I think it should add a check that.

label < length
jijoongmoon commented 6 months ago

Yes. you are right.

eightreal commented 6 months ago

Okay . thanks for your help, and how about the second question?

jijoongmoon commented 6 months ago

Okay . thanks for your help, and how about the second question?

yes. it is better to use cur_label_tensor. Thanks!

eightreal commented 6 months ago

Okay . thanks for your help, and how about the second question?

yes. it is better to use cur_label_tensor. Thanks!

thanks for your help!!!

I also have other problem about nntrainer, I will raise another issue