mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

change the cost function

Open freddycct opened this issue 10 years ago • 5 comments

Hi,

How do I know what is the cost function used in the output layers? Can I change it to least squares error for LinearRegressionOutput?

freddycct avatar Jun 20 '16 01:06 freddycct

model.fit(
        X                  = train,
        eval_data          = val,
        eval_metric        = ['rmse'],
        ...)

tornadomeet avatar Jun 20 '16 02:06 tornadomeet

this is the loss for evaluation but not for the training, i thought

freddycct avatar Jun 20 '16 02:06 freddycct

@freddycct No, train and test also can use it, just try

tornadomeet avatar Jun 20 '16 03:06 tornadomeet

When you choose mx.symbol.LinearRegressionOutput as last layer, the train loss function is encoded in that layer. eval_metric = ['rmse'] is just for the train and val result feedback for us to tune the hyperparameters

pinglforever avatar Jun 20 '16 03:06 pinglforever

ok thank you

freddycct avatar Jun 20 '16 04:06 freddycct