Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mwalmsley/zoobot/llms.txt
Use this file to discover all available pages before exploring further.
FinetuneableZoobotTree adapts a pretrained Zoobot encoder to predict Galaxy Zoo-style vote count distributions across a morphology decision tree. It uses the Dirichlet-Multinomial loss introduced in the Galaxy Zoo DECaLS paper, which accounts for the variable number of volunteer responses per question due to conditional branching in the decision tree. Use this class when training on raw volunteer vote counts from a Galaxy Zoo campaign.
Quick Example
finetune_tree.py
Constructor Parameters
All parameters from FinetuneableZoobotAbstract are accepted. The following is specific to the tree model.Describes the layout of the decision tree: which questions exist, what answers each question has, and which answers lead to which follow-up questions. See the Schemas API reference for how to construct a
Schema object. Pre-built schemas for GZ DECaLS, GZ DESI, GZ2, and other campaigns are available via the galaxy-datasets package.How the Loss Works
The model predicts a Dirichlet concentration parameter for each answer in the decision tree. The Dirichlet-Multinomial loss then compares the predicted distribution of votes (given thatk volunteers were asked a question) to the actual observed vote counts. This naturally handles the fact that some questions receive many votes (asked early in the tree, of every volunteer) and others receive very few (asked late in the tree, of only a subset of volunteers).
Batch Format
batch_to_supervised_tuple extracts the image and all vote count columns from the batch:
schema.label_cols, with integer vote counts (use 0 for questions not asked, never NaN).
Metrics Logged
Unlike the classifier and regressor,FinetuneableZoobotTree logs only loss metrics because accuracy and RMSE are not meaningful for vote count distributions:
| Metric | Description |
|---|---|
finetuning/train_loss | Dirichlet-Multinomial loss on training set |
finetuning/val_loss | Dirichlet-Multinomial loss on validation set |
finetuning/test_loss | Loss on test set (when trainer.test() is called) |
When to Use This vs. FinetuneableZoobotClassifier
- Use FinetuneableZoobotTree when...
- Use FinetuneableZoobotClassifier when...
- You have raw volunteer vote counts from a Galaxy Zoo campaign
- You want to train on a full decision tree of morphology questions simultaneously
- You are creating a new Galaxy Zoo morphology catalog
- You want to replicate or extend GZ DECaLS / GZ DESI style predictions