A Semantic Loss Function for Deep Learning with Symbolic Knowledge Jingyi Xu, Zilu Zhang , Tal Friedman , Yitao Liang, Guy Van den Broeck
Goal : Constrain neural network outputs using logic 1
Multiclass Classification 0.8 0.3 0.9 2 2
Multiclass Classification π π Β¬π π Β¬π π β¨ 0.8 0.3 0.9 Want exactly one class: Β¬π π π π Β¬π π β¨ Β¬π π Β¬π π π π 3 3
Multiclass Classification π π Β¬π π Β¬π π T F T β¨ 0.8 0.3 0.9 Want exactly one class: Β¬π π π π Β¬π π β¨ Β¬π π Β¬π π π π No information gained! 4 4
Why is mixing so difficult? Deep Learning Logic β’ Continuous β’ Discrete β’ Smooth β’ Symbolic β’ Differentiable β’ Strong semantics 5 5
Multiclass Classification π π Β¬π π Β¬π π β¨ 0.8 0.3 0.9 Want exactly one class: Β¬π π π π Β¬π π β¨ Β¬π π Β¬π π π π Probability constraint is satisfied 6 6
Use a probabilistic interpretation! 7
Multiclass Classification π π Β¬π π Β¬π π β¨ 0.8 0.3 0.9 Want exactly one class: Β¬π π π π Β¬π π β¨ Β¬π π Β¬π π π π Probability constraint is satisfied π π π β π π π β π π + π β π π π π π β π π + π β π π π β π π π π = π. πππ 8 8
Semantic Loss β’ Continuous, smooth, easily differentiable function β’ Represents how close outputs are to satisfying the constraint β’ Axiomatically respects semantics of logic, maintains precise meaning β independent of syntax 9
How do we compute semantic loss? 10
Logical Circuits β’ In general: #P-hard β’ Linear in size of circuit = - log( ) L(Ξ±, p ) = L( , p ) 11
Supervised Learning β’ Predict shortest paths β’ Add semantic loss representing paths Is output Is output Does output a path? the true shortest path? have true edges? 12
Semi-Supervised Learning β’ Unlabeled data must have some label 13
Semi-Supervised Learning β’ Unlabeled data must have some label β’ Exactly-one constraint increases confidence 14
15
Main Takeaway β’ Deep learning and logic can be combined by using a probabilistic approach β’ Maintain precise meaning while fitting into the deep learning framework 16
Thanks! 17
Recommend
More recommend