Skip to content

Instantly share code, notes, and snippets.

@schwarzmx
Created September 17, 2012 12:46
Show Gist options
  • Save schwarzmx/3737090 to your computer and use it in GitHub Desktop.
Save schwarzmx/3737090 to your computer and use it in GitHub Desktop.
LFL Objective Function and Gradient
Objective Function (log-likelihood), network data, asymmetric graph, i.e. $\Lambda$ is arbitrary and $U=V$:
\[
F = \min_U\sum_{i,j \epsilon \mathcal{O}} -\log\frac{e^{U_i^{X_{ij}}\Lambda_{ij}(V_j^{X_{ij}})^T}}{\sum_y e^{U_i^{y}\Lambda_{ij}(V_j^{y})^T}} + \frac{\lambda}{2}||U||^2_F
\]
Expansion:
\[
F = \min_U \sum_{i,j \epsilon \mathcal{O}} -
\big[ U_i^{X_{ij}}\Lambda_{ij}(V_j^{X_{ij}})^T - \log \sum_y e^{U_i^{y}\Lambda_{ij}(V_j^{y})^T}
\big] + \frac{\lambda}{2}||U||^2_F
\]
Gradients:
\[
\frac{\partial F}{\partial \Lambda_{ij}} = \sum_{i,j \epsilon \mathcal{O}} -(U_i^{X_{ij}})^T V_j^{X_{ij}} + \sum_y (U_i^y)^T V_j^y p(y=X_{ij}|U_i,V_j,\Lambda_{ij})
\]
for $U$ if $i=j$:
\[
\frac{\partial F}{\partial U_i} = \sum_{i,j \epsilon \mathcal{O}} \big[-(\Lambda_{ij} +\Lambda_{ij}^T) V_j^{X_{ij}} + \sum_y (\Lambda_{ij} +\Lambda_{ij}^T) V_j^y p(y=X_{ij}|U_i,V_j,\Lambda_{ij}) \big] + 2U
\]
otherwise:
\[
\frac{\partial F}{\partial U_i} = \sum_{i,j \epsilon \mathcal{O}} \big[ -\Lambda_{ij} V_j^{X_{ij}} + \sum_y \Lambda_{ij} V_j^y p(y=X_{ij}|U_i,V_j,\Lambda_{ij}) \big] + 2U
\]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment