# \donttest{
if (torch::torch_is_installed()) {
# Formula interface (original)
model_reg = ffnn(
Sepal.Length ~ .,
data = iris[, 1:4],
hidden_neurons = c(64, 32),
activations = "relu",
epochs = 50
)
# XY interface (new)
model_xy = ffnn(
hidden_neurons = c(64, 32),
activations = "relu",
epochs = 50,
x = iris[, 2:4],
y = iris$Sepal.Length
)
}
# }
# \donttest{
if (torch::torch_is_installed()) {
# Formula interface (original)
model_rnn = rnn(
Sepal.Length ~ .,
data = iris[, 1:4],
hidden_neurons = c(64, 32),
rnn_type = "lstm",
activations = "relu",
epochs = 50
)
# XY interface (new)
model_xy = rnn(
hidden_neurons = c(64, 32),
rnn_type = "gru",
epochs = 50,
x = iris[, 2:4],
y = iris$Sepal.Length
)
}
# }
Run the code above in your browser using DataLab