Skip to content

Commit d62f203

Browse files
committed
Expanding on example
1 parent c9b8735 commit d62f203

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

modules/rhoai-demo-app.adoc

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ In this section, you will perform an interactive classification using a Jupyter
8888

8989
. Click *Create project*
9090

91-
.. Enter a name for the project for example ¬my-classification-project` in the *Name* field and click *Create*.
91+
.. Enter a name for the project for example `my-classification-project` in the *Name* field and click *Create*.
9292

9393
. Click on *Create a workbench*. Now you are ready to move to the next step to define the workbench.
9494

@@ -126,9 +126,9 @@ Simplify data preparation in AI projects by automating the fetching of datasets
126126

127127
. Clone the Interactive Image Classification Project from the GitHub repository using the following instructions:
128128

129-
.. At the top of the JupyterLab interface, click on the "Git Clone" icon.
129+
.. At the top of the JupyterLab interface, click on the *Git Clone* icon.
130130

131-
.. In the popup window, enter the URL of the GitHub repository in the "Git Repository URL" field:
131+
.. In the popup window, enter the URL of the GitHub repository in the *Git Repository URL* field:
132132
+
133133
[source,text]
134134
----
@@ -141,16 +141,40 @@ https://github.com/redhat-developer-demos/openshift-ai.git
141141

142142
. Open the Python Notebook in the JupyterLab Interface.
143143
+
144-
The JupyterLab interface is presented after uploading `kaggle.json` and cloning the `openshift-ai``repository shown the file browser on the left with 'openshift-ai' and '.kaggle.json
144+
The JupyterLab interface is presented after uploading `kaggle.json` and cloning the `openshift-ai` repository shown the file browser on the left with `openshift-ai` and ``.kaggle.json`.`
145145

146-
. Open `Interactive_Image_Classification_Notebook.ipynb`` in the `openshift-ai` directory and run the notebook, The notebook contains all necessary instructions and is self-documented.
146+
. Open `Interactive_Image_Classification_Notebook.ipynb` in the `openshift-ai` directory and run the notebook, the notebook contains all necessary instructions and is self-documented.
147147

148148
. Run the cells in the Python Notebook as follows:
149149

150150
.. Start by executing each cell in order by pressing the play button or using the keyboard shortcut "Shift + Enter"
151151

152-
.. Once you run the cell in Step 4, you should see an output as shown in Figure 12 below.
152+
.. Once you run the cell in Step 4, you should see an output as shown in the following screenshot.
153+
+
154+
image::rhoai/predict-step4.png[Interactive Real-Time Data Streaming and Visualization]
155+
156+
.. Running the cell in Step 5, produces an output of two images, one of a cat and one of a dog, with their respective predictions labeled as "Cat" and "Dog".
157+
158+
.. Once the code in the cell is executed in Step 6, a predict button will appear as shown in screenshot below. The interactive session will display images with their predicted labels in real-time as the user clicks the "Predict" button. This dynamic interaction helps in understanding how well the model performs across a random set of images and provides insights into potential improvements for model training.
159+
+
160+
image::rhoai/predict.png[Interactive Real-Time Image Prediction with Widgets]
153161

154-
.. Running the cell in Step 5, produces an output of two images, one of a cat and one of a dog, with their respective predictions labeled as "Cat" and "Dog". as shown in Figure 14 below.
162+
## Addressing misclassification in your AI Model
163+
164+
Misclassification in machine learning models can significantly hinder your model's accuracy and reliability. To combat this, it's crucial to verify dataset balance, align preprocessing methods, and tweak model parameters. These steps are essential for ensuring that your model not only learns well, but also generalizes well, to new, unseen data.
165+
166+
. Adjust the Number of epochs to optimize training speed
167+
+
168+
Changing the number of *epochs* can help you find the sweet spot where your model learns enough to perform well without overfitting. This is crucial for building a robust model that performs consistently.
155169

156-
.. Once the code in the cell is executed in Step 6, a predict button will appear as shown in Figure 15 above. The interactive session will display images with their predicted labels in real-time as the user clicks the "Predict" button. This dynamic interaction helps in understanding how well the model performs across a random set of images and provides insights into potential improvements for model training.
170+
. Try different values for steps per epoch.
171+
+
172+
Modifying *steps_per_epoch* affects how many batches of samples are used in one epoch. This can influence the granularity of the model updates and can help in dealing with imbalanced datasets or overfitting.
173+
174+
For example make these modifications in your Notebook or another Python environment as part of *Step 3: Build and Train the Model*:
175+
176+
[source,text]
177+
----
178+
# Adjust the number of epochs and steps per epoch
179+
model.fit(train_generator, steps_per_epoch=100, epochs=10)
180+
----

modules/rhoai-deploying.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ The {validated-patterns-op} is successfully installed in the relevant namespace.
170170
To know the cluster group name for the patterns that you want to deploy, check the relevant pattern-specific requirements.
171171
. Expand the *Git Config* section to reveal the options and enter the required information.
172172
. Leave *In Cluster Git Server* unchanged.
173-
.. Change the *Target Repo* URL to your forked repository URL. For example, change `https://github.com/validatedpatterns/<pattern_name>` to `https://github.com/<your-git-username>/<pattern-name>`
173+
.. Change the *Target Repo* URL to your forked repository URL. For example, change https://github.com/validatedpatterns/<pattern_name> to https://github.com/<your-git-username>/<pattern-name>.
174174
.. Optional: You might need to change the *Target Revision* field. The default value is `HEAD`. However, you can also provide a value for a branch, tag, or commit that you want to deploy. For example, `v2.1`, `main`, or a branch that you created, `my-branch`.
175175
. Click *Create*.
176176
+
@@ -225,8 +225,6 @@ $ cp values-secret.yaml.template ~/values-secret-openshift-ai.yaml
225225
----
226226
====
227227

228-
The deployment will not take long but it should deploy successfully.
229-
230228
Alternatively you can deploy the OpenShift AI pattern by using the command line script `pattern.sh`.
231229

232230
[id="deploying-cluster-using-patternsh-file"]

0 commit comments

Comments
 (0)