Dpnet.emadl 1015 Bytes
Newer Older
Svetlana's avatar
Svetlana committed
1

2
package dp.subcomponents;
3

4
component Dpnet{
Svetlana's avatar
Svetlana committed
5
    ports in Z(0:255)^{3, 210, 280} data,
Svetlana's avatar
Svetlana committed
6
         out Q(-oo:oo)^{14} predictions;
7 8 9 10 11 12 13 14 15 16 17 18 19 20

    implementation CNN {

        def conv(kernel, channels, hasPool=true, convStride=(1,1)){
            Convolution(kernel=kernel, channels=channels, stride=convStride) ->
            Relu() ->
            Pooling(pool_type="max", kernel=(3,3), stride=(2,2), ?=hasPool)
        }
        def fc(){
            FullyConnected(units=4096) ->
            Relu() ->
            Dropout()
        }

Svetlana's avatar
Svetlana committed
21
        data ->
22 23 24 25 26 27
        conv(kernel=(11,11), channels=96, convStride=(4,4)) ->
        conv(kernel=(5,5), channels=256, convStride=(4,4)) ->
        conv(kernel=(3,3), channels=384, hasPool=false) ->
        conv(kernel=(3,3), channels=384, hasPool=false) ->
        conv(kernel=(3,3), channels=256) ->
        fc() ->
28
        fc() ->
Svetlana's avatar
Svetlana committed
29 30 31
        FullyConnected(units=256) ->
        Relu() ->
        Dropout() ->
32
        FullyConnected(units=14, no_bias=true) ->
33
        predictions
34 35
    }
}