nnstreamer / nntrainer

NNtrainer is Software Framework for Training Neural Network Models on Devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some confusion about random dataset

eightreal opened this issue · comments

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 ?

void fillLabel(float *data, unsigned int length, unsigned int label) {
if (length == 1) {
*data = label;
return;
}
memset(data, 0, length * sizeof(float));
*(data + label) = 1;
}

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

fill_label(*label, output_shapes.at(i).batch(),

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

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.

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.

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

Yes. you are right.

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

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

yes. it is better to use cur_label_tensor. Thanks!

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