What is the loss function that use the DNNRegressor?
<p>I am using <strong>DNNRegressor</strong> to train my model. I search in the documentation what is the loss function used by this wrapper but i don't find it. On the other hand, it is possible to change that loss function?.</p>

<p>Thank you for your suggestions.</p>

<p>It uses L2 loss (mean squared error) as defined in <a href="https://github.com/tensorflow/tensorflow/blob/754048a0453a04a761e112ae5d99c149eb9910dd/tensorflow/contrib/layers/python/layers/target_column.py" rel="nofollow">target_column.py</a>: </p>

<pre><code>def regression_target(label_name=None,
                      weight_column_name=None,
                      target_dimension=1):
  """Creates a _TargetColumn for linear regression.
  Args:
    label_name: String, name of the key in label dict. Can be null if label
        is a tensor (single headed models).
    weight_column_name: A string defining feature column name representing
      weights. It is used to down weight or boost examples during training. It
      will be multiplied by the loss of the example.
    target_dimension: dimension of the target for multilabels.
  Returns:
    An instance of _TargetColumn
  """
  return _RegressionTargetColumn(loss_fn=_mean_squared_loss,
                                 label_name=label_name,
                                 weight_column_name=weight_column_name,
                                 target_dimension=target_dimension)
</code></pre>

<p>and currently API does not support any changes here. However, since it is open source - you can always modify the constructor to call different function internally, with different loss.</p>

python machine-learning neural-network tensorflow deep-learning