Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Adding documentation for Kullback-leibler Divergence #239

Merged
merged 2 commits into from
Jun 14, 2019
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
3 changes: 2 additions & 1 deletion Sources/TensorFlow/Loss.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ public func poissonLoss<Scalar: TensorFlowFloatingPoint>(
return (predicted - expected * log(predicted)).mean()
}

/// Returns the Kullback-Leibler divergence between predictions and expectations.
/// Returns the Kullback-Leibler divergence (KL divergence) between between expectations and predictions.
/// Given two distributions `p` and `q`, KL divergence computes `(p * log(p / q)).sum()`.
///
/// - Parameters:
/// - predicted: Predicted outputs from a neural network.
Expand Down