%matplotlib inline
%reload_ext autoreload
%autoreload 2
from fastai.learner import *
from fastai.dataset import *
X = np.array([[0.,0.], [0,1], [1,0], [1,1]])
y = np.array([0,1,1,0])
data = (X,y)
md = ImageClassifierData.from_arrays('.', data, data, bs=4)
learn = Learner.from_model_data(SimpleNet([2, 10, 2]), md)
learn.crit = nn.CrossEntropyLoss()
learn.opt_fn = optim.SGD
learn.fit(1., 30, metrics=[accuracy])
Failed to display Jupyter Widget of type HBox
.
If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.
If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.
epoch trn_loss val_loss accuracy 0 0.703408 0.686116 0.5 1 0.694675 0.680413 0.5 2 0.689824 0.672467 0.5 3 0.685353 0.6662 0.75 4 0.681366 0.656064 0.75 5 0.676933 0.645323 0.75 6 0.672139 0.634129 0.75 7 0.667045 0.614466 1.0 8 0.66072 0.59939 0.75 9 0.654014 0.579936 0.75 10 0.646579 0.552088 1.0 11 0.637801 0.547516 0.75 12 0.629983 0.531916 1.0 13 0.622022 0.483599 0.75 14 0.611432 0.464332 1.0 15 0.600781 0.439199 1.0 16 0.589663 0.439463 1.0 17 0.57981 0.3815 1.0 18 0.567367 0.345051 1.0 19 0.553991 0.324375 1.0 20 0.540708 0.295096 1.0 21 0.527019 0.266743 1.0 22 0.513012 0.237544 1.0 23 0.498673 0.230024 1.0 24 0.485123 0.199286 1.0 25 0.471132 0.196474 1.0 26 0.458067 0.200001 1.0 27 0.44612 0.152343 1.0 28 0.432868 0.143447 1.0 29 0.420133 0.126178 1.0
[0.12617818, 1.0]