From: Mart Lubbers Date: Tue, 3 Feb 2015 21:26:56 +0000 (+0100) Subject: ding X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=ff62d514805f552f92662788069b958f1f7824bb;p=ker2014-2.git ding --- diff --git a/report/ass2-2.tex b/report/ass2-2.tex index a4da7ab..f05024c 100644 --- a/report/ass2-2.tex +++ b/report/ass2-2.tex @@ -44,4 +44,71 @@ and how would need to proceed if one would like to extend it to large datasets o real-time operation. -\fi \ No newline at end of file +\fi +\section{Domain representation} +Translating the domain specification to AILog results in the following AILog +code: +\inputminted[linenos,fontsize=\footnotesize]{prolog}{./src/pizza.ail} + +\section{Queries} +\subsection{Initial probabilities} +Chances for shapes to be present are visible in Table~\ref{chances} and from +that we can calculate all the initial probabilites for all the shapes for +example with the following queries: +\begin{minted}[fontsize=\footnotesize]{prolog} +ailog: predict circle. +Answer: P(circle|Obs)=0.01. + [ok,more,explanations,worlds,help]: ok. +ailog: observe circle. +Answer: P(circle|Obs)=0.01. + [ok,more,explanations,worlds,help]: ok. +ailog: predict circlePresent. +Answer: P(circlePresent|Obs)=0.95. + [ok,more,explanations,worlds,help]: ok. +\end{minted} +\begin{table} + \label{chances} + \begin{tabular}{|l|ll|} + \hline + & Observed\\ + Present & T & F\\ + \hline + T & $0.95$ & $0.01$\\ + F & $0.05$ & $0.99$\\ + \hline + \end{tabular} +\end{table} + +\subsection{Querying probabilites for pizzas} +Since the chance of a false positive on a shape is so low the initial +probabilities for pizza types are very low. When certain shapes that belong to +a certain type of pizza occur the probability improves a lot. We can show this +by showing the probabilites of a pepperoni pizza before, during and after +observing the ingredients with the following queries: +\begin{minted}[fontsize=\footnotesize]{prolog} +ailog: predict p_pepperoni. +Answer: P(p_pepperoni|Obs)=0.0019. + [ok,more,explanations,worlds,help]: ok. +ailog: observe circle. +Answer: P(circle|Obs)=1.0. + [ok,more,explanations,worlds,help]: ok. +ailog: predict p_pepperoni. +Answer: P(p_pepperoni|Obs)=0.0019. + [ok,more,explanations,worlds,help]: ok. +ailog: observe doublecircle. +Answer: P(doublecircle|Obs)=0.01. + [ok,more,explanations,worlds,help]: ok. +ailog: predict p_pepperoni. +Answer: P(p_pepperoni|Obs)=0.19. + [ok,more,explanations,worlds,help]: ok. +\end{minted} + +\subsection{Finding out which pizza is the most likely to be present on the +image} +We do not only want to know what the probability for a specific pizza is but +also the most likely pizza so that we can give an educated guess about the +pizza type present on the image processed. This can be done with the following +queries: + + +\section{Reflections}