Get weights for the skip layer in a neural network, only valid for networks created using skip = TRUE with the nnet function.

neuralskips(mod_in, ...)

# S3 method for nnet
neuralskips(mod_in, rel_rsc = NULL, ...)

Arguments

mod_in

input object for which an organized model list is desired.

...

arguments passed to other methods

rel_rsc

numeric indicating the scaling range for the width of connection weights in a neural interpretation diagram. Default is NULL for no rescaling. Scaling is relative to all weights, not just those in the primary network.

Value

Returns a list of connections for each output node, where each element of the list is the connection for each input node in sequential order to the respective output node. The first weight in each element is not the bias connection, unlike the results for neuralweights.

Details

This function is similar to neuralweights except only the skip layer weights are returned.

Examples


data(neuraldat)
set.seed(123)

## using nnet

library(nnet)

mod <- nnet(Y1 ~ X1 + X2 + X3, data = neuraldat, size = 5, linout = TRUE, 
 skip = TRUE)
#> # weights:  29
#> initial  value 2013.863122 
#> iter  10 value 0.826394
#> iter  20 value 0.014326
#> iter  30 value 0.000585
#> final  value 0.000082 
#> converged
 
neuralskips(mod)  
#> $`out 1`
#> [1] -0.07848376 -0.10607251  0.05082103
#>