Skip to content

Intempus-Inc/learnedSpectrum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learned Spectrum

Towards Temporal Understanding in AI through fMRI Learning Stage Classification.

Full project documention can be found on: https://teddywarner.org/Projects/LearnedSpectrum/

Usage

Prerequisites

  • Python 3.8+
  • CUDA-capable GPU (recommended)
  • Git

Installation

  1. Clone the repository:
git clone https://github.com/Twarner491/learnedSpectrum.git
cd learnedSpectrum
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows, use: venv\Scripts\activate
  1. Install the package in editable mode with all dependencies:
pip install -e .

Data Preparation

  1. Create necessary directories and download datasets (automated):
python scripts/download.py

This script will:

  • Create required directory structure
  • Download OpenFMRI datasets:
    • ds000002 - Classification Learning
    • ds000011 - Mixed-gambles Task
    • ds000017 - Classification Learning and Reversal
    • ds000052 - Classification Learning and Stop-signal
  • Extract datasets to the correct locations
  • Clean up temporary files

The resulting directory structure will be:

data/
├── raw/
│   ├── ds000002/
│   ├── ds000011/
│   ├── ds000017/
│   └── ds000052/
├── processed/
└── cleaned/

Options:

# Force redownload of datasets (if needed)
python scripts/download.py --force

Running the Analysis

  1. Start Jupyter:
jupyter notebook
  1. Navigate to notebooks/learnedSpectrum.ipynb

  2. Execute cells sequentially

Experiment Tracking

  1. (Optional) Set up Weights & Biases:
wandb login
  1. View training progress:
    • Real-time metrics at wandb.ai
    • Local visualizations in visualizations/
    • Training logs in models/checkpoints/

Troubleshooting

  1. CUDA/GPU Issues:
# Check GPU availability
import torch
print(f"CUDA available: {torch.cuda.is_available()}")
print(f"GPU device: {torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'None'}")
  1. Memory Issues:

    • Reduce BATCH_SIZE in config
    • Enable gradient accumulation
    • Use mixed precision training
  2. Data Loading Issues:

    • Verify dataset structure
    • Check preprocessing logs in data/processed/logs/
    • Ensure sufficient disk space

Copyright © 2024 Teddy Warner

This work may be reproduced, modified, distributed, performed, and displayed for any purpose, but must acknowledge Teddy Warner. Copyright is retained and must be preserved. The work is provided as is; no warranty is provided, and users accept all liability.


About

Towards Temporal Understanding in AI through fMRI Learning Stage Classification.

Resources

License

Stars

Watchers

Forks