Keras Extremely High Loss

后端 未结 2 341
孤城傲影
孤城傲影 2021-01-18 07:03

I\'m trying to predict price by characteristics. I chose a pretty simple model, but it works very strange. Loss function is extremely high and I can\'t see where the problem

2条回答
  •  攒了一身酷
    2021-01-18 07:19

    As @Yu-Yang said you are using mean squared error as loss function. I had this same problem before where the loss value will be very large, on changing the loss function to mean_squared_logarithmic_error, I got the desired result.

    model %>% compile(
    optimizer = optimizer_rmsprop(lr=0.0001),
    loss = loss_mean_squared_logarithmic_error,
    metrics = c("accuracy")
    )
    

    The loss value changed to

    Epoch 1/10
    326981/326981 [==============================] - 17s - loss: 0.0048 - acc: 0.9896

    Hope this finds useful !

提交回复
热议问题