weight balancing in pretraining networks.

3 次查看(过去 30 天)
Dear Deep Learning Team,
Hello, i have a question about training process.
During i work on transfer learning (using pretrained model),
My data has not BALANCED, how to fixing or weight balancing "the gradient value" of mini-batch depends on ratio of my data?
for examples,
now, i have 3 class; A, B, and C // ratio of class is 5:5:1
i try to give weights to gradient
:: In "TrainNetwork" function > trainer.train > computeGradientsForTraning
:: in that function , i found "gradient" variable
> (end-1) cell has 2048x3 array
> (end / the last) cell has 3 value which maybe means average gradients
in that point, i want to give weight to gradient for 3rd class training,
most of "Ypred" predicted A or B, mooooooreeeeeeeee than C
What can i do in this situation?
Thanks for help

回答(1 个)

Maria Duarte Rosa
  1 个评论
Raza Ali
Raza Ali 2019-10-16
is it applicable to images as well? becasue i am trying weighted classfication layer for images but its giving error.
can you specify how to use it for image data (what shold be the class weights for 100 images with the size 256 x 256 by 3)

请先登录,再进行评论。

类别

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