Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dlib/dnn/loss.h
Original file line number Diff line number Diff line change
Expand Up @@ -3827,8 +3827,8 @@ namespace dlib
const auto y_idx = tensor_index(output_tensor, n, k + 1, r, c);
const auto w_idx = tensor_index(output_tensor, n, k + 2, r, c);
const auto h_idx = tensor_index(output_tensor, n, k + 3, r, c);
g[x_idx] = scale_box * put_in_range(-1, 1, (out_data[x_idx] * 2.0 - 0.5 - tx));
g[y_idx] = scale_box * put_in_range(-1, 1, (out_data[y_idx] * 2.0 - 0.5 - ty));
g[x_idx] = scale_box * put_in_range(-1, 1, (out_data[x_idx] * 2.0 - 0.5 - tx)) * 2.0f;
g[y_idx] = scale_box * put_in_range(-1, 1, (out_data[y_idx] * 2.0 - 0.5 - ty)) * 2.0f;
g[w_idx] = scale_box * put_in_range(-1, 1, (out_data[w_idx] - tw));
g[h_idx] = scale_box * put_in_range(-1, 1, (out_data[h_idx] - th));
Comment thread
arrufat marked this conversation as resolved.

Expand Down Expand Up @@ -3863,7 +3863,7 @@ namespace dlib
}

// The loss is the squared norm of the gradient
loss += length_squared(rowm(mat(grad), n));
loss += 0.5 * length_squared(rowm(mat(grad), n));
}
};
}
Expand Down
Loading