neuralskips: Get weights for the skip layer in a neural network

Description Usage Arguments Details Value Examples

View source: R/NeuralNetTools_utils.R

Description

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

Usage

1
2
3
4
neuralskips(mod_in, ...)

## S3 method for class '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.

Details

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

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(neuraldat)
set.seed(123)

## using nnet

library(nnet)

mod <- nnet(Y1 ~ X1 + X2 + X3, data = neuraldat, size = 5, linout = TRUE, 
 skip = TRUE)
 
neuralskips(mod)  

NeuralNetTools documentation built on Jan. 6, 2022, 5:06 p.m.