Getting Started with Catlearn and Catlearn Supplementals
background
This post is intended to help people get started with their own cognitive modelling or machine learning projects in the catlearn environment with the help of catlearn.suppls, the Learning and Representation in Cognition Laboratory’s suite of helper functions for modeling in catlearn.
The motivation behind catlearn.suppls was to create a suite of functions that could be used to rapidly prototype new machine learning architectures that correspond to the cognitive modeling efforts of the LaRC Lab. This includes functions to set up the state information of a model and quickly take rectangular data and format it for the catlearn design pattern—the stateful list processor.
getting Started
If you haven’t already done so, download the catlearn and catlearn.suppls packages.
choosing some data and setting up the model
We’re going to use the classic iris dataset and DIVA (the DIVergent Autoencoder) for this demonstration. We need two objects to run a model in catlearn, the model’s state and the training matrix, which we will call tr.
First, we will construct the model’s state. For this demonstration we’ll set the hyper-parameters to values that we know—a priori—will play nice with our dataset. For real-world problems, you will likely want optimize these values (see future post on grid search and Bayesian optimization options with catlearn.suppls). Detailed description of model hyper-parameters is available in the normal places (e.g., ?slpDIVA).
We can then use catleanr.suppls to create our training matrix
Here’s what our training matrix looks like after the setup procedure:
Finally, we run the model with our state list st and training matrix tr
We can examine performance of the model easily.
plot_training is a simple function used to plot the learning of one or more models.
So with no optimization, we can see that DIVA learns about as much as it is going to learn after one pass through our 150 item training set (obviously absent any cross-validation). Where does it go wrong? You might like to examine which items are not being correctly classified—you can do so by combining the classification probabilities with the original training matrix.
You might also like to see how a number of initializations do on the problem. It’s good practice to average over a series of initializations—something we did not do in this demonstration.
Here we see that there is a fair amount of variation across initializations. This suggests it would be smart to follow the typical procedure of averaging across a series of models to accurately represent the response probabilities. It also suggests that our approach would likely benefit from some optimization and validation.
Future demos will explore the tools within catlearn.suppls used to optimize hyper-parameters and examine the hidden unit representation space toward the goal of uncovering new insight about the problem.