Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

nn_sequential

A sequential container


Description

A sequential container. Modules will be added to it in the order they are passed in the constructor. See examples.

Usage

nn_sequential(..., name = NULL)

Arguments

...

sequence of modules to be added

name

optional name for the generated module.

Examples

if (torch_is_installed()) {

model <- nn_sequential(
  nn_conv2d(1, 20, 5),
  nn_relu(),
  nn_conv2d(20, 64, 5),
  nn_relu()
)
input <- torch_randn(32, 1, 28, 28)
output <- model(input)

}

torch

Tensors and Neural Networks with 'GPU' Acceleration

v0.3.0
MIT + file LICENSE
Authors
Daniel Falbel [aut, cre, cph], Javier Luraschi [aut], Dmitriy Selivanov [ctb], Athos Damiani [ctb], Christophe Regouby [ctb], Krzysztof Joachimiak [ctb], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.