-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9821e8
commit ec06b89
Showing
8 changed files
with
210,966 additions
and
210 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "27845fff-e102-416e-a5d7-1949a33fc3ac", | ||
"metadata": {}, | ||
"source": [ | ||
"### Implementations of the TRACE model\n", | ||
"\n", | ||
"The Magnuson & Crinnion chapter introduces the TRACE model. In this lab, we are going to use a new simulator we are developing in my lab. It is a little bit buggy still, but mostly works very well. \n", | ||
"\n", | ||
"The original TRACE model was written in the programming language C. This was a great choice back in the mid 1980s. C was the most used programming language (it passed Pascal and Fortran in 1985), and remained the most used programming language until 2001, when Java became more widely used. (Java then was the most used language until 2019 when it was passed by javascript, which was shortly passed by Python; see https://www.youtube.com/watch?v=qQXXI5QFUfw). \n", | ||
"\n", | ||
"C is fast, but also pretty complicated. McClelland and Elman made their original C code freely available, but almost no one used it because you really had to be a good programmer to use it. This led to a weird situation where there were many papers where people speculated about what TRACE would do if they tried to simulate their experiment -- *but they did not acutally run any simulations.* And people were wrong a lot! This is a really important thing about modeling. We may have really plausible, logical expectations about what the model *should* do, but a model does not have to be very complex before it surprises us. (If you are interested in some examples, see: Magnuson, J. S., Mirman, D., & Harris, H. D. (2012). Computational models of spoken word recognition. In M. Spivey, K. McRae, & M. Joanisse (Eds.), The Cambridge Handbook of Psycholinguistics, pp. 76-103. Cambridge University Press. [https://magnuson.psy.uconn.edu/wp-content/uploads/sites/1140/2015/01/Magnuson-Mirman-Harris-2012.pdf]). \n", | ||
"\n", | ||
"So back in the early 2000s, I set out to create a new implementation of TRACE in Java. Java was a huge deal back then, because it was the first programming language that strove to be platform independent. With minimal adjustment, Java programs could be run in operating systems ranging from DOS to Windows to OSX to Linux -- and more. That version (jTRACE, for java TRACE) is still available and works great. You can access it here (**but you do not need to even look at this for this lab!**): \n", | ||
"\n", | ||
"https://magnuson.psy.uconn.edu/jtrace/\n", | ||
"\n", | ||
"There was one huge flaw in the Java version. Often, you want to be able to do *batch simulations*. For example, you might want to run a simulation with every word in your lexicon. Or you might want to do that, but with many different parameter settings. We were working on a system for doing this, but we ran out of money, and we were unable to finish it. \n", | ||
"\n", | ||
"However, 3 years ago, I had funding I could use to revisit this. Rather than trying to further improve jTRACE, I decided to port it to javascript. javascript is related to java, but has a ton of Python-like capability. It's much more flexible. I hired a programmer, and it's now 98% done. It has not been released yet, but I'm going to share the preview version with you. A thing that is amazing about doing this in javascript is that we do not have to create our own mini-language or graphical interface for batch scripting. Instead, you just import the libraries and write an actual javascript. \n", | ||
"\n", | ||
"Now we could set things up to run in jupyter, because we can install a javascript kernel, and the latest version of TRACE is in javascript. However, you would have to install a lot of things on your machine, and one of the beauties of developing in javascript is we can easily host an installation that anyone on the internet can use. " | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "4bf86b6a-e74b-4c3e-84a1-7efb2ec3ad8c", | ||
"metadata": {}, | ||
"source": [ | ||
"### jsTRACE\n", | ||
"\n", | ||
"You can run the preview version just by going to this link:\n", | ||
"\n", | ||
"https://andrew0.github.io/tracejs/\n", | ||
"\n", | ||
"This repository now includes a notebook that is just the (draft) manual for jsTRACE (jstrace-user-interface.ipynb). Reading the whole manual would be super boring. However, please read the sections *Introduction* and *A brief overview of TRACE*. You can search the manual for other questions. We will also go through the simulator in class. \n", | ||
"\n", | ||
"**Bugs**. If you discover bugs, please tell me about them. Here are some current ones.\n", | ||
"\n", | ||
"- Jitter -- sometimes the browswer window will jitter like crazy. Resize it (a little smaller or bigger) until that stops. \n", | ||
"\n", | ||
"- Simulation tab fonts and rectangle widths. When you run a simulation animation and click 'Visualize word/phoneme activations' the fonts are stretched out strangely, and the rectangles do not perfectly match temporal alignment yet. Also, the activations in the Chart tab are correct; they are inflated (by about 0.05) in the simulation tab. \n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "988f877f-4d9d-49de-8d6e-a7f7283cdc1b", | ||
"metadata": {}, | ||
"source": [ | ||
"### Lab report\n", | ||
"\n", | ||
"1. Explore the interface. At the top of the screen, you will see 'tabs' for Config, Simulation, Chart and Data. Within Config, you have subtabs Parameters, Phonology, and Lexicon. Follow the instructions in the `jstrace-user-interface.ipynb` notebook under 'Quick start' to run a simulation and generate a chart. Paste in a screenshot of the chart from your computer (do not paste in the image from the manual!).\n", | ||
"\n", | ||
"2. On the chart tab, click 'Max (Post-Hoc)' in the Alignment calculation section, and then click Refresh Chart. (If the chart does not refresh, adjust the size of your browser window -- just click and drag to make slightly larger or smaller; this normally refreshses the chart if the button does not do it.) Paste in a screenshot of the new chart. Describe what is different. Do you understand why they are different? Refer to the section around Figure 4 in the manual for an explanation of the 'tiled' slice representations in TRACE. \n", | ||
"\n", | ||
"3. Replot your chart with Content set to Response probabilities (click on Activations to see that option). Insert a screenshot. Describe what you observe. Do you understand what is happening in this plot (simple yes or no is fine)?\n", | ||
"\n", | ||
"4. Set Content back to Activations, and switch Analyze to Phonemes. Insert a screenshot. What do you observe? What happens when you choose Specified Alignment vs. Max post-hoc? \n", | ||
"\n", | ||
"5. Compare to the Bayesian model we used previously. What are some aspects of SWR (spoken word recognition) that TRACE includes that were missing from our Bayesian model? What are some aspects of SWR that the Bayesian model could address that (this version of) TRACE cannot? \n", | ||
"\n", | ||
"6. **Challenge question**: refer to your Bayesian SWR homework and find some words you tested there. Can you test them in TRACE? TRACE only has about 200 words in its lexicon in this simulator, and it only has 14 of the 39 phonemes of English -- so it may be difficult to find specific words. However, consider the issues / concerns you had about the words you tested in the Bayesian model. Does TRACE seem to do better or worse when you consider those issues?\n", | ||
"\n", | ||
"\n", | ||
"\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "da727825-a115-4bca-9ce7-d3e786d7da14", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.2" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.