Algorithms For Dummies. John Paul Mueller

Algorithms For Dummies - John Paul Mueller


Скачать книгу
a handy resource for locating the most reliable information about Colab.

      

You don’t have to type the source code for this chapter manually. In fact, using the downloadable source is a lot easier. You can find the source for this chapter in the \A4D2E\ A4D2E; 03; Colab Examples.ipynb file of the downloadable source. See the Introduction for details on how to find these source files.

      Colab is designed to mimic a desktop application called Jupyter Notebook (https://jupyter.org/). In fact, it's somewhat difficult to tell the two applications apart in the functionality they provide. Google Colab is the cloud version of Notebook, and the Welcome page makes this fact apparent. It even uses IPython (the previous name for Jupyter) Notebook (.ipynb) files for the site.

      Even though the two applications are similar and they both use .ipynb files, they do have some differences that you need to know about. The previous edition of this book used Jupyter Notebook, but Colab offers the ability to compute anywhere on any device that sports a browser, so this edition of the book focuses on Colab instead. The following sections help you understand the Colab differences.

      Understanding what Google Colab does

      You can use Colab to perform many tasks, but for the purpose of this book, you use it to write and run code, create its associated documentation, and display graphics. The downloadable source for this book is designed to run on Colab, but you can also use it with Jupyter Notebook if you want.

      The other reason that you really need to know about Colab is that you can use it with your alternative device. During the writing process, some of the example code was tested on an Android-based tablet (an ASUS ZenPad 3S 10). The target tablet has Chrome installed and executes the code well enough to follow the examples. All this said, you likely won’t want to try to write code using a tablet of that size — the text was incredibly small, for one thing, and the lack of a keyboard could be a problem, too. The point is that you don’t absolutely have to have a Windows, Linux, or OS X system to try the code, but the alternatives might not provide quite the performance you expect.

      

Google Colab generally doesn’t work with browsers other than Chrome (the browser used in this chapter), Firefox, or Safari (initial tests with Microsoft Edge have also been encouraging). In most cases, you see an error message, such as This site may not work in your browser. Please use a supported browser, and no other display if you try to start Colab in a browser that it doesn’t support. The included More Info link takes you to https://research.google.com/colaboratory/faq.html#browsers, where you can learn more information.

      SOME FIREFOX ODDITIES

      Even with online help, you may still find that your copy of Firefox displays a SecurityError: The operation is insecure. error message. The initial error dialog box points to some unrelated issue, such as cookies, but you see this error message when you click Details. Simply dismissing the dialog box by clicking OK makes Colab appear to be working because it displays your code, but you won't see results from running the code.

      Getting familiar with Google Colab features

      Google Colab provides access to a number of features through the menu system. One of these features, hardware acceleration, appears in the “Using Hardware Acceleration” section, later in this chapter. The features in this section all appear on the Tools menu.

      Locating commands

Snapshot shows Using Colab commands makes configuring your Notebook easy.

      FIGURE 3-1: Using Colab commands makes configuring your Notebook easy.

      Configuring settings

       Site: Configures how the site works. The most interesting setting is the theme. Selecting Adaptive lets Colab choose the interface colors based on lighting conditions. You can also configure display and access settings on this tab.

       Editor: Determines how text appears onscreen and how the interface works. For example, you can set the key bindings to work like those in Vim (a text editor included on Unix and Linux systems, generally as the vi utility; see https://www.vim.org/) if desired. You can also select font size, spaces for each level of indentation, and a plethora of other settings.

       Colab Pro: Provides an advertisement for Colab Pro (https://colab.research.google.com/signup), which gives you some significant benefits like faster GPUs, longer runtimes, and more memory — all of which let you get more work done in a shorter time.

       Miscellaneous: Contains fun settings. You can choose from three visual effects: adding thunder and lightning using the Power Level setting; letting a Corgi run across the top of the display; and allowing a kitten to run across the top of the display. You can choose any mix of these visual effects.

Snapshot shows the Settings dialog box helps you configure the Colab IDE.

      FIGURE 3-2: The Settings dialog


Скачать книгу