Lightning disentangles PyTorch code to decouple the science from the engineering.
library(fastai)
library(magrittr)
= LitModel()
model
= Data_Loaders(model$train_dataloader(), model$val_dataloader())$cuda()
data
= nn()
nn = Learner(data, model, loss_func = nn$functional$cross_entropy, opt_func = Adam,
learn metrics = accuracy)
%>% fit_one_cycle(1, 0.001) learn
epoch train_loss valid_loss accuracy time
0 0.354146 0.334655 0.911300 00:09