<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>R&#38;D &#187; Research &amp; Development</title>
	<atom:link href="http://blog.adnanmasood.com/category/research-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.adnanmasood.com</link>
	<description>Adnan on Technology, Research &#38; Development</description>
	<lastBuildDate>Thu, 17 May 2012 15:39:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>pgm.HelloWorld() with Wainwright &amp; Jordan</title>
		<link>http://blog.adnanmasood.com/2012/05/17/pgm-helloworld-with-wainwright-jordan/</link>
		<comments>http://blog.adnanmasood.com/2012/05/17/pgm-helloworld-with-wainwright-jordan/#comments</comments>
		<pubDate>Thu, 17 May 2012 15:39:27 +0000</pubDate>
		<dc:creator>Adnan Masood</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Bayesian]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Research & Development]]></category>

		<guid isPermaLink="false">http://blog.adnanmasood.com/?p=976</guid>
		<description><![CDATA[I have recently came across Wainwright &#38; Jordan&#8217;s paper on exponential families, graphical models, and variational inference and found it to be quite comprehensive and unifying introduction of the topic. Probabilistic graphical models use a graph-based representation as the basis for compactly encoding a complex distribution over a high-dimensional space. If you are familiar with Koller and Friedman&#8217;s work on [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently came across Wainwright &amp; Jordan&#8217;s paper on <a href="http://www.eecs.berkeley.edu/~wainwrig/Papers/WaiJor08_FTML.pdf" target="_blank">exponential families, graphical models, and variational inference</a> and found it to be quite comprehensive and unifying introduction of the topic. Probabilistic graphical models use a graph-based representation as the basis for compactly encoding a complex distribution over a high-dimensional space. If you are familiar with <a href="http://pgm.stanford.edu/intro.pdf" target="_blank">Koller and Friedman&#8217;s work</a> on Probabilistic Modeling, Wainwright and Jordan&#8217;s paper would provide a less mathenamtically terse and more unifying view of the area.</p>
<p><a href="http://www.eecs.berkeley.edu/~wainwrig/Papers/WaiJor08_FTML.pdf">Graphical Models, Exponential Families, and Variational Inference</a></p>
<p>As compared to Pearl&#8217;s work on Causality, this paper provides a contemporary look at Message-passing Algorithms for Approximate Inference, Connection to Max-Product Message-Passing and detailed insight into Moment Matrices, Semidefinite Constraints, and Conic Programming Relaxation. Due to it&#8217;s clarity and detailed explanation, the background material on Graphs, hypergraphs, exponential families and duality is definitely worth reading even if you don&#8217;t need a refresher.</p>
<p>In Lieu of Pearl&#8217;s polytree approach, Wainwright &amp; Jordan&#8217;s work discusses Graphical Models as Exponential Families before delving into Computational Challenges with High-Dimensional Models. Later chapters deal with Sum-Product, Bethe–Kikuchi, and Expectation-Propagation, Mean Field Methods, Variational Methods in Parameter Estimation, Convex Relaxations and Upper Bounds, Integer Programming, Max-product, and Linear Programming Relaxations concluding with Moment Matrices, Semidefinite Constraints, and Conic Programming Relaxation. For a computer scientist, it is always interesting to observe the statistical perspective of machine learning. This contemporary insight into Graphical Models, Exponential Families, and Variational Inference was published in Foundations and Trends in Machine Learning which is definitely built upon researchers&#8217; earlier work on <a href="http://www.cs.princeton.edu/courses/archive/fall11/cos597C/reading/BleiJordan2005.pdf" target="_blank">Variational inference for Dirichlet process mixtures</a> and <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.61.4581&amp;rep=rep1&amp;type=pdf" target="_blank">Variational inference in graphical models: The view from the marginal polytope</a>.</p>
<p>As an appetizer, I would also recommend <a href="http://research.microsoft.com/en-us/um/people/cmbishop/prml/Bishop-PRML-sample.pdf" target="_blank">Bishop&#8217;s chapter on Graphical Model</a>.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.adnanmasood.com%2F2012%2F05%2F17%2Fpgm-helloworld-with-wainwright-jordan%2F&amp;title=pgm.HelloWorld%28%29%20with%20Wainwright%20%26%23038%3B%20Jordan" id="wpa2a_2"><img src="http://blog.adnanmasood.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.adnanmasood.com/2012/05/17/pgm-helloworld-with-wainwright-jordan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Are Bayesian networks Bayesian enough?</title>
		<link>http://blog.adnanmasood.com/2012/05/03/are-bayesian-networks-bayesian-enough/</link>
		<comments>http://blog.adnanmasood.com/2012/05/03/are-bayesian-networks-bayesian-enough/#comments</comments>
		<pubDate>Thu, 03 May 2012 12:00:28 +0000</pubDate>
		<dc:creator>Adnan Masood</dc:creator>
				<category><![CDATA[Bayesian]]></category>
		<category><![CDATA[Research & Development]]></category>

		<guid isPermaLink="false">http://blog.adnanmasood.com/?p=932</guid>
		<description><![CDATA[In Bayesian Artificial Intelligence, authors Kevin B. Korb and Ann E. Nicholson points out the non-Bayesian nature of Belief networks. The researchers note Many AI researchers like to point out that Bayesian networks are not inherently Bayesian at all; some have even claimed that the label is a misnomer. At the 2002 Australasian Data Mining Workshop, for example, Geoff [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://books.google.com/books?id=I5JG767MryAC&amp;pg=PA23&amp;lpg=PA23&amp;dq=%22in+particular+as+propensities+or+probabilities+determined+by+propensities%22&amp;source=bl&amp;ots=qCFHgJNrDO&amp;sig=lgJuv_AJLw1ZqEJF8amxUG50APY&amp;hl=en&amp;sa=X&amp;ei=_YOhT5qYLdTYiQLk8OmYBw&amp;ved=0CBwQ6AEwAA#v=onepage&amp;q=%22in%20particular%20as%20propensities%20or%20probabilities%20determined%20by%20propensities%22&amp;f=false" target="_blank">Bayesian Artificial Intelligence</a>, authors <a href="http://www.csse.monash.edu.au/~korb/" target="_blank">Kevin B. Korb</a> and <a href="http://www.csse.monash.edu.au/~annn/" target="_blank">Ann E. Nicholson</a> points out the non-Bayesian nature of Belief networks. The researchers note</p>
<blockquote><p>Many AI researchers like to point out that Bayesian networks are not inherently Bayesian at all; some have even claimed that the label is a misnomer. At the 2002 Australasian Data Mining Workshop, for example, Geoff Webb made the former claim. Under questioning it turned out he had two points in mind:<br />
(1) Bayesian networks are frequently “data mined” (i.e., learned by some computer program) via non-Bayesian methods.</p>
<p>(2) Bayesian networks at bottom represent probabilities; but probabilities can be interpreted in any number of ways, including as some form of frequency; hence, the networks are not intrinsically either Bayesian or non-Bayesian, they simply represent values needing further interpretation.</p>
<p><strong>These two points are entirely correct</strong>. We shall ourselves present non-Bayesian methods for automating the learning of Bayesian networks from statistical data. We shall also present Bayesian methods for the same, together with some evidence of their superiority. The interpretation of the probabilities represented by Bayesian networks is open so long as the philosophy of probability is considered an open question.</p></blockquote>
<p>&nbsp;</p>
<p><a href="http://www.csse.monash.edu.au/bai/tutorial/BOMJuly06.pdf" target="_blank"><img class="aligncenter size-medium wp-image-967" title="AreBayesianNetworksBayesian" src="http://blog.adnanmasood.com/wp-content/uploads/2012/05/AreBayesianNetworksBayesian-230x300.png" alt="" width="230" height="300" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<blockquote><p>Indeed, much of the work presented here ultimately depends upon the probabilities being understood as physical probabilities, and in particular as propensities or probabilities determined by propensities.</p>
<p>Nevertheless, we happily invoke the Principal Principle: where we are convinced that the probabilities at issue reflect the true propensities in a physical system we are certainly going to use them in assessing our own degrees of belief.<br />
The advantages of the Bayesian network representations are largely in <strong>simplifying conditionalization, planning decisions under uncertainty and explaining the outcome of stochastic processes</strong>. These purposes all come within the purview of a clearly Bayesian interpretation of what the probabilities mean, and so, we claim, the Bayesian network technology which we here introduce is aptly named: it provides the technical foundation for a truly Bayesian artificial intelligence.</p></blockquote>
<p>References</p>
<p><a href="http://www.csse.monash.edu.au/bai/tutorial/BOMJuly06.pdf" target="_blank">Bayesian AI Tutorial</a></p>
<p><a href="www.cs.ubc.ca/~murphyk/Bayes/bnintro.html" target="_blank">A Brief Introduction to Graphical Models and Bayesian Networks</a></p>
<p>&nbsp;</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.adnanmasood.com%2F2012%2F05%2F03%2Fare-bayesian-networks-bayesian-enough%2F&amp;title=Are%20Bayesian%20networks%20Bayesian%20enough%3F" id="wpa2a_4"><img src="http://blog.adnanmasood.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.adnanmasood.com/2012/05/03/are-bayesian-networks-bayesian-enough/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Darkroom theme for Lyx/LaTeX</title>
		<link>http://blog.adnanmasood.com/2012/05/02/darkroom-theme-for-lyxlatex/</link>
		<comments>http://blog.adnanmasood.com/2012/05/02/darkroom-theme-for-lyxlatex/#comments</comments>
		<pubDate>Wed, 02 May 2012 12:06:23 +0000</pubDate>
		<dc:creator>Adnan Masood</dc:creator>
				<category><![CDATA[Generic]]></category>
		<category><![CDATA[Research & Development]]></category>

		<guid isPermaLink="false">http://blog.adnanmasood.com/?p=956</guid>
		<description><![CDATA[Like distraction-free-easy-on-eyes Dark IDE&#8217;s, most developers prefer clutter free green on black background for their text editors as well. On Lyx, it&#8217;s fairly easy to do with step by step instructions here. This color scheme is somewhat similar to Darkroom for Windows. All you&#8217;d need to do is to modify your lyx preferences file with the [...]]]></description>
			<content:encoded><![CDATA[<p>Like <a href="http://studiostyl.es/" target="_blank">distraction-free-easy-on-eyes Dark IDE&#8217;s</a>, most developers prefer clutter free green on black background for their text editors as well. On Lyx, it&#8217;s fairly easy to do with step by step instructions <a href="http://wiki.lyx.org/Tips/ColorSchemes#green_on_black" target="_blank">here</a>. This color scheme is somewhat similar to Darkroom for Windows. All you&#8217;d need to do is to modify your lyx preferences file with the following code. The location of preferences file depends on your OS but it&#8217;s general location is \<Username>\Application Data\Lyx, could also be \Username\AppData\Roaming\Lyx2.0\Preferences. It&#8217;s an extension-less file.</p>
<pre class="brush: csharp;" lang="C#">

#
# SCREEN &#038; FONTS SECTION ############################
#

\screen_font_roman "Shruti"
\screen_font_sans "Arial Black"

#
# COLOR SECTION ###################################
#

\set_color "cursor" "#00ff00"
\set_color "background" "#000000"
\set_color "foreground" "#00ff00"
\set_color "selection" "#005500"
\set_color "note" "#00ff00"
\set_color "notebg" "#555500"
\set_color "math" "#aaff00"
\set_color "mathbg" "#001000"
\set_color "mathmacrobg" "#003100"
\set_color "mathframe" "#005500"
\set_color "mathcorners" "#005500"
\set_color "buttonframe" "#005500"
\set_color "buttonbg" "#005500"
\set_color "buttonhoverbg" "#00aa00"
</pre>
<p><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/05/DarkThemedLyx.png"><img class="aligncenter size-large wp-image-958" title="DarkThemedLyx" src="http://blog.adnanmasood.com/wp-content/uploads/2012/05/DarkThemedLyx-1024x655.png" alt="" width="600" height="383" /></a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.adnanmasood.com%2F2012%2F05%2F02%2Fdarkroom-theme-for-lyxlatex%2F&amp;title=Darkroom%20theme%20for%20Lyx%2FLaTeX" id="wpa2a_6"><img src="http://blog.adnanmasood.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.adnanmasood.com/2012/05/02/darkroom-theme-for-lyxlatex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continued adventures in SamIam &#8211; Back to Basics with Code Bandit</title>
		<link>http://blog.adnanmasood.com/2012/04/30/continued-adventures-in-samiam-back-to-basics-with-code-bandit/</link>
		<comments>http://blog.adnanmasood.com/2012/04/30/continued-adventures-in-samiam-back-to-basics-with-code-bandit/#comments</comments>
		<pubDate>Tue, 01 May 2012 01:45:34 +0000</pubDate>
		<dc:creator>Adnan Masood</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Bayesian]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Research & Development]]></category>

		<guid isPermaLink="false">http://blog.adnanmasood.com/?p=945</guid>
		<description><![CDATA[As discussed previous post on Customizing Conditional Probability using Code Generation with SamIam, I have touched upon importance of having programmatic and declarative control over the network. Working with SamIam (and with Infer.NET to some extent) gives a researcher provides this flexibility which is hard to find in proprietary tools. Here is a simple example of a [...]]]></description>
			<content:encoded><![CDATA[<p>As discussed previous post on <a href="http://blog.adnanmasood.com/2012/04/23/customizing-conditional-probability-using-code-generation-with-samiam/" target="_blank">Customizing Conditional Probability using Code Generation with SamIam</a>, I have touched upon importance of having programmatic and declarative control over the network. Working with SamIam (and with Infer.NET to some extent) gives a researcher provides this flexibility which is hard to find in proprietary tools.</p>
<p>Here is a simple example of a typical text book belief network. Once graphically drawn, SamIam&#8217;s code bandit allow you to extract the model out as a class.</p>
<p><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/04/samiam-back-to-basics-conditional-probability.png"><img class="aligncenter size-large wp-image-947" title="samiam-back-to-basics-conditional-probability" src="http://blog.adnanmasood.com/wp-content/uploads/2012/04/samiam-back-to-basics-conditional-probability-1024x776.png" alt="" width="600" height="454" /></a></p>
<p>This class hard codes the network &#8230;code\samiam30_windows_amd64\samiam\BeliefNet.net where one can operate on the object BayesianNetwork and can modify the nodes by population from a different data source rather than hard coding. Once a simple, readable structure model is available in raw code, there are lots of possibilities for data population. To build, ensure that inflib.jar occurs in the command line classpath, <em>e.g. javac -classpath inflib.jar ModelTutorial.java</em></p>
<p>&nbsp;</p>
<pre class="brush: csharp;" lang="C#">public BayesianNetwork createBayesianNetwork()
  {
    /* Create a domain of size 5. */
    Domain domain = new Domain(5);

    /* Add a discrete variable called "H" to the domain,
       with states "True", "False". */
    String     name0 = "H";
    String[] values0 = new String[]{ "True", "False" };
    int          id0 = domain.addDim( name0, values0 );

    /* Add a discrete variable called "B" to the domain,
       with states "True", "False". */
    String     name1 = "B";
    String[] values1 = new String[]{ "True", "False" };
    int          id1 = domain.addDim( name1, values1 );

    /* Add a discrete variable called "L" to the domain,
       with states "True", "False". */
    String     name2 = "L";
    String[] values2 = new String[]{ "True", "False" };
    int          id2 = domain.addDim( name2, values2 );

    /* Add a discrete variable called "C" to the domain,
       with states "True", "False". */
    String     name3 = "C";
    String[] values3 = new String[]{ "True", "False" };
    int          id3 = domain.addDim( name3, values3 );

    /* Add a discrete variable called "F" to the domain,
       with states "True", "False". */
    String     name4 = "F";
    String[] values4 = new String[]{ "True", "False" };
    int          id4 = domain.addDim( name4, values4 );

    /* For the cpts, create arrays of double-precision floating point values. */
    //H     Value
    //True  0.2
    //False 0.8
    double[] cpt0 = new double[]{ 0.2, 0.8 };
    //B     H     Value
    //True  True  0.25
    //True  False 0.05
    //False True  0.75
    //False False 0.95
    double[] cpt1 = new double[]{ 0.25, 0.05, 0.75, 0.95 };
    //L     H     Value
    //True  True  0.03
    //True  False 5.0E-4
    //False True  0.97
    //False False 0.9995
    double[] cpt2 = new double[]{ 0.03, 5.0E-4, 0.97, 0.9995 };
    //C     L     Value
    //True  True  0.6
    //True  False 0.02
    //False True  0.4
    //False False 0.98
    double[] cpt3 = new double[]{ 0.6, 0.02, 0.4, 0.98 };
    //F     L     B     Value
    //True  True  True  0.75
    //True  True  False 0.1
    //True  False True  0.5
    //True  False False 0.05
    //False True  True  0.25
    //False True  False 0.9
    //False False True  0.5
    //False False False 0.95
    double[] cpt4 = new double[]{ 0.75, 0.1, 0.5, 0.05, 0.25, 0.9, 0.5, 0.95 };</pre>
<p>Later on, SamIam creates the table using the CPT&#8217;s and eventually build the network using these tables.</p>
<pre class="brush: csharp;" lang="C#">/*
Create a IL2 Table for each cpt.
The parameters to the Table constructor are:
(1) the domain,
(2) the variable ids that name the dimensions of the table (in the form of an IntSet),
(3) the cpt data.
*/
Table table0 = new Table( domain, new IntSet( new int[]{ id0 } ), cpt0 );
Table table1 = new Table( domain, new IntSet( new int[]{ id0, id1 } ), cpt1 );
Table table2 = new Table( domain, new IntSet( new int[]{ id0, id2 } ), cpt2 );
Table table3 = new Table( domain, new IntSet( new int[]{ id2, id3 } ), cpt3 );
Table table4 = new Table( domain, new IntSet( new int[]{ id1, id2, id4 } ), cpt4 );

/* Create an array of all the Tables. */
Table[] tables = new Table[]{ table0, table1, table2, table3, table4 };

/*
The simple BayesianNetwork constructor takes only one argument:
an array of Tables.
*/
BayesianNetwork model = new BayesianNetwork( tables );</pre>
<p>Upon building, you get the following console output.</p>
<p><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/04/samiam-model-building.png"><img class="aligncenter size-large wp-image-948" title="samiam-model-building" src="http://blog.adnanmasood.com/wp-content/uploads/2012/04/samiam-model-building-1024x776.png" alt="" width="600" height="454" /></a></p>
<p>Happy inferring!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.adnanmasood.com%2F2012%2F04%2F30%2Fcontinued-adventures-in-samiam-back-to-basics-with-code-bandit%2F&amp;title=Continued%20adventures%20in%20SamIam%20%26%238211%3B%20Back%20to%20Basics%20with%20Code%20Bandit" id="wpa2a_8"><img src="http://blog.adnanmasood.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.adnanmasood.com/2012/04/30/continued-adventures-in-samiam-back-to-basics-with-code-bandit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag Cloud for Belief Network Sensitivity as Background Knowledge</title>
		<link>http://blog.adnanmasood.com/2012/04/29/tag-cloud-for-belief-network-sensitivity-as-background-knowledge/</link>
		<comments>http://blog.adnanmasood.com/2012/04/29/tag-cloud-for-belief-network-sensitivity-as-background-knowledge/#comments</comments>
		<pubDate>Sun, 29 Apr 2012 11:00:53 +0000</pubDate>
		<dc:creator>Adnan Masood</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Bayesian]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Research & Development]]></category>

		<guid isPermaLink="false">http://blog.adnanmasood.com/?p=923</guid>
		<description><![CDATA[While we are having fun visualizing with tag clouds, here is one on the following four key papers in the area of pattern mining with Bayesian networks as background knowledge and discovery of interesting patterns based on Bayesian network background knowledge. Fast discovery of interesting patterns based on Bayesian network background knowledge Fast discovery of [...]]]></description>
			<content:encoded><![CDATA[<p>While we are having fun visualizing with tag clouds, here is one on the following four key papers in the area of pattern mining with Bayesian networks as background knowledge and discovery of interesting patterns based on Bayesian network background knowledge.</p>
<ul>
<li><a href="http://www.sharjah.ac.ae/Arabic/About_UOS/UOSPublications/Appliedsciences/Issues/Documents/4_3/03-Rana-0104045.pdf" target="_blank">Fast discovery of interesting patterns based on Bayesian network background knowledge</a></li>
<li><a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.68.9201&amp;rep=rep1&amp;type=pdf" target="_blank">Fast discovery of unexpected patterns in data, relative to a Bayesian network</a></li>
<li><a href="http://qspace.qu.edu.qa/bitstream/handle/10576/10467/sdarticle.pdf.txt?sequence=4" target="_blank">Interestingness filtering engine: Mining Bayesian networks for interesting patterns</a></li>
<li><a href="https://www.cs.uni-potsdam.de/ml/publications/dami2008.pdf" target="_blank">Scalable pattern mining with Bayesian networks as background knowledge</a></li>
<li><a href="http://ieeexplore.ieee.org/xpl/login.jsp?tp=&amp;arnumber=4493535&amp;url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D4493535" target="_blank">Using sensitivity of a bayesian network to discover interesting patterns</a></li>
</ul>
<p>&nbsp;</p>
<p><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/04/Scalable-pattern-mining-with-Bayesian-networks-as-background-knowledge-Fast-discovery-of-interesting-patterns-based-on-Bayesian-network-background-knowledge.png"><img class="aligncenter" title="Scalable pattern mining with Bayesian networks as background knowledge Fast discovery of interesting patterns based on Bayesian network background knowledge" src="http://blog.adnanmasood.com/wp-content/uploads/2012/04/Scalable-pattern-mining-with-Bayesian-networks-as-background-knowledge-Fast-discovery-of-interesting-patterns-based-on-Bayesian-network-background-knowledge-1024x462.png" alt="" width="600" height="270" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.adnanmasood.com%2F2012%2F04%2F29%2Ftag-cloud-for-belief-network-sensitivity-as-background-knowledge%2F&amp;title=Tag%20Cloud%20for%20Belief%20Network%20Sensitivity%20as%20Background%20Knowledge" id="wpa2a_10"><img src="http://blog.adnanmasood.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.adnanmasood.com/2012/04/29/tag-cloud-for-belief-network-sensitivity-as-background-knowledge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selected Papers in Machine Learning</title>
		<link>http://blog.adnanmasood.com/2012/04/28/selected-papers-in-machine-learning/</link>
		<comments>http://blog.adnanmasood.com/2012/04/28/selected-papers-in-machine-learning/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 12:09:30 +0000</pubDate>
		<dc:creator>Adnan Masood</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Bayesian]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Research & Development]]></category>

		<guid isPermaLink="false">http://blog.adnanmasood.com/?p=914</guid>
		<description><![CDATA[The Discipline of Machine Learning by Tom Mitchell Introduction to Support Vector Machines &#8211; Dustin Boswell Fast Training of Support Vector Machines using Sequential Minimal Optimization Introduction to linear regression The elements of statistical learning (book) Survey of Clustering Algorithms Supervised Machine Learning: A Review of Classification Techniques Ensemble Methods in Machine Learning The Boosting Approach to [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://www.cs.cmu.edu/~tom/pubs/MachineLearning.pdf" target="_blank">The Discipline of Machine Learning</a> by <a href="www.cs.cmu.edu/~tom/" target="_blank">Tom Mitchell</a></li>
<li><a href="http://thales.doa.fmph.uniba.sk/korbas/pulag/D_Boswell_Intro_To_Support_Vector_Machines.pdf" target="_blank">Introduction to Support Vector Machines &#8211; Dustin Boswell</a></li>
<li><a href="http://research.microsoft.com/en-us/um/people/jplatt/smo-book.pdf" target="_blank">Fast Training of Support Vector Machines using Sequential Minimal Optimization</a></li>
<li><a href="http://www.duke.edu/~rnau/regintro.htm" target="_blank">Introduction to linear regression</a></li>
<li><a href="http://www.stanford.edu/~hastie/local.ftp/Springer/ESLII_print5.pdf" target="_blank">The elements of statistical learning</a> (book)</li>
<li><a href="http://decplagio.googlecode.com/svn/trunk/docs/Survey%20of%20Clustering%20Algorithms.pdf" target="_blank">Survey of Clustering Algorithms</a></li>
<li><a href="http://www.informatica.si/PDF/31-3/11_Kotsiantis%20-%20Supervised%20Machine%20Learning%20-%20A%20Review%20of...pdf" target="_blank">Supervised Machine Learning: A Review of Classification Techniques</a></li>
<li><a href="http://www.eecs.wsu.edu/~holder/courses/CptS570/fall07/papers/Dietterich00.pdf" target="_blank">Ensemble Methods in Machine Learning</a></li>
<li><a href="http://tjure.sfs.uni-tuebingen.de/files/Kursmaterialien/Kuebler/ML-ss05/schapire.pdf" target="_blank">The Boosting Approach to Machine Learning</a></li>
<li><a href="http://ranger.uta.edu/~chqding/papers/KmeansPCA1.pdf" target="_blank">K-means clustering via principal component analysis</a></li>
<li><a href="http://www.math.uwaterloo.ca/~aghodsib/courses/f06stat890/readings/tutorial_stat890.pdf" target="_blank">Dimensionality Reduction</a></li>
<li><a href="http://webdocs.cs.ualberta.ca/~swang/cs886/hofmann.pdf" target="_blank">Unsupervised Learning by Probabilistic Latent Semantic Analysis</a></li>
<li><a href="http://www.ai.mit.edu/projects/jmlr/papers/volume2/genton01a/genton01a.pdf" target="_blank">Classes of Kernels for Machine Learning:A Statistics Perspective</a></li>
<li><a href="http://vmg.pp.ua/books/%D0%9A%D0%BE%D0%BF%D1%8C%D1%8E%D1%82%D0%B5%D1%80%D1%8B%D0%98%D1%81%D0%B5%D1%82%D0%B8/_Lecture%20Notes%20in%20Computer%20Science/learning/Advanced%20Lectures%20on%20Machine%20Learning%202003(LNCS3176,%20Springer,%202004)(ISBN%203540231226)(248s).pdf#page=48" target="_blank">Bayesian inference: An introduction to principles and practice in machine learning</a></li>
<li><a href="http://cis.temple.edu/~latecki/Courses/RobotFall07/PapersFall07/andrieu03introduction.pdf" target="_blank">An Introduction to MCMC for Machine Learning </a></li>
<li><a href="http://www.informatica.si/pdf/informatica_2007_3.pdf#page=3" target="_blank">Supervised machine learning: A review of classification techniques</a></li>
<li><a href="http://www.cs.utah.edu/~hal/courses/2007S_ML/notes02.pdf" target="_blank">Linear Algebra Refresher</a></li>
<li><a href="http://www.cs.utah.edu/~piyush/teaching/bayes-review.pdf" target="_blank">Bayesian Modelling in Machine Learning: A Tutorial Review</a></li>
</ul>
<p><a href="http://www.informatik.uni-hamburg.de/ML/" target="_blank"><img class="aligncenter size-large wp-image-924" title="Machine Learning" src="http://blog.adnanmasood.com/wp-content/uploads/2012/04/ml-wordle-1024x546.jpg" alt="" width="600" height="319" /></a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.adnanmasood.com%2F2012%2F04%2F28%2Fselected-papers-in-machine-learning%2F&amp;title=Selected%20Papers%20in%20Machine%20Learning" id="wpa2a_12"><img src="http://blog.adnanmasood.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.adnanmasood.com/2012/04/28/selected-papers-in-machine-learning/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TagCloud for Sensitivity Analysis of Probabilistic Graphical Models</title>
		<link>http://blog.adnanmasood.com/2012/04/27/tagcloud-for-sensitivity-analysis-of-probabilistic-graphical-models/</link>
		<comments>http://blog.adnanmasood.com/2012/04/27/tagcloud-for-sensitivity-analysis-of-probabilistic-graphical-models/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 05:28:10 +0000</pubDate>
		<dc:creator>Adnan Masood</dc:creator>
				<category><![CDATA[Bayesian]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Research & Development]]></category>

		<guid isPermaLink="false">http://blog.adnanmasood.com/?p=892</guid>
		<description><![CDATA[Here is an interesting word cloud built using dissertation by Hei Chan of UCLA on Sensitivity analysis of probabilistic graphical models. Following is the summary of the thesis. Probabilistic belief systems are used in artificial intelligence to model uncertainty. A popular framework for realizing probabilistic belief systems is to use graphical models, such as Bayesian [...]]]></description>
			<content:encoded><![CDATA[<p>Here is an interesting word cloud built using dissertation by Hei Chan of UCLA on <a href="http://proquest.umi.com/pqdlink?Ver=1&amp;Exp=04-27-2017&amp;FMT=7&amp;DID=990302671&amp;RQT=309&amp;attempt=1" target="_blank">Sensitivity analysis of probabilistic graphical models</a>.</p>
<p><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/04/Sensitivity-Analysis-of-Probabilistic-Graphical-Models.png"><img class="aligncenter size-large wp-image-915" title="Sensitivity Analysis of Probabilistic Graphical Models" src="http://blog.adnanmasood.com/wp-content/uploads/2012/04/Sensitivity-Analysis-of-Probabilistic-Graphical-Models-1024x363.png" alt="Sensitivity Analysis of Probabilistic Graphical Models" width="600" height="212" /></a></p>
<p>Following is the summary of the thesis.</p>
<blockquote><p>Probabilistic belief systems are used in artificial intelligence to model uncertainty. A popular framework for realizing probabilistic belief systems is to use graphical models, such as Bayesian networks and Markov networks. The topic of sensitivity analysis is concerned broadly with the relationships between local beliefs, such as network parameters, and global beliefs, such as values of probabilistic queries. Sensitivity analysis is crucial to probabilistic belief systems because we often need to revise our state of belief to incorporate new probabilistic information in the form of local belief changes. This work focuses on sensitivity analysis of probabilistic graphical models, by addressing central research problems such as the assessment of global belief changes due to local belief changes, the identification of local belief changes that induce certain global belief changes, and the quantifying of belief changes in general. Our results can be divided into the following parts. First, we develop procedures and complexity results for tuning Bayesian or Markov network parameters (single or multiple) to ensure certain query constraints. Second, we provide network-independent bounds on changes in query values due to arbitrary changes in Bayesian or Markov network parameters. Third, we propose a new distance measure for quantifying probabilistic belief changes, and use it to provide guarantees on global belief changes in Bayesian or Markov networks. Fourth, we provide algorithms and complexity results on the sensitivity of decisions induced by Bayesian networks. Finally, we discuss the philosophical topic of belief revision. Many of our results have been implemented in a program called SamIam (Sensitivity Analysis, Modeling, Inference and More), a graphical Bayesian network tool developed by the UCLA Automated Reasoning Group.</p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.adnanmasood.com%2F2012%2F04%2F27%2Ftagcloud-for-sensitivity-analysis-of-probabilistic-graphical-models%2F&amp;title=TagCloud%20for%20Sensitivity%20Analysis%20of%20Probabilistic%20Graphical%20Models" id="wpa2a_14"><img src="http://blog.adnanmasood.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.adnanmasood.com/2012/04/27/tagcloud-for-sensitivity-analysis-of-probabilistic-graphical-models/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fun -&gt; Infer.NET (probabilistic programming in F#)</title>
		<link>http://blog.adnanmasood.com/2012/04/25/fun-infer-net-probabilistic-programming-in-f/</link>
		<comments>http://blog.adnanmasood.com/2012/04/25/fun-infer-net-probabilistic-programming-in-f/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 08:55:32 +0000</pubDate>
		<dc:creator>Adnan Masood</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Bayesian]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Research & Development]]></category>

		<guid isPermaLink="false">http://blog.adnanmasood.com/?p=861</guid>
		<description><![CDATA[&#8220;I&#8217;m not an outlier; I just haven&#8217;t found my distribution yet!&#8221; -Ronan Conroy Infer.NET is a .NET library for machine learning which provides state-of-the-art algorithms for probabilistic inference from data. Due to its capability of seamlessly integrating with the .NET code, I have used this library frequently and wrote about Infer.Net in the past; however, [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;I&#8217;m not an outlier; I just haven&#8217;t found my distribution yet!&#8221; -Ronan Conroy</p>
<p><a href="http://research.microsoft.com/en-us/um/cambridge/projects/infernet/docs/What%20is%20Infer.NET.aspx" target="_blank">Infer.NET</a> is a .NET library for machine learning which provides state-of-the-art algorithms for <a href="http://pubs.amstat.org/doi/abs/10.1198/tast.2011.10169?ai=rv&amp;mi=3b31aa&amp;af=R" target="_blank">probabilistic inference from data</a>. Due to its capability of seamlessly integrating with the .NET code, I have used this library frequently and wrote about <a href="http://blog.adnanmasood.com/2010/12/24/exploring-bayes-point-machine-with-infer-net/" target="_blank">Infer.Net in the past</a>; however, during a recent hunt of looking for a functional dialect for probabilistic programming, I came across <a href="http://research.microsoft.com/en-us/downloads/21e87d72-782d-4657-82c4-4f77c2b547ca/" target="_blank">Infer.NET Fun</a> dubbed as An F# Library for Probabilistic Programming. Being a first class .NET citizen,<a href="http://research.microsoft.com/en-us/um/cambridge/projects/infernet/docs/fsharp%20wrapper.aspx" target="_blank"> it was always possible to call infer.net</a> directly from F# but having a <em>&#8220;succinct syntax of F# into an executable modeling language&#8221; </em>to enjoy the raw-functional-style of language is always the best.</p>
<p>Infer.NET Fun seems to have come out of this research paper <a href=" http://www.cis.upenn.edu/~mgree/papers/esop2011sub_bayesian.pdf" target="_blank">Distribution Transformer Semantics for Bayesian Machine Learning</a> and a resulting Microsoft research report by <a href=" http://www.cis.upenn.edu/~mgree/papers/esop2011sub_bayesian.pdf" target="_blank">Johannes Borgström, Andrew D. Gordon, Michael Greenberg, James Margetson, and Jurgen Van Gael, </a><a href="http://research.microsoft.com/apps/pubs/default.aspx?id=135344">Measure Transformer Semantics for Bayesian Machine Learning</a><a href=" http://www.cis.upenn.edu/~mgree/papers/esop2011sub_bayesian.pdf" target="_blank">, no. MSR-TR-2011-18, July 2011</a></p>
<p>The project is defined as</p>
<blockquote><p>Infer.NET Fun turns the simple succinct syntax of F# into an executable modeling language. You can code up the conditional probability distributions of Bayes’ rule using F# array comprehensions with constraints. Write your model in F#. Run it directly to synthesize test datasets and to debug models. Or compile it with the Infer.NET compiler and runtime for efficient statistical inference.</p></blockquote>
<p>The syntax is very powerful and does every effort to makes functional programmer at home. As an example, let&#8217;s go with the age-old coin toss problem.</p>
<p>Let&#8217;s toss two coins and observe that not both of them are heads; now we can use infer,net to calculate the conditional probability that is assigned after the relevant evidence is taken into account. This is called the inference of posterior probability to figure out if each of these were heads. To do so using Infer.NET Fun you start by writing a model as follows:</p>
<pre class="brush: csharp;" lang="C#">open MicrosoftResearch.Infer.Fun.FSharp.Syntax

[]
let coins () =
    let c1 = random (Bernoulli(0.5))
    let c2 = random (Bernoulli(0.5))
    let bothHeads = c1 &amp;&amp; c2
    observe (bothHeads = false)
    c1, c2, bothHeads</pre>
<p>This is the model definition of the problem. This model is using a function random which returns a random sample from a given distribution. The second function being used is observe which marks the execution as failed if the condition is not satisfied.</p>
<p>It takes some adjustment to be able to understand the functional definition here but the ultimate goal of this inference is to produce the distribution of the output variables of the model across all executions with a condition; no observation should fail (bothHeads=false). Sampling from a model is as simple as calling the function coins(). I am running this in debug mode stepping through as can be seen in the screenshot below.</p>
<div></div>
<p><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/04/fun-fsharp-infer.net-bayesian-inference.png"><img title="fun-fsharp-infer.net-bayesian-inference" src="http://blog.adnanmasood.com/wp-content/uploads/2012/04/fun-fsharp-infer.net-bayesian-inference.png" alt="" width="1020" height="742" /></a></p>
<p>by printing the output from method, you get the screenshot above for c1, c2 and bothHeads</p>
<pre class="brush: csharp;" lang="C#">printf "Sample: %O\n" (coins ())</pre>
<p>Now, in order to retrieve the model (infer) from the given model which we just setup, you can do the following.</p>
<pre>open MicrosoftResearch.Infer.Fun.FSharp.Inference
setVerbose true
setShowFactorGraph false
let (c1D,c2D,bothD) = inferFun3 &lt;@ coins @&gt; ()
printf "coinsD: \n%O\n%O\n%O\n" c1D c2D bothD</pre>
<p>Setting verbosit will be able to demonstrate the underlying model. Now in order to perform inference, the function inferFun3 runs and returns a triple of distributions, one for each return value o<span style="font-family: 'Courier New', Courier, 'Lucida Console', Monaco, 'DejaVu Sans Mono', 'Nimbus Mono L', 'Bitstream Vera Sans Mono', monospace;"><span style="font-size: 12px; line-height: normal;">f coins()</span></span></p>
<p><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/04/fun-fsharp-infer.net-bayesian-inference-model.png"><img class="aligncenter size-large wp-image-901" title="fun-fsharp-infer.net-bayesian-inference-model" src="http://blog.adnanmasood.com/wp-content/uploads/2012/04/fun-fsharp-infer.net-bayesian-inference-model-1024x590.png" alt="" width="600" height="345" /></a></p>
<p>One of the really cool features of infer.net which I like is that by setting the following.</p>
<div>
<pre>setShowFactorGraph true</pre>
</div>
<div>you can actually get the following model without writing a single line of code (for graphical model)!</div>
<div><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/04/bayesian-infernet-setShowFactorGraph.png"><img class="aligncenter size-full wp-image-902" title="bayesian-infernet-setShowFactorGraph" src="http://blog.adnanmasood.com/wp-content/uploads/2012/04/bayesian-infernet-setShowFactorGraph.png" alt="" width="472" height="854" /></a></div>
<p>&nbsp;</p>
<p>The Infer.NET Fun paper concludes with the following information about their contribution. The paper talks about the importance of being able to write probablistic programs directly using a declarative language fun, a subset of F#.</p>
<p>&nbsp;</p>
<blockquote><p>&nbsp;</p>
<p>Our direct contribution is a rigorous semantics for a probabilistic programming language that also has an equivalent factor graph semantics. More importantly, the implication of our work for the machine learning community is that probabilistic programs can be written directly within an existing declarative language (Fun—a subset of F#) and compiled down to lower level Bayesian inference engines.</p>
<p>For the programming language community, our new semantics suggests some novel directions for research. What other primitives are possible—non-generative models, inspection of distributions, on-line inference on data streams? Can we provide a semantics for other data structures, especially of probabilistically varying size? Can our semantics be extended to higher-order programs? Can we verify the transformations performed by machine learning compilers such as Infer.NET compiler for Csoft? Are there type systems for avoiding zero probability exceptions, or to ensure that we only generate factor graphs that can be handled by our back-end?</p></blockquote>
<p><a href="http://research.microsoft.com/en-us/people/dsyme/" target="_blank">Don Syme</a> have <a href="http://research.microsoft.com/en-us/news/features/fsharp-041310.aspx" target="_blank">already said</a> that F stands for fun in F# but Infer.NET fun is definitely putting fun in inference and F#, well probably <img src='http://blog.adnanmasood.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2012/Reverend-Bayes-meet-Countess-Lovelace-Probabilistic-Programming-for-Machine-Learning">Here</a> are the slides and video of the Infer.NET Fun talk at<a href="http://www.curtclifton.net/journal/2012/4/10/langnext-2012.html" target="_blank"> Lang.NEXT 2012</a>.</p>
<p><strong>Reverend Bayes, meet Countess Lovelace: Probabilistic Programming for Machine Learning</strong></p>
<p><iframe style="height:544px;width:960px" src="http://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2012/Reverend-Bayes-meet-Countess-Lovelace-Probabilistic-Programming-for-Machine-Learning/player?w=960&#038;h=544" frameBorder="0" scrolling="no" ></iframe></p>
<p>Great news for creating probabilistic DSL; as <a href="http://msdn.microsoft.com/en-us/vstudio/gg634701" target="_blank">F# is moving into the Enterprise &#8211; Accelerated Analytical and Parallel .NET Development with F# 2.0</a></p>
<p>Happy Infering!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.adnanmasood.com%2F2012%2F04%2F25%2Ffun-infer-net-probabilistic-programming-in-f%2F&amp;title=fun%20-%3E%20Infer.NET%20%28probabilistic%20programming%20in%20F%23%29" id="wpa2a_16"><img src="http://blog.adnanmasood.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.adnanmasood.com/2012/04/25/fun-infer-net-probabilistic-programming-in-f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing Conditional Probability using Code Generation with SamIam</title>
		<link>http://blog.adnanmasood.com/2012/04/23/customizing-conditional-probability-using-code-generation-with-samiam/</link>
		<comments>http://blog.adnanmasood.com/2012/04/23/customizing-conditional-probability-using-code-generation-with-samiam/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 14:59:37 +0000</pubDate>
		<dc:creator>Adnan Masood</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Bayesian]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Research & Development]]></category>

		<guid isPermaLink="false">http://blog.adnanmasood.com/?p=838</guid>
		<description><![CDATA[Even though every machine learning practitioner and researcher would like to modify and tweak both the algorithm and parameters, there are limited options for automated code generation in the machine learning world. SamIam by Automated Reasoning Group, UCLA is the tool designed for “Sensitivity Analysis, Modeling, Inference and more”. Currently the sensitivity, MAP, MPE and EM Learning [...]]]></description>
			<content:encoded><![CDATA[<p>Even though every machine learning practitioner and researcher would like to modify and tweak both the algorithm and parameters, there are limited options for automated code generation in the machine learning world. <a href="http://reasoning.cs.ucla.edu/samiam/" target="_blank">SamIam</a> by <a href="http://reasoning.cs.ucla.edu/" target="_blank">Automated Reasoning Group</a>, UCLA is the tool designed for “Sensitivity Analysis, Modeling, Inference and more”. Currently the sensitivity, MAP, MPE and EM Learning tools are supported by Code Bandit, the automated code generation module in the SamIam. This helps us to write Java code to execute MAP programmatically or write Java code to demonstrate how to create a CPT and edit its parameters dynamically.</p>
<p>The whole process is fairly easy; open up any network.</p>
<p><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/04/samiam-network.png"><img title="samiam-network" src="http://blog.adnanmasood.com/wp-content/uploads/2012/04/samiam-network-1024x713.png" alt="" width="600" height="417" /></a></p>
<p>&nbsp;</p>
<p>Then go to Tools =&gt; code bandit and select the activity you&#8217;d like to perform.</p>
<p><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/04/SamIam-codebandit.png"><img class="aligncenter size-large wp-image-851" title="SamIam-codebandit" src="http://blog.adnanmasood.com/wp-content/uploads/2012/04/SamIam-codebandit-1024x712.png" alt="" width="600" height="417" /></a></p>
<p>Here I will get the java code demonstrating how to create a CPT and edit the parameters dynamically.</p>
<p><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/04/SamIam-codegen.png"><img class="aligncenter size-large wp-image-852" title="SamIam-codegen" src="http://blog.adnanmasood.com/wp-content/uploads/2012/04/SamIam-codegen-1024x933.png" alt="" width="600" height="546" /></a></p>
<p>The sections of code can easily be modified. I am choosing <a href="http://www.glennshafer.com/assets/downloads/articles/article42.pdf" target="_blank">Shenoy-Shafer</a> here as the default algorithm but you can modify it both programatically or via UI.</p>
<pre class="brush: csharp;" lang="C#">System.out.println( "Editing CPT..." );

//(1) Retrieve child variable
FiniteVariable newChild = (FiniteVariable) model.forID( "newchild" );

//(2) Get the CPTShell (TableShell)
TableShell shell = (TableShell) newChild.getCPTShell( DSLNodeType.CPT );

//(3) Get the TableIndex
TableIndex index = shell.index();

//(4) Get the Table
Table table = shell.getCPT();

//(5) Retrieve parent variables
FiniteVariable parent00 = (FiniteVariable) model.forID( "parent00" );
FiniteVariable parent01 = (FiniteVariable) model.forID( "parent01" );
FiniteVariable parent02 = (FiniteVariable) model.forID( "parent02" );
FiniteVariable parent03 = (FiniteVariable) model.forID( "parent03" );
FiniteVariable parent04 = (FiniteVariable) model.forID( "parent04" );

//(6) Create an int[] to
//hold the multi-dimensional indices
int mindex[] = new int[ index.getNumVariables() ];

//(7) Choose the desired condition
//{ parent00 = false, parent01 = true, parent02 = false, parent03 = false, parent04 = false }
mindex[ index.variableIndex( parent00 ) ] = parent00.index( "false" );
mindex[ index.variableIndex( parent01 ) ] = parent01.index( "true" );
mindex[ index.variableIndex( parent02 ) ] = parent02.index( "false" );
mindex[ index.variableIndex( parent03 ) ] = parent03.index( "false" );
mindex[ index.variableIndex( parent04 ) ] = parent04.index( "false" );
mindex[ index.variableIndex( newChild ) ] = 0;

//(8) Use TableIndex to calculate
//the first linear index for the desired condition
int linear = index.index( mindex );
System.out.println( "Linear index? " + linear );

//(9) For the purposes of demonstation,
//set this condition deterministically for value "medium"
double zero = (double)0.0;
double one = (double)1.0;
table.setCP( linear + newChild.index( "low" ), zero );
table.setCP( linear + newChild.index( "medium" ), one );
table.setCP( linear + newChild.index( "high" ), zero );

//Print out information about the edited cpt.
System.out.println( "Edited cpt has min value: " + table.min() );
System.out.println( " max value: " + table.max() );
System.out.println( " entropy: " + table.entropy() );
return;</pre>
<p>and the output from the console window appears as follows.</p>
<p>&nbsp;</p>
<pre class="brush: csharp;" lang="C#">choosing recursive conditioning
Compilation Time (sec): 0.037
Memory used (Mb): 4.2724609375E-4
(Cumulative) Propagation Time (sec): 0.001

Compiling C:\Users\adnan.masood\Desktop\edu\samiam30_windows_amd64\samiam\MAPTutorial.java...
C:\Program Files\Java\jdk1.7.0_03\bin\javac.exe -classpath C:\Users\adnan.masood\Desktop\edu\samiam30_windows_amd64\samiam\inflib.jar C:\Users\adnan.masood\Desktop\edu\samiam30_windows_amd64\samiam\MAPTutorial.java
Note: C:\Users\adnan.masood\Desktop\edu\samiam30_windows_amd64\samiam\MAPTutorial.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Executing MAPTutorial...
C:\Program Files\Java\jdk1.7.0_03\bin\java.exe -classpath .;C:\Users\adnan.masood\Desktop\edu\samiam30_windows_amd64\samiam\inflib.jar MAPTutorial
Approximate MAP, P(MAP,e)= 0.8
	 P(MAP|e)= 0.8
	 instantiation: {A=Absent}

Initialization time, cpu: 0, elapsed: 11
Search time, cpu: 0, elapsed: 1

Executing MAPTutorial...
C:\Program Files\Java\jdk1.7.0_03\bin\java.exe -classpath .;C:\Users\adnan.masood\Desktop\edu\samiam30_windows_amd64\samiam\inflib.jar MAPTutorial
Approximate MAP, P(MAP,e)= 0.8
	 P(MAP|e)= 0.8
	 instantiation: {A=Absent}

Initialization time, cpu: 0, elapsed: 9
Search time, cpu: 0, elapsed: 1

choosing shenoy-shafer
Compilation Time (sec): 0.023
Memory used (Mb): 624.0
(Cumulative) Propagation Time (sec): 0.001

Compiling C:\Users\adnan.masood\Desktop\edu\samiam30_windows_amd64\samiam\CPTTutorial.java...
C:\Program Files\Java\jdk1.7.0_03\bin\javac.exe -classpath C:\Users\adnan.masood\Desktop\edu\samiam30_windows_amd64\samiam\inflib.jar C:\Users\adnan.masood\Desktop\edu\samiam30_windows_amd64\samiam\CPTTutorial.java
Note: C:\Users\adnan.masood\Desktop\edu\samiam30_windows_amd64\samiam\CPTTutorial.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Executing CPTTutorial...
C:\Program Files\Java\jdk1.7.0_03\bin\java.exe -classpath .;C:\Users\adnan.masood\Desktop\edu\samiam30_windows_amd64\samiam\inflib.jar CPTTutorial
Created a new cpt for variable newchild
with 5 parents.
The new cpt has 96 parameters.
The class of the shell is "edu.ucla.belief.TableShell".
Editing CPT...
Linear index? 69
Edited cpt has min value: 0.0
               max value: 1.0
               entropy:   49.13383752235577</pre>
<p>The generated code can therefore be used as a stand-alone program.</p>
<p><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/04/SamIam-console.png"><img class="aligncenter size-large wp-image-853" title="SamIam-console" src="http://blog.adnanmasood.com/wp-content/uploads/2012/04/SamIam-console-1024x559.png" alt="" width="600" height="327" /></a></p>
<p>&nbsp;</p>
<p>Happy Inferencing!</p>
<p><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/04/samiam-network.png"><br />
</a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.adnanmasood.com%2F2012%2F04%2F23%2Fcustomizing-conditional-probability-using-code-generation-with-samiam%2F&amp;title=Customizing%20Conditional%20Probability%20using%20Code%20Generation%20with%20SamIam" id="wpa2a_18"><img src="http://blog.adnanmasood.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.adnanmasood.com/2012/04/23/customizing-conditional-probability-using-code-generation-with-samiam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Uninformative priors of Bayesian Inference</title>
		<link>http://blog.adnanmasood.com/2012/04/22/on-history-of-bayesian-inference/</link>
		<comments>http://blog.adnanmasood.com/2012/04/22/on-history-of-bayesian-inference/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 15:16:31 +0000</pubDate>
		<dc:creator>Adnan Masood</dc:creator>
				<category><![CDATA[Bayesian]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Research & Development]]></category>

		<guid isPermaLink="false">http://blog.adnanmasood.com/?p=822</guid>
		<description><![CDATA[Since calling this post just On the history of Bayesian inference will be non sequitur. Judea Pearl won the ACM Turing Award, widely considered the &#8220;Nobel Prize in Computing&#8221; for his contribution in the areas of developing &#8220;Novel Framework for Reasoning under Uncertainty that Changed How Scientists Approach Real World Problems&#8221;. This framework is the notion of Bayesian Networks aka Bayesian Belief Networks [...]]]></description>
			<content:encoded><![CDATA[<p>Since calling this post just On the history of Bayesian inference will be non sequitur.</p>
<p>Judea Pearl won the <a href="http://www.bayesia.com/en/news/bayesialab/Pearl-TuringAward" target="_blank">ACM Turing Award</a>, widely considered the &#8220;<a href="http://turing100.acm.org/index.cfm?p=home" target="_blank">Nobel Prize in Computing</a>&#8221; for his contribution in the areas of developing <em>&#8220;Novel Framework for Reasoning under Uncertainty that Changed How Scientists Approach Real World Problems&#8221;.</em> This framework is the notion of Bayesian Networks aka Bayesian Belief Networks or just Belief Networks. In a <a href="http://bayes.cs.ucla.edu/TRIBUTE/tribute-contributors.JPG" target="_blank">2010 event</a> honoring the achievements of Dr. Pearl, chair of<a href="http://reasoning.cs.ucla.edu/" target="_blank"> automated reasoning group</a> in UCLA Dr. Darwiche wrote an excellent piece on <a href="http://bayes.cs.ucla.edu/TRIBUTE/part2-probability.pdf" target="_blank">Inference in Bayesian Networks, a historical perspective</a> which is a highly recommended reading for Belief network enthusiasts, historians, practitioners and researchers alike.</p>
<p>This paper outlines the origin of what we now know as Bayesian Networks; it all started as Judea&#8217;s poly-trees, evolved to multiple connected networks and brought the concept of causality and diagnostic support to the earlier days of &#8220;representation-only&#8221; graphs. Over the decades this discipline which started from simpler variable conditioning techniques and loop-cutset algorithms has matured and evolved into sophisticated iterative belief propagation, exact and approximate inference, and probabilistic queries. Beside the notion of causality in belief networks, it&#8217;s direction and implications, Dr. Pearl&#8217;s work has also spawned the area of probabilistic graphical models research, which now considers Belief networks as one of its subsets.</p>
<p>&nbsp;</p>
<p><a href="http://blog.adnanmasood.com/wp-content/uploads/2012/04/History-Bayesian-Inference-Network-Adnan-Masood-Adnan-Darwiche.png"><img class="aligncenter size-large wp-image-839" title="History-Bayesian-Inference-Network-Adnan-Masood-Adnan-Darwiche" src="http://blog.adnanmasood.com/wp-content/uploads/2012/04/History-Bayesian-Inference-Network-Adnan-Masood-Adnan-Darwiche-1024x611.png" alt="" width="600" height="358" /></a></p>
<p>&nbsp;</p>
<p>Reading through <a href="http://academic.research.microsoft.com/Author/550342/judea-pearl?query=judea%20pearl" target="_blank">Dr. Pearl’s</a> <a href="http://academic.research.microsoft.com/Detail?entitytype=2&amp;searchtype=2&amp;id=550342" target="_blank">Publications</a>, the researcher gets the true sense of how inference, causality and learning has evolved as part of the Bayesian networks. In his tribute paper, <a href="http://bayes.cs.ucla.edu/TRIBUTE/part2-probability.pdf" target="_blank">Inference in Bayesian Networks, a historical perspective</a>, <a href="http://www.cs.ucla.edu/~darwiche/" target="_blank">Dr. Darwiche (publications</a>) provides concise insight into the evolution of Bayesian inference. <a href="http://www.cs.ucla.edu/~darwiche/" target="_blank">Dr. Darwiche</a> insight into the future of Bayesian Networks is thoughtful as he concludes the paper with following.</p>
<blockquote><p>There is clearly a lot more to be done as we seem to always exceed the ability of existing algorithms by building more complex networks. In my opinion, however, what is greatly missed since Pearl’s initial work on this subject is his insistence on semantics, where he spared no eﬀort in establishing connections to cognition, and in grounding the most intricate mathematical manipulations in human intuition.</p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.adnanmasood.com%2F2012%2F04%2F22%2Fon-history-of-bayesian-inference%2F&amp;title=On%20Uninformative%20priors%20of%20Bayesian%20Inference" id="wpa2a_20"><img src="http://blog.adnanmasood.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.adnanmasood.com/2012/04/22/on-history-of-bayesian-inference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

