<?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>Artificial Intelligence | Brainxyz</title>
	<atom:link href="https://www.brainxyz.com/tag/artificial-intelligence/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.brainxyz.com/tag/artificial-intelligence/</link>
	<description>Machine Learning, Artificial Intelligence, Brain, Neuroscience, AI</description>
	<lastBuildDate>Mon, 02 Jan 2023 16:02:45 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>

<image>
	<url>https://www.brainxyz.com/wp-content/uploads/2020/08/cropped-new_icon4-1.png</url>
	<title>Artificial Intelligence | Brainxyz</title>
	<link>https://www.brainxyz.com/tag/artificial-intelligence/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">181902284</site>	<item>
		<title>Artificial Neural Networks &#124; Interpolation vs. Extrapolation</title>
		<link>https://www.brainxyz.com/machine-learning/ann/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ann</link>
					<comments>https://www.brainxyz.com/machine-learning/ann/#comments</comments>
		
		<dc:creator><![CDATA[Brainxyz]]></dc:creator>
		<pubDate>Mon, 07 Sep 2020 22:03:59 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[deep learning]]></category>
		<category><![CDATA[GPT-3]]></category>
		<category><![CDATA[neural network]]></category>
		<guid isPermaLink="false">https://www.brainxyz.com/?p=1579</guid>

					<description><![CDATA[<p>Artificial Neural Networks (ANNs) are powerful inference tools. They can be trained to fit complex functions and then used to predict new (unseen) data outside their training set. Fitting the training data is relatively easy for ANNs because of their Universal Approximation capability. However, that does not mean ANNs can learn the rules as we...</p>
<p>The post <a href="https://www.brainxyz.com/machine-learning/ann/">Artificial Neural Networks | Interpolation vs. Extrapolation</a> appeared first on <a href="https://www.brainxyz.com">Brainxyz</a>.</p>
<p>The post <a href="https://www.brainxyz.com/machine-learning/ann/">Artificial Neural Networks | Interpolation vs. Extrapolation</a> appeared first on <a href="https://www.brainxyz.com">Brainxyz</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Artificial Neural Networks (ANNs) are powerful inference tools. They can be trained to fit complex functions and then used to predict new (unseen) data outside their training set. Fitting the training data is relatively easy for ANNs because of their <a href="https://en.wikipedia.org/wiki/Universal_approximation_theorem" target="_blank" rel="noreferrer noopener nofollow">Universal Approximation</a> capability. However, that does not mean ANNs can learn the rules as we humans do. Here we aim to show how well a trained ANN, which fits its training data accurately, can generalize to new and unseen data. We categorize the unseen data into two types:</p>



<ol class="wp-block-list"><li>Data points within the training range (that can be interpolated). </li><li>Data points outside the training range (that can be extrapolated). </li></ol>



<p></p>



<p>Take this example: <strong>|</strong> 1-&gt;1 <strong>|</strong> 2-&gt;4 <strong>|</strong> 3-&gt;<strong>?</strong> <strong>|</strong> 4-&gt;16 <strong>|</strong> 5-&gt;25 <strong>|</strong> 6-&gt;<strong>?</strong> <strong>|</strong> &#8230;</p>



<p>If we ask a human to predict 3-&gt;? and 6-&gt;? from the sequence above, most humans can answer correctly once they discover the rule that fits the set, in this example: <strong>y = X<sup>2</sup></strong>. The process of predicting 3-&gt;9 is called interpolation while the process of predicting 6-&gt;36 is called extrapolation. In this specific example, the distinction between interpolation and extrapolation is not important for humans because as humans find the power rule, they can apply it for any other number in the sequence. Even if we jump to 100-&gt;?, the answer is straight forward (100<sup>2</sup>). Nevertheless, the distinction between interpolation and extrapolation is quite important for ANNs and this sheds some insight into the difference between learning in humans versus learning in ANNs.</p>



<p>Here we demonstrate this difference by implementing a simple yet powerful ANN architecture with a single hidden layer and demonstrate its generalization capability for various parameter settings. We randomly assign and freeze the weights in the first layer and only train the weights in the final layer using a closed-form solution. This method is popularized under the name <a rel="noreferrer noopener nofollow" href="https://en.wikipedia.org/wiki/Extreme_learning_machine" target="_blank">Extreme Learning Machine (ELM)</a> and has some controversial origins. From our experience, this method trains quickly and gives very accurate results for low dimensional datasets that have shallow structures. We use Matlab to showcase the demonstration because its syntax is similar to algebra and we can implement the ANN from scratch in just a few lines of code. First, we start from the hello world of Machine Learning which is training ANN to solve the XOR problem. Below is the complete Matlab code:</p>



<pre class="wp-block-code"><code>X = &#91; 0, 0; 1, 1; 0, 1; 1, 0 ];          % Xor data
y = &#91; 0, 0, 1, 1 ];                      % targets

input = 2; neurons = 5;                  % parameters.
Wx = randn(input, neurons)*0.01;         % input-hidden weights (range ~ -0.01 to 0.01)
z = tanh(X * Wx);                        % 1st-Layer forward activation (tanh)
Wo = y * pinv(z');                       % Training output weights (closed form solution)
predictions = tanh(X * Wx) * Wo';        % Feedforward propagation | inference

disp(predictions)                        % display the predicted data </code></pre>



<p>Believe it or not, the above is all you need to construct and train a single hidden layer ANN (no external libraries are needed). You can achieve comparable conciseness with python+numpy ( <a rel="noreferrer noopener" href="https://github.com/hunar4321/Simple_ANN/blob/master/ELM.py" target="_blank">https://github.com/hunar4321/Simple_ANN/blob/master/ELM.py</a> ). If you run this code in your IDE, it will output very close predictions to the targets i.e [0, 0, 1, 1]. What is more, the same lines of code can be used to approximate any function given you have enough neurons in the hidden layer. Though it should be noted that for very large inputs the inverse operation of the closed-form solution is computationally expensive. And in the case of very noisy datasets, over-fitting is the usual enemy.</p>



<p>Coming back to our quest which was to examine the ability of such trained networks to interpolate and extrapolate the unseen data, the XOR example is not useful for our quest because all the input data is used for training. A better example is to use these networks to solve the power rule: <strong>y = X<sup>2</sup></strong> (our first example). Following is the complete Matlab code for our next example:</p>



<pre class="wp-block-code"><code>step = 2;                          % step size i.e the gap between the training sequence

X = &#91;2:step:100]';                 % training data (even numbers) % 2, 4, 6,...
y = X.^2;                          % train targets

inp = 1; neurons = 100; 
Wx = randn(inp, neurons)*0.01;
z = tanh(X * Wx);
Wo = y' * pinv(z');
yhat = tanh(X * Wx) * Wo';

Xt = &#91;1:step:121]';               % testing data (odd numbers) % 1, 3, 5,...
yt = Xt.^2;                       % test targets

prediction = tanh(Xt * Wx) * Wo'; % inference

% visualizations
figure; hold on; plot(X, y,'og'); plot(X, yhat, '*r'); hold off; 
legend('target', 'prediction'); title('y = X^2')
figure; hold on; plot(Xt, yt,'og'); plot(Xt, prediction, '*r'); hold off; 
legend('target', 'prediction'); title('y = X^2')
xticks = 1:10:121;
set(gca,'XTick',xticks)</code></pre>



<p>The inputs for training are even numbers from 0 to 100 and their squares are the target outputs. As you can see from Figure 1, the network learned to fit and approximate the training data very well. </p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile is-vertically-aligned-center" style="grid-template-columns:55% auto"><figure class="wp-block-media-text__media"><img fetchpriority="high" decoding="async" width="560" height="420" src="https://www.brainxyz.com/wp-content/uploads/2020/09/training.png" alt="" class="wp-image-1658" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/training.png 560w, https://www.brainxyz.com/wp-content/uploads/2020/09/training.png 300w" sizes="(max-width: 560px) 100vw, 560px" /></figure><div class="wp-block-media-text__content">
<p class="has-text-align-center"></p>



<figure class="wp-block-table"><table><tbody><tr><td class="has-text-align-center" data-align="center">Input</td><td class="has-text-align-center" data-align="center">Prediction</td><td class="has-text-align-center" data-align="center">Target</td></tr><tr><td class="has-text-align-center" data-align="center">10</td><td class="has-text-align-center" data-align="center">99.23210</td><td class="has-text-align-center" data-align="center">100</td></tr><tr><td class="has-text-align-center" data-align="center">12</td><td class="has-text-align-center" data-align="center">144.1864</td><td class="has-text-align-center" data-align="center">144</td></tr><tr><td class="has-text-align-center" data-align="center">14</td><td class="has-text-align-center" data-align="center">196.7875</td><td class="has-text-align-center" data-align="center">196</td></tr><tr><td class="has-text-align-center" data-align="center">16</td><td class="has-text-align-center" data-align="center">256.7168</td><td class="has-text-align-center" data-align="center">256</td></tr><tr><td class="has-text-align-center" data-align="center">18</td><td class="has-text-align-center" data-align="center">324.1782</td><td class="has-text-align-center" data-align="center">324</td></tr></tbody></table><figcaption>Table 1: Few examples of training inference</figcaption></figure>
</div></div>



<p class="has-text-align-left">Figure 1: Fitting y = X<sup>2</sup> | training-set</p>
</div></div>



<p>We tested the same network, after training on the even numbers, to predict the unseen odd numbers from 1 to 121. Figure 2 shows the network&#8217;s ability to generalize to the unseen data. As you can note, ANN can predict the odd numbers that are within the training range very well, but cannot extrapolate beyond the training range i.e. When it reaches 101 it starts to give wrong predictions.</p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<div class="wp-block-media-text is-stacked-on-mobile is-vertically-aligned-center" style="grid-template-columns:54% auto"><figure class="wp-block-media-text__media"><img decoding="async" width="560" height="420" src="https://www.brainxyz.com/wp-content/uploads/2020/09/testing.png" alt="" class="wp-image-1659" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/testing.png 560w, https://www.brainxyz.com/wp-content/uploads/2020/09/testing.png 300w" sizes="(max-width: 560px) 100vw, 560px" /></figure><div class="wp-block-media-text__content">
<p class="has-text-align-center"></p>



<figure class="wp-block-table"><table><tbody><tr><td class="has-text-align-center" data-align="center"><strong>Input</strong></td><td class="has-text-align-center" data-align="center"><strong>Prediction</strong></td><td class="has-text-align-center" data-align="center"><strong>Target</strong></td></tr><tr><td class="has-text-align-center" data-align="center">11</td><td class="has-text-align-center" data-align="center">120.7115</td><td class="has-text-align-center" data-align="center">121</td></tr><tr><td class="has-text-align-center" data-align="center">13</td><td class="has-text-align-center" data-align="center">169.5647</td><td class="has-text-align-center" data-align="center">169</td></tr><tr><td class="has-text-align-center" data-align="center">15</td><td class="has-text-align-center" data-align="center">225.8335</td><td class="has-text-align-center" data-align="center">225</td></tr><tr><td class="has-text-align-center" data-align="center">17</td><td class="has-text-align-center" data-align="center">289.4791</td><td class="has-text-align-center" data-align="center">289</td></tr><tr><td class="has-text-align-center" data-align="center">19</td><td class="has-text-align-center" data-align="center">360.8756</td><td class="has-text-align-center" data-align="center">361</td></tr></tbody></table><figcaption>Table 2: Few examples of testing inference</figcaption></figure>
</div></div>



<p class="has-text-align-left">Figure 2: Fitting y = X<sup>2</sup> | test-set</p>
</div></div>



<p>If we increase the number of the hidden neurons from 100 to 10000 we can see a steady improvement in ANN&#8217;s ability to predict the unseen odd numbers.</p>



<figure class="wp-block-gallery columns-3 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><img decoding="async" width="560" height="420" src="https://www.brainxyz.com/wp-content/uploads/2020/09/1000N.png" alt="" data-id="1664" data-full-url="https://www.brainxyz.com/wp-content/uploads/2020/09/1000N.png" data-link="https://www.brainxyz.com/?attachment_id=1664" class="wp-image-1664" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/1000N.png 560w, https://www.brainxyz.com/wp-content/uploads/2020/09/1000N.png 300w" sizes="(max-width: 560px) 100vw, 560px" /><figcaption class="blocks-gallery-item__caption">neurons = 1000</figcaption></figure></li><li class="blocks-gallery-item"><figure><img loading="lazy" decoding="async" width="560" height="420" src="https://www.brainxyz.com/wp-content/uploads/2020/09/10000N.png" alt="" data-id="1663" data-full-url="https://www.brainxyz.com/wp-content/uploads/2020/09/10000N.png" data-link="https://www.brainxyz.com/?attachment_id=1663" class="wp-image-1663" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/10000N.png 560w, https://www.brainxyz.com/wp-content/uploads/2020/09/10000N.png 300w" sizes="(max-width: 560px) 100vw, 560px" /><figcaption class="blocks-gallery-item__caption">neurons = 10,000</figcaption></figure></li><li class="blocks-gallery-item"><figure><img loading="lazy" decoding="async" width="560" height="420" src="https://www.brainxyz.com/wp-content/uploads/2020/09/100000N.png" alt="" data-id="1662" data-full-url="https://www.brainxyz.com/wp-content/uploads/2020/09/100000N.png" data-link="https://www.brainxyz.com/?attachment_id=1662" class="wp-image-1662" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/100000N.png 560w, https://www.brainxyz.com/wp-content/uploads/2020/09/100000N.png 300w" sizes="(max-width: 560px) 100vw, 560px" /><figcaption class="blocks-gallery-item__caption">neurons = 100,000</figcaption></figure></li></ul><figcaption class="blocks-gallery-caption">Figure 3: shows the effect of increasing the size of the hidden layer on ANN&#8217;s interpolation and extrapolation capabilities</figcaption></figure>



<p>Although increasing the number of hidden neurons improves the ANN&#8217;s capability for both interpolation and extrapolation, the network still fails to extrapolate values that are far from the training range. This suggests that &#8216;power rule&#8217; cannot be modeled by ANN no matter how much is the size of our hidden layer. This is understandable because the weighted summation of the inputs (i.e the dot product) cannot model the multiplication process among the inputs, it can only approximate it for a specific range. </p>



<p>It is also worth noting that the interpolation ability of ANNs remains very good, even if we increase the step size (i.e the gap) between the training set numbers (Figure 4).</p>



<figure class="wp-block-gallery columns-3 is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex"><ul class="blocks-gallery-grid"><li class="blocks-gallery-item"><figure><img loading="lazy" decoding="async" width="560" height="420" src="https://www.brainxyz.com/wp-content/uploads/2020/09/gap4.png" alt="" data-id="1674" data-full-url="https://www.brainxyz.com/wp-content/uploads/2020/09/gap4.png" data-link="https://www.brainxyz.com/?attachment_id=1674" class="wp-image-1674" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/gap4.png 560w, https://www.brainxyz.com/wp-content/uploads/2020/09/gap4.png 300w" sizes="(max-width: 560px) 100vw, 560px" /><figcaption class="blocks-gallery-item__caption">step = 4</figcaption></figure></li><li class="blocks-gallery-item"><figure><img loading="lazy" decoding="async" width="560" height="420" src="https://www.brainxyz.com/wp-content/uploads/2020/09/gap8.png" alt="" data-id="1673" data-full-url="https://www.brainxyz.com/wp-content/uploads/2020/09/gap8.png" data-link="https://www.brainxyz.com/?attachment_id=1673" class="wp-image-1673" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/gap8.png 560w, https://www.brainxyz.com/wp-content/uploads/2020/09/gap8.png 300w" sizes="(max-width: 560px) 100vw, 560px" /><figcaption class="blocks-gallery-item__caption">step = 8</figcaption></figure></li><li class="blocks-gallery-item"><figure><img loading="lazy" decoding="async" width="560" height="420" src="https://www.brainxyz.com/wp-content/uploads/2020/09/gap12.png" alt="" data-id="1672" data-full-url="https://www.brainxyz.com/wp-content/uploads/2020/09/gap12.png" data-link="https://www.brainxyz.com/?attachment_id=1672" class="wp-image-1672" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/gap12.png 560w, https://www.brainxyz.com/wp-content/uploads/2020/09/gap12.png 300w" sizes="(max-width: 560px) 100vw, 560px" /><figcaption class="blocks-gallery-item__caption">step = 12</figcaption></figure></li></ul><figcaption class="blocks-gallery-caption">Figure 4: shows the effect of increasing the size of the step (gap) in-between the training data on ANN&#8217;s interpolation capability</figcaption></figure>



<h6 class="wp-block-heading"><strong>We can draw the following conclusions from our results above:</strong></h6>



<ul class="wp-block-list"><li>ANNs can fit the training set of our non-linear function, <strong>y = X<sup>2</sup></strong>, very well. </li><li>ANNs can fit the testing set of the function above provided that the test data are within the range of the training set, i.e ANNs are good at interpolation.</li><li>ANNs can interpolate the unseen data well even if the gaps between the training data are big.</li><li>ANNs are bad at fitting the test data that are far outside the range of the training set.</li><li>Increasing the number of neurons in the hidden layer improves both interpolation and extrapolation capabilities of the ANNs, however, the power rule cannot be modeled no matter how large the hidden layer is. The power rule can only be approximated within the specific range.</li></ul>



<p></p>



<p>The last point is an important distinction between how ANNs learn to generalize and how we humans learn to generalize. However, the way we present the data to the ANNs might be important. For example, in deep learning, the data are usually presented as one-hot encoding which treats the samples as discrete categories instead of continuous values. Some new deep learning architectures like Transformers (e.g GPT-3) are shown to produce coherent text and generate compelling answers to questions suggesting there might be some rule learning capabilities. To our knowledge, GPT-3 was also bad at learning &#8216;multiplication&#8217; (<a rel="noreferrer noopener nofollow" href="https://arxiv.org/abs/2005.14165" target="_blank">GPT-3 paper / Figure 3.10</a>), but good at learning &#8216;addition&#8217; and this sort of behavior resembles very much the behavior of a typical feed-forward ANN such as the one we showed in our example.</p>



<p>Another interesting factor about ANNs is that even though we increased the number of neurons beyond the number of the samples, our network did not suffer from the bad effects of over-fitting. Over-fitting is usually problematic when we have a non-representative training dataset. This usually happens when there is a lot of variance in the data due to the external noise. By external noise, we mean the non-interesting variance that is not part of the data structure itself. People who work with time-series signals that have a low signal to noise ratio (SNR), e.g. EGG and fMRI, usually prefer to use simpler Machine Learning methods such as SVMs and Ridge Regression because over-parameterized ANNs are usually driven toward fitting the external noise instead of the signal (Which is a very bad side effect of over-fitting).</p>



<p>In contrast, in the deep learning world, over-parameterized ANNs seems to be the norm, especially for those working in vision and NLP fields because their training datasets are usually large, representative, and clean. Since the training datasets in those fields are large and include a wide range of structural variation (i.e training datasets are representative of testing datasets), it is no surprise that deep learning networks like CNNs, GANs, and Transformers are capable of learning to classify and generate new variations of interpolate-able unseen data. This is similar to our example where the ANN was able to successfully predict the unseen odd numbers that were within the range of the training set. </p>



<p>In conclusion, we attribute the success of ANNs in vision and NLP fields to their good interpolation capability, especially when they are fed with large and representative training datasets. We also argue that rule learning and extrapolation beyond the training range are ANNs&#8217; weak points.</p>



<p>At Brainxyz, our focus is on learning algorithms that are capable to learn and generalize in a controllable manner. We also aim for biological plausibility and efficiency. In the future articles, we will test and compare PHUN, our in-progress novel ML algorithm, with ANNs and other ML types. Please stay tuned with us. </p>



<h6 class="wp-block-heading"><strong>Abbreviations:</strong></h6>



<ul class="wp-block-list"><li>ML: Machine Learning</li><li>ANNs: Artificial Neural Networks</li><li>CNN: Convolution al Neural Networks</li><li>SVMs: Support Vector Machine</li><li>GANs: Generative Adversarial Networks</li><li>GPT-3: Generative Pre-Training</li><li>NLP: Natural Language Processing</li><li>PHUN: Predictive Hebbian Unified Neurons.</li><li>fMRI: Functional Magnetic Resonance</li><li>EEG: ElectroEncephaloGram</li></ul>



<p></p>The post <a href="https://www.brainxyz.com/machine-learning/ann/">Artificial Neural Networks | Interpolation vs. Extrapolation</a> appeared first on <a href="https://www.brainxyz.com">Brainxyz</a>.<p>The post <a href="https://www.brainxyz.com/machine-learning/ann/">Artificial Neural Networks | Interpolation vs. Extrapolation</a> appeared first on <a href="https://www.brainxyz.com">Brainxyz</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.brainxyz.com/machine-learning/ann/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1579</post-id>	</item>
		<item>
		<title>Predict Pattern &#038; Top Down Approach</title>
		<link>https://www.brainxyz.com/blog/predict/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=predict</link>
					<comments>https://www.brainxyz.com/blog/predict/#respond</comments>
		
		<dc:creator><![CDATA[Brainxyz]]></dc:creator>
		<pubDate>Fri, 28 Aug 2020 21:06:56 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[information theory]]></category>
		<category><![CDATA[minesweeper]]></category>
		<guid isPermaLink="false">https://www.brainxyz.com/?p=1380</guid>

					<description><![CDATA[<p>Suppose you are in an exam and you have to answer a set of True or False questions. Also, suppose you do not know the correct answers to any of the questions (because they seem nonsense to you). In this situation, all you can do is random guessing and normally your resulted score is around...</p>
<p>The post <a href="https://www.brainxyz.com/blog/predict/">Predict Pattern & Top Down Approach</a> appeared first on <a href="https://www.brainxyz.com">Brainxyz</a>.</p>
<p>The post <a href="https://www.brainxyz.com/blog/predict/">Predict Pattern &#038; Top Down Approach</a> appeared first on <a href="https://www.brainxyz.com">Brainxyz</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Suppose you are in an exam and you have to answer a set of True or False questions. Also, suppose you do not know the correct answers to any of the questions (because they seem nonsense to you). In this situation, all you can do is random guessing and normally your resulted score is around 50% by chance. Let&#8217;s say the teacher who marks your work gives you many more trials to answer the same set of questions. Also, he/she shows you your total score at the end of each trial. What will you do to reach the perfect score with a minimal number of trials?</p>



<p>One obvious strategy is a brute-force strategy. In this strategy, you randomly change all your answers in each trial until you get the full score by chance (Figure 1). With this strategy, if the number of questions is 10, your chance of guessing all the answers correctly by brute-force is 1 in 1024 trials. Your winning chances decrease exponentially as the number of questions increases.</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="415" height="451" data-id="1849" src="https://www.brainxyz.com/wp-content/uploads/2020/09/exam11.png" alt="" class="wp-image-1849" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/exam11.png 415w, https://www.brainxyz.com/wp-content/uploads/2020/09/exam11.png 276w" sizes="(max-width: 415px) 100vw, 415px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="415" height="451" data-id="1850" src="https://www.brainxyz.com/wp-content/uploads/2020/09/exam22.png" alt="" class="wp-image-1850" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/exam22.png 415w, https://www.brainxyz.com/wp-content/uploads/2020/09/exam22.png 276w" sizes="(max-width: 415px) 100vw, 415px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="415" height="451" data-id="1851" src="https://www.brainxyz.com/wp-content/uploads/2020/09/exam33.png" alt="" class="wp-image-1851" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/exam33.png 415w, https://www.brainxyz.com/wp-content/uploads/2020/09/exam33.png 276w" sizes="(max-width: 415px) 100vw, 415px" /></figure>
<figcaption class="blocks-gallery-caption wp-element-caption">Figure 1. An example of 10 True or False questions answered by brute-force (3 trials are shown).</figcaption></figure>



<p></p>



<p>The alternative strategy is to change only one question in each trial. If your total score increases, it means your change was correct. If not, it means your change was incorrect. With this simple strategy, you can guarantee to reach the perfect score in just 10 trials (if you have 10 questions). The number of trials required to reach the perfect score using this simple strategy is massively less than the brute-force strategy.</p>



<p>To have more insight into these kinds of problems, we performed some simulations and we figured out that it is possible to improve the chance of &#8216;reaching the full score in fewer trials&#8217; even further if we try to maximize the information gain. This is possible by changing more than one question at a time. Maximizing information gain is a big topic and is detailed through &#8220;Shannon&#8217;s Information Theory&#8221;. In this article, we will not go into the theoretical details.</p>



<p>For educational and entertainment purposes, we turned part of our simulations to an Android game which we called &#8220;MineClear&#8221;. It is now available on Google’s Play Store. We also made a similar online version but with a different interface (Links at the end). Below are some screenshots of MineClear.<br>*Edit: MinClear is now discontinued but we made a similar online game where you need to find the hidden True and False pattern, just like the given example above. Here is the link to the online game.</p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow"><div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.brainxyz.com/wp-content/uploads/2020/09/gameshow.png" alt="" class="wp-image-1952" width="572" height="491" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/gameshow.png 1000w, https://www.brainxyz.com/wp-content/uploads/2020/09/gameshow.png 300w, https://www.brainxyz.com/wp-content/uploads/2020/09/gameshow.png 768w" sizes="(max-width: 572px) 100vw, 572px" /><figcaption class="wp-element-caption">Figure 2: Screenshots of MineClear game</figcaption></figure></div></div></div>



<p>In MineClear, you need to figure out all the &#8216;Mine&#8217; and &#8216;Clear&#8217; squares by flagging or unflagging them correctly. To know if you have made a correct guess you must peek at your score, which shows your current score. What makes the game challenging is that you can only peek at your score for a limited number of trials. The simple strategy described above can help you to pass the first level. However, in the more challenging levels, you have fewer trials than squares, therefore, you cannot figure out all the answers using that strategy because you will run out of your limited number of allowed peeks.</p>



<p>Another possible strategy is to change two squares at once, then peek at your score. For example, say you have flagged two squares (or changed two False choices to True). As a result, two possible changes might occur to your total score:</p>



<ol class="wp-block-list" type="1">
<li>Your total score increases or decreases by a factor of two (+/-2). This means the changes you made were either &#8220;both correct&#8221; or &#8220;both incorrect&#8221;. This situation happens 50% of the time (Figure-3, situation-2).</li>



<li>Your total score does not change. This means one of the changes was correct, but the other was not. In this case, you need another trial to find out which change was the correct one. This happens 50% of the time (Figure-3, situation-1).</li>
</ol>



<p>As you can see, following the above strategy, half of the time you need one trial to correctly guess about two squares, and half of the time you need two trials to correctly guess about both squares. Hence, this strategy can potentially increase your chance of winning by about 25% of our simple strategy. And this will be enough to pass the second level of MineClear most of the time.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.brainxyz.com/wp-content/uploads/2020/09/two_grid.png" alt="" class="wp-image-1967" width="455" height="352" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/two_grid.png 1000w, https://www.brainxyz.com/wp-content/uploads/2020/09/two_grid.png 300w, https://www.brainxyz.com/wp-content/uploads/2020/09/two_grid.png 768w" sizes="(max-width: 455px) 100vw, 455px" /><figcaption class="wp-element-caption">Figure 3: Shows all the possible outcomes if you change 2 squares at once.</figcaption></figure></div>


<p>If you want to maximize the information gain even further, you have to change even more squares. For example, changing 4 squares at once gives you 16 guessing possibilities and 3 distinct situations (Figure 3). In the best-case scenario, you will be able to guess about 4 squares with only 1 trial and this happens 2 out of 16 times (situation-3 in Figure 4). And in the worst-case scenario, you might need up to 4 trials to guess about all the 4 squares correctly (situation-1 in Figure 4). Changing 4 squares at once can increase your chance of winning in the later levels of MineClear.</p>



<p>Please note that no strategy can guarantee your win all the time if the number of the trials is fewer than the number of the squares. Therefore, you need some luck on your side to win, but having a good strategy maximizes your chance of winning. Without a good strategy, you are out of luck too.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="518" src="https://www.brainxyz.com/wp-content/uploads/2020/09/possible-copy2-1024x518.png" alt="" class="wp-image-1954" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/possible-copy2.png 1024w, https://www.brainxyz.com/wp-content/uploads/2020/09/possible-copy2.png 300w, https://www.brainxyz.com/wp-content/uploads/2020/09/possible-copy2.png 768w, https://www.brainxyz.com/wp-content/uploads/2020/09/possible-copy2.png 1536w, https://www.brainxyz.com/wp-content/uploads/2020/09/possible-copy2.png 2000w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">Figure 4: Shows all the possible outcomes if you change 4 squares at once.</figcaption></figure></div>


<p>We will not spoil all the possible strategies and will leave that to you to find ingenious ways to solve the problem, but the take-home message is: To maximize the information gain, you need to have the bird’s eye view of the entire grid at first then come down to the specifics. This is analogous to the top-down approach (Figure 5). With a top-down approach, you can visualize the problem as an inverted tree in which to figure out the values of the nodes at the bottom of your tree, first, you need to figure out the nodes at the top of the hierarchy. Changing a top node changes the nodes directly below it, but changing a node at the bottom will not change the nodes above it.</p>



<figure class="wp-block-image size-large is-resized is-style-rounded"><img loading="lazy" decoding="async" src="https://www.brainxyz.com/wp-content/uploads/2020/09/top_down.png" alt="top down approach brainxyz" class="wp-image-1854" width="713" height="324" srcset="https://www.brainxyz.com/wp-content/uploads/2020/09/top_down.png 716w, https://www.brainxyz.com/wp-content/uploads/2020/09/top_down.png 300w" sizes="(max-width: 713px) 100vw, 713px" /><figcaption class="wp-element-caption">Figure 5: Top down approach where the top nodes have a wider field of view than the bottom ones</figcaption></figure>



<p>We think the game we presented here is a simplified simulation of many other real-life situations where you have to reach a goal with a minimal number of trials and errors. There are so many situations where you cannot get the specific feedback for the individual parts of your actions, instead, you get the feedback for your entire work as a whole. For instance, you might get rejected for a job interview without specific reasons. This rejection represents your total score. In this case, it is your job to find out which parts of you were responsible for the rejection and needs to be improved just like the game presented here. </p>



<p>In fact, in the evolutionary process, natural selection and the survival of the fittest is also a sort of this kind of feedback where each organism is assessed as a whole. This is why the mutation rate is generally slow. Because mutations happen randomly, widespread changes in the DNA structure of the next generations are usually fatal and can hardly improve the species because negative mutations cancel out the positive ones. On the other hand, small and incremental changes in DNA are not fatal. And with natural selection, the process of climbing the mount improbable or even reaching the global maxima is possible (similar to our first simple strategy). Minimizing the number of trials to reach the correct answer is probably the most valuable thing for our survival. Our DNAs cannot use the sophisticated top-down strategies we described here, but our brains can.</p>



<p><strong>Edit</strong>: MineClear is no longer available on the Play store, instead you can play it online here under the name: Predict Hidden Pattern. Also, You can watch our new video about this topic and it&#8217;s relation to consciousness here: <a href="https://youtu.be/5qqxGwlUilU">https://youtu.be/5qqxGwlUilU</a><br></p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="MineClear: A New Brain Puzzle Game" width="720" height="405" src="https://www.youtube.com/embed/x-zOCOLGiW8?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div></figure>



<p></p>



<p></p>



<div style="height:69px" aria-hidden="true" class="wp-block-spacer"></div>The post <a href="https://www.brainxyz.com/blog/predict/">Predict Pattern & Top Down Approach</a> appeared first on <a href="https://www.brainxyz.com">Brainxyz</a>.<p>The post <a href="https://www.brainxyz.com/blog/predict/">Predict Pattern &#038; Top Down Approach</a> appeared first on <a href="https://www.brainxyz.com">Brainxyz</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.brainxyz.com/blog/predict/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1380</post-id>	</item>
	</channel>
</rss>
