VGG16.emadl 720 Bytes
Newer Older
eyuhar's avatar
eyuhar committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
package cNNCalculator;

component VGG16{
    ports in Z(0:255)^{1, 28, 28} image,
         out Q(0:1)^{10} predictions;

         implementation CNN {

             def conv(filter, channels){
                 Convolution(kernel=(filter,filter), channels=channels) ->
                 Relu()
             }
             def fc(){
                 FullyConnected(units=100) ->
                 Relu() ->
                 Dropout(p=0.5)
             }

             image ->
             conv(filter=2, channels=64, ->=2) ->
             Pooling(pool_type="max", kernel=(2,2), stride=(1,1)) ->
             fc() ->
             FullyConnected(units=10) ->
             Softmax() ->
             predictions
         }
  }