Assignment 1: Image Classifier Tutorial#143
Merged
Merged
Conversation
1. Worked in the rst file to put a site with tutorial 2. Added New Species such as flamingos and eagles to tutorial 3. Added some comments for full visualization of table to tutorial
ColtonPayne
requested changes
Apr 27, 2026
| @@ -0,0 +1,337 @@ | |||
| Image Classifier to PyReason Tutorial | |||
Collaborator
There was a problem hiding this comment.
Add the tutorial to index.rst so it shows up in the docs.
Contributor
Author
There was a problem hiding this comment.
I added the following line at the index.rst
./image_classifier_reasoning.rst
I must admit, for some reason it is not showing up when going to the other tutorial pages, but it does appear in the general one.
| This produces explanations for which rule fired, on which node/edge, and why. | ||
|
|
||
|
|
||
| Expected Output (Full Run + Analysis) |
Collaborator
There was a problem hiding this comment.
Don't show the full classifier output here - highlight the important steps for each image.
Contributor
Author
| Fixed Point iterations: 3 | ||
| NODE RULE TRACE: | ||
|
|
||
| Time Fixed-Point-Operation Node Label Old Bound New Bound Occurred Due To Consistent Triggered By Inconsistency Message Clause-1 |
Collaborator
There was a problem hiding this comment.
Instead of just pasting the full trace, highlight key groundings from each timestep and explain why they were grounded.
Contributor
Author
| NODE RULE TRACE: | ||
|
|
||
| Time Fixed-Point-Operation Node Label Old Bound New Bound Occurred Due To Consistent Triggered By Inconsistency Message Clause-1 | ||
| 0 0 0 fish_1 goldfish [0.0,1.0] [1.0,1.0] fish_1-goldfish-fact True Fact None |
Collaborator
Contributor
Author
There was a problem hiding this comment.
Csv files have been created based on a run.
1. Improved reading documentation 2. Divided the output more effectively 3. Created Csv Files with output 4. Added the tutorial to the index
1. Removed additional traces 2. Added images of expected output 3. Added source of LLM into tutorial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Changes
examples/image_classifier_ex.py— standalone example scriptdocs/source/tutorials/image_classifier_reasoning.rst— tutorial documentation pageexamples/images/— sample images for flamingos and eaglesSummary
Builds an image-classification reasoning example with fish, sharks, flamingos, and eagles.
Uses a pretrained ViT model to classify local images, converts predictions into PyReason facts, and runs rule-based inference to derive:
is_fish,is_shark,is_flamingo,is_eagle,is_birdcan_flyfromis_birdlikes_to_eatedges (shark/flamingo -> fish)Also includes a full tutorial page explaining the pipeline (image -> classifier -> facts -> reasoning -> output), expected terminal output, and warnings about using only labels that exist in the model.
Terminal Output