DeepSensor design#
Some users will find it useful to understand the design of DeepSensor before they begin. Others would prefer to just see some examples and get started right away.
If you fall into the latter category, feel free to jump straight to the next page (DataProcessor).
Design overview#
A schematic overview of the core components of DeepSensor is shown below. This shows how the package’s components process data & interact from end-to-end.

The key classes are:
DataProcessor: Mapsxarrayandpandasdata from their native units to a normalised and standardised format (and vice versa).TaskLoader: Slices and samples normalisedxarrayandpandasdata to generateTaskobjects for training and inference.Task: Container for context and target data. Subclass ofdictwith additional methods for processing and summarising the data.DeepSensorModel: Base class for DeepSensor models, implementing a high-level.predictmethod for predicting straight toxarray/pandasin original coordinates and units.ConvNP: Convolutional neural process (ConvNP) model class (subclass ofDeepSensorModel). Uses theneuralprocesseslibrary. This is currently the only model provided by DeepSensor.Trainer: Class for training onTaskobjects using backpropagation and the Adam optimiser.AcquisitionFunction: Base class for active learning acquisition functions.GreedyAlgorithm: Greedy search algorithm for active learning.
In addition, a deepsensor.plot module provides useful plotting functions for
visualising:
Taskcontext and target sets,DeepSensorModelpredictions,ConvNPinternals (encoding and feature maps),GreedyAlgorithmactive learning outputs.
You will see examples of these deepsensor.plot visualisation functions
throughout the documentation.
Design principles#
A few key design principles have guided the development of DeepSensor:
User-friendly interface: The interface should be simple and intuitive, with the flexibility to handle a wide range of use cases.
Leverage powerful and ubiquitous data science libraries: Users can stay within the familiar
xarray/pandasecosystem from start to finish in their DeepSensor research workflows.Infer sensible defaults: DeepSensor should leverage information in the data to infer sensible defaults for hyperparameters, with the option to override these defaults if desired.
Extensible: Extend DeepSensor with new models by sub-classing
DeepSensorModeland implementing the low-level prediction methods ofProbabilisticModel.Modular: The
DataProcessorandTaskLoaderclasses can be used independently of the downstream modelling and active learning components, and can thus be used outside of a DeepSensor workflow.Deep learning library agnostic: DeepSensor is compatible with both TensorFlow and PyTorch thanks to the
backendslibrary - simplyimport deepsensor.tensorfloworimport deepsensor.torch.