tests/testthat/helper-keras.R

keras_test_model <- function() {
  tensorflow::set_random_seed(42)

  nn <- keras::keras_model_sequential()
  nn <- keras::layer_dense(nn, units = 2, activation = "tanh", input_shape = 2)
  nn <- keras::layer_dense(nn, units = 3, activation = "softplus")
  nn <- keras::layer_dense(nn, units = 2, activation = "linear")

  nn
}

Try the nn2poly package in your browser

Any scripts or data that you put into this service are public.

nn2poly documentation built on May 29, 2024, 5:08 a.m.