markov logic network - university of illinoisswoh.web.engr.illinois.edu › ... › handout ›...

15
Markov Logic Network Matthew Richardson and Pedro Domingos IE598 2016, Present by Hao Wu (haowu4)

Upload: others

Post on 07-Jul-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

MarkovLogicNetworkMatthewRichardson

andPedroDomingos

IE5982016,PresentbyHaoWu(haowu4)

Page 2: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

Motivation- UnifyingLogicandProbability

• Logicandprobabilityaretwomostimportwayofreasoning.• “Classic”AIfavorslogicapproaches,whichismostlyrulebased.

• Theoremproofing.• Cannotdealwithuncertainty,verylimitedsuccess.

• “Modern”AIapproachesaredominatedbymoreprobabilisticmethods,whichhandlestheuncertaintyandnoiseinrealdata.

• DeepLearning,PGMandetc.• Hugesuccess

• SowhywestillwanttohaveLogic?(Whynotlearneverything?)

Page 3: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

Whylogicisstillinteresting

• Logic,especially,First-orderlogicprovideaexpressive,compactandelegantwaytoexpressknowledge.

• Itonlytake30+linetowritedowntheruleofSudokuinProlog(andthesamecodecanalsosolveit).Howmanydatadoyouneedtolearneverythingfromscratch?

• Wewantanicewaytorepresentandsolveourproblems(efficiently).• Useexpertknowledgetohelpthedatadrivensystem.

• MarkovLogicisawaytoconnectsLogicandProbability.• Logichandlescomplexity.• Probabilityhandlesuncertainty.

Page 4: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

Background:MarkovNetwork

• Potentialfunctionsdefinedovercliques

∏Φ=c

cc xZxP )(1)(

Smoking

Cough

Cancer

Asthma

Page 5: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

FirstOrderLogic• Constants,variables,functions,predicatesE.g.:Anna,x,MotherOf(x),Friends(x,y)

• Literal: Predicateoritsnegation• Clause: Disjunctionofliterals• Grounding: ReplaceallvariablesbyconstantsE.g.:Friends(Anna,Bob)

• World (model,interpretation):Assignmentoftruthvaluestoallgroundpredicates

Page 6: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

Comparision

( ))()(),(,)()(

ySmokesxSmokesyxFriendsyxxCancerxSmokesx

⇔⇒∀

⇒∀FOL:

MRF:

Smokes(B)

Cancer(A) Cancer(B)

Friends(A,B)

Smokes(A)

Page 7: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

MarkovLogicNetwork

• AMarkovLogicNetwork(MLN) isasetofpairs(F,w) where• F isaformulainfirst-orderlogic• w isarealnumber

*Andweneedadatabasethatcontainsconstantsforgrounding.

( ))()(),(,)()(

ySmokesxSmokesyxFriendsyxxCancerxSmokesx

⇔⇒∀

⇒∀

1.15.1

Page 8: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

( ))()(),(,)()(

ySmokesxSmokesyxFriendsyxxCancerxSmokesx

⇔⇒∀

⇒∀

1.15.1

+ Two constants: Anna (A) and Bob (B)

Cancer(A)

Smokes(A)Friends(A,A)

Friends(B,A)

Smokes(B)

Friends(A,B)

Cancer(B)

Friends(B,B)

Page 9: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

MarkovLogicNetwork:Definition• Eachgroundformuladefinesaclique

• isthenumberoftruegroundingofformulai• isthestate(truthvalue)ofatomsinformulai

Page 10: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

MarkovLogicNetworks

• A template forgroundMarkovRandomField.• CanhavetypetoreducethenumberofpredicateXconstants.

• i.e.Humancanonlybefriendwithanotherhuman.

• Expressivity:• Whensetallweighttoinfinitelarge,itbecomesFOL.• Everyprobabilitydistributionoverdiscreteorfinite- precisionnumericvariablescanberepresented asaMarkovlogicnetwork.

Page 11: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

Inference(SameasinferenceonMRF*)*SometimeneedalittletwistforMCMCstyleinference

• MAPInference:

• ConditionalInference

)|(maxarg xyPy

Page 12: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

• Learnfromadatabase• Cantolearnbothweights(parameters)andFOLformula(structure):

• Learningweights.• Byoptimizelikelihood.

• Learningformula:(InductiveLogicProgramming)• AnILPsystemwillderiveahypothesised logicprogramwhichentailsallthepositiveandnoneofthenegativeexamples.

• UseexistingInductivelogicprogrammingsystem.

Learning

Page 13: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

Learningweight

• Optimizelikelihood.(Generativeapproach)

• Generalizedtoohard,doPseudo-likelihoodinstead.• CountingtruegroundingsofafirstorderclauseinaKBis#Pcomplete

• Optimizeconditionallikelihood.(Discriminativeapproach)

( )∑ ∑

=

−====

'

),'(exp

log),()|(log)(

yi iix

xi

ii

xynwZ

ZxynwxXyYPwf

( )∑ ∑

=

−===

xi ii

iii

xnwZ

ZxnwxXPwf

)'(exp

log)()(log)(

∑ ==l

lll xMBxXPxPL ))(|(log)(log

Page 14: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

Application- Entityresolution(CitationDB)

• Author(bib,author)Title(bib,title)Venue(bib,venue)• HasWord(author,word)• HasWord(title,word)• HasWord(venue,word)• SameAuthor(author1,author2)• SameTitle(title1,title2)• SameVenue(venue1,venue2)• SameBib(bib1,bib2)

Page 15: Markov Logic Network - University Of Illinoisswoh.web.engr.illinois.edu › ... › handout › fall2016_slide16.pdf · 2016-12-03 · Why logic is still interesting • Logic, especially,

Application- Entityresolution

• Title(b1,t1)∧ Title(b2,t2)∧ HasWord(t1,+w)∧ HasWord(t2,+w)⇒SameBib(b1,b2)

• Author(b1,a1)∧ Author(b2,a2)∧ SameBib(b1,b2)⇒SameAuthor(a1,a2)

• Author(b1,a1)∧ Author(b2,a2)∧ SameAuthor(a1,a2)⇒Samebib(b1,b2)