Simulate null plots and predict the visual signal strength
Source:R/zzz_auto_visual_inference.R
AUTO_VI-cash-null_vss.RdThis function simulates null plots from the null hypothesis distribution, and predicts the visual signal strength.
Arguments
- draws
Integer. Number of simulation draws.
- fitted_model
Model. A model object, e.g.
lm.- keras_model
Keras model. A trained computer vision model.
- null_method
Function. A method to simulate residuals from the null hypothesis distribution. For
lm, the recommended method is residual rotationAUTO_VI$rotate_resid().- node_index
Integer. An index indicating which node of the output layer contains the visual signal strength. This is particularly useful when the keras model has more than one output nodes.
- keep_null_data
Boolean. Whether to keep the simulated null data.
- keep_null_plot
Boolean. Whether to keep the simulated null plots.
- extract_feature_from_layer
Character/Integer. A layer name or an integer layer index for extracting features from a layer.
Examples
keras_model <- try(get_keras_model("vss_phn_32"))
if (!inherits(keras_model, "try-error")) {
myvi <- auto_vi(lm(dist ~ speed, data = cars), keras_model)
myvi$null_vss()
}
#> ✔ Generate null data.
#> ✔ Generate null plots.
#> Computing auxiliary inputs ■■■■■■■■■■■■■■■ 45% | ETA: 1s
#> Computing auxiliary inputs ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 98% | ETA: 0s
#> Computing auxiliary inputs ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s
#> ✔ Compute auxilary inputs.
#> ✔ Predict visual signal strength for 100 images.
#> # A tibble: 100 × 1
#> vss
#> <dbl>
#> 1 1.35
#> 2 0.696
#> 3 0.672
#> 4 0.917
#> 5 1.19
#> 6 0.820
#> 7 1.40
#> 8 0.968
#> 9 0.805
#> 10 0.873
#> # ℹ 90 more rows