
Visual-linguistic matching losses (Kamath Eq 9.8-9.9)
Source:R/kamath_llm2_native.R
morie_kamath_ch9_mml_vlm_loss.RdVisual-linguistic matching losses (Kamath Eq 9.8-9.9)
Details
One core serves both Python modules exactly as km137 calls
km136: km136 -> morie_kamath_ch9_mml_vlm_loss, km137 ->
morie_kamath_ch9_itm_hard_negative (the same sum with a hard-negative
set).
Examples
morie_kamath_ch9_mml_vlm_loss(c(0.5, 0.25), c(0.5))
#> $estimate
#> [1] 2.772589
#>
#> $positive_loss
#> [1] 2.079442
#>
#> $negative_loss
#> [1] 0.6931472
#>
#> $n_positive
#> [1] 2
#>
#> $n_negative
#> [1] 1
#>
#> $n
#> [1] 3
#>
#> $method
#> [1] "visual-linguistic matching loss (Kamath Eq 9.8)"
#>