This repository provides MATLAB example codes used in the study "Visual category representations in the infant brain ("VCR_infant" in short)".
You can clone this repository to local using:
git clone https://github.com/siyingxie/VCR_infant.git
IMPORTANT: To run the examples, a LIBSVM toolbox is required. Please see the "Dependency" and "Installation" sections for details.
Here are six examples analyses in the study.
- Decode object categories in time (runtime: ~ 2 min)
example_decodingintime.m
- Decode object categories in time and frequency (runtime: ~ 5 min)
example_decodingtimefrequency.m
- Time generalization analysis (runtime: ~ 1 min)
example_decodingtimegeneralization.m
- Relate category representations in infants and adults (runtime: ~ 1 min)
example_rsatimegeneralization.m
- Relate oscillation-based category representations in infants and adults (runtime: ~ 1 min)
example_rsatimefrequency.m
- Relate category representations to computational models* (runtime: ~ 1 min)
example_rsatomodels.m
*Gabor filter model and VGG-19 deep neural network trained on object categorization
Resource/Software | Source/Identifier |
---|---|
Example data* | [https://osf.io/ruxfg] |
LIBSVM toolbox♰ | [https://github.com/cjlin1/libsvm; RRID: SCR_010243] |
* They will be automatically downloaded while running the examples (via setup.m
) if they have not already been downloaded.
♰ The toolbox needs to be downloaded and installed manually. (See "Installation" for details.)
The examples require LIBSVM (e.g., version-3.25) toolbox, and please add the toolbox as follows:
-
To clone the LIBSVM.git repository to the /code directory, please use:
cd VCR_infant/code git clone https://github.com/cjlin1/libsvm.git
-
If you are on Unix systems, you will need to compile the toolbox. Please refer to the steps in LIBSVM.readme.
A quick walk-through:
- On MATLAB command window, please type:
>> cd libsvm/matlab >> matlabroot % check your $MATLABROOT >> edit Makefile
- On MATLAB editor, please manually edit the "Makefile":
a) In line:3, change the "MATLABDIR ?= " to your $MATLABROOT b) save the "Makefile"
- Back to the MATLAB command window, please type:
>> make % it will take a few seconds to compile
For more details, please see LIBSVM.readme.
These customized functions are provided in the repository.
- averagetimepoints.m
- averagetrials.m
- correlatevectors.m
- covCor.m
- cvmvnn.m
- setup.m
- timefrexdecomp.m
- vectorizerdm.m
The expected outputs from the examples:
- example_decodingintime
- example_decodingtimefrequency
- example_decodingtimegeneralization
- example_rsatimegeneralization
- example_rsatimefrequency
- example_rsatomodels
Results for single participants:
- singlesubject_decodingintime (Related to Figure 1C)
- singlesubject_decodingtimegeneralization (Related to Figure 1G)
- singlesubject_rsatimegeneralization (Related to Figure 2B)
- singlesubject_decodingtimefrequency (Related to Figure 4B)
- singlesubject_rsatimefrequency (Related to Figure 4E)
Model RDMs details:
- visualise_modelRDMs (Related to Figure 3A)