Modules used#
These are the Python modules used in the U-Net tutuorial.
Library imports#
We will be using the following libraries:
import numpy as np
: NumPy is a fundamental library for scientific computing in Python. It provides support for multidimensional arrays, matrices, and many fast mathematical operations tomanipulate these data structures. We use NumPy for array operations and data processing.import dask.array as da
: Dask is a parallel computing library that handles large datasets, and dask array allows parallel computation coordinating a collection of NumPy arrays, which greatly improves efficiency. We use Dask array for more efficient computation of larger data.import xarray as xr
: Xarray is designed for working with labeled multi-dimensional arrays, commonly used in scientific data analysis, particularly in fields like oceanography and climate science. It extends the capabilities of NumPy arrays by introducing labels of dimensions, coordinates, and attributes to the data. We use Xarray to create and manipulate datasets.import zarr
: Zarr is a cloud-based data format for chunked, compressed, N-dimensional arrays. The library allows efficient storage and access of large datasets. We use Zarr to store Xarray datasets in the easily accessible Zarr format.from os import path
: The OS library provides functions for interacting with the operating system, and the Path submodule is specifically useful in pathname manipulations. We use path to check whether a file or directory exists and avoid recomputations.import matplotlib.pyplot as plt
: Matplotlib is a powerful plotting library, and the pyplot module introduces a collection of functions that allows MATLAB-like plotting. We use pyplot to visualize our data and results.import tensorflow as tf
: Tensorflow is a machine learning framework for building and training deep learning neural network models. This library is the basis of building the U-Net model.from keras import Input
: Keras is a high-level neural networks API that runs on top of tensorflow. Input is a tensor-like object that defines the attributes of the input data, such as shape and datatype. We also use it to create models with a defined output usingtf.keras.Model()
.import keras.layers as layers
: The layers module provides various neural network layers, which are used for building the U-Net model.from keras.callbacks import EarlyStopping
: Earlystopping is a regularization technique that monitors the model’s performance during training and stops the training process when the model stops improving. We use earlystopping to improve efficiency and prevent overfitting.import cartopy.crs as ccrs
: This module provides classes and functions to define and manipulate different coordinate reference systems (CRS). We use ccrs to define map projections (PlateCarree, or the equirectangular projection or geographic projection) and transfer the coordinates when plotting results.import cartopy.feature as cfeature
: This module provides access to various geographical features like coastlines, borders, rivers, and landforms. These features can be added to maps to provide context or enhance the visualization. We use cfeature specifically for plotting coastlines during evaluation.