View source: R/relevanceMaps.R
relevanceMaps | R Documentation |
Relevance maps are a representation of the influence of the predictor variables on the downscaling over
a particular gridpoint on a certain day. The relevance maps are obtained using
prediction difference analysis
on a trained deep model (see downscaleTrain.keras
).
relevanceMaps(
x,
obj,
C4R.template,
model,
outputCoords,
parch = c("channel", "variable", "all"),
k = 0,
l = 2,
num_samples = 10,
loss = NULL
)
x |
A grid (usually a multigrid) of predictor fields. |
obj |
The object as returned by |
C4R.template |
A climate4R grid that serves as template for the returned prediction object. |
model |
A keras sequential or functional model. |
outputCoords |
A matrix. The coordinates of the predictand(s) gridpoints for whom the prediction difference analysis is desired. Longitudes in the first column and latitudes in the second column. |
parch |
Possible values are c("all","variable","channel"). Indicates whether we want to marginalize the influence of a certain gridpoint as a whole ("all"), to isolate the influence per variable ("variable", i.e., for example to isolate the influence of the specific humidity at all levels: hus500,hus700,...) or of every channel (i.e., "channel") independently. |
k |
A numeric value. Defines the domain to marginalize around a particular feature with coordinates (i,j). Therefore the new domain has dimensions (i-k:i+k,j-k:j+k). If k=1, then a region of 3x3 is simultaneously marginalized at every step. |
l |
A numeric value. Defines the domain ((2l+1)x(2l+1)) used to infer the conditional multivariate gaussian distribution |
num_samples |
A numeric value. How many times do we sample from the multivariate gaussian distribution? |
loss |
Default to NULL. Otherwise a string indicating the loss function used to train the model. This is only relevant where we have used the 2 custom loss functions of this library: "gaussianLoss" or "bernouilliGammaLoss" |
This function relies on keras, which is a high-level neural networks API capable of running on top of tensorflow, CNTK or theano. There are official keras tutorials regarding how to build deep learning models. We suggest the user, especially the beginners, to consult these tutorials before using the downscaleR.keras package. Moreover, we encourage the reader to consult the prediction difference analysis technique employed which is published in this paper.
A climate 4R object containing the relevance maps as members. The attribute attr(out,"memberCoords") is added to the climate4R output object containing the coordinates in sequential order, such as the relevance map of the first member measures the influence on the first coordinate in attr(out,"memberCoords"). downscaleR.keras Wiki
J. Bano-Medina
Other downscaling.functions:
downscalePredict.keras()
,
downscaleTrain.keras()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.