Logic and machine learning review
CS 540 Yingyu Liang
review CS 540 Yingyu Liang Propositional logic Logic If the - - PowerPoint PPT Presentation
Logic and machine learning review CS 540 Yingyu Liang Propositional logic Logic If the rules of the world are presented formally, then a decision maker can use logical reasoning to make rational decisions. Several types of logic:
CS 540 Yingyu Liang
slide 3
Logic
decision maker can use logical reasoning to make rational decisions.
▪ propositional logic (Boolean logic) ▪ first order logic (first order predicate calculus)
▪ syntax: what is a correctly formed sentence ▪ semantics: what is the meaning of a sentence ▪ Inference procedure (reasoning, entailment): what sentence logically follows given knowledge
slide 4
Propositional logic syntax
Sentence AtomicSentence | ComplexSentence AtomicSentence True | False | Symbol Symbol P | Q | R | . . . ComplexSentence Sentence | ( Sentence Sentence ) | ( Sentence Sentence ) | ( Sentence Sentence ) | ( Sentence Sentence )
BNF (Backus-Naur Form) grammar in propositional logic
P ((True R)Q)) S) well formed P Q) S) not well formed
slide 9
FOL syntax Summary
▪ Constants: Bob, 2, Madison, … ▪ Variables: x, y, a, b, c, … ▪ Functions: Income, Address, Sqrt, … ▪ Predicates: Teacher, Sisters, Even, Prime… ▪ Connectives: ▪ Equality: = ▪ Quantifiers: "$
slide 10
More summary
has no variables)
quantified
to some class of tasks T and performance measure P, if its performance at tasks in T as measured by P, improves with experience E.”
indoor
Experience/Data: images with labels Indoor
should be handled
feature vector while maintaining key characteristics of the training samples
Agglomerative Clustering)
in Euclidean space
ci = {x in cluster i} x / SizeOf(cluster i)
distribution 𝐸
Decision boundary
𝑀 𝑔 =
1 𝑜 σ𝑗=1 𝑜
𝑚(𝑔, 𝑦𝑗, 𝑧𝑗)
𝑀 𝑔 = 𝔽 𝑦,𝑧 ~𝐸[𝑚(𝑔, 𝑦, 𝑧)]
𝜄𝑁𝑀 = argmaxθ∈Θ σ𝑗 log(𝑄𝜄 𝑦𝑗, 𝑧𝑗 ) 𝑚 𝑄𝜄, 𝑦𝑗, 𝑧𝑗 = − log(𝑄𝜄 𝑦𝑗, 𝑧𝑗 ) 𝑀 𝑄𝜄 = − σ𝑗 log(𝑄𝜄 𝑦𝑗, 𝑧𝑗 )
𝜄𝑁𝑀 = argmaxθ∈Θ σ𝑗 log(𝑄𝜄 𝑧𝑗|𝑦𝑗 ) 𝑚 𝑄𝜄, 𝑦𝑗, 𝑧𝑗 = − log(𝑄𝜄 𝑧𝑗|𝑦𝑗 ) 𝑀 𝑄𝜄 = − σ𝑗 log(𝑄𝜄 𝑧𝑗|𝑦𝑗 )
Only care about predicting y from x; do not care about p(x)
𝑥 𝑦 = 𝑥𝑈𝑦 that minimizes
𝑀𝑆 𝑔
𝑥 = 1 𝑜 ⃦𝑌𝑥 − 𝑧 ⃦2 2
w = 𝑌𝑈𝑌 −1𝑌𝑈𝑧 𝑚2 loss: Normal + MLE
𝑥(𝑧 = 1|𝑦) = 𝜏 𝑥𝑈𝑦 = 1 1+exp(−𝑥𝑈𝑦)
𝑄
𝑥 𝑧 = 0 𝑦 = 1 − 𝑄 𝑥 𝑧 = 1 𝑦 = 1 − 𝜏 𝑥𝑈𝑦
𝑀 𝑥 = − 1 𝑜
𝑗=1 𝑜
log 𝑄
𝑥 𝑧𝑗 𝑦𝑗