Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions data/helios/mapbiomas/dense_config/model.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
model:
class_path: rslearn.train.lightning_module.RslearnLightningModule
init_args:
model:
class_path: rslearn.models.multitask.MultiTaskModel
init_args:
encoder:
- class_path: rslearn.models.olmoearth_pretrain.model.OlmoEarth
init_args:
model_id: OLMOEARTH_V1_1_BASE
patch_size: 3
decoders:
segment:
- class_path: rslearn.models.upsample.Upsample
init_args:
scale_factor: 3
- class_path: rslearn.models.conv.Conv
init_args:
in_channels: 768
out_channels: 28
kernel_size: 1
activation:
class_path: torch.nn.Identity
- class_path: rslearn.train.tasks.segmentation.SegmentationHead
lr: 0.0001
scheduler:
class_path: rslearn.train.scheduler.PlateauScheduler
init_args:
factor: 0.2
patience: 2
min_lr: 0
cooldown: 10
data:
class_path: rslearn.train.data_module.RslearnDataModule
init_args:
path: /weka/dfive-default/rslearn-eai/datasets/mapbiomas_3k
inputs:
sentinel2_l2a:
data_type: "raster"
layers: ["sentinel2_l2a_feb", "sentinel2_l2a_may", "sentinel2_l2a_aug", "sentinel2_l2a_nov"]
bands: ["B02", "B03", "B04", "B08", "B05", "B06", "B07", "B8A", "B11", "B12", "B01", "B09"]
passthrough: true
dtype: FLOAT32
load_all_layers: true
targets:
data_type: "raster"
layers: ["label_raster"]
bands: ["label"]
dtype: INT32
is_target: true
task:
class_path: rslearn.train.tasks.multi_task.MultiTask
init_args:
tasks:
segment:
class_path: rslearn.train.tasks.segmentation.SegmentationTask
init_args:
num_classes: 28
class_id_mapping:
3: 1
4: 2
5: 3
6: 4
9: 5
11: 6
12: 7
15: 8
20: 9
21: 10
23: 11
24: 12
25: 13
29: 14
30: 15
32: 16
33: 17
35: 18
39: 19
40: 20
41: 21
46: 22
47: 23
48: 24
49: 25
50: 26
62: 27
nodata_value: 0
enable_f1_metric: true
metric_kwargs:
average: "macro"
input_mapping:
segment:
targets: "targets"
batch_size: 32
num_workers: 16
default_config:
transforms:
- class_path: rslearn.models.olmoearth_pretrain.norm.OlmoEarthNormalize
init_args:
band_names:
sentinel2_l2a: ["B02", "B03", "B04", "B08", "B05", "B06", "B07", "B8A", "B11", "B12", "B01", "B09"]
train_config:
groups: ["mapbiomas_dense_raster"]
tags:
split: "train"
val_config:
groups: ["mapbiomas_dense_raster"]
tags:
split: "val"
test_config:
groups: ["mapbiomas_dense_raster"]
tags:
split: "val"
trainer:
max_epochs: 50
callbacks:
- class_path: lightning.pytorch.callbacks.LearningRateMonitor
init_args:
logging_interval: "epoch"
- class_path: rslearn.train.callbacks.checkpointing.ManagedBestLastCheckpoint
init_args:
monitor: val_segment/F1
mode: max
- class_path: rslearn.train.callbacks.freeze_unfreeze.FreezeUnfreeze
init_args:
module_selector: ["model", "encoder", 0]
unfreeze_at_epoch: 50
unfreeze_lr_factor: 10
management_dir: ${RSLP_PREFIX}/projects
project_name: 20260605_mapbiomas_dense
run_name: placeholder
118 changes: 118 additions & 0 deletions data/helios/mapbiomas/sparse_config/model.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
model:
class_path: rslearn.train.lightning_module.RslearnLightningModule
init_args:
model:
class_path: rslearn.models.multitask.MultiTaskModel
init_args:
encoder:
- class_path: rslearn.models.olmoearth_pretrain.model.OlmoEarth
init_args:
model_id: OLMOEARTH_V1_1_BASE
patch_size: 3
decoders:
segment:
- class_path: rslearn.models.conv.Conv
init_args:
in_channels: 768
out_channels: 12
kernel_size: 1
activation:
class_path: torch.nn.Identity
- class_path: rslearn.train.tasks.segmentation.SegmentationHead
lr: 0.0001
scheduler:
class_path: rslearn.train.scheduler.PlateauScheduler
init_args:
factor: 0.2
patience: 2
min_lr: 0
cooldown: 10
data:
class_path: rslearn.train.data_module.RslearnDataModule
init_args:
path: /weka/dfive-default/rslearn-eai/datasets/mapbiomas_3k
inputs:
sentinel2_l2a:
data_type: "raster"
layers: ["sentinel2_l2a_feb", "sentinel2_l2a_may", "sentinel2_l2a_aug", "sentinel2_l2a_nov"]
bands: ["B02", "B03", "B04", "B08", "B05", "B06", "B07", "B8A", "B11", "B12", "B01", "B09"]
passthrough: true
dtype: FLOAT32
load_all_layers: true
targets:
data_type: "raster"
layers: ["label_raster"]
bands: ["label"]
dtype: INT32
is_target: true
task:
class_path: rslearn.train.tasks.multi_task.MultiTask
init_args:
tasks:
segment:
class_path: rslearn.train.tasks.segmentation.SegmentationTask
init_args:
num_classes: 12
class_id_mapping:
3: 1
4: 2
9: 3
11: 4
12: 5
15: 6
19: 7
20: 8
24: 9
33: 10
36: 11
nodata_value: 0
enable_f1_metric: true
metric_kwargs:
average: "macro"
input_mapping:
segment:
targets: "targets"
batch_size: 32
num_workers: 16
default_config:
crop_size: 48
transforms:
- class_path: rslearn.models.olmoearth_pretrain.norm.OlmoEarthNormalize
init_args:
band_names:
sentinel2_l2a: ["B02", "B03", "B04", "B08", "B05", "B06", "B07", "B8A", "B11", "B12", "B01", "B09"]
- class_path: rslearn.train.transforms.resize.Resize
init_args:
target_size: [16, 16]
selectors: ["target/segment/classes", "target/segment/valid"]
interpolation: "nearest"
train_config:
groups: ["mapbiomas_expert_sparse"]
tags:
split: "train"
val_config:
groups: ["mapbiomas_expert_sparse"]
tags:
split: "val"
test_config:
groups: ["mapbiomas_expert_sparse"]
tags:
split: "val"
trainer:
max_epochs: 50
callbacks:
- class_path: lightning.pytorch.callbacks.LearningRateMonitor
init_args:
logging_interval: "epoch"
- class_path: rslearn.train.callbacks.checkpointing.ManagedBestLastCheckpoint
init_args:
monitor: val_segment/F1
mode: max
- class_path: rslearn.train.callbacks.freeze_unfreeze.FreezeUnfreeze
init_args:
module_selector: ["model", "encoder", 0]
unfreeze_at_epoch: 50
unfreeze_lr_factor: 10
management_dir: ${RSLP_PREFIX}/projects
project_name: 20260605_mapbiomas
run_name: placeholder
Loading
Loading