Heads#
Info
Heads are linear layers or MLPs that are applied on top of the decoder and produce the final output.
Parameters like in_channels and num_classes are normally selected by the model factories and do not need to be defined manually.
terratorch.models.heads.regression_head.RegressionHead
#
Bases: Module
Regression head
Source code in terratorch/models/heads/regression_head.py
__init__(in_channels, num_outputs=1, final_act=None, learned_upscale_layers=0, channel_list=None, batch_norm=True, dropout=0)
#
Constructor
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
in_channels
|
int
|
Number of input channels |
required |
num_outputs
|
int
|
Number of predicted regression variables. Defaults to single regression. |
1
|
final_act
|
Module | None
|
Final activation to be applied. Defaults to None. |
None
|
learned_upscale_layers
|
int
|
Number of Pixelshuffle layers to create. Each upscales 2x. Defaults to 0. |
0
|
channel_list
|
list[int] | None
|
List with number of channels for each Conv layer to be created. Defaults to None. |
None
|
batch_norm
|
bool
|
Whether to apply batch norm. Defaults to True. |
True
|
dropout
|
float
|
Dropout value to apply. Defaults to 0. |
0
|
Source code in terratorch/models/heads/regression_head.py
terratorch.models.heads.segmentation_head.SegmentationHead
#
Bases: Module
Segmentation head
Source code in terratorch/models/heads/segmentation_head.py
__init__(in_channels, num_classes, channel_list=None, dropout=0)
#
Constructor
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
in_channels
|
int
|
Number of input channels |
required |
num_classes
|
int
|
Number of output classes |
required |
channel_list
|
list[int] | None
|
List with number of channels for each Conv layer to be created. Defaults to None. |
None
|
dropout
|
float
|
Dropout value to apply. Defaults to 0. |
0
|