Migrating from Pytorch

_

Plain Pytorch with fastai

library(fastai)
library(magrittr)

data = Data_Loaders(train_loader, test_loader)

nn = nn()
learn = Learner(data, Net(), loss_func = nn$functional$nll_loss, 
                opt_func = Adam(), metrics = accuracy, cbs = CudaCallback())

learn %>% fit_one_cycle(1, 1e-2)