Skip to content

Commit

Permalink
Merge pull request #1029 from nature-of-code/notion-update-docs
Browse files Browse the repository at this point in the history
[Notion] fixing errata
  • Loading branch information
shiffman authored Oct 8, 2024
2 parents 21de2e2 + 15bad12 commit de39aad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion content/00_5_introduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h2 id="a-word-about-p5js">A Word About p5.js</h2>
<h2 id="what-do-you-need-to-know">What Do You Need to Know?</h2>
<p>The prerequisites for understanding the material in this book could be stated as “one semester of programming instruction with p5.js, Processing, or any other creative coding environment.” That said, there’s no reason you couldn’t read this book having learned programming with a different language or development environment.</p>
<p>If you’ve never written any code before, while you could read the book for the concepts and inspiration, you’ll likely struggle with the code because I’m assuming knowledge of the fundamentals: variables, conditionals, loops, functions, objects, and arrays. If these concepts are new to you, my <a href="https://thecodingtrain.com/p5js">“Code! Programming with p5.js”</a> and <a href="https://thecodingtrain.com/processing">“Learning Processing”</a> video courses provide the fundamentals of what you need<br>to know.</p>
<p>If you’re an experienced programmer but haven’t worked with p5.js, you can probably pick it up by <a href="https://p5js.org/">checking out the p5.js documentation</a>, poking through the examples, and <a href="https://p5js.org/get-started">reading through the library’s “Get Started” page</a>.</p>
<p>If you’re an experienced programmer but haven’t worked with p5.js, you can probably pick it up by <a href="https://p5js.org/">checking out the p5.js documentation</a>, poking through the examples, and <a href="https://p5js.org/tutorials/get-started/">reading through the library’s “Get Started” page</a>.</p>
<p>I should also point out that experience with object-oriented programming is fairly critical. I’ll review some of the basics in Chapter 0, but if classes and objects are unfamiliar to you, I suggest watching <a href="https://thecodingtrain.com/oop">my p5.js and Processing object-oriented video tutorials, both also available at the Coding Train</a>.</p>
<h2 id="how-are-you-reading-this-book">How Are You Reading This Book?</h2>
<p>Are you reading this book on a Kindle? Printed paper? On your laptop in PDF form? On a tablet showing an animated HTML5 version? Are you strapped to a chair, absorbing the content directly into your brain via a series of electrodes, tubes, and cartridges?</p>
Expand Down
2 changes: 1 addition & 1 deletion content/10_nn.html
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ <h3 id="training-the-model">Training the Model</h3>
let options = { epochs: 25 };
classifier.train(options, finishedTraining);</pre>
<p>The number of epochs is an example of a hyperparameter, a global setting for the training process. You can set others through the <code>options</code> object (the learning rate, for example), but I’m going to stick with the defaults. You can read more about customization options in the ml5.js documentation.</p>
<p>The second argument to <code>train()</code> is optional, but it’s good to include one. It specifies a callback function that runs when the training process is complete—in this case, <code>finshedTraining()</code>. (See the “Callbacks” box for more on callback functions.) This is useful for knowing when you can proceed to the next steps in your code. Another optional callback, which I usually name <code>whileTraining()</code>, is triggered after each epoch. However, for my purposes, knowing when the training is done is plenty!</p>
<p>The second argument to <code>train()</code> is optional, but it’s good to include one. It specifies a callback function that runs when the training process is complete—in this case, <code>finishedTraining()</code>. (See the “Callbacks” box for more on callback functions.) This is useful for knowing when you can proceed to the next steps in your code. Another optional callback, which I usually name <code>whileTraining()</code>, is triggered after each epoch. However, for my purposes, knowing when the training is done is plenty!</p>
<div data-type="note">
<h3 id="callbacks">Callbacks</h3>
<p>A <strong>callback function</strong> in JavaScript is a function you don’t actually call yourself. Instead, you provide it as an argument to another function, intending for it to be <em>called back</em> automatically at a later time (typically associated with an event, like a mouse click). You’ve seen this before when working with Matter.js in <a href="/physics-libraries#section-physics-libraries">Chapter 6</a>, where you specified a function to call whenever a collision was detected.</p>
Expand Down

0 comments on commit de39aad

Please sign in to comment.