maxpumperla / hyperas

Keras + Hyperopt: A very simple wrapper for convenient hyperparameter optimization
http://maxpumperla.com/hyperas/
MIT License
2.17k stars 316 forks source link

Regarding custom loss #218

Closed BenLim88 closed 5 years ago

BenLim88 commented 5 years ago

How can I define custom loss functions in Hyperas?

I am running a 4 dense layers architecture with 3 outputs. For the loss, i would like to define it as:

Loss

( (Output1 Error) / max[Output1_pred, Output1_true] ) + ( (Output2 Error) / max[Output2_pred, Output2_true] ) + ( (Output3 Error) / max[Output3_pred, Output3_true] )

maxpumperla commented 5 years ago

@BenLim88 not exactly sure what you mean, just define your loss and return it as loss in the return value of your model function here

https://github.com/maxpumperla/hyperas/blob/master/examples/simple.py#L65