In [1]:
from tfs.models import LeNet
from tfs.dataset import Mnist
net = LeNet()
dataset = Mnist()
In [2]:
from tfs.core.optimizer import GradientDecentOptimizer
from tfs.core.regularizers import L1
net.optimizer = GradientDecentOptimizer(net)
net.regularizer = L1(net,l1=0.001)
net.build()
Out[2]:
In [3]:
net.fit(dataset,batch_size=200,n_epoch=1,max_step=100)
Out[3]:
In [4]:
net.save('lenet_epoch_1')
In [5]:
!ls ./
In [6]:
from tfs.network import Network
net2 = Network()
net2.load('lenet_epoch_1')
In [7]:
print net2
In [8]:
print net2.optimizer
In [9]:
print net2.initializer
In [10]:
print net2.losser
In [11]:
print 'accuracy',net2.score(dataset.test)
In [12]:
net2.fit(dataset,batch_size=200,n_epoch=1,max_step=100)
Out[12]:
In [13]:
net2.score(dataset.test)
Out[13]:
In [ ]: