Esempio n. 1
0
 def __init__(self):
     self.network = layers.SequentialLayer([
         layers.LinearLayer(28 * 28, 1000),
         layers.ReLULayer(),
         layers.LinearLayer(1000, 100),
         layers.ReLULayer(),
         layers.LinearLayer(100, 10),
     ])
     loss_layer = losses.SoftmaxCrossEntropyLossLayer(parent=self.network)
     super(MNISTNetwork, self).__init__(loss_layer)
Esempio n. 2
0
 def __init__(self):
     self.layers = layers.SequentialLayer([
         layers.ConvLayer(1, 6, 5),
         layers.MaxPoolLayer(2, 2),
         layers.ReLULayer(),
         layers.ConvLayer(6, 16, 5),
         layers.MaxPoolLayer(2, 2),
         layers.ReLULayer(),
         layers.FlattenLayer(),
         layers.LinearLayer(16 * 7 * 7, 120),
         layers.ReLULayer(),
         # layers.LinearLayer(120, 84),
         # layers.ReLULayer(),
         layers.LinearLayer(120, 10),
     ])
     loss_layer = losses.SoftmaxCrossEntropyLossLayer(parent=self.layers)
     super(MNISTNetwork, self).__init__(loss_layer)