Closed taunometsalu closed 6 years ago
If the output layer has more than 9 levels, the following row gives an error:
hid_out <- wts_in[[grep(paste('out', out_ind), names(wts_in))]][-1]
It finds both "out 1" and "out 10", grep gives output of length 2. It seems that simply taking the first occurence fixes the issue:
hid_out <- wts_in[[grep(paste('out', out_ind), names(wts_in))[1]]][-1]
Fixed d4d843d9e748d564c1e0982fd707b98872de1d1d
This is more explicit:
hid_out <- wts_in[[paste('out', out_ind)]][-1]
Not sure why I ever used grep for that.
If the output layer has more than 9 levels, the following row gives an error:
hid_out <- wts_in[[grep(paste('out', out_ind), names(wts_in))]][-1]
It finds both "out 1" and "out 10", grep gives output of length 2. It seems that simply taking the first occurence fixes the issue:
hid_out <- wts_in[[grep(paste('out', out_ind), names(wts_in))[1]]][-1]