Skip to content

Commit ad4d70e

Browse files
committed
📝 Update docs and add training information
1 parent 219e01a commit ad4d70e

6 files changed

Lines changed: 72 additions & 11 deletions

File tree

docs/src/how-to/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# How-to guides
2+
3+
Step-by-step guides for common tasks.
4+
5+
- [Add a new model](add-a-model.md) - implement a custom architecture
6+
- [Train a model](train.md) - run single-stage end-to-end training
7+
- [Train in stages](train-multistage.md) - pretrain each component separately before finetuning

docs/src/how-to/train-multistage.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
# Train in stages
1+
# Run multistage training
22

3-
Staged training is an alternative to end-to-end training for `EncodeProcessDecode` models.
3+
Multistage training is an alternative to [normal training](./train.md) for `EncodeProcessDecode` models.
44
Instead of training the full model in one pass, each component is trained in isolation before the weights are loaded into the full model for a final finetuning step.
55
This can be useful when the model is large, when encoder inputs have very different characteristics, or when you want finer control over the training of individual components.
66

77
## The four stages
88

9-
**Stage 1 Train encoders**
9+
**Stage 1 - Train encoders**
1010

1111
Each encoder is trained independently as a standalone autoencoder (encoder + disposable decoder). One training run per encoder.
1212

1313
![Stage 1 diagram](../assets/staged-training-stage1.png)
1414

15-
**Stage 2 Train decoder**
15+
**Stage 2 - Train decoder**
1616

1717
The decoder is trained on the combined frozen encoder latents from stage 1.
1818

1919
![Stage 2 diagram](../assets/staged-training-stage2.png)
2020

21-
**Stage 3 Train processor**
21+
**Stage 3 - Train processor**
2222

2323
The processor is trained with frozen encoders and decoder from stages 1–2.
2424

2525
![Stage 3 diagram](../assets/staged-training-stage3.png)
2626

27-
**Stage 4 Finetune**
27+
**Stage 4 - Finetune**
2828

2929
Pretrained weights are loaded into the full `EncodeProcessDecode` model and the entire model is trained end-to-end.
3030

@@ -36,7 +36,7 @@ Pretrained weights are loaded into the full `EncodeProcessDecode` model and the
3636
uv run imp train --multistage
3737
```
3838

39-
A checkpoint is saved at the end of each stage. To resume a partially completed run, pass `--checkpoint-dir` pointing at the checkpoint directory from the original run any stage whose checkpoint already exists there will be skipped:
39+
A checkpoint is saved at the end of each stage. To resume a partially completed run, pass `--checkpoint-dir` pointing at the checkpoint directory from the original run - any stage whose checkpoint already exists there will be skipped:
4040

4141
```bash
4242
uv run imp train --multistage --checkpoint-dir ${BASE_DIR}/training/wandb/run-<date>-<id>/checkpoints

docs/src/how-to/train.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Train a model
2+
3+
Single-stage training trains the full model end-to-end in one pass.
4+
It is the default and works for all model architectures.
5+
6+
```bash
7+
uv run imp train
8+
```
9+
10+
## Prerequisites
11+
12+
You will need a [Weights & Biases account](https://docs.wandb.ai/models/quickstart).
13+
Generate an API key, then authenticate before running any training command:
14+
15+
```bash
16+
export WANDB_API_KEY=<your_api_key>
17+
wandb login
18+
```
19+
20+
## Configuring training
21+
22+
Training is controlled by the `train` section of your config.
23+
The most commonly adjusted settings are:
24+
25+
```yaml
26+
train:
27+
optimizer:
28+
lr: 1e-3
29+
weight_decay: 1e-4
30+
scheduler:
31+
T_max: 20
32+
eta_min: 1e-5
33+
trainer:
34+
max_epochs: 20
35+
accelerator: auto
36+
```
37+
38+
## Checkpoints
39+
40+
A checkpoint is saved after each epoch to:
41+
42+
```
43+
${BASE_DIR}/training/wandb/run-<date>-<id>/checkpoints/
44+
```
45+
46+
where `BASE_DIR` is the `base_path` defined in your local config.
47+
Pass this path to `evaluate` to assess the trained model.
48+
49+
## Multistage training
50+
51+
For `EncodeProcessDecode` models, components can be pretrained in isolation before a final finetuning step.
52+
See [Run multistage training](train-multistage.md) for details.

docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ It performs multi-modal data fusion across satellite, sensor and post-processed
55

66
## Getting started
77

8-
- [User Guide](user-guide/index.md) installation, configuration, and the `imp` CLI
9-
- [API Reference](api/index.md) every public module, class, and function
8+
- [User Guide](user-guide/index.md) - installation, configuration, and the `imp` CLI
9+
- [API Reference](api/index.md) - every public module, class, and function
1010

1111
## Quick install
1212

docs/src/user-guide/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# User Guide
22

3-
This guide covers everything you need to get IceNet-MP running from installing the package to training a model and visualising results.
3+
This guide covers everything you need to get IceNet-MP running - from installing the package to training a model and visualising results.

zensical.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ nav = [
1515
{ "Commands" = "user-guide/commands.md" },
1616
] },
1717
{ "How-to" = [
18+
{ "Overview" = "how-to/index.md" },
1819
{ "Add a model" = "how-to/add-a-model.md" },
19-
{ "Train in stages" = "how-to/train-in-stages.md" },
20+
{ "Train a model" = "how-to/train.md" },
21+
{ "Run multistage training" = "how-to/train-multistage.md" },
2022
] },
2123
{ "API Reference" = [
2224
{ "Overview" = "api/index.md" },

0 commit comments

Comments
 (0)