This guide explains how to visualize and analyze results from DynVision experiments, helping you understand the temporal dynamics and response properties of your models.
DynVision provides several visualization tools to analyze model behavior, particularly focusing on temporal dynamics and response properties that reflect biological neural systems. Key visualizations include:
- Response Time Courses: Neural activity over time
- Weight Distributions: Model parameter distributions
- Classifier Responses: Classification behavior over time
- Adaptation Analysis: Neural adaptation to repeated stimuli
- Contrast Response: Response properties to varying contrast levels
- Duration Response: Response properties to varying stimulus durations
- Interval Response: Response properties to varying interstimulus intervals
DynVision's visualization system is integrated into the Snakemake workflow:
dynvision/workflow/
└── snake_visualizations.smk # Contains visualization rules
Visualizations are typically generated automatically when running experiments:
# Run experiment and generate visualizations
snakemake experiment --config experiment=contrastResults are saved in the reports directory:
reports/
└── figures/
├── contrast/ # Experiment-specific visualizations
├── weight_distributions/ # Weight analysis
└── classifier_response/ # Classifier behavior
To generate all visualizations for completed experiments:
snakemake plot_experiments_on_modelsTo generate visualizations for a specific experiment:
# Generate contrast response visualizations
snakemake --config experiment=contrast plot_adaptionTo compare different models on the same experiment:
# Compare different recurrence types
snakemake --config experiment=contrast model_args="{rctype:[full,self,depthpointwise,pointdepthwise]}" plot_experiments_on_modelsThese visualizations show the evolution of neural activity over time in response to a stimulus.
Key Features to Look For:
- Response Onset: When neural activity begins to increase
- Peak Time: When activity reaches its maximum
- Response Duration: How long activity persists
- Adaptation: Whether activity decreases with sustained stimulation
Example:
In the example figure above, we can observe:
- The V1 layer responds first, followed by V2, V4, and IT layers
- Higher layers show progressively longer response latencies
- Full recurrence (blue) shows stronger adaptation than self recurrence (orange)
Generation Command:
snakemake --config experiment=response plot_adaptionThese visualizations show the distribution of weights in different parts of the model.
Key Features to Look For:
- Distribution Shape: Whether weights follow a Gaussian-like distribution
- Magnitude: The range of weight values
- Layer Differences: How weight distributions differ across layers
- Recurrence Weights: Differences between feedforward and recurrent weights
Example:
In the example figure above, we can observe:
- Feedforward weights (top row) show broader distributions than recurrent weights (bottom row)
- Higher layers (right) have slightly larger weight magnitudes than lower layers (left)
- The model has learned sparse connectivity patterns in recurrent connections
Generation Command:
snakemake plot_weight_distributions --config model_name=DyRCNNx4 model_args="{rctype:full}"These visualizations show how neural activity changes with stimulus contrast.
Key Features to Look For:
- Response Magnitude: How activity increases with contrast
- Response Speed: Whether high-contrast stimuli elicit faster responses
- Layer Differences: How contrast sensitivity differs across layers
- Recurrence Effects: How different recurrence types affect contrast sensitivity
Example:
In the example figure above, we can observe:
- Response magnitude increases with contrast in all layers
- Higher layers (V4, IT) show stronger contrast dependence than lower layers (V1, V2)
- Full recurrence (blue) shows stronger contrast response than self recurrence (orange)
- High-contrast stimuli elicit responses with shorter latencies
Generation Command:
snakemake --config experiment=contrast plot_adaptionThese visualizations show how neural activity changes with stimulus duration.
Key Features to Look For:
- Temporal Summation: How activity accumulates with longer stimuli
- Saturation: Whether responses saturate with long stimuli (subadditive temporal summation)
- Offset Response: Whether there's a response when the stimulus ends
- Layer Differences: How temporal integration differs across layers
Example:
In the example figure above, we can observe:
- Response magnitude increases with stimulus duration but saturates (subadditive temporal summation)
- Higher layers (V4, IT) show stronger saturation than lower layers (V1, V2)
- Full recurrence (blue) shows stronger sustained activity than self recurrence (orange)
- V1 layer shows an offset response when the stimulus ends
Generation Command:
snakemake --config experiment=duration plot_adaptionThese visualizations show how neural activity responds to repeated stimuli with varying intervals.
Key Features to Look For:
- Repetition Suppression: Whether the second response is weaker than the first
- Recovery: How the second response recovers with longer intervals
- Layer Differences: How adaptation differs across layers
- Recurrence Effects: How different recurrence types affect adaptation
Example:
In the example figure above, we can observe:
- The response to the second stimulus is weaker than the first (repetition suppression)
- Longer intervals lead to stronger recovery of the second response
- Higher layers (V4, IT) show stronger adaptation than lower layers (V1, V2)
- Full recurrence (blue) shows stronger adaptation effects than self recurrence (orange)
Generation Command:
snakemake --config experiment=interval plot_adaptionYou can also create custom visualizations in Python:
import torch
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from dynvision.mode



