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.
FinetuneableZoobotRegressor adapts a pretrained Zoobot encoder to predict continuous morphological measurements — bar strength, ellipticity, Sérsic index, merger probability as a fraction, or any other real-valued quantity. It attaches a single-output linear head to the encoder and trains with MSE or MAE loss. An optional sigmoid activation constrains predictions to the unit interval [0, 1].
Quick Example
finetune_regression.py
There is also a Google Colab notebook demonstrating regression with Zoobot: Open in Colab.
Constructor Parameters
All parameters from FinetuneableZoobotAbstract are accepted. The following are specific to the regressor.Name of the column in the batch dictionary containing the continuous target value. Must be a key in your catalog and listed in
label_cols passed to CatalogDataModule.Loss function to use during training. Options:
'mse'or'mean_squared_error'— mean squared error (L2 loss)'mae','mean_absolute_error','l1', or'l1_loss'— mean absolute error (L1 loss)
If
True, applies a sigmoid activation to the head output, constraining predictions to [0, 1]. Useful when predicting fractions, probabilities, or any quantity bounded between 0 and 1.Metrics Logged
| Metric | Description |
|---|---|
finetuning/train_loss | Loss on training set (MSE or MAE, per epoch) |
finetuning/val_loss | Loss on validation set (per epoch) |
finetuning/train_rmse | Root mean squared error on training set |
finetuning/val_rmse | Root mean squared error on validation set |
finetuning/test_rmse | RMSE on test set (when trainer.test() is called) |
Example with Fraction Prediction
For predicting a morphological fraction (e.g. the fraction of volunteers that called a galaxy a merger):fraction_regression.py