---
title: "Migrating from Pytorch"
output:
rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Migrating from Pytorch}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE,eval = FALSE,echo = T)
```
## Plain Pytorch with fastai
```{r }
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)
```