if (torch_is_installed()) {
if (torch_is_installed()) {
x <- nn_sequential(
nn_relu(),
nn_tanh(),
nn_relu6(),
nn_relu(),
nn_linear(2,10),
nn_batch_norm1d(10),
nn_tanh(),
nn_linear(10,3)
)
prune <- nn_prune_head(x, 3)
prune
}
}
Run the code above in your browser using DataLab