View source: R/visualization.R
| heatmaps_integrated_grad | R Documentation | 
Creates a heatmap from output of integrated_gradients function. The first row contains
the column-wise absolute sums of IG scores and the second row the sums. Rows 3 to 6 contain the IG scores for each
position and each nucleotide. The last row contains nucleotide information.
heatmaps_integrated_grad(integrated_grads, input_seq)
| integrated_grads | Matrix of integrated gradient scores (output of  | 
| input_seq | Input sequence for model. Should be the same as  | 
A list of heatmaps.
library(reticulate)
model <- create_model_lstm_cnn(layer_lstm = 8, layer_dense = 3, maxlen = 20, verbose = FALSE)
random_seq <- sample(0:3, 20, replace = TRUE)
input_seq <- array(keras::to_categorical(random_seq), dim = c(1, 20, 4))
ig <- integrated_gradients(
  input_seq = input_seq,
  target_class_idx = 3,
  model = model)
heatmaps_integrated_grad(integrated_grads = ig,
                         input_seq = input_seq)
 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.