Skip to contents

Deep (stacked) RNN forward pass, bottom-up per time step (hmdrnn)

Usage

morie_geron_deep_rnn(
  X,
  hidden_sizes = 4,
  n_layers = NULL,
  weights = NULL,
  seed = 0,
  activation = "tanh"
)

Arguments

X

Input sequence (T, d).

hidden_sizes

Width(s) per layer.

n_layers

Optional repeat count.

weights

Optional list of (Wx, Wh, b) triples.

seed

LCG seed.

activation

"tanh"/"relu".

Value

List with outputs, states, final_states, layer_sizes, n_params, state_norms.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_deep_rnn(V)
#> $outputs
#> $outputs[[1]]
#> [1] -0.7231837 -0.6452206  0.8029629  0.5237606
#> 
#> $outputs[[2]]
#> [1] -0.8729399 -0.8882050  0.8582650  0.7033403
#> 
#> $outputs[[3]]
#> [1] -0.9736079 -0.9788004  0.9769558  0.8776618
#> 
#> $outputs[[4]]
#> [1] -0.9947125 -0.9954971  0.9965273  0.9588968
#> 
#> $outputs[[5]]
#> [1] -0.9990832 -0.9990659  0.9995916  0.9871970
#> 
#> $outputs[[6]]
#> [1] -0.9998492 -0.9998019  0.9999546  0.9960179
#> 
#> $outputs[[7]]
#> [1] -0.9999756 -0.9999575  0.9999950  0.9987580
#> 
#> $outputs[[8]]
#> [1] -0.9999961 -0.9999909  0.9999995  0.9996121
#> 
#> 
#> $states
#> $states[[1]]
#> $states[[1]][[1]]
#> [1] -0.7231837 -0.6452206  0.8029629  0.5237606
#> 
#> $states[[1]][[2]]
#> [1] -0.8729399 -0.8882050  0.8582650  0.7033403
#> 
#> $states[[1]][[3]]
#> [1] -0.9736079 -0.9788004  0.9769558  0.8776618
#> 
#> $states[[1]][[4]]
#> [1] -0.9947125 -0.9954971  0.9965273  0.9588968
#> 
#> $states[[1]][[5]]
#> [1] -0.9990832 -0.9990659  0.9995916  0.9871970
#> 
#> $states[[1]][[6]]
#> [1] -0.9998492 -0.9998019  0.9999546  0.9960179
#> 
#> $states[[1]][[7]]
#> [1] -0.9999756 -0.9999575  0.9999950  0.9987580
#> 
#> $states[[1]][[8]]
#> [1] -0.9999961 -0.9999909  0.9999995  0.9996121
#> 
#> 
#> 
#> $final_states
#> $final_states[[1]]
#> [1] -0.9999961 -0.9999909  0.9999995  0.9996121
#> 
#> 
#> $layer_sizes
#> [1] 4
#> 
#> $n_layers
#> [1] 1
#> 
#> $n_params
#> [1] 24
#> 
#> $state_norms
#> $state_norms[[1]]
#> [1] 1.363224 1.668004 1.905438 1.973073 1.992496 1.997815 1.999343 1.999799
#> 
#> 
#> $activation
#> [1] "tanh"
#> 
#> $estimate
#> [1] -0.01219972
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "stacked RNN forward pass, bottom-up per time step"
#>