All due date/times are given in Central Time (US). Please make sure you translate appropriately for your locale.
Items listed with due dates are to be turned in on my.wartburg (see link at top of this page). For most assignments you will be uploading one or more files.
On the page for the assignment on my.wartburg, you will see two buttons: "upload," and "turn in." You may upload multiple files and freely add/delete to the list of files you have uploaded. However, once you click "turn in," your uploads will be frozen, and you will not be able to make further modifications.
If you have uploaded files but have not yet clicked on "turn in," your files will automatically be turned in for you when the assignment is due. For maximum flexibility, I suggest uploading file(s) for an assignment as soon as it is done, but NOT selecting "turn in." That way you have something submitted (which will eventually get turned in automatically), but you still have the ability to go in and make updates right up until the time that the assignment is due.
Homework answers can be submitted as electronic documents; PDF is prefered, but MS Office formats (.docx), and plain text (.txt) are fine. You can also write answers on paper and submit a picture file. Any standard image format is fine (PDF, jpg, png, gif, etc). Using an app like "camScanner" and collecting multiple pages into a single PDF document is strongly encouraged.
For Projects, you should always submit the code (module) file. This will be a plain text file containing the program code. For security reasons, my.wartburg does not allow direct submission of files containing program code. You will have to "zip" your files in order to upload them. You should be able to do this on your computer by right-clicking on the file and selecting some sort of "compress" option. If you need help, see these instructions for Windows 10 and MacOS . The file that you actually upload will have a ".zip" extension.
More information on this later.
This is just a reminder that our first class session on 8/26 will be via Zoom. The link for our Zoom session was in an email I sent out early this week. You can also find it under Zoom Sessions on my.wartburg.
In order to split the class into groups, I also need a little bit of information from you. If you have not already completed the initial survey, please so so ASAP. It will take about 30 seconds (really). The survey is available here.
Read Chapter 1 of "Thinking as Computation." Be prepared to discuss:
Pay special attention to "tracing" the back-chaining algorithm for the examples that use Figure 2.1. You should be able to "recreate" the example traces from the book. For example, produce a trace of the query "P is a father of john" just using the knowledge base in figure 2.1 and the back-chaining algorithm depicted in figure 2.2.
I'll be asking you to do examples like this in class on Wed. Don't forget our Weds. classes are Zoom only.
Exercises 3, 4, and 5 at the end of TaC Chapter 2. You will turn these in electronically, but I suggest you just use pencil and paper to "work" the problems. You can take a picture to turn in your work. Click the "Show General Information" button at the top of this page for guidance on submitting your homework.
You can find a link to swi-prolog at the top of this page. Appendix B of TaC has some help to get you started.
We've swapped rooms with another class. We will be meeting in SC 345 for the remainder of the term.
As I mentioned in class on Friday (9/4), I am considering moving changing Wednesday classes to also be hybrid in-class/Zoom. Please fill out this short survey.
I've posted a link for a share movie KB under coursework on my.wartburg. Please see the instructions there.
I sent an email this morning (9/8) on plans for Wednesday classes. Quick summary: weds. will also be hybrid. Come to class tomorrow if you wish to partipate in-class on wednesdays.
I also outlined some Zooming suggestions/policies, so please read the email carefully.
Get the movies.pl file from our handouts folder and use it to do Exercises 1--10 (starting on page 61). You should document both your queries, and the results that you get.
Then invent 3 more questions that could be asked of this KB and write queries for them. Show there results that you get from the queries. The more "inventive" the question, the better.
You are to write a KB that describes relationships in an extended family. Specifically, implement all of the predicates described in Exercises 1--10 at the end of Chapter 4.
It's useful to have a set of facts for an extended family tree to test and debug your KB as you go along. I have posted a file, royals.pl, in our handouts folder that includes background facts for the recen British royal family. You can use data by simply consulting into a session along with your family_rules. If you prefer, you could test with family data of your own devising.
?- [royals]. true. ?- [family_rules]. true. ?- sibling(charles, X). X = anne true.
Notes: I used 'parent' as a primitive rather than 'child'. I have included a rule for child in the royals data, so that should be transparent to your program usage (i.e. take both 'parent' and 'child' as given). You should start your family_rules with the definitions for the 'father' and 'grand_father' predicates shown in Chapter 3. Finally, DO NOT include the facts for the royal family (or your own test family) in your family_rules.pl file. You should just include the predicates described in the exercises (plus father and grand_father).
This is your first programming "project" for the class. Normal standards for such projects such as correctness, style, and readability apply.
The exam will be posted on my.wartburg before class time on 9/21. You will have 70 minutes from the time that you open the assignment to the time that you turn in your work. It is up to you to monitor that time to make sure that you do not go over. You must submit your answers within 70 minutes of opening the exam. The usual file formats and ways of turning your work in apply. It might be a good idea to upload files as you go along instead of waiting to the very end.
I will be in our normal class Zoom session on Monday. If you choose to take the exam at that time, you can Zoom in should you need any clarifications on the exam. You may also choose to do it at a time that is more convenient for you. But again, you must complete it in the alloted 70 minutes.
Here are the instructions on the exam. I'm posting them here so that you can read them BEFORE clicking on the exam to start your 70 minute clock.
The exam is open-book, open-note, open-class-websites. You may also make use of SWI-Prolog and its documentation. You are NOT allowed to work with anyone or consult resources external to our class. You are reminded of your obligation to the Wartburg Honor Code. Knights do the right thing.
You must submit your work as file uploads on my.wartburg under the "Exam 1" assignment. As with homework, PDF is the preferred file type. You can use an app like camScanner on your mobile to turn written work into a PDF. For some of the questions, you may wish to turn in a Prolog program as a ".pl" file (you can either zip it or rename to .txt to upload it). Feel free to upload your answers as you go along. When you are all finished, make sure you go back in and double check that your files were uploaded and click the "final submission" button.
There is a 70 minute time limit for the exam. This means all work must be submitted no later than 70 minutes after you first clicked on the assignment. If you are not finished at the 70 minute mark, submit whatever work you have done. The deadline for completion of the exam is 11:55 pm.
I've posted your exam scores/feedback files on my.wartburg. There will be a "second chance" option discussed in class tomorrow, so don't worry too much about your initial score/grade.
Using the feedback I gave from Exam 1, redo the exam. I will average your scores.
Make enahncements to shrink.pl to overcome the following shortcomings:
The output appears as a list of atoms. You should rewrite write_list to produce a simple sentence of text as output.
The program is predictable. The table of responses is given by the response predicate. Currently, pick_response just "grabs" the first pattern that matches. You should modify this behavior to find all possible responses and then pick one at random. If there is no matching pattern, then you should pick one of the punt responses (again, randomly). To complete the new pick_response you might make use of the SWI-prolog built-ins: findall, random, and nth0. Consult the SWI documentation to learn about these predicates.
You should use a similar technique to change getWword so that it chooses at random from among the possible wWords.
Some of the responses are not very good. The response table includes entries that "spitback" part of the original sentence. For example, "i sometimes feel depressed" spits back "i sometimes feel depressed". It should modify the sentence to change occurrences of "i" into "you", "my" into "your" etc. Then it would respond with "you sometimes feel depressed"-- which sounds more analytic. You should modify spitback to do the appropriate changes. Some words to consider changing are: "i", "me", "you", "my", "your", "yours", "mine", "am".
Some patterns have only a single response. This means that the program can be backed into saying the same thing over and over. Try adding some novel patterns to response to overcome this repitition. The sky's the limit here. The more and better patterns you add, the more realistic the conversation will be.
You will hand in your updated program code along with a "transcript" of a conversation with your program that demonstrates what it can do. One way of capturing this dialog is to use the built-in predicate, protocol.
The Chapter 8 exercises are posted under our handouts link above. This was mostly done in-class, and I am not collecting/grading it.
The project description is in search_proj.pdf. The starter code is here.
The exam is posted under Coursework on my.wartburg.
This is a "lab day" to work on your projects.
This is a "lab day" to finish work on Exam 2.
Finish up the simple Perceptron class that we worked on in class be adding the code implementing the training algorithm using the perceptron learning rule.
To test your learner, you will need to "invent" some data for it to train on. I would suggest creating simple Boolean function classification data where each example is a vector of Boolean attributes (using 1.0, -1,0) and the correct labels are assigned via a rule of Boolean algebra. For example, if the input vector is size 4, there are 2**4 = 16 distinct inputs. You could pick a "correct" labeling using a Boolean formula such as "X[0] and not X[4]" (e.g. animal and not duck). And then see whether your perceptron can learn the concept (properly classify all the examples).
You will turn in your code and a very short report showing evidence that your perceptron can learn.
I figured out the SNAFU in class today. Tensorflow is only compatible with 64-bit versions of Python. While I had Python 3.8 installed on my virtual machine, it was a 32-bit version. I now have it successfully installed. Here are the steps I did:
Uninstalled Python 3.8 (Through the settings/Apps/uninstall)
Installed Python 3.8 using the 64-bit installer from Python.org. Note: Python 3.9 is now available, but I don't think a Tensorflow package is available for 3.9 yet. Play it safe by getting Python 3.8. Make sure when installing Python to check the box to add Python to your environment variables or PATH.
pip installed tensorflow. At a command line: python -m pip install tensorflow
Installed Visual Studio Code (see note below).
When using the Tensorflow package, I got errors because I did not have the Microsoft Visual C++ run-time libraries that were needed. You may or may not not have this issue. I fixed this problem by installing the 64-bit version of Microsoft Visual Studio Code (see https://code.visualstudio.com/). This is a nice code editor that is worth checking out anyway, and it installs the necessary C++ run-time packages.
Starting with one of the examples in Chapter 3, do some simple experiements and see what effect they have on the training and performance of the network. Section 3.5.8 suggests some ideas. You may do something different. For example, you might experiment with batch_size on the boston housing data.
Write up a little report that describes the experiements you did and what you learned given the results. This doesn't have to be anything earth-shattering, just some evidence that you did enough experimenting to reach some sort of conclusion about whatever you tried.