1adrianb / face-alignment

:fire: 2D and 3D Face alignment library build using pytorch
https://www.adrianbulat.com
BSD 3-Clause "New" or "Revised" License
6.94k stars 1.33k forks source link

about the loss when training the network #161

Closed flyduck closed 4 years ago

flyduck commented 4 years ago

HI, first, very thanks for your grate work! I test your model on my own data, its perfect! I want to train my own data, but, I cant understand you said the loss use "sigmoid cross-entropy pixel-wise loss". So I use L2 loss, but the loss decrease so slowly, could you please explain how to create the loss function about "sigmoid cross-entropy pixel-wise loss"? Grate thanks!

1adrianb commented 4 years ago

Hi @flyduck, Thanks for your interest! You can find the loss (BCE) used in pytorch here: https://pytorch.org/docs/stable/nn.html#torch.nn.BCELoss

flyduck commented 4 years ago

@1adrianb ok, thanks very much. I look your lua code, and I cant find the function "crop" definition, could you please help me tell me where this function? thanks~

flyduck commented 4 years ago

@1adrianb I find the function in your another code project, but I have another question, in your code, when get the heat map from gt, the gaussian around the gt point in the 64*64 size, the gaussian maybe could not uniform gaussian? if uniform gaussian there will be some accuracy loss in gt?

flyduck commented 4 years ago

@1adrianb hi, I rewrite your code with tensor flow framework, and I want to know if you try the tensor channel with other number, with channel 256 the model is so large~

1adrianb commented 4 years ago

@flyduck you can either reduce the number of HGs from 4 to 2 or decrease the number of channels to something like 128. The accuracy drop should be small

flyduck commented 4 years ago

@1adrianb ok, I will be test it, thanks very much!