Extra Model Structures#
            terratorch.models.model.Model
#
    
              Bases: ABC, Module
Source code in terratorch/models/model.py
                
            terratorch.models.model.AuxiliaryHead
  
      dataclass
  
#
    Class containing all information to create auxiliary heads.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                name
             | 
            
                  str
             | 
            
               Name of the head. Should match the name given to the auxiliary loss.  | 
            required | 
                decoder
             | 
            
                  str
             | 
            
               Name of the decoder class to be used.  | 
            required | 
                decoder_args
             | 
            
                  dict | None
             | 
            
               parameters to be passed to the decoder constructor.
Parameters for the decoder should be prefixed with   | 
            required | 
Source code in terratorch/models/model.py
                
            terratorch.models.model.ModelOutput
  
      dataclass
  
#
    
            terratorch.registry.registry.MultiSourceRegistry
#
    
              Bases: Mapping[str, T], Generic[T]
Registry that searches in multiple sources
Correct functioning of this class depends on registries raising a KeyError when the model is not found.
Source code in terratorch/registry/registry.py
                42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131  |  | 
            register_source(prefix, registry)
#
    Register a source in the registry
            terratorch.registry.registry.Registry
#
    
              Bases: Set
Registry holding model constructors and multiple additional sources.
This registry behaves as a set of strings, which are model names, to model classes or functions which instantiate model classes.
In addition, it can instantiate models with the build method.
Add constructors to the registry by annotating them with @registry.register.
>>> registry = Registry()
>>> @registry.register
... def model(*args, **kwargs):
...     return object()
>>> "model" in registry
True
>>> model_instance = registry.build("model")
Source code in terratorch/registry/registry.py
                
            build(name, *constructor_args, **constructor_kwargs)
#
    Build and return the component. Use prefixes ending with _ to forward to a specific source
Source code in terratorch/registry/registry.py
              
            register(constructor)
#
    Register a component in the registry. Used as a decorator.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
                constructor
             | 
            
                  Callable | type
             | 
            
               Function or class to be decorated with @register.  | 
            required |