PyTorch framework for Deep Learning research and development. It focuses on reproducibility, rapid experimentation, and codebase reuse so you can create something new rather than write another regular train loop. Break the cycle - use the Catalyst!
Specify loaders from catalyst dict:
library(fastai)
library(magrittr)
= loaders()
loaders
= Data_Loaders(loaders['train'], loaders['valid'])$cuda()
data
= nn()
nn = nn$Sequential() +
model $Flatten() +
nn$Linear(28L * 28L, 10L) nn
Output:
Sequential(
(0): Flatten()
(1): Linear(in_features=784, out_features=10, bias=True)
)
= list(accuracy,top_k_accuracy)
metrics = Learner(data, model, loss_func = nn$functional$cross_entropy, opt_func = Adam,
learn metrics = metrics)
%>% fit_one_cycle(1, 0.02) learn
epoch train_loss valid_loss accuracy top_k_accuracy time
0 0.269411 0.336529 0.910200 0.993700 00:08