yu4u / age-gender-estimation

Keras implementation of a CNN network for age and gender estimation
MIT License
1.46k stars 501 forks source link

Calculate MAE #96

Closed DoDDnice6 closed 5 years ago

DoDDnice6 commented 5 years ago

Hi. I wonder MAE can be calculated during training data? I searched the internet and didn't seem to calculate it when the output was multiple.Can output be combined into a dict? And did you try the age and gender estimate model using ResNet or InceptionResnet as the sub project? Thanks again to your project. I just started learning machine learning, last time I asked and you answered very enthusiastically

yu4u commented 5 years ago

Hi. I wonder MAE can be calculated during training data? I searched the internet and didn't seem to calculate it when the output was multiple.Can output be combined into a dict?

Yes. https://keras.io/metrics/#custom-metrics

And did you try the age and gender estimate model using ResNet or InceptionResnet as the sub project?

I recommend PyTorch version. https://github.com/yu4u/age-estimation-pytorch Many models can be used.

DoDDnice6 commented 5 years ago

Yes. https://keras.io/metrics/#custom-metrics

"The function would need to take (y_true, y_pred) as arguments and return a single tensor value." But here the output is multipe. I read here [(https://stackoverflow.com/questions/44172165/keras-multiple-output-custom-loss-function/55894885#55894885)] and it seems they can't handle it.

I recommend PyTorch version. https://github.com/yu4u/age-estimation-pytorch Many models can be used.

Looks like this only estimates age. I will try different models with simultaneous age and gender estimates. Thank you

yu4u commented 5 years ago

http://faroit.com/keras-docs/2.0.6/models/model/

To specify different metrics for different outputs of a multi-output model, you could also pass a dictionary, such as metrics={'output_a': 'accuracy'}

I did not try it but it seems to be possible.

DoDDnice6 commented 5 years ago

thank you