Skip to content

Commit

Permalink
Merge pull request #835 from nature-of-code/notion-update-docs
Browse files Browse the repository at this point in the history
9-10
  • Loading branch information
shiffman authored Feb 25, 2024
2 parents 9dc2c53 + 869a85d commit 396b44f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 3 additions & 2 deletions content/09_ga.html
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ <h3 id="step-2-selection-1">Step 2: Selection</h3>
<p>Where should I calculate the fitness? Since the <code>DNA</code> class contains the genetic information (the phrase I will test against the target phrase), I can write a method inside the <code>DNA</code> class to score its own fitness. Let’s assume a target phrase:</p>
<pre class="codesplit" data-code-language="javascript">let target = "to be or not to be";</pre>
<p>I can now compare each gene against the corresponding character in the target phrase, incrementing a counter each time I find a correct character in the correct position. For example, a <code>t</code> is found in several places in <code>target</code>, but it increases the fitness only if it is in the <code>genes</code> array at the correct corresponding index:</p>
<p></p>
<pre class="codesplit" data-code-language="javascript">class DNA {
<div class="avoid-break">
<pre class="codesplit" data-code-language="javascript">class DNA {
constructor(length) {
this.genes = [];
//{!1} Add a variable to track fitness.
Expand All @@ -410,6 +410,7 @@ <h3 id="step-2-selection-1">Step 2: Selection</h3>
this.fitness = score / target.length;
}
}</pre>
</div>
<p>Since fitness is calculated for each subsequent generation, the very first step I’ll take inside the <code>draw()</code> loop is to call the fitness function for each member of the population:</p>
<pre class="codesplit" data-code-language="javascript">function draw() {
for (let phrase of population) {
Expand Down
8 changes: 1 addition & 7 deletions content/10_nn.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,8 @@ <h2 id="introducing-artificial-neural-networks">Introducing Artificial Neural Ne
<ul>
<li><strong>Pattern recognition:</strong> Neural networks are well suited to problems when the aim is to detect, interpret, and classify features or patterns within a dataset. This includes everything from identifying objects (like faces) in images, to optical character recognition, to more complex tasks like gesture recognition.</li>
<li><strong>Time-series prediction and anomaly detection: </strong>Neural networks are utilized both in forecasting, such as predicting stock market trends or weather patterns, and in recognizing anomalies, which can be applied to areas like cyberattack detection and fraud prevention.</li>
<li><strong>Signal processing and soft sensors:</strong> Neural networks play a crucial role in devices like cochlear implants and hearing aids by filtering noise and amplifying essential sounds. They’re also involved in <em>soft sensors</em>, software systems that process data from multiple sources to give a comprehensive analysis of the environment.</li>
<li><strong>Natural language processing (NLP):</strong> One of the biggest developments in recent years has been the use of neural networks for processing and understanding human language. They’re used in various tasks including machine translation, sentiment analysis, and text summarization, and are the underlying technology behind many digital assistants and chatbots.</li>
</ul>
<div class="avoid-break">
<ul>
<li><strong>Signal processing and soft sensors:</strong> Neural networks play a crucial role in devices like cochlear implants and hearing aids by filtering noise and amplifying essential sounds. They’re also involved in <em>soft sensors</em>, software systems that process data from multiple sources to give a comprehensive analysis of the environment.</li>
</ul>
</div>
<ul>
<li><strong>Control and adaptive decision-making systems: </strong>These applications range from autonomous vehicles like self-driving cars and drones to adaptive decision-making used in game playing, pricing models, and recommendation systems on media platforms.</li>
<li><strong>Generative models:</strong> The rise of novel neural network architectures has made it possible to generate new content. These systems can synthesize images, enhance image resolution, transfer style between images, and even generate music and video.</li>
</ul>
Expand Down

0 comments on commit 396b44f

Please sign in to comment.