Merge branch 'master' of github.com:clearlinux/clear-linux-documentation into rtd-theme

This commit is contained in:
Kevin Putnam
2019-08-05 09:44:29 -07:00
2 changed files with 42 additions and 36 deletions
+12 -12
View File
@@ -16,7 +16,8 @@ Description
Kubernetes is an open source system for automating deployment, scaling, and
management of containerized applications. It groups containers that make up
an application into logical units for easy management and discovery.
an application into logical units for easy management and discovery. Get up
and running quickly with our `Cloud native setup automation`_.
Kata Containers\* kata-runtime adheres to
:abbr:`OCI (Open Container Initiative*)` guidelines and works seamlessly with
@@ -229,6 +230,10 @@ Related topics
Read the Kubernetes documentation to learn more about:
* Deploying Kubernetes with a `cloud-native-setup`_
* :ref:`Kubernetes best practices <kubernetes-bp>`
* `Understanding basic Kubernetes architecture`_
* `Deploying an application to your cluster`_
@@ -237,11 +242,12 @@ Read the Kubernetes documentation to learn more about:
* `Joining your nodes`_
Cloud native setup automation (optional)
****************************************
Cloud native setup automation
*****************************
Clone the `cloud-native-setup`_ repository on your system and follow the
instructions. This repository includes helper scripts to automate configuration.
Optional: Clone the `cloud-native-setup`_ repository on your system and
follow the instructions. This repository includes helper scripts to automate
configuration.
Package configuration customization (optional)
**********************************************
@@ -293,12 +299,6 @@ commands as a shell script to configure all of these services in one step:
EOF
done
Next steps
**********
:ref:`kubernetes-bp`
Troubleshooting
***************
@@ -412,4 +412,4 @@ Troubleshooting
.. _documentation: https://clearlinux.org/documentation/clear-linux
.. _cloud-native-setup: https://github.com/clearlinux/cloud-native-setup
.. _cloud-native-setup: https://github.com/clearlinux/cloud-native-setup/tree/master/clr-k8s-examples
@@ -3,13 +3,17 @@
TensorFlow\* machine learning on |CL-ATTR|
##########################################
This tutorial will demonstrate the installation and execusion of a TensorFlow\*
This tutorial demonstrates the installation and execution of a TensorFlow\*
machine learning example on |CL-ATTR|. It uses a Jupyter\* Notebook and MNIST
data for handwriting recognition. 
The initial steps will have you set up a Jupyter kernel and run a Notebook
The initial steps show how to set up a Jupyter kernel and run a Notebook
on a bare-metal |CL| system.
.. contents::
:local:
:depth: 1
Prerequisites
*************
@@ -23,12 +27,12 @@ Before you install any new packages, update |CL| with the following command:
sudo swupd update
Once your system is updated, add the following bundles to your system:
After your system is updated, add the following bundles to your system:
* `machine-learning-web-ui`: This bundle contains the Jupyter application.
* :command:`machine-learning-web-ui`: This bundle contains the Jupyter application.
* `machine-learning-basic`: This bundle contains TensorFlow and other useful
tools.
* :command:`machine-learning-basic`: This bundle contains TensorFlow
and other useful tools.
To install the bundles, run the following commands in your :file:`$HOME`
directory:
@@ -39,7 +43,7 @@ directory:
sudo swupd bundle-add machine-learning-basic
Set up a Jupyter notebook
Set up a Jupyter Notebook
*************************
With all required packages and libraries installed, set up the file structure
@@ -68,8 +72,8 @@ for the Jupyter Notebook.
directory.
.. note::
After installing the `machine-learning basic` bundle, you can find the
example code under
After installing the :command:`machine-learning basic` bundle, you can find the example code under
:file:`/usr/share/doc/tensorflow/MNIST_example.ipynb`.
@@ -91,7 +95,7 @@ The files needed are:
Run the Jupyter machine learning example code
*********************************************
With |CL|, Jupyter, and TensorFlow installed and configured, we can
With |CL|, Jupyter, and TensorFlow installed and configured, you can
run the example code.
#. Go to the :file:`($HOME)/Notebooks` directory and start Jupyter with the
@@ -104,7 +108,8 @@ run the example code.
jupyter notebook
The Jupyter server starts and opens a web browser showing the Jupyter file
manager with a list of files in the current directory, see figure 1.
manager with a list of files in the current directory, as shown in
Figure 1.
.. figure:: figures/machine-learning-1.png
:alt: Jupyter file manager
@@ -112,15 +117,15 @@ run the example code.
Figure 1: The Jupyter file manager shows the list of available files.
#. Click on the :file:`Handwriting` directory. The :file:`MNIST_example.ipynb`
file created earlier should be listed there, see figure 2.
file created earlier should be listed there, as shown in Figure 2.
.. figure:: figures/machine-learning-2.png
:alt: Example file within the Jupyter file manager
Figure 2: The example file within the Jupyter file manager.
#. To run the hand writing example, click on the :file:`MNIST_example.ipynb`
file to load the notebook, see figure 3.
#. To run the handwriting example, click on the :file:`MNIST_example.ipynb`
file to load the notebook, as shown in Figure 3.
.. figure:: figures/machine-learning-3.png
:alt: The loaded MNIST_example notebook
@@ -132,7 +137,7 @@ run the example code.
move to the next.
#. Select the :guilabel:`In [2]` cell and click the |run-cell| button to load
the MNIST data. The successful output is shown on figure 4.
the MNIST data. The successful output is shown on Figure 4.
.. figure:: figures/machine-learning-4.png
:alt: Successful import of MNIST data
@@ -140,15 +145,16 @@ run the example code.
Figure 4: Output after successfully importing the MNIST data.
After the MNIST data was successfully downloaded and extracted into the
After the MNIST data is successfully downloaded and extracted into the
:file:`mnist` directory within the :file:`($HOME)/Notebooks/Handwriting`
directory, four .gz files are present and the four data sets were created:
directory, four .gz files are present and the four data sets are created:
`trainX`, `trainY`, `testX` and `testY`.
#. To inspect the imported data, the function in :guilabel:`In [3]` first
instructs Jupyter to reshape the data into an array of 28 x 28 images and to
plot the area in a 28 x 28 grid. Click the |run-cell| button twice to show
the first two digits in the `trainX` dataset, see figure 5.
the first two digits in the `trainX` dataset. An example is shown in
Figure 5.
.. figure:: figures/machine-learning-5.png
:alt: Function to reshape data.
@@ -158,17 +164,17 @@ run the example code.
#. The :guilabel:`In [4]` cell defines the neural network. It provides the
inputs, defines the hidden layers, runs the training model, and sets up
the output layer, see figure 6. Click the |run-cell| button four times to
perform these operations.
the output layer, as shown in Figure 6. Click the |run-cell| button four
times to perform these operations.
.. figure:: figures/machine-learning-6.png
:alt: Defining, building and training the neural network model
Figure 6: Defining, building and training the neural network model.
Figure 6: Defining, building, and training the neural network model.
#. To test the accuracy of the prediction the system makes, select the
#. To test the accuracy of the prediction that the system makes, select the
:guilabel:`In [8]` cell and click the |run-cell| button. In this example,
the number 6 was predicted with a 99% accuracy, see figure 7.
the number 6 was predicted with a 99% accuracy, as shown in Figure 7.
.. figure:: figures/machine-learning-7.png
:alt: Prediction example
@@ -184,7 +190,7 @@ run the example code.
#. To check the accuracy for the whole dataset, select the :guilabel:`In [10]`
cell and click the |run-cell| button. Our example's accuracy is
calculated as 97.17%, see figure 8.
calculated as 97.17%, as shown in Figure 8.
.. figure:: figures/machine-learning-8.png
:alt: System's accuracy