### Running the Setup Script (Bash) Source: https://github.com/pico-lm/pico-analyze/blob/main/README.md Executes the setup.sh script, which handles environment checks, tool installation, and setting up the Poetry virtual environment for the project. This completes the installation process. ```bash source setup.sh ``` -------------------------------- ### Cloning the Pico Analyze Repository (Bash) Source: https://github.com/pico-lm/pico-analyze/blob/main/README.md Clones the pico-lm/pico-analyze repository from GitHub and changes the current directory to the newly cloned repository's root. This is the first step in the installation process. ```bash git clone https://github.com/pico-lm/pico-analyze cd pico-analyze ``` -------------------------------- ### Example Analysis Configuration (YAML) Source: https://github.com/pico-lm/pico-analyze/blob/main/README.md A sample YAML configuration file (configs/my_analysis_config.yaml) demonstrating how to specify analysis parameters. It defines which checkpoints (steps), metrics (CKA), components (simple), layers, and monitoring settings (output directory, Weights & Biases) to use for an analysis run. ```yaml analysis_name: "my_analysis" steps: - 0 - 1000 - 5000 metrics: - metric_name: cka data_split: "val" target_checkpoint: 5000 components: - component_name: simple data_type: "weights" layer_suffixes: "attention.o_proj" layers: [0, 1, 2] monitoring: output_dir: "analysis_results" save_to_wandb: true wandb: entity: "pico-lm" project: "pico-analysis" ``` -------------------------------- ### Configuring Environment Tokens (Bash) Source: https://github.com/pico-lm/pico-analyze/blob/main/README.md Example content for a .env file used to set environment variables for Hugging Face and Weights & Biases API keys. These tokens are required for accessing models and logging results. ```bash export HF_TOKEN=your_huggingface_token export WANDB_API_KEY=your_wandb_key ``` -------------------------------- ### Running the Analysis Command (Bash) Source: https://github.com/pico-lm/pico-analyze/blob/main/README.md Command line instruction using Poetry to execute the analyze script. It takes the path to the analysis configuration file, the Hugging Face repository ID, and the branch/revision as arguments to start the analysis process. ```bash poetry run analyze \ --config_path configs/my_analysis_config.yaml \ --repo_id pico-lm/pico-decoder-small \ --branch pico-decoder-small-1 ``` -------------------------------- ### BibTeX Citation for Pico Analyze Source: https://github.com/pico-lm/pico-analyze/blob/main/README.md BibTeX entry for citing the Pico project in academic or professional work, as recommended by the authors. ```bibtex @software{pico2025, author = {Diehl Martinez, Richard}, title = {Pico: A Lightweight Framework for Studying Language Model Learning Dynamics}, year = {2025}, url = {https://github.com/pico-lm} } ``` -------------------------------- ### Registering a Custom Metric (Python) Source: https://github.com/pico-lm/pico-analyze/blob/main/README.md Demonstrates the basic structure for creating and registering a custom metric class in Python. The class should inherit from BaseMetric and be decorated with @register_metric("your_metric_name") to be recognized by Pico Analyze. ```python # src/metrics/custom.py @register_metric("my_custom_metric") class MyCustomMetric(BaseMetric): ... ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.